Files
automaton/memory/framework-architecture.md
T

20 lines
1.3 KiB
Markdown
Raw Normal View History

# Framework architecture — key files and enforcement layers
## Three enforcement layers (in order of strength)
1. **Harness pre-edit hook** (`--can-edit`) — blocks edits before they happen. opencode plugin at `plugins/automaton-guard/`.
2. **Git pre-commit hook** (`scripts/git-hooks/pre-commit`) — blocks commits when no task in edit-allowed phase. Works for ALL harnesses.
3. **Prompt-based rules** (ALLOWED/FORBIDDEN sections) — advisory only.
## Key files
- `scripts/status.py` (~1430 lines) — core enforcement: phase transitions, approvals, can-edit, scope-check, audit, claim/release
- `scripts/vram_detect.py` (~700 lines) — VRAM detection and model context lookup
- `automaton/dashboard/core/task.py` — dashboard state inference (`.state` first, artifacts fallback)
- `automaton/dashboard/ui/app.py` — HTTP server with security headers
## NON_ARTIFACT_FILES
Files that should NOT be treated as phase artifacts:
`.state`, `.state.tmp`, `.state.lock`, `.state.approvals`, `.state.implementer`, `.state.lastedit`, `VRAM_CONFIG.md`, `PARENT_SPEC.md`, `REVIEW.md`
## Stale-task mechanism
`.state.lastedit` file touched by `--can-edit` on ALLOWED. Falls back to `.state` mtime if `.state.lastedit` doesn't exist. 30-minute threshold. `--touch` resets the timer.