Skip to content

Make the V5 diagnostic harness executable and fail closed - #3603

Open
joshlf wants to merge 1 commit into
Ghh32fbkyuqkrndyfjzwwarkb4dmfosugfrom
Ghchu3g3fkri2ofhgm5addjto4rfkyvyi
Open

Make the V5 diagnostic harness executable and fail closed#3603
joshlf wants to merge 1 commit into
Ghh32fbkyuqkrndyfjzwwarkb4dmfosugfrom
Ghchu3g3fkri2ofhgm5addjto4rfkyvyi

Conversation

@joshlf

@joshlf joshlf commented Aug 29, 2026

Copy link
Copy Markdown
Member

The first V5 draft described the intended diagnostic study but could not safely execute it. Review found that READY promotion was impossible, several CLI routes had stale arities, padded report IDs disagreed with their validators, host-specific paths destroyed prompt equality, evaluator packets named only digests rather than readable evidence, materiality had no runnable lifecycle, and DRAFT/READY schemas and runtime-state rules contradicted one another.

Replace that draft boundary with an authenticated prepare-snapshot, private-review, and finalize lifecycle. The production lock now binds the trusted source declaration, both skill packages, every target, the harness programs, the staged word counter, 120 report prompts/plans/launches, 43 evaluator assignments, hook-specific review contracts and receipts, empty pre-lock runtime state, and a separately custodied external commitment. Synthetic paths carry an authenticated test-only kind and cannot mint production artifacts.

Adversarial review exposed further trust failures: executing an unverified candidate verifier, source-copy TOCTOU, ambiguous line-oriented manifests, arbitrary review claims and evaluator launches, stale receipts, unreviewed runtime state, irrelevant schema leakage, optional or crash-unsafe external commitments, and a coherent attack that rebound an F report to target E and a V5 condition to the V4 package. Use injective framed commitments, trusted in-process regeneration, exact artifact/check/evidence inventories, private review copies, atomic no-replace publication, explicit custody-bound recovery, and exact target/condition/package joins to close those failures. Preserve each attack as a negative self-test.

Complete the execution protocol around those locked inputs: readable content-addressed packets, two independent consistency reviews, conditional adjudication, materiality review and ledger reconstruction, exact projection and control joins, deterministic aggregate rebuilding, production state authentication, canonical path checks, leases and seals with crash recovery, and fail-closed bound gate evaluation. Unbound caller data cannot make D-STATIC pass.

Validation covers prepare, integration, protocol, and draft-verification self-tests; hostile temporary paths; all CLI help surfaces; all JSON parsing and schemas; adversarial provenance, packet, lease, gate, commitment, and assignment mutations; whitespace; and cache hygiene. This remains diagnostic infrastructure: G-ISOLATION and G-OUTPUT-FINALIZATION deliberately remain FAIL, so the commit cannot support a release or terminal-VN claim.

Agent-Authored-By: AI agent acting on Josh Liebow-Feeser's behalf


This PR is on branch codex/unsafe-rust-stack.

Latest Update: v15 — Compare vs v14

📚 Full Patch History

Links show the diff between the row version and the column version.

Version v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v8 v7 v6 v5 v4 v3 v2 v1 Base
v7 v6 v5 v4 v3 v2 v1 Base
v6 v5 v4 v3 v2 v1 Base
v5 v4 v3 v2 v1 Base
v4 v3 v2 v1 Base
v3 v2 v1 Base
v2 v1 Base
v1 Base
⬇️ Download this PR

Branch

git fetch origin refs/heads/Ghchu3g3fkri2ofhgm5addjto4rfkyvyi && git checkout -b pr-Ghchu3g3fkri2ofhgm5addjto4rfkyvyi FETCH_HEAD

Checkout

git fetch origin refs/heads/Ghchu3g3fkri2ofhgm5addjto4rfkyvyi && git checkout FETCH_HEAD

Cherry Pick

git fetch origin refs/heads/Ghchu3g3fkri2ofhgm5addjto4rfkyvyi && git cherry-pick FETCH_HEAD

Pull

git pull origin refs/heads/Ghchu3g3fkri2ofhgm5addjto4rfkyvyi

