Skip to content

Persist validation proofs before cross-session handoff - #473

Merged
LeanAndMean merged 10 commits into
mainfrom
feature/issue-472-commit-validation-proofs
Aug 6, 2026
Merged

Persist validation proofs before cross-session handoff#473
LeanAndMean merged 10 commits into
mainfrom
feature/issue-472-commit-validation-proofs

Conversation

@LeanAndMean

Copy link
Copy Markdown
Owner

Summary

  • Commit and push retained executable validation proofs as a tests-only Git boundary before review publication and fresh-session handoff.
  • Assess immutable proof commits, including base-inapplicable findings, and remove rejected ownership groups through targeted cleanup commits.
  • Synchronize validation-origin repair and push contracts around clean worktrees, authenticated ancestry, remote-head verification, and safe publication recovery.
  • Replace dirty-worktree and comment-embedded patch transport assertions with semantic coverage for the committed-proof lifecycle.

Test plan

  • Run npx vitest run packages/scramjet/tests/mach12-pr-validation.test.ts
  • Run npm run typecheck
  • Run npm test
  • Run npm run lint
  • Run git diff --check main...HEAD

Fixes #472

@LeanAndMean

Copy link
Copy Markdown
Owner Author

Automated PR Review: Persist validation proofs before cross-session handoff

Critical

None.

Important

F1: Zero-finding assessment is gated by proof-commit checks that cannot succeed. In packages/scramjet/mach12/commands/mach12:pr-validation-assessment.md:55-67, Step 3 universally requires local/upstream/GitHub heads to equal V, parent(V) == P, and a valid P..V proof diff before it handles an authenticated proof commit: none artifact. A zero-finding run has no V, so the stated guards force it to stop before reaching its dedicated branch. Scope the V checks to retained-proof artifacts or move the zero-finding branch ahead of them, and add an ordering assertion; the current test at packages/scramjet/tests/mach12-pr-validation.test.ts:438-453 checks only that both sets of prose exist.

F2: Assessment-cleanup mode performs its commit and push in Step 1, then falls through to the generic commit, push, and progress-comment flow. packages/scramjet/mach12/commands/mach12:push.md:31-39 instructs this mode to stage, create exactly one cleanup commit, push exactly once, verify, and return, but only initial-proof mode is excluded from the unconditional Steps 2-4 at packages/scramjet/mach12/commands/mach12:push.md:42-78. An agent following the command can therefore attempt a second commit/push and publish an underspecified progress artifact even though assessment owns the authoritative publication. Keep Step 1 to validation/staging and branch through shared commit/push steps, or explicitly return assessment-cleanup mode after its verified push. Add direct semantic coverage for this mode; current cleanup tests cover only the caller contract.

F3: Validation-origin repair and declined-proof cleanup can commit or publish only part of the bounded operation. packages/scramjet/mach12/commands/mach12:push.md:29-39 validates the dirty-state shape but then routes these modes through generic selective staging; unlike initial proof and assessment cleanup, it does not require the staged diff to equal the complete declared operation, prohibit unstaged residuals, verify the successor's sole parent and exact diff, or require local/upstream/fresh GitHub-head convergence plus a clean tree before Step 4 publication. A partial staging choice or remote mismatch can therefore produce a trusted progress comment for an incomplete successor. Give these modes the same exact-diff, no-residual, one-parent, one-push, remote-convergence, and clean-worktree completion boundary before comment publication. This is per mach12:silent-failure-hunter.

F4: Repair requires content identities that neither authoritative producer is required to publish. Validation's review schema records P, V, paths, nodes, findings, and ownership groups at packages/scramjet/mach12/commands/mach12:pr-validation.md:165-187; assessment's artifact schema similarly omits content identities at packages/scramjet/mach12/commands/mach12:pr-validation-assessment.md:93-98. Repair nevertheless requires extracting content identities from both artifacts and requiring agreement at packages/scramjet/mach12/commands/mach12:pr-review-fix.md:128-140. A valid handoff can therefore fail because the demanded fields were never part of either producer contract. Prefer deriving canonical proof content identities from authenticated Git objects (P..V and the current surviving content), or explicitly add one producer field to both artifacts. This is per mach12:type-design-analyzer.

