@seanhogg/builderforce-memory 2026.10.75 → 2026.10.77
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/knowledge/facts/factsHash.d.ts +27 -0
- package/dist/knowledge/facts/factsHash.d.ts.map +1 -0
- package/dist/knowledge/facts/factsHash.js +67 -0
- package/dist/knowledge/facts/factsHash.js.map +1 -0
- package/dist/knowledge/facts/fileFacts.d.ts +70 -12
- package/dist/knowledge/facts/fileFacts.d.ts.map +1 -1
- package/dist/knowledge/facts/fileFacts.js +42 -33
- package/dist/knowledge/facts/fileFacts.js.map +1 -1
- package/dist/knowledge/facts/guards.d.ts +101 -0
- package/dist/knowledge/facts/guards.d.ts.map +1 -0
- package/dist/knowledge/facts/guards.js +260 -0
- package/dist/knowledge/facts/guards.js.map +1 -0
- package/dist/knowledge/index.d.ts +9 -1
- package/dist/knowledge/index.d.ts.map +1 -1
- package/dist/knowledge/index.js +7 -1
- package/dist/knowledge/index.js.map +1 -1
- package/dist/knowledge/rules/evaluateRules.d.ts.map +1 -1
- package/dist/knowledge/rules/evaluateRules.js +2 -1
- package/dist/knowledge/rules/evaluateRules.js.map +1 -1
- package/dist/knowledge/rules/factGraph.d.ts +2 -0
- package/dist/knowledge/rules/factGraph.d.ts.map +1 -1
- package/dist/knowledge/rules/factGraph.js +6 -2
- package/dist/knowledge/rules/factGraph.js.map +1 -1
- package/dist/knowledge/rules/factStore.d.ts +139 -0
- package/dist/knowledge/rules/factStore.d.ts.map +1 -0
- package/dist/knowledge/rules/factStore.js +252 -0
- package/dist/knowledge/rules/factStore.js.map +1 -0
- package/dist/stats/prng.d.ts +5 -1
- package/dist/stats/prng.d.ts.map +1 -1
- package/dist/stats/prng.js +11 -3
- package/dist/stats/prng.js.map +1 -1
- package/package.json +1 -1
- package/src/contract/exports.snapshot.json +14 -0
- package/src/contract/regression.prng.test.ts +126 -0
- package/src/contract/types.contract.test.ts +57 -2
- package/src/knowledge/facts/factsHash.test.ts +50 -0
- package/src/knowledge/facts/factsHash.ts +71 -0
- package/src/knowledge/facts/fileFacts.test.ts +2 -1
- package/src/knowledge/facts/fileFacts.ts +104 -36
- package/src/knowledge/facts/guards.test.ts +276 -0
- package/src/knowledge/facts/guards.ts +296 -0
- package/src/knowledge/index.ts +13 -1
- package/src/knowledge/rules/evaluateRules.ts +2 -1
- package/src/knowledge/rules/factGraph.ts +8 -2
- package/src/knowledge/rules/factStore.test.ts +303 -0
- package/src/knowledge/rules/factStore.ts +317 -0
- package/src/stats/prng.ts +11 -3
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* knowledge/rules/factStore.ts — the FACT STORE PORT (PRD 41 §B4) and the pure functions that persist, restore and sweep
|
|
3
|
+
* a {@link FactGraph} through it. No I/O here; {@link memoryFactStore} is the in-memory reference adapter.
|
|
4
|
+
*
|
|
5
|
+
* The graph maps onto the port 1:1:
|
|
6
|
+
* - OBJECTS: each `FileFacts` as its canonical JSON (`factsJson`) under its content address `factsHash`. Write-once.
|
|
7
|
+
* - MANIFEST: path → {@link FactManifestEntry} (`factsHash`, `contentHash`, kind hashes), stamped with a
|
|
8
|
+
* {@link FactStoreVersion}: an `epoch` (a random id minted when the store is created or reset) and a `generation`
|
|
9
|
+
* bumped by every manifest write and every sweep.
|
|
10
|
+
* - DERIVED: each {@link DerivedRow} under {@link derivedRowKey}, carrying its input-hash trace (`inputs`).
|
|
11
|
+
*
|
|
12
|
+
* Commit order: objects first, then the manifest delta and the derived puts/deletes in ONE transaction (`writeManifest`,
|
|
13
|
+
* compare-and-swap on the version). A write interrupted between the two leaves the previous manifest valid — it references
|
|
14
|
+
* only objects that already existed — and at worst unreferenced objects, which {@link sweepFactStore} removes.
|
|
15
|
+
*
|
|
16
|
+
* ADAPTERS:
|
|
17
|
+
* - Node (VSIX, on-prem): the G03 SQLite store (`localRecordTransaction`): an `extracted(hash PRIMARY KEY, json)` table
|
|
18
|
+
* plus manifest, derived and version rows in one `index.sqlite`. `writeManifest` and `sweepObjects` run in ONE
|
|
19
|
+
* `BEGIN IMMEDIATE` transaction each (the write lock is taken before the version is compared, so two processes never
|
|
20
|
+
* both pass the check). Adapter-private columns (stat, git blob id) never cross the port and never enter the dump (§B8.3).
|
|
21
|
+
* - Worker: the port needs a transactional compare-and-swap over manifest + derived. Put it behind a Durable Object
|
|
22
|
+
* (transactional storage), or keep manifest + derived as ONE R2 object written with an `onlyIf` etag precondition and
|
|
23
|
+
* the objects as R2 objects under their hash. Plain KV (eventually consistent, no CAS) cannot implement this port.
|
|
24
|
+
*
|
|
25
|
+
* HOST CONTRACT (recovery):
|
|
26
|
+
* - Saves to one store are SERIALIZED within a process (one writer queue per store); the version CAS guards only against
|
|
27
|
+
* other processes.
|
|
28
|
+
* - `fact_store_generation_conflict` (another writer, or a sweep, moved the store): `loadFactGraph`, re-apply the pending
|
|
29
|
+
* `FactChange`s with `updateFactGraph`, then `saveFactGraph` with the loaded {@link StoredFactGraph}; retry a bounded
|
|
30
|
+
* number of times (e.g. 3), then give up until the next change.
|
|
31
|
+
* - `fact_store_object_missing` / `fact_store_object_corrupt` / `fact_store_manifest_corrupt` / `fact_store_derived_corrupt`:
|
|
32
|
+
* the store is a disposable cache (§B1: it rebuilds to the same bytes) — call `reset()` and rebuild from the files.
|
|
33
|
+
*/
|
|
34
|
+
import { type DerivedRow } from './evaluateRules.js';
|
|
35
|
+
import { type FactGraph, type FactManifestEntry } from './factGraph.js';
|
|
36
|
+
/** A value or a promise of it: the SQLite adapter is synchronous, the Durable Object / R2 one is not. */
|
|
37
|
+
export type Awaitable<T> = T | Promise<T>;
|
|
38
|
+
/** Which store (`epoch`, minted on create and on `reset()`) and which state of it (`generation`, 0 when empty). */
|
|
39
|
+
export interface FactStoreVersion {
|
|
40
|
+
epoch: string;
|
|
41
|
+
generation: number;
|
|
42
|
+
}
|
|
43
|
+
/** The stored manifest: path → entry, at a version. */
|
|
44
|
+
export interface FactStoreManifest extends FactStoreVersion {
|
|
45
|
+
files: ReadonlyMap<string, FactManifestEntry>;
|
|
46
|
+
}
|
|
47
|
+
/** One manifest write: the entries put and the paths deleted, committed as `generation` (stored + 1) of `epoch`. */
|
|
48
|
+
export interface FactManifestDelta extends FactStoreVersion {
|
|
49
|
+
puts: ReadonlyMap<string, FactManifestEntry>;
|
|
50
|
+
deletes: readonly string[];
|
|
51
|
+
}
|
|
52
|
+
export interface FactStorePort {
|
|
53
|
+
/** The stored JSON of each hash present (absent hashes are left out). */
|
|
54
|
+
getObjects(hashes: readonly string[]): Awaitable<ReadonlyMap<string, string>>;
|
|
55
|
+
/** Stores objects (hash → JSON). WRITE-ONCE: an existing hash is left as it is. */
|
|
56
|
+
putObjects(objects: ReadonlyMap<string, string>): Awaitable<void>;
|
|
57
|
+
/** The version alone (cheap): what a load re-reads to detect a write that landed under it. */
|
|
58
|
+
readVersion(): Awaitable<FactStoreVersion>;
|
|
59
|
+
readManifest(): Awaitable<FactStoreManifest>;
|
|
60
|
+
/**
|
|
61
|
+
* ONE transaction: compares the version (`manifest.epoch` must be the stored epoch and `manifest.generation` the stored
|
|
62
|
+
* generation + 1, else `fact_store_generation_conflict`), checks that every put's object exists (else
|
|
63
|
+
* `fact_store_object_missing`), applies the manifest delta, puts the derived rows (by {@link derivedRowKey}) and
|
|
64
|
+
* deletes the derived keys.
|
|
65
|
+
*/
|
|
66
|
+
writeManifest(manifest: FactManifestDelta, derivedPuts: readonly DerivedRow[], derivedDeletes: readonly string[]): Awaitable<void>;
|
|
67
|
+
/** Every stored derived row by its key (bulk; the load path). */
|
|
68
|
+
derivedRows(): Awaitable<ReadonlyMap<string, DerivedRow>>;
|
|
69
|
+
/**
|
|
70
|
+
* ONE transaction: compares the version with `expected` (else `fact_store_generation_conflict`) and deletes every object
|
|
71
|
+
* the manifest does not reference; when it deleted any, it bumps the generation (a no-op sweep leaves the version as it
|
|
72
|
+
* was). Returns how many it deleted. The bump makes a writer that put objects before the sweep conflict on its
|
|
73
|
+
* `writeManifest`, so it re-puts them on retry.
|
|
74
|
+
*/
|
|
75
|
+
sweepObjects(expected: FactStoreVersion): Awaitable<number>;
|
|
76
|
+
/** Drops everything and mints a new epoch at generation 0 (the recovery for a corrupt store). */
|
|
77
|
+
reset(): Awaitable<void>;
|
|
78
|
+
}
|
|
79
|
+
/** A graph and the store version it was loaded or saved at: what a later save diffs against. */
|
|
80
|
+
export interface StoredFactGraph extends FactStoreVersion {
|
|
81
|
+
graph: FactGraph;
|
|
82
|
+
}
|
|
83
|
+
/** What a save wrote, and the stored graph to pass as `previous` to the next save. */
|
|
84
|
+
export interface FactStoreSaveResult extends StoredFactGraph {
|
|
85
|
+
/** Objects put (hashes, sorted). */
|
|
86
|
+
objects: string[];
|
|
87
|
+
/** Manifest paths put and deleted (sorted). */
|
|
88
|
+
puts: string[];
|
|
89
|
+
deletes: string[];
|
|
90
|
+
/** Derived keys put and deleted (sorted). */
|
|
91
|
+
derivedPuts: string[];
|
|
92
|
+
derivedDeletes: string[];
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Persists `graph`, writing ONLY the delta against what the store holds: the objects of new or changed manifest entries,
|
|
96
|
+
* the manifest entries that moved, the derived rows that moved and the keys that went away. Derived rows are diffed by
|
|
97
|
+
* identity against `previous.graph` (a reused row is the same object) ONLY when `previous` is at the stored epoch and
|
|
98
|
+
* generation; otherwise against the stored rows. Rejects `fact_store_generation_conflict` when another writer committed
|
|
99
|
+
* in between (see the recovery contract in the header).
|
|
100
|
+
*/
|
|
101
|
+
export declare function saveFactGraph(port: FactStorePort, graph: FactGraph, previous?: StoredFactGraph): Promise<FactStoreSaveResult>;
|
|
102
|
+
export interface LoadFactGraphOptions {
|
|
103
|
+
/**
|
|
104
|
+
* `full` (default; tests, the oracle): every object must hash to its address, and every manifest entry must match its
|
|
105
|
+
* object. `manifest`: trusts the stored address and checks only each entry's content hash and kind hashes against its
|
|
106
|
+
* object (cheaper on a large store; a corruption that leaves those intact goes unnoticed).
|
|
107
|
+
*/
|
|
108
|
+
verify?: 'full' | 'manifest';
|
|
109
|
+
}
|
|
110
|
+
/** How many times a load retries when a write lands under it before rejecting `fact_store_generation_conflict:load`. */
|
|
111
|
+
export declare const FACT_STORE_LOAD_ATTEMPTS = 3;
|
|
112
|
+
/**
|
|
113
|
+
* Restores the graph the store holds, with the version it was read at: the manifest, every referenced object (read through
|
|
114
|
+
* `readFileFacts`, so an object written before an additive field existed reads with that field empty) and every derived
|
|
115
|
+
* row with its trace. The result continues under `updateFactGraph` with early cutoff intact: a row whose trace still holds
|
|
116
|
+
* is reused, not rerun. The version is re-read after the rows: a write that landed mid-load (or a sweep that removed an
|
|
117
|
+
* object it was about to read) retries, up to {@link FACT_STORE_LOAD_ATTEMPTS}, so a graph never mixes generations (§B8.4).
|
|
118
|
+
* Throws the corruption errors of the header when the store itself is bad.
|
|
119
|
+
*/
|
|
120
|
+
export declare function loadFactGraph(port: FactStorePort, opts?: LoadFactGraphOptions): Promise<StoredFactGraph>;
|
|
121
|
+
/**
|
|
122
|
+
* The store's canonical dump (§B8.6, the port's `canonicalDump()`): sorted canonical JSON of the manifest, the referenced
|
|
123
|
+
* objects and the derived rows — exactly `factGraphDump` of the loaded graph, so a store and the graph it was saved from
|
|
124
|
+
* dump to the same bytes. Versions, storage layout and unreferenced objects never take part.
|
|
125
|
+
*/
|
|
126
|
+
export declare function factStoreDump(port: FactStorePort): Promise<string>;
|
|
127
|
+
/**
|
|
128
|
+
* Removes the objects the current manifest does not reference (§B4 sweep; run when idle). Rejects
|
|
129
|
+
* `fact_store_generation_conflict` when a write lands between reading the version and the sweep; the next idle sweep
|
|
130
|
+
* catches up. Returns how many objects it deleted.
|
|
131
|
+
*/
|
|
132
|
+
export declare function sweepFactStore(port: FactStorePort): Promise<number>;
|
|
133
|
+
/** The in-memory reference adapter (tests, a Worker's per-request graph). Stores JSON, so a load is a real round trip. */
|
|
134
|
+
export interface MemoryFactStore extends FactStorePort {
|
|
135
|
+
/** Every stored object hash, referenced or not (sorted). */
|
|
136
|
+
objectHashes(): string[];
|
|
137
|
+
}
|
|
138
|
+
export declare function memoryFactStore(): MemoryFactStore;
|
|
139
|
+
//# sourceMappingURL=factStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"factStore.d.ts","sourceRoot":"","sources":["../../../src/knowledge/rules/factStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAKH,OAAO,EAAiB,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,EAAoC,KAAK,SAAS,EAAE,KAAK,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAE1G,yGAAyG;AACzG,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;AAE1C,mHAAmH;AACnH,MAAM,WAAW,gBAAgB;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,uDAAuD;AACvD,MAAM,WAAW,iBAAkB,SAAQ,gBAAgB;IACvD,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;CACjD;AAED,oHAAoH;AACpH,MAAM,WAAW,iBAAkB,SAAQ,gBAAgB;IACvD,IAAI,EAAE,WAAW,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;IAC7C,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;CAC9B;AAED,MAAM,WAAW,aAAa;IAC1B,yEAAyE;IACzE,UAAU,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC9E,mFAAmF;IACnF,UAAU,CAAC,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;IAClE,8FAA8F;IAC9F,WAAW,IAAI,SAAS,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AAE,aAAa,EAAE,IAAI,GAAE,oBAAyB,GAAG,OAAO,CAAC,eAAe,CAAC,CAclH;AAED;;;;GAIG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CAExE;AAED;;;;GAIG;AACH,wBAAsB,cAAc,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CAEzE;AAED,0HAA0H;AAC1H,MAAM,WAAW,eAAgB,SAAQ,aAAa;IAClD,4DAA4D;IAC5D,YAAY,IAAI,MAAM,EAAE,CAAC;CAC5B;AAQD,wBAAgB,eAAe,IAAI,eAAe,CAoDjD"}
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* knowledge/rules/factStore.ts — the FACT STORE PORT (PRD 41 §B4) and the pure functions that persist, restore and sweep
|
|
3
|
+
* a {@link FactGraph} through it. No I/O here; {@link memoryFactStore} is the in-memory reference adapter.
|
|
4
|
+
*
|
|
5
|
+
* The graph maps onto the port 1:1:
|
|
6
|
+
* - OBJECTS: each `FileFacts` as its canonical JSON (`factsJson`) under its content address `factsHash`. Write-once.
|
|
7
|
+
* - MANIFEST: path → {@link FactManifestEntry} (`factsHash`, `contentHash`, kind hashes), stamped with a
|
|
8
|
+
* {@link FactStoreVersion}: an `epoch` (a random id minted when the store is created or reset) and a `generation`
|
|
9
|
+
* bumped by every manifest write and every sweep.
|
|
10
|
+
* - DERIVED: each {@link DerivedRow} under {@link derivedRowKey}, carrying its input-hash trace (`inputs`).
|
|
11
|
+
*
|
|
12
|
+
* Commit order: objects first, then the manifest delta and the derived puts/deletes in ONE transaction (`writeManifest`,
|
|
13
|
+
* compare-and-swap on the version). A write interrupted between the two leaves the previous manifest valid — it references
|
|
14
|
+
* only objects that already existed — and at worst unreferenced objects, which {@link sweepFactStore} removes.
|
|
15
|
+
*
|
|
16
|
+
* ADAPTERS:
|
|
17
|
+
* - Node (VSIX, on-prem): the G03 SQLite store (`localRecordTransaction`): an `extracted(hash PRIMARY KEY, json)` table
|
|
18
|
+
* plus manifest, derived and version rows in one `index.sqlite`. `writeManifest` and `sweepObjects` run in ONE
|
|
19
|
+
* `BEGIN IMMEDIATE` transaction each (the write lock is taken before the version is compared, so two processes never
|
|
20
|
+
* both pass the check). Adapter-private columns (stat, git blob id) never cross the port and never enter the dump (§B8.3).
|
|
21
|
+
* - Worker: the port needs a transactional compare-and-swap over manifest + derived. Put it behind a Durable Object
|
|
22
|
+
* (transactional storage), or keep manifest + derived as ONE R2 object written with an `onlyIf` etag precondition and
|
|
23
|
+
* the objects as R2 objects under their hash. Plain KV (eventually consistent, no CAS) cannot implement this port.
|
|
24
|
+
*
|
|
25
|
+
* HOST CONTRACT (recovery):
|
|
26
|
+
* - Saves to one store are SERIALIZED within a process (one writer queue per store); the version CAS guards only against
|
|
27
|
+
* other processes.
|
|
28
|
+
* - `fact_store_generation_conflict` (another writer, or a sweep, moved the store): `loadFactGraph`, re-apply the pending
|
|
29
|
+
* `FactChange`s with `updateFactGraph`, then `saveFactGraph` with the loaded {@link StoredFactGraph}; retry a bounded
|
|
30
|
+
* number of times (e.g. 3), then give up until the next change.
|
|
31
|
+
* - `fact_store_object_missing` / `fact_store_object_corrupt` / `fact_store_manifest_corrupt` / `fact_store_derived_corrupt`:
|
|
32
|
+
* the store is a disposable cache (§B1: it rebuilds to the same bytes) — call `reset()` and rebuild from the files.
|
|
33
|
+
*/
|
|
34
|
+
import { canonicalJson, compareStr } from '../refs.js';
|
|
35
|
+
import { readFileFacts } from '../facts/fileFacts.js';
|
|
36
|
+
import { factKindHashes, factsHash, factsJson } from '../facts/factsHash.js';
|
|
37
|
+
import { derivedRowKey } from './evaluateRules.js';
|
|
38
|
+
import { factGraphDump, sameManifestEntry } from './factGraph.js';
|
|
39
|
+
const rowJson = (row) => canonicalJson(row);
|
|
40
|
+
const sameVersion = (a, b) => a.epoch === b.epoch && a.generation === b.generation;
|
|
41
|
+
const conflict = (why) => new Error(`fact_store_generation_conflict:${why}`);
|
|
42
|
+
/**
|
|
43
|
+
* Persists `graph`, writing ONLY the delta against what the store holds: the objects of new or changed manifest entries,
|
|
44
|
+
* the manifest entries that moved, the derived rows that moved and the keys that went away. Derived rows are diffed by
|
|
45
|
+
* identity against `previous.graph` (a reused row is the same object) ONLY when `previous` is at the stored epoch and
|
|
46
|
+
* generation; otherwise against the stored rows. Rejects `fact_store_generation_conflict` when another writer committed
|
|
47
|
+
* in between (see the recovery contract in the header).
|
|
48
|
+
*/
|
|
49
|
+
export async function saveFactGraph(port, graph, previous) {
|
|
50
|
+
const stored = await port.readManifest();
|
|
51
|
+
const puts = new Map();
|
|
52
|
+
for (const [path, e] of graph.manifest)
|
|
53
|
+
if (!sameManifestEntry(e, stored.files.get(path)))
|
|
54
|
+
puts.set(path, e);
|
|
55
|
+
const deletes = [...stored.files.keys()].filter((p) => !graph.manifest.has(p)).sort(compareStr);
|
|
56
|
+
const objects = [...new Set([...puts.values()].map((e) => e.factsHash))].sort(compareStr);
|
|
57
|
+
if (objects.length > 0) {
|
|
58
|
+
const jsons = new Map();
|
|
59
|
+
for (const hash of objects) {
|
|
60
|
+
const facts = graph.objects.get(hash);
|
|
61
|
+
if (!facts)
|
|
62
|
+
throw new Error(`fact_store_object_missing:${hash}`);
|
|
63
|
+
jsons.set(hash, factsJson(facts));
|
|
64
|
+
}
|
|
65
|
+
await port.putObjects(jsons);
|
|
66
|
+
}
|
|
67
|
+
const derivedPuts = [];
|
|
68
|
+
let derivedDeletes;
|
|
69
|
+
if (previous && sameVersion(previous, stored)) {
|
|
70
|
+
for (const [key, row] of graph.derived)
|
|
71
|
+
if (previous.graph.derived.get(key) !== row)
|
|
72
|
+
derivedPuts.push(row);
|
|
73
|
+
derivedDeletes = [...previous.graph.derived.keys()].filter((k) => !graph.derived.has(k));
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
const rows = await port.derivedRows();
|
|
77
|
+
for (const [key, row] of graph.derived) {
|
|
78
|
+
const prior = rows.get(key);
|
|
79
|
+
if (!prior || rowJson(prior) !== rowJson(row))
|
|
80
|
+
derivedPuts.push(row);
|
|
81
|
+
}
|
|
82
|
+
derivedDeletes = [...rows.keys()].filter((k) => !graph.derived.has(k));
|
|
83
|
+
}
|
|
84
|
+
derivedPuts.sort((a, b) => compareStr(derivedRowKey(a.rule, a.focus), derivedRowKey(b.rule, b.focus)));
|
|
85
|
+
derivedDeletes.sort(compareStr);
|
|
86
|
+
const generation = stored.generation + 1;
|
|
87
|
+
await port.writeManifest({ epoch: stored.epoch, generation, puts, deletes }, derivedPuts, derivedDeletes);
|
|
88
|
+
return {
|
|
89
|
+
epoch: stored.epoch,
|
|
90
|
+
generation,
|
|
91
|
+
graph,
|
|
92
|
+
objects,
|
|
93
|
+
puts: [...puts.keys()].sort(compareStr),
|
|
94
|
+
deletes,
|
|
95
|
+
derivedPuts: derivedPuts.map((r) => derivedRowKey(r.rule, r.focus)),
|
|
96
|
+
derivedDeletes,
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
/** How many times a load retries when a write lands under it before rejecting `fact_store_generation_conflict:load`. */
|
|
100
|
+
export const FACT_STORE_LOAD_ATTEMPTS = 3;
|
|
101
|
+
async function loadOnce(port, stored, verify) {
|
|
102
|
+
const hashes = [...new Set([...stored.files.values()].map((e) => e.factsHash))].sort(compareStr);
|
|
103
|
+
const raw = await port.getObjects(hashes);
|
|
104
|
+
const objects = new Map();
|
|
105
|
+
for (const hash of hashes) {
|
|
106
|
+
const json = raw.get(hash);
|
|
107
|
+
if (json === undefined)
|
|
108
|
+
throw new Error(`fact_store_object_missing:${hash}`);
|
|
109
|
+
let facts;
|
|
110
|
+
try {
|
|
111
|
+
facts = readFileFacts(JSON.parse(json));
|
|
112
|
+
}
|
|
113
|
+
catch {
|
|
114
|
+
throw new Error(`fact_store_object_corrupt:${hash}`);
|
|
115
|
+
}
|
|
116
|
+
if (verify === 'full' && factsHash(facts) !== hash)
|
|
117
|
+
throw new Error(`fact_store_object_corrupt:${hash}`);
|
|
118
|
+
objects.set(hash, facts);
|
|
119
|
+
}
|
|
120
|
+
const manifest = new Map();
|
|
121
|
+
for (const path of [...stored.files.keys()].sort(compareStr)) {
|
|
122
|
+
const e = stored.files.get(path);
|
|
123
|
+
const facts = objects.get(e.factsHash);
|
|
124
|
+
const entry = { contentHash: facts.contentHash, factsHash: e.factsHash, kinds: factKindHashes(facts) };
|
|
125
|
+
if (!sameManifestEntry(e, entry))
|
|
126
|
+
throw new Error(`fact_store_manifest_corrupt:${path}`);
|
|
127
|
+
manifest.set(path, entry);
|
|
128
|
+
}
|
|
129
|
+
const derived = new Map();
|
|
130
|
+
const rows = await port.derivedRows();
|
|
131
|
+
for (const key of [...rows.keys()].sort(compareStr)) {
|
|
132
|
+
const row = rows.get(key);
|
|
133
|
+
if (derivedRowKey(row.rule, row.focus) !== key)
|
|
134
|
+
throw new Error(`fact_store_derived_corrupt:${key}`);
|
|
135
|
+
derived.set(key, row);
|
|
136
|
+
}
|
|
137
|
+
return { manifest, objects, derived };
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Restores the graph the store holds, with the version it was read at: the manifest, every referenced object (read through
|
|
141
|
+
* `readFileFacts`, so an object written before an additive field existed reads with that field empty) and every derived
|
|
142
|
+
* row with its trace. The result continues under `updateFactGraph` with early cutoff intact: a row whose trace still holds
|
|
143
|
+
* is reused, not rerun. The version is re-read after the rows: a write that landed mid-load (or a sweep that removed an
|
|
144
|
+
* object it was about to read) retries, up to {@link FACT_STORE_LOAD_ATTEMPTS}, so a graph never mixes generations (§B8.4).
|
|
145
|
+
* Throws the corruption errors of the header when the store itself is bad.
|
|
146
|
+
*/
|
|
147
|
+
export async function loadFactGraph(port, opts = {}) {
|
|
148
|
+
const verify = opts.verify ?? 'full';
|
|
149
|
+
for (let attempt = 0; attempt < FACT_STORE_LOAD_ATTEMPTS; attempt++) {
|
|
150
|
+
const stored = await port.readManifest();
|
|
151
|
+
let graph;
|
|
152
|
+
try {
|
|
153
|
+
graph = await loadOnce(port, stored, verify);
|
|
154
|
+
}
|
|
155
|
+
catch (err) {
|
|
156
|
+
if (!sameVersion(stored, await port.readVersion()))
|
|
157
|
+
continue;
|
|
158
|
+
throw err;
|
|
159
|
+
}
|
|
160
|
+
if (sameVersion(stored, await port.readVersion()))
|
|
161
|
+
return { epoch: stored.epoch, generation: stored.generation, graph };
|
|
162
|
+
}
|
|
163
|
+
throw conflict('load');
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* The store's canonical dump (§B8.6, the port's `canonicalDump()`): sorted canonical JSON of the manifest, the referenced
|
|
167
|
+
* objects and the derived rows — exactly `factGraphDump` of the loaded graph, so a store and the graph it was saved from
|
|
168
|
+
* dump to the same bytes. Versions, storage layout and unreferenced objects never take part.
|
|
169
|
+
*/
|
|
170
|
+
export async function factStoreDump(port) {
|
|
171
|
+
return factGraphDump((await loadFactGraph(port)).graph);
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Removes the objects the current manifest does not reference (§B4 sweep; run when idle). Rejects
|
|
175
|
+
* `fact_store_generation_conflict` when a write lands between reading the version and the sweep; the next idle sweep
|
|
176
|
+
* catches up. Returns how many objects it deleted.
|
|
177
|
+
*/
|
|
178
|
+
export async function sweepFactStore(port) {
|
|
179
|
+
return port.sweepObjects(await port.readVersion());
|
|
180
|
+
}
|
|
181
|
+
let epochCounter = 0;
|
|
182
|
+
function newEpoch() {
|
|
183
|
+
const uuid = globalThis.crypto?.randomUUID?.();
|
|
184
|
+
return uuid ?? `epoch-${Date.now().toString(36)}-${(epochCounter++).toString(36)}-${Math.random().toString(36).slice(2)}`;
|
|
185
|
+
}
|
|
186
|
+
export function memoryFactStore() {
|
|
187
|
+
const objects = new Map();
|
|
188
|
+
let manifest = new Map();
|
|
189
|
+
let derived = new Map();
|
|
190
|
+
let epoch = newEpoch();
|
|
191
|
+
let generation = 0;
|
|
192
|
+
const check = (expected, nextGeneration) => {
|
|
193
|
+
if (expected.epoch !== epoch || nextGeneration !== generation + 1) {
|
|
194
|
+
throw conflict(`${epoch}@${generation}->${expected.epoch}@${expected.generation}`);
|
|
195
|
+
}
|
|
196
|
+
};
|
|
197
|
+
return {
|
|
198
|
+
getObjects: (hashes) => new Map(hashes.filter((h) => objects.has(h)).map((h) => [h, objects.get(h)])),
|
|
199
|
+
putObjects: (puts) => { for (const [h, json] of puts)
|
|
200
|
+
if (!objects.has(h))
|
|
201
|
+
objects.set(h, json); },
|
|
202
|
+
readVersion: () => ({ epoch, generation }),
|
|
203
|
+
readManifest: () => ({
|
|
204
|
+
epoch,
|
|
205
|
+
generation,
|
|
206
|
+
files: new Map([...manifest].map(([p, json]) => [p, JSON.parse(json)])),
|
|
207
|
+
}),
|
|
208
|
+
writeManifest: (delta, derivedPuts, derivedDeletes) => {
|
|
209
|
+
check(delta, delta.generation);
|
|
210
|
+
for (const e of delta.puts.values())
|
|
211
|
+
if (!objects.has(e.factsHash))
|
|
212
|
+
throw new Error(`fact_store_object_missing:${e.factsHash}`);
|
|
213
|
+
// Stage, then swap: all or nothing.
|
|
214
|
+
const next = new Map(manifest);
|
|
215
|
+
for (const [p, e] of delta.puts)
|
|
216
|
+
next.set(p, canonicalJson(e));
|
|
217
|
+
for (const p of delta.deletes)
|
|
218
|
+
next.delete(p);
|
|
219
|
+
const rows = new Map(derived);
|
|
220
|
+
for (const row of derivedPuts)
|
|
221
|
+
rows.set(derivedRowKey(row.rule, row.focus), rowJson(row));
|
|
222
|
+
for (const key of derivedDeletes)
|
|
223
|
+
rows.delete(key);
|
|
224
|
+
manifest = next;
|
|
225
|
+
derived = rows;
|
|
226
|
+
generation = delta.generation;
|
|
227
|
+
},
|
|
228
|
+
derivedRows: () => new Map([...derived].map(([k, json]) => [k, JSON.parse(json)])),
|
|
229
|
+
sweepObjects: (expected) => {
|
|
230
|
+
check(expected, expected.generation + 1);
|
|
231
|
+
const live = new Set([...manifest.values()].map((json) => JSON.parse(json).factsHash));
|
|
232
|
+
let removed = 0;
|
|
233
|
+
for (const h of [...objects.keys()])
|
|
234
|
+
if (!live.has(h)) {
|
|
235
|
+
objects.delete(h);
|
|
236
|
+
removed++;
|
|
237
|
+
}
|
|
238
|
+
if (removed > 0)
|
|
239
|
+
generation += 1;
|
|
240
|
+
return removed;
|
|
241
|
+
},
|
|
242
|
+
reset: () => {
|
|
243
|
+
objects.clear();
|
|
244
|
+
manifest = new Map();
|
|
245
|
+
derived = new Map();
|
|
246
|
+
epoch = newEpoch();
|
|
247
|
+
generation = 0;
|
|
248
|
+
},
|
|
249
|
+
objectHashes: () => [...objects.keys()].sort(compareStr),
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
//# sourceMappingURL=factStore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"factStore.js","sourceRoot":"","sources":["../../../src/knowledge/rules/factStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,aAAa,EAAkB,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAmB,MAAM,oBAAoB,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAA0C,MAAM,gBAAgB,CAAC;AAmE1G,MAAM,OAAO,GAAG,CAAC,GAAe,EAAE,EAAE,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;AACxD,MAAM,WAAW,GAAG,CAAC,CAAmB,EAAE,CAAmB,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,UAAU,KAAK,CAAC,CAAC,UAAU,CAAC;AACvH,MAAM,QAAQ,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,IAAI,KAAK,C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}
|
package/dist/stats/prng.d.ts
CHANGED
|
@@ -4,7 +4,11 @@
|
|
|
4
4
|
* same inputs give byte-identical outputs on any machine. Algorithm: xoshiro128**.
|
|
5
5
|
*/
|
|
6
6
|
export type Rng = () => number;
|
|
7
|
-
/**
|
|
7
|
+
/**
|
|
8
|
+
* A deterministic RNG in [0, 1), seeded once. `seed = 0` is a valid seed. State (a, b, c, d) = (s0, s1, s2, s3)
|
|
9
|
+
* of the reference xoshiro128** (Blackman & Vigna): result = rotl(s1·5, 7)·9; t = s1 << 9 (a SHIFT, not a
|
|
10
|
+
* rotate — rotating collapsed every stream to 0 within a few hundred draws).
|
|
11
|
+
*/
|
|
8
12
|
export declare function createRng(seed: number): Rng;
|
|
9
13
|
/** Box–Muller standard-normal draw from a uniform RNG (deterministic under seed). */
|
|
10
14
|
export declare function normalDraw(rng: Rng): number;
|
package/dist/stats/prng.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prng.d.ts","sourceRoot":"","sources":["../../src/stats/prng.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"prng.d.ts","sourceRoot":"","sources":["../../src/stats/prng.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC;AAoB/B;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAc3C;AAED,qFAAqF;AACrF,wBAAgB,UAAU,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,CAI3C"}
|
package/dist/stats/prng.js
CHANGED
|
@@ -3,7 +3,11 @@
|
|
|
3
3
|
* stochastic routine here draws from THIS generator, seeded by the caller, so the
|
|
4
4
|
* same inputs give byte-identical outputs on any machine. Algorithm: xoshiro128**.
|
|
5
5
|
*/
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* SplitMix32-style seed expansion to four uint32 words. Never the all-zero state (the one fixed point of
|
|
8
|
+
* xoshiro): the finaliser is a bijection on uint32 (xor-shifts and odd multipliers), and its four inputs
|
|
9
|
+
* s + k·0x9e3779b9 (k = 1..4) are distinct mod 2^32, so at most one of the four words can be 0.
|
|
10
|
+
*/
|
|
7
11
|
function seedWords(seed) {
|
|
8
12
|
let s = seed >>> 0;
|
|
9
13
|
const next = () => {
|
|
@@ -16,13 +20,17 @@ function seedWords(seed) {
|
|
|
16
20
|
};
|
|
17
21
|
return [next(), next(), next(), next()];
|
|
18
22
|
}
|
|
19
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* A deterministic RNG in [0, 1), seeded once. `seed = 0` is a valid seed. State (a, b, c, d) = (s0, s1, s2, s3)
|
|
25
|
+
* of the reference xoshiro128** (Blackman & Vigna): result = rotl(s1·5, 7)·9; t = s1 << 9 (a SHIFT, not a
|
|
26
|
+
* rotate — rotating collapsed every stream to 0 within a few hundred draws).
|
|
27
|
+
*/
|
|
20
28
|
export function createRng(seed) {
|
|
21
29
|
let [a, b, c, d] = seedWords(seed);
|
|
22
30
|
return () => {
|
|
23
31
|
const result = (Math.imul(b, 5) << 7 | Math.imul(b, 5) >>> 25) >>> 0;
|
|
24
32
|
const out = ((result * 9) >>> 0) / 4294967296;
|
|
25
|
-
const t = (b << 9
|
|
33
|
+
const t = (b << 9) >>> 0;
|
|
26
34
|
c = (c ^ a) >>> 0;
|
|
27
35
|
d = (d ^ b) >>> 0;
|
|
28
36
|
b = (b ^ c) >>> 0;
|
package/dist/stats/prng.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prng.js","sourceRoot":"","sources":["../../src/stats/prng.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH
|
|
1
|
+
{"version":3,"file":"prng.js","sourceRoot":"","sources":["../../src/stats/prng.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH;;;;GAIG;AACH,SAAS,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C,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;QAClB,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;QAClB,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;QAClB,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;QAClB,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;QAClB,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC;QACnC,OAAO,GAAG,CAAC;IACf,CAAC,CAAC;AACN,CAAC;AAED,qFAAqF;AACrF,MAAM,UAAU,UAAU,CAAC,GAAQ;IAC/B,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;IAC3C,MAAM,EAAE,GAAG,GAAG,EAAE,CAAC;IACjB,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;AACrE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seanhogg/builderforce-memory",
|
|
3
|
-
"version": "2026.10.
|
|
3
|
+
"version": "2026.10.77",
|
|
4
4
|
"description": "BuilderForce Agent Memory — runtime layer. SSM execution, Transformer orchestration, online distillation, enterprise RAG (ingestion pipelines, vector-store adapters, tenant/ACL-scoped hybrid retrieval), multi-agent graph orchestration, LLM telemetry and cost accounting, persistent agent memory, and token-saving agent-run memory (code maps, a prompt-cache-safe working memory, chunked transcript windowing) for BuilderForce.ai agents.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -304,6 +304,7 @@
|
|
|
304
304
|
"FACT_GRAPH_DUMP_VERSION",
|
|
305
305
|
"FACT_KINDS",
|
|
306
306
|
"FACT_KIND_FIELDS",
|
|
307
|
+
"FACT_STORE_LOAD_ATTEMPTS",
|
|
307
308
|
"FALLBACK_PACK_ID",
|
|
308
309
|
"GENERIC_FINDING_RULES",
|
|
309
310
|
"GOD_MODULE_KIND",
|
|
@@ -317,6 +318,7 @@
|
|
|
317
318
|
"MAX_CALL_SITES_PER_EDGE",
|
|
318
319
|
"MAX_CLAIM_TEXT_CHARS",
|
|
319
320
|
"MAX_FINDING_NODES",
|
|
321
|
+
"MAX_MOUNT_DEPTH",
|
|
320
322
|
"MAX_NODES_CAP",
|
|
321
323
|
"MAX_QUOTE_CHARS",
|
|
322
324
|
"MAX_QUOTE_LINES",
|
|
@@ -385,6 +387,7 @@
|
|
|
385
387
|
"defineRule",
|
|
386
388
|
"derivedRowKey",
|
|
387
389
|
"detectCommunities",
|
|
390
|
+
"effectiveGuards",
|
|
388
391
|
"emptyFactGraph",
|
|
389
392
|
"encodeCoChange",
|
|
390
393
|
"entityKey",
|
|
@@ -399,8 +402,11 @@
|
|
|
399
402
|
"factKeyOf",
|
|
400
403
|
"factKindHashes",
|
|
401
404
|
"factRef",
|
|
405
|
+
"factStoreDump",
|
|
402
406
|
"factsExtractorTag",
|
|
403
407
|
"factsHash",
|
|
408
|
+
"factsJson",
|
|
409
|
+
"factsWireForm",
|
|
404
410
|
"failureTotal",
|
|
405
411
|
"failuresOf",
|
|
406
412
|
"fileRefOf",
|
|
@@ -429,23 +435,27 @@
|
|
|
429
435
|
"isRootFilePath",
|
|
430
436
|
"isSymbolEdgeKind",
|
|
431
437
|
"jobOf",
|
|
438
|
+
"joinRoutePath",
|
|
432
439
|
"judgedManifestKey",
|
|
433
440
|
"kindOfAnchor",
|
|
434
441
|
"knowledgeFacts",
|
|
435
442
|
"knowledgeInputHash",
|
|
436
443
|
"knownKeysOf",
|
|
437
444
|
"knownKeysOfEntities",
|
|
445
|
+
"loadFactGraph",
|
|
438
446
|
"loadKnowledgeIndex",
|
|
439
447
|
"loadPartitions",
|
|
440
448
|
"localSnapshotStore",
|
|
441
449
|
"matchGlob",
|
|
442
450
|
"matchLineage",
|
|
443
451
|
"mediaTypeOfPath",
|
|
452
|
+
"memoryFactStore",
|
|
444
453
|
"merkleTree",
|
|
445
454
|
"mostLikelyWalk",
|
|
446
455
|
"nameResolver",
|
|
447
456
|
"normalizeAnalysis",
|
|
448
457
|
"normalizeKey",
|
|
458
|
+
"normalizeMountPrefix",
|
|
449
459
|
"normalizePath",
|
|
450
460
|
"normalizeSnippet",
|
|
451
461
|
"oneLineLabel",
|
|
@@ -476,9 +486,12 @@
|
|
|
476
486
|
"resolveEntities",
|
|
477
487
|
"resolveRelativePath",
|
|
478
488
|
"reviewDirectory",
|
|
489
|
+
"rootRouters",
|
|
490
|
+
"routePathCovers",
|
|
479
491
|
"runEta",
|
|
480
492
|
"runKnowledgeRules",
|
|
481
493
|
"runRate",
|
|
494
|
+
"saveFactGraph",
|
|
482
495
|
"sha256",
|
|
483
496
|
"sha256Hex",
|
|
484
497
|
"slowestSteps",
|
|
@@ -487,6 +500,7 @@
|
|
|
487
500
|
"srcRef",
|
|
488
501
|
"startRun",
|
|
489
502
|
"stationTransitions",
|
|
503
|
+
"sweepFactStore",
|
|
490
504
|
"toCards",
|
|
491
505
|
"toMermaid",
|
|
492
506
|
"traceGraph",
|