2026-06-16 07:28:45 -04:00
|
|
|
# Automaton Guard Plugin
|
|
|
|
|
|
|
|
|
|
**Harness**: OpenCode (`@opencode-ai/plugin`)
|
|
|
|
|
**Status**: Active
|
|
|
|
|
**Enforcement**: Pre-edit (`tool.execute.before`)
|
|
|
|
|
|
|
|
|
|
Blocks file modifications (`edit`, `write` tools) when no automaton task is in
|
|
|
|
|
implement or doc_review phase. Calls `status.py --can-edit --file <path> --json`
|
|
|
|
|
before every edit.
|
|
|
|
|
|
|
|
|
|
## Installation
|
|
|
|
|
|
|
|
|
|
The framework install/update scripts auto-register this plugin in
|
2026-06-22 10:40:58 -04:00
|
|
|
`~/.config/opencode/opencode.json` (or `opencode.jsonc`):
|
2026-06-16 07:28:45 -04:00
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
{
|
2026-06-22 10:40:58 -04:00
|
|
|
"plugin": ["~/.automaton/plugins/automaton-guard"]
|
2026-06-16 07:28:45 -04:00
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Other Harnesses
|
|
|
|
|
|
|
|
|
|
| Harness | Plugin | Status |
|
|
|
|
|
|---------|--------|--------|
|
|
|
|
|
| OpenCode | `plugins/automaton-guard/plugin.ts` | ✅ Active |
|
|
|
|
|
| Pi Dev | `plugins/automaton-guard-pi/guard.ts` | ✅ Active |
|
|
|
|
|
| Other | N/A | N/A |
|
|
|
|
|
|
|
|
|
|
To add support for a new harness, create a plugin in `plugins/` that calls
|
|
|
|
|
`status.py --can-edit --file <path>` before tool execution, matching the
|
|
|
|
|
`contracts/harness-integration.md` specification.
|
|
|
|
|
|
|
|
|
|
## Enforcement Layers
|
|
|
|
|
|
|
|
|
|
| Layer | Mechanism | Harness scope |
|
|
|
|
|
|-------|-----------|---------------|
|
|
|
|
|
| Pre-edit | This plugin | OpenCode only |
|
|
|
|
|
| Pre-commit | `scripts/git-hooks/pre-commit` | All git projects |
|
|
|
|
|
| Pre-push | `scripts/git-hooks/pre-push` | All git projects |
|