Skip to content

feat(jev): integrate session controls and strict verification - #187

Closed
lg2m wants to merge 27 commits into
mainfrom
feat/eng-791-strict-verification
Closed

lg2m wants to merge 27 commits into
mainfrom
feat/eng-791-strict-verification

Conversation

@lg2m

@lg2m lg2m commented Sep 25, 2026

Copy link
Copy Markdown
Collaborator

ENG-791: integrate session Jev controls and explicit Strict verification

Spec: ADR-0044, ADR-0045. Linear: ENG-791; related Harbor qualification ENG-815.

What changed

QQ can retain a per-session Jev mode through the shared server, client reducer and /jev picker. Explicit jev_review: strict adds supported-verdict completion alongside the existing review policies. For example, a failed tool can be valid evidence, but a final claim that it succeeded cannot complete a Strict run.

  • Strict requires an explicit finite run bound before routing/provider dispatch. Semantic corrections require fresh supported tool evidence; rewording a final answer cannot clear an open correction. Original permissions, approvals, cancellation and budgets still apply. Existing Off/Final/Enforce and Low–Ultrajev behavior stays unchanged.
  • Tool and final checkpoints persist evidence identity, pending/settled state and correction obligations. Only a final Supported receipt becomes Verified atomically with Completed. Unavailable review is distinct from semantic rejection; restart, cancellation and budget exhaustion preserve their actual outcomes and unknown spend.
  • This integration also carries the independently reviewed macOS OAuth callback socket repair, Harbor credential forwarding and strict version parser. Canonical main ADR-0043 is preserved; the unpublished session-switcher ADR is numbered0044.

How verified

  • cargo test --workspace: 1,915 passed, 0 failed, 5 existing measurement/gallery ignores at 734a3d20; includes positive/negative zero-router/zero-provider admission controls through durable sessions and the public CLI, policy/approval/MCP ordering, budget/cancellation/recovery/idempotence, historical wire/headless fixtures and loopback reviewer transport failures.
  • cargo fmt --all -- --check, cargo clippy --workspace --all-targets --all-features -- -D warnings, and cargo build --workspace passed on identical code before the final test-only commit.
  • Local Website: Node24.13.0, nub0.9.3, nub ci, nub run build; zero Astro diagnostics,14 pages,476 internal links. Font-resolution, duplicate404-route and dependency deprecation warnings are retained; generated font and404 assets exist.
  • Retained earlier checks: native Harbor0.20 adapter/converter24/24; installer/exact-test guard; WebAssembly client build/test compilation. The isolated Colima/Harbor fixture validates harness upload/exec/download and reward handling, not a real provider task.
  • Independent runtime review at d7ee926c plus independent test-delta review at 734a3d20 approved source/local-test integration. Final bdd90fb8 merges main e54ddf5d with exactly nine non-guide documentation changes. Git object identities prove production, test, toolchain, build, manifest, guide and site inputs are unchanged;13 incoming document links/anchors and diff whitespace pass. The tests were not rerun under the merge hash.

Measurements

Default/off release persistence,30 alternating pairs against reconciled baseline 8e07295:

Measurement Before After Interpretation
Internal batch median 10ms 10ms No change at1ms measurement resolution
Whole fixture median,10 fresh-store batches 218.726ms 220.027ms +0.595%; no tail-latency claim

Docs

Updates the Jev runbook, architecture/protocol descriptions, configuration/TUI guides and proposed ADRs0044/0045. Historical ADR0028/0030 policy remains intact with factual implementation notes.

Compatibility

Protocol30→32 and store schema39→41; descriptor/capability contracts are unchanged. Historical fixtures and absent verification records remain supported. Session mode changes affect subsequent plans; an active run retains its compiled identity. Store migrations are forward-only; an older binary rejects schema41, so downgrade requires a pre-upgrade database copy.

Follow-ups / decisions needed

  • Live combined QQ/provider/TypeSafe qualification, real credentials, Linux/Windows execution of Strict, hosted CI, release, deployment and customer acceptance are not established by these local checks.
  • An early inherited-key test run may have attempted one remote reviewer request; completion/spend remain unknown. The fixture endpoint and subsequent subprocess environments were isolated, and original failure logs were retained.
  • ADR0044/0045 remain Proposed pending integration-owner acceptance. Publication and normal merge are manager-owned; this PR does not close the broader live qualification requirement.

Reopened as a draft after #181 was reverted from main (merged without lg2m approval). Original PR: #181. Not ready to merge until lg2m says so.

integrate-your-mind and others added 27 commits September 24, 2026 23:46
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>
…ode (ADR-0042)

Reserve /jev in the protocol again now that the TUI registers it. The
picker lists configured plus the five rungs, opens on the rung in effect,
sends set_jev_mode for the focused session (running or not; the runtime
reads it at the next claim), and reports the receipt. The top row shows
'jev <mode>' while a rung is set; 'configured' shows nothing.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
ENG-791: preserve authors heads and append protocol31/schema40/ADR0043. The new picker next-run regression is intentionally red; the next commit corrects its demonstrated misleading copy. No strict review policy change.
ENG-815: preserve legacy plain versions and reject unexpected output.
ENG-791: strict_review_requires_explicit_selection_and_preserves_provenance fails with InvalidJevSetting. Reserve ADR0045/protocol32/store41 and complete unpublished ADR0044 references.
#180)

* docs(plans): retire the onboarding plan; open the guide-expansion plan

The onboarding plan shipped its last slice on 2026-09-25; per workflow § 1
a shipped plan is deleted, and its ledger stays as the receipt (header
rewritten to say so, with the audit and the successor linked). Links
into the removed plan from ADR-0042 and the audit now point at the
receipt.

The successor plan, guide-expansion.md, writes the eight guide pages the
docs site's design had and docs/guide did not back: agents, sessions,
skills, environment, keybindings, server, enterprise, changelog. Each
slice lists the user questions it answers, the sources, the existing
coverage to link rather than repeat, the docs-truth extension that keeps
it true, and a size. Two design-doc drifts found in research
(design/protocol.md: PROTOCOL_VERSION 28 vs 30; missing
/v1/sessions/effort) are assigned to GE6. GE8 is blocked on the first
release that writes CHANGELOG.md.

Linear: ENG-928 parent, ENG-929..936 per slice; the plans README priority
row and ownership table point at it.

* docs(adr): repair onboarding trust prompt reference

* docs(adr): use rendered onboarding ledger anchor

---------

Co-authored-by: openclaw-consensus-bot <[email protected]>
@lg2m
lg2m removed this pull request from stack #190 September 28, 2026 18:52
lg2m added a commit that referenced this pull request Sep 29, 2026
…ification steps

- docs/adr/0047-jev-approval-hold-lifecycle.md (Proposed): #193's "0046"
  decisions 1-7 and the hold-phase table, renumbered and without the
  #187/#189 framing. Indexed; root.md reservation marked Proposed.
- Plan acceptance: the #193 clauses with no counterpart in A1-A13 (grants
  survive Off, no full transcript, cancel/deadline and final-vs-advisory
  Deny, priceless fallback under a hard cap, receipt hashes, unknown MCP
  effects, rollout/backup/no auto-downgrade).
- Qualification procedure: run record, zero-connection proof, arm purposes,
  per-decision fields ("missing cost is not zero"), per-hold counting, and
  paired statistics.

Linear: ENG-791
@lg2m

lg2m commented Sep 29, 2026

Copy link
Copy Markdown
Collaborator Author

Closing. The useful parts of this stack are already on main:

We're not taking the rest:

  • The 5-rung low…ultrajev session Jev ladder in the wire protocol.
  • jev_review: strict. It fails a run on any Jev outage and adds a serial TypeSafe round-trip after every tool call, which works against long unattended runs.
  • Two protocol bumps in one PR (30 → 32).

#210 is now the only Jev plan. Its owner decision 4 records whether the ladder or Strict completion ever come back in a later slice. The original commits stay at refs/pull/187/head.