Suggestions

S1: Restore compact semantic coverage for the detached-worktree safety boundary. The current test at packages/scramjet/tests/mach12-pr-validation.test.ts:415-423 checks immutable replay vocabulary but no longer pins snapshot-before-dispatch ordering, byte-for-byte post-dispatch comparison, evidence preservation on mutation, or safe cleanup after malformed assessor output. These are material requirements in packages/scramjet/mach12/commands/mach12:pr-validation-assessment.md:73-79; one focused ordering/recovery test would preserve them without restoring the former large assertion block. This is per mach12:test-analyzer and mach12:feature-completeness-checker.

S2: Add representative branch-specific routing assertions. packages/scramjet/tests/mach12-pr-validation.test.ts:455-469 now proves only that some fix and pre-merge wires exist, so it would miss ownership-group splitting, omitted --staged-later/--cleanup-finding arguments, or a no-survivor branch that still offers a fix. Cover the mixed-group branch and the exclusive no-survivor pre-merge branch rather than restoring the full prior matrix.

Strengths

  • The PR replaces mutable dirty-worktree and comment-patch transport with a native, content-addressed Git boundary: one tests-only proof commit directly above the frozen implementation parent.
  • Initial proof mode has strong exact-path staging, intentional-red semantics, direct-parent verification, synchronized local/upstream/GitHub heads, and no-blind-retry recovery.
  • Base-inapplicable findings no longer require impossible merge-base patch application, while ownership groups remain atomic through assessment and cleanup.
  • The focused semantic suite passes all 39 tests, and the changed commands consistently preserve append-only ancestry and reject force-push/recommit recovery.

Reviewed by GPT-5.6 Sol

This is an automated review.

@LeanAndMean

Copy link
Copy Markdown
Owner Author

Independent Assessment of PR Review Findings

Assessment of review comment: #473 (comment)

Classifications

F1 — Genuine issue — Zero-finding assessment is gated by proof-commit checks that cannot succeed. packages/scramjet/mach12/commands/mach12:pr-validation-assessment.md:55-67 universally requires heads to equal V, validates V’s parent, and inspects P..V before reaching the branch that explicitly requires proof commit: none. Detect and validate the authenticated zero-finding artifact before proof-commit guards, applying V guards only to retained-proof runs.

F2 — Genuine issue — Assessment-cleanup mode falls through after already committing and pushing. packages/scramjet/mach12/commands/mach12:push.md:31 specifies staging, committing, pushing, and convergence inside assessment-cleanup mode, but only initial-proof mode is excluded from the later generic processing at lines 35-78. Return assessment-cleanup mode immediately after its verified push and leave authoritative artifact publication to mach12:pr-validation-assessment.

F3 — Genuine issue — Validation-origin repair or declined cleanup can publish a partial bounded operation. packages/scramjet/mach12/commands/mach12:push.md:29-78 validates the dirty-state shape but then uses generic selective staging without repair-specific staged-diff equality, residual-worktree, direct-parent, or remote-convergence verification. Add a dedicated boundary requiring the exact declared diff, no residual changes, one direct successor commit, one push, local/upstream/GitHub equality, and a clean worktree before progress publication.

F4 — Genuine issue — Repair requires content identities that neither producer publishes. Validation omits content identities from its review contract at packages/scramjet/mach12/commands/mach12:pr-validation.md:174-186, and assessment omits them at packages/scramjet/mach12/commands/mach12:pr-validation-assessment.md:93-97, while repair requires extracting them from both artifacts at packages/scramjet/mach12/commands/mach12:pr-review-fix.md:128-140. Publish deterministic proof content identities in both artifacts and carry them through assessment-cleanup and progress provenance.

S1 — Genuine issue — Detached-worktree safety lacks compact semantic coverage. packages/scramjet/tests/mach12-pr-validation.test.ts:415-423 checks execution and base-inapplicable wording but does not pin the snapshot-before-dispatch, post-dispatch byte comparison, mutation preservation, or controlled cleanup requirements at packages/scramjet/mach12/commands/mach12:pr-validation-assessment.md:73-79. Add ordered assertions covering those failure boundaries, including malformed assessor output cleanup.

