Skip to content

feat(bin): guard watcher liveness across supervision scripts - #8

Merged
kunchenguid merged 3 commits into
mainfrom
feat/watcher-guard
Jun 12, 2026
Merged

kunchenguid merged 3 commits into
mainfrom
feat/watcher-guard

Conversation

@kunchenguid

Copy link
Copy Markdown
Owner

Intent

Make firstmate's watcher-liveness robust across ALL crewmate harnesses, not just Claude Code. Context: this session firstmate twice ended a turn without restarting the background watcher (fm-watch.sh), so a crewmate's 'done' signal went unnoticed for minutes. Earlier-considered fixes (Claude Code Stop hooks, persistent monitors) were rejected because the firstmate template must work on codex/opencode/pi too. The harness-agnostic channel chosen is tool output, which firstmate reads constantly while supervising. Changes: (1) fm-watch.sh touches state/.last-watcher-beat every poll cycle as a liveness beacon (no PIDs, works everywhere); (2) new bin/fm-guard.sh: if any state/*.meta exists (task in flight) and the beacon is missing or older than FM_GUARD_GRACE (default 300s), it prints a loud restart warning to STDERR and always exits 0 (warn, never block); the 300s grace keeps normal wake handling - watcher briefly down between a wake and its restart - silent; (3) the supervision scripts fm-peek, fm-send, fm-spawn, fm-teardown, fm-pr-check, fm-promote call fm-guard.sh first so the warning rides whatever output firstmate was already reading; fm-brief is deliberately NOT guarded because it only scaffolds a file and often runs before any task exists; (4) AGENTS.md section 8 documents the beacon+guard as a pull-based guard replacing pure discipline, section 2 lists the new state file. Deliberate decisions: guard writes to stderr to avoid polluting fm-peek's parseable stdout (pane capture); guard is pull-based by design - it cannot fire if firstmate ends a turn and never touches the fleet again, with the next captain message as the recovery point, because closing that last gap would require a per-harness push channel which is the exact dependency we are avoiding; absent kind= in older meta defaults to ship. All branches smoke-tested locally (silent with fresh beacon, warns with stale/missing beacon and a live task, all scripts pass bash -n).

What Changed

  • Added fm-guard.sh to warn on stderr when tasks are in flight and the watcher heartbeat beacon is missing or stale, without blocking supervision commands.
  • Updated fm-watch.sh to refresh state/.last-watcher-beat every poll cycle and wired the guard into the supervision entrypoints.
  • Documented the watcher beacon, guard behavior, and new state file in AGENTS.md and README.md.

Risk Assessment

✅ Low: The change is limited to a non-blocking watcher-liveness beacon and guard wiring around existing supervision scripts, with no material correctness issues found in the reviewed diff.

Testing

Exercised the watcher-guard flow end-to-end as a firstmate would experience it through CLI output: guard silence with no task or fresh beacon, loud stderr warnings for missing and stale watcher beacons with in-flight metadata, warning propagation through a guarded supervision script, and fm-watch.sh creating the liveness beacon; no automated test suite was present, the CLI transcript was captured as evidence, and the worktree was clean after removing transient state.

Evidence: Watcher guard CLI transcript

Shows no-task silence, missing-beacon warning, stale-beacon warning, fresh-beacon silence, guarded supervision-script warning propagation, and fm-watch.sh creating state/.last-watcher-beat.

## no-task
command: ./bin/fm-guard.sh
exit: 0
stdout:
  <empty>
stderr:
  <empty>

## missing-beacon
command: ./bin/fm-guard.sh
exit: 0
stdout:
  <empty>
stderr:
  WARNING: tasks are in flight but no watcher has ever run (no liveness beacon).
  Restart it NOW, before anything else: run bin/fm-watch.sh as a background task.

## stale-beacon
command: env FM_GUARD_GRACE=300 ./bin/fm-guard.sh
exit: 0
stdout:
  <empty>
stderr:
  WARNING: tasks are in flight but no watcher has been alive for 203432772s (>300s).
  Restart it NOW, before anything else: run bin/fm-watch.sh as a background task.

## fresh-beacon
command: env FM_GUARD_GRACE=300 ./bin/fm-guard.sh
exit: 0
stdout:
  <empty>
stderr:
  <empty>

## supervised-script-warning
command: ./bin/fm-promote.sh demo
exit: 1
stdout:
  <empty>
stderr:
  WARNING: tasks are in flight but no watcher has ever run (no liveness beacon).
  Restart it NOW, before anything else: run bin/fm-watch.sh as a background task.
  error: task demo is not a scout task (kind=scout not in meta)

## watcher-beacon
command: ./bin/fm-watch.sh (started in background for 1s, then stopped)
state/.last-watcher-beat: present
stdout:
  <empty>
stderr:
  <empty>

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

✅ **Test** - passed

✅ No issues found.

  • Inspected target diff from d3f8a1c18ffec95e2c3c27ca47835970ee84d68c..44499023f2e3e7fd2d3835f107800698eccd71ac to identify watcher-liveness intent and affected scripts.
  • Created an isolated state/ fixture and ran ./bin/fm-guard.sh with no *.meta task files to confirm it exits 0 and stays silent when no task is in flight.
  • Created state/demo.meta with no state/.last-watcher-beat and ran ./bin/fm-guard.sh to confirm it warns on stderr, leaves stdout empty, and exits 0.
  • Touched an old state/.last-watcher-beat and ran env FM_GUARD_GRACE=300 ./bin/fm-guard.sh to confirm stale watcher detection warns on stderr without blocking.
  • Touched a fresh state/.last-watcher-beat and ran env FM_GUARD_GRACE=300 ./bin/fm-guard.sh to confirm the grace-window path stays silent.
  • Ran guarded supervision entrypoint ./bin/fm-promote.sh demo against the fixture to confirm the watcher warning rides a supervision script's stderr before that script's own task error.
  • Started ./bin/fm-watch.sh in the background for 1 second, then stopped it, confirming it created state/.last-watcher-beat.
  • Searched for existing tests with Glob patterns **/*test*, **/package.json, and **/Makefile; none were present.
  • Removed the transient state/ fixture and verified cleanup with git status --short.
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@kunchenguid
kunchenguid merged commit 0cfbc84 into main Jun 12, 2026
3 checks passed
@kunchenguid
kunchenguid deleted the feat/watcher-guard branch June 12, 2026 21:19
andrew-kim-techtorch referenced this pull request in andrew-kim-techtorch/firstmate Jul 7, 2026
…hment requirement

Proven live on PR #11 and PRs #6-#8: github.com/<owner>/<repo>/raw/<sha>/<path>
renders inline for authenticated members on private repos; raw.githubusercontent.com
does not. Attachment upload (browser-only) is no longer needed.

Convention: commit PNGs to docs/pr-screenshots/<task-id>/ and reference via
github.com/<owner>/<repo>/raw/<commit-sha>/<path> in the PR body table.

fm-pr-body-check --ui now accepts github.com/.../raw/... URLs in addition to
existing GitHub attachment URL patterns; blob links still fail.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
andrew-kim-techtorch referenced this pull request in andrew-kim-techtorch/firstmate Jul 7, 2026
)

* feat(bin): add PR body conventions to ship briefs and body-check script

Add a PR body conventions block to ship briefs (no-mistakes and direct-PR
modes) so crewmates always receive clear guidance: lead with the requirement
satisfied, use rendered screenshots from raw.githubusercontent.com or GitHub
attachments (never local /var/folders/private/tmp/Users paths), and present
before/after side by side in a table.

Add bin/fm-pr-body-check.sh that firstmate runs before relaying any PR as
ready; --ui mode also asserts at least one rendered image is present.
Wire a one-line reference into AGENTS.md section 7 PR ready.
Add tests/fm-pr-body-check.test.sh covering the full pass/fail matrix.