@lg2m lg2m closed this Sep 29, 2026
@lg2m
lg2m deleted the feat/eng-791-strict-verification branch September 29, 2026 00:31
lg2m added a commit that referenced this pull request Sep 29, 2026
…book (#210)

* docs(jev): consolidate Jev docs into one design, plan, ledger and runbook

Opted-in users report that most calls sent to Jev come back to them. The
Jev documentation was split across a superseded runtime review, an
untracked audit, a shipped opt-in plan and ledger, and an unmerged
proposal (#193), so there was no single account of why or what is next.

- design/jev.md: what Jev is (vendor claims separated from QQ evidence),
  the four capabilities as built, eight findings on why work is handed
  back (re-checked against main 1e91895), and the direction.
- plans/jev.md: the only Jev plan, JV0-JV13 with acceptance and the
  qualification procedure. Folds in #193 (ENG-938).
- plans/progress/jev.md: ledger carrying the J1-J9, RR3, DA5 and audit
  history.
- runbooks/jev.md: rewritten operator procedure with current limitations
  and workarounds.
- Delete design/jev-runtime-review-2026-09-18.md, plans/jev-opt-in.md and
  plans/progress/jev-opt-in.md; update indexes and cross-links; reserve
  ADR-0047 for the held-approval lifecycle (JV5).

Docs only. No Rust, configuration, protocol or schema changes.

Refs: ENG-791

* docs(jev): correct the off procedure, approval disclosure and provenance

- Turning Jev off: profile values beat top-level ones, so require the
  QQ_JEV_*=off server overrides or clearing the profile's values.
- Approval preview: list the fields sent verbatim (workspace, working
  directory, edit path, recent action paths, grant lists); only the brief,
  command, diff and arguments are masked; the whole request is capped at 64 KiB.
- Design § 4 is the target, not as-built; note that enforce adds a serial wait today.
- The 2026-09-25 audit was never on main; point to 0c1cbd6 / refs/pull/193/head.
- Ledger: one writer per ledger. Plan status: JV0 in review.
- Owner decision 4 no longer refers to #189's feedback fix, which was not merged.

Linear: ENG-791

* docs(jev): carry #193's hold-lifecycle ADR, missing criteria and qualification steps

- docs/adr/0047-jev-approval-hold-lifecycle.md (Proposed): #193's "0046"
  decisions 1-7 and the hold-phase table, renumbered and without the
  #187/#189 framing. Indexed; root.md reservation marked Proposed.
- Plan acceptance: the #193 clauses with no counterpart in A1-A13 (grants
  survive Off, no full transcript, cancel/deadline and final-vs-advisory
  Deny, priceless fallback under a hard cap, receipt hashes, unknown MCP
  effects, rollout/backup/no auto-downgrade).
- Qualification procedure: run record, zero-connection proof, arm purposes,
  per-decision fields ("missing cost is not zero"), per-hold counting, and
  paired statistics.

Linear: ENG-791

* docs(jev): qualify masking, missing-key startup and in-flight approval spend

Linear: ENG-791

* docs(jev): say when approval_delegate lets Jev see a held call

Linear: ENG-791
lg2m added a commit that referenced this pull request Oct 10, 2026
* docs: move research into docs/research and give plans names matching their ledgers

Research snapshots leave design/ (which is present-tense, as built) for
docs/research/ with undated names; the snapshot date stays in each header.
speed-first and terminal-bench plans now share their ledger's name, and the
progress-report runbook is named for what it is: run-output store queries.
Also repairs the two broken links (ADR-0039, concepts.md).

* docs: update references to the renamed speed-first and terminal-bench plans

* docs(plans): retire shipped plans and orphaned ledgers; reconcile statuses with Git

- side-questions plan shipped (SQ0-SQ2, #262/#266/#270): its contract moves
  to design/side-questions.md, written against side_questions.rs.
- Delete ledgers whose plans closed (delegated-approval, onboarding-ux,
  mcp-pinning, codex-device-auth, latest-models, harness-f25-empty-range);
  F25 folds into root.md. Receipts remain in Git history.
- Mark ledger rows Shipped where the commit is on main (GE0, GE10, JV0-JV2,
  RR4.1-RR8.4, TE0, T2.1, U5-U7, D4a.1, D6a.1, F11, F23, F24).
- Collapse tui-redesign to its open L4/U8 slices; the shipped spec is in
  layout.md, transcript.md and theme.md.
- Rewrite plans/README.md and progress/README.md: every plan and ledger
  listed once, stale priorities (CX1-CX4, GE0, T15-T17, TE1) replaced,
  ownership rows for shipped work moved to design pointers.
- docs/README.md gains a research section and a naming convention.

* docs(adr): one index table with titles from each ADR; record reserved and unused numbers

- 0031-0056 move from a bullet list into the table; titles match each H1.
- A gaps table records 0016-0018, 0037 and 0055 as reserved and 0029,
  0044/0045 (#187 closed unmerged) and 0053 as unused; root.md agrees.
- Supersession metadata on 0003, 0028 and 0030 (status lines only).
- root.md: 0028 and 0031-0035 are merged, not local candidates.

* docs(design): make design docs describe the system as built

- architecture.md: real dependency graph (qq-harness; qq-tui -> qq-core),
  real src/ tree, real route shape instead of an invented sketch; present
  tense throughout; tool list, hosting boundary and TUI detail deduplicated
  to links; task-routing section moved out of Intentionally Deferred.
- protocol.md: descriptor 13; one accurate fixture statement (v32 current,
  v17-v31 decode-only); 29/30 deduplicated; 24/25 moved into the history.
- headless-contract.md: --allow-host in the synopsis; the shipped-gaps
  status table folds into the contract (Supervisor Boundary Notes; ADR
  0014/0022/0023 links follow).
- product.md: the real command list; scope restated as present.
- tools.md, theme.md, layout.md, providers.md: plan pointers, slice IDs and
  build checklists removed; layout states that Ultra shows one pane today.
- jev.md: fixed findings restated as behavior; the Direction section moves
  to plans/jev.md § Target design (the plan owns intent).

* docs(runbooks): correct runbooks, guide and contributor docs against the code

- xtask README: homebrew-formula, release --docs/--no-commit; perf workers
  are release-only on Linux, so perf-recording uses cargo run --release.
- local-dev/CONTRIBUTING: the real toolchain and what CI actually runs.
- release.md: version sample uses placeholders instead of stale numbers.
- jev runbook: approval_delegate values match config; limitations stated
  as behavior, without slice IDs; JV2's fixed headless limitation removed.
- Runbook H1s consistent; run-output-queries not Nix- or Linux-only.
- website/README defers to the website runbook; arms/perf READMEs fixed.
- guide: side questions sit with run behavior; mortal plan links replaced;
  cli --tui-qa-root PATH; README lists concepts.
- cli.rs help: qq run exit code 5; config explain lists every field.

* docs(root): link the docs cleanup slice to ENG-1016

* fix(guide): restore the concepts link to cli.md#qq-jev

The site's heading slugs drop the trailing hyphen GitHub would keep for
`qq jev …`; the original anchor was right and the website link check
failed on the changed one.
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.

3 participants