S2 — Genuine issue — Branch-specific routing contracts are no longer meaningfully tested. packages/scramjet/tests/mach12-pr-validation.test.ts:455-467 checks only generic fix/pre-merge messages and common provenance flags, leaving ownership-group and no-survivor semantics unprotected despite distinct branches beginning at packages/scramjet/mach12/commands/mach12:pr-validation-assessment.md:105. Add representative mixed-group, separated optional-group, cleanup-only, and zero-survivor wire assertions with exact disposition flags.

Staged Implementation Plan

  1. Correct assessment and push control flow (F1, F2)

    • Update packages/scramjet/mach12/commands/mach12:pr-validation-assessment.md to handle zero findings before V checks.
    • Update packages/scramjet/mach12/commands/mach12:push.md so assessment cleanup terminates after its verified commit/push boundary.
  2. Make validation-origin publication atomic (F3)

    • Add repair/declined-cleanup-specific exact-diff, residual-state, ancestry, single-push, convergence, and clean-worktree checks in packages/scramjet/mach12/commands/mach12:push.md.
    • Preserve progress-publication recovery without recommitting or repushing.
  3. Establish proof content identity provenance (F4)

    • Add deterministic identities across packages/scramjet/mach12/commands/mach12:pr-validation.md, mach12:pr-validation-assessment.md, mach12:pr-review-fix.md, and mach12:push.md.
  4. Strengthen semantic contract tests (S1, S2)

    • Extend packages/scramjet/tests/mach12-pr-validation.test.ts with ordering, safety, and representative routing-wire assertions.
    • Run the focused validation test and standard repository checks.

Assessed by GPT-5.6 Sol

@LeanAndMean

Copy link
Copy Markdown
Owner Author

Review fixes completed

Originating review ID: 5195846722

Commit: 2e73832

  • Moved zero-finding assessment ahead of every proof-commit dereference and guard.
  • Terminated assessment-cleanup mode after its single verified push.
  • Made validation-origin repair and cleanup commits atomic through exact patch identity, direct ancestry, remote convergence, and clean-worktree verification.
  • Published deterministic per-path proof content identities derived from committed Git blobs and preserved the bounded-operation identity in progress provenance.
  • Added focused semantic coverage for detached-worktree mutation recovery and branch-specific routing wires.

Verification: focused validation tests (44/44), repository typecheck, and the full workspace test suite passed.

@LeanAndMean

Copy link
Copy Markdown
Owner Author

CI formatting gate resolved

Originating review ID: 5195846722

Commit: 04a55a5

Applied Biome's required multiline formatting to the new atomic-publication ordering assertion. No command behavior changed.

Verification: npm run lint and the focused validation suite (44/44) pass locally.

@LeanAndMean

Copy link
Copy Markdown
Owner Author

Automated PR Review: Persist validation proofs before cross-session handoff

Critical

None.

Important

F1: The zero-finding assessment branch still cannot publish its required artifact. packages/scramjet/mach12/commands/mach12:pr-validation-assessment.md:51-55 correctly forbids extracting or validating V when the review records proof commit: none, but the unconditional publication and reconciliation contract at packages/scramjet/mach12/commands/mach12:pr-validation-assessment.md:95-97 requires V, proof mappings, proof results, and proof groups. The semantic test at packages/scramjet/tests/mach12-pr-validation.test.ts:466-480 explicitly asserts this contradictory V requirement, so 44/44 focused tests pass while a compliant zero-finding run cannot complete. Define a branch-specific zero-finding artifact and reconciliation key using proof commit: none, unchanged P/current head, and no proof metadata. This is per mach12:code-reviewer, mach12:test-analyzer, mach12:comment-analyzer, mach12:type-design-analyzer, and mach12:feature-completeness-checker.

