Skip to content

feat(bin): end scout reports with an open-decisions section - #7816

Open
c6aw wants to merge 3 commits into
kunchenguid:mainfrom
c6aw:fm/upstream-fm-scout-open-decisions
Open

c6aw wants to merge 3 commits into
kunchenguid:mainfrom
c6aw:fm/upstream-fm-scout-open-decisions

Conversation

@c6aw

@c6aw c6aw commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Intent

Scout reports should end with an "Open decisions: options and my pick" section.

History: the first version also had a scout name each open captain call in its done status, so the supervisor could hold each one. Upstream #7875 has since made the scout ask the supervisor to register its open captain calls before it reports done, and the 2026-10-30 review asked to drop that handoff line, so this head keeps only the Open decisions section.

What Changed

  • bin/fm-brief.sh: the generated scout brief now tells the scout to end its report with an "Open decisions: options and my pick" section. The section lists each open decision, its options, the scout's pick with one reason, and which decisions only the captain can make. It says "None" when there are no open decisions.
  • tests/fm-brief.test.sh: test_scout_and_secondmate_load_decision_hold_policy now checks that the scout brief contains the new instruction.

🤖 Generated with Claude Code

Risk Assessment

✅ Low: The change adds one instruction line to the generated scout brief's definition of done, plus a test that checks the generated brief. It matches the current intent exactly and changes no logic.

Testing

I ran the real fm-brief.sh in a disposable lab home at HEAD and at the base commit. At HEAD, the generated scout brief tells the scout to end its report with the "Open decisions: options and my pick" section. The line sits between the captain-hold completion gate and the done-status line. A ship brief made at HEAD and a scout brief made at the base commit both lack the section. The brief no longer carries the dropped captain-call handoff line. The targeted fm-brief test file passed. I removed the lab home and the temporary base worktree afterwards. I did not have a live Claude scout write a real report from the brief, because the change only alters the brief text that the scaffold produces.

  • Live validation: ✅ go - 4 of 4 scenarios driven live against the product
Scenario Result Live Evidence
Operator scaffolds a scout brief; the brief tells the scout to end its report with an "Open decisions: options and my pick" section (options, pick with reason, captain-only calls, or "None") ✅ pass live scout-brief-open-decisions.txt (line 86 of the generated brief); generated-scout-brief.md
The new instruction sits after the captain-hold completion gate and before the done-status line, so the report is complete before done ✅ pass live scout-brief-open-decisions.txt order check: lines 85, 86, 87
Adversarial: a ship brief does not pick up the scout-only report section ✅ pass live scout-brief-open-decisions.txt: ship brief has 0 'Open decisions' matches
Regression baseline: the scout brief from the base commit lacks the section, so the change adds it ✅ pass live scout-brief-open-decisions.txt: base scout brief has 0 matches
Evidence: Before/after scout and ship brief generation transcript

Source: Before/after scout and ship brief generation transcript

== HEAD (ba40098c) scout brief: fm-brief.sh demo-scout sample --scout
scaffolded: /tmp/fm-lab.YgGP6b/data/demo-scout/brief.md (scout; replace {TASK} and {FIRSTMATE_SPEC})
86:End the report with an "Open decisions: options and my pick" section: each open decision, its options, your pick with one reason, and which ones only the captain can make; write "None" when there are none.

Order check (completion gate -> Open decisions -> done line):
85:Before reporting done, read and follow `~/.no-mistakes/worktrees/<repo-id>/01M674P0FJCCGSWX0J14RVVCRX/.agents/skills/captain-hold-lifecycle/SKILL.md` and pass its shared completion gate for the report and any visual review.
86:End the report with an "Open decisions: options and my pick" section: each open decision, its options, your pick with one reason, and which ones only the captain can make; write "None" when there are none.
87:When the report is complete, append `done [at=<epoch>]: {one-line conclusion}` to the status file and stop.

== HEAD ship brief (must NOT carry the scout report section): fm-brief.sh demo-ship sample --mode local-only
scaffolded: /tmp/fm-lab.YgGP6b/data/demo-ship/brief.md (ship, mode=local-only; replace {TASK} and {FIRSTMATE_SPEC})
Open decisions matches: 0

