@fgv/ts-agent-memory 5.1.0-46 → 5.1.0-47
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/.rush/temp/{6e1299d1cebb080772163a532c221cd181b54f9f.tar.log → 5667e36f1c0cc503a5c20a3ebff76e7b9a702d41.tar.log} +8 -2
- package/.rush/temp/chunked-rush-logs/ts-agent-memory.build.chunks.jsonl +2 -2
- package/.rush/temp/operation/build/all.log +2 -2
- package/.rush/temp/operation/build/log-chunks.jsonl +2 -2
- package/.rush/temp/operation/build/state.json +1 -1
- package/README.md +55 -0
- package/dist/packlets/ingest/orchestrator.js +104 -19
- package/dist/packlets/ingest/orchestrator.js.map +1 -1
- package/dist/packlets/store/fileTreeMemoryStore.js +11 -4
- package/dist/packlets/store/fileTreeMemoryStore.js.map +1 -1
- package/dist/test/unit/ingest/dedupScope.test.js +434 -0
- package/dist/test/unit/ingest/dedupScope.test.js.map +1 -0
- package/dist/test/unit/ingest/orchestrator.test.js +7 -4
- package/dist/test/unit/ingest/orchestrator.test.js.map +1 -1
- package/dist/test/unit/tools/memoryTools.test.js +1 -0
- package/dist/test/unit/tools/memoryTools.test.js.map +1 -1
- package/dist/ts-agent-memory.d.ts +92 -5
- package/etc/ts-agent-memory.api.md +2 -0
- package/lib/packlets/ingest/orchestrator.d.ts +62 -5
- package/lib/packlets/ingest/orchestrator.d.ts.map +1 -1
- package/lib/packlets/ingest/orchestrator.js +104 -19
- package/lib/packlets/ingest/orchestrator.js.map +1 -1
- package/lib/packlets/store/fileTreeMemoryStore.d.ts +31 -1
- package/lib/packlets/store/fileTreeMemoryStore.d.ts.map +1 -1
- package/lib/packlets/store/fileTreeMemoryStore.js +11 -4
- package/lib/packlets/store/fileTreeMemoryStore.js.map +1 -1
- package/lib/test/unit/ingest/dedupScope.test.d.ts +2 -0
- package/lib/test/unit/ingest/dedupScope.test.d.ts.map +1 -0
- package/lib/test/unit/ingest/dedupScope.test.js +436 -0
- package/lib/test/unit/ingest/dedupScope.test.js.map +1 -0
- package/lib/test/unit/ingest/orchestrator.test.js +7 -4
- package/lib/test/unit/ingest/orchestrator.test.js.map +1 -1
- package/lib/test/unit/tools/memoryTools.test.js +1 -0
- package/lib/test/unit/tools/memoryTools.test.js.map +1 -1
- package/package.json +7 -7
- package/rush-logs/ts-agent-memory.build.cache.log +1 -1
- package/rush-logs/ts-agent-memory.build.log +2 -2
- package/src/packlets/ingest/orchestrator.ts +116 -21
- package/src/packlets/store/fileTreeMemoryStore.ts +40 -2
- package/src/test/unit/ingest/dedupScope.test.ts +542 -0
- package/src/test/unit/ingest/orchestrator.test.ts +4 -0
- package/src/test/unit/tools/memoryTools.test.ts +1 -0
- package/temp/build/lint/_eslint-5eVG3S6w.json +9 -5
- package/temp/build/typescript/ts_8nwakTlr.json +1 -1
- package/temp/ts-agent-memory.api.json +97 -0
- package/temp/ts-agent-memory.api.md +2 -0
|
@@ -348,9 +348,11 @@ export class FileTreeMemoryStore {
|
|
|
348
348
|
* vector index, the on-disk file, and the derived index never interleave.
|
|
349
349
|
*/
|
|
350
350
|
async _writeResolved(record, body, scope, idStem, hash) {
|
|
351
|
-
var _a;
|
|
352
351
|
const policy = this._policyFor(record.envelope.kind);
|
|
353
|
-
|
|
352
|
+
// Read through the public accessor so the write path and every external
|
|
353
|
+
// caller (the ingest orchestrator's layer-1) resolve dedup granularity from
|
|
354
|
+
// ONE place — there is no second declaration site.
|
|
355
|
+
const dedupScope = this.dedupScopeFor(record.envelope.kind);
|
|
354
356
|
// Content-hash dedup runs BEFORE policy. Its granularity is the kind's
|
|
355
357
|
// `dedupScope`:
|
|
356
358
|
// - 'content': an identical { kind, body, links } triple ANYWHERE in the
|
|
@@ -674,7 +676,6 @@ export class FileTreeMemoryStore {
|
|
|
674
676
|
* version's `valid_at` lower-bounds its interval.
|
|
675
677
|
*/
|
|
676
678
|
async _putVersioned(record, body, codec, scope) {
|
|
677
|
-
var _a;
|
|
678
679
|
const envelope = record.envelope;
|
|
679
680
|
const entityId = envelope.entityId;
|
|
680
681
|
const kind = envelope.kind;
|
|
@@ -686,7 +687,8 @@ export class FileTreeMemoryStore {
|
|
|
686
687
|
const priorCurrents = versions.filter(isVersionCurrent);
|
|
687
688
|
const current = selectCurrentVersion(versions);
|
|
688
689
|
const policy = this._policyFor(kind);
|
|
689
|
-
|
|
690
|
+
// Same single-owner read as the flat path (see `_writeResolved`).
|
|
691
|
+
const dedupScope = this.dedupScopeFor(kind);
|
|
690
692
|
return this._contentHash(kind, body, envelope.links).thenOnSuccess((hash) => {
|
|
691
693
|
// Entity-scoped dedup: a re-put is a no-op only when the CURRENT content AND
|
|
692
694
|
// its mutable metadata are unchanged (does not spawn a redundant version).
|
|
@@ -934,6 +936,11 @@ export class FileTreeMemoryStore {
|
|
|
934
936
|
var _a;
|
|
935
937
|
return (_a = this._writePolicies.get(kind)) !== null && _a !== void 0 ? _a : this._defaultPolicy;
|
|
936
938
|
}
|
|
939
|
+
/** {@inheritDoc IMemoryStore.dedupScopeFor} */
|
|
940
|
+
dedupScopeFor(kind) {
|
|
941
|
+
var _a;
|
|
942
|
+
return (_a = this._policyFor(kind).dedupScope) !== null && _a !== void 0 ? _a : DEFAULT_DEDUP_SCOPE;
|
|
943
|
+
}
|
|
937
944
|
/**
|
|
938
945
|
* Read and validate the record at `<scope>/<idStem>.md`, returning `undefined`
|
|
939
946
|
* when the scope directory or file is absent. Verifies the on-disk id ↔
|