F2: The two new proof/cleanup push modes can mutate the wrong branch before detecting it. The payloads require repository, PR, and branch identity, but the pre-mutation guards in packages/scramjet/mach12/commands/mach12:push.md:25-31 do not bind the current non-detached branch, upstream ref, repository, and fresh GitHub PR head to those identities; agreement is checked only after git push. A stale checkout, changed upstream, or another branch at the same commit can therefore receive intentionally red proofs or cleanup removals before the command fails closed. Authenticate the exact local branch, upstream destination, repository/PR, and remote head before staging or committing, and push the authenticated ref explicitly. This is per mach12:silent-failure-hunter.

F3: The cleanup payload cannot prove a complete ownership-group removal, especially when rejected and surviving groups share a file. Validation defines only whole-file blob identities at packages/scramjet/mach12/commands/mach12:pr-validation.md:139, while assessment permits targeted group removal and sends only rejected groups/paths plus surviving whole-file identities at packages/scramjet/mach12/commands/mach12:pr-validation-assessment.md:83-85. Removing one group necessarily changes the shared file's blob hash, and the payload contains neither a group-owned delta nor an exact cleanup-patch digest for /mach12:push to verify at packages/scramjet/mach12/commands/mach12:push.md:31. Either make co-located groups indivisible or define stable group/node identities and transmit an exact bounded cleanup patch hash, including post-cleanup survivor identities. This is per mach12:type-design-analyzer, mach12:comment-analyzer, and mach12:feature-completeness-checker.

F4: Progress artifacts and staged-continuation authentication use incompatible edge labels. /mach12:push preserves the exact pre-commit predecessor head and appends a successor head at packages/scramjet/mach12/commands/mach12:push.md:120, but mach12:pr-review-fix requires each trusted progress record to contain an exact prior head and exact predecessor head at packages/scramjet/mach12/commands/mach12:pr-review-fix.md:132. Because “predecessor” denotes the old head to the producer but appears to denote the current continuation head to the consumer, a valid chain can fail closed or be interpreted heuristically. Standardize exact prior_head -> successor_head fields and require each continuation's --predecessor-head to equal the prior artifact's successor_head. This is per mach12:silent-failure-hunter.

Suggestions

S1: Remove retrospective checks that a worktree “was clean before” caller-owned edits from packages/scramjet/mach12/commands/mach12:push.md:29-31. The delegated command cannot observe past state; callers should record/authenticate that boundary, while push should validate the current predecessor, empty index before its own staging, and exact dirty/staged/committed diff. This is per mach12:code-simplifier and mach12:comment-analyzer.

S2: Restore compact branch-scoped routing assertions. packages/scramjet/tests/mach12-pr-validation.test.ts:483-510 globally checks wire fields but structurally verifies only the mixed-group and no-survivor branches, so mixed-classification, genuine-only, or optional-only routes can lose entries, ordering, reasons, recommendations, or cleanup sequencing while tests pass. This is per mach12:test-analyzer.

Strengths

  • The PR replaces mutable comment-embedded proof transport with native Git blob and ancestry evidence while retaining fail-closed authentication.
  • Initial proof publication, immutable assessment, base-inapplicable handling, append-only cleanup, and no-blind-retry recovery are substantially synchronized across the four commands.
  • The focused semantic suite passes all 44 tests and covers proof-before-publication ordering, exact remote convergence, detached-worktree mutation recovery, and production-only repair.
  • The fixes after the prior review correctly moved zero-finding detection before retained-proof guards and stopped assessment-cleanup fallthrough; the findings above concern remaining downstream contracts at the current head.

Reviewed by GPT-5.6 Sol

This is an automated review.

@LeanAndMean

Copy link
Copy Markdown
Owner Author

Independent Assessment of PR Review Findings

Assessment of review comment: #473 (comment)

Classifications

F1 — Genuine issue — Zero-finding assessment still requires proof metadata. The zero-finding branch explicitly forbids extracting V and proof metadata at packages/scramjet/mach12/commands/mach12:pr-validation-assessment.md:51-55, but publication unconditionally requires V, mappings, results, and groups at lines 95-97; the test codifies that contradiction at packages/scramjet/tests/mach12-pr-validation.test.ts:466-480. Define a branch-specific zero-finding artifact requiring proof commit: none, unchanged P/current head, disposition counts, and no proof metadata, and use those identities for reconciliation.