Stacked PRs enabled by GHerrit.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 29, 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-08-29T10:50:41.964088Z 8b1b6f4 PR opened
ℹ️ 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.

@codecov-commenter

codecov-commenter commented Aug 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.85%. Comparing base (cbcb1ae) to head (afc8a38).

Additional details and impacted files
@@                        Coverage Diff                         @@
##           Ghh32fbkyuqkrndyfjzwwarkb4dmfosug    #3603   +/-   ##
==================================================================
  Coverage                              91.85%   91.85%           
==================================================================
  Files                                     20       20           
  Lines                                   6093     6093           
==================================================================
  Hits                                    5597     5597           
  Misses                                   496      496           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@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: 8b1b6f491c

ℹ️ 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 +7152 to +7153
if consistency_inputs[0] != consistency_inputs[1]:
raise ProtocolError(f"consistency reviewers did not receive byte-equal input: {mode}")

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 Compare the consistency packets as bytes

When c1 and c2 are leased with JSON packets that differ only in whitespace or key order, load_bound_input_packet parses both and this object comparison succeeds, even though each reviewer saw different bytes. build_expected_evaluator_launch binds each launch to its supplied raw packet independently, so the aggregate reconstruction does not reject this elsewhere. This violates the byte-equal reviewer-input invariant and permits reviewer-specific signaling; compare load_bound_input_packet_bytes(...) for the two attempts and require the deterministic canonical encoding.

Useful? React with 👍 / 👎.

Comment on lines +7296 to +7298
packets = [load_bound_input_packet(item["lease"]) for item in reviewer_attempts]
if packets[0] != packets[1]:
raise ProtocolError("materiality reviewers did not receive byte-equal input")

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 Compare the materiality packets as bytes

When m1 and m2 receive semantically equal JSON with different serialization, this parsed-object comparison accepts it despite build_materiality_review_packet explicitly defining a byte-identical shared packet. The launch verifier authenticates each supplied byte string separately, and the later comparison to expected_packet is also object-level, so reviewer-specific formatting survives aggregate verification and can compromise the claimed independent review. Compare both raw packet byte strings and require the canonical deterministic packet bytes.

Useful? React with 👍 / 👎.

raise IntegrationError("unknown bundle kind")
snapshot = snapshot.resolve()
receipts = receipts.resolve()
output = output.resolve()

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 Reject symlinked final output paths before resolving

When finalize --output is passed a dangling symlink, calling resolve() first discards the symlink entry, after which output.exists() checks the absent target and finalization publishes the bundle there. This bypasses the advertised no-replace semantics for the caller-supplied pathname and can redirect the production bundle outside its intended custody directory; unlike _prepare_snapshot, this path never checks is_symlink() before resolution. Validate the lexical output entry with lstat/is_symlink before resolving it.

Useful? React with 👍 / 👎.