== BASE (30e185d1) scout brief
scaffolded: /tmp/fm-lab.YgGP6b/data/base-scout/brief.md (scout; replace {TASK} and {FIRSTMATE_SPEC})
Open decisions matches: 0
Evidence: Generated scout brief at HEAD

Source: Generated scout brief at HEAD

You are a crewmate: an autonomous worker agent managed by firstmate. Work on your own; do not wait for a human.

# Task
## Captain's intent
{TASK}

## Firstmate spec
{FIRSTMATE_SPEC}

# Herdr lifecycle declaration - NOT ENABLED
**HARD SAFETY GATE:** this scaffold cannot inspect the task text filled in above.
If the task will start, stop, delete, restart, profile, or otherwise drive Herdr lifecycle behavior, stop and regenerate the brief with `--herdr-lab` before dispatch.
Do not add Herdr lifecycle commands to this unguarded brief by hand.

# Setup
You are in a disposable git worktree of sample, at a detached HEAD on a clean default branch.
This is a SCOUT task: the deliverable is a written report, not a PR.
The worktree is your laboratory - install, run, edit, and make scratch commits freely; all of it is discarded at teardown.
The report is the only thing that survives, so anything worth keeping must be in it.

# Rules
1. Never push to any remote and never open a PR.
2. Stay inside this worktree; the only files you may write outside it are the report and the status file below.
3. Use gh-axi for GitHub operations and chrome-devtools-axi for browser operations.
4. Report status by appending one line:
   `echo "{state} [at=<epoch>]: {one short line}" >> '/tmp/fm-lab.YgGP6b/state/demo-scout.status' && { [ ! -e '/tmp/fm-lab.YgGP6b/config/fleet-ledger' ] || '~/.no-mistakes/worktrees/<repo-id>/01M674P0FJCCGSWX0J14RVVCRX/bin/fm-fleet-ledger.sh' appended '/tmp/fm-lab.YgGP6b/config' '/tmp/fm-lab.YgGP6b/state/demo-scout.status' >/dev/null 2>&1 || true; }`
   States: working, needs-decision, blocked, paused, done, failed.
   Substitute `<epoch>` with the current Unix time in seconds - run `date +%s` and write the number it printed; a stamp that is not plain digits records no time at all.
   Each append wakes firstmate, so report sparingly: only phase changes a supervisor
   would act on and the needs-decision/blocked/paused/done/failed states. No step-by-step
   FYI progress lines; firstmate reads your pane for that.
   Whenever you mention a PR anywhere - a status line, your terminal, a summary - write its full
   https:// URL exactly as the forge printed it, never a bare number such as "PR 108"; firstmate
   copies that URL from your line rather than assembling one.
   Use `paused: {why}` - distinct from `blocked:` - when deliberately waiting for work or an external condition expected to clear on its own, including your own validation round.
   Before ending your turn with your own background shell or monitor still running, or before waiting on your own pipeline run or a long foreground command, append `paused [at=<epoch>]: {job and completion condition}` to the status file.
   Name what you are waiting for and what will let you resume; do not repeat the declaration on every poll.
   Do not declare active implementation or reasoning as a wait.
   Firstmate may still raise one first-sight alert; the declared wait then uses the existing long recheck cadence instead of repeated possible-wedge alarms.
   When you know when the wait clears, include `until <YYYY-MM-DDTHH:MMZ>` (UTC) for a recheck at that time; for your own background job or command with a timeout, that time is its start plus its timeout, rounded up to the minute.
   Follow the resolution rule below when the wait clears, then resume the task.
   Use `blocked:` when you are stuck and need help.

5. If you hit the same obstacle twice, append `blocked [at=<epoch>]: {why}` and stop; firstmate will help.
6. If a decision belongs to a human (product choices, destructive actions),
   append `needs-decision [at=<epoch>]: {summary of options}` and stop. Firstmate will reply with the decision.
   A decision or blocker you opened stays open until a `resolved` line carrying its exact key lands; a later `done:` or `working:` line never closes it, even when the answer is what started that work.
   Firstmate's reply normally writes that closing line at answer time; when a blocker or wait clears WITHOUT a firstmate reply, append `resolved [at=<epoch>]: {how it cleared}` yourself (same `[key=<slug>]` if you opened it with one) as you resume.
