Skip to content

fix(source-control): let a trusted spec amendment clear an earlier verify FAIL - #18077

Draft
kyle-sexton wants to merge 1 commit into
mainfrom
fix/verify-earlier-fail-spec-amend
Draft

kyle-sexton wants to merge 1 commit into
mainfrom
fix/verify-earlier-fail-spec-amend

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

Refs: #18023

Summary

The merge gate refused verify:earlier-fail forever when a FAIL came from a done-when item that a trusted person later amended. It cleared a FAIL at an earlier head only when the pull request's change differed (change_digest), and that compares code, never the spec. Pull request #18023 failed pr-verify at 87c556c7 against issue #17908's original item 1. The item was then amended by a trusted comment, and head adcf2963 carries the same change with a pass-notes verdict judged against the amended spec. The gate still refused it.

Held as a draft with do-not-merge until the owner decides whether only owner-recorded spec changes should count.

Fix

_spec_amended (in babysit_verify_evidence.py) clears a FAILed head of the same change when all of these hold:

  • every FAIL there and every pass at the head record the same linked issues;
  • for each pass, a trusted person amended one of those issues after the last FAIL's run was created and up to the pass run's creation. An amendment is either a body edit whose last editor the pass's verdict records as trusted (_trusted_actor), or a spec comment created in that window (_spec_comments trust).

Requiring the same linked issues leaves relinks to _superseded. Without that check, an untrusted relink to an issue with a fresh trusted comment could clear a FAIL. The rule adds no GitHub read: comment createdAt comes from the closing-issues read the module already makes, and the body editor comes from the pass's verdict record. Any failed record, time or read keeps the refusal. The module docstring states the new rule.

Verification

  • python3 -m unittest discover -s plugins/source-control/skills/babysit-prs/scripts/tests -p test_babysit_verify_evidence.py: 473 tests, OK. pytest is not installed on this host.
  • New class ATrustedSpecAmendmentClearsAnEarlierFailOnTheSameChange covers:
  • With the new clause removed, both clearing tests fail with verify:earlier-fail.
  • scripts/run-ruff.sh check passes on both changed files.

Related

🤖 Generated with Claude Code

https://claude.ai/code/session_01RAoAtUnz4WHB5auUnwQYq7

…rify FAIL

A counted pass cleared verify:earlier-fail only when the change differed
from every FAILed head's change, so a FAIL against a done-when item that
a trusted person later amended never cleared while the code stayed the
same (pull request #18023 against issue #17908).

_spec_amended clears a FAILed head of the same change when every FAIL
there and every pass at the head record the same linked issues, and for
each pass a trusted person amended one of them after the last FAIL's
creation and up to the pass run's creation: a body edit whose last
editor the pass records as trusted, or a spec comment (_spec_comments
trust) created then. Requiring the same linked issues leaves relinks to
_superseded, so an untrusted relink to a freshly commented issue clears
nothing. No new GitHub read: the comments' createdAt comes from the
closing-issues read already made, and the body editor from the pass's
verdict record. Any failed read keeps the refusal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RAoAtUnz4WHB5auUnwQYq7
@kyle-sexton kyle-sexton added the do-not-merge Hard merge gate: do not merge while applied. label Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge Hard merge gate: do not merge while applied.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant