Skip to content

fix(session-flow): keep carry checks failing after a size-only predecessor failure - #17334

Merged
kyle-sexton merged 6 commits into
mainfrom
fix/handoff-carry-fail-after-size-fail
Nov 19, 2026
Merged

kyle-sexton merged 6 commits into
mainfrom
fix/handoff-carry-fail-after-size-fail

Conversation

@kyle-sexton

@kyle-sexton kyle-sexton commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

Refs: #16427

Summary

After a predecessor handoff failed validation only on size, validate downgraded every carry check on its successor to a WARN, so a successor that dropped a carried rule, decision or question still passed. Reproduced: a size-failed predecessor plus a deleted [R1] exited 0; after a passing predecessor the same drop exited 1.

Scope: shapes 2 and 3; the per-slot size check is later work. This merges on its unit tests under the owner's exception for a fix that can only turn a silent content loss into a FAIL; a later eval arm measures it. The shape-2 skeleton's UNVERIFIED tagging is unchanged here (owner decision: any change to it is measured first).

Fix

  • Findings carry a check kind, and writers stamp checks: 2 in the frontmatter.
  • For a successor stamped at or above the content-only generation (its own constant, so a later stamp bump keeps it), only an order or malformed predecessor FAIL downgrades its carry checks.
  • new still tags carried rows UNVERIFIED after any predecessor FAIL, as before.
  • amend keeps the stamp, and its introduced-FAIL diff exempts size kinds.
  • reference/structure.md states the stamped rule and lists checks in both frontmatter schemas.
  • Unstamped files validate exactly as before.

Acceptance criteria

  • AC1: After a predecessor that failed only on size, deleting a carried [R1] from the successor makes validate exit 1.

Verification

  • test_save_point.py: 317 passed.
  • The new tests failed on the unmodified script, including one that bumps CHECKS to 3 and still FAILs a stamp-2 drop, and a guard that every size finding carries a size kind, shown red with the tag removed. A test pins the shape-2 UNVERIFIED tag after a non-content predecessor failure.
  • A dry run re-validating 843 local hot files with the stamp forced to 2 turned 21 from pass to FAIL, each a real binding drop and none a bug in this change; unforced verdicts matched main on all 843.

Left out: the full .github suite locally (CI runs it).

Related

N/A

Remaining

Deferred review findings

A missing checks line in a successor of a stamped predecessor restores the old downgrade; the two skeleton builders duplicate the frontmatter head; the checks key literal appears at four sites. Each is left for the redesign's chain-reader step.

🤖 Generated with Claude Code

kyle-sexton and others added 4 commits November 18, 2026 19:04
…essor failure

A predecessor that failed only on size downgraded its successor's carry
checks to WARN, so a dropped rule passed validation silently.

Each finding now carries a CheckKind. Writers stamp `checks: 2`; for a
successor stamped 2 or higher only a content-kind predecessor FAIL
(order, malformed) downgrades its carry checks, on both the validate path
and `new`'s shape-2 UNVERIFIED tagging. An unstamped file validates as
before. amend's introduced-FAIL diff exempts size kinds by kind.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ument the stamp

The downgrade compared a file's stamp with CHECKS, so bumping the stamp
writers write would hand every checks: 2 file the old downgrade back.
CONTENT_ONLY_DOWNGRADE_FROM now holds that generation on its own.

CheckKind keeps only the members something emits; a test pins every size
finding to a size kind, so an untagged size FAIL can neither downgrade a
successor nor block an amend. structure.md states the stamped rule and
lists checks: in both frontmatter blocks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kyle-sexton
kyle-sexton marked this pull request as ready for review November 19, 2026 01:03
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-19T01:09:06.183355Z 44da4dc Draft marked ready
ℹ️ 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.

@kyle-sexton kyle-sexton added the do-not-merge Hard merge gate: do not merge while applied. label Nov 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-refine/fix-docs
Model rung 0
Leg base
Run job success
Activity step skipped
Commits pushed none (read lane)
Run 44434026118

Failed GitHub API calls