F2 — Genuine issue — Proof and cleanup modes can mutate an unauthenticated branch. Initial-proof mode checks only HEAD == P before staging at packages/scramjet/mach12/commands/mach12:push.md:25-27; assessment cleanup similarly accepts branch identity without authenticating the checked-out branch, upstream destination, repository/PR, or fresh PR head before committing at line 31. Before staging, bind the repository, open PR, non-detached branch, exact upstream ref, and fresh headRefOid to the payload, then push that authenticated ref explicitly.

F3 — Genuine issue — Cleanup cannot authenticate partial removal from shared proof files. Validation records whole-file identities while allowing ownership groups below file granularity at packages/scramjet/mach12/commands/mach12:pr-validation.md:139, but assessment removes rejected groups while requiring surviving content unchanged at mach12:pr-validation-assessment.md:83-85. Use the contained fix: require all retained findings sharing a proof path to belong to one indivisible ownership group, avoiding a new node-digest or patch-manifest model.

F4 — Genuine issue — Progress-chain edge labels are incompatible. /mach12:push receives an “exact pre-commit predecessor head” and appends a “successor head” at packages/scramjet/mach12/commands/mach12:push.md:120, while mach12:pr-review-fix requires “exact prior head” and “exact predecessor head” at line 132. Standardize artifacts on prior_head -> successor_head, and require --predecessor-head to equal the preceding artifact's successor_head.

S1 — Genuine issue — Push requires an unobservable historical cleanliness check. The delegated push command requires that the worktree “were clean before the caller's bounded edits” at packages/scramjet/mach12/commands/mach12:push.md:29, although it begins after those edits and has no authenticated snapshot proving that state. Remove the retrospective assertion while retaining authenticated predecessor/ancestry checks, an empty index before push-owned staging, and exact current dirty/staged/committed patch verification.

S2 — Nitpick — Routing tests verify branch presence more than branch contents. packages/scramjet/tests/mach12-pr-validation.test.ts:483-510 checks all branch headings and common wire fields but deeply inspects only mixed-group and no-survivor routes. Compact table-driven assertions for each route would improve regression coverage without changing command behavior.

Staged Implementation Plan

  1. Make assessment artifacts branch-specific (F1)

    • Update packages/scramjet/mach12/commands/mach12:pr-validation-assessment.md with separate retained-proof and zero-finding publication/reconciliation contracts.
    • Correct the zero-finding assertions in packages/scramjet/tests/mach12-pr-validation.test.ts.
  2. Authenticate mutation destinations and observable state (F2, S1)

    • Update packages/scramjet/mach12/commands/mach12:push.md with pre-mutation repository/PR/branch/upstream/remote-head checks and explicit authenticated pushes.
    • Remove the retrospective cleanliness requirement while preserving exact current patch, index, ancestry, and convergence checks.
    • Add focused safety assertions in packages/scramjet/tests/mach12-pr-validation.test.ts.
  3. Make cleanup ownership representable (F3)

    • Require one indivisible ownership group per proof path in packages/scramjet/mach12/commands/mach12:pr-validation.md.
    • Synchronize cleanup requirements in mach12:pr-validation-assessment.md and mach12:push.md.
    • Add shared-file ownership and cleanup assertions.
  4. Normalize staged-continuation edge identities (F4)

    • Use exact prior_head and successor_head fields consistently in packages/scramjet/mach12/commands/mach12:push.md and mach12:pr-review-fix.md.
    • Update continuation-chain assertions in packages/scramjet/tests/mach12-pr-validation.test.ts.
  5. Optional: strengthen branch-specific routing coverage (S2)

    • Add compact table-driven assertions for mixed-classification, genuine-only, optional-only, mixed-group, and no-survivor routes in packages/scramjet/tests/mach12-pr-validation.test.ts.

Assessed by GPT-5.6 Sol

@LeanAndMean

Copy link
Copy Markdown
Owner Author

Validation review contract gaps resolved

