@chankov/agent-fleet 0.0.1 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/.claude/commands/doctor-agent-fleet.md +1 -1
  2. package/.claude/commands/setup-agent-fleet.md +4 -4
  3. package/.opencode/commands/af-doctor-agent-fleet.md +2 -0
  4. package/.opencode/commands/af-setup-agent-fleet.md +1 -1
  5. package/.pi/agents/model-profiles.yaml +12 -12
  6. package/.pi/agents/peers.yaml +26 -22
  7. package/.pi/agents/teams.yaml +2 -2
  8. package/.pi/harnesses/agent-hub/README.md +57 -4
  9. package/.pi/harnesses/agent-hub/index.ts +236 -80
  10. package/.pi/harnesses/agent-hub/research-retention.js +34 -0
  11. package/.pi/harnesses/ask-user-remote/README.md +8 -0
  12. package/.pi/harnesses/ask-user-remote/index.ts +41 -1
  13. package/.pi/harnesses/coms/README.md +11 -0
  14. package/.pi/prompts/doctor-agent-fleet.md +1 -1
  15. package/.pi/prompts/setup-agent-fleet.md +4 -4
  16. package/README.md +133 -354
  17. package/agents/architect.md +4 -2
  18. package/agents/bowser.md +2 -1
  19. package/agents/builder.md +3 -2
  20. package/agents/code-reviewer.md +7 -7
  21. package/agents/deep-researcher.md +3 -3
  22. package/agents/documenter.md +3 -1
  23. package/agents/orchestrator.md +5 -3
  24. package/agents/plan-reviewer.md +5 -5
  25. package/agents/planner.md +7 -7
  26. package/agents/releaser.md +3 -1
  27. package/agents/researcher.md +3 -3
  28. package/agents/security-auditor.md +7 -7
  29. package/agents/test-engineer.md +5 -5
  30. package/agents/web-debugger.md +3 -3
  31. package/agents/web-performance-auditor.md +3 -3
  32. package/bin/snapshot-version.js +17 -1
  33. package/codex/CONDUCTOR.md +148 -0
  34. package/docs/ARCHITECTURE.md +165 -0
  35. package/docs/agent-fleet-setup.md +1 -0
  36. package/docs/claude-code-coms-bridge.md +10 -0
  37. package/docs/codex-remote-conductor.md +170 -0
  38. package/docs/coms-hermes-bridge.md +121 -0
  39. package/docs/getting-started.md +14 -0
  40. package/docs/npm-install.md +2 -0
  41. package/docs/pi-extensions.md +16 -0
  42. package/docs/pi-setup.md +2 -0
  43. package/hermes/README.md +48 -0
  44. package/hermes/skills/hub-conductor/SKILL.md +84 -0
  45. package/hermes/skills/hub-liaison/SKILL.md +84 -0
  46. package/justfile +132 -15
  47. package/package.json +10 -3
  48. package/scripts/codex-conductor.ts +41 -0
  49. package/scripts/codex-remote-control.ts +167 -0
  50. package/scripts/coms-cli.ts +311 -199
  51. package/scripts/coms-hermes-bridge.ts +8 -4
  52. package/scripts/lib/codex-conductor.ts +88 -0
  53. package/scripts/lib/codex-remote-control.ts +480 -0
  54. package/scripts/lib/coms-envelope.ts +51 -6
  55. package/scripts/lib/herdr-layout.ts +35 -7
  56. package/scripts/lib/hermes-bridge-core.ts +4 -4
  57. package/scripts/lib/spawn-stagger.ts +101 -0
  58. package/scripts/lib/team-project.ts +112 -3
  59. package/scripts/lib/team-snapshot.ts +3 -2
  60. package/scripts/team-snapshot.ts +23 -6
  61. package/scripts/team-up.ts +106 -18
  62. package/skills/guided-workspace-setup/SKILL.md +123 -97
  63. package/skills/guided-workspace-setup/companion-manifest.json +33 -0
  64. package/skills/peer-coms/SKILL.md +9 -0
  65. package/systemd/user/agent-fleet-codex-remote-control.service.in +23 -0
