@geonosis/document 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,124 @@
1
1
  # @geonosis/document
2
2
 
3
+ ## 0.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 7f24da6: `aggregate` no longer hardcodes the physical column `"total"` in `sum("total")::text` — it reads it,
8
+ `heads`'s own `"status"`/`"issueDate"` predicates, and the bucket expression's column off ONE
9
+ `columnOf` map, the same one `heads`'s select list already used. `DocumentColumns` gains `total`, a
10
+ renamed `total` column now also carried through `documentMigrations`' DDL and its per-column
11
+ sortable index.
12
+ - 7f24da6: The core knows a validator CONTRACT, never a schema library (#383): `DocumentDefinition` and
13
+ `DocumentEntity`'s `body`, `draft`, `incoming` and `card.schema` type parameters are bound to
14
+ `StandardSchemaV1` (`@standard-schema/spec`, types only) instead of `zod.ZodTypeAny` — zod, valibot
15
+ or a hand-built `{ '~standard': { validate, vendor, version } }` object all satisfy it equally, and
16
+ `zod` leaves `peerDependencies` (it stays a `devDependency` for the tests). `DocumentHead` and
17
+ `DocumentRecord` are no longer `z.infer<...>` of a zod schema — both are plain object types, and
18
+ `Document.head`/`Document.record` are `StandardSchemaV1` validators DERIVED by the new
19
+ `validatorOf` from two exported declarative field specs, `Document.headFields` and
20
+ `Document.recordFields` (the `FieldKind` union is exported too) — the base still enforces its own
21
+ contract on `headOf`, but a consumer folds `headFields` into their own library instead of restating
22
+ the seven fields by hand. `card` is now `{ schema, of(document, { counterpartyName }) }` instead of
23
+ a bare function, so a consumer's wire card schema travels beside the function that builds it.
24
+
25
+ `documentEntities` folds over the map's values instead of building a union itself: `nameSchema`,
26
+ `bodySchema` and `bodyDecoder` are REMOVED — removed without an alias at 0.x by agreement with the
27
+ one consumer; three lines in their door replace them: `names` for `nameSchema` (build your own enum
28
+ over it), `fold((e) => e.body)` (or the new `bodies` array) for `bodySchema` (build your own union),
29
+ and your own `z.union(...).compile()`/equivalent over `bodies` for `bodyDecoder`. `fold(pick)` reads
30
+ a per-entity fact off every entity in one place, typed over the union of the map's values; `bodies`
31
+ and `cards` are the DISTINCT declared body/card schemas, both `StandardSchemaV1[]`. A layer that
32
+ owns a per-entity decision registers by extending the fold and checks its own coverage once, at its
33
+ composition root — never a `satisfies Record<Names, T>` map filled in per call site.
34
+ - 7f24da6: The write model is now one verb, `commit` — an append-only log the application role cannot
35
+ rewrite (a guarded `revoke update, delete` plus a `before update or delete` trigger), a projection
36
+ derived from it, `ref` as the address (D-065). New doors: `commit`, `retire`, `succeed`,
37
+ `reinstate`, `at`, `asOf`, `history`, `verify`, `rebuild`, `canonicalOf`/`hashOf`, `systemActor`/
38
+ `isSystemActor`, the `ArchivePort`/`TimestampPort` types, `documentStore({ archive })`. Removed:
39
+ `upsert` (replaced by `commit`) and `revisions` (replaced by `history`) — `documentMigrations` now
40
+ requires `appRole` whenever its log renders (the default).
41
+ - 7f24da6: `documentStore({ registry, seam, table?, schema?, columns? })` (T2/S1): one physical table for
42
+ every document entity in a registry, discriminated by a `constants` column (`entity` unless
43
+ `columns.entity` names another) so two entities on one table never see each other's rows under the
44
+ same `number`. Per entity, `defineEntity` from `@geonosis/db` with `onRetiredConflict: 'replace'`,
45
+ `columns.version` declared, `indexed`/`sortable`/`filterable` over the seven `Document.headFields`
46
+ columns, and `item` that runs a stored body through the entity's own `migrateBody` then its
47
+ `~standard.validate` — a stored body that fails its own schema after migration is a refusal naming
48
+ the entity and the number, never an item. Writes run the entity's own `prepare` then `stampBody`.
49
+ `documentMigrations({ table?, schema?, columns? })` renders that table's DDL over `@geonosis/db`'s
50
+ `entityMigrations`: `total` is `numeric` (a text column orders `'9.00' > '10.00'`, and `total` is a
51
+ sortable, filterable listing column), every other head column `text`, plus a listing index on
52
+ `(entity, issueDate)` no per-column sortable index gives the table. `AnyDocumentEntity` is
53
+ exported from `documentEntities`'s own module (the bound `documentStore` and `documentEntities`
54
+ share). `@geonosis/db` and `@geonosis/conformance` join `dependencies` (`workspace:^`) — the core
55
+ did not declare them because it did not import them.
56
+ - 7f24da6: `documentStore(...)`'s composed store (T2/S2) grows two doors beside its per-entity `Entity`s:
57
+ `heads({ columns, entity?, order, where? })` — a projection over the head columns plus `entity` and
58
+ `number`, `entity` a single kind or a set (RECENT's own read narrows `kind IN ($kinds)`), `order` an
59
+ array (HEADS FOR MATCHING orders by `kind, number`) — and `aggregate({ by?, entity?, entities?,
60
+ measures, where? })` — `where` OPTIONAL (a plain `count()` with no range is one row), `by: 'status' |
61
+ 'entity' | { bucket: 'day' | 'week' | 'month', of: 'issueDate' }`, `measures: ('count' |
62
+ 'sum:total')[]`, `count` as a number and `sum:total` as a DECIMAL STRING (`sum("total")::text`,
63
+ `'0'` for an empty group), ordered by the `by` key. Both are tenant-scoped by the seam and exclude
64
+ retired rows. Six consumer reads (STATUS BREAKDOWN, TIME SERIES, COUNT BY ENTITY, RECENT, COUNT per
65
+ org, HEADS FOR MATCHING) are each a case in `domains/document/src/store/postgres.test.ts`, over real
66
+ Postgres 17 and 18, with hand-computed decimal sums (`12.50 + 0.25 = 12.75`, no float crossing).
67
+ - 7f24da6: `layer-walls` holds a NEW plant beside the core's: the store may reach `@geonosis/db` and
68
+ `@geonosis/conformance`, never `@geonosis/workflows` directly (`src/walls.test.ts`,
69
+ `src/__fixtures__/walls/domains/document/src/store/store-reaches-the-engine.ts`).
70
+ `create-geonosis`'s document scaffold entry now composes `documentStore` inside the tenant session
71
+ (`definitions.session`) instead of handing back the bare, un-composed registry. README: a "Store"
72
+ section, and "what does not exist yet" shortened to what T2 has not shipped.
73
+ - 7f24da6: `documentStore`/`documentMigrations` gain `revisions` (on by default, `document_revisions`;
74
+ `false` to opt out), keyed by `(tenant, entity, number, version)`. A changed upsert's `after.upsert`
75
+ inserts the row it overwrote (the prior body and its prior `updated_at`, plus `replaced_at`); an
76
+ identical body writes none. `after.replace` deletes a dead document's revisions before the row that
77
+ takes its number is inserted (W72's "nothing inherited"), and the undo of a changed upsert deletes
78
+ the one row that write inserted rather than replaying a new one. `store.revisions({ entity, number
79
+ })` answers `{ version, body, updatedAt, replacedAt }[]` ordered by version, migrated and validated
80
+ through the entity's own schema exactly as `item()` reads a document — a stored revision failing
81
+ its schema is refused naming the entity, the number AND the version.
82
+
83
+ ### Patch Changes
84
+
85
+ - 7f24da6: `UpsertOutput.replaced` gains `changed: boolean` (#396) — the same comparison that already decided
86
+ the version bump, now exposed instead of leaving a caller to re-derive it. `replaced` itself is
87
+ present whenever a previous row existed, identical body or not, so without this a caller could not
88
+ tell a real change from a no-op re-upsert. `domains/document`'s store deletes its own duplicated
89
+ `bodyChanged`/`canonicalOf` and reads `answered.replaced?.changed` off the floor instead.
90
+ - 02c80d6: `appRoleStatements` takes `appendOnly?: string[]` (`@geonosis/db`) — table names excluded from its
91
+ blanket grant's UPDATE and DELETE, holding regardless of whether it runs before or after the
92
+ migration that creates them (#408, from during.day's own provisioning order: migrate as owner, then
93
+ create the role, which the shipped code left with only the trigger standing — SQLSTATE P0001, never
94
+ the grant's own 42501). `@geonosis/document` exports `appendOnlyTables()` (the log's own name) and
95
+ `documentRoleStatements(appRole)` for a consumer that provisions its role by hand, outside
96
+ `appRoleStatements`.
97
+ - 4c00092: `fieldPatterns` (`Record<'calendarDate' | 'decimal', RegExp>`) is exported from the core — the
98
+ exact patterns `validatorOf` checks those two `FieldKind`s against — so a consumer's own zod (or
99
+ other) fold names neither regex a second time (#409, from during.day's own fold restating both).
100
+ - b583b8e: The log's own `committed | retired | reinstated` column is `revision_kind`, configurable via
101
+ `columns.revisionKind` — never the hard-coded `kind`, which collided with a consumer whose entity
102
+ column (`columns.entity`) is itself named `kind` (#407, from during.day's swap against the 0.2.0
103
+ candidate). The shipped `document_revisions` migration and the store's own reads/writes move to the
104
+ new name.
105
+ - 7f24da6: `EntityRow` gains `version?: number`, present when the entity declares `columns.version` —
106
+ `selected()` names the column so `get`/`list`/`listAll` carry it, at no extra statement. The
107
+ document store's `item()` reads it off the row directly; `withRealVersion` and the `seam.scoped`
108
+ wrappers it forced around `get`/`list`/`listAll` are gone, so a listing spends one select on the
109
+ page rather than one per row.
110
+ - Updated dependencies [7f24da6]
111
+ - Updated dependencies [7f24da6]
112
+ - Updated dependencies [02c80d6]
113
+ - Updated dependencies [7f24da6]
114
+ - @geonosis/db@0.8.0
115
+
116
+ ## 0.1.1
117
+
118
+ ### Patch Changes
119
+
120
+ - 237b325: The core declares no floor it does not import — the store, workflows and contract tickets declare theirs when they land.
121
+
3
122
  ## 0.1.0
4
123
 
5
124
  ### Minor Changes
package/README.md CHANGED
@@ -10,40 +10,60 @@ pnpm add @geonosis/document
10
10
 
11
11
  ## `Document`
12
12
 
13
- `Document = { head, record, extend }`. `head` is the indexed facts every document has —
14
- `status`, `issueDate`, `dueDate`, `counterparty`, `externalRef`, `revision`, `total`, every one
15
- nullable. Two refusals the schema makes that a looser one would not:
13
+ The core knows a CONTRACT, never a schema library: `body`, `draft`, `incoming` and `card.schema`
14
+ are each bound to `StandardSchemaV1` alone (`@standard-schema/spec`, types only — zod, valibot or a
15
+ hand-built `{ '~standard': { validate, vendor, version } }` object all satisfy it equally). Document
16
+ shouldn't know anything about schema; we extend, we do it.
17
+
18
+ `Document = { headFields, head, recordFields, record, extend }`. `headFields` is the declarative
19
+ FIELD SPEC every document's indexed facts are named from — `{ status: 'text', issueDate:
20
+ 'calendarDate', dueDate: 'calendarDate', counterparty: 'text', externalRef: 'text', revision:
21
+ 'text', total: 'decimal' }`, every field nullable. `head` is a `StandardSchemaV1` DERIVED from
22
+ `headFields` by `validatorOf` (exported, one small checker per `FieldKind`) — the base enforcing
23
+ its own contract, never a second listing of the fields. A consumer's wire schema folds
24
+ `headFields` into its own library instead of naming the seven fields by hand, and `fieldPatterns`
25
+ (exported) is `validatorOf`'s own `calendarDate`/`decimal` regexes so that fold names neither
26
+ pattern twice (#409). Two refusals the derived validator makes that a looser one would not:
16
27
 
17
28
  - `issueDate` and `dueDate` are calendar strings, `YYYY-MM-DD` or `null` — a `headOf` that answers
18
- with prose is refused at the `Document.head` parse, not accepted and read wrong three files
29
+ with prose is refused at the `Document.head` validation, not accepted and read wrong three files
19
30
  later.
20
31
  - `total` is a decimal STRING or `null` — money never crosses this boundary as a float.
21
32
 
22
- `record` is `{ version, createdAt, updatedAt }` — what storage adds once a document is written.
33
+ `recordFields` is `{ version: 'positiveInt', createdAt: 'int', updatedAt: 'int' }` and `record` is
34
+ its derived validator — what storage adds once a document is written.
23
35
 
24
36
  `Document.extend(definition)` takes the shape an entity decides (`name`, `noun`, `basePath`,
25
37
  `body`, `draft`, `incoming`, `statuses`, `numbering`, `fromDraft`, `headOf`, `searchText`,
26
38
  `statusOf`, `withStatus`, `prepare`, `merge`, `onSent`, `copy`, `removable`, `card`, and optionally
27
39
  `bodyVersion`/`migrations` — see body versioning below) and returns it with `is()`, a type guard
28
- narrowing on the entity's own name. `InstanceOf`, `BodyOf`, `DraftOf`, `IncomingOf`, `StatusOf`,
29
- `CardOf` and `NameOf` read the pieces back off an entity, generically.
40
+ narrowing on the entity's own name. `card` is `{ schema, of(document, { counterpartyName }) }` — ONE
41
+ shape, what the list endpoint returns per row and what the UI's list reads; the floor carries the
42
+ card's schema and never looks inside it. `InstanceOf`, `BodyOf`, `DraftOf`, `IncomingOf`, `StatusOf`,
43
+ `CardOf` and `NameOf` read the pieces back off an entity, generically, through
44
+ `StandardSchemaV1.InferOutput`.
30
45
 
31
46
  ## `documentEntities`
32
47
 
48
+ Document shouldn't know anything about schema — we extend, we do it (#383). A per-entity fact
49
+ (`card`, `headOf`, …) is declared once, at the entity's OWN `Document.extend` call — never a second
50
+ map a layer fills in per entity later. Totality lives at that extension site: `Document.extend`'s
51
+ own parameter type refuses an entity that leaves a required fact undecided, so a consumer never
52
+ reaches for a `satisfies Record<Names, T>` map to catch it (the pattern this ruling retires).
53
+
33
54
  `documentEntities({ memo: Memo, receipt: Receipt, … })` takes a map of `Document.extend` results,
34
55
  keyed by name, and:
35
56
 
36
57
  - refuses a map whose key does not match the definition's own `name` — a mismatch here is a row
37
58
  whose `entity` column nothing can find again;
38
- - derives `names` off the map's OWN keys — never a hand-written union, so a consumer's own
39
- `satisfies Record<Names, T>` map fails to compile the moment a new entity joins this one and that
40
- consumer has not decided for it (the totality guarantee `keyof typeof entities` gave the
41
- reference this floor was extracted from, and the reason the return type carries `names` rather
42
- than a caller reading `Object.keys` and hoping);
43
- - derives `nameSchema` (`z.enum`) and `bodySchema` (`z.union` over the DISTINCT declared body
44
- schemas — two entities sharing a shape contribute it once) — both read off the map, never
45
- restated;
46
- - `bodyDecoder` is `bodySchema` run through `z.compile` once, for a store that parses every row;
59
+ - derives `names` off the map's OWN keys — never a hand-written union;
60
+ - `fold(pick)` reads a per-entity fact off EVERY entity the map holds, in one place, typed over the
61
+ union of the map's values (`registry.fold((e) => e.card.schema)`) — a layer that owns a
62
+ cross-entity concern (a union type, a compiled decoder, a per-entity effect) registers by
63
+ extending the fold and checks its own coverage once, at ITS composition root; that layer, never
64
+ this one, is where `z.union`/`z.compile`/`z.enum` now live;
65
+ - `bodies` and `cards` are the DISTINCT declared body/card schemas (`StandardSchemaV1[]`, deduplicated
66
+ by identity) — the layer that needs a union or a compiled decoder builds it with its OWN library;
47
67
  - `instance(name, parts)` stamps a document with the entity name it was minted for; `named(name)`
48
68
  hands back one entity's own definition.
49
69
 
@@ -67,18 +87,119 @@ nothing.
67
87
  `documentIdentifiers(name)` derives every spelling a surface needs from one hyphenated entity name:
68
88
  `camel`, `pascal`, `pluralCamel`, `snake`, `snakePlural`, `path`.
69
89
 
90
+ ## Store
91
+
92
+ `documentStore({ registry, seam, table?, schema?, columns?, revisions?, archive? })` is ONE table
93
+ for every document entity the registry holds — never one table per entity — plus the append-only
94
+ log beside it. Per entity, a `defineEntity` (`@geonosis/db`) supplies `get`/`list`/`listAll` only
95
+ — the write model below has its own transaction shape and does not go through `defineEntity`'s
96
+ upsert path. `key: { column: 'number', param: 'ref' }`: `ref` (D-065) is the parameter every write
97
+ and read addresses a document by; `number` stays the PROJECTION's own physical column and head
98
+ field, unchanged. `constants: { [columns.entity ?? 'entity']: name }` is the discriminator two
99
+ entities on one table disagree on — a `ref` may repeat ACROSS entities and both rows exist,
100
+ discriminated by nothing else. `indexed`/`sortable`/`filterable` are the seven
101
+ `Document.headFields` columns, named off the field spec — never a second list.
102
+
103
+ `documentMigrations({ table?, schema?, columns?, revisions?, appRole })` renders the projection's
104
+ DDL — the seven head columns typed off `FieldKind`, `lineage` and `hash` beside the usual clocks —
105
+ and the log's, unless `revisions: false`. `appRole` is required whenever the log renders (the
106
+ default): the name a consumer's application connects as, the same law as
107
+ `@geonosis/db`'s own `appRoleStatements` (nothing here can pick it). The log's own
108
+ `committed | retired | reinstated` column is `columns.revisionKind`, `'revision_kind'` when
109
+ unnamed — never `'kind'`, which is what these docs use for `columns.entity`, and a consumer who
110
+ names their own entity column `kind` would otherwise get one physical column declared twice (#407).
111
+
112
+ ## Writes
113
+
114
+ There is ONE write verb, `commit`. `store.<entity>.commit({ ref, body, actor, reason? })` appends
115
+ an immutable revision and updates the projection, in one transaction: it locks the lineage's latest
116
+ row, computes `version + 1`, and answers `{ committed: true, version, hash, previous: { version,
117
+ hash } | null }`. An identical body (canonical) writes nothing and answers `{ committed: false,
118
+ version }` instead — the current version, never a new one. `actor` is REQUIRED on every write — a
119
+ principal's id, or `systemActor(name)` (exported, `core/actor`) for an unattended one
120
+ (`systemActor('recurring.generate')`); `isSystemActor(actor)` reads it back. `reason` is optional
121
+ prose.
122
+
123
+ A revision carries `tenant, entity, ref, lineage, version, kind, body, actor, reason, at, prevHash,
124
+ hash` (`kind`: `'committed' | 'retired' | 'reinstated'`) plus `compensationOf` (nullable — the
125
+ version an undo compensates). `at` is the DATABASE clock, never the application's. Every revision's
126
+ `hash` is `hashOf` (`core/hash`, exported) over the canonical form of everything but
127
+ `compensationOf` — `prevHash` is null only at version 1 of a lineage, so the chain is tamper-evident
128
+ from the first write; a consumer's own archive recomputes the SAME `hashOf`/`canonicalOf`, the one
129
+ canonicaliser both sides use.
130
+
131
+ `store.<entity>.retire({ ref, actor, reason? })` is a commit of kind `retired` — the body is the
132
+ last one, unchanged; the projection's `retired_at` is set; a retired document refuses `commit`.
133
+ `store.<entity>.succeed({ ref, body, actor, reason? })` is the only door back from retired: it opens
134
+ a NEW LINEAGE at version 1 — the old lineage's rows are untouched, its own `history` still reads.
135
+ `store.<entity>.reinstate({ ref, actor, reason? })` un-retires the SAME lineage (kind `reinstated`)
136
+ — never a new one.
137
+
138
+ The log the application role CANNOT rewrite has two walls, and both must stand for the write to be
139
+ refused at the PRIVILEGE (SQLSTATE 42501) rather than only at the trigger (P0001): a
140
+ `before update or delete` trigger that raises regardless of privilege — the owner is walled by this
141
+ alone, and `documentMigrations` renders it plus a guarded `revoke update, delete` that is a no-op
142
+ until the named role exists — and the grant itself, which is `@geonosis/db`'s
143
+ `appRoleStatements`'s to get right: its blanket `grant … on all tables` re-broadens whatever the
144
+ guarded revoke stripped, in EITHER provisioning order, unless it is told to exclude this table.
145
+ Call it with `appendOnly: appendOnlyTables()` (this domain's own export, naming its log) — this
146
+ holds regardless of whether migrations or the role come first (#408). A consumer that provisions
147
+ its role by hand, outside `appRoleStatements`, calls this domain's own `documentRoleStatements(
148
+ appRole)` instead, AFTER the role exists.
149
+
150
+ `undos` (D-063 clause 2) APPEND, never remove: the undo of a `commit` is a new revision restoring
151
+ the prior body; the undo of a FIRST commit (a create, no prior body to restore) is a `retired`
152
+ revision instead; the undo of a `retire` is a `reinstated` revision on the same lineage. Every
153
+ compensating revision carries `compensationOf`, naming the version it undoes — the archive shows
154
+ the rollback structurally, never in prose.
155
+
156
+ `documentStore({ archive })` (optional, `ArchivePort` from `core/ports`) copies a commit's revision
157
+ to `<tenant>/<entity>/<lineage>/<version>.json` AFTER its own transaction has committed — never
158
+ inside it, so an archive that is down never rolls a durable write back; the answer carries
159
+ `archived: false` instead, and a later ticket's workflow is what retries it. `TimestampPort` (a
160
+ trusted third party's timestamp over a hash) is declared beside it, not implemented by anything
161
+ here.
162
+
163
+ ## Reads
164
+
165
+ `store.<entity>.get({ ref })` is the projection's live head — migrated, validated, excludes a
166
+ retired document, as before. `store.<entity>.at({ ref, version })` and
167
+ `.asOf({ ref, at })` read the CURRENT lineage's own history: an exact version, or the latest
168
+ revision at or before an instant. `store.<entity>.history({ ref, lineage? })` answers `{ version,
169
+ kind, actor, reason, at, hash, body }[]` by version — `lineage` defaults to the current one, but an
170
+ explicit one (the value `succeed` left behind) still reads in full. `store.<entity>.verify({ ref,
171
+ lineage? })` recomputes every hash of a lineage from version 1 and answers `{ ok: true, versions }`
172
+ or `{ ok: false, brokenAt, expected, found }` — a fact no privilege can hide, since the log's own
173
+ bytes are what it reads.
174
+
175
+ `store.rebuild({ entity? })` (tenant-scoped) rewrites the projection from the log's own latest
176
+ version of its latest lineage, per `(entity, ref)`, and answers how many rows it wrote — a
177
+ consumer's repair tool, and the exam's own way of proving the projection is truly DERIVED.
178
+
179
+ `store.heads({ columns, entity?, order, where? })` is a PROJECTION, never an aggregate: the head
180
+ columns plus `entity` and `number`, `entity` one kind or a set, `order` every column a page is
181
+ ordered by (the tie-break included). `store.aggregate({ by?, entity?, entities?, measures, where? })`
182
+ answers `count` and `sum:total` — `where` OPTIONAL (a plain count with no range is one row) —
183
+ grouped by `'status' | 'entity' | { bucket: 'day' | 'week' | 'month', of: 'issueDate' }`. `count` is
184
+ a number; `sum:total` is a DECIMAL STRING (`sum("total")::text`, `'0'` for an empty group) — money
185
+ never crosses this door as a float either. Both are tenant-scoped by the seam and exclude retired
186
+ rows.
187
+
70
188
  ## What does not exist yet
71
189
 
72
- This ticket ships `src/core/` only. `src/store/` (one table, its revisions, the entity-floor
73
- composition), `src/workflows/` (the org's engine, the only internal folder that may import it),
74
- `src/contract/` (the wire schemas), `src/surface/` (the procedure/route/tool mounts), `src/ui/`
75
- (the view axis) and `src/conformance/` (the exam a consumer runs against their own provider) are
76
- later tickets — the internal layout is declared now (and held by `layer-walls`) so each lands
77
- inside the wall already drawn for it.
190
+ `src/store/` ships the commits (`commit`, `retire`, `succeed`, `reinstate`, `get`, `at`, `asOf`,
191
+ `history`, `verify`, `rebuild`, `heads`, `aggregate`) and the archive/timestamp ports declared, not
192
+ mirrored; it ships no search projection yet. `upsert` and `revisions` are GONE (replaced by
193
+ `commit`; `history`). `src/workflows/` (the org's engine, the only internal folder that may import
194
+ it — the archive mirror lands there), `src/contract/` (the wire schemas), `src/surface/` (the
195
+ procedure/route/tool mounts), `src/ui/` (the view axis) and `src/conformance/` (the exam a consumer
196
+ runs against their own provider) are later tickets — the internal layout is declared now (and held
197
+ by `layer-walls`) so each lands inside the wall already drawn for it.
78
198
 
79
199
  ## One door, and what holds it
80
200
 
81
201
  `sideEffects: false`; inside the package the in-package wall is `layer-walls`, planted in
82
202
  `src/__fixtures__/walls/` and proved through the real binary in `src/walls.test.ts` — the core may
83
- reach `@geonosis/conformance` and nothing else; only `src/workflows/` may reach `@geonosis/workflows`
203
+ reach `@geonosis/conformance` and nothing else, the store may reach `@geonosis/db` and
204
+ `@geonosis/conformance` and nothing else, and only `src/workflows/` may reach `@geonosis/workflows`
84
205
  directly (D-052 — the org's engine is a direct dependency of this domain).