Background
PR #3 introduced architectural boundary invariants enforced by scripts/import-boundaries.ts over a 5×5 layer-pair matrix (domain, application, adapters, app, other). The current test suite uses only example-based cases and does not exhaustively verify all 25 import-direction combinations.
Requested work
Add property-based tests using fast-check to tests/import-boundaries.test.ts (or a new tests/import-boundaries.property.test.ts) that:
- Generate arbitrary source-file pairs
(sourceLayer, targetLayer) drawn from the full 5×5 matrix.
- Assert that
findBoundaryViolations emits a violation if and only if the pair is in the forbidden set.
- Cover all 25 combinations, including self-imports (e.g.
domain → domain).
Provide rigorous reasoning or a proof sketch if any range-sensitive invariant makes exhaustive property testing unnecessary.
Acceptance criteria
bun test passes including the new property-based tests.
- All 25 layer-pair combinations are covered.
- No dependency on example fixtures for coverage of the boundary rule logic.
References
Background
PR #3 introduced architectural boundary invariants enforced by
scripts/import-boundaries.tsover a 5×5 layer-pair matrix (domain,application,adapters,app,other). The current test suite uses only example-based cases and does not exhaustively verify all 25 import-direction combinations.Requested work
Add property-based tests using fast-check to
tests/import-boundaries.test.ts(or a newtests/import-boundaries.property.test.ts) that:(sourceLayer, targetLayer)drawn from the full 5×5 matrix.findBoundaryViolationsemits a violation if and only if the pair is in the forbidden set.domain → domain).Provide rigorous reasoning or a proof sketch if any range-sensitive invariant makes exhaustive property testing unnecessary.
Acceptance criteria
bun testpasses including the new property-based tests.References