feat(bin): wire GitHub issues into task delivery - #1271
Open
HelloWorldSungin wants to merge 5 commits into
Open
Conversation
HelloWorldSungin
force-pushed
the
fm/fm-issue-lifecycle-wiring
branch
2 times, most recently
from
July 31, 2026 03:49
52dc17a to
1bca513
Compare
added 5 commits
July 31, 2026 16:52
HelloWorldSungin
force-pushed
the
fm/fm-issue-lifecycle-wiring
branch
from
July 31, 2026 16:53
1bca513 to
c6ba037
Compare
Owner
|
Automated reminder: thanks for the PR! This branch currently has a merge conflict with the base branch. When you get a chance, please rebase onto (or merge) the latest base branch, resolve the conflict, and push. After that, checks will re-run and the PR will get looked at again. Noted for firstmate#1271 at |
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
Make GitHub issue lifecycle part of Firstmate's delivery machinery so issue-sourced work cannot remain merged-but-open merely because an agent forgot. Add an optional GitHub issue number to fm-brief.sh while keeping briefs generated without it byte-identical; issue briefs must require a substantive issue comment describing findings and actual changes and a Closes # PR-body keyword. Record the explicit issue identity into task metadata at spawn time and never infer it from PR text. After a successful GitHub PR merge, verify the recorded issue is closed, close it with the merged PR URL if needed, and make any bookkeeping failure loud without making the completed merge appear failed or retryable. Preserve behavior for tasks with no issue and for non-GitHub providers, add colocated tests for all paths, and keep scripts shellcheck-clean. During verification, two pre-existing suite failures were reproduced and corrected: coverage comparison now uses the same C locale as its sorted inputs, and the Calm E2E waits for all asynchronously hidden transcript rows before asserting.
What Changed
Closes #<number>PR keywords.Risk Assessment
Testing
Targeted brief, spawn, merge, locale, and real Pi Calm terminal E2E checks passed; the initial newly added brief assertion had a test-only matcher error that was corrected and rerun, lifecycle evidence was captured, and no screenshot was produced because the Calm change only stabilizes an existing E2E wait and changes no production UI.
Evidence: Issue lifecycle end-to-end transcript
Generated issue brief -> persisted issue=42 -> merged PR -> verified, closed, and re-verified issue; a simulated close failure remained exit 0 with a loud warning.Evidence: No-issue byte-identity evidence
cmp exit=0 for all eight no-issue brief variants against fixed pre-issue fingerprints.Evidence: Non-C locale coverage check
FM_TEST_COVERAGE ok total=102 parallel=29 serial=63 herdr=10Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
🔧 **Review** - 2 issues found → auto-fixed ✅
bin/fm-pr-merge.sh:102- The requirement says, "After a successful GitHub PR merge, verify the recorded issue is closed." Reconciliation runs only after this script invokesgh-axi pr merge. A captain can merge through GitHub, whichfm-pr-poll.shdetects without calling this script, leaving a forgottenCloseskeyword and the issue open. Conversely, forwarded--autoor merge-queue behavior can return success before the PR is merged, causing premature issue closure. Move reconciliation to the shared actual-MERGED observation boundary and cover external/queued merges.tests/fm-brief.test.sh:187- The required "briefs generated without it byte-identical" guarantee is not tested. The new plain-brief assertions only check that two issue-specific strings are absent, so any unconditional whitespace or wording drift would pass. Add an exact byte comparison or golden fixtures for existing no-issue brief variants.🔧 Fix: Add exact no-issue brief golden coverage
✅ Re-checked - no issues remain.
✅ **Test** - passed
✅ No issues found.
bin/fm-test-run.sh tests/fm-brief.test.sh tests/fm-spawn-worktree-settle.test.sh tests/fm-pr-merge.test.shbin/fm-test-run.sh tests/fm-test-run.test.sh tests/fm-calm-pi-extension.test.shbin/fm-test-run.sh tests/fm-spawn-worktree-settle.test.shafter adding explicit-identity guardsbin/fm-test-run.sh tests/fm-pr-merge.test.shafter adding verification, re-verification, and invalid-metadata casesbin/fm-test-run.sh tests/fm-brief.test.shafter correcting a test-only fixed-string assertion and rerunningFinal combined rerun:bin/fm-test-run.sh tests/fm-brief.test.sh tests/fm-spawn-worktree-settle.test.sh tests/fm-pr-merge.test.shLC_ALL=en_US.utf8 bin/fm-test-run.sh --check-coverageManual isolated lifecycle:fm-brief.sh ... --issue 42->fm-spawn.sh ...->fm-pr-merge.sh .../pull/31using fake terminal and GitHub endpoints, with persisted metadata and API calls captured✅ **Document** - passed
✅ No issues found.
🔧 **Lint** - 1 issue found → auto-fixed ✅
🔧 Fix: Suppress literal backtick fixture ShellCheck warning
✅ Re-checked - no issues remain.
✅ **Push** - passed
✅ No issues found.