Skip to content

feat: show every worker's status on the live board - #66

Merged
doitdigital0495 merged 2 commits into
mainfrom
fm/live-board-worker-status
Oct 11, 2026
Merged

doitdigital0495 merged 2 commits into
mainfrom
fm/live-board-worker-status

Conversation

@doitdigital0495

Copy link
Copy Markdown
Owner

Intent

The live board is the firstmate project page that groups work into the captain's named projects: one card per project with three lanes, real captain questions, a per-project timeline of pull requests, a DEV, UAT and PROD strip, a table of contents and collapsible cards (PRs #60 to #64, merged).
The captain said in chat on 2026-10-11: "Make sure that in the live lavish board I can see the status of all workers too. Like are they working, waiting for validation, etc. Please implement this into the live lavish baord so I can zoom into what all workers are doing high over."
Context: he sees many workers (the main home and the persistent AI assistant secondmate home run about 40 between them) and cannot tell which are working, which wait on validation or a merge, which wait on him, and which are finished and idle.

What Changed

  • The live board gains a Workers section: every task that has a worker gets one of seven plain statuses (working, waiting for validation, waiting for a merge or CI, waiting on you, paused on an outside wait, finished and idle, stuck or stopped), with a count per status that filters a by-project list. Each row carries a one-sentence explanation, the kind of work, the worker's last note and its pull request link. The rule lives in lb_worker_status in bin/fm-live-board-projects.jq and only words the state the snapshot already resolved.
  • fm-fleet-snapshot.sh --live-board-input now also reads each registered local secondmate home's own board input, in parallel and read-only, each bounded by the new FM_SNAPSHOT_BOARD_HOMES_TIMEOUT (default 30 seconds). The result lands in registered_homes[] and coverage.registered_homes. A home that is remote, invalid or not read in time is disclosed on the board instead of silently dropped, and a registered home's own registered homes are not followed.
  • Registered homes contribute workers only: the project cards still show this home's work, and the board says so. docs/architecture.md and docs/configuration.md are updated for the new scope, and the snapshot, board and render-harness tests cover the new statuses, the registered-home reads and the filtering.

Risk Assessment

✅ Low: Additive, read-only Workers section that satisfies the intent (all workers, main and local secondmate homes, plain statuses, filterable); only defects are one rare mislabel of an already-merged PR and a minor row open-state desync, both small fixes.

Testing

Built an isolated firstmate home with nine workers in different states and a registered second mate home with two more, ran the real fm-live-board.sh build, and drove the resulting page in headless Chrome at 1280 px and 390 px: counts, filtering by pressed count, pressing again and All, opening rows, phone-width fold, second mate grouping with its pull request link, and the notice for a second mate that could not be read. A second page, built with the real snapshot, view and template from the collector's input with two workers' resolved state set to a running review and a green pull request, showed all seven statuses. The two live-board test files (tests/fm-live-board.test.sh, tests/fm-live-board-snapshot.test.sh) also passed. Six screenshots, the two driver scripts and a transcript are in the evidence directory; the fixture and browser session were removed and the worktree is clean. Not driven: keeping the pressed count and open rows across a Lavish live reload in a real Lavish frame, and a second mate home that times out.

  • Live validation: ✅ go - 8 of 10 scenarios driven live against the product
Scenario Result Live Evidence
Captain opens the live board and sees a Workers section with one count per status and every worker listed by project with a plain status ✅ pass live 01-workers-all-desktop.png; transcript.md page 1: 11 workers, counts 5 working / 1 waiting on you / 1 paused on an outside wait / 2 finished and idle / 2 stuck or stopped, grouped under Webshop, Help…
Captain presses a status count and the list narrows to only those workers; pressing it again or All shows everyone ✅ pass live 02-filter-stuck-desktop.png; transcript.md: stuck -> 2 rows in Webshop, pressed again -> All 11, finished -> 2 rows across Webshop and Help desk
Captain presses a worker row and reads what the status means and the worker's last report ✅ pass live 03-rows-open-desktop.png; transcript.md: four rows opened, each with its explanation and last report; the worker with no readable state says so and shows no report
A second mate home's workers appear in the counts and the list under their project, with the second mate named and the pull request linked ✅ pass live 01-workers-all-desktop.png: Help desk group badged 'Second mate: Ai desk' with 2 workers and a pull request link; both are in the All 11 total
Adversarial: a registered second mate home that cannot be read is named on the page instead of being counted as empty ✅ pass live 01-workers-all-desktop.png: 'The workers of second mate Lost desk are not shown: its registration could not be checked.'
On a phone-width page the worker list starts folded under its counts, and pressing a count opens it on those workers ✅ pass live 04-phone-folded.png and 05-phone-filter-you.png at 390 px; no sideways scroll
Adversarial: no task id, internal state label, home path or worktree name reaches the Workers section ✅ pass live transcript.md: browser check of the section text found none (leak: false) on both desktop and phone loads
A worker whose work is under automatic review shows Waiting for validation, and one with a green unmerged pull request shows Waiting for a merge or CI ✅ pass live 06-all-seven-statuses-desktop.png; transcript.md page 2. The page ran the real snapshot, view and template in Chrome, but the two workers' resolved state was set in the collected input by drive-run-st…
The pressed count, folded list and open rows survive a Lavish live reload of the board ⏸️ untested no Lavish restores the hidden field only inside a real Lavish session; opening one means fm-live-board.sh open against the machine's live Lavish server, which this gate run did not have authority to bi…
A registered second mate home that is not read within FM_SNAPSHOT_BOARD_HOMES_TIMEOUT is named on the page ⏸️ untested no Needs a second mate home whose own board input read hangs; no honest way to make a real home slow was available without stubbing the collector. The same notice path was driven live for a home that fai…

Workers section, all 11 workers, desktop

Evidence: Transcript of what was driven and read from the page

Source: Transcript of what was driven and read from the page

# Live board Workers section - what was driven

Fixture: a throwaway firstmate home and one registered second mate home, built by `drive-fixture.sh`.
The page was built by the real `bin/fm-live-board.sh build` and opened in headless Chrome through `chrome-devtools-axi`.
Every result below was read from the page in the browser after real clicks.

## Page 1: `board.html` from `fm-live-board.sh build`

Resolved states the collector reported for the main home:

`` `
c-doing     working  pane        harness busy (claude-hook)
w-ask       parked   status-log  which courier should we use for the launch
w-doing     working  pane        harness busy (claude-hook)
w-finished  done     status-log  product page tidied and checked on a phone
w-lost      unknown  none        no current-state source available
w-merge     working  pane        harness busy (claude-hook)
w-paused    paused   status-log  waiting for the supplier to publish their release
w-stuck     blocked  status-log  the payment sandbox keeps refusing our test card
w-val       working  pane        harness busy (claude-hook)
`` `

Workers section on load, 1280 px (`01-workers-all-desktop.png`):

`` `
Workers 11
The workers of second mate Lost desk are not shown: its registration could not be checked.
All 11 | 5 working | 1 waiting on you | 1 paused on an outside wait | 2 finished and idle | 2 stuck or stopped
Webshop 6:    Stuck or stopped x2, Finished and idle, Waiting on you, Paused on an outside wait, Working
Help desk (Second mate: Ai desk) 2:  Finished and idle (with pull request link), Working (Investigation)
Claims portal 3:  Working x3
`` `

Press "2 stuck or stopped" (`02-filter-stuck-desktop.png`):

`` `
pressed: 2 stuck or stopped
summary: 2 stuck or stopped, by project
groups:  Webshop 2
rows:    Fix the payment error; Speed up search
`` `

Press it again: pressed is "All 11" and all 11 rows show.

Press "2 finished and idle":

`` `
summary: 2 finished and idle, by project
groups:  Webshop 1; Help desk Second mate: Ai desk 1
rows:    Tidy the product page; Wrap up the desk report (pull request)
`` `

Press "All 11", then press four rows (`03-rows-open-desktop.png`):

`` `
Speed up search                 -> Its current state could not be read.
Tidy the product page           -> It is done and can be cleaned up. Last report: product page tidied and checked on a phone
Set up the courier integration  -> It asked for a decision before it can go on. Last report: which courier should we use for the launch
Wait for the supplier release   -> It paused itself until something outside the team is ready. Last report: waiting for the supplier to publish their release
`` `