7. Never administer infrastructure that every lane shares. Two things are shared:
   - The `no-mistakes` daemon - one instance serving every lane/home, so stopping, restarting, or
     updating it kills other lanes' in-flight pipeline runs; only firstmate manages the daemon.
     Before you append `blocked:` about the pipeline, run `no-mistakes daemon status` and
     `no-mistakes axi status`. If the daemon socket refuses connections or is missing, append
     `blocked [at=<epoch>]: {the daemon error}` and stop even when the local run record still says running or
     fixing, because that record can be stale after the daemon exits. A run record failed with a
     daemon error is also a real block.
     Only after ruling out socket refusal, if the run is still running or fixing, reattach and keep
     going. A drive-call error, timeout, slow read, or generic unreachability is NOT a daemon error:
     the daemon accepts `respond` immediately and runs the round in the background, so a killed or
     timed-out call was only waiting for a read while the run kept working.
   - The worktree pool your own worktree came from, and the repository every lane's worktree
     shares. Never create, remove, return, prune, move, or reassign a worktree or pool slot, and
     never write into a sibling slot's directory. Rule 2 does not cover this: removing a worktree
     is administration rather than an edit outside your directory, and it lands on lanes that are
     running right now. The act is the rule and commands are only examples of it - `treehouse`
     get/return/remove/prune, the equivalent operations on any other worktree provider or runtime
     backend, and `git worktree add|remove|move|prune`. A slot that looks unused is not evidence
     that it is free, and returning your own worktree is firstmate's job at cleanup, not yours.
   If you genuinely need a second checkout, another slot, or the daemon touched, append
   `blocked [at=<epoch>]: {what you need}` and stop; firstmate arranges it.
8. Never start a shell command with `cd`, and never run a search whose path depends on the current directory.
   Use absolute paths, `git -C <abs>`, or a `( cd <abs> && ... )` subshell.
   Pass this rule to every sub-agent you launch.

# Firstmate instruction inbox
Firstmate steers you through durable message files in '/tmp/fm-lab.YgGP6b/state/demo-scout.inbox'.
When a terminal message says an instruction is waiting there - and at any natural checkpoint when you are unsure - list them with `find '/tmp/fm-lab.YgGP6b/state/demo-scout.inbox' -maxdepth 1 -name '*.msg' 2>/dev/null | sort -V`, read the complete contents of each record (including its final line even when it is not newline-terminated) and act on each message in numeric order, then acknowledge each handled message by moving it: `mv '/tmp/fm-lab.YgGP6b/state/demo-scout.inbox'/NNN.msg '/tmp/fm-lab.YgGP6b/state/demo-scout.inbox'/handled/`.
Prefer the format-aware `fm_task_inbox_body` reader from `bin/fm-task-inbox-lib.sh` when it is available. If you read manually, a header line `body-terminator=1` means the writer added exactly one synthetic final newline to terminate the record file; that marked newline is not part of the logical message body, so remove only it and preserve any intentional trailing newlines. Legacy records without that marker may end without a newline; read them through the file end.
The move IS the acknowledgement: without it firstmate rings again and eventually treats you as stuck. An empty or absent inbox needs no action.

# Definition of done
Write your findings to `/tmp/fm-lab.YgGP6b/data/demo-scout/report.md`.
The report must stand alone: what you did, what you found, the evidence (commands run, output, file:line references), and what you recommend.
Lavish is unavailable (lavish-axi is missing or below its supported version floor), so deliver your findings as a text report without Lavish, even for a visual deliverable.
Before reporting done, read and follow `~/.no-mistakes/worktrees/<repo-id>/01M674P0FJCCGSWX0J14RVVCRX/.agents/skills/captain-hold-lifecycle/SKILL.md` and pass its shared completion gate for the report and any visual review.
End the report with an "Open decisions: options and my pick" section: each open decision, its options, your pick with one reason, and which ones only the captain can make; write "None" when there are none.
When the report is complete, append `done [at=<epoch>]: {one-line conclusion}` to the status file and stop.
If your findings reveal work that should ship (e.g. you reproduced a bug and the fix is clear), say so in the report; firstmate may promote this task in place, and you would then receive mode-specific ship instructions as a follow-up message.

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

⏭️ **Rebase** - skipped
  • ⚠️ bin/fm-brief.sh - merge conflict rebasing onto origin/main
✅ **Review** - passed

✅ No issues found.

✅ **Test** - passed

✅ No issues found.

  • Live validation: ✅ go - 4 of 4 scenarios driven live against the product
Scenario Result Live Evidence
Operator scaffolds a scout brief; the brief tells the scout to end its report with an "Open decisions: options and my pick" section (options, pick with reason, captain-only calls, or "None") ✅ pass live scout-brief-open-decisions.txt (line 86 of the generated brief); generated-scout-brief.md
The new instruction sits after the captain-hold completion gate and before the done-status line, so the report is complete before done ✅ pass live scout-brief-open-decisions.txt order check: lines 85, 86, 87
Adversarial: a ship brief does not pick up the scout-only report section ✅ pass live scout-brief-open-decisions.txt: ship brief has 0 'Open decisions' matches
Regression baseline: the scout brief from the base commit lacks the section, so the change adds it ✅ pass live scout-brief-open-decisions.txt: base scout brief has 0 matches
  • bin/fm-lab-home.sh create $LAB then FM_HOME=$LAB bin/fm-brief.sh demo-scout sample --scout at HEAD ba40098c
  • FM_HOME=$LAB bin/fm-brief.sh demo-ship sample --mode local-only at HEAD (adversarial: ship brief must not carry the section)
  • FM_HOME=$LAB &lt;base-worktree&gt;/bin/fm-brief.sh base-scout sample --scout at base 30e185d1 (before/after comparison)
  • bash tests/fm-brief.test.sh (targeted brief test file, including test_scout_and_secondmate_load_decision_hold_policy)
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

…o the supervisor

The scout brief limits writes outside the worktree to the report and status file, yet its definition of done asked for the captain-call completion gate, whose commands write the backlog. The brief now asks the report to end with an open-decisions section and tells a scout that may not write the backlog to name each open captain call in its report and done status, so the supervisor holds it and runs complete.
…itions

Drop the widened captain-hold-lifecycle trigger and reword the scout lines so this change only asks a scout to end its report with an "Open decisions: options and my pick" section and to name each open captain call, with its question and options, in its report and done status so firstmate can hold each one before running complete.
@c6aw c6aw changed the title fix(bin): let a scout without backlog writes hand its captain calls to the supervisor fix(bin): have scout briefs hand open captain calls to firstmate Oct 30, 2026
@greptile-apps

greptile-apps Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 4/5

[Low impact] The change is limited to guidance for scout reports.

Restore the required scout status handoff before merging.

Reviews (2) · Last reviewed commit: "fix(bin): keep only the scout report's o..." · Reviewed by Greptile

Comment thread bin/fm-brief.sh Resolved
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thank you @c6aw. Having every scout report end with a clear "Open decisions: options and my pick" section is a nice idea, and the live scout runs make it concrete.

I read the tip 47ab4f93 against main cccdc047. One thing to fix, and one thing to know:

  • Greptile's P2 is real, and main makes it sharper. Since this branch was cut, fix(bin): let scout brief write its own empty-inventory attestation #7875 landed on main. It already has the scout ask firstmate to register a non-empty inventory before reporting done, and the skill now says the scout reports to firstmate instead of writing records. So the new line "name each one … in your done status, so firstmate can hold each one before running complete" points the other way, and the new skill line mostly repeats what main now says. Could you make the handoff line agree with main's order (or drop it), and keep the "Open decisions" section, which is the genuinely new part?
  • The conflict with main is ours to handle. You don't need to rebase. Because of the conflict, GitHub hasn't started CI on this head yet. That isn't on you either.

VISION: the "Open decisions" section aligns. It puts decisions and options in front of firstmate, and the cost is one line per scout. The handoff line as written doesn't align with the completion gate that main now specifies.

contract-class: new-default (a new default-on instruction in every scout brief, changing what every scout report must contain). Once it's otherwise ready, it goes to the captain for a merge-or-leave call.

This is waiting on you only for the P2 point above.

Drop the scout captain-call handoff line and its test, and the matching
captain-hold-lifecycle sentence. Main already tells a scout how to have
its captain calls registered and completion attested before it reports
done, so the handoff line pointed the other way and the skill line
repeated main. The scout brief keeps the line asking the report to end
with an "Open decisions: options and my pick" section.
@c6aw c6aw changed the title fix(bin): have scout briefs hand open captain calls to firstmate feat(bin): end scout reports with an open-decisions section Oct 30, 2026
Comment thread bin/fm-brief.sh
The report must stand alone: what you did, what you found, the evidence (commands run, output, file:line references), and what you recommend.
$LAVISH_LINE
Before reporting done, read and follow \`$FM_ROOT/.agents/skills/captain-hold-lifecycle/SKILL.md\` and pass its shared completion gate for the report and any visual review.
End the report with an "Open decisions: options and my pick" section: each open decision, its options, your pick with one reason, and which ones only the captain can make; write "None" when there are none.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Open calls miss the status

The scout brief now requires each open question and its options only in the report. The next line still allows a done status with just a “one-line conclusion.” A scout can therefore finish without including those details in the status that wakes firstmate.

This violates the repository directive to meet the accepted Intent, which explicitly requires the questions and options in both places. Restore that status requirement and its test, while making clear that firstmate owns registration and completion.

Context Used: If there is a VISION.md file at the root of the repo, the PR must not conflict / diverge / drift from it. If the PR description has an "Intent" section, respect that as the accepted user intent. - Do make comments if anything in the implementation ... (source)

Fix in Codex

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This follows the 2026-10-30 review on this PR: upstream main (#7875) now has the scout ask the supervisor to register its open captain calls before it reports done, so the status line was dropped on purpose. The description's Intent section now states only the current scope.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed—the earlier comment relied on the previous handoff design. With upstream #7875, the scout asks firstmate to register and attest any non-empty captain-call inventory before reporting done; the done status line does not need to repeat the questions and options. This PR's report section is consistent with the updated scope, so my prior finding no longer applies.

Tip: You can customize Greptile's behavior for this repo with .greptile/rules.md and .greptile/config.json.

@c6aw

c6aw commented Oct 31, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the review. The head is now ba40098: it drops the handoff line from the brief and the skill, and keeps only the "Open decisions: options and my pick" section and its test. I also rewrote the Intent section of the description so it states only that scope; Greptile's P1 on ba40098 read the earlier intent, which still asked for the status line.

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thank you @c6aw. Head ba40098c does what my 10-30 note asked. The handoff line is gone from the brief and the skill. What's left is the one "Open decisions: options and my pick" line in the scout brief's definition of done, plus its test. It sits after the captain-hold completion gate and before the done line, so it agrees with the order main now follows after #7875. Your 4-of-4 live brief runs show the section in a scout brief, missing from a ship brief, and missing at base. Greptile's 10-30 P1 asked for the status line back, but it read the old Intent text. Greptile has since agreed in that thread that the finding no longer applies.

I read ba40098c against main 043d8344. The no-mistakes attestation binds this head. Its rebase step was skipped only because of the conflict with main in bin/fm-brief.sh. That conflict is ours to fix if Kun says merge, so you don't need to do anything about it. Because of the conflict, GitHub hasn't run CI on this head yet.

Contract-class (my own read): new-default. Every scout brief now asks for a new required report section, which the unconfigured product didn't ask for before. VISION: One captain aligns (decisions and options come to firstmate up front, never to the captain directly) · Authority aligns (the scout picks and names the captain-only calls, and nothing is decided for the captain) · Scripts aligns (one templated line) · Restart aligns (the section lives in the durable report) · Delegation aligns (the scout report gets more legible) · Vendor aligns (harness-neutral text) · Scope aligns. Token cost is one brief line per scout, and it doesn't touch the always-loaded contract.

Next step: this now waits on Kun's merge-or-leave decision, not on you. If he says merge, we resolve the conflict, run the full suite on the merged head and land it.

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.

2 participants