Repository navigation
fix: preserve authorized follow-on work for second mates - #44
Merged
Merged
Conversation
AGENTS.md section 10 told supervisors to file a backlog item before dispatch, so a later phase authorized behind another item or a date was never filed and stayed invisible to the teardown and session-start re-evaluation. The secondmate charter's "act only on routed tasks" line also read as needing a fresh route for each already-authorized phase. File each item as soon as its work is authorized, including every later phase gated on another item (blocked-by) or a date, and state in the charter that authorized later phases are routed work to file on arrival and dispatch when ready. The generated-charter test asserts the new rule.
…5e routing sentence. No other files changed. git diff --check and fm-doc-audience-check passed. The two CI failures are unrelated pre-existing flakes being handled separately
This was referenced Sep 23, 2026
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
how about the stall issue can you also start a scout task on it to see what the issue is and similar to the last one see if we can make it a PR that can also be created in the upstream repo.
Context the ask refers to ("the stall issue", "the last one"): on 2026-09-22 the main firstmate routed a captain-approved, dependency-ordered multi-phase build (Nextrade unified notifications: Phase 0, 1a, then 1b/1c/1d and Phase 3 batches in parallel after 1a lands, Phase 2 after 1c) to the remote second mate nx-remote-b1 as steering-inbox messages.
The second mate dispatched Phase 0 and 1a and wrote a status line saying 1b/1c/1d, Phase 2 and Phase 3 were held until 1a landed per dependency order.
1a merged (https://github.com/knowttl/nextrade/pull/781) and was torn down cleanly, but for more than an hour afterward nothing started: the remote home had no backlog items or lanes for the unblocked slices, and main had to steer it by hand.
The gated follow-on work apparently lived only in the second mate's conversation, never as durable backlog items with dependencies, so the merge woke nothing.
A possibly related earlier symptom the same day: main received
check: secondmate wake-loop stalled: mate=nextrade-mate-d7 row=27867 idle=253s- the local second mate sat idle with an unhandled queued wake in its own home until main nudged it."The last one" is the sibling scout fm-remote-relay-leak-scout, which verifies a remote relay bug with a view to fixing it in this fork and upstream; this scout is the same shape for the stall.
also ensure that before you create a pull request on the upstream repo please also ensure we properly follow the upstream repo contribution rules if there are any and the standards it has defined?
also ensure that the fixes generalize across the firstmate repo.
please create a proper fix based on the stall scout finding.
please put them as teo separate pull requests.
The stall scout's finding (report section 8.1), in substance: AGENTS.md section 10 says a supervisor's remaining backlog job is "filing the item before dispatch", so authorized work gated on another item or a date is naturally never filed and is invisible to the teardown and session-start re-evaluation; and the second-mate charter scaffolded by bin/fm-brief.sh says "Act only on tasks the main firstmate routes to you", which reads as needing a fresh route for each later phase already authorized in a routed message.
The fix: patch that section 10 sentence so each item is filed as soon as its work is authorized, including every later phase gated on another item (blocked-by) or a date; and add one charter sentence saying later phases authorized in a routed message are routed work, filed on arrival with their dependencies and dispatched when ready without waiting to be asked again; with a regression test on the generated charter.
"Them as two separate pull requests" means this wording fix is one pull request, and the separate monitoring backstop (surfacing newly ready date-gated or unblocked backlog items from the watcher heartbeat, and keeping supervision alive while such items exist) is a second pull request, not part of this one.
What Changed
Risk Assessment
✅ Low: The change narrowly addresses the reported filing gap, and the new test checks the generated charter, which is the intended output contract.
Testing
The focused brief test passed, and a freshly generated project-backed charter provides reviewer-visible evidence of the new instruction and its routed-work boundary. The worktree has no test residue. No live second-mate agent was driven, so filing and later dispatch were not established.
bash tests/fm-brief.test.shfm-lab-*session to evaluate the agent’s behavior.Evidence: Generated Nextrade second-mate charter
Source: Generated Nextrade second-mate charter
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
bash tests/fm-brief.test.shfm-lab-*session to evaluate the agent’s behavior.bash tests/fm-brief.test.shFM_HOME=<evidence>/secondmate-charter-home FM_SECONDMATE_CHARTER='Supervise routed Nextrade phases' FM_SECONDMATE_SCOPE='Nextrade routed work' bin/fm-brief.sh nextrade-phases --secondmate nextradeInspected the generated charter’s Operating model section and checked for worktree test residue.✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.