Phone width 390 px, fresh load (`04-phone-folded.png`): six counts show, the list is folded, no row shows, no sideways scroll.
Press "1 waiting on you" (`05-phone-filter-you.png`): the list opens on the one row "Set up the courier integration".

No task id, state-source label, home path or worktree name appears in the section text.

## Page 2: `board-run-states.html` (`06-all-seven-statuses-desktop.png`)

"Waiting for validation" and "Waiting for a merge or CI" are read from a real no-mistakes run, which a throwaway home cannot hold.
`drive-run-states.sh` took the board input the real collector produced, set the resolved state of two workers to `working / run-step / validating (running)` and `done / run-step / checks green: PR ready for review (still monitoring for merge/close)`, and ran the real snapshot, view and template.
The state resolver itself (`bin/fm-crew-state.sh`) is not part of this change and was not driven for these two workers.

`` `
All 11 | 3 working | 1 waiting for validation | 1 waiting for a merge or CI | 1 waiting on you |
1 paused on an outside wait | 2 finished and idle | 2 stuck or stopped
Add the claim form              -> Waiting for validation: Its work is being reviewed and checked automatically.
Export claims to a spreadsheet  -> Waiting for a merge or CI: Its pull request is ready and waits to be merged.
`` `
Evidence: Fixture driver: homes, workers, real build

Source: Fixture driver: homes, workers, real build

#!/usr/bin/env bash
# Evidence driver: builds a throwaway firstmate home plus one registered second
# mate home, gives their tasks workers in different states, and runs the real
# `bin/fm-live-board.sh build`. Usage: drive-fixture.sh <worktree> <fixture-root>
set -euo pipefail
ROOT=$1
FX=$2
# shellcheck disable=SC1091
. "$ROOT/tests/lib.sh"
trap - EXIT INT TERM HUP QUIT

make_home() {
  local home="$FX/$1" fakebin
  mkdir -p "$home/data" "$home/state" "$home/config" "$home/projects"
  chmod 700 "$home" "$home/data" "$home/state" "$home/config"
  cp "$ROOT/.tasks.toml" "$home/.tasks.toml"
  printf '## In flight\n\n## Queued\n\n## Done\n' > "$home/data/backlog.md"
  fakebin=$(fm_fakebin "$home")
  fm_fake_exit0 "$fakebin" tmux treehouse no-mistakes gh gh-axi lavish-axi
  printf '%s\n' "$home"
}
in_home() {
  local home=$1
  shift
  PATH="$home/fakebin:$PATH" FM_ROOT_OVERRIDE="$ROOT" FM_HOME="$home" \
    FM_STATE_OVERRIDE="$home/state" FM_DATA_OVERRIDE="$home/data" \
    FM_CONFIG_OVERRIDE="$home/config" FM_PROCEVENT_CLAIM_ROOT="$home/procevent-claims" \
    LAVISH_AXI_NO_OPEN=1 "$@"
}
tasks_in() { local home=$1; shift; (cd "$home" && tasks-axi "$@" >/dev/null); }
worker() {  # <home> <id> <busy|idle> [meta-line...]
  local home=$1 id=$2 now=$3 gen event=stop
  shift 3
  mkdir -p "$home/projects/wt-$id"
  fm_write_meta "$home/state/$id.meta" 'kind=ship' 'harness=claude' "window=firstmate:fm-$id" \
    "worktree=$home/projects/wt-$id" "$@"
  gen=$("$ROOT/bin/fm-busy-event.sh" arm "$home/state" "$id")
  [ "$now" = idle ] || event=user-prompt-submit
  "$ROOT/bin/fm-busy-event.sh" apply "$home/state" "$id" "$now" --gen "$gen" --source claude-hook --event "$event"
}

home=$(make_home main)
mate=$(make_home mate)
mkdir -p "$mate/bin"
printf '# Firstmate fixture\n' > "$mate/AGENTS.md"
printf 'ai-desk\n' > "$mate/.fm-secondmate-home"
printf -- '- shop [no-mistakes] - fixture (added 2026-01-01)\n- claims [no-mistakes] - fixture (added 2026-01-01)\n' > "$home/data/projects.md"
printf -- '- ai-desk - fixture (home: %s; scope: fixture; projects: desk; added 2026-07-11)\n- lost-desk - fixture (home: %s/no-such-home; scope: fixture; projects: desk; added 2026-07-11)\n' \
  "$mate" "$FX" > "$home/data/secondmates.md"
