Files
automaton/tasks/complete/project-scoping-enforcement/ADVERSARIAL_BUG_REPORT.md
T
Lap Tran 4a2301b077
CI / build (push) Has been cancelled
Archive completed tasks, add cleanup commands, self-documenting dashboard UI
- Archive 79 completed framework-dev tasks from tasks/ -> tasks/complete/
- status.py: add --cleanup-done and --install-cleanup-schedule commands
- Add scripts/automaton-cleanup.sh for periodic task archiving
- Dashboard: rename 'Background' tab -> 'Agent', 'Cleanup' agent -> 'Completed Task Archiver', remove redundant group headers and pill badges, dim inactive agent placeholders
- .rules.md: add Self-Documenting UI Names rule
- New tests: test_cleanup_done.py, expanded test_app.py and test_task.py
2026-06-24 22:43:33 -04:00

2.3 KiB

Adversarial Bug Report: project-scoping-enforcement

Summary

Adversarial review of the project scoping enforcement implementation. While the code changes are correct and well-tested, the process violation (implementing before tasking) reveals a deeper trust model issue.

Bugs Found

Bug 1: Agent can bypass the entire framework by editing files directly (Critical)

  • Severity: Critical
  • Description: All enforcement in the framework is prompt-based or tool-based (status.py). But nothing prevents an agent from directly editing scripts/status.py or any other file without a task. The --can-edit check only works if the agent chooses to call it. This is the same category of issue as the one we were fixing — the framework trusts the agent to follow its own rules.
  • Suggested Fix: This is inherent to prompt-driven frameworks. The fix is discipline, not code. However, we could add a git pre-commit hook that checks for .state file existence for modified files.

Bug 2: _infer_state_from_artifacts heuristic is still slightly wrong (Low)

  • Severity: Low
  • Description: In _infer_state_from_artifacts, when SPEC.md exists without BUG_REPORT.md, it returns bug_find instead of research. The logic at line 284 (if "SPEC.md" in artifacts and "BUG_REPORT.md" not in artifacts: return "bug_find") is incorrect — a task with only SPEC.md should be in research phase. However, since this heuristic is now only used by --upgrade (for migrating pre-v2.0 tasks), the impact is limited — the upgrade might assign a slightly wrong phase that the user can manually correct in .state.
  • Suggested Fix: Change line 284 to if "SPEC.md" in artifacts and "BUG_REPORT.md" not in artifacts and "IMPLEMENTATION.md" not in artifacts: return "research"

Bug 3: cmd_validate_folder still uses _infer_state_from_artifacts after .state exists (Low)

  • Severity: Low
  • Description: After confirming .state exists, cmd_validate_folder reads it and then falls back to _infer_state_from_artifacts if the read returns None (line 538). This shouldn't happen in practice — if .state exists, _read_state should return a value. But the fallback is unnecessary.
  • Suggested Fix: Remove the fallback and error instead.

Score

+5 (Bug 1 is a known limitation, Bug 2 and 3 are minor)