Problem
The PR checklist includes: "No sdk/mpr write imports in executor." This rule exists because executor handlers must route through the backend interface (mdl/backend/), never calling the MPR writer directly. Today this is enforced only in code review. An AI code generator that bypasses the backend produces code that compiles but violates the architecture — the mistake ships unless a reviewer catches it.
Proposed solution
Convert this checklist rule into a compiler or linter error so violations are caught before review.
Option A — Go internal/ package: Move MPR write types into sdk/mpr/internal/writer/. Go's visibility rules prevent any package outside sdk/mpr/ from importing it.
Design note: mdl/backend/mpr/ (the legitimate consumer) lives under mdl/, not sdk/mpr/, so the internal/ mechanism would also block it. This requires either restructuring the package layout or using Option B.
Option B — Linting rule: Add a depguard or gomodguard rule to CI that flags any import of specific sdk/mpr write symbols from mdl/executor/. Enforced at CI, not compile time, but achieves the same practical effect.
Implementation steps
- Decide on Option A (package restructure) or Option B (linting rule)
- For Option A: move write-path types into
sdk/mpr/internal/writer/, update mdl/backend/mpr/ imports, verify compile
- For Option B: configure
depguard in .golangci.yml with a deny rule on write imports in mdl/executor/, add to make lint
- Verify the rule catches a deliberate violation in a test branch
Expected outcome
Any code in mdl/executor/ that imports sdk/mpr write types fails at compile time (Option A) or CI lint (Option B). The architecture is self-enforcing.
See proposal: docs/11-proposals/PROPOSAL_agentic_architecture_improvements.md (Change 5)
Problem
The PR checklist includes: "No sdk/mpr write imports in executor." This rule exists because executor handlers must route through the backend interface (
mdl/backend/), never calling the MPR writer directly. Today this is enforced only in code review. An AI code generator that bypasses the backend produces code that compiles but violates the architecture — the mistake ships unless a reviewer catches it.Proposed solution
Convert this checklist rule into a compiler or linter error so violations are caught before review.
Option A — Go
internal/package: Move MPR write types intosdk/mpr/internal/writer/. Go's visibility rules prevent any package outsidesdk/mpr/from importing it.Design note:
mdl/backend/mpr/(the legitimate consumer) lives undermdl/, notsdk/mpr/, so theinternal/mechanism would also block it. This requires either restructuring the package layout or using Option B.Option B — Linting rule: Add a
depguardorgomodguardrule to CI that flags any import of specificsdk/mprwrite symbols frommdl/executor/. Enforced at CI, not compile time, but achieves the same practical effect.Implementation steps
sdk/mpr/internal/writer/, updatemdl/backend/mpr/imports, verify compiledepguardin.golangci.ymlwith a deny rule on write imports inmdl/executor/, add tomake lintExpected outcome
Any code in
mdl/executor/that importssdk/mprwrite types fails at compile time (Option A) or CI lint (Option B). The architecture is self-enforcing.See proposal:
docs/11-proposals/PROPOSAL_agentic_architecture_improvements.md(Change 5)