docs(spec): copy Grok Bot handling into relay-control + dynamic rules source
Merged
AG
3d ago+418+418+012345678901234567890123456789-0-0-0123456789
Spec only: no code, migration or deploy changes. Requested by Khaliq.
Adds docs/specs/grok-bot-dynamic-prompt.md, in three phases:
- Copy, not migration. Cloud's
grokRoutinePrompt,connect_grok_bot_routine(webhook and polling) and what they directly need are copied into relay-control as is. That includessender-check.ts, the parsers, routine headers, and Cloud-shapedrelay.messagewakes. It also includesget_event/get_recent_eventsfor Grok connections, plus reply-mode and polling settings, because the copied prompt calls them. The copy sits behind a default-off flag. Cloud is untouched and keeps working. There is no cutover, move of bots or Cloud rollback. - Dynamic prompt. The pasted routine prompt becomes a small bootstrap that calls
get_agent_ruleson every wake. Rules are a versioned bundle in the repo, tagged by audience (grok-bot / lead / worker), plus a per-org overlay, served over MCP and HTTP (ETag). Rules v1 is the copied prompt text, so behaviour is the same on day one. SKILL.md shrinks to the connect steps. Layered leads fetchaudience=leadat startup and fall back to a pinned snapshot. - Rules. Draft text for the orchestration-only rule (Grok bots don't code or decide) and the stall-watch rule.
Open decisions D1–D8 for Khaliq are in §6.
Spec only; awaiting Khaliq's review. Not for merge until the open questions are decided.
🤖 Generated with Claude Code