@ultimat3/manifest 30.2.0 → 30.3.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ultimat3/manifest",
3
- "version": "30.2.0",
3
+ "version": "30.3.0",
4
4
  "description": "x.manifest.json: deterministic generated facts, contract diff, AGENTS.md budget",
5
5
  "keywords": [
6
6
  "ultimate",
@@ -43,12 +43,12 @@
43
43
  "test": "bun test"
44
44
  },
45
45
  "dependencies": {
46
- "@ultimat3/action": "30.2.0",
47
- "@ultimat3/core": "30.2.0",
48
- "@ultimat3/entity": "30.2.0",
49
- "@ultimat3/jobs": "30.2.0",
50
- "@ultimat3/query": "30.2.0",
51
- "@ultimat3/realtime": "30.2.0",
52
- "@ultimat3/schema": "30.2.0"
46
+ "@ultimat3/action": "30.3.0",
47
+ "@ultimat3/core": "30.3.0",
48
+ "@ultimat3/entity": "30.3.0",
49
+ "@ultimat3/jobs": "30.3.0",
50
+ "@ultimat3/query": "30.3.0",
51
+ "@ultimat3/realtime": "30.3.0",
52
+ "@ultimat3/schema": "30.3.0"
53
53
  }
54
54
  }
@@ -37,6 +37,7 @@ export function diffEntities(
37
37
  changes.push(...diffReason('shared', `${path}.shared`, entity.shared, next.shared));
38
38
  changes.push(...diffReason('scan', `${path}.scan`, entity.scan, next.scan));
39
39
  changes.push(...diffView(`${path}.view`, entity.view, next.view));
40
+ changes.push(...diffReadOnly(`${path}.readOnly`, entity.readOnly, next.readOnly));
40
41
  }
41
42
  for (const entity of after) {
42
43
  if (!beforeByName.has(entity.name)) {
@@ -124,6 +125,24 @@ function diffView(
124
125
  ];
125
126
  }
126
127
 
128
+ /** `diffView`'s axis: closing a table refuses every write that worked; opening one widens. */
129
+ function diffReadOnly(
130
+ path: string,
131
+ before: string | undefined,
132
+ after: string | undefined,
133
+ ): readonly ManifestChange[] {
134
+ if (before === after) return [];
135
+ if (before === undefined) {
136
+ return [
137
+ { kind: 'breaking', path, detail: `became readOnly (${after}); every write is refused` },
138
+ ];
139
+ }
140
+ if (after === undefined) {
141
+ return [{ kind: 'additive', path, detail: 'no longer readOnly; writes are accepted' }];
142
+ }
143
+ return [{ kind: 'internal', path, detail: `readOnly reason ${before} -> ${after}` }];
144
+ }
145
+
127
146
  function diffColumns(
128
147
  path: string,
129
148
  before: EntityFact,
package/src/schema.ts CHANGED
@@ -161,6 +161,8 @@ export interface EntityFact {
161
161
  readonly shared?: string;
162
162
  /** `entity({ scan })`: why the table may be read whole. Absent when undeclared. */
163
163
  readonly scan?: string;
164
+ /** `entity({ readOnly })`: why the app never writes the table; every write refused. Absent when undeclared. */
165
+ readonly readOnly?: string;
164
166
  /**
165
167
  * `entity({ view })`: a relation Postgres derives, so every write to it is refused and the admin
166
168
  * lists it read-only. `materialized` stores the rows a `refreshView()` job recomputes. Absent on
package/src/sources.ts CHANGED
@@ -169,6 +169,7 @@ export function frameworkSources(input: FrameworkSourcesInput): ManifestSources
169
169
  invariants: entity.invariants.map((invariant) => invariant.name),
170
170
  ...(entity.shared === undefined ? {} : { shared: entity.shared }),
171
171
  ...(entity.scan === undefined ? {} : { scan: entity.scan }),
172
+ ...(entity.readOnly === undefined ? {} : { readOnly: entity.readOnly }),
172
173
  ...(entity.view === undefined || entity.view === null
173
174
  ? {}
174
175
  : { view: { materialized: entity.view.materialized === true } }),