Skip to content

Derive canary qualification from retained evidence - #53

Merged
vriesd merged 1 commit into
mainfrom
codex/assurance-hardening-phase-6
Aug 28, 2026
Merged

Derive canary qualification from retained evidence#53
vriesd merged 1 commit into
mainfrom
codex/assurance-hardening-phase-6

Conversation

@vriesd

@vriesd vriesd commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Summary

  • remove caller authority over canary status, checks, actors, and host identity
  • derive qualification from the exact prepared artifact, loaded plugin digest, valid Session v5 state, Flow assurance, and real OpenCode transcript parts
  • rederive retained evidence during strict release verification and reject the known caller-attested 8.1.2 format
  • reuse bounded same-handle evidence reads and deterministic actor pseudonyms

Verification

  • bun run check: 586 passed, 1 intentional live-smoke skip
  • bun run replay: 13 of 13 cassettes reproduced
  • FLOW_LIVE_SMOKE=1 bun test tests/live-opencode-smoke.test.ts: pinned OpenCode 1.18.6 passed
  • three-model interrogate and comment/deslop review: green
  • contribution preflight in commit and push modes: passed

Review guide

Start with deriveCanaryResult and canaryRecordIssue in scripts/eval-canary.ts. Then inspect the runtime identity addition in src/platform/opencode/plugin.ts and src/platform/opencode/tools.ts. The focused attack cases live in tests/eval-canary.test.ts.

@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: e085bc900c

ℹ️ 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 scripts/eval-canary.ts
Comment on lines +204 to +209
function completed(calls: readonly ObservedCall[], tool: string): boolean {
return calls.some(
(call) =>
call.tool === tool &&
(call.status === "completed" || call.status === "ok"),
);

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 Reject application-level tool failures

When a Flow handler rejects an operation, execute() catches the exception and returns a serialized {status:"error"} response (src/platform/opencode/tools.ts:118-128), so OpenCode still records the tool part itself as completed. This helper therefore credits rejected plan-save, validation, review, and close calls; because the session document is evaluated independently, retained evidence from another or altered session can satisfy the state predicates while the transcript contains only failed invocations. Parse the Flow response and require its application status to be ok before treating the call as completed.

Useful? React with 👍 / 👎.

Comment thread scripts/eval-canary.ts
Comment on lines +422 to +429
operation.inputDigest = operationInputDigest({
operationId: closure.operationId,
expectedRevision: closure.recordedRevision - 1,
sessionId: session.id,
kind: closure.kind,
summary: closure.summary,
});
const repaired = SessionSchema.safeParse(session);

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 Reject invalid closure digests instead of repairing them

When retained session evidence fails SessionSchema, this verification path overwrites the closure operation digest using the other retained fields and then accepts the repaired document. Consequently a session whose closure ID, revision, kind, summary, or digest was altered can pass derivation after its integrity failure is silently normalized away, undermining the release gate's claim to rederive the evidence as retained. Perform any redaction-related digest regeneration while recording, but require verification to reject an invalid retained session unchanged.

Useful? React with 👍 / 👎.

@vriesd
vriesd merged commit 269bd85 into main Aug 28, 2026
12 checks passed
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