Skip to content

fix: keep decision metadata from invalidating PR polls - #116

Merged
Freudator86 merged 2 commits into
mainfrom
fm/fm-pr-poll-meta-decision-lines
Aug 17, 2026
Merged

fix: keep decision metadata from invalidating PR polls#116
Freudator86 merged 2 commits into
mainfrom
fm/fm-pr-poll-meta-decision-lines

Conversation

@Freudator86

Copy link
Copy Markdown
Collaborator

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

  • Updates PR metadata parsing so authenticated polls require one canonical pr= identity and valid pr_head= values while allowing other well-formed metadata keys before or after pr=.
  • Keeps the stricter post-pr= ambiguity check for legacy unauthenticated PR-check migration, and documents that ambiguous legacy metadata stays quarantined and unarmed.
  • Adds regression coverage that arms a poll through bin/fm-pr-check.sh, records and completes a decision through bin/fm-decision-hold.sh, and confirms fm_pr_poll_artifacts_valid still succeeds; the adjacent observed watcher-pause race in bin/fm-pr-check-migrate.sh remains 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
$ bin/fm-pr-check.sh task-a https://github.com/o/r/pull/10
armed: state/task-a.check.sh

$ fm_pr_poll_artifacts_valid ... # after arming
valid after arming

$ bin/fm-decision-hold.sh hold task-a route ...
task-a-decision-route

$ bin/fm-decision-hold.sh complete task-a route
complete: task-a decision inventory reviewed (route)

$ state/task-a.meta after decision completion
window=fm-task-a
worktree=/tmp/no-mistakes-evidence/01M06G19N7PC4857BMHFPCFQAK/decision-completion-fixture-1786925090-1810238/wt
project=/tmp/no-mistakes-evidence/01M06G19N7PC4857BMHFPCFQAK/decision-completion-fixture-1786925090-1810238/project
kind=ship
mode=no-mistakes
pr=https://github.com/o/r/pull/10
pr_head=0123456789abcdef0123456789abcdef01234567
decisions_reviewed=1
decision_keys=route

$ ls -1 state/task-a.* poll artifacts
task-a.check.sh
task-a.meta
task-a.pr-poll
task-a.pr-poll-registration

$ fm_pr_poll_artifacts_valid ... # after decision completion
valid after decision completion

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.sh
  • Manual evidence fixture under /tmp/no-mistakes-evidence/01M06G19N7PC4857BMHFPCFQAK: ran bin/fm-pr-check.sh task-a https://github.com/o/r/pull/10, validated with fm_pr_poll_artifacts_valid, ran bin/fm-decision-hold.sh hold task-a route ... and bin/fm-decision-hold.sh complete task-a route, printed state/task-a.meta, then validated with fm_pr_poll_artifacts_valid again.
  • git status --short
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@Freudator86
Freudator86 merged commit 49a7688 into main Aug 17, 2026
10 checks passed
@Freudator86
Freudator86 deleted the fm/fm-pr-poll-meta-decision-lines branch August 17, 2026 00:46
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.

1 participant