Originating review ID: 5196405974

Commit: dfbf88190dafb55a30ca064d519925dbc8423b41

  • Added a branch-specific zero-finding assessment artifact and reconciliation identity with no retained-proof metadata.
  • Authenticated repository, open PR, non-detached branch, exact upstream destination and remote repository, and fresh GitHub head before structured validation mutations; pushes now target the authenticated ref explicitly.
  • Made every proof path one indivisible ownership group so targeted cleanup remains representable with whole-file content identities.
  • Standardized staged continuation records on exact prior_head -> successor_head edges.
  • Removed the unobservable retrospective cleanliness check while retaining current index, patch, ancestry, convergence, and clean-tree guards.
  • Added focused semantic assertions for the repaired contracts.

Verification: focused validation suite (44/44), repository typecheck, full workspace tests (2,494 tests), lint, and git diff --check passed.

@LeanAndMean

Copy link
Copy Markdown
Owner Author

Automated PR Review: Persist validation proofs before cross-session handoff

Critical

None.

Important

F1: Repair authentication requires the review artifact to contain an identity that does not exist when that artifact is published. packages/scramjet/mach12/commands/mach12:pr-review-fix.md:128 requires both the review and assessment comments to refer to the same “current assessment head,” but validation publishes the review before assessment and its schema records only the frozen implementation parent and proof commit. The post-assessment head is produced only by mach12:pr-validation-assessment.md:97, after optional cleanup. A valid repair handoff therefore cannot satisfy the stated cross-artifact agreement. Require agreement on PR, P, V, merge base, and proof mapping, but source the current assessment head exclusively from the authenticated assessment artifact. This is per mach12:type-design-analyzer.

F2: Rejected-proof cleanup reruns the pre-cleanup consolidated invocation after removing some or all of its nodes. packages/scramjet/mach12/commands/mach12:pr-validation-assessment.md:73 defines the consolidated invocation over every retained node, while line 83 removes rejected groups and then requires “every survivor plus the consolidated command.” When any rejected node was part of that command, valid cleanup can fail test discovery; when no proofs survive, there is no consolidated command left to run. Reconstruct and run a survivor-only consolidated invocation, and explicitly skip it when no proof survives. This is per mach12:comment-analyzer.

F3: A cleanup commit pushed immediately before interruption cannot be authenticated by a resumed assessment. packages/scramjet/mach12/commands/mach12:pr-validation-assessment.md:57-65 requires every retained-proof invocation to start with local, upstream, and GitHub heads equal to original proof commit V; after Step 5 pushes cleanup, those heads equal the cleanup successor. Line 87 says to reconcile failed or ambiguous publication without another mutation, but provides no entry/recovery branch that accepts and authenticates that successor, and the classifications needed for publication were not yet made durable. A process exit or lost session after push therefore strands an otherwise valid cleanup. Add an authenticated post-cleanup recovery contract with durable disposition evidence, or move durable assessment publication before mutation and reconcile the cleanup identity through a separately verifiable artifact. This is per mach12:silent-failure-hunter.

F4: Assessment does not bind the checked-out branch name to the PR head branch. The approved Stage 2 plan for #472 requires the local feature branch to be the PR head branch, but packages/scramjet/mach12/commands/mach12:pr-validation-assessment.md:59-60 checks only that the worktree is non-detached and that commit identities equal V. A different local branch at the same commit passes and can publish an assessment from the wrong branch context. Require the current branch to equal the freshly authenticated PR head branch before execution or mutation. This is per mach12:feature-completeness-checker.

Suggestions

S1: Add ordering assertions that bind structured push authentication before staging and commit. packages/scramjet/tests/mach12-pr-validation.test.ts:963-1017 mostly checks that destination-authentication and mutation vocabulary exists, so moving a guard after staging could still pass. Add compact expectInOrder coverage for authenticate destination → validate index/diff → stage → commit → push → verify convergence. This is per mach12:test-analyzer.

