Repository navigation
feat(protocol)!: add the per-session Jev mode switcher (ADR-0042) - #166
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
Protocol 29 adds set_jev_mode / jev_mode_set on /v1/sessions/jev-mode and the optional SessionSummary.jev_mode (low | medium | high | max | ultrajev, absent to clear). The value is opaque on the wire; the composition root maps each rung onto jev_routing / jev_review / approval_delegate when the next run is claimed, so an active run keeps its compiled plan. The regular model switcher (set_session_model / set_session_effort) is unchanged and remains the provider-neutral model and reasoning-effort control. Store schema 37 adds the nullable sessions.jev_mode column; the command writes it and appends session_updated in one transaction before publishing. Children inherit the parent's pin; a child's resolved routing/checkpoint selection still wins over it. A rung never widens Jev consent or the approval ceiling and fails closed without a Jev credential. ApprovalDelegateSetting gains by_mode so the ladder can name the default explicitly. Verification: cargo test --workspace, fmt --check, clippy -D warnings, cargo test -p qq-provider --no-default-features --features test-support. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
|
this is good, i want to keep it open until we do more thorough testing with jev and got the implementation in a place where jev is actually able to provide value. currently jev is failing almost 70% of the approval delegations and routes. i will take a look and add another PR addressing. |
|
Incorporated by replacement in merged #181, main 2103aa5. Independent exact-source review accounted for the full #166/#170 stack (107 paths), including versioned wire-fixture moves, ADR numbering, session persistence and TUI behavior. Retained integration c5a5836 includes exact #170 as its second parent and this head beneath it; the reviewed replacement tree is now main. This PR itself is closed, not described as merged. Original head 83455ec and branch are retained. Review report SHA256 c84c39eb2f75aa066e68517f83dee144fb565989b20b2142702ebe6d947cd0dd. No unique output was discarded; live runtime/release qualification remains separate. |
What changes for users
Every session gains a second switcher beside the model/effort one: a Jev mode with five rungs
low | medium | high | max | ultrajev(or none, to clear).set_jev_mode { session_id, mode? }onPOST /v1/sessions/jev-mode, outcomejev_mode_set, and the optionalSessionSummary.jev_modeon everysession_updated/ snapshot, so web, desktop, mobile, and the TUI all read the same state from theqq-clientreducer (SessionClient::set_jev_mode).set_session_model/set_session_effort, TUI/models//effort, and the existing HTTP routes already are the provider-neutral model and reasoning-effort controls, so no duplicateSetModelwas added.approval_delegate(config /QQ_APPROVAL_DELEGATE) now also acceptsby_mode, naming the default explicitly.The TUI
/jevpicker lands in the stacked follow-up PR.Why / design
ADR-0042 (
docs/adr/0042-session-model-and-jev-mode-switchers.md). Key decisions:TypeSafe's public Jev API exposes no effort/mode request parameter (one versioned model, typed decisions). Rather than invent one,
JevModeis a QQ-local ladder over the three existing Jev roles already composed at the root: task routing, checkpoint review (off | final | enforce), and approval delegate (off | by_mode | on). The protocol value is opaque; onlysrc/runtime.rsknows the table:lowmediumhighmaxultrajevThis exact table is a founder decision flagged in the ADR; changing it touches only
jev_mode_rung.Precedence: configured/profile < session
jev_mode< explicit inherited routing/checkpoint selections (a child's resolved policy still wins). A rung never widens Jev consent or the approval mode's ceiling, and fails closed (RuntimeLoadError::Configuration) when notypesafe-jevcredential is stored — exactly likejev_routing: true.Persistence follows the existing
approval_delegatepattern:UPDATE sessions … ; load summary; append session_updatedin one transaction, publish after commit.ClaimedRun.jev_mode→RuntimeLoadRequest.jev_mode→ loader overrides.No new
qq-providerJev adapter: the existingTypeSafeTaskRouter/TypeSafeCheckpointReviewer/JevApprovalRevieweralready implement the roles through core traits (qq feat(runtime): enforce JEV checkpoints and add effort transport #72/feat(runtime): make Jev review opt-in and account for bounded assessments #74). The Anthropic-efforts PRs (feat(provider)!: add model-specific efforts and Anthropic discovery #154–feat(provider)!: preserve Anthropic thinking for Opus 5.5 #157) are orthogonal and untouched.Linear: ENG-
Slice: docs/adr/0042-session-model-and-jev-mode-switchers.md
How verified
cargo fmt --all -- --checkcargo clippy --workspace --all-targets --all-features -- -D warningscargo test --workspace(qq-core 723 passed, qq bin 228, qq-tui 323, qq-client 23, qq-server 27, qq-protocol 48 + fixtures)cargo test -p qq-provider --no-default-features --features test-support(171 + 17 passed)New tests:
qq-protocol:jev_mode_spellings_are_stable_and_ordered,set_jev_mode_is_a_work_command_on_its_own_route, wire/headless goldensv29.qq-core:set_jev_mode_persists_publishes_and_is_inherited_by_children,jev_mode_reaches_the_loader_at_the_next_claim_not_the_active_run,version_thirty_six_gains_the_jev_mode_and_rejects_a_bad_shape.qq(runtime):jev_mode_rungs_map_onto_the_jev_roles_at_load(all five rungs, fail-closed without a credential, inherited selections win),jev_mode_rungs_are_monotone.qq-client:session_updated_carries_the_jev_mode_to_every_surface;session_management_commands_reach_their_routes_and_only_theirsnow covers/v1/sessions/jev-modeend to end.Impact
const fntable lookup at plan compile.v23–v28goldens retained decode-only). Store schema 36→37 (ALTER TABLE sessions ADD COLUMN jev_mode TEXT, migration + shape test). Descriptor unchanged. Harbor trace fixture headers bumped to 29.docs/design/protocol.md(version 29, route, endpoint),docs/runbooks/jev.md(ladder section),docs/guide/configuration.md(by_mode),docs/adr/README.md,docs/plans/progress/root.md.Link to Devin session: https://app.devin.ai/sessions/5288c73e9e644e0dad0a0c23700b9b46
Open in Devin Desktop: https://app.devin.ai/desktop/session/5288c73e9e644e0dad0a0c23700b9b46?variant=devin
Requested by: @integrate-your-mind