Skip to content

feat(session): re-land the Jev confidence-gated middle layer (#1311) - #1528

Open
aarontrowbridge wants to merge 7 commits into
mainfrom
amico/1311-reland
Open

aarontrowbridge wants to merge 7 commits into
mainfrom
amico/1311-reland

Conversation

@aarontrowbridge

Copy link
Copy Markdown
Member

Closes #1311 — re-land of closed-as-stale-base #1339 (which superseded nothing functionally: same 6-commit slice, replayed fresh off current main per the #1465 slice doctrine).

What

  • Thin Jev client (amico-run): server-side key posture ($AMICO_TYPESAFE_KEY_FILE → amico secrets path ~/.amico/typesafe/key), one JSON decision-record receipt per call (primitive, verdict, confidence, latency, model version) in the shared receipts journal. Confirmed wire contract, verified live against the vendor API on the preserved branch (state top-level; questions = type + instructions + criteria; choice criteria = option→rubric map).
  • Classifier residual: sessions the deterministic classifier leaves unclassified get one choice call (closed buckets + unclassified option); junk-bucket p ≥ 0.95 AND age ≥ 48 h admits to the S2 archive path as an OR with the untouched deterministic junk rule. Fail-open on any client failure/low confidence.
  • Onset thread-Noul: a pass verb computes per-candidate thread-Nouls into a derived ops-dir map; the digest reads the map as its third input feature (the S3 sibling-of-prStateFor pattern — the caller decides when to spend a network call). ≥ 0.5 promotes + ranks; absent map → the feat(agent): derived open-thread digest in the onset context #1305 digest byte-for-byte. The bucket label stays deterministically derived.
  • Calibration battery: the 2026-09-20 sweep recorded as a fixture + an opt-in live harness (agreement, Noul spread, Brier per primitive). Director-verified live on the preserved branch: 6/6 bucket + action agreement, choice Brier 0.0, noul Brier 0.0145 (amico-run 1754/0 (+46), open_threads 58/58 — record from feat(session): Jev confidence-gated middle layer (classifier residual + onset thread-Noul) #1339).
  • Off-switch: AMICO_JEV_DISABLED=1 disables the path with zero behavioral delta; the bundle test harness injects it by default to stay hermetic.

Re-land notes

  • All 6 commits of amico/1301-s5-jev-middle cherry-picked onto current main (244e6a9c): zero conflicts; amicode_context.ts auto-merged keeping BOTH fixes (main's Harmoniqs transport applyHarmoniqsHeaders + the branch's thread-Noul wiring — both verified present).
  • No test deleted, skipped, or weakened in the replay.

Verification (this re-land, from package dirs only)

Baseline honesty: the closed PR's "1754/0" was against the Sep-20 base; current main carries environment-dependent pre-existing failures, so a clean origin/main baseline worktree was run side-by-side.

  • bun test in packages/amico-run: 1744 pass / 10 skip / 10 fail across 106 files — the 10 fails are the identical test set (byte-for-byte, timing aside) as a clean origin/main baseline run: 1698 pass / 9 skip / 10 fail across 102 files. Delta vs baseline: +46 pass, +4 files, +1 skip, failure set unchanged — none of the fails touch the Jev/sessions surface (they are: amico cloud unreachable-endpoint ×2, curlSotaFetch transport ×4, loadRegistry seed bootstrap, parseDoctorArgs, reviewSpec no-real-model-calls guard, gh shim recursion guard).
  • bun test test/jev_client.test.ts test/jev_curation.test.ts test/jev_calibration.test.ts test/sessions_verb.test.ts test/s31.test.ts in packages/amico-run: 77 pass / 0 fail across 5 files.
  • bun typecheck in packages/amico-run: 0 errors (tsc --noEmit clean).
  • bun typecheck in packages/extension: 0 errors (tsc --noEmit clean).
  • bun test test/open_threads.test.ts in packages/extension: 57 pass / 1 fail across 58 tests (baseline: 47 pass / 1 fail across 48) — +10 new tests, all passing; the 1 fail ("returns null when bun:sqlite is unavailable (Node runtime)") is the identical pre-existing origin/main failure, same class as the documented pre-existing extension set on the feat(amico-run): the strategy-brief renderer — living-sota slice 6 finally lands (portfolio fold, health stamps, one renderer two paths) #1310 re-land.
  • Purity: the deterministic classifier/archiver happy paths contain no Jev call (residual-only; module-level purity guard green in the suite).
  • Security: the real key appears nowhere in the diff (grep-verified); tests use injected temp key-file paths.

Notes

@aarontrowbridge
aarontrowbridge marked this pull request as draft September 24, 2026 06:12
@coderabbitai

coderabbitai Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: e66153a7-3b0b-49e5-bc91-d9cd332d6f32


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(sessions): Jev confidence-gated middle layer (classifier residual + onset thread-Noul)

1 participant