S2: Add branch-scoped assertions for the mixed-classification, genuine-only, and optional-only routing sections. packages/scramjet/tests/mach12-pr-validation.test.ts:487-515 deeply checks only the mixed-group and no-survivor branches; the other branches can lose entry counts, ordering, disposition flags, or recommendation semantics while the global checks still pass. This is per mach12:test-analyzer.

Strengths

  • The PR replaces mutable comment-embedded executable patches with a native, content-addressed Git proof boundary and clean cross-session handoff.
  • Current contracts strongly authenticate repository, PR, branch destination, ancestry, explicit upstream, tests-only proof content, and remote convergence before most structured mutations.
  • The two prior review cycles’ findings are resolved at the current head; the remaining findings above concern downstream edge contracts exposed by those fixes.
  • The focused validation suite passes all 44 tests, git diff --check is clean, and both Ubuntu and macOS CI validation jobs pass.

Reviewed by GPT-5.6 Sol

This is an automated review.

@LeanAndMean

LeanAndMean commented Aug 5, 2026

Copy link
Copy Markdown
Owner Author

Independent Assessment of PR Review Findings

Assessment of review comment: #473 (comment)

Classifications

F1 — Genuine issue — Repair authentication requires the review artifact to contain an identity that does not exist when that artifact is published. packages/scramjet/mach12/commands/mach12:pr-review-fix.md:128 requires both artifacts to agree on the current assessment head, but validation publishes its artifact before assessment cleanup and establishes only P and V; the post-assessment head is first defined by packages/scramjet/mach12/commands/mach12:pr-validation-assessment.md:97. Require cross-artifact agreement on immutable review-time identities and source the current assessment head exclusively from the authenticated assessment.

F2 — Genuine issue — Rejected-proof cleanup reruns the pre-cleanup consolidated invocation after removing some or all of its nodes. The consolidated invocation initially covers every retained node at packages/scramjet/mach12/commands/mach12:pr-validation-assessment.md:73, yet cleanup removes rejected groups and reruns that same command at line 83, which can reference deleted nodes or have no nodes left. Reconstruct a survivor-only consolidated invocation after cleanup and skip it explicitly when no proof survives.

F3 — Genuine issue — A cleanup commit pushed immediately before interruption cannot be authenticated by a resumed assessment. Fresh retained-proof assessment requires every head to equal original V at packages/scramjet/mach12/commands/mach12:pr-validation-assessment.md:57-65, while cleanup advances those heads before publication; line 87 supplies neither durable classifications nor a successor-authentication entry path. Before cleanup, publish and verify a trusted checkpoint containing the review digest, P, V, classifications, ownership-group dispositions, and exact intended cleanup transition; on resume, authenticate either unchanged V or its single declared cleanup successor and finish final publication without repeating repository mutation.

F4 — Genuine issue — Assessment does not bind the checked-out branch name to the PR head branch. The assessment requires only a non-detached branch and commit equality at packages/scramjet/mach12/commands/mach12:pr-validation-assessment.md:59-60, unlike structured push modes that explicitly bind the current branch to the fresh PR head branch. Add that fresh branch-name equality check before proof execution, dispatch, publication, or cleanup.

S1 — Genuine issue — Structured push authentication ordering is not protected by semantic tests. packages/scramjet/tests/mach12-pr-validation.test.ts:994-1017 checks authentication vocabulary and broad phase ordering, so moving destination authentication below staging would still pass despite the pre-mutation contract in packages/scramjet/mach12/commands/mach12:push.md:29-31. Add compact mode-specific ordered assertions covering destination authentication, index/diff validation, staging, commit, explicit push, and convergence.

S2 — Nitpick — Three routing branches lack branch-scoped structural assertions. packages/scramjet/tests/mach12-pr-validation.test.ts:487-518 verifies global wire fields and headings but examines exact branch structure only for mixed-group and no-survivor routes. Compact table-driven checks for mixed-classification, genuine-only, and optional-only routes would improve regression coverage, but no current routing defect is demonstrated.

