--- id: RBT-WP-0003 type: workplan title: "Engine core: run state and evidence" domain: infotech repo: runbook-tutorials status: finished flavor: implementation owner: claude topic_slug: stack created: "2026-09-29" updated: "2026-09-29" depends_on: [RBT-WP-0002] state_hub_workstream_id: "b7f2568a-96a2-5e92-8d04-4e7ac7b6da9b" --- ## Goal Give the engine memory: a run of a pack keeps non-secret parameter values, per-step state and evidence, and is the only thing allowed to change a pack's exercise status. ## Design the run record ```task id: RBT-WP-0003-T01 status: done priority: high state_hub_task_id: "e61fbba9-d69f-59d4-ad86-c1fab69e8171" ``` Specified in `docs/run-spec.md`: `runbook-run/v0.1`: pack id and revision, operator label, parameter values, per-step state (`todo|running|done|failed|skipped`), timestamps, evidence facts, verification results. Non-secret only, with the same secret-marker rejection as packs. Stored under `.local/runbook-runs/` in the repo being operated. ## Implement the run store and step state machine ```task id: RBT-WP-0003-T02 status: done priority: high state_hub_task_id: "fb10ebd1-d122-5b5f-9fd5-83d08539f8c1" ``` Create, resume and list runs. Enforce order, block a step until the previous one verified, record failures without losing state. Tests for restart and resume. ## Implement verification ```task id: RBT-WP-0003-T03 status: done priority: medium state_hub_task_id: "870980df-c1e8-51e5-9a00-643f63404783" ``` `manual`, `exit-0` and `output-contains` checks. Commands are shown to the operator; the engine runs a verify command only when the operator confirms it, with a timeout and captured output size only (no output stored). ## Exercise-status writer ```task id: RBT-WP-0003-T04 status: done priority: medium state_hub_task_id: "bad99b81-2b64-520f-b92f-1b8c6457659b" ``` When every step of a run has verified, offer to write `exercise_status: exercised by ` into `pack.yaml` via a reviewable diff. Never edit automatically. ## Acceptance Criteria - A run survives restart and records outcomes without secrets. - A pack becomes `exercised` only through a completed, verified run.