Skip to content

feat(herdr): opt-in project groups with status tags and sorted agents view - #7303

Closed
thelad-dev wants to merge 7 commits into
kunchenguid:mainfrom
thelad-dev:fm/herdr-gruppierung-ship
Closed

thelad-dev wants to merge 7 commits into
kunchenguid:mainfrom
thelad-dev:fm/herdr-gruppierung-ship

Conversation

@thelad-dev

@thelad-dev thelad-dev commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Intent

Herdr soll Arbeitsbereiche optional nach Projekt gruppieren und mit Status kennzeichnen und dazu eine sortierte Agentenansicht bieten. Die Gruppierung ist opt-in: ohne die Konfigurationsdatei config/herdr-project-groups verhaelt sich alles genau wie vorher - Spawn uebergibt einen leeren Gruppenschluessel, die Projektionsreihenfolge behaelt die Platzierung am Blockende, und Watcher und Spawn rufen das Gruppenskript nicht auf. Die Synchronisation im Watcher ist reine Darstellung und loest keine Benachrichtigung aus. Vererbung gibt nur eine Datei weiter, die die primaere Instanz schon angelegt hat. Es entsteht keine neue Workflow-, Secret- oder Netzwerkflaeche. Am uebrigen Verhalten soll sich nichts aendern.

In dieser Runde kommt kein neues Verhalten hinzu. Die Anhebung von PORTABLE_SERIAL_MAX_WEIGHT_MS und die daran haengenden Hinweise, Tests und Dokumentationsstellen zu den seriellen Shards sind wieder heraus; sie gehoeren zum repoweiten Thema aus #6790 und nicht hierher. Von der Testinfrastruktur bleibt nur, was die neue Suite selbst braucht: ihre Hinweiszeile und ein kollationssicherer comm-Aufruf in der Abdeckungspruefung. Zusaetzlich sind die leeren Array-Durchlaeufe in bin/fm-herdr-groups.sh fuer Bash 3.2 unter set -u abgesichert.

What Changed

  • Add opt-in Herdr project groups via config/herdr-project-groups, with bin/fm-herdr-groups.sh planning/syncing display-only fm_* pane and workspace tokens, status ranks, and a firstmate/projects agents view over protocol 22.
  • Wire spawn and watch producers to tag new tasks immediately and reconcile once per poll; place newly projected workspaces by fm_group_order inside the parent block, and inherit the setting into secondmate homes.
  • Document the contract and add offline coverage in tests/fm-herdr-groups.test.sh plus herdr backend ordering cases, with locale-safe comm fixes in the test runner.

Risk Assessment

✅ Low: The Bash 3.2 empty-array abort is fixed at the three reported sites, and the remaining project-groups paths are well-bounded display-only logic with safe off-by-default guards.

Testing

Exercised the Herdr project-groups public CLI and the Bash 3.2 empty-array fix end-to-end: all fm-herdr-groups cases passed (including zero-task plan/sync and all-invalid rules fallback), the backend herdr suite passed with group-key placement ok, a fake-herdr CLI transcript showed plan/sync token reporting and agents-view set plus sidebar rows, and docker bash 3.2 reproduced the pre-fix unbound TASKS[@] failure while the fixed script exited 0 with empty plan output.

Evidence: End-user fm-herdr-groups CLI transcript (plan/sync/order-key/sidebar)

Source: End-user fm-herdr-groups CLI transcript (plan/sync/order-key/sidebar)

=== 1) plan with setting on and ZERO herdr tasks (empty TASKS path) ===
exit=0
stdout_repr=''

=== 2) rules file: only invalid rules => RULE_GROUP stays empty; plan/resolve still OK ===
exit=0
output:
warning: herdr project groups: /tmp/fm-herdr-groups-e2e.njXSPc/home/config/herdr-project-groups: ignoring rule with invalid group name "Bad/Name" (letters, digits, . _ + - only)
warning: herdr project groups: /tmp/fm-herdr-groups-e2e.njXSPc/home/config/herdr-project-groups: ignoring rule with invalid group name "!!!" (letters, digits, . _ + - only)
web-a	storefront	running	999.storefront.3.web-a	999.storefront

=== 3) first valid rule line starts with empty RULE_GROUP (load_setting first append path) ===
exit=0
output:
web-a	Web	running	001.Web.3.web-a	001.Web

=== 4) order-key for rule group and unmatched fallback ===
order-key web-new => exit=0 out=001.Web
order-key loose   => exit=0 out=999.tools

=== 5) sync with on + live panes: report tokens + agents view set ===
exit=0
sync_stdout=''
--- herdr report calls ---
herdr status --json --session s1
herdr workspace list --session s1
herdr pane list --session s1
herdr pane report-metadata w2:p2 --source firstmate --token fm_group=storefront --token fm_state=running --token fm_task=web-a --token fm_sort=000.storefront.3.web-a --session s1
herdr session list --json --session s1
--- agents view log ---
/tmp/fm-groups-s1.sock	set

=== 6) sidebar-config print (operator-facing rows) ===
exit=0

# Firstmate project groups (docs/herdr-backend.md "Project groups").
[ui.sidebar.spaces]
rows = [
  ["state_icon", "workspace"],
  [{ token = "$fm_group", bold = true }, "$fm_state"],
]

[ui.sidebar.agents]
rows = [
  ["state_icon", { token = "$fm_group", bold = true }, "$fm_state", "$fm_task"],
]
Evidence: Bash 3.2 post-fix empty-array CLI paths

Source: Bash 3.2 post-fix empty-array CLI paths

bash version: GNU bash, version 3.2.57(1)-release (x86_64-pc-linux-musl)
=== A: plan on, zero tasks ===
exit=0 out_len=0 out=''
=== B: only-invalid rules then plan with one task (empty RULE_GROUP during load + resolve) ===
exit=0
warning: herdr project groups: /tmp/case/home/config/herdr-project-groups: ignoring rule with invalid group name "Bad/Name" (letters, digits, . _ + - only)
warning: herdr project groups: /tmp/case/home/config/herdr-project-groups: ignoring rule with invalid group name "!!!" (letters, digits, . _ + - only)
web-a	storefront	running	999.storefront.3.web-a	999.storefront
=== C: first rule with empty RULE_GROUP start ===
exit=0
web-a	Web	running	001.Web.3.web-a	001.Web
=== D: order-key ===
exit=0 out=001.Web
--- unguarded empty array on bash 3.2 ---
start
survived_bang
bash: TASKS[@]: unbound variable
start
start
survived_plus
survived_while
Evidence: Bash 3.2 before/after empty TASKS[@] summary

Source: Bash 3.2 before/after empty TASKS[@] summary

Bash 3.2 empty-array regression (docker bash:3.2)
------------------------------------------------
Unguarded empty TASKS[@] under set -u:
bash: TASKS[@]: unbound variable

Guarded form used by cmd_plan:
survived

Pre-fix fm-herdr-groups.sh plan with on + zero tasks:
PRE-FIX zero tasks plan:
exit=1 out=/tmp/case/fm-herdr-groups.pre.sh:\ line\ 284:\ TASKS\[@\]:\ unbound\ variable

Post-fix fm-herdr-groups.sh plan with on + zero tasks:
=== A: plan on, zero tasks ===
exit=0 out_len=0 out=''
=== B: only-invalid rules then plan with one task (empty RULE_GROUP during load + resolve) ===

Post-fix first rule / all-invalid / order-key on bash 3.2: all exit 0 (see herdr-groups-bash32-empty-array.txt)
Evidence: fm-herdr-groups.test.sh run log

Source: fm-herdr-groups.test.sh run log

FM_TEST_BEGIN 2026-10-15T10:27:04Z tests/fm-herdr-groups.test.sh family=unclassified expected_gate_skip=none
ok - absent or off setting: no plan, no key, and not a single Herdr call
ok - on with zero tasks: plan and sync stay quiet and exit 0
ok - on: one group per project, status order needs-captain, problem, running, done
ok - rules: line order sets group order; task prefix beats repo beats catch-all; bad rules warn
ok - all-invalid rules: empty RULE_GROUP still plans via project fallback
ok - sync: reports only drifted tokens, workspace tokens only on the exact projection, view set on change
ok - sync: an older Herdr protocol warns once and stays inactive
ok - clear: removes this home's tokens and the agents view after the feature is turned off
ok - sidebar-config: prints rows; --apply backs up, appends once, never reloads Herdr
ok - agent view helper: exactly agent.view.set and agent.view.clear for source firstmate
ok - watcher: one poll cycle reconciles the project-group tags
FM_TEST_END 2026-10-15T10:27:13Z tests/fm-herdr-groups.test.sh exit=0 duration_ms=8990 gate_skip=false
FM_TEST_SUMMARY total=1 failed=0 skipped_gate=0 duration_ms=9045
FM_TEST_SUMMARY_FAMILY family=unclassified count=1 duration_ms=8990 failed=0
FM_TEST_SLOWEST rank=1 script=tests/fm-herdr-groups.test.sh duration_ms=8990
Evidence: fm-backend-herdr.test.sh run log (group-key ordering ok)

