sumHerdr-native agent distrodocsinstallgithub ↗

Herdr backend

Herdr owns processes and worktrees. Pane identity, env start and stop, native event delivery, and native metadata.

Pane identity

Herdr 0.9.0 pane and agent objects carry a terminal_id and, when an official integration reports it, an agent_session. sum judges a recorded address against those fields. It invents no generation field, and a socket path or a bare pid is never identity.

A server stop and restart restores the saved layout under the same pane IDs, with a new terminal_id and a new shell.
A kill -9 restart restores only what was saved; a later pane can receive a freed ID.
A live handoff keeps pane IDs and the shell process, and still issues a new terminal_id.

Environments

./bin/sumctl env discover TASK_ID # declared dev commands from mise/package/Makefile/justfile/Procfile/compose/Dockerfile/devcontainer
./bin/sumctl env record TASK_ID --url http://127.0.0.1:PORT [--log PATH | --pane ID | --container ID]
./bin/sumctl env inspect TASK_ID # re-observe once: stale URLs, configuration drift, missing logs
./bin/sumctl env start TASK_ID --command NAME [--url ... | --match TEXT] [--log PATH] [--timeout S]
./bin/sumctl env stop TASK_ID [--service ID]

env start launches one command the repository declares in a pane split under the worker pane inside the checkout. A timeout is an explicit failed state, never a retry or restart. env stopre-proves that identity, sends exactly one ctrl+c through Herdr, waits a bound for exit, verifies the port is released, and closes only the pane sum created. Environments started by hand are never stop targets. Credentials in URLs, labels, or paths are refused.

Native event delivery (enabled by default)

./bin/sumctl hook enable # coordinator only; retry or re-enable this instance's Herdr plugin
./bin/sumctl hook status
./bin/sumctl hook disable # or --unlink

On a recorded pane going idle/done, the handler re-observes the pane and runs one bounded pump toward that recipient: pending questions, reports, answers, and requested brief revisions are delivered at the boundary instead of waiting for the next rundown. A recorded worker seen blocked, idle with nothing owed, exited, or closed produces an attention record on the task. It is evidence, not a question, a result, a quota diagnosis, or permission to approve anything. Disabled, degraded, or crashing, the handler changes nothing about ask/report, init, bind, and pump.

Coordinator init enables the plugin for a new installation;update apply enables it for an existing installation unlesshook disable was explicitly chosen. An enable failure is recorded as degraded and does not fail init or update. The user's opt-out is saved in .sum/settings.json.

Native metadata (optional)

./bin/sumctl metadata enable
./bin/sumctl metadata sync [--force]
./bin/sumctl metadata status
./bin/sumctl metadata inbox [--grouped] [--open --placement split|overlay|tab|zoomed]
./bin/sumctl metadata disable

sum task state projected as namespaced sum_* tokens on the endpoints sum owns, rendered by sidebar rows the user chooses to add. Task panes carry sum_state, sum_pipeline, sum_task, sum_repo, sum_rev, and sum_pr; the coordinator pane carries sum_inbox and sum_tasks. Panes this installation never recorded are never touched.

needs-decisionneeds-attentionreview-readyanswer-pendinginstruction-refresh-pendingrunning

These labels never prove verification or completion.