Skip to content

C5: the module boundary rule, and the demo store's version from the seeds - #3

Merged
lroy-stack merged 2 commits into
mainfrom
feat/m5-boundary-rule
Nov 5, 2026
Merged

lroy-stack merged 2 commits into
mainfrom
feat/m5-boundary-rule

Conversation

@lroy-stack

Copy link
Copy Markdown
Owner

Plan 009 C5 (plan 006 M5 and M6's store version; ADR 0017 §4 and §8). Two commits, one per task.

M5 — the boundary rule (build(deps))

  • Outside src/modules, only src/config/*.generated.ts, src/verticals/* and the paths some module owns import a module.
  • npm run generate:modules writes src/config/modules.owns.generated.json; .dependency-cruiser.cjs reads it in modules-only-through-composition, whose message names the fix and cites ADR 0017 §4.
  • The bell (dashboard layout and notification helpers) is listed as PENDING_M10 until M10 composes it from feeds.
  • parties now owns its route and e2e (the parties screen, G4), which the rule requires.

M6a — the store version (feat(demo-store))

  • STORE_VERSION = ${STORE_FORMAT}:${seedFingerprint(seeds)}, compared as text; STORE_FORMAT (7) is bumped by hand only for snapshot-format changes.
  • seedFingerprint covers the seeds' structure and row ids, so a module, collection, field or row that comes or goes resets saved sessions; the pinned hash test gives way to store-version.test.ts.
  • Deploying this resets every saved demo session once — that deploy waits for E2 (deploy, tag, release).

How verified

  • tsc, npm test (5943), npm run check, npm run build, docs/mcp/reference.md unchanged, generate:modules up to date.
  • A planted module import from src/config, and the bell left out of PENDING_M10, each fail npm run depcruise with the rule's message.

M6b (seeds split per module, a pure move) is not in this PR.

🤖 Generated with Claude Code

lroy-stack and others added 2 commits November 5, 2026 17:44
… a module

ADR 0017 §4, plan 006 M5: outside src/modules, a module is imported only
by src/config/*.generated.ts, src/verticals/* and the paths some module
owns, so removing a module never breaks a file nobody owns.

- `npm run generate:modules` also writes
  src/config/modules.owns.generated.json, the sorted owned paths; the
  staleness test covers it and .gitattributes marks it generated.
- .dependency-cruiser.cjs reads it in the new rule
  `modules-only-through-composition`, whose message names the fix (add the
  path to the module's owns and regenerate) and cites ADR 0017 §4.
- The bell (the dashboard layout and its notification helpers) imports
  notifications until M10 composes it from the modules' feeds; it is listed
  as PENDING_M10, which M10 deletes.
- parties now owns its route and e2e (the parties screen, G4), which the
  rule requires.

A planted import of a module from src/config, and the bell left out of
PENDING_M10, each fail `npm run depcruise` with that message.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eeds' fingerprint

ADR 0017 §8, plan 006 M6 (the store version): a saved session resets when
the snapshot's format or the seeds it was written against change, with no
hand-kept number to bump for a seed change and no pin that a removed
module breaks.

- STORE_VERSION is `${STORE_FORMAT}:${seedFingerprint(seeds)}`, compared
  as text. STORE_FORMAT (now 7) is bumped by hand only when the snapshot's
  own format changes. The `:` keeps the value text in the existing INTEGER
  column, so a session saved under the old numeric version resets once.
- `seedFingerprint` replaces `seedShapeHash`: it covers the seeds'
  structure and their row ids, so a module, a collection, a field or a row
  that comes or goes resets saved sessions; other values do not.
- The pin of [SCHEMA_VERSION, hash] gives way to store-version.test.ts:
  the version is composed this way and never reads as a number, and the
  fingerprint moves when a row, a field or a module's collection is added
  or removed. "Ignores values" now means values other than ids, as the ADR
  asks.

Deploying it resets every saved demo session once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lroy-stack
lroy-stack merged commit 8b8b5ec into main Nov 5, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant