Skip to content

k8s.md compliance audit: 4-round codebase review #247

Description

@abix-

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

  • Round 1: complete inventory of BuildingKind match arms with file:line refs
  • Round 2: every match arm checked against k8s.md, violations flagged with severity
  • Round 3: concrete fix plan with PR grouping for every violation
  • Round 4: final verification pass confirms completeness, no missed violations
  • All 4 rounds documented as issue comments with agent name and round number
  • Final summary includes total violation count and priority-ordered fix list

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-humanagent work done, waiting for human action (merge/close/decision)testTest-only work, regression coverage, or verification follow-up

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions