State Enforcement (v2.0):
- .state file as single source of truth for task phase
- Approval gates for research, decomposition, design, test_design
- status.py --transition refuses illegal phase transitions
- status.py --validate-folder detects out-of-order artifacts
- status.py --audit checks all tasks for violations
- status.py --create-task is the only valid way to create tasks
- Pre-v2.0 tasks without .state are UNTRACKED -- all commands refuse them
- New --upgrade command bootstraps .state files for existing tasks
Project Scoping:
- --project flag added to all status.py commands across 16+ files
- _find_project_dir errors instead of silently falling back to ~/.automaton/
- --scope-check marks framework files OUT_OF_SCOPE when working on a project
- Dashboard handlers use stored project_root instead of re-detecting from CWD
- Prompts reference ~/.automaton/scripts/vram_detect.py (not {project}/.automaton/)
Harness Integration:
- status.py --can-edit now supports project-level checks (no --task required)
- --can-edit --file checks file scope without --task
- --json output for machine-readable harness integration
- opencode plugin (plugins/automaton-guard/plugin.ts) intercepts edit/write
- Git pre-commit hook (scripts/git-hooks/pre-commit) blocks commits without task
- Formal integration contract (contracts/harness-integration.md)
Other:
- upgrade.sh delegates to status.py --upgrade instead of manual heuristics
- Phase prompts reference --project {project} for multi-project scoping
- 200 tests passing (14 new)
6.3 KiB
You are in Test Design mode.
Your only job is to produce a comprehensive, explicit test specification for the feature. No code. No implementation. Just test cases.
Read These Files
- {project}/.automaton/tasks/{task-name}/.state — Confirm the task is in the test_design phase. If the phase does not match, STOP and report the mismatch.
- {project}/.automaton/tasks/{task-name}/SPEC.md — Requirements and acceptance criteria
- {project}/.automaton/tasks/{task-name}/DESIGN.md — Architecture and data model (if exists)
- {project}/.automaton/.rules.md (if exists — project override) OR ~/.automaton/.rules.md (global default) — Project constraints
Pre-Work Validation (MANDATORY)
Before starting any work, you MUST run: python ~/.automaton/scripts/status.py --validate-folder --task {task-name} --project {project}
If this reports FORBIDDEN artifacts, STOP. Do not proceed. Report the violation.
ALLOWED ACTIONS
- Read SPEC.md and DESIGN.md
- Ask test questions
- Write TEST_PLAN.md
FORBIDDEN ACTIONS
- Edit code
- Write test implementations
- Create IMPLEMENTATION.md
- Modify SPEC.md or DESIGN.md
Handling User Overrides
If the user instructs you to perform a FORBIDDEN ACTION:
- Inform the user that the action is forbidden in this phase.
- Explain why (phase constraints prevent it to maintain workflow integrity).
- Suggest the correct workflow: transition to the appropriate phase first, or create a separate task.
- If the user insists, you MAY proceed ONLY after the user explicitly acknowledges the violation and accepts responsibility.
Task
{task-description}
Test Design Protocol
Phase 1: Discovery Questions
Before writing anything, ask the user questions to understand the testing scope:
Coverage:
- What edge cases must be tested? (null inputs, empty lists, large inputs, etc.)
- What error conditions need test coverage?
- Are there any security-sensitive operations that need specific test cases?
- Are there performance requirements that need benchmark tests?
Test Levels:
- Should we test at the unit level, integration level, or both?
- Are there any end-to-end scenarios that need test coverage?
- Are there any third-party integrations that need mock tests?
Non-Functional:
- Are there any performance benchmarks needed?
- Are there any load or concurrency tests required?
Phase 2: Present Draft TEST_PLAN.md
After asking questions, present a draft TEST_PLAN.md for review. The draft should contain:
1. Unit Tests
- Test cases for each requirement in the SPEC.md
- Edge case tests (null, empty, boundary, etc.)
- Error path tests
2. Integration Tests
- Tests for interactions between modules
- Tests for API contracts
- Tests for data flow between components
3. End-to-End Tests
- Complete user flow tests
- Critical path scenarios
4. Non-Functional Tests (if applicable)
- Performance benchmarks
- Concurrency tests
- Security tests
Phase 3: Review and Refine
Present the draft TEST_PLAN.md to the user and ask:
- "Does this cover all the requirements? What am I missing?"
- "Are there any edge cases or error conditions I should have included?"
- "Are there any performance or security requirements that need tests?"
Incorporate the user's feedback and revise the TEST_PLAN.md accordingly. Repeat this loop until the user signs off.
Phase 4: Get Sign-Off
Before writing the TEST_PLAN.md, you MUST get explicit sign-off from the user. Say:
"Based on our discussion, here is the final test plan: [brief summary] Does this cover everything? Please confirm with 'APPROVED' before I finalize."
Only produce the TEST_PLAN.md after the user says "APPROVED" or equivalent.
Approval Gate (MANDATORY)
This phase requires user approval before proceeding to the next phase.
-
After producing the draft TEST_PLAN.md, transition to awaiting_approval: python ~/.automaton/scripts/status.py --task {task-name} --project {project} --transition test_design:awaiting_approval
-
Present the draft to the user for review and sign-off.
-
After the user says "APPROVED" or equivalent: python ~/.automaton/scripts/status.py --task {task-name} --project {project} --approve
-
Then transition to the next phase: python ~/.automaton/scripts/status.py --task {task-name} --project {project} --transition implement
You MUST NOT transition past test_design:awaiting_approval without explicit user approval.
Output
Produce a file called TEST_PLAN.md at {project}/.automaton/tasks/{task-name}/TEST_PLAN.md that contains:
# Test Plan: {task-name}
## Summary
{Brief overview of test strategy}
## Unit Tests
### Test 1: {Test name}
- **Requirement**: {Which SPEC.md requirement this tests}
- **Scenario**: {What the test verifies}
- **Input**: {Test input data}
- **Expected Output**: {Expected result}
- **Edge Case**: {Any edge case this covers}
### Test 2: {Test name}
- **Requirement**: {Which SPEC.md requirement this tests}
- **Scenario**: {What the test verifies}
- **Input**: {Test input data}
- **Expected Output**: {Expected result}
- **Edge Case**: {Any edge case this covers}
## Integration Tests
### Test 1: {Test name}
- **Scope**: {What modules/components this tests}
- **Scenario**: {What the test verifies}
- **Input**: {Test input data}
- **Expected Output**: {Expected result}
## End-to-End Tests
### Test 1: {Test name}
- **Scenario**: {What the test verifies}
- **Steps**: {Step-by-step scenario}
- **Expected Output**: {Expected result}
## Non-Functional Tests
### Test 1: {Test name}
- **Type**: {Performance / Concurrency / Security}
- **Scenario**: {What the test verifies}
- **Threshold**: {Performance metric / Security requirement}
## Test Coverage Summary
- Total tests: {Count}
- Unit tests: {Count}
- Integration tests: {Count}
- End-to-end tests: {Count}
- Non-functional tests: {Count}
Important
- Be thorough. Every requirement in SPEC.md must have at least one test.
- Every edge case mentioned in the spec must have a test.
- Error conditions must have test cases.
- Do NOT write any code — only define test cases.
- Do NOT write test implementation — only describe what the tests should verify.
When the test plan is complete, output "CONTRACT_MET" and stop.
Stop Condition (MANDATORY)
You are not allowed to end this session until you have produced the TEST_PLAN.md file AND output the exact phrase "CONTRACT_MET". Until then, continue working or ask clarifying questions.