- **Harness pre-edit hook**: `--can-edit` now supports project-level checks without `--task`, file scope checks with `--file`, and `--json` output for machine-readable harness integration
- **opencode plugin**: `plugins/automaton-guard/plugin.ts` — intercepts `edit` and `write` tool calls, calls `--can-edit` before allowing modifications
- **Git pre-commit hook**: `scripts/git-hooks/pre-commit` — blocks commits when no task is in an edit-allowed phase (universal safety net for all harnesses)
- **Pre-v2.0 task enforcement**: Tasks without `.state` files are UNTRACKED — `--transition`, `--can-edit`, `--task`, and `--approve` all refuse to operate on them
- **New `--upgrade` command**: Bootstraps `.state` files for pre-v2.0 tasks (single task with `--task` or all tasks at once)
- **Untracked task reporting**: `--list` shows `UNTRACKED (no .state)` for tasks without `.state` files instead of silently bootstrapping
- **Project scoping fix**: `status.py` errors when no project is detected instead of silently falling back to framework directory
- **Scope check fix**: `--scope-check` marks framework files as OUT_OF_SCOPE when working on a project
- **Dashboard scope fix**: Handler methods use stored `project_root` instead of re-detecting from CWD on every request
- **`--project` flag**: Added to all status.py command invocations across 16+ prompt and config files
- **`_infer_state_from_artifacts` locked to `--upgrade`**: Removed as silent fallback from all operational commands
- **Phase approval gates**: Research, Decomposition, Design, and Test Design phases now require explicit user approval (`:awaiting_approval` → `:approved`) before proceeding
- **status.py script**: Comprehensive enforcement and status tool with `--task`, `--list`, `--create-task`, `--transition`, `--approve`, `--validate-folder`, `--audit`, `--claim`, `--release`, `--next-available`, `--available`, `--can-edit`, `--scope-check`, `--same-session`, `--upgrade`
- **Untracked task enforcement**: Tasks without `.state` files are UNTRACKED — `--transition`, `--can-edit`, `--task`, `--approve` all refuse to operate on them. Run `--upgrade` to bootstrap `.state` files
- **`--project` flag**: All `status.py` commands now support `--project` for explicit project scoping when multiple projects exist on the same machine
- **`--upgrade` command**: Bootstraps `.state` files for pre-v2.0 tasks that lack them (single task with `--task` or all tasks at once)
- **Project scoping**: `status.py` now errors when not in a project directory and `--project` is not specified, instead of silently falling back to `~/.automaton/`
- **Scope check fix**: `--scope-check` now correctly marks framework files as OUT_OF_SCOPE when working on a project (was incorrectly always IN_SCOPE)
- **Dashboard scope fix**: Dashboard handler methods now use stored `project_root` and `scope` instead of re-detecting from CWD on every request
- **Phase-scoped prompts**: All phase prompts now include ALLOWED ACTIONS, FORBIDDEN ACTIONS, approval gates (where applicable), pre-work validation, and `.state` precondition checks
- **Orchestrator restructuring**: Reduced from 493 lines to 143 lines; sub-task management extracted to `subtask_management.md`; state machine reference moved to `workflow.md`
- **ALLOWED/FORBIDDEN enforcement**: Each phase prompt explicitly defines what agents can and cannot do, with user override resistance instructions
- **Workflow enforcement**: `--transition` refuses illegal phase transitions; `--validate-folder` detects out-of-order artifacts; `--audit` checks all tasks for violations
- **Task creation gate**: `status.py --create-task` is the only valid way to create tasks; `--audit` flags manually created folders
- **Approval log**: `.state.approvals` file records all user approvals with timestamp and approver
- **Multi-agent support**: Optional `Agent Configuration` section in `.agent.md` enables task claiming, role binding, and work discovery for multi-agent setups
- **Tool integration hooks**: `--can-edit`, `--scope-check`, `--same-session` for agent tool integrations (optional, not called by prompts)
- **upgrade.sh script**: Bootstraps `.state` files for existing tasks from artifact heuristic
- **Framework version marker**: `config.md` now includes version 2.0 with state enforcement indicator
- Removed `sys.path.insert` hack from `__main__.py` (#cleanup-cruft)
- Documented `scripts/dashboard.sh` convenience wrapper in README.md (#cleanup-cruft)
- Framework self-consistency test suite: 17 tests covering prompt stop conditions, hardcoded URLs, canonical paths, .rules.md sections, stale dependencies, CSS theme parity, verdict regression, and CI validation (#framework-self-consistency-tests)
### Fixed
- REFEREE state was never produced by state machine — verdict with unparseable status now correctly shows as REFEREE instead of silently falling through to earlier states (#task-status-reason)
- Pending review count in header now excludes done/blocked tasks (#task-status-reason)
- Critical: PASS verdicts mentioning FAIL/NEEDS_REVIEW in body text were falsely classified as BLOCKED (#fix-verdict-parsing)
- State divergence: IMPLEMENTATION.md alone showed "Implement" instead of "Bug Find" (#fix-verdict-parsing)
- Added mandatory stop conditions to `bug_finder.md` and `adversarial_bug_find.md` (#fix-prompt-consistency)
- Fixed deprecated `{project}/tasks/` path in `onboarding.md` (#fix-prompt-consistency)
- Expanded prompt path test to catch concrete deprecated path patterns (#fix-prompt-consistency)
- Audit Bug 1: `--audit` category 3 now checks `.automaton/tasks/` paths (was only checking `tasks/`) (#fix-cat3-audit-paths)
- Audit Bug 2: `migrate-project.sh` find command now has parentheses around `-name` group for correct `-prune` binding (#fix-migrate-find-precedence)
- Audit Bug 3: `_lookup_model_context()` no longer false-matches model prefixes (e.g. `phi-4` matching `phi-4-mini`) — uses three-tier matching with known suffix whitelist (#fix-vram-model-prefix-match)
- Audit Bug 4: Verdict PASS/FAIL inference uses structured `## Status:` line parsing instead of fragile substring search (#fix-verdict-pass-inference)
- Audit Bug 5: `register-guards.sh` now checks both `.json`/`.jsonc`, writes to `plugin` (singular) key, and strips `//` comments before `json.loads()` (#fix-register-guards)
- Audit Bug 6: Dashboard `determine_task_state()` now reads `.state` file (source of truth) before falling back to artifact heuristic (#fix-dashboard-read-state)
- Audit Bug 7: `--can-edit` and `--scope-check` path prefix matching uses `os.sep` boundary to prevent sibling directory false matches (#fix-can-edit-path-prefix)
- Audit Bug 8: Removed wildcard CORS `Access-Control-Allow-Origin: *` from dashboard — replaced with security headers (`X-Content-Type-Options`, `X-Frame-Options`) (#fix-dashboard-cors-origin)
- Audit Bug 9: Stale-task detection uses `.state.lastedit` timestamp (touched on actual edit activity) instead of `.state` mtime (which only reflects phase transitions) (#fix-stale-task-mtime-proxy)
- Audit Bug 10: TEST_PLAN.md now correctly maps to `test_design` phase (was mapping to `implement`) in both `status.py` and dashboard `task.py` (#fix-test-plan-phase-mapping)
- scripts/update.sh: simplified to plain git pull (#additive-extension-model)
- .rules.md: converted from template to concrete rules with Task-Driven Development, VRAM-aware sizing, Changelog, and Self-Improvement sections (#framework-self-enforcement)
- system-prompt.md: added instruction to read global .rules.md (#framework-self-enforcement)