Prompt-pack Element protocol

Dual-wiki: operator · system.

Updated

Laptop-only workcell prompt_pack_worker: share a zip of markdown prompts in the Element #cursor-plain room, approve execution on this machine, then optionally run an allowlisted deploy plan.

Executive capsule

Operator drops a freeform prompt zip. The bridge validates and registers the pack, pins Grok 4.7 (grok-4.7-high), runs Cursor after approve, applies a completion scan on pack evidence (decision, acceptance, checkpoint, deploy plan), may post CONTINUE for up to three turns, then posts IMPLEMENTED or FAILED, always followed by AUDIT. Deploy commands run only after a separate deploy reply.

This is not !agent task (Granite Roadrunner). General !agent new Agent mode remains approval-gated; only this workcell may spawn write-capable Cursor on the laptop.

Progress card

While a long pack step runs (implement, test, catchup, deploy, and similar), the bridge posts one in-thread message and edits it in place (m.replace). The card shows workcell id, phase, percent complete, ETA (after the first completed step), and a short label (for example the current pytest suite id). Final protocol messages (AUDIT, IMPLEMENTED, TEST, and so on) are unchanged and still arrive as separate events after the card reaches 100%.

Command grammar

  1. Upload a .zip with caption !agent pack, or upload then send !agent pack within the media TTL.
  2. Thread ACK: pack id, digest, file list; reply approve or reject <reason>.
  3. After approve: APPROVED → IMPLEMENTING → Cursor (up to 3 turns).
  4. If mandatory gates remain: CONTINUE lists unfinished ids and resumes on the laptop (same pack id).
  5. When the completion scan passes: IMPLEMENTED (summary + deploy plan). After 3 turns without pass: FAILED.
  6. AUDIT follows IMPLEMENTED or FAILED (deterministic collector + optional narrative); not a deploy. Reply audit in the pack thread to refresh. Run dir gets audit-report.md and remediation/ (zip and !agent pack for follow-on scope).
  7. Reply deploy to run allowlisted commands from the frozen snapshot → SUMMARY.
  8. After implementation, these replies stay on the same pack and do not restart services:
  9. testplan tags each matrix row as acceptance and groups scenarios into suites by component. It writes test-plan.json and does not run pytest.
  10. After testplan or audit, the reply lists up to three next steps from files already on disk. Reply 1 (or yes) to run the recommended step. Element has no command buttons in this room.
  11. acceptance runs only the rows tagged acceptance.
  12. test runs the suite groups. When the plan is large (4 or more suites, more than one pytest file, or 8 or more dirty forge-market paths), each suite runs separately.
  13. dual-wiki checks that summary.md names the same decision as promotion_decision.json, and that every zip acceptance id has a status row.
  14. fix starts Cursor on the last test log. It does not commit.
  15. catchup starts Cursor on the audit unfinished list and remediation/00_REMEDIATION_MASTER.md. It does not mark NOT_RUN as pass.
  16. commit puts dirty forge-market, forge-agents, and forge-squid trees on feature/prompt-pack-<id> with type(scope): summary. It skips .env, keys, and databases. It does not push main.
  17. push runs git push -u origin HEAD. On a non-fast-forward rejection it merges origin/<branch> and, for content conflicts, keeps this branch, completes the merge, and pushes again. A failed resolve aborts the merge so the tree is not left conflicted.

IMPLEMENTED means the completion scan passed (not merely that summary.md exists). AUDIT is an independent report; it does not restart Market Studio — use deploy for allowlisted systemctl restarts.

Governance

Rule Behavior
Model grok-4.7-high only; fails closed if not in cursor-agent models
Zip ≤20 MB, ≤200 files, .md / .txt only, no traversal or symlinks
Queue One active pack until DONE, FAILED, or REJECTED
Deploy Allowlisted scripts under Code / ~/forge-fleet; no ssh, &&, force-push, --no-verify
Completion Scan promotion_decision.json, acceptance_status.json, CHECKPOINT.json, deploy plan (forge-market runtime changes require systemctl --user restart forge-market-studio.service in the plan)
Turns Max 3 implement turns; then FAILED with unfinished list

Runtime

  • Bridge: forge-cursor-bridge matrix-adapter (local transport) on the operator laptop
  • Data: ~/.local/share/forge-prompt-pack/<pack_id>/
  • Ledger: prompt-packs.db beside the bridge SQLite store