Skip to content

Fix /statusline install bugs on macOS/BSD (v1.5.1) - #4

Merged
gering merged 2 commits into
mainfrom
knowledge-system/statusline-install-fixes
May 12, 2026
Merged

Fix /statusline install bugs on macOS/BSD (v1.5.1)#4
gering merged 2 commits into
mainfrom
knowledge-system/statusline-install-fixes

Conversation

@gering

@gering gering commented May 12, 2026

Copy link
Copy Markdown
Owner

Summary

Three bugs found while migrating a manual ~/.claude/statusline.sh to the plugin-managed version on macOS. All three caused silent failures — the install reported success but the status line broke in different ways. Patch bump 1.5.0 → 1.5.1.

Bug 1 — BSD awk writes empty file

BSD awk (macOS default) rejects newlines inside -v variable values with a newline in string warning and produces empty output. mv then silently overwrites the target with zero bytes. bash -n "" passes (empty script is syntactically valid), so the install's verify step did not catch it.

Fix: prescribe python3 (always available on macOS/Linux) for the marker block mutation. Explicitly forbid awk -v "$multiline_var" in the SKILL.md. Add post-write checks: file non-empty + marker count exactly 1 + BEGIN line < END line, in that order, before bash -n.

Bug 2 — placeholder placed before OUT= initialization

If the user drops # {{cks}} before the line that initializes $OUT, the injected marker block runs against an empty accumulator and the subsequent OUT="..." overwrites the cks contribution. No error — cks just disappears.

Fix: detect via line-number comparison. PLACEHOLDER_LINE must be strictly greater than LAST_OUT_LINE (the line number of the last ^[[:space:]]*OUT= assignment in the file). Abort with a specific error pointing to both line numbers if not.

Bug 3 — symlink target without +x

When ~/.claude/statusline.sh is a symlink managed by stow/chezmoi/etc., the link target may not carry the executable bit. Claude Code execs the command directly via execve, which requires +x on the resolved file. bash ~/.claude/statusline.sh from a test shell works (bash does not need +x), so the bug only surfaces in actual Claude Code sessions — no status line at all, no error.

Fix: resolve the symlink in step 0 (python3 -c "import os,sys; print(os.path.realpath(sys.argv[1]))" "$STATUSLINE"STATUSLINE_TARGET). In preflight, check [ -x "$STATUSLINE_TARGET" ] and auto-chmod +x if missing (with an explanatory message).

Bonus — symlink-aware atomic mv

All mutations now operate on STATUSLINE_TARGET (resolved real path), so the temp file lives on the same filesystem as the destination → os.replace is truly atomic. Previously, a symlink pointing across filesystems could cause mv to fall back to copy+delete or fail outright.

Implementation notes

  • Both install and uninstall now use python3 for in-place edits, never sed -i or awk -v.
  • Step 0 of SKILL.md introduces STATUSLINE_TARGET and a tooling-rationale note that future implementers cannot ignore.
  • Verify step (2e) is now a four-item ordered checklist: non-empty → marker count/order → bash -n → exec bit retained. Restore from named $BACKUP on each failure.
  • Uninstall (5a) mirrors the same Python3 + atomic + verify pattern.

Test plan

  • On macOS with default BSD awk: run install against a real ~/.claude/statusline.sh and verify the file is non-empty after mutation
  • Place # {{cks}} before the host's OUT="..." line, run install → expect abort with line-number-specific error
  • Place # {{cks}} after the last OUT= line, run install → expect successful placement
  • Run install against a ~/.claude/statusline.sh symlink whose target lacks +x → expect auto-chmod + explanatory message
  • Verify the renderer at ~/.claude/cks-statusline.sh is still copied with +x after the install
  • Run uninstall → expect marker block stripped, file still non-empty + executable, bash -n passes
  • Run install then uninstall on a symlinked statusline.sh hosted on a separate filesystem (e.g. stow setup) → expect atomic mv works on the resolved target

🤖 Generated with Claude Code

gering and others added 2 commits May 12, 2026 11:12
SKILL.md hardening — three bugs found while migrating a manual
~/.claude/statusline.sh to the plugin-managed version on macOS:

1. BSD-awk newline-in-variable trap → empty file silently overwrites
   target (bash -n on empty file passes, so verify did not catch it).
   Prescribe python3 for the marker mutation, explicitly forbid awk -v
   for multi-line content. Add post-write verify: file non-empty,
   marker count exactly 1, BEGIN line < END line.

2. # {{cks}} placeholder placed before the host script's `OUT=`
   initialization → marker block runs against an empty $OUT, gets
   overwritten by the subsequent OUT= assignment, cks disappears with
   no error. Detect via line-number compare: PLACEHOLDER_LINE must be
   strictly greater than LAST_OUT_LINE; abort with specific guidance
   if not.

3. ~/.claude/statusline.sh as a symlink with target lacking the +x bit
   → Claude Code execve's directly and fails silently (no statusline
   at all). Resolve via python3 os.path.realpath in step 0, then
   `[ -x "$STATUSLINE_TARGET" ]` check in preflight with auto-chmod.

Bonus: all mutations (install + uninstall) now operate on
STATUSLINE_TARGET (resolved real path) so atomic os.replace lands on
the same filesystem as the file we replace — fixes potential mv
failures for stow/chezmoi-managed setups across mounts.

Patch bump 1.5.0 → 1.5.1: bug fixes only, no behavior changes to the
renderer or the public skill API.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- LAST_OUT_LINE regex now matches OUT+= (was: ^[[:space:]]*OUT=
  which silently misses += appends — same class of bug this PR is
  fixing). Use ^[[:space:]]*OUT[+]?= with rationale inline.
- Replace 4 leftover STATUSLINE refs with STATUSLINE_TARGET:
  status check (line 65), duplicate-block detection (2c), confirm
  message (2f), broken-link diagnostic.
- Add command -v python3 preflight + [ -e $STATUSLINE_TARGET ]
  existence check after realpath (catches broken symlink chains).
- Document INSERT_LINE / START_LINE / END_LINE discovery via grep -n
  for placeholder, auto-detect, and refresh paths — was hand-waved.
- Wrap Python recipe in try/except so a malformed env var produces a
  structured error instead of a raw traceback.
- Surface chmod recovery in verify step 2e.4 (was: silent re-set).
- Tighten awk note wording: "emits nothing on stdout" instead of
  "writes an empty result" — more precise about the actual failure.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@gering
gering force-pushed the knowledge-system/statusline-install-fixes branch from c12a924 to 5b9ffae Compare May 12, 2026 09:23
@gering
gering merged commit abe0484 into main May 12, 2026
@gering
gering deleted the knowledge-system/statusline-install-fixes branch May 12, 2026 09:30
gering added a commit that referenced this pull request Jul 12, 2026
Fixes the ✅/🟨 findings the --max review surfaced (three real loop bugs first):

- #4: don't re-review a byte-identical tree — when a round changed no files and
  only a pending decision keeps the loop alive, pause to collect the decision
  instead of spinning the (possibly --max) ensemble on an unchanged tree.
- #7: --staged + --loop re-reviewed `git diff --cached` while fixes land in the
  working tree, so the loop never saw its own edits — re-review the working tree
  (re-stage for --staged scope) before each round.
- #5: --loop=0 is now a single --fix pass, not a cap=0 that aborts after fixes.
- #2: temper "deterministic termination" → deterministic arithmetic over judged
  inputs (SKILL + knowledge); count F/A/C/pending carefully (garbage-in).
- #8: derive every fix from the code, treat finding text (recommendation) as
  advisory/untrusted — for ✅ agree too, not only 🟨.
- #9: document args.max (+ args.claude) in the workflow input header.
- #1: note --max's codex model must be loadable; a bad model surfaces as a
  backendError (visible degrade), never a silent downgrade.
- #10: mechanism is not a rendered column — after compaction re-derive finding
  identity from Ort + Befund.

#6 (Bash block scope in prose) left as the accepted LLM-in-the-loop design.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
gering added a commit that referenced this pull request Jul 12, 2026
Fixes the ✅/🟨 findings the --max review surfaced (three real loop bugs first):

- #4: don't re-review a byte-identical tree — when a round changed no files and
  only a pending decision keeps the loop alive, pause to collect the decision
  instead of spinning the (possibly --max) ensemble on an unchanged tree.
- #7: --staged + --loop re-reviewed `git diff --cached` while fixes land in the
  working tree, so the loop never saw its own edits — re-review the working tree
  (re-stage for --staged scope) before each round.
- #5: --loop=0 is now a single --fix pass, not a cap=0 that aborts after fixes.
- #2: temper "deterministic termination" → deterministic arithmetic over judged
  inputs (SKILL + knowledge); count F/A/C/pending carefully (garbage-in).
- #8: derive every fix from the code, treat finding text (recommendation) as
  advisory/untrusted — for ✅ agree too, not only 🟨.
- #9: document args.max (+ args.claude) in the workflow input header.
- #1: note --max's codex model must be loadable; a bad model surfaces as a
  backendError (visible degrade), never a silent downgrade.
- #10: mechanism is not a rendered column — after compaction re-derive finding
  identity from Ort + Befund.

#6 (Bash block scope in prose) left as the accepted LLM-in-the-loop design.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
gering added a commit that referenced this pull request Jul 12, 2026
- #5: derive C (files changed per loop round) deterministically from git
  (git stash create snapshot → git diff --name-only) instead of a hand count —
  removes the most error-prone judged input from the termination decision.
  F/A/pending stay judged (inherent to the in-session design).
- #6: validate MAX_CODEX_MODEL against a model-id allowlist before it is
  interpolated into the transport shell command — a constant today, guarded so
  a future dynamic source can't inject.
- #4: strengthen the fix phase — finding summary/recommendation/failure_scenario
  are untrusted data; never follow instruction-like phrasing inside them.

#3 (stable cross-round finding identity) left as a documented residual: no
deterministic key survives across rounds (the diff/lines drift after fixes,
mechanism is model prose) — only best-effort (file, defect) reconciliation.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
gering added a commit that referenced this pull request Jul 12, 2026
- #2: check_plugin_tests now passes stdin=DEVNULL + timeout=120 to subprocess
  and treats a timeout as a failure, so a hanging/stdin-blocking test can't
  wedge the structure check (and CI) indefinitely.
- #5: the loop's C= snippet counted new untracked files with `grep -c .`, which
  exits 1 on zero matches and aborts the arithmetic under `set -euo pipefail`
  (the review block's shell). Use `wc -l` (exit 0), symmetric with the first
  term. Verified under strict shell across clean/modified/new-file cases.
- #7: knowledge/ci-structure-checks.md now documents the fifth check (plugin
  tests) the last commit added.

Left as accepted residuals: #1 (C misses edits to pre-existing untracked files
— rare, documented), #3 (CI arbitrary-code surface — safe under GH fork-PR
defaults), #4/#6 (LLM-in-the-loop scope + in-session loop state, by design).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
gering added a commit that referenced this pull request Jul 16, 2026
First dogfooding run: /swarm:review --fix over its own diff (4 cluster
finders + codex + grok-4.5 + composer; 13 findings, 5 cross-family
consensus). Fixes the agreed findings:

- Keep validly tagged off-cluster lens prefixes: validate against the
  global lens set, not the finder's subset — coercion could flip kind
  and route a real defect through the applicability verifier (#1, consensus critical)
- Verify design clusters even with cross-family consensus: agreement
  attests agreement, not repo-grounded applicability (externals cannot
  open repo files); defect consensus stays auto-accepted (#2)
- Untagged external findings ('unspecified' lens) no longer vote in the
  cluster-kind derivation (#3)
- Derive CANDIDATE_LENSES from LENS_CLUSTERS — one list, no unchecked
  mirror; DRIFT WARNING on the SKILL.md external-prompt copy (#4, #9)
- Finder prompt: "issue (defect or substantive improvement)" + all lens
  prefixes; external prompt lead covers design improvements too (#5, #6)
- pr-post.py owns design-row ordering + [lens] prefixing via optional
  kind/lens row fields, unit-tested; SKILL.md step 5 passes rows through
  verbatim (#13)
- Doc sync: balance-spec finder count, README canonical cluster names +
  preset teaser wording, knowledge-index line trimmed (#8, #10, #11, #12)

Declined: #7 (per-cluster dilutes per-lens depth) — deliberate,
documented cost/coverage trade-off; --max is the depth profile.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126cGxsBYxqgEFH4AcpriNk
gering added a commit that referenced this pull request Jul 16, 2026
Second dogfooding round at the deepest profile (/swarm:review --max --fix:
per-lens split live — gate pruned style, 10 xhigh finders + codex
gpt-5.6-sol@xhigh + grok-4.5 + composer; 24 findings, 10 consensus).
Fixes the agreed findings:

- Never auto-accept an all-untagged consensus cluster: no tagged lens
  backs it, so it is verified like a solo. Verify/auto-accept now derive
  from ONE needsVerify predicate (structural exactly-once partition);
  kind vote in clearer every-form (#1, consensus critical; #21, #22)
- Design verifier sees the finding's recommendation — the proposal the
  applicability rubric actually tests — and carries an escape hatch:
  a genuine defect mis-filed under a design lens is not refuted away
  (#12, #3); "solo" dropped from verifier prompts (#4)
- Untagged findings from multi-lens cluster finders fall back to
  'unspecified' (safe defect bucket), not lenses[0] (#7); merge-agent
  free-text lens validated, majority-member fallback (#9)
- Improvement invitation scoped to design finder units — defect-lens
  finders stay defect-only (#8); merge prompt clusters by issue, not
  only defect (#13); schema descriptions generalized for design
  findings (#14)
- LENS_BRIEF startup assertion (#6); gate prompt interpolates
  LENS_CLUSTERS.design (#19); new test_lens_sync.py guards all lens
  mirrors: SKILL HDR prompt, LENS_BRIEF, pr-post DESIGN_LENSES (#5)
- Workflow assigns stable finding num (defects first, shared sequence);
  presenter/pr-post render it verbatim (#20)
- pr-post.py: design lens is the backup kind signal when the handoff
  drops kind (explicit defect still wins); single-pass partition (#17, #24)
- Balance: REFUTED is its own segment (refuted ⊄ solo since design
  consensus can be refuted) (#2); LOCKED design-table column precedence
  in --loop rounds clarified (#11); "verifies solos" doc sweep across
  manifests/README/knowledge (#4); cluster failure-isolation trade-off
  documented (#10); knowledge index line trimmed (#15)

Declined: #16 (JS test harness for sandbox code; lens-sync test covers
the drift class), #18 (gate-fail under --max runs all lenses — the
documented never-silently-narrower degrade), #23 (micro-opt vs readability).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126cGxsBYxqgEFH4AcpriNk
gering added a commit that referenced this pull request Jul 17, 2026
Address the agreed findings from the local swarm review:

- agent-registry grok probe: add a `gtimeout` fallback so `grok models` is
  time-bounded on stock macOS (only gtimeout ships there), not just where GNU
  `timeout` exists (#1).
- grok availability: a failed/unreachable `grok models` fetch is now inconclusive
  (trust auth, soft note) rather than "unavailable" — a network hiccup no longer
  wrongly blocks launch. Fetch status rides the function's exit code, since a
  command-substitution subshell can't carry a global flag back (#6).
- agent-registry resolve: reject control chars in `--session`, closing the
  newline→forged-`argv=`-line injection through the launch protocol (#2).
- kickoff SKILL manual (non-herdr) block: shell-quote each argv word (the
  codex/grok bootstrap prompt is one word with spaces) instead of space-joining
  (#3); and persist a picker "save as default" on the manual path too, not only
  the herdr path (#4).
- plugin.json: refresh the stale description (dropped the wrong lifecycle verbs,
  mention worker-agent choice) (#8).

Not changed (reviewed, disagreed): /continue's claude-only resume is a
documented degradation; README model-id duplication is accepted human-facing
docs; the CHANGELOG paragraph matches the repo's entry style.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NjTKpmBkXxxYkn7orMfZCC
gering added a commit that referenced this pull request Jul 17, 2026
- default get now VALIDATES the committed value against the registry: a stale/
  removed/attacker-supplied name (from a cloned repo) reads as "no default" →
  picker, instead of routing or bricking every no-flag kickoff (#1). kickoff also
  announces a non-claude project default before launch — visibility, not a prompt,
  so a committed default can't silently route your code off-Claude (#1 security).
- grok probe: when neither `timeout` nor `gtimeout` exists, skip `grok models`
  and return inconclusive (trust auth) rather than risk an unbounded call that
  hangs the picker (#2).
- kickoff argument grammar: `--agent` consumes the next token as its value, so it
  isn't mistaken for the task name (#4).
- agent-registry.sh committed executable (100755), matching herdr-launch.sh, so
  the documented direct invocation works (#5).
- kickoff "Critical" note: step 12 → step 13 cross-ref (launch was renumbered) (#6).
- `supports=` comment marked RESERVED/not-yet-consumed (a seed for the
  orchestration design), not "already driving" degradation (#7).
- herdr-launch bad-mode usage string shows the launch arity incl.
  [agent-selector] (#8).
- continue reopen: note reworded to match behavior (`claude -c` IS always sent)
  and the codex/grok caveat surfaced inline in the success report (#3).

Not changed (reviewed): README model-id duplication (accepted human-facing docs),
CHANGELOG paragraph (matches repo style); per-task worker persistence for a true
per-CLI resume stays a later idea.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NjTKpmBkXxxYkn7orMfZCC
gering added a commit that referenced this pull request Jul 17, 2026
First dogfooding run: /swarm:review --fix over its own diff (4 cluster
finders + codex + grok-4.5 + composer; 13 findings, 5 cross-family
consensus). Fixes the agreed findings:

- Keep validly tagged off-cluster lens prefixes: validate against the
  global lens set, not the finder's subset — coercion could flip kind
  and route a real defect through the applicability verifier (#1, consensus critical)
- Verify design clusters even with cross-family consensus: agreement
  attests agreement, not repo-grounded applicability (externals cannot
  open repo files); defect consensus stays auto-accepted (#2)
- Untagged external findings ('unspecified' lens) no longer vote in the
  cluster-kind derivation (#3)
- Derive CANDIDATE_LENSES from LENS_CLUSTERS — one list, no unchecked
  mirror; DRIFT WARNING on the SKILL.md external-prompt copy (#4, #9)
- Finder prompt: "issue (defect or substantive improvement)" + all lens
  prefixes; external prompt lead covers design improvements too (#5, #6)
- pr-post.py owns design-row ordering + [lens] prefixing via optional
  kind/lens row fields, unit-tested; SKILL.md step 5 passes rows through
  verbatim (#13)
- Doc sync: balance-spec finder count, README canonical cluster names +
  preset teaser wording, knowledge-index line trimmed (#8, #10, #11, #12)

Declined: #7 (per-cluster dilutes per-lens depth) — deliberate,
documented cost/coverage trade-off; --max is the depth profile.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126cGxsBYxqgEFH4AcpriNk
gering added a commit that referenced this pull request Jul 17, 2026
Second dogfooding round at the deepest profile (/swarm:review --max --fix:
per-lens split live — gate pruned style, 10 xhigh finders + codex
gpt-5.6-sol@xhigh + grok-4.5 + composer; 24 findings, 10 consensus).
Fixes the agreed findings:

- Never auto-accept an all-untagged consensus cluster: no tagged lens
  backs it, so it is verified like a solo. Verify/auto-accept now derive
  from ONE needsVerify predicate (structural exactly-once partition);
  kind vote in clearer every-form (#1, consensus critical; #21, #22)
- Design verifier sees the finding's recommendation — the proposal the
  applicability rubric actually tests — and carries an escape hatch:
  a genuine defect mis-filed under a design lens is not refuted away
  (#12, #3); "solo" dropped from verifier prompts (#4)
- Untagged findings from multi-lens cluster finders fall back to
  'unspecified' (safe defect bucket), not lenses[0] (#7); merge-agent
  free-text lens validated, majority-member fallback (#9)
- Improvement invitation scoped to design finder units — defect-lens
  finders stay defect-only (#8); merge prompt clusters by issue, not
  only defect (#13); schema descriptions generalized for design
  findings (#14)
- LENS_BRIEF startup assertion (#6); gate prompt interpolates
  LENS_CLUSTERS.design (#19); new test_lens_sync.py guards all lens
  mirrors: SKILL HDR prompt, LENS_BRIEF, pr-post DESIGN_LENSES (#5)
- Workflow assigns stable finding num (defects first, shared sequence);
  presenter/pr-post render it verbatim (#20)
- pr-post.py: design lens is the backup kind signal when the handoff
  drops kind (explicit defect still wins); single-pass partition (#17, #24)
- Balance: REFUTED is its own segment (refuted ⊄ solo since design
  consensus can be refuted) (#2); LOCKED design-table column precedence
  in --loop rounds clarified (#11); "verifies solos" doc sweep across
  manifests/README/knowledge (#4); cluster failure-isolation trade-off
  documented (#10); knowledge index line trimmed (#15)

Declined: #16 (JS test harness for sandbox code; lens-sync test covers
the drift class), #18 (gate-fail under --max runs all lenses — the
documented never-silently-narrower degrade), #23 (micro-opt vs readability).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126cGxsBYxqgEFH4AcpriNk
gering added a commit that referenced this pull request Jul 17, 2026
- grok probe now always runs BOUNDED: when neither `timeout` nor `gtimeout`
  exists, self-bound with a background killer (fds detached so the command
  substitution doesn't block on it) instead of skipping the check — so a dropped
  model is still caught on hosts without a timeout binary, and the probe still
  can't hang the picker (#1).
- a successful `grok models` that parses to nothing (a reformatted listing that
  dropped the `*` bullet) is treated as inconclusive → availability assumed,
  rather than marking every grok entry unavailable and disabling the backend (#3).
- herdr-launch surfaces resolve's real stderr on exit 2 instead of labelling
  every cause "unknown agent selector" (#5).
- README: `/continue` reopen wording corrected — it always sends `claude -c` and
  the user resumes a codex/grok worker themselves; no automatic per-CLI resume is
  claimed (#2, doc half; per-task persistence stays a later idea).
- marketplace.json work-system description refreshed to match plugin.json (#6).

Not changed: committed-external-default consent gate (#4) — an explicit product
decision to announce, not prompt (a cloned repo can already run hooks/CLAUDE.md).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NjTKpmBkXxxYkn7orMfZCC
gering added a commit that referenced this pull request Jul 17, 2026
Address the agreed findings from the local swarm review:

- agent-registry grok probe: add a `gtimeout` fallback so `grok models` is
  time-bounded on stock macOS (only gtimeout ships there), not just where GNU
  `timeout` exists (#1).
- grok availability: a failed/unreachable `grok models` fetch is now inconclusive
  (trust auth, soft note) rather than "unavailable" — a network hiccup no longer
  wrongly blocks launch. Fetch status rides the function's exit code, since a
  command-substitution subshell can't carry a global flag back (#6).
- agent-registry resolve: reject control chars in `--session`, closing the
  newline→forged-`argv=`-line injection through the launch protocol (#2).
- kickoff SKILL manual (non-herdr) block: shell-quote each argv word (the
  codex/grok bootstrap prompt is one word with spaces) instead of space-joining
  (#3); and persist a picker "save as default" on the manual path too, not only
  the herdr path (#4).
- plugin.json: refresh the stale description (dropped the wrong lifecycle verbs,
  mention worker-agent choice) (#8).

Not changed (reviewed, disagreed): /continue's claude-only resume is a
documented degradation; README model-id duplication is accepted human-facing
docs; the CHANGELOG paragraph matches the repo's entry style.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NjTKpmBkXxxYkn7orMfZCC
gering added a commit that referenced this pull request Jul 17, 2026
- default get now VALIDATES the committed value against the registry: a stale/
  removed/attacker-supplied name (from a cloned repo) reads as "no default" →
  picker, instead of routing or bricking every no-flag kickoff (#1). kickoff also
  announces a non-claude project default before launch — visibility, not a prompt,
  so a committed default can't silently route your code off-Claude (#1 security).
- grok probe: when neither `timeout` nor `gtimeout` exists, skip `grok models`
  and return inconclusive (trust auth) rather than risk an unbounded call that
  hangs the picker (#2).
- kickoff argument grammar: `--agent` consumes the next token as its value, so it
  isn't mistaken for the task name (#4).
- agent-registry.sh committed executable (100755), matching herdr-launch.sh, so
  the documented direct invocation works (#5).
- kickoff "Critical" note: step 12 → step 13 cross-ref (launch was renumbered) (#6).
- `supports=` comment marked RESERVED/not-yet-consumed (a seed for the
  orchestration design), not "already driving" degradation (#7).
- herdr-launch bad-mode usage string shows the launch arity incl.
  [agent-selector] (#8).
- continue reopen: note reworded to match behavior (`claude -c` IS always sent)
  and the codex/grok caveat surfaced inline in the success report (#3).

Not changed (reviewed): README model-id duplication (accepted human-facing docs),
CHANGELOG paragraph (matches repo style); per-task worker persistence for a true
per-CLI resume stays a later idea.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NjTKpmBkXxxYkn7orMfZCC
gering added a commit that referenced this pull request Jul 17, 2026
- grok probe now always runs BOUNDED: when neither `timeout` nor `gtimeout`
  exists, self-bound with a background killer (fds detached so the command
  substitution doesn't block on it) instead of skipping the check — so a dropped
  model is still caught on hosts without a timeout binary, and the probe still
  can't hang the picker (#1).
- a successful `grok models` that parses to nothing (a reformatted listing that
  dropped the `*` bullet) is treated as inconclusive → availability assumed,
  rather than marking every grok entry unavailable and disabling the backend (#3).
- herdr-launch surfaces resolve's real stderr on exit 2 instead of labelling
  every cause "unknown agent selector" (#5).
- README: `/continue` reopen wording corrected — it always sends `claude -c` and
  the user resumes a codex/grok worker themselves; no automatic per-CLI resume is
  claimed (#2, doc half; per-task persistence stays a later idea).
- marketplace.json work-system description refreshed to match plugin.json (#6).

Not changed: committed-external-default consent gate (#4) — an explicit product
decision to announce, not prompt (a cloned repo can already run hooks/CLAUDE.md).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NjTKpmBkXxxYkn7orMfZCC
gering added a commit that referenced this pull request Jul 17, 2026
First dogfooding run: /swarm:review --fix over its own diff (4 cluster
finders + codex + grok-4.5 + composer; 13 findings, 5 cross-family
consensus). Fixes the agreed findings:

- Keep validly tagged off-cluster lens prefixes: validate against the
  global lens set, not the finder's subset — coercion could flip kind
  and route a real defect through the applicability verifier (#1, consensus critical)
- Verify design clusters even with cross-family consensus: agreement
  attests agreement, not repo-grounded applicability (externals cannot
  open repo files); defect consensus stays auto-accepted (#2)
- Untagged external findings ('unspecified' lens) no longer vote in the
  cluster-kind derivation (#3)
- Derive CANDIDATE_LENSES from LENS_CLUSTERS — one list, no unchecked
  mirror; DRIFT WARNING on the SKILL.md external-prompt copy (#4, #9)
- Finder prompt: "issue (defect or substantive improvement)" + all lens
  prefixes; external prompt lead covers design improvements too (#5, #6)
- pr-post.py owns design-row ordering + [lens] prefixing via optional
  kind/lens row fields, unit-tested; SKILL.md step 5 passes rows through
  verbatim (#13)
- Doc sync: balance-spec finder count, README canonical cluster names +
  preset teaser wording, knowledge-index line trimmed (#8, #10, #11, #12)

Declined: #7 (per-cluster dilutes per-lens depth) — deliberate,
documented cost/coverage trade-off; --max is the depth profile.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126cGxsBYxqgEFH4AcpriNk
gering added a commit that referenced this pull request Jul 17, 2026
Second dogfooding round at the deepest profile (/swarm:review --max --fix:
per-lens split live — gate pruned style, 10 xhigh finders + codex
gpt-5.6-sol@xhigh + grok-4.5 + composer; 24 findings, 10 consensus).
Fixes the agreed findings:

- Never auto-accept an all-untagged consensus cluster: no tagged lens
  backs it, so it is verified like a solo. Verify/auto-accept now derive
  from ONE needsVerify predicate (structural exactly-once partition);
  kind vote in clearer every-form (#1, consensus critical; #21, #22)
- Design verifier sees the finding's recommendation — the proposal the
  applicability rubric actually tests — and carries an escape hatch:
  a genuine defect mis-filed under a design lens is not refuted away
  (#12, #3); "solo" dropped from verifier prompts (#4)
- Untagged findings from multi-lens cluster finders fall back to
  'unspecified' (safe defect bucket), not lenses[0] (#7); merge-agent
  free-text lens validated, majority-member fallback (#9)
- Improvement invitation scoped to design finder units — defect-lens
  finders stay defect-only (#8); merge prompt clusters by issue, not
  only defect (#13); schema descriptions generalized for design
  findings (#14)
- LENS_BRIEF startup assertion (#6); gate prompt interpolates
  LENS_CLUSTERS.design (#19); new test_lens_sync.py guards all lens
  mirrors: SKILL HDR prompt, LENS_BRIEF, pr-post DESIGN_LENSES (#5)
- Workflow assigns stable finding num (defects first, shared sequence);
  presenter/pr-post render it verbatim (#20)
- pr-post.py: design lens is the backup kind signal when the handoff
  drops kind (explicit defect still wins); single-pass partition (#17, #24)
- Balance: REFUTED is its own segment (refuted ⊄ solo since design
  consensus can be refuted) (#2); LOCKED design-table column precedence
  in --loop rounds clarified (#11); "verifies solos" doc sweep across
  manifests/README/knowledge (#4); cluster failure-isolation trade-off
  documented (#10); knowledge index line trimmed (#15)

Declined: #16 (JS test harness for sandbox code; lens-sync test covers
the drift class), #18 (gate-fail under --max runs all lenses — the
documented never-silently-narrower degrade), #23 (micro-opt vs readability).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126cGxsBYxqgEFH4AcpriNk
gering added a commit that referenced this pull request Jul 17, 2026
- Bound EVERY external-CLI probe: factor out run_bounded (timeout/gtimeout, else
  a self-watchdog that escalates SIGTERM -> SIGKILL) and use it for codex
  `login status` (was completely unbounded) and grok `models`. Its stdout goes to
  a temp file so an orphaned grandchild can't hold the command-substitution pipe
  open — verified a SIGTERM-ignoring probe is now killed at ~12s, not left to hang
  the picker (#4).
- kickoff manual (non-herdr) block no longer auto-persists the project default:
  it only prints a command, so no launch is confirmed — tell the user to run
  `default set` once the worker is up, matching the herdr path's "persist only
  after a successful launch" rule (#2).
- kickoff picker: set OFFER_DEFAULT from the interpreted Yes/No answer, not a
  literal label match, so the save-as-default gate can't miss on case (#3).
- knowledge: add the missing `prime:` key to the new entry (#6); refresh the
  stale herdr-kickoff-automation entry (step 13, registry-resolved worker argv,
  not a hardcoded `claude … /continue`) (#7).

Not changed: the committed-external-default consent gate (#1) stays announce-not-
prompt (a settled product decision); herdr-launch's `${0%/*}` sibling lookup (#5)
is latent and matches the file's existing convention (callers always pass an
absolute path).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NjTKpmBkXxxYkn7orMfZCC
gering added a commit that referenced this pull request Jul 17, 2026
Mostly real regressions from the round-4 batch, caught by the re-review:

- run_bounded: add `-k 1` to the timeout/gtimeout branches. GNU timeout only
  SIGTERMs at the deadline then waits, so a SIGTERM-ignoring probe ran forever on
  the COMMON path (any host with a timeout binary — e.g. all Linux CI); --kill-after
  escalates to SIGKILL like the self-watchdog. Normalize a bounded kill to a single
  124 "timed out" code (#4).
- codex probe: a run_bounded timeout (124) is now inconclusive -> assume available
  (mirrors grok), not a genuine auth failure — a slow `codex login status` no longer
  tells a logged-in user to re-login and disables the backend (#5).
- grok probe: match the model id as a SUBSTRING of the raw `grok models` output
  (here-string, no pipe) instead of a positional awk field + exact-line grep, so a
  reformatted listing can't yield a wrong token and a false "model not offered" (#6).
- project default resolves the MAIN repo root via --git-common-dir, so a
  `default set` run from inside a linked worktree lands in the main checkout, not
  the disposable worktree copy (#3).
- kickoff manual path: the main-repo session runs `default set` after the user
  confirms the worker started — not a command for the user's terminal, where $REG
  is undefined and the cwd is the worktree (#2).
- knowledge: correct the herdr-kickoff entry's grok argv (`grok -m …`, not codex) (#7).

Not changed: committed-external-default consent gate (#1) — settled announce-not-
prompt product decision.

Verified: gtimeout -k bounds a SIGTERM-ignoring probe at ~11s; a hung codex probe
reads available; `default set` from the worktree writes the main repo.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NjTKpmBkXxxYkn7orMfZCC
gering added a commit that referenced this pull request Jul 17, 2026
Address the agreed findings from the local swarm review:

- agent-registry grok probe: add a `gtimeout` fallback so `grok models` is
  time-bounded on stock macOS (only gtimeout ships there), not just where GNU
  `timeout` exists (#1).
- grok availability: a failed/unreachable `grok models` fetch is now inconclusive
  (trust auth, soft note) rather than "unavailable" — a network hiccup no longer
  wrongly blocks launch. Fetch status rides the function's exit code, since a
  command-substitution subshell can't carry a global flag back (#6).
- agent-registry resolve: reject control chars in `--session`, closing the
  newline→forged-`argv=`-line injection through the launch protocol (#2).
- kickoff SKILL manual (non-herdr) block: shell-quote each argv word (the
  codex/grok bootstrap prompt is one word with spaces) instead of space-joining
  (#3); and persist a picker "save as default" on the manual path too, not only
  the herdr path (#4).
- plugin.json: refresh the stale description (dropped the wrong lifecycle verbs,
  mention worker-agent choice) (#8).

Not changed (reviewed, disagreed): /continue's claude-only resume is a
documented degradation; README model-id duplication is accepted human-facing
docs; the CHANGELOG paragraph matches the repo's entry style.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NjTKpmBkXxxYkn7orMfZCC
gering added a commit that referenced this pull request Jul 17, 2026
- default get now VALIDATES the committed value against the registry: a stale/
  removed/attacker-supplied name (from a cloned repo) reads as "no default" →
  picker, instead of routing or bricking every no-flag kickoff (#1). kickoff also
  announces a non-claude project default before launch — visibility, not a prompt,
  so a committed default can't silently route your code off-Claude (#1 security).
- grok probe: when neither `timeout` nor `gtimeout` exists, skip `grok models`
  and return inconclusive (trust auth) rather than risk an unbounded call that
  hangs the picker (#2).
- kickoff argument grammar: `--agent` consumes the next token as its value, so it
  isn't mistaken for the task name (#4).
- agent-registry.sh committed executable (100755), matching herdr-launch.sh, so
  the documented direct invocation works (#5).
- kickoff "Critical" note: step 12 → step 13 cross-ref (launch was renumbered) (#6).
- `supports=` comment marked RESERVED/not-yet-consumed (a seed for the
  orchestration design), not "already driving" degradation (#7).
- herdr-launch bad-mode usage string shows the launch arity incl.
  [agent-selector] (#8).
- continue reopen: note reworded to match behavior (`claude -c` IS always sent)
  and the codex/grok caveat surfaced inline in the success report (#3).

Not changed (reviewed): README model-id duplication (accepted human-facing docs),
CHANGELOG paragraph (matches repo style); per-task worker persistence for a true
per-CLI resume stays a later idea.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NjTKpmBkXxxYkn7orMfZCC
gering added a commit that referenced this pull request Jul 17, 2026
- grok probe now always runs BOUNDED: when neither `timeout` nor `gtimeout`
  exists, self-bound with a background killer (fds detached so the command
  substitution doesn't block on it) instead of skipping the check — so a dropped
  model is still caught on hosts without a timeout binary, and the probe still
  can't hang the picker (#1).
- a successful `grok models` that parses to nothing (a reformatted listing that
  dropped the `*` bullet) is treated as inconclusive → availability assumed,
  rather than marking every grok entry unavailable and disabling the backend (#3).
- herdr-launch surfaces resolve's real stderr on exit 2 instead of labelling
  every cause "unknown agent selector" (#5).
- README: `/continue` reopen wording corrected — it always sends `claude -c` and
  the user resumes a codex/grok worker themselves; no automatic per-CLI resume is
  claimed (#2, doc half; per-task persistence stays a later idea).
- marketplace.json work-system description refreshed to match plugin.json (#6).

Not changed: committed-external-default consent gate (#4) — an explicit product
decision to announce, not prompt (a cloned repo can already run hooks/CLAUDE.md).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NjTKpmBkXxxYkn7orMfZCC
gering added a commit that referenced this pull request Jul 17, 2026
- Bound EVERY external-CLI probe: factor out run_bounded (timeout/gtimeout, else
  a self-watchdog that escalates SIGTERM -> SIGKILL) and use it for codex
  `login status` (was completely unbounded) and grok `models`. Its stdout goes to
  a temp file so an orphaned grandchild can't hold the command-substitution pipe
  open — verified a SIGTERM-ignoring probe is now killed at ~12s, not left to hang
  the picker (#4).
- kickoff manual (non-herdr) block no longer auto-persists the project default:
  it only prints a command, so no launch is confirmed — tell the user to run
  `default set` once the worker is up, matching the herdr path's "persist only
  after a successful launch" rule (#2).
- kickoff picker: set OFFER_DEFAULT from the interpreted Yes/No answer, not a
  literal label match, so the save-as-default gate can't miss on case (#3).
- knowledge: add the missing `prime:` key to the new entry (#6); refresh the
  stale herdr-kickoff-automation entry (step 13, registry-resolved worker argv,
  not a hardcoded `claude … /continue`) (#7).

Not changed: the committed-external-default consent gate (#1) stays announce-not-
prompt (a settled product decision); herdr-launch's `${0%/*}` sibling lookup (#5)
is latent and matches the file's existing convention (callers always pass an
absolute path).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NjTKpmBkXxxYkn7orMfZCC
gering added a commit that referenced this pull request Jul 17, 2026
Mostly real regressions from the round-4 batch, caught by the re-review:

- run_bounded: add `-k 1` to the timeout/gtimeout branches. GNU timeout only
  SIGTERMs at the deadline then waits, so a SIGTERM-ignoring probe ran forever on
  the COMMON path (any host with a timeout binary — e.g. all Linux CI); --kill-after
  escalates to SIGKILL like the self-watchdog. Normalize a bounded kill to a single
  124 "timed out" code (#4).
- codex probe: a run_bounded timeout (124) is now inconclusive -> assume available
  (mirrors grok), not a genuine auth failure — a slow `codex login status` no longer
  tells a logged-in user to re-login and disables the backend (#5).
- grok probe: match the model id as a SUBSTRING of the raw `grok models` output
  (here-string, no pipe) instead of a positional awk field + exact-line grep, so a
  reformatted listing can't yield a wrong token and a false "model not offered" (#6).
- project default resolves the MAIN repo root via --git-common-dir, so a
  `default set` run from inside a linked worktree lands in the main checkout, not
  the disposable worktree copy (#3).
- kickoff manual path: the main-repo session runs `default set` after the user
  confirms the worker started — not a command for the user's terminal, where $REG
  is undefined and the cwd is the worktree (#2).
- knowledge: correct the herdr-kickoff entry's grok argv (`grok -m …`, not codex) (#7).

Not changed: committed-external-default consent gate (#1) — settled announce-not-
prompt product decision.

Verified: gtimeout -k bounds a SIGTERM-ignoring probe at ~11s; a hung codex probe
reads available; `default set` from the worktree writes the main repo.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NjTKpmBkXxxYkn7orMfZCC
gering added a commit that referenced this pull request Jul 18, 2026
Address swarm review findings on the settings CLI (all in settings.py):

- TOML string values now escape control chars (\n, \t, … via short forms +
  \uXXXX), so a value with a newline no longer writes a file tomllib refuses to
  reparse (#1).
- dump_toml quotes table-name and key segments that aren't bare-key-safe, so a
  related_projects entry like `web api` / `a.b` survives a rewrite (#7).
- config_filename rejects any x-config-file that isn't a plain basename
  (absolute, `..`, `~`, nested), so a malformed schema can't write/unlink
  outside the project root (#3).
- `set` classifies the target against the schema: setting a section (#5) or
  descending past a scalar leaf (#8) is now a clear error, not a crash or silent
  mis-nest.
- `set` gates the write on schema validity — a coerced array with wrong element
  types (#4) or a mistyped dynamic related_projects field (#6) is refused
  instead of silently writing an invalid config.

Tests: serializer round-trip (control chars + non-bare keys), config-filename
sandbox, and the four set-path guards.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ToUjTdtMa9oXUwjfgERkXL
gering added a commit that referenced this pull request Jul 18, 2026
Address swarm review findings on the settings CLI (all in settings.py):

- TOML string values now escape control chars (\n, \t, … via short forms +
  \uXXXX), so a value with a newline no longer writes a file tomllib refuses to
  reparse (#1).
- dump_toml quotes table-name and key segments that aren't bare-key-safe, so a
  related_projects entry like `web api` / `a.b` survives a rewrite (#7).
- config_filename rejects any x-config-file that isn't a plain basename
  (absolute, `..`, `~`, nested), so a malformed schema can't write/unlink
  outside the project root (#3).
- `set` classifies the target against the schema: setting a section (#5) or
  descending past a scalar leaf (#8) is now a clear error, not a crash or silent
  mis-nest.
- `set` gates the write on schema validity — a coerced array with wrong element
  types (#4) or a mistyped dynamic related_projects field (#6) is refused
  instead of silently writing an invalid config.

Tests: serializer round-trip (control chars + non-bare keys), config-filename
sandbox, and the four set-path guards.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ToUjTdtMa9oXUwjfgERkXL
gering added a commit that referenced this pull request Jul 18, 2026
External-only (codex+grok) review of this branch's own diff:

- #1: pr-post's design double-prefix guard required trailing whitespace
  after "[lens]", so a valid but unspaced self-tag ([reuse]text, bare
  [reuse]) — which the workflow parser accepts — slipped past and got
  re-prefixed to "[reuse] [reuse]…". Align the regex to the workflow
  parser (/^\s*\[([\w-]+)\]/, no trailing-space requirement).
- #2: the SKILL in-session Design-table skip rule suppressed the prefix
  only for the row's OWN lens, while pr-post suppresses any known
  design-lens tag — so a merged row opening with a different member's
  tag rendered differently on the two surfaces, contradicting the
  "read identically" claim. Align the wording to the pr-post guard.
- #4: the "cap wins over design-only" test used defects=2, so
  design-only was never eligible and it never exercised the ordering.
  Replace with the real precedence (design-only wins over cap at the
  last round, defects=0) + a correctly-named cap-with-defects case.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jo5yGBLmefV64HN26hxV8n
gering added a commit that referenced this pull request Jul 23, 2026
Address swarm review findings on the settings CLI (all in settings.py):

- TOML string values now escape control chars (\n, \t, … via short forms +
  \uXXXX), so a value with a newline no longer writes a file tomllib refuses to
  reparse (#1).
- dump_toml quotes table-name and key segments that aren't bare-key-safe, so a
  related_projects entry like `web api` / `a.b` survives a rewrite (#7).
- config_filename rejects any x-config-file that isn't a plain basename
  (absolute, `..`, `~`, nested), so a malformed schema can't write/unlink
  outside the project root (#3).
- `set` classifies the target against the schema: setting a section (#5) or
  descending past a scalar leaf (#8) is now a clear error, not a crash or silent
  mis-nest.
- `set` gates the write on schema validity — a coerced array with wrong element
  types (#4) or a mistyped dynamic related_projects field (#6) is refused
  instead of silently writing an invalid config.

Tests: serializer round-trip (control chars + non-bare keys), config-filename
sandbox, and the four set-path guards.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ToUjTdtMa9oXUwjfgERkXL
gering added a commit that referenced this pull request Jul 23, 2026
External-only swarm review (codex + grok) on PR #42. Apply the agreed
findings to the decision record:

- AMQ send vs single-sequencer: workers send only to the Manager handle;
  Manager relays. `amq send --to <peer>` bypasses the sequencer (#1).
- Broadcast: reuse AMQ fan-out/presence/federation instead of hand-rolled
  multi-writer global.jsonl (the model Maildir superseded) (#2).
- Lane lifecycle: drain-on-/close + stale-mail guard so a reused path never
  reconsumes a prior occupant's undrained message (#3).
- Soften the "RESOLVES" overclaim: this ADR supersedes the herdr docs' enum;
  their refresh is pending (#4).
- Canonicalize the lane key via git rev-parse --show-toplevel, not raw cwd (#7).
- Fix ws-statusline states flag order: `states [--cached] <dir>` (#10).
- _index.md blurb: central ~/.agent-mail/ mailbox, not the superseded
  .mailbox/ protocol (always-loaded surface) (#11).
- Note the spike is decided, no open task file (#12).
- Trust-model residuals (convention-based identity, home-dir readable store)
  as accepted for a single-user local tool (#5, #6).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LTZx9DqrXPXQFoTrCvcJmD
gering added a commit that referenced this pull request Jul 23, 2026
Address swarm review findings on the settings CLI (all in settings.py):

- TOML string values now escape control chars (\n, \t, … via short forms +
  \uXXXX), so a value with a newline no longer writes a file tomllib refuses to
  reparse (#1).
- dump_toml quotes table-name and key segments that aren't bare-key-safe, so a
  related_projects entry like `web api` / `a.b` survives a rewrite (#7).
- config_filename rejects any x-config-file that isn't a plain basename
  (absolute, `..`, `~`, nested), so a malformed schema can't write/unlink
  outside the project root (#3).
- `set` classifies the target against the schema: setting a section (#5) or
  descending past a scalar leaf (#8) is now a clear error, not a crash or silent
  mis-nest.
- `set` gates the write on schema validity — a coerced array with wrong element
  types (#4) or a mistyped dynamic related_projects field (#6) is refused
  instead of silently writing an invalid config.

Tests: serializer round-trip (control chars + non-bare keys), config-filename
sandbox, and the four set-path guards.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ToUjTdtMa9oXUwjfgERkXL
gering added a commit that referenced this pull request Jul 27, 2026
A second local swarm review (mostly regressions surfaced by the round-1 fixes);
7 agreed findings applied, 3 declined (a misread pluginVersion, the re-raised
per-subcommand python3 guard, and a 3-file DRY extraction left as a follow-up).

herdr-agent.sh:
- ha_wait now runs under _ha_bounded too, sized ABOVE the server --timeout
  (+5s), so a wedged server can't hang it either — the "never a hang" contract
  now holds for every wrapper. _ha_bounded takes the bound as an argument. (#1)
- get/read/wait reject a leading-dash <target> (usage code 2) so an untrusted
  id can't be parsed as an option flag, matching herdr-tab-glyph's guard. (#3)

lanes.sh:
- Coerce every liveness cell to str (_s): a non-string herdr field (e.g. numeric
  agent_status) no longer crashes the TSV scrub / mistypes the JSON. (#2)
- A malformed (non-dict) list element now fails unmatched lanes closed to
  "unverified" — a partly-untrustworthy list can't assert "no worker". (#4)
- Every --json early-exit emits [] (not empty stdout), so json.loads never
  chokes; the header contract is now fully honoured. (#5)
- Drop the dead `import os` from lanes_join (the prelude imports it). (#7)

herdr-tab-glyph.sh: cmd_refresh calls the bounded ha_list instead of a raw
`herdr agent list`, so a wedged server can't hang a glyph refresh. (#6)

Tests extended: leading-dash reject + bounded wait (herdr-agent); non-string
field, malformed→unverified, and []-on-empty (lanes). check-structure green,
classification byte-identical vs the live snapshot.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R8crYp6tzRKMiwW63Zt3GG
gering added a commit that referenced this pull request Jul 27, 2026
A third swarm review (--fix) over the accumulated diff; 6 agreed findings
applied, 4 declined (the recurring feature version bump — user decided against
it; a premature _ha_validate_dict helper; a theoretical states-via-argv ARG_MAX;
and the 3-file run_bounded DRY extraction, still a follow-up).

herdr-agent.sh:
- ha_get validates with an explicit if/exit instead of `assert` — `python3 -O` /
  PYTHONOPTIMIZE strips asserts, which would silently pass a malformed body. (#1)
- Factor the <target> guard (empty + leading-dash) into one _ha_check_target
  helper the three wrappers share, instead of three copy-pasted case lines. (#7)

herdr-tab-glyph.sh:
- extract_glyph_tabs guards non-dict agents/tabs elements (isinstance), mirroring
  the lanes.sh hardening, so a null element can't abort a whole refresh. (#3)
- Bound `herdr tab list` via _ha_bounded too: ha_list already bounds the agent
  call, but a server wedging on the tab-list call would still hang refresh. (#4)

lanes.sh / herdr-agent.sh: chmod +x — both carry a shebang and a CLI Usage
header, so they now match the executable sibling CLIs (ws-statusline.sh, …). (#5)

Tests: an INTEGRATION test drives the real HERDR_ENV → ha_list → mktemp → trap →
join glue with a fake herdr on PATH (previously only the env seam was covered);
classification stays byte-identical vs the live snapshot. (#8)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R8crYp6tzRKMiwW63Zt3GG
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.

1 participant