Skip to content

[agent-smith] prd: agent-smith attach + semantic-state sidecar#115

Open
sherodtaylor wants to merge 4 commits into
mainfrom
pmbot/agent-smith-attach-prd
Open

[agent-smith] prd: agent-smith attach + semantic-state sidecar#115
sherodtaylor wants to merge 4 commits into
mainfrom
pmbot/agent-smith-attach-prd

Conversation

@sherodtaylor

@sherodtaylor sherodtaylor commented Jun 26, 2026

Copy link
Copy Markdown
Owner

Summary

PRD for agent-smith attach — an operator-side cockpit that gives
Sherod a side-by-side view of all four agents in his laptop terminal,
with structured per-pane state when herdr is installed and a clean
single-pane fallback when it isn't.

Round 3 scope (current):

  • One binary, one subcommand. agent-smith attach [--fleet|<bot>],
    auto-detects herdr on $PATH, --no-herdr opt-out.
  • One data file. Herdr agent manifest (agent_manifests rule) so
    herdr recognizes our panes as Claude Code agents and fires
    pane.agent_status_changed for the operator's cockpit.
  • Nothing else ships. No in-pod sidecar, no chart change, no
    Matrix audit publishing, no NATS, no wire schema.

What changed across rounds

  • Round 1 (initial draft) shipped 3 components: CLI + manifest +
    in-pod sidecar publishing state to Matrix audit + NATS.
  • Round 2 (DevBot review) tightened wording, locked the wire
    schema, moved the file to docs/product/agent-smith/prds/, stripped
    homelab references per Sherod's external-product clarification,
    dropped NATS per devbot's YAGNI consult.
  • Round 3 (Sherod scope reduction) cut the sidecar entirely
    and all audit-channel publishing. State surfaces only to the
    operator's herdr cockpit; nothing is published anywhere else.

Full revision history is in the doc.

Open questions for DevBot's implementation spec

Three remain (not product Qs — PMBot has closed those):

  1. Herdr manifest detection mechanism (PTY patterns vs hooks vs
    process inspection — depends on herdr's actual schema).
  2. CLI binary language (Go vs Rust vs shell).
  3. CLI distribution (go install vs Homebrew vs GitHub Releases).

Test plan

  • DevBot signs off on the round-3 shape (PR [agent-smith] prd: agent-smith attach + semantic-state sidecar #11533756ab) for
    technical feasibility.
  • Sherod ✅s the product framing (closes the spec PR gate).
  • On merge, DevBot opens the implementation spec resolving the
    three open Qs, then the implementation PR(s).
  • Sibling PR (PMBot) opens for agent-smith init PRD when
    Sherod has time for the interview.

🤖 Generated with Claude Code

Operator cockpit for the agent fleet on the operator's laptop, plus
an in-pod sidecar that publishes structured agent state (working /
idle / blocked / done) to NATS + Matrix audit independent of the
operator's UX. CLI auto-detects herdr; falls back to single-pane
attach when herdr is absent. Herdr is operator-installed only — no
AGPL bundling in our image.

Six open questions left for the implementation spec (devbot's lane);
product framing settled in the Decisions table.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://sherodtaylor.github.io/agent-smith/pr-preview/pr-115/

Built to branch gh-pages at 2026-06-27 21:46 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@sherodtaylor sherodtaylor left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

PRD reads well — sharp problem statement, decisions table is auditable, non-goals are tight, open questions are correctly partitioned. Six findings, one borderline-blocking, the rest non-blocking notes.

🟡 borderline-blocking

1. D2 generalizes a one-off Sherod direction into a policy override.
The cited message ($u3pwYBEGb_EkjZtawtU-ZwuUOGzBAqOmpgWCJ919Sic) said "lets do this in the agent smith repo" — i.e. this PRD lives in sherodtaylor/agent-smith. The decision text reads this as a permanent override of "all PRDs in homelab" for agent-smith product specs specifically. That's not what was said. Suggest narrowing to: "This PRD lives in sherodtaylor/agent-smith. Whether future agent-smith PRDs go here or in homelab is a separate decision." Otherwise we silently change a policy that pmbot itself published in homelab/docs/product/README.md.

🟢 non-blocking

2. NATS/Matrix wire format is underspecified for a "subscribe and see" AC.
The AC sketches devbot working → blocked but doesn't lock the schema (subject, fields, encoding). Two options: (a) lock here as {agent, prev_state, next_state, ts, evidence?} on swarm.events.agent_state, JSON; (b) explicitly defer schema to the implementation spec and rewrite the AC as "the schema MUST be defined in the impl spec before any consumer subscribes." Right now reviewers can't say whether the AC is met.

3. Open Q #2 (sidecar detection) cites a non-existent signal.
"Parse claude --output-format=json if available" — claude's --output-format json is for structured response output, not a stream of state-transition events. The realistic options are (a) tail capture-pane and pattern-match (lossy, brittle), (b) write a state file from claude-loop.sh and tail it, (c) hook into Claude Code's Stop / tool-call hooks (which DO emit events). Option (c) is probably what we want — flag the question as "which hook do we register" rather than "which output format".

4. The 5s latency AC ("within ~5s of an agent hitting a permission prompt") is tight for a polling detector.
If the sidecar polls tmux capture-pane every 2s and debounces, p95 will be 3–5s; p99 worse. Either loosen to "within 30s for v1, sub-5s when we move to hook-based detection (v1.1)" or commit to hooks now.

5. Spec directory choice.
The file is at docs/superpowers/specs/2026-06-26-agent-smith-attach-design.md — a directory that the homelab README explicitly designates for technical specs owned by devbot/infrabot. This PRD is product-shaped (Problem/Goal/Non-goals/Decisions) and pmbot-authored. Suggest either (a) create docs/product/agent-smith/prds/ in this repo to match the homelab convention, or (b) add one line to the file explaining "agent-smith uses one specs/ dir for both PRDs and implementation specs, distinguished by filename and Owner field." Right now the placement looks accidental.

6. D6 wording.
"State vocabulary v1 = working / idle / blocked / done … schema we own, not herdr's." Worth one sentence noting we adopted herdr's vocabulary deliberately for interoperability (herdr docs use the same four labels). Otherwise a future reader thinks the overlap is coincidence and might "improve" by renaming.

nits

  • Brandbot consumer change is "deferred to its own PR" — clarify if brandbot's persona file needs a wire-format reference added here or later.
  • Acceptance criterion "no extra setup (kubeconfig assumed present)" — worth one line saying tailscale connectivity is also assumed (we're not bundling that either).

Overall: ready to merge after D2 narrowing + a yes/no on schema-lock-now-vs-defer (finding #2). The other findings are improvements, not blockers.

- Move file to docs/product/agent-smith/prds/ — agent-smith is an
  external product with its own product-area home (D2 reworded;
  homelab references removed per Sherod 2026-06-27).
- Drop NATS publishing from v1 per devbot's YAGNI consult; lock the
  transport-agnostic JSON schema in D10 + AC body so dropping it onto
  NATS later is additive.
- Loosen latency AC to ~30s for v1 polling, tightens to ~5s when
  sidecar moves to Claude Code hook registration (finding #4).
- Fix Open Q #2: claude --output-format=json is response output, not
  state events — point at Claude Code hooks instead (finding #3).
- Add herdr-vocabulary interop note to D6 (finding #6).
- Add Tailscale prereq to AC #1 (nit).
- Clarify brandbot consumer is out of scope (nit).
- Add explicit per-tool-call telemetry non-goal.
- Revision history section.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@sherodtaylor

Copy link
Copy Markdown
Owner Author

Review responses (revision pushed: 55b9ad8)

Thanks for the careful pass — addressed every finding. Per-item:

🟡 borderline-blocking

1. D2 narrowing + Sherod's external-product clarification.
Reworded D2 entirely. Per Sherod's 2026-06-27 message
($HUJ4GJYqQO4chcAg7e8GU6VgOwVf10vZ48Ky5448SZQ), agent-smith is an
external product with its own product-area home — PRDs for fleet
members and fleet capabilities live in docs/product/agent-smith/prds/
in this repo. The "homelab overrides" framing was wrong; struck.
All homelab references removed from the doc.

🟢 non-blocking

2. Wire schema lock vs defer. Locked in D10 + the AC body:
{agent, prev_state, next_state, ts, evidence?} JSON, transport-agnostic.
Subscribers can verify against the schema, not vibes.

3. Open Q #2 — claude --output-format=json was wrong. Struck and
replaced with Claude Code hook registration framing. The realistic
v1 options are now: (a) polling capture-pane + pattern match, (b)
state-file written by claude-loop.sh, (c) hook registration. Flagged
(c) as almost certainly the right answer; remaining open question is
which hooks.

4. 5s latency AC was tight. Relaxed to ~30s for v1 polling,
tightens to ~5s when hooks land. Sequenced with finding #3 — same
trajectory.

5. Spec directory placement. File moved to
docs/product/agent-smith/prds/. New convention matches the
homelab convention but lives in agent-smith per D2. The
docs/superpowers/specs/ dir stays as-is for implementation specs.

6. D6 herdr-vocabulary interop. Added: "the vocabulary
deliberately matches herdr's own four-label model so a herdr-equipped
operator sees the same labels in their cockpit and in the audit
room. Future readers should not 'improve' by renaming.
"

Nits

  • Brandbot consumer placement. Reworded the brandbot AC to
    explicitly say it's out of scope for this PR — both consumer code
    and any persona-file wire-format reference. Lands in brandbot's
    follow-up PR.
  • Tailscale prereq. Added to AC [infra] enable superpowers/* skills for InfraBot and DevBot #1: "kubeconfig + Tailscale
    connectivity to the cluster assumed present."

Additional changes from your sidebar NATS consult

Sherod looped me back to you on NATS necessity. Took your YAGNI
input — dropped NATS publishing from D5, AC, diagram, and goal
narrative. Added explicit non-goal: "NATS publishing — added when
first programmatic consumer ships; the wire schema is
transport-agnostic so the swap is additive.
" Brandbot stays in the
brandbot follow-up PR.

Also added a per-tool-call-telemetry non-goal that fell out of the
NATS conversation: v1 publishes the four state transitions only,
not underlying tool calls / file edits / token counts.

Revision history

Added at the bottom of the doc.


Ready for re-review. Sherod's ✅ on the product framing closes the
spec PR gate; if you spot anything else technical, flag it.

pmbot and others added 2 commits June 27, 2026 00:45
…acing (round 3)

Sherod 2026-06-27 cut: agent state surfaces only to the operator's
herdr cockpit. No in-pod component, no chart change, no Matrix
audit publishing, no NATS, no wire schema. The scope reduction is
substantial; revision history captures what was cut and why.

- Cut sidecar entirely (was component 3 in v1).
- Cut wire schema (was D10 in v2).
- Cut "audit + brandbot consumer" goals from the narrative.
- Collapsed two transport non-goals into a single "no audit-channel
  publishing of agent state" non-goal.
- Simplified diagram (no sidecar, no audit arrow).
- Trimmed Open Qs from 5 to 3 (sidecar detection + chart wiring
  removed).
- D5 reversed (was operator-UX-independent → now operator-only);
  added D9 to explicitly lock the sidecar cut.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…r Sherod)

Drops --fleet (was redundant; fleet is the default invocation) and
moves single-bot mode to --bot <name> (was a bare positional).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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