Staged Implementation Plan

  1. Repair artifact authentication and branch guards — F1, F4

    • Source the current assessment head solely from the authenticated assessment artifact.
    • Require the current local branch to equal the freshly authenticated PR head branch before assessment work begins.
    • Add focused semantic assertions for both contracts.
  2. Rebuild post-cleanup execution — F2

    • Construct the consolidated invocation from surviving paths and node IDs after cleanup.
    • Skip consolidated execution when no proof survives.
    • Test partial-survivor and zero-survivor cleanup cases.
  3. Pin structured push ordering — S1

    • Add mode-specific ordered assertions for authentication → diff/index validation → staging → commit → push → convergence.
  4. Persist resumable cleanup assessment state — F3

    • Define and verify a trusted pre-cleanup checkpoint containing the review digest, P, V, complete classifications and group dispositions, and the exact intended cleanup transition.
    • Add a resume branch that accepts either unchanged V or the single authenticated cleanup successor, then completes final assessment publication without recommitting or repushing.
    • Test interruption before cleanup, after cleanup push, and after final publication.
  5. Optional: strengthen routing coverage — S2

    • Add compact table-driven assertions for mixed-classification, genuine-only, and optional-only route contents and ordering.

Assessed by GPT-5.6 Sol

@LeanAndMean

Copy link
Copy Markdown
Owner Author

Validation assessment recovery gaps resolved

Originating review ID: 5196840619

Commit: ba58f82a360d41f2cbe449bf7e68c9723c0d51d9

  • Source the post-assessment head only from the authenticated assessment artifact while keeping immutable review-time identities cross-bound.
  • Rebuild rejected-proof cleanup execution from surviving nodes and skip consolidated execution when no proof survives.
  • Persist a verified pre-cleanup checkpoint so interrupted assessments can authenticate one cleanup successor and finish publication without repeating mutation.
  • Bind assessment work to the freshly authenticated PR head branch.
  • Pin structured validation ordering through destination authentication, exact diff/index validation, staging, commit verification, explicit push, and remote convergence.

Verification: focused validation suite (46/46), repository typecheck, full workspace tests (2,496 tests), lint, and git diff --check passed.

@LeanAndMean

Copy link
Copy Markdown
Owner Author

Executable validation handoff simplified

Commit: 0bfb9b987ea8a9bb05d8f3a34f83908cf783cf78

Reworked validation around purpose and durable contracts rather than speculative recovery protocols:

  • Candidate tests remain ordinary uncommitted changes through a forced same-session assessment.
  • Assessment independently rejects unsupported candidates before creating one accepted-tests-only proof commit.
  • Removed linked-worktree requirements, assessment checkpoints, cleanup successors, ownership groups, content-identity transport, staged-proof continuations, and comment-based ancestry reconstruction.
  • Simplified repair to make every accepted proof green through production changes and simplified push to one accepted-proof mode plus ordinary operation.
  • Changed comment identity capture to use the posting command's returned URL rather than racing on the latest comment.
  • Reduced validation contract coverage to 26 workflow-boundary tests while retaining all 105 Mach 12 wiring tests.

Verification: focused validation/wiring tests (131), repository typecheck, full workspace tests (2,476), lint, and git diff --check passed.

Related command-authoring follow-up: #474 records the evidence-based instruction-economy and prompt-specialist agent work; that issue remains separate from this PR.

@LeanAndMean

Copy link
Copy Markdown
Owner Author

Redundant workflow instructions removed

Commit: 68e37a61412c7c73720a4237d1cedd9d4dd1b76e

  • Removed a hard-coded recommendation index from the forced validation handoff.
  • Replaced the assessment's mechanical index instruction with the semantic requirement to recommend its emitted route.
  • Removed duplicated generic user-input, next-step reason, and current-session freshness guidance already owned by the harness or outgoing route fields.
  • Restored the deliberate requirement that /mach12:push document progress whenever an associated PR or issue can be identified, exhausting session and branch evidence before skipping publication.

Verification: focused validation/wiring tests (131), lint, and git diff --check passed.

@LeanAndMean
LeanAndMean merged commit 6fe5087 into main Aug 6, 2026
@LeanAndMean
LeanAndMean deleted the feature/issue-472-commit-validation-proofs branch August 6, 2026 21:00
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.

Commit and push executable validation proofs before handoff

1 participant