Summary
Full codebase audit against docs/k8s.md (Def/Instance/Controller architecture). Four sequential review rounds, each by a different agent, each building on the previous agent's findings.
Spec Doc
Spec: self-contained in issue body
Reference
docs/k8s.md -- the authoritative architecture doc being audited against
Process
Each round is one agent dispatch cycle. The agent reads k8s.md, reviews the codebase, documents violations, and hands off to the next round.
Round 1: Inventory
- Read
docs/k8s.md cover to cover
- Catalog every
BuildingKind, BuildingDef, and BuildingInstance usage across the codebase
- List every match arm that switches on specific
BuildingKind variants
- Document findings in a comment with file:line references
Round 2: Violation detection
- Read round 1 findings + k8s.md
- For each match arm from round 1, check: does this duplicate data that should come from the Def registry?
- Flag any instance field that caches a value already in the Def
- Flag any system that reads a hardcoded variant list instead of a Def field/flag
- Document violations with severity (blocker vs cleanup)
Round 3: Fix plan
- Read round 1+2 findings + k8s.md
- For each violation, propose the concrete fix (new Def field, registry lookup, etc.)
- Estimate scope: which files change, how many match arms collapse
- Group fixes into mergeable PRs (1 PR per logical change)
- Document the fix plan in a comment
Round 4: Verification
- Read all previous rounds + k8s.md
- Verify the fix plan is complete and correct
- Check for any violations missed in rounds 1-2
- Produce final summary: total violations, fix PRs needed, priority order
- Hand off to needs-human with the final report
Acceptance criteria
Summary
Full codebase audit against
docs/k8s.md(Def/Instance/Controller architecture). Four sequential review rounds, each by a different agent, each building on the previous agent's findings.Spec Doc
Spec: self-contained in issue body
Reference
docs/k8s.md-- the authoritative architecture doc being audited againstProcess
Each round is one agent dispatch cycle. The agent reads k8s.md, reviews the codebase, documents violations, and hands off to the next round.
Round 1: Inventory
docs/k8s.mdcover to coverBuildingKind,BuildingDef, andBuildingInstanceusage across the codebaseBuildingKindvariantsRound 2: Violation detection
Round 3: Fix plan
Round 4: Verification
Acceptance criteria