Skip to content

Sync Jev protocol and response provenance across QQ decisions - #319

Merged
integrate-your-mind merged 12 commits into
mainfrom
feat/jev-protocol-sync
Oct 16, 2026
Merged

integrate-your-mind merged 12 commits into
mainfrom
feat/jev-protocol-sync

Conversation

@integrate-your-mind

@integrate-your-mind integrate-your-mind commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

Result

Syncs QQ's Jev approval, routing, checkpoint and advisory clients with the shared jev-2026-10-15.1 contract 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 main 55936a1e8cd875c9a683f2e4028c391c307c04a8.

  • Independent non-author source review: VERIFIED, no remaining actionable findings.
  • Rust 1.97.1 with its matching Clippy: formatting, repository lint (76/76 sleep entries), all-target/all-feature QQ Clippy passed.
  • Root acceptance run: 71/71 tests passed (14 QQ routing/approval/TypeSafe checkpoint tests and all 57 protocol tests). Inherited provider environment was removed for isolated fixtures.
  • Shared contract/conformance files are byte-identical to the merged Codex/Claude plugin; the deterministic drift checker passes.
  • Live read-only QA through the production Rust client retained matching transport and decoded IDs. Stable jev-1.13.0 returned req_01a142186ea77ccf8721cae5f6d39607; preview resolved to jev-1.14.0 with req_01a1421885837cdba28834519b13d7ab. Both outcomes were LowConfidence, 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 predecessor 5ce0788; 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 main 55936a1e8cd875c9a683f2e4028c391c307c04a8. 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 separate local-ci / Jev focused macOS status records that result. No hosted Actions run was created for the repair head or merge.

@integrate-your-mind
integrate-your-mind marked this pull request as ready for review October 15, 2026 22:42
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-16T00:36:58.942405Z cbc8231 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +2205 to +2208
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>,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment thread src/runtime/routing.rs
Comment on lines +202 to +205
reason: format!(
"selected from authorized model and effort candidates via {}",
value["model"].as_str().unwrap_or("unknown")
),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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}

@chatgpt-codex-connector chatgpt-codex-connector Bot Oct 15, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@integrate-your-mind
integrate-your-mind merged commit 60dd03d into main Oct 16, 2026
1 check passed
@integrate-your-mind
integrate-your-mind deleted the feat/jev-protocol-sync branch October 16, 2026 00:35

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/runtime.rs
Comment on lines +3703 to +3704
qq_config::JevReviewMode::Final => "typesafe/jev/criteria-2026-10-15.1/final",
qq_config::JevReviewMode::Enforce => "typesafe/jev/criteria-2026-10-15.1/enforce",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment on lines +504 to +508
/// 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>,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment thread src/runtime/approval.rs
};
}
};
let usage = spend.usage;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

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.

2 participants