* fix(bin): correct PR screenshot convention for private repos

raw.githubusercontent.com URLs do not render inline on private repos
(GitHub image proxy cannot authenticate). Update the ship-brief PR body
conventions and fm-pr-body-check to reflect the correct approach:

- Commit screenshots under docs/pr-screenshots/<task-id>/ and reference
  them as clickable blob links; authenticated reviewers can open these.
- Flag in the PR body when inline rendering is wanted so a human can
  upload images as GitHub attachments (browser drag-drop only).
- fm-pr-body-check now always fails on raw.githubusercontent.com refs,
  in addition to local filesystem paths.
- --ui screenshot detection expanded to match blob links to image files
  as well as inline GitHub attachment images.
- 11 tests covering the full pass/fail matrix.

* fix(bin): require GitHub attachment URLs for --ui inline screenshots

Blob links (github.com/.../blob/...) open in a browser tab but do not
render inline in the PR body. The universal inline method for any GitHub
repo (public or private) is GitHub attachments, served from
user-attachments/assets or <owner>/<repo>/assets URLs.

Update ship-brief conventions: attachment URLs required for inline
rendering; commit source PNGs under docs/pr-screenshots/ for history;
flag the need for a human to perform the browser drag-drop upload.

Update fm-pr-body-check --ui: pass only when the body contains at least
one attachment-style URL; blob links no longer satisfy the check.
10 tests covering the full pass/fail matrix.

* chore: ignore .serena/ tool state directory

* no-mistakes(review): fail loudly on PR body fetch errors in fm-pr-body-check

* no-mistakes(document): docs: sync pr-body-check script into scripts, tests, and brief-contract docs

* fix(bin): use github.com/raw/<sha> for inline screenshots, drop attachment requirement

Proven live on PR #11 and PRs #6-#8: github.com/<owner>/<repo>/raw/<sha>/<path>
renders inline for authenticated members on private repos; raw.githubusercontent.com
does not. Attachment upload (browser-only) is no longer needed.

Convention: commit PNGs to docs/pr-screenshots/<task-id>/ and reference via
github.com/<owner>/<repo>/raw/<commit-sha>/<path> in the PR body table.

fm-pr-body-check --ui now accepts github.com/.../raw/... URLs in addition to
existing GitHub attachment URL patterns; blob links still fail.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
LoneExile added a commit to LoneExile/firstmate that referenced this pull request Jul 20, 2026
Must-fix kunchenguid#8 (3a0f568) added a per-target mutex around fm-send's type+submit so
two callers racing into one pane (e.g. several Quartermaster /set-sail handoffs
into the captain's pane) cannot interleave keystrokes, but nothing exercised it.

tests/fm-send-lock.test.sh runs two fm-send processes at the SAME resolved target
concurrently; the tmux backend stub records how many callers are inside the type
step at once. Serialized => never more than one => no overlap. A second case
sends to two DIFFERENT targets and asserts overlap IS present, proving the lock
is keyed per resolved target rather than one global lock. Neutering the lock
acquire makes the same-target case fail (overlap cnt=2); restored it passes.
vipentti pushed a commit to vipentti/firstmate that referenced this pull request Aug 5, 2026
…guid#8)

* feat: guard watcher liveness across all harnesses

* no-mistakes(document): Document watcher guard

* no-mistakes(lint): Fix shell lint issues
NewAiCoder referenced this pull request in NewAiCoder/firstmate Sep 26, 2026
…ling (#8)

* feat(waiting): workers declare a wait and a deterministic when source rings them

D5: no-mistakes ship workers end their turn on a declared paused: wait
instead of foreground-sleeping between axi status polls. fm-spawn.sh arms
a per-task when source (bin/fm-nm-state-condition.sh) whose condition
polls a projection of axi status outside any model turn and rings the
task's steering inbox on a real state change; fm-teardown.sh retires it.
fm-dod-lib.sh's no-mistakes Definition of done is rewritten to match.

tests/fm-brief.test.sh's quota-efficiency assertions are updated to pin
the new no-sleep/end-your-turn contract instead of the retired sleep 600
paragraph they were pinning; no other behavior in that suite changed.

Not run in this task on firstmate instruction (shellcheck was starving
the host and got the production build gate killed twice): bin/fm-lint.sh
and any standalone shellcheck pass over the changed scripts. The
no-mistakes pipeline lints this branch before merge.

Left for a live lane, not attempted in this isolated worktree: step 12's
one-real-task measurement and telemetry/BASELINE.md delta, which needs a
live fleet dispatch outside this worktree's authority.

* no-mistakes(review): Fix nm-state watch: stable 1 and delete snapshot only on arm success

* no-mistakes(document): docs(scripts): list fm-nm-state-condition.sh in bin/ inventory

* no-mistakes(lint): fix(tests): use if/else instead of SC2015-flagged && || in fm-nm-state-condition.test.sh

* no-mistakes(document): docs(agents): list state/<id>.nm-state in per-task file inventory

* no-mistakes(ci): Root-caused and fixed the "Behavior portable serial 2" CI failure. Failing test: tests/fm-remote-secondmate-lifecycle-e2e.test.sh ("remote retirement did not remove the remote home"), caused by this PR's D5 addition to bin/fm-teardown.sh (the two lines retiring the `nm-state-$ID` watch and removing `$STATE/$ID.nm-state`). Confirmed regression via bisection: passes on base commit 3dcb05a, fails starting at the first D5 commit (e56f523), and disabling just those two lines makes it pass again. Root cause (traced with strace, not guesswork): for a secondmate whose own `$STATE` lives nested inside its home directory, `remove_firstmate_home` correctly deletes the whole home first. The new unconditional call to `fm-procevent-when.sh retire "nm-state-$ID"` runs immediately after — but that script sources `bin/fm-wake-lib.sh`, which does an unconditional top-level `mkdir -p "$STATE"` on load. Since `$STATE` no longer exists, sourcing it resurrects the just-deleted home before teardown returns, so the home never actually disappears even though teardown reports success. Fix: guard the new cleanup block on `$STATE` still existing (`[ -e "$STATE" ] || [ -L "$STATE" ]`), mirroring the existing pattern a few lines below (line ~2990) that already handles this exact "nested remote retirement removed the home" case for other post-removal cleanup. This is a no-op for the intended ship-mode nm-state watch (its `$STATE` is never removed at this point), and skips the now-provably-unsafe call for secondmate teardown once the home is confirmed gone. Verified: bin/fm-test-run.sh tests/fm-remote-secondmate-lifecycle-e2e.test.sh now passes (was reproducibly failing before, both standalone and matching the CI log). Also reran tests/fm-teardown.test.sh, tests/fm-dod-wait.test.sh, tests/fm-nm-state-condition.test.sh, tests/fm-brief.test.sh (the intent-scoped set) — all pass. shellcheck on bin/fm-teardown.sh shows no new findings. bash -n passes. The other failing check, "PR must be raised via no-mistakes", is the documented attestation-check exception (fails only because the pipeline's `test` step shows status=skipped for this push) — no code change is warranted for it; it should clear once this fix lands and the pipeline's test phase completes normally. Only file changed: bin/fm-teardown.sh (9 insertions, 3 deletions). Cleaned up all scratch git worktrees and temp files used for bisection/reproduction

* no-mistakes(test): fix(tests): portable comm locale and hasher fallback for sandboxes lacking shasum/ruby

---------

Co-authored-by: NewAiCoder <170579485+NewAiCoder@users.noreply.github.com>
NewAiCoder referenced this pull request in NewAiCoder/firstmate Sep 26, 2026
…ling (#8)

* feat(waiting): workers declare a wait and a deterministic when source rings them

D5: no-mistakes ship workers end their turn on a declared paused: wait
instead of foreground-sleeping between axi status polls. fm-spawn.sh arms
a per-task when source (bin/fm-nm-state-condition.sh) whose condition
polls a projection of axi status outside any model turn and rings the
task's steering inbox on a real state change; fm-teardown.sh retires it.
fm-dod-lib.sh's no-mistakes Definition of done is rewritten to match.

tests/fm-brief.test.sh's quota-efficiency assertions are updated to pin
the new no-sleep/end-your-turn contract instead of the retired sleep 600
paragraph they were pinning; no other behavior in that suite changed.

Not run in this task on firstmate instruction (shellcheck was starving
the host and got the production build gate killed twice): bin/fm-lint.sh
and any standalone shellcheck pass over the changed scripts. The
no-mistakes pipeline lints this branch before merge.

Left for a live lane, not attempted in this isolated worktree: step 12's
one-real-task measurement and telemetry/BASELINE.md delta, which needs a
live fleet dispatch outside this worktree's authority.

* no-mistakes(review): Fix nm-state watch: stable 1 and delete snapshot only on arm success

* no-mistakes(document): docs(scripts): list fm-nm-state-condition.sh in bin/ inventory

* no-mistakes(lint): fix(tests): use if/else instead of SC2015-flagged && || in fm-nm-state-condition.test.sh

* no-mistakes(document): docs(agents): list state/<id>.nm-state in per-task file inventory

* no-mistakes(ci): Root-caused and fixed the "Behavior portable serial 2" CI failure. Failing test: tests/fm-remote-secondmate-lifecycle-e2e.test.sh ("remote retirement did not remove the remote home"), caused by this PR's D5 addition to bin/fm-teardown.sh (the two lines retiring the `nm-state-$ID` watch and removing `$STATE/$ID.nm-state`). Confirmed regression via bisection: passes on base commit 4c7ace4, fails starting at the first D5 commit (e56f523), and disabling just those two lines makes it pass again. Root cause (traced with strace, not guesswork): for a secondmate whose own `$STATE` lives nested inside its home directory, `remove_firstmate_home` correctly deletes the whole home first. The new unconditional call to `fm-procevent-when.sh retire "nm-state-$ID"` runs immediately after — but that script sources `bin/fm-wake-lib.sh`, which does an unconditional top-level `mkdir -p "$STATE"` on load. Since `$STATE` no longer exists, sourcing it resurrects the just-deleted home before teardown returns, so the home never actually disappears even though teardown reports success. Fix: guard the new cleanup block on `$STATE` still existing (`[ -e "$STATE" ] || [ -L "$STATE" ]`), mirroring the existing pattern a few lines below (line ~2990) that already handles this exact "nested remote retirement removed the home" case for other post-removal cleanup. This is a no-op for the intended ship-mode nm-state watch (its `$STATE` is never removed at this point), and skips the now-provably-unsafe call for secondmate teardown once the home is confirmed gone. Verified: bin/fm-test-run.sh tests/fm-remote-secondmate-lifecycle-e2e.test.sh now passes (was reproducibly failing before, both standalone and matching the CI log). Also reran tests/fm-teardown.test.sh, tests/fm-dod-wait.test.sh, tests/fm-nm-state-condition.test.sh, tests/fm-brief.test.sh (the intent-scoped set) — all pass. shellcheck on bin/fm-teardown.sh shows no new findings. bash -n passes. The other failing check, "PR must be raised via no-mistakes", is the documented attestation-check exception (fails only because the pipeline's `test` step shows status=skipped for this push) — no code change is warranted for it; it should clear once this fix lands and the pipeline's test phase completes normally. Only file changed: bin/fm-teardown.sh (9 insertions, 3 deletions). Cleaned up all scratch git worktrees and temp files used for bisection/reproduction

* no-mistakes(test): fix(tests): portable comm locale and hasher fallback for sandboxes lacking shasum/ruby

---------

Co-authored-by: NewAiCoder <170579485+NewAiCoder@users.noreply.github.com>
NewAiCoder referenced this pull request in NewAiCoder/firstmate Sep 26, 2026
…ling (#8)

* feat(waiting): workers declare a wait and a deterministic when source rings them

D5: no-mistakes ship workers end their turn on a declared paused: wait
instead of foreground-sleeping between axi status polls. fm-spawn.sh arms
a per-task when source (bin/fm-nm-state-condition.sh) whose condition
polls a projection of axi status outside any model turn and rings the
task's steering inbox on a real state change; fm-teardown.sh retires it.
fm-dod-lib.sh's no-mistakes Definition of done is rewritten to match.

tests/fm-brief.test.sh's quota-efficiency assertions are updated to pin
the new no-sleep/end-your-turn contract instead of the retired sleep 600
paragraph they were pinning; no other behavior in that suite changed.

Not run in this task on firstmate instruction (shellcheck was starving
the host and got the production build gate killed twice): bin/fm-lint.sh
and any standalone shellcheck pass over the changed scripts. The
no-mistakes pipeline lints this branch before merge.

Left for a live lane, not attempted in this isolated worktree: step 12's
one-real-task measurement and telemetry/BASELINE.md delta, which needs a
live fleet dispatch outside this worktree's authority.

* no-mistakes(review): Fix nm-state watch: stable 1 and delete snapshot only on arm success

* no-mistakes(document): docs(scripts): list fm-nm-state-condition.sh in bin/ inventory

* no-mistakes(lint): fix(tests): use if/else instead of SC2015-flagged && || in fm-nm-state-condition.test.sh

* no-mistakes(document): docs(agents): list state/<id>.nm-state in per-task file inventory

* no-mistakes(ci): Root-caused and fixed the "Behavior portable serial 2" CI failure. Failing test: tests/fm-remote-secondmate-lifecycle-e2e.test.sh ("remote retirement did not remove the remote home"), caused by this PR's D5 addition to bin/fm-teardown.sh (the two lines retiring the `nm-state-$ID` watch and removing `$STATE/$ID.nm-state`). Confirmed regression via bisection: passes on base commit 4c7ace4, fails starting at the first D5 commit (e56f523), and disabling just those two lines makes it pass again. Root cause (traced with strace, not guesswork): for a secondmate whose own `$STATE` lives nested inside its home directory, `remove_firstmate_home` correctly deletes the whole home first. The new unconditional call to `fm-procevent-when.sh retire "nm-state-$ID"` runs immediately after — but that script sources `bin/fm-wake-lib.sh`, which does an unconditional top-level `mkdir -p "$STATE"` on load. Since `$STATE` no longer exists, sourcing it resurrects the just-deleted home before teardown returns, so the home never actually disappears even though teardown reports success. Fix: guard the new cleanup block on `$STATE` still existing (`[ -e "$STATE" ] || [ -L "$STATE" ]`), mirroring the existing pattern a few lines below (line ~2990) that already handles this exact "nested remote retirement removed the home" case for other post-removal cleanup. This is a no-op for the intended ship-mode nm-state watch (its `$STATE` is never removed at this point), and skips the now-provably-unsafe call for secondmate teardown once the home is confirmed gone. Verified: bin/fm-test-run.sh tests/fm-remote-secondmate-lifecycle-e2e.test.sh now passes (was reproducibly failing before, both standalone and matching the CI log). Also reran tests/fm-teardown.test.sh, tests/fm-dod-wait.test.sh, tests/fm-nm-state-condition.test.sh, tests/fm-brief.test.sh (the intent-scoped set) — all pass. shellcheck on bin/fm-teardown.sh shows no new findings. bash -n passes. The other failing check, "PR must be raised via no-mistakes", is the documented attestation-check exception (fails only because the pipeline's `test` step shows status=skipped for this push) — no code change is warranted for it; it should clear once this fix lands and the pipeline's test phase completes normally. Only file changed: bin/fm-teardown.sh (9 insertions, 3 deletions). Cleaned up all scratch git worktrees and temp files used for bisection/reproduction

* no-mistakes(test): fix(tests): portable comm locale and hasher fallback for sandboxes lacking shasum/ruby

---------

Co-authored-by: NewAiCoder <170579485+NewAiCoder@users.noreply.github.com>
This was referenced Sep 30, 2026
@SpeakableAuto

Copy link
Copy Markdown

Post-merge live check

The remote second mate's code root only carries bin/fm-quota-snapshot.sh after this merges and the fleet is updated, so the cross-machine path is checked live then:

  1. After the fleet update, read the remote machine's quota through fm-on: bin/fm-quota-snapshot.sh --secondmate <remote-id> must print a valid snapshot (exit 0), not an unavailable line.
  2. Run one dispatch-resolve dry run for a project in that second mate's projects: list, for example bin/fm-dispatch-resolve.sh <brief> --project <listed-project>, and confirm it prints a placement: line and a home: <remote-id> line carrying that machine's own quota evidence.

fritznoff pushed a commit to fritznoff/starship that referenced this pull request Nov 2, 2026
Define one fleet-status contract for guarded Claude, Pi, and Kimi surfaces while preserving Cursor's worker-only boundary.
fritznoff pushed a commit to fritznoff/starship that referenced this pull request Nov 2, 2026
kunchenguid#8)

* feat(todo): let a home list its held backlog decisions in Needs you now

A held_decisions_need_you setting in config/channel-intake keeps a home's
captain-held backlog decisions out of the collapsed Firstmate tooling
approvals fold. With it on, a firstmate-backlog alias alone no longer marks
a line as tooling; the firstmate label, a firstmate: alias and the tooling
flag still do. Default off, so existing pages render as before.

* no-mistakes(review): Drop unused held_decisions_need_you from settings subcommand output

* no-mistakes(ci): I fixed the Lint 1 failure. It was ShellCheck warning SC2034 at bin/fm-channel-intake.sh:441: `CFG_HELD_NEED_YOU` is assigned but never read. The rule it broke is that any variable a script assigns must also be read. `fm-channel-intake.sh` owns `config/channel-intake`, so it has to accept the `held_decisions_need_you` key and check it. Otherwise it would stop with "unknown config key". But only `bin/fm-todo-render.sh` reads the value, and it passes it on to the composer. That made the intake script's copy of the variable dead. I checked every other place the setting is handled. The renderer's `CFG_HELD_NEED_YOU` is assigned and passed to `fm-todo-compose.py` at render_page, so it is used and I left it alone. The composer reads it as an argument, and nothing else touches the setting. The fix removes the dead variable and keeps the check. In `bin/fm-channel-intake.sh` I deleted the `CFG_HELD_NEED_YOU=false` default, and the `held_decisions_need_you` case now accepts `true|false` without assigning anything. Any other value still stops the script with "held_decisions_need_you must be true or false". The header comment, the renderer and the composer are unchanged. The earlier decision to drop the key from the `settings` subcommand output still stands. Checks I ran locally: - `shellcheck -x` on both scripts is clean. - `bash bin/fm-lint.sh bin/fm-channel-intake.sh bin/fm-todo-render.sh` exits 0 with full extended analysis, which is the CI mode. - `tests/fm-todo.test.sh`, `tests/fm-channel-intake.test.sh` and `tests/fm-todo-render.test.sh` all pass. That includes the two tests for this setting: with it off, a held backlog decision stays in the tooling fold; with it on, it shows in "Needs you now". I did not commit the change
ghazni101 pushed a commit to ghazni101/firstmate-dsh that referenced this pull request Nov 18, 2026
… panes' (kunchenguid#8) from fm/herdr-presentation-from-dsh into main
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.

3 participants