@@ -0,0 +1,165 @@
1
+ # Agent Fleet Architecture
2
+
3
+ Agent Fleet is a Pi-centered multi-agent orchestration system. This page maps
4
+ the runtime responsibilities and where each module lives in the repository.
5
+
6
+ ## Runtime layers
7
+
8
+ | Layer | Role | Implementation |
9
+ | --- | --- | --- |
10
+ | **Pi Coding Agent** | Primary local runtime — runs the dispatcher and specialist subagents | `.pi/harnesses/`, `.pi/extensions/`, `.pi/agents/`, `.pi/prompts/` |
11
+ | **agent-hub** | Thin-context multi-agent harness: dispatcher + specialists + research helpers + Verification Contract | `.pi/harnesses/agent-hub/` |
12
+ | **Herdr** | Fleet/workspace control plane — spawns peer teams as tiled workspaces, presence via push events, snapshot/resume | [herdr.dev](https://herdr.dev); client in `.pi/harnesses/lib/herdr-client.ts`, layout in `scripts/lib/herdr-layout.ts` |
13
+ | **coms** | Peer communication protocol/data plane — envelope-based P2P messaging between agents | `.pi/harnesses/coms/`, `scripts/lib/coms-envelope.ts`, `scripts/coms-cli.ts` |
14
+ | **Claude Code bridge** | Makes an interactive Claude Code pane a bidirectional coms peer | `scripts/coms-claude-bridge.ts`, `hooks/coms-stop-hook.mjs`, `skills/peer-coms/` — see [claude-code-coms-bridge.md](claude-code-coms-bridge.md) |
15
+ | **Hermes bridge** | Remote human control — relays hub questions to Telegram, races phone vs. local answers, conductor/liaison skills | `scripts/coms-hermes-bridge.ts`, `.pi/harnesses/ask-user-remote/`, `hermes/skills/` — see [coms-hermes-bridge.md](coms-hermes-bridge.md) |
16
+ | **Codex remote-control conductor** | Experimental outbound-only, user-systemd-managed Android conductor; verified on Codex CLI 0.144.x | `scripts/codex-remote-control.ts`, `scripts/codex-conductor.ts`, `codex/CONDUCTOR.md`, `systemd/user/`; runtime under `~/.local/state/agent-fleet/codex-conductor/` — see [codex-remote-conductor.md](codex-remote-conductor.md) |
17
+ | **Skill library** | Lifecycle workflows and quality gates every agent follows | `skills/` (native) + `vendor/agent-skills-upstream/skills/` (vendored) — see [UPSTREAM-SKILLS.md](UPSTREAM-SKILLS.md) |
18
+ | **Personas** | Reusable specialist definitions, transformed per harness | `agents/`, `bin/lib/transform-persona.js` |
19
+
20
+ ## Fleet hierarchy
21
+
22
+ Agent Fleet is layered on purpose. Work flows **down** (delegate); evidence and status flow **up** — as compact structured returns, never raw dumps.
23
+
24
+ ```mermaid
25
+ flowchart TD
26
+ You(["You · Hermes inbound relay · Codex outbound conductor on your phone"])
27
+
28
+ subgraph HUBL["HUB — thin dispatcher (just hub · just hub-team)"]
29
+ Hub["agent-hub harness + orchestrator persona<br/>routes tasks · owns the Verification Contract on disk<br/>never swallows research dumps into its own context"]
30
+ end
31
+
32
+ subgraph TEAML["TEAM — named roster (.pi/agents/teams.yaml)"]
33
+ Team["default: planner · plan-reviewer · builder · test-engineer · code-reviewer · documenter<br/>also: debug · frontend · security · hotfix · release · info"]
34
+ end
35
+
36
+ subgraph RESL["RESEARCH HELPERS — read-only, always available"]
37
+ Research["researcher (fast tier — simple reads)<br/>deep-researcher (deep tier — hard, cross-cutting questions)"]
38
+ end
39
+
40
+ subgraph SUBL["SUB-AGENTS — focused children, narrow tools + models"]
41
+ Subs["planner → scout · rules · risk<br/>plan-reviewer → feasibility · deps<br/>builder → recon · verifier<br/>test-engineer → coverage-scout · conventions<br/>code-reviewer → preflight · quality · perf · docs<br/>security-auditor → recon · input-sweep · secrets-sweep"]
42
+ end
43
+
44
+ You -->|task| Hub
45
+ Hub -->|"dispatch_agent — one persona = one specialist session"| Team
46
+ Hub -->|"spawn_research"| Research
47
+ Research -.->|"findings written to disk — hub gets paths, not dumps"| Hub
48
+ Team -->|"subagents: block (delegate_depth ≥ 1)"| Subs
49
+ Subs -.->|"results return to the parent agent only"| Team
50
+ Team -.->|"structured return + evidence"| Hub
51
+ Hub -.->|"one status line: Assertions: 2✓ 1○ 1✗"| You
52
+ ```
53
+
54
+ Every specialist session is one persona from [`agents/`](../agents/) — *skills* tell each agent **how** to work; *personas* define **who** they are (see [agents.md](agents.md)).
55
+
56
+ The same idea as a tree:
57
+
58
+ ```text
59
+ hub (orchestrator)
60
+ ├── team: default
61
+ │ ├── planner → scout · rules · risk
62
+ │ ├── plan-reviewer → feasibility · deps
63
+ │ ├── builder → recon · verifier
64
+ │ ├── test-engineer → coverage-scout · conventions
65
+ │ ├── code-reviewer → preflight · quality · perf · docs
66
+ │ └── documenter
67
+ ├── research helpers (spawn_research, any time)
68
+ │ ├── researcher
69
+ │ └── deep-researcher
70
+ └── optional fleet peers (herdr + coms)
71
+ ├── architect / releaser / web-debugger panes
72
+ ├── Claude Code peer (coms bridge)
73
+ ├── Hermes (phone human · inbound ask_user)
74
+ └── Codex Remote Control (Android · outbound coms delegation)
75
+ ```
76
+
77
+ Composition rule: **the hub (or a slash command) orchestrates; personas do not invoke other personas as peers.** Specialists may only fan out to their configured **sub-agents**. Research helpers write findings to disk; the hub resumes specialists with paths, not raw dumps. Full pattern catalog: [references/orchestration-patterns.md](../references/orchestration-patterns.md).
78
+
79
+ ## Runtime stack (tools the fleet sits on)
80
+
81
+ ```mermaid
82
+ flowchart TD
83
+ AF["<b>Agent Fleet</b><br/>agent-hub · personas · skills · coms · bridges · CLI"]
84
+ AF -->|primary runtime| PI["<b>pi</b><br/>coding agent — loads harnesses,<br/>extensions, prompts, personas"]
85
+ AF -->|control plane| HERDR["<b>herdr</b><br/>tiled peer workspaces,<br/>presence, snapshot/resume"]
86
+ AF -->|peer + install target| CC["<b>Claude Code</b><br/>bidirectional peer via<br/>the coms bridge"]
87
+ AF -->|install target| OC["<b>OpenCode</b><br/>skill-driven execution<br/>(AGENTS.md + skill tool)"]
88
+ AF -->|remote human| HERMES["<b>Hermes</b><br/>hub questions relayed<br/>to your phone (Telegram)"]
89
+ AF -->|outbound remote delegation| CODEX["<b>Codex Remote Control</b><br/>Android-approved calls to<br/>listed coms peers (experimental)"]
90
+ ```
91
+
92
+ ### External dependencies
93
+
94
+ These are the external systems Agent Fleet assumes or integrates with — not npm packages, but the **runtime stack** the fleet operates on top of.
95
+
96
+ | Dependency | Role | Required? |
97
+ | --- | --- | --- |
98
+ | **[pi](https://github.com/badlogic/pi-mono)** (or your pi install) | Primary coding-agent runtime; loads harnesses, extensions, prompts, and personas | Yes for full fleet mode (`just hub`) |
99
+ | **[herdr](https://herdr.dev)** | Workspace control plane: tiled peer panes, presence push events, team snapshot/resume | Yes for fleet recipes (`just team-up`, `just hub-team`, …); optional for solo hub |
100
+ | **[Claude Code](https://docs.anthropic.com/en/docs/claude-code)** | First-class peer via the [coms bridge](claude-code-coms-bridge.md); also a supported install target for skills/personas | Optional peer / alternate harness |
101
+ | **[OpenCode](https://opencode.ai)** | Skill-driven execution target (`AGENTS.md` + `skill` tool); `af-*` slash commands | Optional alternate harness |
102
+ | **Hermes** | Remote human-in-the-loop (Telegram relay for hub questions) — [coms-hermes-bridge](coms-hermes-bridge.md) | Optional |
103
+ | **Codex CLI + ChatGPT Android** | Experimental outbound remote-control conductor on supported `0.144.x`; requires Node `22.6+`, user systemd, interactive pairing, and per-command mobile approvals — [runbook](codex-remote-conductor.md) | Optional / revalidate after minor-version or mobile-client changes |
104
+ | **[addyosmani/agent-skills](https://github.com/addyosmani/agent-skills)** | Upstream skill library (manually vendored) | Bundled (vendored) |
105
+ | **[disler/pi-vs-claude-code](https://github.com/disler/pi-vs-claude-code)** | Source inspiration / MIT port origin for pi harnesses | Design lineage (ported in-repo) |
106
+ | **LLM providers** | Models per persona (`model:` / `models:` in agent frontmatter) — e.g. OpenAI Codex, GitHub Copilot, Ollama, … | Yes (at least one provider your agents can call) |
107
+ | **Chrome DevTools MCP** / **Playwright Agent CLI** | Browser verify (`browser-testing-with-devtools`) and headless automation (`bowser`) | Optional, feature-specific |
108
+ | **Node.js + npm** | CLI (`npx @chankov/agent-fleet`), package install, `just` recipes | Yes for install & tooling |
109
+
110
+ ## Repository module map
111
+
112
+ ```text
113
+ .pi/ # Pi runtime: harnesses, extensions, agents config, prompts
114
+ skills/ # Agent Fleet-native skills (shadow vendored names)
115
+ agents/ # Personas/subagents used by Agent Fleet
116
+ scripts/ # CLI helpers, bridges, team launchers (pure logic in scripts/lib/)
117
+ hermes/ # Hermes-facing skills/integration assets
118
+ codex/ # Canonical Codex conductor contract (runtime copy lives outside checkout)
119
+ systemd/user/ # Owned user-unit template for Codex remote control
120
+ vendor/agent-skills-upstream/ # Manually imported upstream skills (pinned SHA)
121
+ bin/ # npm CLI: init/update/doctor/transform-persona
122
+ hooks/ # Session lifecycle + coms Stop hooks
123
+ references/ # Supplementary checklists (see fleet-coordination-patterns.md)
124
+ docs/ # This file, setup guides, bridge references, vendoring policy
125
+ ```
126
+
127
+ Reserved for future modules (do not repurpose these paths):
128
+
129
+ ```text
130
+ apps/dashboard/ # future dashboard: Kanban state, Herdr workspaces, peer status
131
+ packages/fleet-core/ # future extracted core orchestration library
132
+ packages/herdr-bridge/ # future Herdr integration package
133
+ packages/hermes-bridge/ # future Hermes integration package
134
+ ```
135
+
136
+ ## Design rules
137
+
138
+ - **Thin dispatcher context.** Nothing lands persistently in the dispatcher's
139
+ context if it can live on disk or in a one-line status. Research findings,
140
+ the Verification Contract ledger, and team snapshots are all disk-first.
141
+ - **Herdr owns panes, presence, and lifecycle; coms owns messages.** Fleet
142
+ recipes hard-require a running herdr server and refuse with an actionable
143
+ message otherwise; non-fleet recipes never touch herdr.
144
+ - **External agents are peers, not plugins.** Claude Code (and future CLI
145
+ agents) join the fleet through bridge adaptors that speak coms envelopes —
146
+ the fleet core stays agent-agnostic. Hermes remains the inbound `ask_user`/
147
+ Telegram route; the experimental Codex conductor is outbound-initiated only,
148
+ approval-gated, and restricted to listed peers through the validated wrapper.
149
+ - **External conductor contracts are advisory.** Pi damage-control wraps Pi
150
+ tool calls, not Hermes or Codex processes; human approvals and their
151
+ contracts reduce risk but do not provide an OS command allowlist.
152
+ - **Destructive fleet verbs are damage-control-guarded.** Specialists cannot
153
+ spawn/close herdr panes; the human confirms destructive actions.
154
+ - **Native-over-vendored skills.** The skill catalogue resolves `skills/`
155
+ first, then the vendored upstream import; upstream updates are explicit
156
+ maintainer actions ([UPSTREAM-SKILLS.md](UPSTREAM-SKILLS.md)).
157
+
158
+ ## History
159
+
160
+ Agent Fleet began as a fork of `addyosmani/agent-skills` and was split into a
161
+ standalone repository in July 2026, with upstream demoted to vendored content.
162
+ The one-time migration record, including the history-filtering commands, lives
163
+ in [MIGRATION-agent-fleet.md](MIGRATION-agent-fleet.md); the product
164
+ requirements that drove the split are in
165
+ [prd-agent-fleet-split.md](prd-agent-fleet-split.md).
@@ -105,6 +105,7 @@ targets an end-of-session compound pass writes lessons to.
105
105
  | `delegate-depth.<persona>` | persona frontmatter `delegate_depth:` (default/max 1) | Replaces the persona's delegation depth budget: `0` makes its delegate tool refuse (delegation off for this project), `1` lets it spawn terminal children. Values above 1 are clamped to 1; children at remaining depth 0 do not receive delegate tooling. |
106
106
  | `rules` | none | Comma-separated repo-relative folders holding the project's own rule files (HOW — implementation patterns the work must comply with). Resolution is **index-first**: when a folder has a top-level `README.md`/`index.md`, personas read it first and follow its loading manifest (session bundles, conditional-load lists) instead of bulk-reading the tree; a folder without an index is searched **recursively** through all subfolders. The harness tells every dispatched specialist where the rules live and how to resolve them; the planner and code-reviewer personas read the relevant rules, validate their subject against them, and pass them on (cited in plan acceptance criteria / handed to delegate sub-reviewers). Missing folders produce a session-start warning. |
107
107
  | `docs` | none | Comma-separated repo-relative documentation **entry points** (WHAT/WHY — architecture, standards, decisions): canonical files (e.g. `Docs/AGENTS.md`) or doc folders (personas start from a folder's `README.md`/index). Unlike `rules`, docs orient rather than bind: every dispatched specialist and research helper is told to read the entry points relevant to its task and follow their links instead of bulk-reading doc trees; the code-reviewer flags changes that alter documented behavior without a doc update; the documenter treats the entry points and the trees they link as the docs it maintains. Missing paths produce a session-start warning. |
108
+ | `research-keep` | `4` | How many **finished** manual/persona research helpers the hub retains (LRU by finish time) so they stay resumable via `/agents-cont rN`; older ones are pruned along with their session files. `all` disables the cap. Auto-research pipe helpers (spawned for `NEEDS_RESEARCH:` pauses) are always pruned as soon as they finish — their findings persist as files under `.pi/agent-sessions/findings/`. Running helpers are never pruned. An invalid value is ignored with a session-start warning. |
108
109
 
109
110
  Example — switch the dispatcher to Bulgarian, pin the builder to sonnet, raise the
110
111
  code-reviewer's thinking level, move the code-reviewer's docs sub-reviewer to a
@@ -78,6 +78,16 @@ same return contract, ASK_USER handling, and history. The standing Claude sessio
78
78
  its context across review rounds, which is the point for code/plan review. See
79
79
  "Coms-backed dispatch" in `.pi/harnesses/agent-hub/README.md`.
80
80
 
81
+ ## Migrating legacy CLI spools
82
+
83
+ Current releases isolate CLI queues by project at:
84
+
85
+ ```text
86
+ ~/.pi/coms/cli/projects/<project>/<name>/
87
+ ```
88
+
89
+ Older releases used the ambiguous name-only path `~/.pi/coms/cli/<name>/`. If that legacy directory exists, `send`, `await`, `reply`, and listener operations fail closed rather than assigning queued messages to whichever project runs first. Before upgrading, stop commands using that CLI identity, inspect its `pending`, `responses`, and `inbound` files, determine the owning project, and move the complete `<name>` directory to `cli/projects/<project>/<name>`. Do not merge two queues or delete pending data merely to clear the error. The name `projects` is reserved for the namespace and cannot be used as a coms identity.
90
+
81
91
  ## Behavior notes
82
92
 
83
93
  - **Serialization:** one prompt at a time per pane; queue depth shows in the peer's
@@ -0,0 +1,170 @@
1
+ # Codex Remote-Control Conductor
2
+
3
+ > **Experimental; verified with Codex CLI 0.144.6 on Linux.** The daemon is user-systemd-managed on the headless host, while manual pairing happens in the operator's interactive terminal. Revalidate the live gate after any Codex minor-version or mobile-client behavior change.
4
+
5
+ The conductor is an outbound-initiated, singleton Codex remote-control service with a visible Herdr **control** pane. The pane displays user-systemd requested state; it never starts, stops, or owns the daemon. Based on the verified design boundary, closing its workspace leaves the enabled service running. Codex uses the dedicated advisory contract at [`../codex/CONDUCTOR.md`](../codex/CONDUCTOR.md); Hermes/Telegram remains the inbound `ask_user` route.
6
+
7
+ ## Supported facts and limits
8
+
9
+ - The pilot was validated with `codex-cli 0.144.6`. Public policy supports **only `0.144.x`**. Resolve the local binary with `command -v codex`; normal lifecycle state changes run a capability preflight, and `0.145.x` or later fail closed until reviewed.
10
+ - The confirmed remote-control subcommands are `start`, `stop`, and `pair`.
11
+ - The only approval modes are `untrusted`, `on-request`, and `never`. The only sandbox modes are `read-only`, `workspace-write`, and `danger-full-access`. **There is no `writes` mode.**
12
+ - The verified posture is `on-request` with `workspace-write`. The runtime-only container is `$HOME/.local/state/agent-fleet/codex-conductor`, outside every checkout; wrapper commands execute from its `workspace` child. Codex 0.144.x/Android may expose the container parent as writable, but repository source and canonical `codex/CONDUCTOR.md` remain outside it. Setup places a managed `workspace/AGENTS.md` copy inside the container. The helper requests the configured `~/.pi/coms` directory as the only extra writable root. The mobile client's managed permission profile still requires a visible one-command escalation for `send`; this approval is mandatory. A remote thread that reports `approval_policy=never` must not delegate.
13
+ - Codex documents neither a foreground daemon lifecycle nor a websocket address/port. Do not configure, probe, document, or depend on a websocket port, PID, or health endpoint.
14
+ - `systemd` state is not daemon health: `active (exited)` means that the requested start command succeeded, not that a paired client is usable.
15
+ - Remote control is outbound-initiated and exclusive **as far as verified for this pilot**. It does not create inbound questions; use Hermes/Telegram for inbound `ask_user`.
16
+
17
+ Both Codex and Hermes are external conductors. Their contracts and human approvals are advisory safeguards outside Pi's damage-control harness; Pi's guardrails and an OS command allowlist do not technically constrain either process. See [Hermes and coms](coms-hermes-bridge.md).
18
+
19
+ ## Before touching the host
20
+
21
+ 1. Confirm the operator accepts the singleton/global-stop limitation: `stop` can affect the remote-control daemon rather than a process systemd can prove it owns.
22
+ 2. Use a Node runtime that supports `--experimental-strip-types` (Node `22.6+`) for these optional TypeScript recipes. Setup persists the exact `process.execPath` for systemd, and team-up passes the same absolute binary to the control pane.
23
+ 3. Close Codex Desktop, editor-owned Codex app servers, and interactive Codex sessions for this host before starting the headless service. The remote-control host is singleton; a desktop/app-server owner can make headless `start` fail with `connection is errored`. Do not mix Mode B with the community Linux desktop workaround.
24
+ 4. Set global `approval_policy = "on-request"` in `~/.codex/config.toml` after making a private backup. The Android client applies this global value to new threads and can override daemon-only config. This affects all local Codex sessions; the lifecycle preflight verifies the effective redacted `codex doctor --json` value and refuses `never`.
25
+ 5. Keep pairing codes, credentials, auth files, remote-control URLs, approval transcripts, and screenshots **out of Git, documentation, plans, test fixtures, and logs**. Pairing output stays in the operator's terminal.
26
+ 6. Run the non-mutating compatibility evidence. It confirms only advertised static capabilities and configured approval posture; it does not prove daemon ownership, pairing, session root, contract loading, approval delivery, or health.
27
+
28
+ ```bash
29
+ CODEX="$(command -v codex)"
30
+ "$CODEX" --version
31
+ "$CODEX" remote-control --help
32
+ "$CODEX" remote-control start --help
33
+ "$CODEX" remote-control stop --help
34
+ "$CODEX" remote-control pair --help
35
+ "$CODEX" doctor --json # redacted; preflight requires approval policy OnRequest
36
+ node --experimental-strip-types scripts/codex-remote-control.ts preflight --codex-bin "$CODEX"
37
+ ```
38
+
39
+ **Compatibility stop condition:** if the version is not `0.144.x`, a required subcommand is absent, or `on-request` plus `workspace-write` cannot be demonstrated for this remote-control path, stop. Do not use guessed flags, a port, or a fallback launcher.
40
+
41
+ The loading mechanism uses a managed runtime contract at `$HOME/.local/state/agent-fleet/codex-conductor/workspace/AGENTS.md`, copied from canonical `codex/CONDUCTOR.md`. A fresh thread must prove that managed copy was loaded and that any mobile writable root remains inside the external user-state runtime container; cwd and environment markers alone remain insufficient.
42
+
43
+ ## Lifecycle
44
+
45
+ Run these recipes from the repository root. The helper rejects unsafe scope, invalid paths, unsupported Codex versions, and mismatched singleton configuration.
46
+
47
+ ```bash
48
+ just conductor-codex-setup docs --project af
49
+ ```
50
+
51
+ The recipe resolves `codex`, the real repository root, and `$HOME/.pi/coms`, derives the isolated identity `codex-docs-conductor`, creates `$HOME/.local/state/agent-fleet/codex-conductor/workspace` outside the checkout and refreshes its owned contract copy with the absolute validated wrapper path. The lower-level `scripts/codex-remote-control.ts setup` command remains available for explicit integrations.
52
+
53
+ `setup` preflights, writes non-secret owned files, reloads user systemd, and enables the service. It does **not** pair or start it. The owned paths are:
54
+
55
+ - `~/.config/agent-fleet/codex-remote-control.json` (mode-restricted, non-secret configuration, including the external runtime directory)
56
+ - `~/.config/systemd/user/agent-fleet-codex-remote-control.service`
57
+ - `~/.local/state/agent-fleet/codex-conductor/workspace/AGENTS.md` (managed runtime copy)
58
+
59
+ The unit is `Type=oneshot` with `RemainAfterExit=yes`, has no `Restart=` policy, uses the dedicated scratch directory as daemon `WorkingDirectory` (the verified mobile client broadens its managed root only to the runtime-only parent container), and runs preflight immediately before `remote-control start`. Start passes the verified `approval_policy="on-request"`, `sandbox_mode="workspace-write"`, and one `sandbox_workspace_write.writable_roots` entry for the validated coms directory. `ExecStopPost` uses the capability-checked stop path even after a failed `ExecStart`. A mobile managed profile can remain narrower, so the exact wrapper `send` must request and receive phone approval before its first execution. The unit makes no foreground, PID, port, or readiness claim.
60
+
61
+ ### Pair — human interaction required
62
+
63
+ Pair the mobile client manually in an interactive operator TTY, after setup. Any displayed pairing code is short-lived secret material:
64
+
65
+ ```bash
66
+ just conductor-codex-pair
67
+ ```
68
+
69
+ Do not pipe, tee, capture, transcribe, screenshot, or commit the output. Never put pairing material or Codex credentials in the unit or config.
70
+
71
+ ### Start, status, and conductor launch
72
+
73
+ ```bash
74
+ just conductor-codex-start
75
+ just conductor-codex-status
76
+ just conductor-codex docs --project af
77
+ ```
78
+
79
+ `status` reports only requested systemd state. Actual usability must be checked from the paired client, without inventing a network probe. The control pane similarly reports requested state only. Legacy `conductor-codex-pilot*` aliases remain available for the initial 0.144.x rollout.
80
+
81
+ ### Use with `hub-team` and Android
82
+
83
+ The service does not start peers. Launch a hub/team in the exact project stored by setup:
84
+
85
+ ```bash
86
+ just hub-team docs --project af
87
+ ```
88
+
89
+ Do not also run `just conductor-codex docs --project af` for the same team unless a second peer set is intentional. `conductor-codex` is the alternative control-pane-plus-team layout when no hub is needed.
90
+
91
+ In ChatGPT Android, open the paired Remote Control host and create a fresh thread using:
92
+
93
+ ```text
94
+ $HOME/.local/state/agent-fleet/codex-conductor/workspace
95
+ ```
96
+
97
+ Do not start a local `codex` process as a substitute for the Android flow. Ask the thread to load its `AGENTS.md`, run one fresh wrapper list, and request approval once if needed. The managed contract contains the validated absolute wrapper path; do not reconstruct it or invoke `coms-cli` directly. For a send, first confirm the listed peer and exact bounded task conversationally, then approve the one displayed wrapper command. A denial stops without retry or side effect.
98
+
99
+ Example read-only delegation:
100
+
101
+ ```text
102
+ List peers once. If researcher is visible, ask me to confirm:
103
+ "Inspect the current implementation and return findings with file:line evidence; do not edit files."
104
+ After confirmation, request approval for the exact wrapper send once.
105
+ ```
106
+
107
+ ### Stop, recovery, and reconfiguration
108
+
109
+ ```bash
110
+ just conductor-codex-stop
111
+ just conductor-codex-recover
112
+ ```
113
+
114
+ Use recovery when the unit says `active (exited)` but the paired client is unavailable, or when an `ExecStart` failure left the unit in `failed`. It is an explicit operator-confirmed systemd stop/reset/preflight/start path, not a health probe. Plain `start` still refuses `failed` and directs the operator to recovery or uninstall. Stop and emergency stop safely clear a confirmed `failed` state; other ambiguous states refuse rather than guessing.
115
+
116
+ To change the configured scope—or to upgrade an earlier in-checkout pilot runtime to the external user-state boundary—use `reconfigure` with the complete validated setup arguments, then explicitly stop/start as required. Do not edit the unit or config by hand:
117
+
118
+ ```bash
119
+ just conductor-codex-reconfigure docs --project af
120
+ ```
121
+
122
+ ### Stale Codex send lock
123
+
124
+ A crash or `SIGKILL` can leave `~/.pi/coms/locks/codex-send.lock`. Automatic removal is intentionally forbidden because removing a live lock could permit concurrent sends. When the wrapper reports a held-or-stale lock:
125
+
126
+ 1. Do not retry or start another delegation.
127
+ 2. Inspect the non-secret JSON metadata (`started_at`, `project`, `name`, and advisory `pid`) without copying it into repository artifacts.
128
+ 3. Confirm in the mobile thread that no wrapper command is still running. A host-side `kill -0` check is insufficient because remote commands may use a different PID namespace.
129
+ 4. Wait beyond the configured send timeout. If ownership remains uncertain, stop the user service and confirm that no delegation is active.
130
+ 5. Only then remove that one exact lock file manually and restart/recover the service if it was stopped.
131
+
132
+ Never use a wildcard cleanup or remove project spools as part of lock recovery.
133
+
134
+ ### Version drift: emergency stop and uninstall
135
+
136
+ If normal preflight fails after Codex version/capability drift, normal start/stop/recovery remains blocked. The only exception is an explicit emergency stop, which first proves that the currently installed CLI still advertises the exact `remote-control stop` capability:
137
+
138
+ ```bash
139
+ node --experimental-strip-types scripts/codex-remote-control.ts emergency-stop \
140
+ --confirm emergency-stop-confirmed
141
+ ```
142
+
143
+ If that capability is absent, restore a supported `0.144.x` CLI before stopping or uninstalling. Never substitute a guessed stop command.
144
+
145
+ Uninstall is explicit, operates only on the owned unit/config, accepts and clears a confirmed `failed` state, resets the loaded unit before deleting it, disables the service, reloads user systemd, and leaves Codex authentication and pairing state untouched:
146
+
147
+ ```bash
148
+ just conductor-codex-uninstall
149
+ # After version drift, use the lower-level helper only if the exact current
150
+ # stop capability is proved:
151
+ node --experimental-strip-types scripts/codex-remote-control.ts uninstall \
152
+ --confirm operator-confirmed --emergency-confirm emergency-stop-confirmed
153
+ ```
154
+
155
+ Repository rollback does not stop or uninstall an already installed user service. If ownership is ambiguous, stop and review; do not remove files or use a broad manual cleanup. The scratch directory is retained if it contains operator-visible files; inspect it before removing it manually. After stopping/uninstalling the conductor, the operator may restore the private pre-change `config.toml` backup if `on-request` is not wanted for other Codex sessions.
156
+
157
+ ## Verified live behavior
158
+
159
+ The Linux/Android live gate passed with CLI `0.144.6`: the managed unit completed start/stop/restart, manual pairing connected the phone, a fresh mobile thread loaded the original parent contract before workspace isolation, and the wrapper listed the `af` pool despite the remote PID namespace. The human confirmed one bounded delegation and separately approved the exact elevated wrapper command; `documenter` replied `Pilot acknowledged. No files changed.` A second approval was denied, producing no researcher message and no lock. The lock was absent after completion, and closing the control workspace did not stop the service.
160
+
161
+ Post-review live hardening passed on Android: because Codex 0.144.x can broaden the managed root to the runtime container parent regardless of daemon cwd, the entire container now lives under user state outside the checkout. A fresh Android thread used `$HOME/.local/state/agent-fleet/codex-conductor/workspace`, loaded its managed `AGENTS.md`, requested one approval for the rendered absolute list wrapper, listed `documenter` and `researcher`, and performed no edit or send.
162
+
163
+ Remote threads use only `scripts/codex-conductor.ts` from the dedicated scratch workspace. It reads owned scope, pins the real coms directory, and refuses repository/project/name/timeout overrides. **Human interaction remains required** twice for every send: first to confirm the freshly listed recipient/task conversationally, then to approve the exact wrapper command through Codex's `on-request` approval. The command must request escalation before its first execution because coms state and Unix sockets are outside the selected workspace.
164
+
165
+ ## Related documentation
166
+
167
+ - [Experimental implementation plan](../plans/codex-remote-conductor.md) — gates and acceptance criteria.
168
+ - [Canonical Codex conductor contract](../codex/CONDUCTOR.md) — bounded outbound delegation rules.
169
+ - [Hermes/coms bridge](coms-hermes-bridge.md) — inbound human questions and Hermes conductor boundary.
170
+ - [Architecture](ARCHITECTURE.md) — ownership of Pi, Herdr, coms, and external conductors.
@@ -0,0 +1,121 @@
1
+ # coms Hermes bridge
2
+
3
+ Protocol contract for the Hermes ⇄ pi `coms` bridge. The first implemented daemon is `scripts/coms-hermes-bridge.ts`, which registers a `user-remote` peer and turns coms prompt envelopes into Hermes/Telegram questions.
4
+
5
+ ## Pieces
6
+
7
+ | Piece | Role |
8
+ | --- | --- |
9
+ | `scripts/coms-hermes-bridge.ts` | Daemon peer, default name `user-remote`, purpose `Remote human via Hermes/Telegram`. Accepts prompt, cancel, and ping envelopes. |
10
+ | `scripts/lib/hermes-bridge-core.ts` | Pure contract logic: qid validation, Telegram formatting, answer-file validation, answer mapping, timeout outcome, state transitions, and log records. |
11
+ | `scripts/lib/coms-envelope.ts` | Shared non-pi envelope wire shapes, including additive `cancel` envelopes. |
12
+ | `~/.pi/coms/hermes-bridge/questions/` | Private answer-file wire written by the Hermes gateway/liaison. |
13
+ | `~/.pi/coms/hermes-bridge/log.ndjson` | Bridge observability log. |
14
+
15
+ ## user-remote topology
16
+
17
+ 1. A pi peer sends a coms `prompt` envelope to `user-remote`.
18
+ 2. The bridge derives `qid` from `prompt.msg_id`, formats the question, and runs `hermes send --to <target> <message>` (`<target>` defaults to `telegram`).
19
+ 3. The human replies in Telegram; the Hermes gateway/liaison writes the answer file.
20
+ 4. The bridge polls the questions directory, validates the file, maps the answer, sends a coms `response` envelope, and removes the answer file.
21
+
22
+ ## Protocol contract v1
23
+
24
+ ### qid and correlation
25
+
26
+ `qid` is exactly the prompt envelope's `msg_id`. It must match the 26-character Crockford ULID regex `^[0-9A-HJKMNP-TV-Z]{26}$`. The same `qid` is the only correlation key across coms, Telegram, answer files, state, and logs.
27
+
28
+ ### Telegram question format
29
+
30
+ `formatTelegramQuestion` emits UTF-16 text capped at 4096 code units:
31
+
32
+ ```text
33
+ ❓ [HUB-Q:<qid>] <question>
34
+
35
+ Context: <context, truncated if needed>
36
+
37
+ Options:
38
+ 1. <title> — <description>
39
+ ...
40
+
41
+ ↩ Reply to this message, or type: HUB-Q:<qid>: <answer>
42
+ ```
43
+
44
+ `Context:` is omitted when absent. `Options:` is omitted when no options are supplied. Context receives the remaining budget after the header, options, and reply instruction.
45
+
46
+ ### Answer-file path, schema, and validation
47
+
48
+ The private wire path is:
49
+
50
+ ```text
51
+ ~/.pi/coms/hermes-bridge/questions/<qid>.answer.json
52
+ ```
53
+
54
+ Schema:
55
+
56
+ ```json
57
+ {
58
+ "qid": "<26-character Crockford ULID>",
59
+ "answer": "<text>",
60
+ "answered_by": "telegram:<user>",
61
+ "at": "<ISO timestamp>"
62
+ }
63
+ ```
64
+
65
+ Validation rejects and ignores files unless all conditions hold: filename ends in `.answer.json`; filename qid is valid; filename qid is currently pending; JSON parses; object fields match the schema; `at` parses as a timestamp; and body `qid` equals the filename qid. Rejection reasons are `invalid_path`, `invalid_qid`, `foreign_qid`, `invalid_json`, `invalid_schema`, and `qid_mismatch`; the daemon logs rejected files as `answer_rejected` and removes them. Exception: an `invalid_json` file is treated as a possible partial write and left in place for a short grace window (`max(2 × poll interval, 1s)` from first sighting); it is rejected and removed only if it still fails to parse after the grace expires.
66
+
67
+ ### Answer mapping
68
+
69
+ If options exist and the trimmed answer is a 1-based number for an option, the response is `{ "kind": "selection", "selections": ["<option title>"] }`. If options exist and the trimmed answer case-insensitively equals an option title, it maps to the same selection shape. All other answers map to `{ "kind": "freeform", "text": "<trimmed answer>" }`.
70
+
71
+ ### Cancel semantics
72
+
73
+ `cancel` is an additive coms envelope with shape `{ "type": "cancel", "msg_id", "from", "to", "created_at", "ref_msg_id" }`; `ref_msg_id` is the target `qid`. The bridge acks well-formed cancel envelopes before handling them.
74
+
75
+ For a pending qid, cancel clears the timeout, removes the pending question, records terminal state `cancelled`, appends a `cancelled` log event, and sends a Telegram note: `✖ [HUB-Q:<qid>] The question was cancelled — it was answered from the console.` Cancel for a non-pending or invalid qid is a no-op after the envelope ack. A later answer file for a closed qid is treated as `late_answer`: logged, removed, and answered in Telegram with a polite ignored note; no response envelope is sent.
76
+
77
+ ### Timeouts
78
+
79
+ The per-question remote timeout defaults to `PI_COMS_TIMEOUT_MS`, or `1800000` ms when unset/invalid; `--timeout <ms>` overrides it. On timeout, the bridge removes the pending question, records terminal state `timeout`, logs `timeout`, sends the Telegram note `⌛ [HUB-Q:<qid>] The question timed out after <ms>ms.`, and sends an error response envelope with error `no remote answer within <ms>ms` and `response: null`.
80
+
81
+ ### States
82
+
83
+ Question states are in-memory per qid: `pending`, `delivered`, `answered`, `cancelled`, and `timeout`. Implemented transitions are: `null + question_received → pending`; `pending + delivered → delivered`; `pending + delivery_error → null`; `pending|delivered + answered → answered` (the daemon currently answers from delivered or pending if the file arrives quickly); `pending|delivered + cancelled → cancelled`; `pending|delivered + timeout → timeout`; and terminal `answered|cancelled|timeout + late_answer` remains terminal.
84
+
85
+ ### ndjson logging
86
+
87
+ The bridge appends one JSON object per line to `~/.pi/coms/hermes-bridge/log.ndjson`. Core log records have shape `{ "at": "<ISO>", "qid": "<qid>", "event": "<event>", "detail"?: <value> }`. Contract events are `question_received`, `delivered`, `delivery_error`, `answered`, `cancelled`, `timeout`, and `late_answer`; the daemon also writes `answer_rejected` for invalid answer files. Ping agent cards report `queue_depth` as the current number of pending questions.
88
+
89
+ ## Hermes as conductor
90
+
91
+ Hermes can also act as the conductor without this daemon: use `coms-cli list` to discover peers and `coms-cli send --await --timeout <ms>` to delegate to hub-team pi peers, then synthesize the results for the human. This conductor topology uses the existing coms CLI as the bridge; no standing Hermes peer is required.
92
+
93
+ Launch a visible conductor workspace with:
94
+
95
+ ```bash
96
+ just conductor docs # live herdr workspace: conductor pane + docs team panes
97
+ just conductor-dry docs # no herdr calls; prints the planned layout JSON
98
+ ```
99
+
100
+ The live recipe reuses `scripts/team-up.ts --conductor`: it creates a normal herdr workspace labeled `<worktree-tag>-conductor-<team>` (the tag is the last dot-segment of the checkout's basename, so the same team from a different worktree gets its own workspace), places a `conductor` pane running `hermes -p dev`, and tiles the chosen team beside it. Team peers keep their normal coms harness and herdr presence reporting, so they continue to show agent state in the sidebar; Hermes' own herdr-agent-state plugin is responsible for the conductor pane's state.
101
+
102
+ Hard boundary: the Hermes conductor must not run `herdr` commands, drive panes, create/kill workspaces, or manage fleet lifecycle. Herdr driving stays with the human/orchestrator so the damage-control model remains intact; see `.pi/damage-control-rules.yaml` for the authoritative no-herdr boundary. Hermes may only operate inside the project coms pool through the documented coms CLI commands.
103
+
104
+ ## Hermes and the experimental Codex conductor
105
+
106
+ Hermes/Telegram remains the **inbound** human `ask_user` complement to the
107
+ experimental Codex remote-control conductor. Codex is outbound-initiated,
108
+ approval-gated, and serialized; it is not an inbound question channel. The Codex user service and control-pane lifecycle are
109
+ separate from Hermes. See the [experimental Codex operator runbook](codex-remote-conductor.md).
110
+
111
+ Both conductor contracts are advisory outside Pi damage-control: Pi wraps Pi
112
+ tool calls, not Hermes or Codex, and neither has an OS command allowlist.
113
+ Human confirmation, approvals, and sandboxing reduce risk but do not
114
+ technically enforce either external contract.
115
+
116
+ ## Deferred
117
+
118
+ - Standing conductor peer for pi → Hermes inbound messages.
119
+ - Telegram-driven conductor profile.
120
+ - Group/multi-recipient questions and non-text answers.
121
+ - Kanban-driven orchestration on top of the same conductor contract.
@@ -18,6 +18,20 @@ Each skill is a Markdown file (`SKILL.md`) that describes a specific engineering
18
18
 
19
19
  All three converge on the same `guided-workspace-setup` skill — they only differ in how the source files reach your workspace. None is being deprecated.
20
20
 
21
+ ## Optional experimental Android conductor
22
+
23
+ Linux/pi fleet users can pair Codex Remote Control with ChatGPT Android and delegate one approval-gated task at a time to peers already running in a coms project. It is optional, supports only Codex CLI `0.144.x`, requires Node `22.6+` and user systemd, and does not replace Hermes as the inbound `ask_user` route.
24
+
25
+ ```bash
26
+ cd /path/to/agent-fleet
27
+ just conductor-codex-setup docs --project af
28
+ just conductor-codex-pair
29
+ just conductor-codex-start
30
+ just hub-team docs --project af
31
+ ```
32
+
33
+ The runtime contract is generated under `$HOME/.local/state/agent-fleet/codex-conductor/`, outside the checkout. Pairing is interactive secret-bearing output and must never be captured. Read the complete [Codex conductor runbook](codex-remote-conductor.md) before enabling the service.
34
+
21
35
  ## Quick Start (Any Agent)
22
36
 
23
37
  ### 1. Clone the repository
@@ -56,6 +56,8 @@ The pi package manifest exposes this repo's skills, pi runtime skills, lifecycle
56
56
 
57
57
  It intentionally does not auto-expose this repo's own `.pi/extensions` or harness directories; install those through guided setup or the pi setup docs so their runtime dependencies are handled explicitly. `pi-codex-image-gen` is also not bundled or required; guided setup may offer it as an optional suggested external npm/pi package when package installation is available, and installs it only if selected (`pi install -l npm:pi-codex-image-gen`). Minimal setup works without it.
58
58
 
59
+ The package also ships assets for the **experimental Linux Codex Remote-Control conductor** (`codex/`, `systemd/`, lifecycle/wrapper scripts, recipes, and runbook). Guided setup copies or links those assets with selected pi harnesses but never enables systemd, edits Codex config, starts a service, or pairs a phone. Those remain explicit operator actions and support only Codex CLI `0.144.x`; see [codex-remote-conductor.md](codex-remote-conductor.md). Its managed runtime contract is created later under `$HOME/.local/state/agent-fleet/codex-conductor/`, not inside the npm package or target checkout.
60
+
59
61
  ## Commands
60
62
 
61
63
  ### `npx @chankov/agent-fleet init`
@@ -173,10 +173,26 @@ The `justfile` sets `dotenv-load`, so a `.env` file at the repo root is auto-loa
173
173
  | `AZURE_SPEECH_KEY` | `pi-voice-stt` (azure backend) | Azure Speech resource key |
174
174
  | `AZURE_SPEECH_ENDPOINT` | `pi-voice-stt` (azure backend) | Azure resource endpoint, used when `provider.endpoint` is unset |
175
175
  | `PI_STT_CONFIG` / `PI_STT_KEYBIND` | `pi-voice-stt` | Override config (inline JSON or path) / the record hotkey (default `alt+s`) |
176
+ | `AGENT_FLEET_SPAWN_DELAY` | `_peer` / `_peer-plus` recipes | Seconds to sleep before launching pi in a fleet pane (set per pane by `team-up`/`team-resume`, see below) |
176
177
 
177
178
  The `chrome-devtools-mcp` server starts once at extension load, so changing its vars needs a pi
178
179
  restart / `/reload` to take effect.
179
180
 
181
+ ### Spawn pre-warm/stagger
182
+
183
+ pi loads its credential store (`~/.pi/agent/auth.json`) once at boot under a short-retry
184
+ file lock. When the stored OAuth token is stale, the first pi to boot refreshes it over
185
+ the network *while holding that lock*; sibling panes spawned in the same instant (as
186
+ `just team-up` / `just hub-team` / `just team-resume` do) lose the lock race and come up
187
+ with every provider showing **unconfigured**. To dodge this, the team scripts check
188
+ `auth.json` before spawning (only `type`/`expires` are read — values never leave the
189
+ process): if any OAuth credential is expired or about to expire, one pi pane (the hub
190
+ when present, else the first pi peer) starts immediately and refreshes the token, and
191
+ every other pi pane gets `AGENT_FLEET_SPAWN_DELAY` in its pane env — the `_peer` /
192
+ `_peer-plus` recipes sleep that many seconds before launching pi. Fresh tokens mean zero
193
+ delay everywhere; `claude-code` runner panes never wait. Pure logic in
194
+ `scripts/lib/spawn-stagger.ts` (under `node --test`).
195
+
180
196
  ---
181
197
 
182
198
  ## Supporting data
package/docs/pi-setup.md CHANGED
@@ -27,6 +27,8 @@ No plugin, wrapper, or custom system prompt is required for the core workflow.
27
27
 
28
28
  **Recommended companion packages:** [`pi-ask-user`](https://github.com/edlsh/pi-ask-user) adds an interactive `ask_user` tool and bundles an `ask-user` skill. It is bundled automatically when you install `@chankov/agent-fleet` as a pi package; clone/symlink setups should install it separately. `pi-codex-image-gen` is an optional suggested npm/pi extension for image generation; guided setup can offer it when package installation is available, but it is not bundled or required.
29
29
 
30
+ **Experimental phone conductor:** Linux users may pair Codex CLI `0.144.x` with ChatGPT Android to perform human-confirmed outbound delegation to live coms peers. Guided setup installs the repository assets when pi harnesses are selected, but deliberately never changes systemd, Codex auth/config, pairing, or service state. Host setup remains an explicit operator flow; see [Codex Remote-Control Conductor](codex-remote-conductor.md).
31
+
30
32
  ---
31
33
 
32
34
  ## Installation
@@ -0,0 +1,48 @@
1
+ # Hermes artifacts
2
+
3
+ This directory contains in-repository Hermes skills for the coms Hermes bridge plan. They are source artifacts only; this pass does not modify `~/.hermes`.
4
+
5
+ ## Skills
6
+
7
+ - `skills/hub-liaison/` — gateway-side Telegram liaison. It writes `~/.pi/coms/hermes-bridge/questions/<qid>.answer.json` answer files for `[HUB-Q:<qid>]` questions consumed by `scripts/coms-hermes-bridge.ts`.
8
+ - `skills/hub-conductor/` — dev-profile conductor. It uses `scripts/coms-cli.ts list` and `scripts/coms-cli.ts send --await --timeout` to delegate to live pi hub-team peers, while preserving the no-herdr damage-control boundary.
9
+
10
+ ## Install
11
+
12
+ Install a skill into the desired Hermes profile with either option supported by your Hermes setup:
13
+
14
+ ```bash
15
+ hermes skills install hermes/skills/hub-liaison
16
+ hermes skills install hermes/skills/hub-conductor
17
+ ```
18
+
19
+ Or copy the skill directories into the profile's skills directory:
20
+
21
+ ```bash
22
+ cp -R hermes/skills/hub-liaison ~/.hermes/<profile>/skills/
23
+ cp -R hermes/skills/hub-conductor ~/.hermes/<profile>/skills/
24
+ ```
25
+
26
+ Use `hub-liaison` in the gateway-owning Telegram profile and `hub-conductor` in the human's dev/conductor profile. Verify availability with your normal Hermes skill listing command before relying on them.
27
+
28
+ ## Usage notes
29
+
30
+ For `hub-liaison`, ensure the Telegram-capable profile has terminal/file-write tools enabled so it can create exactly `~/.pi/coms/hermes-bridge/questions/<qid>.answer.json` and nothing outside that questions directory.
31
+
32
+ For `hub-conductor`, either start the pi team/pool outside Hermes first, or use the repo recipe to create a visible conductor workspace:
33
+
34
+ ```bash
35
+ just conductor docs # conductor pane (`hermes -p dev`) + docs team panes
36
+ just conductor-dry docs # dry-run layout, no herdr calls
37
+ ```
38
+
39
+ Inside Hermes, discover and delegate only through coms:
40
+
41
+ ```bash
42
+ node --experimental-strip-types /home/nchankov/repos/agent-fleet/scripts/coms-cli.ts list
43
+ node --experimental-strip-types /home/nchankov/repos/agent-fleet/scripts/coms-cli.ts send <peer> "<task>" --await --timeout 300000
44
+ ```
45
+
46
+ Hermes must not drive herdr panes or workspaces; the `just conductor` recipe creates the pane before Hermes starts. The no-herdr boundary is documented in `docs/coms-hermes-bridge.md` and governed by `.pi/damage-control-rules.yaml`.
47
+
48
+ Hermes/Telegram remains the inbound `ask_user` path beside the experimental Codex remote-control conductor. Codex is outbound-initiated, approval-gated, and serialized through the validated wrapper; both Hermes and Codex contracts remain advisory outside Pi damage-control, and neither external process has an OS command allowlist. See the [Codex operator runbook](../docs/codex-remote-conductor.md).