Watch
0
0
Fork
You've already forked hyperhive
0
hyperhive/swarm-controller/src
Repository files (latest commit first)
Filename Latest commit message Latest commit date
atlas 88674eb63a read an agent's agents.md through the swarm and edit it with git diffs
The agent's state/AGENTS.md stays the truth and its harness the only
writer. The harness mirrors the file into a new `agents-md` KV bucket,
and swarm-controller serves that copy, so a read works while the agent is
stopped. An edit is a unified diff plus the revision it was made against,
sent over the agent's existing control subject; the harness refuses a
stale base, applies the diff with `git apply --check` then `git apply` to
a temp copy, and writes the file only when both pass. Fixes #5519.

Files:
- swarm-queue-client/src/agents_md.rs, lib.rs: the bucket name and
  subject, the mirror value, the `ApplyAgentsMd` control command and its
  reply. `AgentControl` loses `Copy` because the new variant carries text.
- hive-agent/src/swarm_agents_md.rs, main.rs: the mirror task (start,
  10 s re-read, immediate republish after an edit) and the apply.
- hive-agent/src/swarm_input.rs: the control loop answers both commands.
- hive-agent/src/claude_md_watch.rs: its AGENTS.md path is shared.
- hive-agent/Cargo.toml, Cargo.lock: sha1 for the git blob id (already in
  the lock), tempfile moves from dev to runtime for the apply directory.
- swarm-controller/src/agents_md.rs, main.rs: the bucket reader and
  GET/PUT /api/agents/{name}/agents-md; test AppState literals get the
  new field.
- swarm-controller/src/agent_control.rs: the sink hands back raw reply
  bytes, so each command decodes its own reply type.
- swarm-controller-api/src/agents_md.rs: the route bodies, shared with
  swarmctl.
- swarmctl/src/agents_md.rs, main.rs: `swarmctl agent agents-md get|apply`.
- nix/host-modules/swarm-nats.nix, nix/module-eval/nats-authelia.nix: the
  agent's publish grant on its own `$KV.agents-md.<agent>` key.

git needs no new package: agent containers enable programs.git, and the
harness unit's PATH includes /run/current-system/sw.
2026-10-18 12:35:11 +02:00
..
builder swarm-controller: record builder runs with nix's tail and link the status to them 2026-10-17 23:51:35 +02:00
forge move stored_secret from swarm-queue-client to swarm-secret-client 2026-10-18 09:00:08 +02:00
matrix_account matrix: back up agents' room keys with a controller-minted recovery passphrase 2026-10-14 02:09:57 +02:00
review_classifier review classifier: re-post a clean verdict on a same-head re-request 2026-10-17 12:38:06 +02:00
agent_archetype.rs archetypes: build an archetype agent from its archetype's module on the hive 2026-10-17 16:27:21 +02:00
agent_control.rs read an agent's agents.md through the swarm and edit it with git diffs 2026-10-18 12:35:11 +02:00
agent_icon.rs swarm: let an agent publish its own icon 2026-09-28 13:47:37 +02:00
agent_identity.rs swarm-secret-client: agents may list their own subtree; controller rewrites agent policies 2026-10-01 17:43:28 +02:00
agent_input.rs swarm-controller: send one operator message to several agents 2026-10-18 01:49:03 +02:00
agent_limits.rs read an agent's agents.md through the swarm and edit it with git diffs 2026-10-18 12:35:11 +02:00
agent_login.rs swarm UI: an agent that needs a Claude login shows it on its card 2026-10-14 20:07:46 +02:00
agent_permissions.rs retry the remaining plain schedules with backon 2026-10-17 16:33:21 +02:00
agent_renewal.rs swarm-queue-client: re-read a held OIDC client secret when the IdP refuses it 2026-10-13 19:16:04 +02:00
agent_state_stream.rs swarm UI: an agent that needs a Claude login shows it on its card 2026-10-14 20:07:46 +02:00
agent_status.rs swarm UI: an agent that needs a Claude login shows it on its card 2026-10-14 20:07:46 +02:00
agents_md.rs read an agent's agents.md through the swarm and edit it with git diffs 2026-10-18 12:35:11 +02:00
alerts.rs swarm UI: an alerts page, read by the controller with a Viewer Grafana token from bao 2026-10-15 15:16:21 +02:00
archetypes.rs archetypes: prefill the create form from flake-declared agent archetypes 2026-10-17 12:57:20 +02:00
auth.rs swarm options: no swarm.* value depends on a deploy option or this host's hive 2026-10-04 18:13:47 +02:00
builder.rs swarm-ui: a builds page for the swarm builder's runs, and the status links to it 2026-10-18 01:26:45 +02:00
claude_login.rs swarm UI: log an agent into claude from its card; the credentials go to bao and the agent picks them up 2026-10-15 13:26:29 +02:00
config_pr.rs swarm-builder: build each agent config PR head and post a commit status 2026-10-14 03:30:46 +02:00
forge.rs move stored_secret from swarm-queue-client to swarm-secret-client 2026-10-18 09:00:08 +02:00
forge_account.rs read an agent's agents.md through the swarm and edit it with git diffs 2026-10-18 12:35:11 +02:00
github_account.rs read an agent's agents.md through the swarm and edit it with git diffs 2026-10-18 12:35:11 +02:00
inference.rs allow a max_subagents of 0: no subagents for the agent 2026-10-15 22:00:00 +02:00
issue_report.rs swarm-controller: bound the issue-report forge calls with the forge deadline 2026-10-15 13:30:34 +02:00
linked_accounts.rs read an agent's agents.md through the swarm and edit it with git diffs 2026-10-18 12:35:11 +02:00
main.rs read an agent's agents.md through the swarm and edit it with git diffs 2026-10-18 12:35:11 +02:00
matrix_account.rs read an agent's agents.md through the swarm and edit it with git diffs 2026-10-18 12:35:11 +02:00
otel_http_client.rs swarm-controller: get its otlp pushes past the collector, log failures 2026-10-17 09:44:33 +02:00
pulls.rs swarm-ui, swarm-controller: the review try-out's repo and PR fields offer the repos and PRs to pick 2026-10-12 19:05:37 +02:00
queue_identity.rs move stored_secret from swarm-queue-client to swarm-secret-client 2026-10-18 09:00:08 +02:00
read_policy.rs retry the remaining plain schedules with backon 2026-10-17 16:33:21 +02:00
review_classifier.rs swarm-controller: the review classifier reads a diff with 200 lines of context 2026-10-15 12:43:12 +02:00
schedules.rs share the forge and schedule wire types through swarm-controller-api 2026-10-17 23:27:14 +02:00
status.rs gateway: serve the hive dashboard on <hive>.hives.<swarm> behind authelia, drop htpasswd 2026-10-15 21:44:27 +02:00
store.rs fix doc-comment pointers broken by the module-eval split 2026-09-20 04:31:08 +02:00
subagent_term.rs swarm-controller: replay a subagent's newest rows before its live tail 2026-10-18 03:00:08 +02:00
term_stream.rs swarm-controller: replay a subagent's newest rows before its live tail 2026-10-18 03:00:08 +02:00
test_nats.rs swarm-controller: let each test nats-server bind its own port 2026-10-14 16:33:19 +02:00
vcs_metrics.rs drop the remaining HYPERHIVE_OTEL_METRIC_INTERVAL_MS readers 2026-10-17 08:00:14 +02:00
wanted.rs swarm-controller: first credential-renewal pass waits for the queue connection 2026-09-30 15:46:56 +02:00
webhook.rs swarm-builder: build each agent config PR head and post a commit status 2026-10-14 03:30:46 +02:00