printf '%s\n' '{"schema":"fm-live-board-projects.v1","projects":[{"name":"Webshop","match":[{"repo":"shop"}]},{"name":"Claims portal","match":[{"repo":"claims"}]},{"name":"Help desk","match":[{"repo":"desk"}]}]}' \
  > "$home/config/live-board-projects.json"
printf '%s\n' '{"schema":"fm-live-board-config.v1","enabled":true,"refresh_seconds":60}' > "$home/config/live-board.json"

for row in 'w-doing|busy|shop|Build the new checkout' 'w-stuck|idle|shop|Fix the payment error' \
  'w-paused|idle|shop|Wait for the supplier release' 'w-finished|idle|shop|Tidy the product page' \
  'w-lost|idle|shop|Speed up search' 'w-ask|idle|shop|Set up the courier integration' \
  'w-val|busy|claims|Add the claim form' 'w-merge|busy|claims|Export claims to a spreadsheet' \
  'c-doing|busy|claims|Rework the claims inbox'; do
  IFS='|' read -r id now repo title <<<"$row"
  tasks_in "$home" add "$id" "$title" --repo "$repo" --kind ship --start
  worker "$home" "$id" "$now" "project=$repo"
done
stamp=$(date +%s)
printf 'working [at=%s]: wiring the basket into the new checkout page\n' "$stamp" > "$home/state/w-doing.status"
printf 'blocked [at=%s]: the payment sandbox keeps refusing our test card\n' "$stamp" > "$home/state/w-stuck.status"
printf 'paused [at=%s]: waiting for the supplier to publish their release\n' "$stamp" > "$home/state/w-paused.status"
printf 'done [at=%s]: product page tidied and checked on a phone\n' "$stamp" > "$home/state/w-finished.status"
printf 'needs-decision [at=%s]: which courier should we use for the launch\n' "$stamp" > "$home/state/w-ask.status"
printf 'working [at=%s]: building the claim form fields\n' "$stamp" > "$home/state/w-val.status"
printf 'working [at=%s]: writing the spreadsheet export\n' "$stamp" > "$home/state/w-merge.status"
printf 'working [at=%s]: sorting the inbox by urgency\n' "$stamp" > "$home/state/c-doing.status"

tasks_in "$mate" add cr-answer "Answer the refund question" --repo desk --kind scout --start
tasks_in "$mate" add cr-wrap "Wrap up the desk report" --repo desk --kind ship --start
tasks_in "$mate" add cr-waiting "Not started yet" --repo desk --kind ship
worker "$mate" cr-answer busy 'kind=scout' 'project=desk'
worker "$mate" cr-wrap idle 'project=desk' 'pr=https://github.com/acme/desk/pull/7'
printf 'done [at=%s]: desk report written and checked\n' "$stamp" > "$mate/state/cr-wrap.status"

in_home "$home" "$ROOT/bin/fm-live-board.sh" build
in_home "$home" "$ROOT/bin/fm-fleet-snapshot.sh" --live-board-input > "$FX/input.json"
Evidence: Driver for the validation and merge page

Source: Driver for the validation and merge page

#!/usr/bin/env bash
# Evidence driver, second page. Validation and merge/CI statuses are read from a
# real no-mistakes run, which a throwaway home cannot hold. This takes the board
# input the real collector produced for the fixture home, sets the resolved
# current state of two workers to the readings bin/fm-crew-state.sh emits for a
# running review and a green pull request, and then runs the same steps
# `fm-live-board.sh build` runs: the real snapshot, the real view and the shipped
# template. Usage: drive-run-states.sh <worktree> <fixture-root>
set -euo pipefail
ROOT=$1
FX=$2
jq '(.tasks[] | select(.id == "w-val") | .current_state)
      |= . + {state:"working",source:"run-step",detail:"validating (running)"}
  | (.tasks[] | select(.id == "w-merge") | .current_state)
      |= . + {state:"done",source:"run-step",detail:"checks green: PR ready for review (still monitoring for merge/close)"}' \
  "$FX/input.json" > "$FX/input-run-states.json"