Source: fm-backend-herdr.test.sh run log (group-key ordering ok)

FM_TEST_BEGIN 2026-10-15T10:27:23Z tests/fm-backend-herdr.test.sh family=backend-dispatch expected_gate_skip=none
ok - fm_backend_herdr_version_check: accepts the current protocol (14)
ok - fm_backend_herdr_version_check: refuses an old protocol loudly
ok - fm_backend_herdr_version_check: refuses loudly when herdr is not installed
ok - fm_backend_herdr_workspace_label: a primary home (no marker) resolves to 'firstmate'
ok - fm_backend_herdr_workspace_label: a secondmate home (.fm-secondmate-home) resolves to '2ndmate-<id>'
ok - fm_backend_herdr_workspace_label: trims whitespace around the marker's secondmate id
ok - fm_backend_herdr_workspace_label: an empty marker file falls back to the primary label 'firstmate'
ok - fm_backend_herdr_workspace_label: two different secondmate homes get two different, non-colliding labels
ok - fm_backend_herdr_cli: sets HERDR_SESSION AND appends a trailing --session flag on every call
ok - herdr client selection: a live pane behind a stale shadowing client reads alive
ok - herdr recovery-grade read: a stopped server means missing there, and nowhere else
ok - herdr stale registration: a shell-only pane with a lingering Pi record is agent-free with an explicit reason
ok - herdr stale registration: no registered status can outrank a shell-only process view
ok - herdr pane agent session: a resumable reference is reported with the agent label that reported it
ok - herdr pane agent session: anything unresumable degrades to a nonzero read with no output
ok - herdr stale registration: a registered agent with a live Pi foreground process still reads alive
ok - herdr stale registration: only a shell-only pane demotes a registration
ok - herdr stale registration: a transient prompt helper settles into stale-agent instead of reading live
ok - herdr stale registration: an exhausted settle window still reads a non-shell foreground as live
Terminated
ok - herdr stale registration: an agent process outside the foreground group still counts as alive
Terminated
ok - herdr stale registration: the descendant walk reads a spaced executable path whole
/home/<user>/.no-mistakes/worktrees/0f2624469d68/01M4ZG85ARKXRZRNA3N48JNV1G/bin/backends/herdr.sh: line 2179: [: : integer expression expected
/home/<user>/.no-mistakes/worktrees/0f2624469d68/01M4ZG85ARKXRZRNA3N48JNV1G/bin/backends/herdr.sh: line 2179: [: : integer expression expected
/home/<user>/.no-mistakes/worktrees/0f2624469d68/01M4ZG85ARKXRZRNA3N48JNV1G/bin/backends/herdr.sh: line 2179: [: : integer expression expected
ok - herdr stale registration: an unreadable process view refuses instead of guessing either way
ok - herdr stale registration: an empty foreground list over a real shell is not unreadable, it settles via the descendant walk
ok - herdr stale registration: presentation reclaim never closes a stale-registration pane
ok - herdr stale registration: busy_state proves a working record at process level before reporting busy
ok - herdr client selection: one selected client is reused per process
ok - herdr client selection: selected clients remain scoped to their session
ok - herdr client selection: only protocol_mismatch triggers reselection; other failures pass through untouched
ok - herdr client selection: the happy path makes no extra call
ok - herdr client status: .server.compatible, legacy protocol equality, unknown, and stopped shapes all normalize
ok - fm_backend_herdr_launcher_identity: a firstmate not running inside herdr has no launcher workspace to inherit
ok - fm_backend_herdr_launcher_identity: HERDR_ENV=1 without a pane id selects the backend but binds no parent
ok - fm_backend_herdr_launcher_identity: resolves the launcher's exact workspace even when a same-labeled workspace sorts first
ok - fm_backend_herdr_launcher_identity: refuses a launcher pane that names a different herdr session
ok - fm_backend_herdr_launcher_identity: refuses a claimed pane without exact server identity
ok - fm_backend_herdr_launcher_identity: refuses a launcher pane whose injected socket belongs to another herdr server
ok - fm_backend_herdr_launcher_identity: refuses when the launcher's own pane no longer resolves
ok - fm_backend_herdr_launcher_identity: refuses when the launcher's pane and tab disagree about their workspace
ok - fm_backend_herdr_launcher_identity: refuses when the launcher's workspace is gone from its own session
ok - fm_backend_herdr_workspace_ensure: places a worker in the launcher's exact workspace, not the first same-labeled one
ok - fm_backend_herdr_workspace_ensure: refuses to guess between two same-labeled home workspaces
ok - fm_backend_herdr_workspace_ensure: a --secondmate container resolves that home's own workspace, not the launcher's
ok - fm_backend_herdr_container_ensure: surfaces the exact ambiguous-placement refusal instead of a generic failure
ok - fm_backend_herdr_container_ensure: version-gates, starts the server, ensures the firstmate workspace, echoes session:workspace_id + the seeded default tab id
ok - fm_backend_herdr_server_ensure: scrubs home and harness identity without disturbing unrelated environment or session routing
ok - fm_backend_herdr_container_ensure: reuses an existing firstmate workspace without recreating it, and reports no seeded default tab (adopted, not created)
ok - fm_backend_herdr_container_ensure: workspace create passes --no-focus
ok - fm_backend_herdr_container_ensure: creates the workspace under the SECONDMATE home's own label, not 'firstmate'
ok - fm_backend_herdr_create_task: prunes exactly the seeded default tab container_ensure identified, once the first real task tab exists
ok - herdr repeated spawn/teardown: one persistent firstmate workspace reused, zero orphans, default tab pruned, create ran once
ok - fm_backend_herdr_create_task: an ADOPTED workspace's pre-existing tab is never pruned (the created-vs-adopted gate)
ok - fm_backend_herdr_create_task: the label-collision startup-workspace scenario (2026-07-02 incident) leaves the captain's live tab untouched
ok - fm_backend_herdr_workspace_prune_seeded_default_tab: refuses to close the seeded default tab when its pane reports a working agent (defense in depth)
ok - fm_backend_herdr_create_task: refuses a duplicate tab label (herdr's own tab create has no uniqueness check)
ok - fm_backend_herdr_create_task: a same-labeled tab with a live (even idle) registered agent still refuses exactly as before
ok - fm_backend_herdr_create_task: scans every same-labeled tab and refuses if any duplicate is live
ok - fm_backend_herdr_create_task: closes and replaces a same-labeled tab whose pane is dead (pane_not_found)
ok - fm_backend_herdr_create_task: closes and replaces a same-labeled tab whose pane is alive but hosts no registered agent (a restored plain shell)
ok - fm_backend_herdr_create_task: closes every confirmed same-labeled husk only after creating the replacement
ok - fm_backend_herdr_create_task: refuses success when a preexisting husk tab remains after replacement
ok - fm_backend_herdr_create_task: refuses (fail-safe) rather than guessing when the duplicate's agent state cannot be classified confidently
ok - fm_backend_herdr_create_task: creates the replacement tab BEFORE closing the husk tab, never the reverse
ok - fm_backend_herdr_create_task: creates a tab and parses tab_id/pane_id from the JSON response, prunes nothing when no seeded tab id is given
ok - fm_backend_herdr_create_task: tab create passes --no-focus
ok - herdr presentation: a home that set nothing gets the projection by default at or above the floor
ok - herdr presentation: an unconfigured home below the floor falls back flat with one naming warning
ok - herdr presentation: an unreadable client release falls back flat instead of guessing
ok - herdr presentation: a deliberate opt-in is never silently downgraded below the floor
ok - herdr presentation: an explicit off opts the home out
ok - herdr presentation: an unrecognized value warns and follows the default instead of failing a spawn
ok - herdr presentation: the below-floor warning is one per home per release, not one per spawn
ok - herdr presentation: warning marker publication is atomic, symlink-safe, and fails visible
ok - herdr presentation: client and selected server floors compose conservatively without overriding explicit opt-in
ok - herdr presentation floor: every measured release, and each signal alone, classifies correctly
ok - herdr presentation floor: either signal alone can carry an above verdict, and each divergence is real
ok - herdr presentation: config parsing separates a deliberate choice from an unconfigured default
ok - herdr presentation journal: atomically publishes one non-authoritative 128-bit correlator and refuses overwrite
ok - herdr presentation journal: version 2 binds exact home/endpoint/parent identities and advances atomically
ok - herdr presentation create: exact response IDs yield one normal task pane with no workspace-close authority
ok - herdr presentation create: concurrent same-label tabs are never prune targets
ok - herdr presentation focus: snapshot requires one exact active workspace and tab
ok - herdr presentation focus: exact pane close restores the exact prior workspace and tab
ok - herdr presentation focus: cleanup refuses rather than close the tab a live client is viewing
ok - herdr presentation focus: unexpected foreground-client reasons fail closed
ok - herdr presentation focus: cleanup closes a persisted-focused tab when no live client is attached
ok - herdr presentation focus: pane close fails when exact focus restoration fails
ok - herdr presentation reclaim: live agent state at the close boundary refuses mutation
ok - herdr presentation focus: active-tab attachment is rechecked after agent validation
ok - herdr presentation focus: pre-close checkpoint catches a target focused during planning
ok - herdr presentation focus: close preserves a live client that switches away from the target during planning
ok - herdr presentation cleanup: emptying close behind focus ends the exact shell without a move or focus change
ok - herdr presentation cleanup: emptying close before focus moves the doomed workspace to the end and ends its exact shell
ok - herdr presentation cleanup: emptying close with the focused workspace last skips the move
ok - herdr presentation cleanup: emptying close of the last workspace skips the move
ok - herdr presentation cleanup: a non-emptying close stays plain with no proof, move, or signal
ok - herdr presentation cleanup: no-move plain close requires structured pane removal
ok - herdr presentation cleanup: an ambiguous workspace layout falls back to the plain close
ok - herdr presentation cleanup: a failed repositioning move falls back to the plain close with a warning
ok - herdr presentation cleanup: a pane with a live foreground process falls back to the plain close
ok - herdr presentation cleanup: a transient prompt helper settles into the pane-death path instead of the plain close
tests/fm-backend-herdr.test.sh: line 2706: 3444233 Killed                  bash -c 'trap "" HUP; sleep 300'
ok - herdr presentation cleanup: a SIGHUP-surviving shell is escalated to SIGKILL before giving up
tests/fm-backend-herdr.test.sh: line 2744: 3444594 Killed                  bash -c 'trap "" HUP; sleep 300'
ok - herdr presentation cleanup: a failed pane-death close falls back to the plain close
ok - herdr presentation cleanup: the exact-tab restore remains the backstop behind the pane-death close
ok - herdr presentation cleanup: SIGKILL never reaches a pid the exact pane no longer owns
ok - herdr presentation cleanup: every unconfirmed removal restores the exact original workspace order and reports failure
ok - fm_backend_herdr_kill: one session lock covers the focus-safe emptying removal
ok - fm_backend_herdr_kill: killing the focused workspace's tab keeps the legitimate plain close
ok - endpoint confirmed-gone: only structured not-found permits record removal and ambiguous identity refuses
ok - fm_backend_herdr_kill: unavailable session locks defer every pane close
ok - herdr presentation focus: projected seeded pruning refuses the active tab
ok - herdr presentation labels: └ concise-task · p:<full-token> for primary and secondmate children
ok - herdr presentation ordering: exact new workspace appends to the primary block while focus and relative orders stay stable
ok - herdr presentation ordering: secondmate children append under their owning parent block
ok - herdr presentation ordering: a group key places only the new workspace inside its group, untagged children stay ahead
ok - herdr presentation ordering: a foreign legacy child is warning-only and read-only
ok - herdr presentation ordering: intervening parent child blocks remain traversable
ok - herdr presentation ordering: only the exact new id moves; human spaces keep relative order
ok - herdr presentation ordering: move failure warns, returns success, and grants no cleanup authority
ok - herdr presentation ordering: an ambiguous existing worker block is warning-only and read-only
ok - herdr presentation ordering: the launcher's exact parent workspace id disambiguates a duplicated home label without moving anything
ok - herdr presentation ordering: a foreign new-format child is warning-only and read-only
ok - herdr presentation ordering: missing owning parent is warning-only and read-only
ok - herdr presentation lock: one path per session/socket across homes
ok - herdr presentation lock: null and missing socket paths fail closed
ok - herdr presentation ordering: malformed socket metadata is warning-only and read-only
ok - herdr presentation reclaim: legacy, cross-home, ambiguous, live/unknown, and focus-unknown cases refuse without mutation
Evidence: Bash 3.2 empty-array probe and pre-fix failure

Source: Bash 3.2 empty-array probe and pre-fix failure

version: GNU bash, version 3.2.57(1)-release (x86_64-pc-linux-musl)
len=0
bang_ec=0 bang_out=
empty_TASKS_at_ec=1 out=bash: line 12: TASKS[@]: unbound variable
set_empty_TASKS_at_ec=1 out=bash: line 17: TASKS[@]: unbound variable
plus_ec=0 out=ok
while_ok
PRE-FIX zero tasks plan:
exit=1 out=/tmp/case/fm-herdr-groups.pre.sh:\ line\ 284:\ TASKS\[@\]:\ unbound\ variable
PRE-FIX first rule load + plan:
exit=0 out=$'/tmp/case/fm-herdr-groups.pre.sh: line 197: /tmp/case/fm-wake-lib.sh: No such file or directory\nweb-a\tWeb\trunning\t001.Web.3.web-a\t001.Web'

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-herdr-groups.sh:147 - Under set -u, stock macOS Bash 3.2 treats empty ${!arr[@]} / ${arr[@]} as unbound (the repo already documents and guards this elsewhere). Concrete failure: any config/herdr-project-groups rules file hits for i in &#34;${!RULE_GROUP[@]}&#34; while the array is still empty on the first rule line, so load_setting aborts before any rule is stored; rules mode never works on Bash 3.2. The same pattern appears at resolve_group (line 169) when RULE_GROUP is empty after all-invalid rules, and at cmd_plan (line 287) when there are zero Herdr tasks (fm-herdr-groups.sh plan should print nothing and exit 0). The file already uses the safe ${sels[@]+&#34;${sels[@]}&#34;} form for selectors. Earliest fix: use the same + guard (or a length check before the loop) for RULE_GROUP indices and TASKS iterations.

🔧 Fix: Guard empty-array loops for Bash 3.2
✅ Re-checked - no issues remain.

✅ **Test** - passed

✅ No issues found.

  • bin/fm-test-run.sh tests/fm-herdr-groups.test.sh (including new zero-task plan and all-invalid rules cases)
  • bin/fm-test-run.sh tests/fm-backend-herdr.test.sh (includes group-key presentation ordering)
  • manual CLI transcript of fm-herdr-groups.sh plan/sync/order-key/sidebar-config against a fake herdr
  • docker run bash:3.2 pre-fix vs post-fix empty TASKS[@] / zero-task plan regression
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@thelad-dev
thelad-dev force-pushed the fm/herdr-gruppierung-ship branch from 4e7352e to 59dff03 Compare October 14, 2026 19:15
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate (OSS triage, not the captain).

Thank you @thelad-dev. This is a nicely contained presentation feature, and the off path is easy to verify.

  • Diff review: a new bin/fm-herdr-groups.sh and bin/backends/herdr-agent-view.py (talks only to the local Herdr Unix socket), hooks in fm-spawn.sh / fm-watch.sh, an optional group key for fm_backend_herdr_projection_order_best_effort, inheritance in fm-config-inherit-lib.sh, plus docs and tests. No workflow, secret, or network surface.
  • Contract-class: opt-in (my own read). Every hook is behind [ ! -e "$CONFIG/herdr-project-groups" ]. With the file absent, spawn passes an empty group key, and the projection order keeps the block-end placement exactly as before. The watcher and spawn never call the script. Inheritance only propagates a file the primary has already created. The watcher sync is display-only and never raises a wake.
  • VISION.md: aligns. It's a presentation convenience that composes with Herdr, it's opt-in, and it isn't in the captaincy's way. Mechanics stay in scripts, Herdr is one of several session managers, and it stays in command-layer scope.

One blocker (waiting on you): the required "PR must be raised via no-mistakes" check failed on 59dff034 (This PR was not raised through no-mistakes). The attestation in the body still shows the pr step as running, and there's no ## Intent section, so it looks like the pipeline didn't finish writing the body. Could you re-raise through no-mistakes (git push no-mistakes) so the check verifies? Everything else in CI is green.

Live validation: 4 of 5 is a good spread. If you can, while re-raising, please drive the one untested scenario live and post the evidence: a newly spawned workspace landing once at the end of its project group, with only that workspace moving. It's the only part that moves anything in Herdr. If that isn't practical, a sentence on why the offline coverage is enough is fine.

Once the no-mistakes check is green on the new head, this is on the auto-merge path as an opt-in. No rush, and thanks again!

denladdi and others added 2 commits October 15, 2026 06:35
…ts view

Add config/herdr-project-groups (absent or off: unchanged behavior). When on,
Firstmate tags each Herdr task pane, and its own projected workspace, with
display-only fm_group/fm_state/fm_task/fm_sort tokens, sets a Herdr agents
view sorted by group then status (needs-captain, problem, running, done), and
places a new projected task at the end of its own group inside the parent
block with the same single verified move as before.

The watcher reconciles tags once per poll and a spawn tags its task at once;
bin/fm-herdr-groups.sh also previews (plan), clears, and prints or appends
suggested sidebar rows with a backup. Covered by offline tests only.
@thelad-dev
thelad-dev force-pushed the fm/herdr-gruppierung-ship branch from 59dff03 to f0ee8da Compare October 15, 2026 04:49
@thelad-dev thelad-dev changed the title feat(herdr): opt-in project groups with status tags and a sorted agents view feat(herdr): opt-in project groups with status tags and sorted agents view Oct 15, 2026
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate (OSS triage, not the captain).

Thanks for the re-raise, @thelad-dev. The body now has its ## Intent section, and full CI on the new head 97ec2184 is green.

Contract-class: still opt-in (my own read of the tip against main a24f4cb8, which is 3 ahead and 0 behind). Every product hook is still behind config/herdr-project-groups: the spawn order key and post-spawn sync, the watcher sync, and the optional <group-order-key> for fm_backend_herdr_projection_order_best_effort, which with an empty key keeps the block-end placement. The new herdr-agent-view.py talks only to the local Herdr Unix socket. No workflow, secret, or network surface. VISION alignment is unchanged from my last pass.

Two things on the new head, both waiting on you:

  1. no-mistakes attestation doesn't bind to the head. The required "PR must be raised via no-mistakes" check fails with Pipeline attestation head_sha does not match the current PR head (attestation f0ee8da1, head 97ec2184). The body still shows the pr step running and ci pending, so the pipeline's CI-fix commit landed after the attestation was written. If the pipeline is still finishing, it may refresh the body on its own. Otherwise, a fresh git push no-mistakes will rebind it.
  2. The CI-fix commit brings in an unrelated test-infra policy change. 97ec2184 ("no-mistakes: apply CI fixes") raises PORTABLE_SERIAL_MAX_WEIGHT_MS in bin/fm-test-run.sh from 1200000 to 1715043. That removes the stated "leave at least ten minutes of the normal CI tier" headroom against the 30-minute tier. It also bumps the fm-supervision-host hint and rewrites the matching tests and docs/fm-test-portable-shards.md. That's the repo-wide serial-shard problem tracked in CI fails fm-remote-reply.test.sh on commits that later pass, and cancels Behavior portable serial 2 at 30 minutes #6790, which other PRs are already working on, and it has nothing to do with project groups. Could you drop that commit, keeping only the tests/fm-herdr-groups.test.sh hint your new suite needs, and re-raise? A slow fm-supervision-host shard on main isn't something this PR needs to fix. If a serial shard times out, say so here and we can re-run it.

Live validation (still optional): if it's practical while re-raising, a short live check of a newly spawned workspace landing at the end of its project group, with only that workspace moving, would round out the evidence. If not, a sentence on why the offline coverage is enough is fine.

Once the no-mistakes check is green on a head without the unrelated shard-policy change, this is back on the auto-merge path as an opt-in. Thanks again!

ladwein added 3 commits October 15, 2026 08:26
Die Anhebung von PORTABLE_SERIAL_MAX_WEIGHT_MS auf 1715043, der nachgezogene
Hinweis fuer tests/fm-supervision-host.test.sh und die daran haengenden Stellen
in tests/fm-test-run.test.sh und docs/fm-test-portable-shards.md gehoeren nicht
zu den Projektgruppen. Sie betreffen das repoweite Problem der seriellen Shards
und bleiben dort, wo es behandelt wird. Von der Testinfrastruktur bleibt nur,
was die neue Suite selbst braucht: ihre Hinweiszeile und der Kollationsfix der
Abdeckungspruefung.

Die Abdeckungspruefung bleibt mit dem alten Budget von 1200000 gruen; der
groesste modellierte serielle Shard liegt bei 1074843 ms.
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: noting the new tip 563f71ca — attestation now matches the head and full CI (including no-mistakes) is green. Thank you for the rebind.

The unrelated PORTABLE_SERIAL_MAX_WEIGHT_MS 1200000→1715043 change (and the matching fm-supervision-host hint / tests / docs) is still on this tip, same as my prior note. Still waiting on dropping that shard-policy piece (keep only the fm-herdr-groups hint your suite needs) and re-raising via no-mistakes. Contract-class stays opt-in; once that scope is clean this is back on auto-merge. The optional live placement check from before still stands if practical — no new ask.

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate (OSS triage, not the captain).

Thanks @thelad-dev. Dropping the shard-budget change was exactly what I was hoping for. On head d4a04067, PORTABLE_SERIAL_MAX_WEIGHT_MS and the fm-supervision-host hint are back to main's values. What's left in bin/fm-test-run.sh is your suite's own hint plus the small LC_ALL=C comm collation fix with its test, which is fine. The attestation matches the head, and full CI, including Require no-mistakes, is green. The branch is MERGEABLE/CLEAN, 12 commits behind main with no conflict.

Contract-class: opt-in (my own read of the tip against main 7099556d). Every product hook is still behind config/herdr-project-groups: the watcher sync, the spawn order-key and post-spawn sync, and the optional <group-order-key>. With that key empty, fm_backend_herdr_projection_order_best_effort keeps the block-end placement. Inheritance only propagates a file the primary already has. herdr-agent-view.py talks only to the named local Herdr Unix socket. I found no workflow, secret, or network surface.

VISION.md, rule by rule: One captain (aligns — an opt-in presentation convenience that composes with Herdr). Authority explicit (aligns — off unless the home turns it on). Scripts own the mechanics (aligns). Restart a non-event (aligns — tags and the view are re-derived from disk on the next poll). Delegation with a spine (aligns). Outlives any vendor (aligns — Herdr is one of several backends, and older protocols warn and stay inactive. VISION also asks adapters to earn trust through verification, see below). Scope (aligns).

One thing left, waiting on you: live validation. Your own "Verification status" section in docs/herdr-backend.md says the tags, the agents view, and the placement move haven't been run against a real Herdr server yet. All the evidence in the body is from a scripted Herdr CLI and socket helper. This feature is the first to call report-metadata and agent.view.set on a live Herdr, so we'd love one real run before it lands. When you get a chance, could you turn the feature on in a home with Herdr 0.9.3 and post the output or screenshots for the hand check your doc already describes?

  1. After one watcher poll, herdr pane list shows the fm_* tokens on each task pane.
  2. The agents list header reads projects, with tasks ordered by group and then status.
  3. A newly spawned projected task appears after the other tasks in its group, with no other workspace moving and no focus change.
  4. fm-herdr-groups.sh clear removes the tokens and the view again.

Re-raising through no-mistakes with that evidence in the body works just as well. Once it's posted, please also update the "Verification status" paragraph (and the "only verified release" line) to match. This is on the opt-in auto-merge path once the live evidence is here. No rush, and thanks again!

@thelad-dev

Copy link
Copy Markdown
Contributor Author

Superseded by #7434, which resubmits this change without the unrelated test-infrastructure edit, as requested.

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