Repository navigation
fix: preserve PR monitoring after task relaunch - #58
Merged
Merged
Conversation
Relaunch appended control_relaunch_tx after the preserved lines, so a task with pr= recorded ended with a key after its PR identity block. fm_pr_metadata_identity_parse rejects any such key and PR monitoring stopped silently. Write the transaction marker before the preserved lines so the pr= block stays last, and cover it with a relaunch test that parses the result.
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
I would like all bugs to be fixed so tomorrow can be focused entirely to Vernant and not problems preventing Vernant from getting built. A recommended architecture should come with proof.
Context (the backlog record for this bug, as filed): Relaunch writes control_relaunch_tx after pr= in task meta; fm_pr_metadata_identity_parse rejects it and PR monitoring silently stops (repo: firstmate, since 2026-10-06). Root-caused 2026-10-06 by lane d1 on GRE-1842 (https://github.com/MrGTV-love/vernant/pull/3091): an unchanged control_relaunch_tx line appended after pr= in state/.meta makes fm_pr_metadata_identity_parse reject the record; moving the field before pr= restored monitoring (counterfactual ordering passed). Many workers were relaunched on Claude, so any relaunched task with a recorded PR may have silent PR monitoring. Fix the publication order or make the parser order-independent, with a behavioral test (relaunch a task that has pr= recorded, then the PR poll must still parse). Priority: high.
What Changed
control_relaunch_txbefore the preserved PR metadata block so relaunched task records remain parseable by PR monitoring.traceparententries with a single carrier before the firstpr=line, or at the end of records without a PR, and document this ordering.Risk Assessment
✅ Low: The change narrowly corrects metadata publication ordering, preserves existing carrier and transaction semantics, and introduces no unsupported behavior or substantiated material defects.
Testing
Targeted regressions passed and reproduced both failures with the old writers. Real-Claude stopped-task recovery relaunches passed tracing-off, tracing-on, repeated-carrier, and no-PR scenarios, with CLI and generated-metadata evidence saved. Earlier Herdr and idle-Claude setup attempts could not complete; the supported recovery route succeeded, and all disposable labs were removed.
Evidence: Real-Claude recovery relaunches: published metadata and watcher validation
Source: Real-Claude recovery relaunches: published metadata and watcher validation
Evidence: Targeted regression: passing target and failing original writers
Source: Targeted regression: passing target and failing original writers
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
🔧 **Review** - 1 issue found → auto-fixed ✅
bin/fm-spawn.sh:5519- Tracing-enabled relaunches still break PR monitoring. Concrete sequence: a home has tracing frozen on and a task has a valid recorded PR; relaunch now publishes control_relaunch_tx before the preserved PR block, but subsequently spawn_record_traceparent copies that record and appends traceparent after pr=. fm_pr_metadata_identity_parse rejects that field (bin/fm-pr-lib.sh:393), preventing the watcher from dispatching the PR poll (bin/fm-watch.sh:2982). Relevant sites in the changed files: bin/fm-spawn.sh:5453 removes the prior carrier, :5519 preserves the PR block, :5870 appends the replacement carrier, and :5907 invokes that second publication; tests/fm-control-relaunch.test.sh:742 exercises relaunch without enabling tracing, so its parser assertion at :748 misses this supported path. Complete the publication-order fix in spawn_record_traceparent, the shared writer used by traced relaunches, by placing the carrier before the preserved record. Extend the behavioral regression to cover tracing both on and off.🔧 Fix applied.
✅ Re-checked - no issues remain.
✅ **Test** - passed
✅ No issues found.
bash tests/.pr-relaunch-regression-validation.sh— isolated execution oftest_relaunch_keeps_a_recorded_pr_parseable_for_monitoring; tracing-off and tracing-on cases passed.env FM_TEST_ALT_BIN="$PWD/tests/.pr-relaunch-baseline-bin" bash tests/.pr-relaunch-regression-validation.sh— the original writer reproduced PR parser rejection with tracing off.env FM_TEST_ALT_BIN="$PWD/tests/.pr-relaunch-trace-before-bin" bash tests/.pr-relaunch-regression-validation.sh— restoring only the old trace writer reproduced rejection with tracing on while tracing off passed.bash tests/.pr-relaunch-live-validation.sh— attempted a named Herdr lab; the attempt timed out andbin/fm-herdr-lab.sh teardown fm-lab-pr-relaunch-live-43167-25585completed.bash tests/.pr-relaunch-tmux-validation.shandbash tests/.pr-relaunch-tmux-retry-validation.sh— attempted idle-Claude readiness in private tmux labs; import-dialog and subsequent rendering readiness prevented those attempts from reaching relaunch.claude auth status --json | jq '{loggedIn, authMethod, apiProvider}'— confirmed the existing Claude login; the successful disposable configuration also reported authenticated first-party OAuth access.bash tests/.pr-relaunch-stopped-live-validation.sh— drove four successfulfm-control.shrecovery relaunches against real Claude 2.1.295 on private tmux 3.5a endpoints.fm_pr_metadata_identity_parseandfm_pr_poll_snapshot_capture— accepted each PR-linked record after live relaunch; duplicate historic carriers became one stable carrier, and repeated relaunch preserved it.fm_pr_metadata_identity_parse— rejected disposable records reproducing both old post-PR publication orders.Removed disposable drivers, fixture repositories, generated task scratch data, and lab homes; confirmed no matching worktree fixtures remained. No full suite, linters, formatters, or static analysis ran.✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.