CI / build (push) Has been cancelled
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)
4.6 KiB
4.6 KiB
Implementation: Project Scoping Enforcement
Changes Made
1. scripts/status.py — _find_project_dir() fix (critical)
- Removed
cwd.name == ".automaton"false positive that misidentified project dirs as framework - Removed silent fallback to
AUTOMATON_DIR— now errors with guidance to use--project - Added
cwd.parent == AUTOMATON_DIRcheck so running from inside~/.automaton/still works - Added warning when
--projectpoints to a directory without.automaton/
2. scripts/status.py — cmd_scope_check() fix (critical)
- Framework directory (
~/.automaton/) is now OUT_OF_SCOPE whenproject_dir != AUTOMATON_DIR - Previously, ANY file under
~/.automaton/was considered IN_SCOPE regardless of which project you were working on
3. scripts/status.py — _require_state() helper and untracked task enforcement
- New
_require_state()function that reads.stateand refuses operations on tasks without it cmd_show_task,cmd_transition,cmd_can_edit,cmd_claimall use_require_state()— they refuse untracked tasks and direct users to run--upgradecmd_listshowsUNTRACKED (no .state)for tasks without.statefiles, with a note to run--upgrade
4. scripts/status.py — New --upgrade command
--upgrade --task {name}bootstraps.statefor a single task--upgrade(no --task) bootstraps all tasks missing.state, including sub-tasks- Uses
_infer_state_from_artifactsheuristic (same as before, but now only accessible via--upgrade)
5. automaton/dashboard/ui/app.py — Dashboard scope fix
- Added
project_rootandscopeas class attributes onDashboardHandler - All 7 handler methods (
_serve_tasks,_handle_config_update,_serve_scope,_serve_project_name,_serve_task,_get_review_path,_serve_review_summary) now useself.project_root/self.scopeinstead of callingfind_automaton_root()/detect_scope()per-request DashboardApp.run()sets these class attributes from the stored values- Removed unused
find_automaton_rootimport
6. scripts/upgrade.sh — Delegates to status.py --upgrade
- Replaced 80+ lines of manual shell heuristic bootstrapping with
python3 "$STATUS_SCRIPT" --upgrade --project "$PROJECT_DIR" - Updated final instructions to include
--projectflag
7. Added --project {project} to all status.py commands in:
.agent.md.rules.mdsystem-prompt.md.onboarding.mdprompts/onboarding.mdprompts/orchestrate.mdprompts/research.mdprompts/design.mdprompts/implement.mdprompts/decompose.mdprompts/test_design.mdprompts/bug_finder.mdprompts/adversarial_bug_find.mdprompts/doc_review.mdprompts/referee.mdprompts/subtask_management.mdprompts/workflow.md
8. Fixed {project}/.automaton/scripts/vram_detect.py references
prompts/orchestrate.mdandprompts/decompose.mdreferenced{project}/.automaton/scripts/vram_detect.pywhich doesn't exist in projects (only in~/.automaton/scripts/). Changed to~/.automaton/scripts/vram_detect.py.
9. Updated documentation for untracked tasks and --upgrade
AGENTS.md— Added--upgradecommand, untracked task behavior.rules.md— Added Project Scoping section, untracked task rulesystem-prompt.md— Added Project Scoping section, untracked task rule.agent.md— Added--upgradecommand.onboarding.md— Added--upgradecommandprompts/workflow.md— Added untracked task behaviorprompts/onboarding.md— Changed upgrade step to usestatus.py --upgradeCHANGELOG.md— Added all changes under[unreleased]
10. New tests (9)
test_scope_check_framework_out_of_scope_for_project— framework files are OUT_OF_SCOPE for projectstest_no_project_errors_without_flag—--listerrors from non-project directorytest_project_flag_targets_correct_tasks—--projectcorrectly scopes taskstest_transition_refuses_untracked_task—--transitionrefuses tasks without.statetest_can_edit_refuses_untracked_task—--can-editrefuses tasks without.statetest_show_task_refuses_untracked_task—--taskrefuses tasks without.statetest_list_shows_untracked_task—--listshows UNTRACKED for tasks without.statetest_upgrade_bootstraps_state_file—--upgrade --taskbootstraps.statefor single tasktest_upgrade_all_tasks—--upgradebootstraps.statefor all tasks missing it
11. Updated tests/test_app.py
- Removed
find_automaton_rootmonkeypatching — handlers now useself.project_rootclass attribute test_handle_config_updatesetshandler.project_root = tmp_path
Total: 192 tests passing.