Repository navigation
Sync Jev protocol and response provenance across QQ decisions - #319
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5ce078832b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| delegate_model: Option<String>, | ||
| /// Provider request identifier for the delegate response, when supplied. | ||
| #[serde(default, skip_serializing_if = "Option::is_none")] | ||
| delegate_request_id: Option<String>, |
There was a problem hiding this comment.
Bump the protocol version for the new approval fields
Adding these serialized fields changes the exact SessionEvent wire encoding, but PROTOCOL_VERSION remains 32 and the existing v32 fixture was rewritten. Consequently, released and new peers can advertise the same protocol version while using different schemas, and the previous v32 golden is no longer retained as historical compatibility evidence. Bump the version, generate a new fixture directory, and leave v32 unchanged.
AGENTS.md reference: AGENTS.md:L156-L156
Useful? React with 👍 / 👎.
| reason: format!( | ||
| "selected from authorized model and effort candidates via {}", | ||
| value["model"].as_str().unwrap_or("unknown") | ||
| ), |
There was a problem hiding this comment.
Preserve the resolved model on fallback decisions
The provider model is recorded only for the selected branch here. When JEV_MODEL is jev-latest or jev-preview and the provider returns a valid versioned response whose confidence is below 0.7, line 195 produces a durable fallback decision with spend but no indication whether the alias resolved to 1.13 or 1.14. Carry the response model into every response-derived routing decision, including uncertainty fallbacks, so the decision evidence remains attributable.
Useful? React with 👍 / 👎.
| #!/bin/sh | ||
| set -eu | ||
|
|
||
| canonical=${1:-/Users/romanmondello/plugins/jev-codex-plugin-cross-host/contracts/jev} |
There was a problem hiding this comment.
Remove the author-specific sync-checker default
On any checkout other than the author's machine, invoking this checker without an argument compares against a nonexistent $HOME/... path and reports contract drift rather than performing a usable deterministic check. Require the canonical directory explicitly or derive a repository-neutral location so the checked-in command works for other developers and CI.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cbc8231a40
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| qq_config::JevReviewMode::Final => "typesafe/jev/criteria-2026-10-15.1/final", | ||
| qq_config::JevReviewMode::Enforce => "typesafe/jev/criteria-2026-10-15.1/enforce", |
There was a problem hiding this comment.
Encode the selected model in durable Jev identities
When JEV_MODEL changes to another accepted selector across a restart, persisted owned work carries only this model-independent checkpoint identity, so load_with_progress accepts it and constructs a reviewer using the current environment; a plan recorded under pinned 1.13 can therefore resume on preview/1.14 while retaining the same descriptor identity. Include the requested selector in the checkpoint identity and in JEV_APPROVAL_IDENTITY, which has the same omission, so reload either restores or rejects changed addon configuration.
Useful? React with 👍 / 👎.
| /// The provider response model when a delegate supplied one. This is | ||
| /// optional so older reviewer implementations remain wire-compatible. | ||
| pub delegate_model: Option<String>, | ||
| /// Provider request identifier when the delegate response supplied one. | ||
| pub delegate_request_id: Option<String>, |
There was a problem hiding this comment.
Bound delegate provenance at the public reviewer seam
A custom implementation of the public ApprovalReviewer trait can return arbitrarily large values for these new strings, which are copied directly into ToolApprovalResolved; if either pushes the event past MAX_PERSISTED_EVENT_BYTES, append_event returns EventTooLarge, rolls back the transaction, and an otherwise valid approval or denial becomes a server failure. Use bounded provenance types or discard/truncate oversized values before persistence.
AGENTS.md reference: AGENTS.md:L92-L93
Useful? React with 👍 / 👎.
| }; | ||
| } | ||
| }; | ||
| let usage = spend.usage; |
There was a problem hiding this comment.
Keep combined usage unknown after nullable Jev usage
When a valid response uses the contract-permitted null for either usage count and Jev then abstains or falls below the confidence threshold, this sets Jev's ReviewSpend.usage to None; if the fallback reviewer reports concrete usage, the existing add_spend arm (None, Some) => Some records only the fallback tokens, and run accounting treats that incomplete total as exact. Distinguish a skipped Jev request from a dispatched request with unknown usage and keep the aggregate unknown in the latter case.
Useful? React with 👍 / 👎.
Result
Syncs QQ's Jev approval, routing, checkpoint and advisory clients with the shared
jev-2026-10-15.1contract used by Jev Workflows 0.5.1 for Codex and Claude Code. The boundary validates model selection and nullable usage, preserves actual returned model identity, and sends the long-context header only on explicit opt-in.The HTTP client now keeps bounded provider request-ID headers separately from the JSON response. Approval/checkpoint provenance uses safe header IDs even when the provider omits a body ID; low-confidence attempts retain their evidence internally, while fallback reviewers retain ownership of their own decisions. Header and JSON IDs containing the active credential are rejected. Default activation, decision thresholds, permissions and fallback behavior remain unchanged. No artificial quota is added.
Verification
Final reviewed head:
cbc8231a4083781a7d8cca90509d23e0edb5c459, against main55936a1e8cd875c9a683f2e4028c391c307c04a8.jev-1.13.0returnedreq_01a142186ea77ccf8721cae5f6d39607; preview resolved tojev-1.14.0withreq_01a1421885837cdba28834519b13d7ab. Both outcomes wereLowConfidence, a valid abstention. Sanitized private receipts retain those observations; this is compatibility evidence, not a decision-quality benchmark.The earlier full macOS run was not green: 2,058 passed, six unchanged long-path fixtures failed with
ENAMETOOLONG, and 12 skipped. The earlier Linux run passed on predecessor5ce0788; it does not qualify this repair. Latest commits use[skip ci]to honor the requested local-only validation and avoid hosted Actions spending. Current-head local acceptance is recorded separately.This PR updates source. It does not replace the stable local QQ executable, migrate user session data, enable global Jev approval/routing, change authentication or claim improved decision quality.
Merged verification
Merged as
60dd03db53b9a72c8617d891b19007ea9ddcce80. The merge tree exactly matches the reviewed change combined with main55936a1e8cd875c9a683f2e4028c391c307c04a8. Repeated on the actual merged revision with the pinned toolchain: 71/71 focused/protocol tests, formatting, lint, all-target/all-feature QQ Clippy, and shared-contract parity passed. The separatelocal-ci / Jev focused macOSstatus records that result. No hosted Actions run was created for the repair head or merge.