fix: keep decision metadata from invalidating PR polls - #116
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Intent
Fix Firstmate's PR merge monitoring so recording and completing a captain decision after a PR poll is already armed no longer invalidates that task's authenticated merge poll. The intended contract is that current authenticated polls care about one canonical pr= identity plus valid pr_head= values, not about reserving the tail of state/.meta for PR-only lines; other well-formed metadata keys may be appended before or after pr=. Keep the stricter post-pr ambiguity rule only for legacy unauthenticated PR-check migration, where old runnable check files must be quarantined if their metadata cannot be classified safely. Include a regression that arms a poll through bin/fm-pr-check.sh, records and completes a decision through bin/fm-decision-hold.sh, and asserts fm_pr_poll_artifacts_valid still succeeds. The PR body should name this intent/evidence and also note the adjacent observed watcher-pause race in fm-pr-check-migrate.sh without fixing it in this change.
What Changed
pr=identity and validpr_head=values while allowing other well-formed metadata keys before or afterpr=.pr=ambiguity check for legacy unauthenticated PR-check migration, and documents that ambiguous legacy metadata stays quarantined and unarmed.bin/fm-pr-check.sh, records and completes a decision throughbin/fm-decision-hold.sh, and confirmsfm_pr_poll_artifacts_validstill succeeds; the adjacent observed watcher-pause race inbin/fm-pr-check-migrate.shremains out of scope for this change.Risk Assessment
✅ Low: The change is narrowly scoped to metadata parsing and migration classification, preserves the stricter legacy quarantine path, and adds an executable regression for the reported authenticated poll invalidation sequence.
Testing
Ran the targeted PR-check security regression file and a separate end-to-end evidence fixture; both showed authenticated PR poll validation survives decision hold completion, with no worktree changes left behind. PR body wording was not verified here because this assigned test phase must not create or control the outer PR step.
Evidence: Decision completion PR poll validation transcript
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
command -v tasks-axi; bash tests/fm-pr-check-security.test.shManual evidence fixture under/tmp/no-mistakes-evidence/01M06G19N7PC4857BMHFPCFQAK: ranbin/fm-pr-check.sh task-a https://github.com/o/r/pull/10, validated withfm_pr_poll_artifacts_valid, ranbin/fm-decision-hold.sh hold task-a route ...andbin/fm-decision-hold.sh complete task-a route, printedstate/task-a.meta, then validated withfm_pr_poll_artifacts_validagain.git status --short✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.