- **Restore 82 completed tasks** from tasks/complete/ back to tasks/ top level (all <7 days old per the cleanup policy; premature bulk archive was fixed). - **Dashboard: fix scroll-reset on auto-refresh** — renderBoard rebuilds the board via innerHTML every 2s, destroying each column-body's scrollTop. Now snapshots column-body scrollTop + board.scrollLeft + view.scrollTop before rebuild and restores after (matched by PHASE_GROUPS index). - **Dashboard UI additions** (pre-existing unstaged work): approval section cards, transition buttons, inline artifact editor (textarea for writing missing SPEC/VERDICT/etc from the detail modal). - **Bind ornith as Implement model** — config.md: Model explicit to omlx/Ornith-1.0-35B-4bit-mlx, context window 32768. Interactive autopilot already used ornith via opencode default; now explicit. - **Fix cleanup stub** — automaton-cleanup.sh had a stale --project arg pointing at a pytest temp dir (test isolation leak). Rewired to point at ~/.automaton. - **Fix plist-isolation test** — test asserted host plist doesn't exist, but a real install creates it. Now snapshots mtime before run, asserts unchanged after (only a write during the test counts as bleed). - **New Playwright smoke test** (tests/test_dashboard_ui.py) — 2 tests: board renders tasks, column scroll survives auto-refresh tick. Verified the test fails without the scroll fix (scrollTop resets to 0). Skipped via importorskip when playwright is absent (main CI stays green). - **Clarify SI loop scope in README** — new-project onboarding section documents the framework-scoped self-improvement loop and options (leave/pause/create project loop). - **CHANGELOG** documents all changes including the known model-divergence gap (mde tasks marked complete but per-role model binding was never implemented).
9.0 KiB
SPEC: Phase-Scoped Prompts with Forbidden Actions
Goal
Restructure all phase prompts to include explicit ALLOWED and FORBIDDEN action sections, ensuring agents cannot skip phases or perform actions outside their current phase scope.
Background
Currently, phase prompts describe what to produce (SPEC.md, DESIGN.md, etc.) but never state what's NOT allowed. When a user says "fix this bug," the agent has no instruction refusing to skip phases. The prompts are also monolithic — the orchestrator prompt is 493 lines, diluting compliance. Each phase prompt needs hard boundaries.
Requirements
1. ALLOWED/FORBIDDEN sections in every phase prompt
Every phase prompt must include two explicit sections:
## ALLOWED ACTIONS
- {action 1}
- {action 2}
## FORBIDDEN ACTIONS
- Do NOT {forbidden action 1}
- Do NOT {forbidden action 2}
- If the user requests {forbidden action}, respond: "That requires going through the {phase} phase first. The current phase is {current phase}."
2. Per-phase ALLOWED and FORBIDDEN definitions
research.md
- ALLOWED: Read project files, ask clarifying questions, write SPEC.md
- FORBIDDEN: Edit code, create IMPLEMENTATION.md, create DESIGN.md, create any artifact other than SPEC.md, skip to implementation regardless of user request
- APPROVAL REQUIRED: SPEC.md must be approved before transitioning to the next phase. The research phase has sub-states:
research: Active — agent is working on SPEC.mdresearch:awaiting_approval: SPEC.md draft is produced, waiting for user sign-offresearch:approved: User has approved SPEC.md, ready to transition to next phase
decompose.md
- ALLOWED: Read SPEC.md, ask decomposition questions, write DECOMPOSITION.md, run VRAM detection
- FORBIDDEN: Edit code, create IMPLEMENTATION.md, modify SPEC.md, create sub-task folders (the Orchestrator does this)
- APPROVAL REQUIRED: DECOMPOSITION.md must be approved before sub-tasks are created. Sub-states:
decomposition: Active — agent is working on DECOMPOSITION.mddecomposition:awaiting_approval: DECOMPOSITION.md draft is produced, waiting for user sign-offdecomposition:approved: User has approved DECOMPOSITION.md, ready to create sub-tasks
design.md
- ALLOWED: Read SPEC.md, ask design questions, write DESIGN.md
- FORBIDDEN: Edit code, create IMPLEMENTATION.md, modify SPEC.md, skip to implementation regardless of user request
- APPROVAL REQUIRED: DESIGN.md must be approved before transitioning. Sub-states:
design: Active — agent is working on DESIGN.mddesign:awaiting_approval: DESIGN.md draft is produced, waiting for user sign-offdesign:approved: User has approved DESIGN.md, ready to transition
test_design.md
- ALLOWED: Read SPEC.md and DESIGN.md, ask test questions, write TEST_PLAN.md
- FORBIDDEN: Edit code, write test implementations, create IMPLEMENTATION.md, modify SPEC.md or DESIGN.md
- APPROVAL REQUIRED: TEST_PLAN.md must be approved before transitioning. Sub-states:
test_design: Active — agent is working on TEST_PLAN.mdtest_design:awaiting_approval: TEST_PLAN.md draft is produced, waiting for user sign-offtest_design:approved: User has approved TEST_PLAN.md, ready to transition
implement.md (already exists, needs FORBIDDEN additions)
- ALLOWED: Edit code, write tests, create IMPLEMENTATION.md, run test suite
- FORBIDDEN: Create new tasks, modify SPEC.md or DESIGN.md, transition to bug-find phase (the Orchestrator does this)
- NO APPROVAL: implement phase has no approval sub-states — it transitions directly to bug_find when IMPLEMENTATION.md is complete and CONTRACT_MET is output
bug_finder.md
- ALLOWED: Read code, read SPEC.md, read IMPLEMENTATION.md, write BUG_REPORT.md
- FORBIDDEN: Edit code, fix bugs (that's a separate implementation task), modify SPEC.md
adversarial_bug_find.md
- ALLOWED: Read code, read SPEC.md, read BUG_REPORT.md, write ADVERSARIAL_BUG_REPORT.md
- FORBIDDEN: Edit code, fix bugs, modify SPEC.md or BUG_REPORT.md
doc_review.md
- ALLOWED: Read DESIGN.md, read code, read docs, write DOC_REVIEW.md, update documentation
- FORBIDDEN: Edit non-documentation code, modify SPEC.md, modify DESIGN.md
referee.md
- ALLOWED: Read all artifacts, write VERDICT.md
- FORBIDDEN: Edit code, modify any artifact other than VERDICT.md
orchestrate.md
- ALLOWED: Read
.state, transition.state, create task folders (viastatus.py --create-task), delegate to phase prompts, callstatus.py --approveon behalf of the user in manual mode - FORBIDDEN: Edit code directly, produce phase artifacts (SPEC.md, DESIGN.md, etc.), skip phases, create task folders manually (must use
status.py --create-task)
3. User override resistance
Each FORBIDDEN section must include a standard response template for when the user tries to bypass the workflow:
## Handling User Overrides
If the user requests an action that is FORBIDDEN in the current phase:
1. Do NOT perform the forbidden action
2. Respond with: "That action requires the {required_phase} phase. The current phase is {current_phase}. To proceed, say 'orchestrate' and I will advance to the next phase."
3. If the user insists, you may note their request but still do not perform the forbidden action
4. .state precondition check
Each phase prompt must include in its "Read These Files" section:
1. {project}/.automaton/tasks/{task-name}/.state — Confirm the task is in the correct phase. If the phase does not match this prompt, STOP and report the mismatch.
5. Approval gate check
For phases that require approval (research, decomposition, design, test_design), the prompt must include:
## Approval Gate (MANDATORY)
This phase requires user approval before proceeding to the next phase.
1. After producing the draft artifact ({artifact_name}), transition to awaiting_approval:
python ~/.automaton/scripts/status.py --task {task-name} --transition {phase}:awaiting_approval
2. Present the draft to the user for review and sign-off.
3. After the user says "APPROVED" or equivalent:
python ~/.automaton/scripts/status.py --task {task-name} --approve
4. Then transition to the next phase:
python ~/.automaton/scripts/status.py --task {task-name} --transition {next-phase}
You MUST NOT transition past {phase}:awaiting_approval without explicit user approval.
status.py --transition will REFUSE the transition if approval has not been granted.
5. Folder validation check
Each phase prompt must include a mandatory validation step before beginning work:
## Pre-Work Validation (MANDATORY)
Before starting any work, you MUST run:
python ~/.automaton/scripts/status.py --validate-folder --task {task-name}
If this reports FORBIDDEN artifacts, STOP. Do not proceed. Report the violation and ask the user to resolve it.
This catches phase-skipping violations before the agent begins work in a phase, preventing the agent from building on top of artifacts that shouldn't exist.
5. Prompt length discipline
- Each phase prompt should be under 150 lines (except orchestrate.md which may be longer due to the state machine definition)
- Remove redundant content — if the state machine is defined in
workflow.md, don't repeat it inorchestrate.md - The orchestrator prompt should reference
workflow.mdfor state transitions rather than duplicating them
6. Orchestrate.md restructuring
- Remove the detailed state determination logic from orchestrate.md (it lives in workflow.md, which is already separate)
- Remove the sub-task management details (move to a new
prompts/subtask_management.mdreference document) - Keep orchestrate.md focused on: reading
.state, determining next action, writing.statetransitions, and delegating to phase prompts - Target: reduce orchestrate.md from 493 lines to under 200 lines
Acceptance Criteria
- Every phase prompt has explicit ALLOWED ACTIONS section
- Every phase prompt has explicit FORBIDDEN ACTIONS section
- Every phase prompt includes user override resistance instructions
- Every phase prompt includes
.stateprecondition check - Every phase prompt includes mandatory
--validate-foldercheck before work - Research, decomposition, design, and test_design prompts include approval gate check
- Approval gate check references
--transition {phase}:awaiting_approval,--approve, and--transition {next-phase} - Implementation, bug finder, adversarial bug finder, doc review, and referee prompts do NOT include approval gates
- orchestrate.md FORBIDDEN section includes "create task folders manually (must use status.py --create-task)"
- orchestrate.md is under 200 lines
- State transition logic is not duplicated between orchestrate.md and workflow.md
- Sub-task management is extracted to its own reference document
- No prompt exceeds 150 lines (except orchestrate.md which may be up to 200)
Non-Goals
- This spec does not cover the
.statefile implementation (separate task) - This spec does not cover the
status.pyscript (separate task) - This spec does not cover autopilot integration (separate task)