@feltdb/core 0.11.5 → 0.11.7
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/dist/create/package-versions.js +1 -1
- package/dist/create/server-source/crates/feltdb/src/lib.rs +10 -1
- package/dist/create/server-source/crates/feltdb/src/semantic_decision.rs +124 -12
- package/dist/create/server-source/crates/feltdb/src/semantic_query.rs +599 -0
- package/dist/create/server-source/crates/feltdb/src/state_contract.rs +222 -0
- package/dist/create/server-source/crates/feltdb/tests/pr7_self_authorization_proof.rs +1 -0
- package/dist/create/server-source/crates/feltdb/tests/saas_invitation_lifecycle.rs +1 -0
- package/dist/create/server-source/crates/feltdb/tests/semantic_query.rs +767 -0
- package/dist/create/server-source/crates/feltdb/tests/semantic_query_contract.rs +363 -0
- package/dist/create/server-source/crates/feltdb-server/src/app_state.rs +5 -0
- package/dist/create/server-source/crates/feltdb-server/src/main.rs +150 -2
- package/dist/db.d.ts +43 -0
- package/dist/db.d.ts.map +1 -1
- package/dist/db.js +50 -0
- package/dist/embedded-query.d.ts +1 -0
- package/dist/embedded-query.d.ts.map +1 -1
- package/dist/embedded-query.js +15 -4
- package/dist/feltdb-vision-invariants.d.ts +1 -1
- package/dist/feltdb-vision-invariants.d.ts.map +1 -1
- package/dist/feltdb-vision-invariants.js +27 -0
- package/dist/file-db.d.ts +143 -14
- package/dist/file-db.d.ts.map +1 -1
- package/dist/file-db.js +690 -244
- package/dist/file-journal.d.ts +70 -0
- package/dist/file-journal.d.ts.map +1 -0
- package/dist/file-journal.js +184 -0
- package/dist/http-db.d.ts +8 -0
- package/dist/http-db.d.ts.map +1 -1
- package/dist/http-db.js +7 -0
- package/dist/index-core.d.ts +1 -0
- package/dist/index-core.d.ts.map +1 -1
- package/dist/index-core.js +1 -0
- package/dist/runtime-snapshot.d.ts +337 -0
- package/dist/runtime-snapshot.d.ts.map +1 -0
- package/dist/runtime-snapshot.js +482 -0
- package/dist/semantic-decision.d.ts +57 -0
- package/dist/semantic-decision.d.ts.map +1 -1
- package/dist/state-contract.d.ts +3 -2
- package/dist/state-contract.d.ts.map +1 -1
- package/dist/studio-app/assets/{feltdb_wasm-BGgGSBOP.js → feltdb_wasm-D58hv7aa.js} +1 -1
- package/dist/studio-app/assets/feltdb_wasm_bg-BgFXYOtc.wasm +0 -0
- package/dist/studio-app/assets/index-gR6d3Tys.js +30 -0
- package/dist/studio-app/index.html +1 -1
- package/dist/wasm/feltdb_wasm_bg.wasm +0 -0
- package/package.json +1 -1
- package/dist/studio-app/assets/feltdb_wasm_bg-ClM6Qpod.wasm +0 -0
- package/dist/studio-app/assets/index-Cg6EWmLb.js +0 -30
|
@@ -0,0 +1,482 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Native materialized runtime snapshots.
|
|
3
|
+
*
|
|
4
|
+
* A hot path — an authorization decision, an agent loop, a rendered view —
|
|
5
|
+
* reads the same durable state hundreds of times per second. Asking the
|
|
6
|
+
* durable authority every time is slow, so applications build their own cache,
|
|
7
|
+
* and that cache becomes an unofficial second database: mutable, unversioned,
|
|
8
|
+
* invalidated by hand, and eventually disagreeing with FeltDB.
|
|
9
|
+
*
|
|
10
|
+
* A runtime snapshot is FeltDB's answer. It is a *derived representation* of
|
|
11
|
+
* authoritative FeltDB state, not a second source of truth:
|
|
12
|
+
*
|
|
13
|
+
* - it says which durable state it represents, through the same revision
|
|
14
|
+
* semantics `freshness.ts` defines, or says honestly that it cannot;
|
|
15
|
+
* - it is immutable once published, so a consumer mid-decision cannot be
|
|
16
|
+
* overtaken by a partial rebuild;
|
|
17
|
+
* - it is replaced atomically, so consumers observe one complete snapshot or
|
|
18
|
+
* another, never a mixture;
|
|
19
|
+
* - it holds no reference to the database, so reading it cannot perform
|
|
20
|
+
* durable I/O — that is a structural property, not a promise;
|
|
21
|
+
* - it answers bounded queries through the same executor the embedded
|
|
22
|
+
* storage boundary uses, so filtering, ordering, cursors, and index
|
|
23
|
+
* selection mean what they already mean in FeltDB.
|
|
24
|
+
*
|
|
25
|
+
* Writes never go here. A snapshot has no `set` and no `delete`, because
|
|
26
|
+
* mutation belongs to the authoritative state APIs and nothing else.
|
|
27
|
+
*
|
|
28
|
+
* See docs/reference/runtime-snapshots.md for the contract, the consistency
|
|
29
|
+
* and staleness rules, and the memory and lifecycle semantics.
|
|
30
|
+
*/
|
|
31
|
+
import { isCacheCurrent, } from './freshness.js';
|
|
32
|
+
import { conditionMatches, EmbeddedQueryEngine } from './embedded-query.js';
|
|
33
|
+
export class SnapshotDefinitionError extends Error {
|
|
34
|
+
constructor(message) { super(message); this.name = 'SnapshotDefinitionError'; }
|
|
35
|
+
}
|
|
36
|
+
/** A build failed. The previously published snapshot, if any, remains active. */
|
|
37
|
+
export class SnapshotBuildError extends Error {
|
|
38
|
+
cause;
|
|
39
|
+
constructor(message, cause) {
|
|
40
|
+
super(message);
|
|
41
|
+
this.cause = cause;
|
|
42
|
+
this.name = 'SnapshotBuildError';
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
/** A snapshot was read before anything was published. */
|
|
46
|
+
export class SnapshotNotPublishedError extends Error {
|
|
47
|
+
constructor(message) { super(message); this.name = 'SnapshotNotPublishedError'; }
|
|
48
|
+
}
|
|
49
|
+
/** Proof of currency was required and the runtime cannot provide it. */
|
|
50
|
+
export class SnapshotFreshnessError extends Error {
|
|
51
|
+
constructor(message) { super(message); this.name = 'SnapshotFreshnessError'; }
|
|
52
|
+
}
|
|
53
|
+
const EMPTY = Object.freeze([]);
|
|
54
|
+
class PublishedSnapshot {
|
|
55
|
+
name;
|
|
56
|
+
generation;
|
|
57
|
+
basis;
|
|
58
|
+
materialization;
|
|
59
|
+
collections;
|
|
60
|
+
records;
|
|
61
|
+
constructor(name, generation, basis, materialization) {
|
|
62
|
+
this.name = name;
|
|
63
|
+
this.generation = generation;
|
|
64
|
+
this.basis = basis;
|
|
65
|
+
this.materialization = materialization;
|
|
66
|
+
this.collections = Object.freeze([...materialization.byCollection.keys()]);
|
|
67
|
+
this.records = materialization.records.size;
|
|
68
|
+
Object.freeze(this);
|
|
69
|
+
}
|
|
70
|
+
get revision() { return this.basis.revision; }
|
|
71
|
+
get materializedAt() { return this.basis.materializedAt; }
|
|
72
|
+
get(collection, id) {
|
|
73
|
+
return this.materialization.records.get(`${collection}:${id}`);
|
|
74
|
+
}
|
|
75
|
+
has(collection, id) {
|
|
76
|
+
return this.materialization.records.has(`${collection}:${id}`);
|
|
77
|
+
}
|
|
78
|
+
all(collection) {
|
|
79
|
+
this.requireCollection(collection);
|
|
80
|
+
return (this.materialization.byCollection.get(collection) ?? EMPTY);
|
|
81
|
+
}
|
|
82
|
+
query(request) {
|
|
83
|
+
this.requireCollection(request.collection);
|
|
84
|
+
return this.materialization.engine.execute(request);
|
|
85
|
+
}
|
|
86
|
+
derived() { return this.materialization.derived; }
|
|
87
|
+
explain(request) {
|
|
88
|
+
if (request) {
|
|
89
|
+
this.requireCollection(request.collection);
|
|
90
|
+
return this.materialization.engine.explain(request);
|
|
91
|
+
}
|
|
92
|
+
return {
|
|
93
|
+
name: this.name,
|
|
94
|
+
generation: this.generation,
|
|
95
|
+
records: this.records,
|
|
96
|
+
basis: this.basis,
|
|
97
|
+
buildMs: this.materialization.buildMs,
|
|
98
|
+
sources: this.materialization.sources,
|
|
99
|
+
indexes: this.materialization.indexes,
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* A collection the snapshot does not hold is a definition mistake, not an
|
|
104
|
+
* empty result. Answering "no records" would let a consumer conclude the
|
|
105
|
+
* durable state is empty when the snapshot simply never derived it.
|
|
106
|
+
*/
|
|
107
|
+
requireCollection(collection) {
|
|
108
|
+
if (!this.materialization.byCollection.has(collection)) {
|
|
109
|
+
throw new SnapshotDefinitionError(`snapshot "${this.name}" does not materialize collection "${collection}"; `
|
|
110
|
+
+ `it holds ${this.collections.length ? this.collections.join(', ') : 'no collections'}`);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* The lifecycle owner: CREATE → BUILD → VALIDATE → PUBLISH → READ → REPLACE.
|
|
116
|
+
*
|
|
117
|
+
* The handle is mutable — it is what replacement means. Everything it
|
|
118
|
+
* publishes is not.
|
|
119
|
+
*/
|
|
120
|
+
export class RuntimeSnapshotHandle {
|
|
121
|
+
definition;
|
|
122
|
+
source;
|
|
123
|
+
active;
|
|
124
|
+
generation = 0;
|
|
125
|
+
building;
|
|
126
|
+
listeners = new Set();
|
|
127
|
+
builds = 0;
|
|
128
|
+
failures = 0;
|
|
129
|
+
durableReads = 0;
|
|
130
|
+
lastFailure;
|
|
131
|
+
closed = false;
|
|
132
|
+
constructor(definition, source) {
|
|
133
|
+
this.definition = definition;
|
|
134
|
+
this.source = source;
|
|
135
|
+
assertSnapshotDefinition(definition);
|
|
136
|
+
}
|
|
137
|
+
get name() { return this.definition.name; }
|
|
138
|
+
/**
|
|
139
|
+
* The active snapshot, or `undefined` before the first successful build.
|
|
140
|
+
*
|
|
141
|
+
* Never performs I/O and never blocks: this is the hot-path accessor.
|
|
142
|
+
*/
|
|
143
|
+
get current() { return this.active; }
|
|
144
|
+
/** The active snapshot, or an error explaining that nothing is published yet. */
|
|
145
|
+
read() {
|
|
146
|
+
if (!this.active) {
|
|
147
|
+
throw new SnapshotNotPublishedError(`snapshot "${this.name}" has not been built; call refresh() before reading it`);
|
|
148
|
+
}
|
|
149
|
+
return this.active;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Build and publish a snapshot.
|
|
153
|
+
*
|
|
154
|
+
* When the runtime offers an authoritative revision and the active snapshot
|
|
155
|
+
* already represents it, nothing is rebuilt and the active snapshot is
|
|
156
|
+
* returned — the cheapest correct incremental step there is. `force` skips
|
|
157
|
+
* that check.
|
|
158
|
+
*
|
|
159
|
+
* A failed build throws and leaves the active snapshot untouched.
|
|
160
|
+
*/
|
|
161
|
+
async refresh(options = {}) {
|
|
162
|
+
this.assertOpen();
|
|
163
|
+
if (!options.force && this.active) {
|
|
164
|
+
const staleness = await this.staleness();
|
|
165
|
+
if (staleness.state === 'current')
|
|
166
|
+
return this.active;
|
|
167
|
+
}
|
|
168
|
+
return this.build();
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* A snapshot proven to represent current durable state.
|
|
172
|
+
*
|
|
173
|
+
* Rebuilds when stale, and refuses when currency cannot be established,
|
|
174
|
+
* rather than serving state of unknown age. Security-sensitive consumers —
|
|
175
|
+
* authorization above all — use this instead of `current`, so that their
|
|
176
|
+
* freshness requirement is explicit in the code that depends on it.
|
|
177
|
+
*/
|
|
178
|
+
async fresh() {
|
|
179
|
+
this.assertOpen();
|
|
180
|
+
const staleness = await this.staleness();
|
|
181
|
+
if (staleness.state === 'unknown') {
|
|
182
|
+
throw new SnapshotFreshnessError(`snapshot "${this.name}" cannot be proven current: ${staleness.reason}`);
|
|
183
|
+
}
|
|
184
|
+
if (staleness.state === 'current' && this.active)
|
|
185
|
+
return this.active;
|
|
186
|
+
const rebuilt = await this.build();
|
|
187
|
+
if (rebuilt.basis.validation !== 'revision') {
|
|
188
|
+
throw new SnapshotFreshnessError(`snapshot "${this.name}" was rebuilt without an authoritative revision: ${rebuilt.basis.reason}`);
|
|
189
|
+
}
|
|
190
|
+
return rebuilt;
|
|
191
|
+
}
|
|
192
|
+
/** Whether the active snapshot still represents current durable state. */
|
|
193
|
+
async staleness() {
|
|
194
|
+
const capability = await this.source.freshness();
|
|
195
|
+
if (capability.validation !== 'revision') {
|
|
196
|
+
return {
|
|
197
|
+
state: 'unknown',
|
|
198
|
+
reason: capability.reason ?? 'the runtime does not offer revision validation',
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
const current = await this.source.revision();
|
|
202
|
+
if (!this.active)
|
|
203
|
+
return { state: 'stale', current, reason: 'no snapshot has been published' };
|
|
204
|
+
const snapshot = this.active.revision;
|
|
205
|
+
if (!snapshot) {
|
|
206
|
+
return {
|
|
207
|
+
state: 'stale',
|
|
208
|
+
current,
|
|
209
|
+
reason: 'the active snapshot was built when the runtime offered no revision',
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
return {
|
|
213
|
+
state: isCacheCurrent(snapshot, current) ? 'current' : 'stale',
|
|
214
|
+
snapshot,
|
|
215
|
+
current,
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
/** Observe publications. The listener receives the snapshot that became active. */
|
|
219
|
+
subscribe(listener) {
|
|
220
|
+
this.listeners.add(listener);
|
|
221
|
+
return () => { this.listeners.delete(listener); };
|
|
222
|
+
}
|
|
223
|
+
/** What this handle holds, how it was built, and what it failed to build. */
|
|
224
|
+
explain() {
|
|
225
|
+
const published = this.active?.explain();
|
|
226
|
+
return {
|
|
227
|
+
name: this.name,
|
|
228
|
+
generation: this.generation,
|
|
229
|
+
records: published?.records ?? 0,
|
|
230
|
+
basis: published?.basis ?? {
|
|
231
|
+
validation: 'refresh',
|
|
232
|
+
reason: 'no snapshot has been published',
|
|
233
|
+
coherence: 'unproven',
|
|
234
|
+
materializedAt: 0,
|
|
235
|
+
},
|
|
236
|
+
buildMs: published?.buildMs ?? 0,
|
|
237
|
+
sources: published?.sources ?? [],
|
|
238
|
+
indexes: published?.indexes ?? [],
|
|
239
|
+
builds: this.builds,
|
|
240
|
+
failures: this.failures,
|
|
241
|
+
...(this.lastFailure ? { lastFailure: this.lastFailure } : {}),
|
|
242
|
+
durableReads: this.durableReads,
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Release the active snapshot.
|
|
247
|
+
*
|
|
248
|
+
* A handle retains exactly one snapshot, so this is what bounds retention
|
|
249
|
+
* when an application is done with a snapshot but keeps the database open.
|
|
250
|
+
* Consumers still holding a snapshot keep reading it; they always could.
|
|
251
|
+
*/
|
|
252
|
+
close() {
|
|
253
|
+
this.closed = true;
|
|
254
|
+
this.active = undefined;
|
|
255
|
+
this.listeners.clear();
|
|
256
|
+
}
|
|
257
|
+
assertOpen() {
|
|
258
|
+
if (this.closed)
|
|
259
|
+
throw new SnapshotDefinitionError(`snapshot "${this.name}" is closed`);
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Single-flight build. Two concurrent refreshes produce one materialization
|
|
263
|
+
* and one publication, not two builds racing to replace each other.
|
|
264
|
+
*/
|
|
265
|
+
build() {
|
|
266
|
+
if (this.building)
|
|
267
|
+
return this.building;
|
|
268
|
+
const running = this.runBuild();
|
|
269
|
+
this.building = running;
|
|
270
|
+
return running.finally(() => {
|
|
271
|
+
if (this.building === running)
|
|
272
|
+
this.building = undefined;
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
async runBuild() {
|
|
276
|
+
try {
|
|
277
|
+
const capability = await this.source.freshness();
|
|
278
|
+
if (capability.validation !== 'revision') {
|
|
279
|
+
const materialization = await this.materialize();
|
|
280
|
+
return this.publish(materialization, {
|
|
281
|
+
validation: 'refresh',
|
|
282
|
+
reason: capability.reason ?? 'the runtime does not offer revision validation',
|
|
283
|
+
coherence: 'unproven',
|
|
284
|
+
materializedAt: Date.now(),
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
// A revision read on each side of the materialization is what makes the
|
|
288
|
+
// result a point-in-time view rather than a smear across concurrent
|
|
289
|
+
// writes. When it moved, the work is discarded rather than published
|
|
290
|
+
// under a revision it does not represent.
|
|
291
|
+
const attempts = Math.max(1, this.definition.coherenceAttempts ?? 3);
|
|
292
|
+
for (let attempt = 1; attempt <= attempts; attempt += 1) {
|
|
293
|
+
const before = await this.source.revision();
|
|
294
|
+
const materialization = await this.materialize();
|
|
295
|
+
const after = await this.source.revision();
|
|
296
|
+
if (!isCacheCurrent(before, after))
|
|
297
|
+
continue;
|
|
298
|
+
return this.publish(materialization, {
|
|
299
|
+
validation: 'revision',
|
|
300
|
+
revision: before,
|
|
301
|
+
coherence: 'proven',
|
|
302
|
+
materializedAt: Date.now(),
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
throw new SnapshotBuildError(`durable state changed during each of ${attempts} materialization attempts for snapshot "${this.name}"`);
|
|
306
|
+
}
|
|
307
|
+
catch (error) {
|
|
308
|
+
this.failures += 1;
|
|
309
|
+
this.lastFailure = { at: Date.now(), message: error instanceof Error ? error.message : String(error) };
|
|
310
|
+
throw error instanceof SnapshotBuildError
|
|
311
|
+
? error
|
|
312
|
+
: new SnapshotBuildError(`snapshot "${this.name}" could not be built: ${this.lastFailure.message}`, error);
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
async materialize() {
|
|
316
|
+
const started = Date.now();
|
|
317
|
+
const freeze = this.definition.freezeRecords !== false;
|
|
318
|
+
const records = new Map();
|
|
319
|
+
const byCollection = new Map();
|
|
320
|
+
const definitions = [];
|
|
321
|
+
const sources = [];
|
|
322
|
+
const indexes = [];
|
|
323
|
+
for (const source of this.definition.sources) {
|
|
324
|
+
this.durableReads += 1;
|
|
325
|
+
const durable = await this.source.readRecords(source.collection);
|
|
326
|
+
const kept = [];
|
|
327
|
+
for (const record of durable) {
|
|
328
|
+
if (!record || typeof record !== 'object' || Array.isArray(record))
|
|
329
|
+
continue;
|
|
330
|
+
if (source.where && !source.where.every(condition => conditionMatches(record, condition)))
|
|
331
|
+
continue;
|
|
332
|
+
const id = record.id;
|
|
333
|
+
if (typeof id !== 'string' && typeof id !== 'number') {
|
|
334
|
+
throw new SnapshotBuildError(`a record in collection "${source.collection}" has no record id, so it cannot be materialized`);
|
|
335
|
+
}
|
|
336
|
+
if (freeze)
|
|
337
|
+
Object.freeze(record);
|
|
338
|
+
records.set(`${source.collection}:${id}`, record);
|
|
339
|
+
kept.push(record);
|
|
340
|
+
}
|
|
341
|
+
byCollection.set(source.collection, Object.freeze(kept));
|
|
342
|
+
sources.push({
|
|
343
|
+
collection: source.collection,
|
|
344
|
+
records: kept.length,
|
|
345
|
+
filtered: Boolean(source.where?.length),
|
|
346
|
+
indexes: (source.indexes ?? []).map(config => config.name),
|
|
347
|
+
});
|
|
348
|
+
for (const config of source.indexes ?? []) {
|
|
349
|
+
definitions.push([`__indexes__:${source.collection}:${config.name}`, { config }]);
|
|
350
|
+
indexes.push({
|
|
351
|
+
collection: source.collection,
|
|
352
|
+
name: config.name,
|
|
353
|
+
fields: config.fields?.length ? [...config.fields] : config.field ? [config.field] : [],
|
|
354
|
+
entries: kept.length,
|
|
355
|
+
});
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
// The same executor the embedded storage boundary uses, over materialized
|
|
359
|
+
// rows instead of durable ones. Reusing it is the point: a snapshot query
|
|
360
|
+
// plans, filters, orders, pages, and explains exactly as a durable bounded
|
|
361
|
+
// query does, because it is the same code.
|
|
362
|
+
const engine = new EmbeddedQueryEngine(function* () {
|
|
363
|
+
yield* definitions;
|
|
364
|
+
yield* records.entries();
|
|
365
|
+
});
|
|
366
|
+
const view = Object.freeze({
|
|
367
|
+
collections: Object.freeze([...byCollection.keys()]),
|
|
368
|
+
all: (collection) => (byCollection.get(collection) ?? EMPTY),
|
|
369
|
+
});
|
|
370
|
+
const derived = this.definition.derive
|
|
371
|
+
? freezeDerived(this.definition.derive(view))
|
|
372
|
+
: undefined;
|
|
373
|
+
return {
|
|
374
|
+
records,
|
|
375
|
+
byCollection,
|
|
376
|
+
engine,
|
|
377
|
+
sources: Object.freeze(sources),
|
|
378
|
+
indexes: Object.freeze(indexes),
|
|
379
|
+
derived,
|
|
380
|
+
buildMs: Date.now() - started,
|
|
381
|
+
};
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* VALIDATE, then PUBLISH.
|
|
385
|
+
*
|
|
386
|
+
* Publication is the single assignment below. A consumer holding the
|
|
387
|
+
* previous snapshot keeps a complete snapshot; a consumer reading after it
|
|
388
|
+
* gets a complete snapshot; there is no moment at which half of each is
|
|
389
|
+
* visible.
|
|
390
|
+
*/
|
|
391
|
+
publish(materialization, basis) {
|
|
392
|
+
const candidate = new PublishedSnapshot(this.name, this.generation + 1, Object.freeze(basis), materialization);
|
|
393
|
+
this.definition.validate?.(candidate);
|
|
394
|
+
this.active = candidate;
|
|
395
|
+
this.generation = candidate.generation;
|
|
396
|
+
this.builds += 1;
|
|
397
|
+
for (const listener of [...this.listeners]) {
|
|
398
|
+
// A subscriber that throws has a problem with its own reaction, not with
|
|
399
|
+
// the snapshot. It must not unpublish what is already active, nor stop
|
|
400
|
+
// the other subscribers from being told.
|
|
401
|
+
try {
|
|
402
|
+
listener(candidate);
|
|
403
|
+
}
|
|
404
|
+
catch { /* observers cannot fail a publication */ }
|
|
405
|
+
}
|
|
406
|
+
return candidate;
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
/** Shallow-freeze a derived value so publication cannot hand out mutable state. */
|
|
410
|
+
function freezeDerived(value) {
|
|
411
|
+
return value !== null && typeof value === 'object' ? Object.freeze(value) : value;
|
|
412
|
+
}
|
|
413
|
+
export function assertSnapshotDefinition(definition) {
|
|
414
|
+
if (!definition?.name?.trim()) {
|
|
415
|
+
throw new SnapshotDefinitionError('a snapshot definition requires a name');
|
|
416
|
+
}
|
|
417
|
+
if (!Array.isArray(definition.sources) || definition.sources.length === 0) {
|
|
418
|
+
throw new SnapshotDefinitionError(`snapshot "${definition.name}" declares no sources`);
|
|
419
|
+
}
|
|
420
|
+
const seen = new Set();
|
|
421
|
+
for (const source of definition.sources) {
|
|
422
|
+
if (!source?.collection?.trim()) {
|
|
423
|
+
throw new SnapshotDefinitionError(`snapshot "${definition.name}" declares a source with no collection`);
|
|
424
|
+
}
|
|
425
|
+
if (seen.has(source.collection)) {
|
|
426
|
+
throw new SnapshotDefinitionError(`snapshot "${definition.name}" declares collection "${source.collection}" twice`);
|
|
427
|
+
}
|
|
428
|
+
seen.add(source.collection);
|
|
429
|
+
for (const condition of source.where ?? []) {
|
|
430
|
+
const operators = ['eq', 'neq', 'lt', 'lte', 'gt', 'gte'].filter(operator => operator in condition);
|
|
431
|
+
if (!condition.field || operators.length !== 1) {
|
|
432
|
+
throw new SnapshotDefinitionError(`snapshot "${definition.name}" declares a condition on "${source.collection}" without exactly one operator`);
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
for (const index of source.indexes ?? []) {
|
|
436
|
+
if (!index?.name?.trim()) {
|
|
437
|
+
throw new SnapshotDefinitionError(`snapshot "${definition.name}" declares an unnamed index on "${source.collection}"`);
|
|
438
|
+
}
|
|
439
|
+
if (!index.field && !index.fields?.length) {
|
|
440
|
+
throw new SnapshotDefinitionError(`snapshot "${definition.name}" declares index "${index.name}" with no fields`);
|
|
441
|
+
}
|
|
442
|
+
if (index.type === 'text') {
|
|
443
|
+
// The runtime planner has no text access path. Accepting the
|
|
444
|
+
// declaration would publish a snapshot whose explain() names an index
|
|
445
|
+
// that never answers a query.
|
|
446
|
+
throw new SnapshotDefinitionError(`snapshot "${definition.name}" declares text index "${index.name}"; `
|
|
447
|
+
+ 'runtime snapshot indexes are hash, sorted, or compound');
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
/**
|
|
453
|
+
* Create a snapshot handle over any FeltDB runtime.
|
|
454
|
+
*
|
|
455
|
+
* `StateFirstDB.snapshot()` is the application-facing form; this is the same
|
|
456
|
+
* primitive for runtimes and tools that hold a source of their own.
|
|
457
|
+
*/
|
|
458
|
+
export function createRuntimeSnapshot(definition, source) {
|
|
459
|
+
return new RuntimeSnapshotHandle(definition, source);
|
|
460
|
+
}
|
|
461
|
+
/**
|
|
462
|
+
* Whether two definitions describe the same snapshot.
|
|
463
|
+
*
|
|
464
|
+
* Sources, filters, indexes, and options compare structurally; `derive` and
|
|
465
|
+
* `validate` compare by identity, because two functions with the same text can
|
|
466
|
+
* still compute different things and nothing here can tell.
|
|
467
|
+
*/
|
|
468
|
+
export function snapshotDefinitionsMatch(left, right) {
|
|
469
|
+
const shape = (definition) => JSON.stringify({
|
|
470
|
+
name: definition.name,
|
|
471
|
+
sources: definition.sources.map(source => ({
|
|
472
|
+
collection: source.collection,
|
|
473
|
+
where: source.where ?? [],
|
|
474
|
+
indexes: source.indexes ?? [],
|
|
475
|
+
})),
|
|
476
|
+
coherenceAttempts: definition.coherenceAttempts ?? null,
|
|
477
|
+
freezeRecords: definition.freezeRecords !== false,
|
|
478
|
+
});
|
|
479
|
+
return shape(left) === shape(right)
|
|
480
|
+
&& left.derive === right.derive
|
|
481
|
+
&& left.validate === right.validate;
|
|
482
|
+
}
|
|
@@ -164,4 +164,61 @@ export interface DecisionBatchEvaluation {
|
|
|
164
164
|
id: string;
|
|
165
165
|
result: DecisionResult;
|
|
166
166
|
}
|
|
167
|
+
/** Semantic composition over one bounded-query page. See docs/reference/semantic-query.md. */
|
|
168
|
+
export type SemanticQueryMode = 'evaluate' | 'reuse-only';
|
|
169
|
+
export interface SemanticQueryFilter {
|
|
170
|
+
/** `binary`: keep candidates whose decision equals this value. */
|
|
171
|
+
is?: boolean;
|
|
172
|
+
/** `choice` and `score`: keep candidates whose selected value is one of these declared values. */
|
|
173
|
+
in?: string[];
|
|
174
|
+
/** `score`: keep candidates at or above this declared level. */
|
|
175
|
+
atLeast?: string;
|
|
176
|
+
/** `score`: keep candidates at or below this declared level. */
|
|
177
|
+
atMost?: string;
|
|
178
|
+
}
|
|
179
|
+
export interface SemanticQueryOrder {
|
|
180
|
+
direction: 'asc' | 'desc';
|
|
181
|
+
}
|
|
182
|
+
export interface SemanticQueryClause {
|
|
183
|
+
decision: DecisionDefinition;
|
|
184
|
+
/** Defaults to `evaluate`. `reuse-only` never reaches a provider. */
|
|
185
|
+
mode?: SemanticQueryMode;
|
|
186
|
+
filter?: SemanticQueryFilter;
|
|
187
|
+
/** Only a `score` decision orders a page, by the ordinal of its selected level. */
|
|
188
|
+
orderBy?: SemanticQueryOrder;
|
|
189
|
+
/** Explicit field selection, narrowed further by authorization. */
|
|
190
|
+
fields?: string[];
|
|
191
|
+
schemaVersion?: string;
|
|
192
|
+
/** Field-level narrowing; the authority binds the principal to the authenticated one. */
|
|
193
|
+
authorization?: DecisionTransportAuthorization;
|
|
194
|
+
}
|
|
195
|
+
export interface SemanticAnnotation {
|
|
196
|
+
record_id: string;
|
|
197
|
+
result: DecisionResult;
|
|
198
|
+
cached: boolean;
|
|
199
|
+
provenance: DecisionEvaluation['provenance'];
|
|
200
|
+
}
|
|
201
|
+
export type SemanticUnevaluatedReason = 'unauthorized' | 'no-judgment' | 'missing';
|
|
202
|
+
export interface SemanticStageSummary {
|
|
203
|
+
definition_hash: string;
|
|
204
|
+
schema_version: string;
|
|
205
|
+
runtime: DecisionRuntimeMetadata;
|
|
206
|
+
mode: SemanticQueryMode;
|
|
207
|
+
candidates: number;
|
|
208
|
+
reused: number;
|
|
209
|
+
evaluated: number;
|
|
210
|
+
unevaluated: number;
|
|
211
|
+
filtered: number;
|
|
212
|
+
}
|
|
213
|
+
export interface SemanticQueryResult {
|
|
214
|
+
/** False when at least one candidate of the page could not be evaluated. */
|
|
215
|
+
complete: boolean;
|
|
216
|
+
stage: SemanticStageSummary;
|
|
217
|
+
/** Aligned with the page's `records`; `null` for a record that was not evaluated. */
|
|
218
|
+
annotations: Array<SemanticAnnotation | null>;
|
|
219
|
+
unevaluated: Array<{
|
|
220
|
+
record_id: string;
|
|
221
|
+
reason: SemanticUnevaluatedReason;
|
|
222
|
+
}>;
|
|
223
|
+
}
|
|
167
224
|
//# sourceMappingURL=semantic-decision.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"semantic-decision.d.ts","sourceRoot":"","sources":["../src/semantic-decision.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE;QAAE,IAAI,EAAE,OAAO,GAAG,SAAS,GAAG,UAAU,GAAG,OAAO,GAAG,YAAY,GAAG,QAAQ,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;IACpG,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAA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,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,mBAAmB;IAClC,4EAA4E;IAC5E,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,oBAAoB,CAAC;IAC5B,qFAAqF;IACrF,WAAW,EAAE,KAAK,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAAC;IAC9C,WAAW,EAAE,KAAK,CAAC;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,yBAAyB,CAAA;KAAE,CAAC,CAAC;CAC9E"}
|
package/dist/state-contract.d.ts
CHANGED
|
@@ -102,7 +102,8 @@ export interface CanonicalQuery {
|
|
|
102
102
|
collection: string;
|
|
103
103
|
projection?: string[];
|
|
104
104
|
as_name: string;
|
|
105
|
-
}[];
|
|
105
|
+
}[]; /** Recognized and refused with SEMANTIC_UNSUPPORTED: canonical queries do not compose semantic decisions. Use the bounded authority query. */
|
|
106
|
+
semantic?: never;
|
|
106
107
|
}
|
|
107
108
|
export interface QueryResult<T = Record<string, unknown>> {
|
|
108
109
|
query_id: string;
|
|
@@ -140,7 +141,7 @@ export interface TransactionResult {
|
|
|
140
141
|
audit: unknown;
|
|
141
142
|
}
|
|
142
143
|
export interface StateFailure {
|
|
143
|
-
code: 'VALIDATION_FAILED' | 'PRECONDITION_FAILED' | 'AUTHORIZATION_DENIED' | 'SCHEMA_MISMATCH' | 'CONFLICT' | 'STORAGE_FAILURE' | 'INVALID_QUERY' | 'UNKNOWN_FIELD' | 'UNKNOWN_COLLECTION' | 'UNAUTHORIZED_PROJECTION' | 'INVALID_CURSOR' | 'STATE_UNAVAILABLE';
|
|
144
|
+
code: 'VALIDATION_FAILED' | 'PRECONDITION_FAILED' | 'AUTHORIZATION_DENIED' | 'SCHEMA_MISMATCH' | 'CONFLICT' | 'STORAGE_FAILURE' | 'INVALID_QUERY' | 'UNKNOWN_FIELD' | 'UNKNOWN_COLLECTION' | 'UNAUTHORIZED_PROJECTION' | 'INVALID_CURSOR' | 'STATE_UNAVAILABLE' | 'SEMANTIC_UNSUPPORTED';
|
|
144
145
|
message: string;
|
|
145
146
|
expected?: unknown;
|
|
146
147
|
actual?: unknown;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state-contract.d.ts","sourceRoot":"","sources":["../src/state-contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAGvF,gEAAgE;AAChE,MAAM,MAAM,aAAa,GAAC,QAAQ,GAAC,SAAS,GAAC,QAAQ,GAAC,SAAS,GAAC,WAAW,GAAC,MAAM,GAAC,MAAM,GAAC,MAAM,GAAC,MAAM,GAAC,SAAS,GAAC,OAAO,GAAC,QAAQ,GAAC,OAAO,GAAC,KAAK,GAAC,OAAO,GAAC,QAAQ,GAAC,MAAM,GAAC,WAAW,GAAC,QAAQ,CAAC;AAC9L,MAAM,MAAM,SAAS,GAAC;IAAC,IAAI,EAAC,WAAW,CAAC;IAAA,SAAS,EAAC,aAAa,CAAA;CAAC,GAAC;IAAC,IAAI,EAAC,MAAM,CAAC;IAAA,MAAM,EAAC,MAAM,EAAE,CAAA;CAAC,GAAC;IAAC,IAAI,EAAC,WAAW,CAAC;IAAA,UAAU,EAAC,MAAM,CAAA;CAAC,GAAC;IAAC,IAAI,EAAC,OAAO,CAAC;IAAA,KAAK,EAAC,SAAS,CAAA;CAAC,GAAC;IAAC,IAAI,EAAC,KAAK,CAAC;IAAA,MAAM,EAAC,SAAS,CAAA;CAAC,GAAC;IAAC,IAAI,EAAC,QAAQ,CAAC;IAAA,UAAU,CAAC,EAAC,MAAM,CAAA;CAAC,CAAC;AACpO,MAAM,WAAW,UAAU;IAAC,IAAI,EAAC,MAAM,CAAC;IAAA,UAAU,EAAC,SAAS,CAAC;IAAA,QAAQ,CAAC,EAAC,OAAO,CAAC;IAAA,QAAQ,CAAC,EAAC,OAAO,CAAC;IAAA,OAAO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