hive-ag3nt + docs: extract prompt-rendering prose (#716 batch 3)

This commit is contained in:
iris 2026-05-31 16:44:17 +02:00 committed by mara
commit 84f3fe5f69
3 changed files with 57 additions and 80 deletions

View file

@ -187,6 +187,26 @@ socket at `/run/hive/` once at startup:
`services.hyperhive.c0re.operatorPronouns`, default `she/her`).
Passed via `--system-prompt-file`.
**Marker grammar.** `<!-- role:X -->` opens a block; matching
`<!-- /role:X -->` closes it. Nesting is NOT supported — a stray
opener overrides until its closing tag (or end of file). A
mismatched closer (`<!-- /role:manager -->` inside a `role:agent`
block) is elided from the output but does NOT pop the active
role: suppression stays conservative so a typo can't dump
wrong-flavor content. Whitespace inside markers is tolerated
(`<!--role:foo-->` parses the same as `<!-- role:foo -->`).
Content outside any marker is always shared.
**`hive_identity` / `swarm_identity` shape.** Each carries a
leading space + backticked name (` on hive \`pr1ma\``,
` in swarm \`constellat1on\``) when the corresponding env var
is set, otherwise empty string. The independence lets the
template drop one or both into the opener prose without
breaking single-hive deployments that never set the option;
the renderer also treats `Some("")` from a caller as `None` so
empty-string env vars and missing env vars round-trip the
same way.
The shared per-turn plumbing lives in `hive_ag3nt::turn::{write_mcp_config,
write_settings, write_system_prompt, run_turn, drive_turn,
emit_turn_end, wait_for_login, compact_session}` so the two binaries