Final architecture spec for scobleclaw#7, covering: - Actor-Judge separation principle (separate model instances, divergent optimization goals) - Risk classification matrix (4 tiers: no-judge, lightweight-approval, full-judge-review, human-only) - Judge protocol spec (proposal/verdict JSON formats, retry/override logic with clarify cycles, confidence scoring) - Integration via MCP Tool Proxy Middleware (zero agent changes, single enforcement point) - Kubernetes sidecar pattern for kubeclaw operator - Implementation priority: exec/Forgejo (P0) -> web/Discord (P1-P2) - Metrics framework (approval rate, latency, clarify cycles, escalation) - 4-phase rollout plan with shadow mode before enforcement Closes scobleclaw#7
44 lines
2.1 KiB
Markdown
44 lines
2.1 KiB
Markdown
# Agent Judge — Action Validation Protocol
|
|
|
|
The judge validates every CoS action before execution. It sits between my intent (what I plan to do) and the tool call (what I actually execute). If the judge rejects, I don't execute — I fix the approach.
|
|
|
|
## Validation Rules (checked on every tool call)
|
|
|
|
### 1. SDLC Gate
|
|
- **Is there code being created/modified?** → Must have an issue in the correct department repo (marcus/engineering, not sscoble/*)
|
|
- **Is a PR being created?** → Must use the correct agent token (not Scott's)
|
|
- **Are binaries/build artifacts in the diff?** → Reject
|
|
- **Is a PR being merged without review?** → Only allowed if Scott explicitly approved
|
|
|
|
### 2. Dispatch Gate
|
|
- **Is this a dispatch to another department?** → Must include `[Project: Name]` prefix
|
|
- **Does the task include clear expectations?** → Must have "Expect: ..." line
|
|
- **Is the task scoped to ONE thing?** → Reject bundled tasks
|
|
- **Am I doing the work myself instead of dispatching?** → Reject (unless editorial/merge work that subagents consistently fail)
|
|
|
|
### 3. Ticket Gate
|
|
- **Am I creating an issue?** → Must be in the correct repo per forgejo-workflow skill
|
|
- **Does the issue have a label?** → Must have at least one
|
|
- **Is the issue well-groomed?** → Title actionable, body has context + acceptance criteria
|
|
|
|
### 4. OB1 Gate
|
|
- **Did I just create/close/update an issue?** → Must capture a thought to OB1 with forgejo_url
|
|
- **Did I just make a decision?** → Must capture with type "decision"
|
|
- **Did I just observe something important?** → Must capture with type "observation"
|
|
|
|
## Judge Execution
|
|
|
|
Before ANY tool call that writes externally (Forgejo, files, Discord, web):
|
|
|
|
1. Pause — mentally run the validation rules
|
|
2. If any rule fails → fix the approach, don't execute
|
|
3. If all pass → execute
|
|
4. After execution → capture OB1 thought if ticket/decision gate applies
|
|
|
|
## Self-Audit
|
|
|
|
Every 3-5 user interactions, check:
|
|
- Did I follow SDLC on every code change?
|
|
- Did I capture OB1 thoughts?
|
|
- Did I dispatch instead of doing work myself?
|
|
- Did I use the right repos?
|