Commit 983c67f
committed
docs(research): § 1.5 boundary violations — Shape A directional rules
Grill-me Q13 outcome: § 1.5 was underspecified ("--boundaries <config>
flag on audit OR recipe consuming the config"). Three real questions
needed answering: where the config lives, what shape, recipe-or-flag.
Shape A (directional rules) locked in for v1:
boundaries: [
{
name: "no-cross-feature",
from_glob: "src/features/*/**",
to_glob: "src/features/*/**",
action: "deny",
except_self: true,
},
...
]
Why A over B (element-types) over C (layers) — honest discriminator:
A and B have IDENTICAL expressiveness (B compiles to A at index time).
The real question is ergonomics-at-scale vs forward-compat / smallest-
viable-config:
- A wins 5 of 6 dimensions: smallest-viable-config (one entry); Zod
schema simplest; mental-model load (one concept); forward-compat (B
layers on top later as sugar); backwards-compat (never paint into a
corner; primitives are durable).
- B wins only "ergonomics at scale" (5+ rules with element reuse) —
exactly the dimension that can be added later as a sugar layer
without breaking A.
- C (layer ordering) is most opinionated; only fits layered
architectures. Not a v1 default.
Decision rule (ship the smallest primitive that doesn't paint into a
corner; layer ergonomics on top later) mirrors § 6 Q5 history-table
defer logic.
Implementation reuses every shipped or in-flight piece of plumbing:
- Zod config slot (existing src/config.ts substrate)
- Index-time reconciler (mirrors recipe_recency from item 1.9)
- New boundary_rules table (moat-B-aligned schema growth)
- Bundled recipe boundary-violations.sql via SQLite GLOB operator
- SARIF output formatter (already shipped) for CI gate
NO new CLI flag — moat-A clean. The verb is query --recipe
boundary-violations --format sarif. Recipe consumes config-as-data;
SARIF output mode handles verdict-shaped CI consumers.
Effort stays S. Element-types / layer sugar deferred to v1.x with
explicit "demand-driven" trigger (mirrors fallow.md B.5 verdict-
threshold deferral pattern, kept in this doc as the recurring
deferral idiom).1 parent a5b75df commit 983c67f
1 file changed
Lines changed: 12 additions & 12 deletions
0 commit comments