"$ROOT/bin/fm-live-board-snapshot.sh" --json --input "$FX/input-run-states.json" > "$FX/snapshot-run-states.json"
map=$(cat "$FX/main/config/live-board-projects.json")
jq -c -L "$ROOT/bin" --argjson map "$map" 'include "fm-live-board-projects";
  {refresh_seconds:60, view:lb_view($map),
   board:(if (.pull_requests.repos | type) == "array" then .pull_requests.repos |= map(del(.prs)) else . end)}' \
  "$FX/snapshot-run-states.json" > "$FX/payload.json"
json=$(cat "$FX/payload.json")
printf '%s' "${json//</\\u003c}" > "$FX/payload.json"
BOARD_DATA="$FX/payload.json" perl -pe 'BEGIN { local $/; open my $f, "<", $ENV{BOARD_DATA} or die; $data = <$f>; close $f }
  s/^__FM_LIVE_BOARD_DATA__$/$data/' "$ROOT/bin/fm-live-board-template.html" > "$FX/board-run-states.html"
jq -c '.view.workers.statuses' "$FX/payload.json"
- Outcome: ⚠️ 1 info across 1 run (4m41s)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

⚠️ **Review** - 2 issues (1 warning, 1 info)
  • ⚠️ bin/fm-live-board-projects.jq:237 - lb_worker_status labels a worker whose PR is already merged as "Waiting for a merge or CI". Trace: bin/fm-crew-state.sh:765 (nm_reclassify_failed_run_as_held_green) emits state=done, source=run-step, detail "checks green: PR merged (ci monitor ended): <url>"; the done branch tests checks green|^run passed: PR open, matches "checks green", returns "merge", and lb_worker_say then prints "Its pull request is ready and waits to be merged." Correct status is "finished" (done, not cleaned up), so the captain is told to wait for a merge that already happened and the finished/merge counts are both off by one. Fix at the one rule: in the done branch treat a detail containing "PR merged" as finished before the checks-green test (e.g. if ($detail | test(&#34;PR merged&#34;)) then &#34;finished&#34; elif ($detail | test(&#34;checks green|^run passed: PR open&#34;)) then &#34;merge&#34; else &#34;finished&#34; end). Same rule feeds lb_worker_say (merge sentence) and the workers.statuses counts; no other site needs a change. Add a harness case with that detail.
  • ℹ️ bin/fm-live-board-template.html:1179 - The row's summary click listener records an open/close for every click that bubbles to it, including a click on the "pull request" link inside the summary. A browser follows the link and does not toggle the <details>, but pressRow still stores the row as toggled in the hidden workers field; on the next live reload (about a minute) syncCrew opens a row the captain never opened, or closes one that was open. Fix: ignore clicks whose target is inside the anchor (or record state from the details' toggle event instead of the summary click). The list summary listener at line 1313 has no nested link and is unaffected.
⚠️ **Test** - 1 info
  • ℹ️ bin/fm-live-board-projects.jq - The same task reads two ways on one page. A worker that asked for a decision in its own report (current state parked from status-log) is 'Waiting on you' in the Workers section, while its project card's Charted next lane says 'Stuck, needs help' and the page totals still say 0 questions for you. Seen live on the fixture task 'Set up the courier integration' (01-workers-all-desktop.png). The lane wording predates this change; the captain may want the two to agree.
  • Live validation: ✅ go - 8 of 10 scenarios driven live against the product
Scenario Result Live Evidence
Captain opens the live board and sees a Workers section with one count per status and every worker listed by project with a plain status ✅ pass live 01-workers-all-desktop.png; transcript.md page 1: 11 workers, counts 5 working / 1 waiting on you / 1 paused on an outside wait / 2 finished and idle / 2 stuck or stopped, grouped under Webshop, Help…
Captain presses a status count and the list narrows to only those workers; pressing it again or All shows everyone ✅ pass live 02-filter-stuck-desktop.png; transcript.md: stuck -> 2 rows in Webshop, pressed again -> All 11, finished -> 2 rows across Webshop and Help desk
Captain presses a worker row and reads what the status means and the worker's last report ✅ pass live 03-rows-open-desktop.png; transcript.md: four rows opened, each with its explanation and last report; the worker with no readable state says so and shows no report
A second mate home's workers appear in the counts and the list under their project, with the second mate named and the pull request linked ✅ pass live 01-workers-all-desktop.png: Help desk group badged 'Second mate: Ai desk' with 2 workers and a pull request link; both are in the All 11 total
Adversarial: a registered second mate home that cannot be read is named on the page instead of being counted as empty ✅ pass live 01-workers-all-desktop.png: 'The workers of second mate Lost desk are not shown: its registration could not be checked.'
On a phone-width page the worker list starts folded under its counts, and pressing a count opens it on those workers ✅ pass live 04-phone-folded.png and 05-phone-filter-you.png at 390 px; no sideways scroll
Adversarial: no task id, internal state label, home path or worktree name reaches the Workers section ✅ pass live transcript.md: browser check of the section text found none (leak: false) on both desktop and phone loads
A worker whose work is under automatic review shows Waiting for validation, and one with a green unmerged pull request shows Waiting for a merge or CI ✅ pass live 06-all-seven-statuses-desktop.png; transcript.md page 2. The page ran the real snapshot, view and template in Chrome, but the two workers' resolved state was set in the collected input by drive-run-st…
The pressed count, folded list and open rows survive a Lavish live reload of the board ⏸️ untested no Lavish restores the hidden field only inside a real Lavish session; opening one means fm-live-board.sh open against the machine's live Lavish server, which this gate run did not have authority to bi…
A registered second mate home that is not read within FM_SNAPSHOT_BOARD_HOMES_TIMEOUT is named on the page ⏸️ untested no Needs a second mate home whose own board input read hangs; no honest way to make a real home slow was available without stubbing the collector. The same notice path was driven live for a home that fai…
  • bash drive-fixture.sh &lt;worktree&gt; &lt;fixture&gt; - throwaway main home (9 workers, 2 projects) plus registered second mate home (2 workers) and one unregistrable home, then real bin/fm-live-board.sh build and bin/fm-fleet-snapshot.sh --live-board-input
  • chrome-devtools-axi open file://.../main/data/live-board/board.html at 1280x1600 - read Workers section text and screenshot
  • Clicked the 2 stuck or stopped count, clicked it again, clicked 2 finished and idle, clicked All 11 - read pressed button, list summary, visible groups and rows after each
  • Clicked four worker rows open - read each row's status explanation and last report
  • chrome-devtools-axi resize 390 844 and reload - list folded, no sideways scroll; clicked 1 waiting on you - list opened on that one row
  • Checked the Workers section text in the browser for task ids, state-source labels, home paths and worktree names - none present
  • bash drive-run-states.sh &lt;worktree&gt; &lt;fixture&gt; - real bin/fm-live-board-snapshot.sh --json --input, real lb_view, shipped template, with two workers' resolved state set to validating (running) and checks green: PR ready for review; opened in Chrome and read counts and both opened rows
  • bash tests/fm-live-board.test.sh
  • bash tests/fm-live-board-snapshot.test.sh
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

…filter a by-project list

The live board gains a Workers section between the table of contents and the
project cards. A row of counts says how many workers are working, waiting for
validation, waiting for a merge or CI, waiting on the captain, paused on an
outside wait, finished and idle, or stuck or stopped; each count is a button
that narrows the list under it. The list groups workers by project, leads with
what needs cleaning up, and opens a pressed row on what that status means and
the worker's last report.

The status is worded from the current state the snapshot already resolved
(lb_worker_status in bin/fm-live-board-projects.jq); nothing is classified
anew. Workers of registered secondmate homes are included: the board input now
reads each registered local home's own board input, read-only and bounded by
FM_SNAPSHOT_BOARD_HOMES_TIMEOUT, and a home that is remote, invalid or not read
in time is named on the page instead of counted as empty.
@doitdigital0495
doitdigital0495 merged commit b45b513 into main Oct 11, 2026
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