@joshlf
joshlf force-pushed the Ghchu3g3fkri2ofhgm5addjto4rfkyvyi branch from 8b1b6f4 to 245af42 Compare August 29, 2026 11:11
@joshlf
joshlf force-pushed the Ghchu3g3fkri2ofhgm5addjto4rfkyvyi branch from 245af42 to 2ddc311 Compare September 1, 2026 22:15
@joshlf
joshlf force-pushed the Ghh32fbkyuqkrndyfjzwwarkb4dmfosug branch from fa2f962 to 9197f43 Compare September 2, 2026 21:51
@joshlf
joshlf force-pushed the Ghchu3g3fkri2ofhgm5addjto4rfkyvyi branch 2 times, most recently from 2c9a61a to 8d546d7 Compare September 2, 2026 22:28
@joshlf
joshlf force-pushed the Ghh32fbkyuqkrndyfjzwwarkb4dmfosug branch from 9197f43 to 013d38a Compare September 2, 2026 22:28
@joshlf
joshlf force-pushed the Ghchu3g3fkri2ofhgm5addjto4rfkyvyi branch from 8d546d7 to ee97491 Compare September 2, 2026 23:04
@joshlf
joshlf force-pushed the Ghh32fbkyuqkrndyfjzwwarkb4dmfosug branch 2 times, most recently from 6163891 to 886ad3a Compare September 3, 2026 00:07
@joshlf
joshlf force-pushed the Ghchu3g3fkri2ofhgm5addjto4rfkyvyi branch 2 times, most recently from 91c37c6 to 82f1cbd Compare September 3, 2026 01:00
@joshlf
joshlf force-pushed the Ghh32fbkyuqkrndyfjzwwarkb4dmfosug branch from 886ad3a to 271bd9a Compare September 3, 2026 01:00
@joshlf
joshlf force-pushed the Ghchu3g3fkri2ofhgm5addjto4rfkyvyi branch from 82f1cbd to 879e1c9 Compare September 3, 2026 01:33
@joshlf
joshlf force-pushed the Ghh32fbkyuqkrndyfjzwwarkb4dmfosug branch from 271bd9a to 7d4ace9 Compare September 3, 2026 01:33
@joshlf
joshlf force-pushed the Ghchu3g3fkri2ofhgm5addjto4rfkyvyi branch from 879e1c9 to df52065 Compare September 3, 2026 02:26
@joshlf
joshlf force-pushed the Ghh32fbkyuqkrndyfjzwwarkb4dmfosug branch from 7d4ace9 to 5ba5deb Compare September 3, 2026 02:26
@joshlf
joshlf force-pushed the Ghchu3g3fkri2ofhgm5addjto4rfkyvyi branch from df52065 to c941428 Compare September 3, 2026 03:03
@joshlf
joshlf force-pushed the Ghh32fbkyuqkrndyfjzwwarkb4dmfosug branch from 5ba5deb to 0393e94 Compare September 3, 2026 03:03
The first V5 draft described the intended diagnostic study but could not safely execute it. Review found that READY promotion was impossible, several CLI routes had stale arities, padded report IDs disagreed with their validators, host-specific paths destroyed prompt equality, evaluator packets named only digests rather than readable evidence, materiality had no runnable lifecycle, and DRAFT/READY schemas and runtime-state rules contradicted one another.

Replace that draft boundary with an authenticated prepare-snapshot, private-review, and finalize lifecycle. The production lock now binds the trusted source declaration, both skill packages, every target, the harness programs, the staged word counter, 120 report prompts/plans/launches, 43 evaluator assignments, hook-specific review contracts and receipts, empty pre-lock runtime state, and a separately custodied external commitment. Synthetic paths carry an authenticated test-only kind and cannot mint production artifacts.

Adversarial review exposed further trust failures: executing an unverified candidate verifier, source-copy TOCTOU, ambiguous line-oriented manifests, arbitrary review claims and evaluator launches, stale receipts, unreviewed runtime state, irrelevant schema leakage, optional or crash-unsafe external commitments, and a coherent attack that rebound an F report to target E and a V5 condition to the V4 package. Use injective framed commitments, trusted in-process regeneration, exact artifact/check/evidence inventories, private review copies, atomic no-replace publication, explicit custody-bound recovery, and exact target/condition/package joins to close those failures. Preserve each attack as a negative self-test.

Complete the execution protocol around those locked inputs: readable content-addressed packets, two independent consistency reviews, conditional adjudication, materiality review and ledger reconstruction, exact projection and control joins, deterministic aggregate rebuilding, production state authentication, canonical path checks, leases and seals with crash recovery, and fail-closed bound gate evaluation. Unbound caller data cannot make D-STATIC pass.

Validation covers prepare, integration, protocol, and draft-verification self-tests; hostile temporary paths; all CLI help surfaces; all JSON parsing and schemas; adversarial provenance, packet, lease, gate, commitment, and assignment mutations; whitespace; and cache hygiene. This remains diagnostic infrastructure: G-ISOLATION and G-OUTPUT-FINALIZATION deliberately remain FAIL, so the commit cannot support a release or terminal-VN claim.

gherrit-pr-id: Ghchu3g3fkri2ofhgm5addjto4rfkyvyi
Agent-Authored-By: AI agent acting on Josh Liebow-Feeser's behalf
@joshlf
joshlf force-pushed the Ghchu3g3fkri2ofhgm5addjto4rfkyvyi branch from c941428 to afc8a38 Compare September 3, 2026 04:06
@joshlf
joshlf force-pushed the Ghh32fbkyuqkrndyfjzwwarkb4dmfosug branch from 0393e94 to cbcb1ae Compare September 3, 2026 04:06
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