This repository was archived by the owner on Aug 25, 2026. It is now read-only.
Repository navigation
fix: preserve supervision state across multi-stage work - #85
Merged
Merged
Conversation
Adapt owner PR kunchenguid#758 onto current JT main without replaying its mixed history. Preserve the already-landed AFK wedge fix, make nonterminal suppression override-safe, bind no-mistakes state to compatible HEAD ancestry, and protect multi-stage working gates. Source commits: 80e4b9c, fad734e, 4ddb731.
…ible run attribution
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
Port upstream owner PR kunchenguid#758 onto current JT firstmate main. Preserve verb-aware captain relevance so nonterminal working/paused and other progress verbs never become terminal from free-text merged, PR ready, or checks green tokens while genuine done, needs-decision, blocked, failed, legacy bare free text, and validated merge-check events still escalate. Preserve independent bounded AFK stale/possible-wedge aging even when seen-status dedupe matches. Bind no-mistakes current-state attribution to branch plus compatible code identity: equal HEAD or local HEAD ancestor of the pipeline run HEAD, rejecting rewritten, diverged, missing, and local-advanced heads. Protect multi-stage ship briefs so setup-complete working lines stay nonterminal until a defined done gate. Adapt owner kunchenguid#758 source commits without blind replay, preserve existing JT Herdr, Grok, lifecycle, multi-home, and parallel kunchenguid#1092 isolation contracts, ship only to JTInventory/firstmate through no-mistakes, never merge, never use --yes for ask-user findings, and keep deterministic incident and counterfactual regressions.
What Changed
working,paused, and other progress states remain nonterminal; custom captain vocabulary is now additive.Risk Assessment
✅ Low: Captain, the prior three findings are resolved, and the bounded classifier and run-attribution changes now conform to the supplied intent without a substantiated material regression.
Testing
The supplied full behavior baseline was green; focused current-state, classification, generated-brief, CI-ready, AFK, instruction-owner, and watcher-lock tests passed, including two deterministic watcher-lock runs. Reviewer-visible transcripts demonstrate the intended CLI behavior end to end; no UI surface changed, so visual screenshots were not applicable.
Evidence: Verb classification and commit-attribution transcript
Evidence: Bounded AFK possible-wedge transcript
Evidence: Generated multi-stage ship brief
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
🔧 **Review** - 2 issues found → auto-fixed (2) ✅
bin/fm-classify-lib.sh:111- Intent requires “genuine done, needs-decision, blocked, failed ... still escalate,” but terminal verbs are recognized only whenFM_CAPTAIN_REis unset. Any custom override can therefore suppress a genuine terminal status. Confirm whether the existing whole-vocabulary override may supersede this required terminal guarantee; otherwise terminal verbs must remain unconditional before applying the custom regex.bin/fm-crew-state.sh:380- Intent requires branch plus compatible-code attribution, but fallback selects only the first same-branch run and stops if its HEAD is incompatible. A newer rewritten/reused-branch run can mask a later listed equal-or-descendant-compatible run, forcing stale pane/status-log fallback. Scan bounded same-branch candidates until a compatible HEAD is found, honoring the documentedFM_CREW_STATE_RUNS_LIMIT.🔧 Fix: Captain, preserve terminal escalation and compatible run attribution
1 error still open:
bin/fm-classify-lib.sh:113- Intent requires “legacy bare free text ... still escalate,” and the changed comment saysFM_CAPTAIN_REadds vocabulary, but this expression replaces the default legacy-token regex whenever the override is set. For example,FM_CAPTAIN_RE='custom-verb:'suppresses baremerged,PR ready, andchecks green. Keep required legacy matching unconditional and make the custom expression additive.🔧 Fix: Captain, preserve legacy signals with custom vocabulary
✅ Re-checked - no issues remain.
🔧 **Test** - 1 issue found → auto-fixed ✅
bash bin/fm-run-behavior-tests.sh🔧 Fix: Wait for watcher readiness before legacy lock migration
✅ Re-checked - no issues remain.
bash bin/fm-run-behavior-tests.shBaseline supplied by the gate:bash bin/fm-run-behavior-tests.shbash tests/fm-watch-triage.test.shbash tests/fm-crew-state.test.shbash tests/fm-crew-state-ci-ready.test.shbash tests/fm-instruction-owners.test.shbash tests/fm-watcher-lock.test.shtwicebash tests/fm-daemon.test.shandenv -u NO_MISTAKES_GATE bash tests/fm-daemon.test.sh— all Phase 3 cases passed before the unrelated lifecycle test correctly refused execution from a gate worktree; the supplied full-suite baseline exercises it from the runner's neutral cloneManual production-function transcript covering nonterminal/terminal classification, compatible pipeline-fix ancestry, and rejection of a local-advanced historical runManual AFK scenario with matching seen-status marker, immediate suppression, retained aging timer, and apossible wedgeescalation after 500 secondsFM_HOME=/tmp/no-mistakes-evidence/01KYNK83RXYSMSAHPAY2SSSBCD/brief-home bin/fm-brief.sh phase3-brief local-project✅ **Document** - passed
✅ No issues found.
🔧 **Lint** - 1 issue found → auto-fixed ✅
🔧 Fix: Quote terminal status token for ShellCheck
✅ Re-checked - no issues remain.
✅ **Push** - passed
✅ No issues found.