Method Path Status
GET /repos/{repo}/git/ref/tags/* 404

… failure

`new` again tags every carried shape-2 row UNVERIFIED whenever the
predecessor fails validation, whatever it failed on, as on main. Only
validate's carry-check downgrade follows the stamped content-only rule.
The shape-2 test now pins the tag next to the failing drop, and
structure.md states the two rules apart.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kyle-sexton kyle-sexton removed the do-not-merge Hard merge gate: do not merge while applied. label Nov 19, 2026
@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 13c33271f6f80067400fa300ffb6cbb698fa7aef: read 3 of 3 changed file(s); 0 finding(s), 0 as inline comments.

Security review: PR #17334 (incremental, blocking only)

I found no security issues in this push.

This was an incremental review of the changes since 44da4dc6. I read every hunk of all three files that changed:

  • plugins/session-flow/scripts/save_point.py
  • plugins/session-flow/scripts/tests/test_save_point.py
  • plugins/session-flow/reference/structure.md

This lane had already reviewed an earlier head, so this review covers only CRITICAL and IMPORTANT findings.

What changed:

  • cmd_new in save_point.py. When new continues a predecessor that failed validation for any reason, it now prefixes every carried entry with UNVERIFIED (predecessor failed validation):. Before this push, that happened only for an order or a malformed failure. The check is now validate_doc(...) returning a non-zero code, in place of _downgrading_fail(...).
  • Successor validation. The rule that limits the WARN downgrade to an order or malformed failure for successors stamped checks: 2 is unchanged.
  • Net effect. The change is stricter. Carried entries are now flagged as unverified in more cases, and none are flagged in fewer.
  • Test and docs. The test and structure.md were updated to match.

What I checked:

  • No new shell call, path handling, network call, credential use or external input.
  • This is a local validator for the user's own handoff files. It is not a trust boundary.
  • No trusted path, workflow, plugin manifest, trust control or merge hold is touched.
  • No standing instruction is removed.
  • The PR context holds no text telling the lane what to do.

Spend: none.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed 13c33271f6f80067400fa300ffb6cbb698fa7aef: read 3 of 3 changed file(s); 0 finding(s), 0 as inline comments.

Code review (incremental, blocking only): no findings.

This lane already reviewed an earlier head (44da4dc), so this pass only looked for blocking findings and covers only the three files changed since then.

What changed. cmd_new again sets pred_failed when the predecessor fails validation for any reason (code != 0). It no longer uses the stamped content-only rule (_downgrading_fail). So a shape-2 skeleton built after any predecessor FAIL tags every carried entry UNVERIFIED (predecessor failed validation):, as main did. That matches the PR body ("new still tags carried rows UNVERIFIED after any predecessor FAIL, as before", and the owner decision to leave the shape-2 tagging unchanged). The validator's downgrade, _pred_failed at save_point.py#L1424-L1437, still follows the stamped content-only rule.

What I checked against the head source:

  • A faithful carry still validates. The carry comparison strips UNVERIFIED_PRED_RE from each entry before matching (save_point.py#L720). A stamped successor that keeps the tagged entries therefore matches its predecessor, even though a non-content predecessor FAIL no longer downgrades the carry checks. Only a real drop FAILs.
  • The exit codes can't misfire. validate_doc returns 0, 1 or 3. Code 3 (a newer shape) is already rejected earlier in cmd_new (L3966–3970), and shape 1 or None never reaches this branch. So code != 0 means exactly "the predecessor has a FAIL".
  • The renamed test pins the new behaviour. test_shape2_carry_is_tagged_unverified_yet_a_drop_fails_after_a_non_content_failure asserts the tagged line and that dropping it FAILs a stamped successor. Its unstamped branch still downgrades.
  • The docs match the code. Both reference/structure.md hunks now say new tags entries after any predecessor FAIL, while the validator's downgrade for a checks: 2 successor stays limited to order and malformed FAILs.

Closing issue: the PR says Refs: #16427 and closes no issue, so there are no closing-issue criteria to check. AC1 from the PR body is still covered by test_carry_checks_stay_failing_after_a_size_only_predecessor_failure, which this push didn't touch. I ran no tests. The PR's verification results are the author's claims, not checked here.

Loosened-check verdict: fail (default; the prompt gave no verdict line); patterns: 0. The citation requirement was not checked because the prompt gave no decision-record line.

Spend: none beyond this review run.

Verifier dropped 0 of 0 candidates.

@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 19, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 19, 2026
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 19, 2026
Merged via the queue into main with commit 371139a Nov 19, 2026
48 checks passed
@kyle-sexton
kyle-sexton deleted the fix/handoff-carry-fail-after-size-fail branch November 19, 2026 03:20
@github-actions github-actions Bot added the merge-path: owner-agent Post-merge accounting record (README.md, Merge paths) label Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-path: owner-agent Post-merge accounting record (README.md, Merge paths)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant