@remnic/core 9.35.2 → 9.35.3
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/access-admin-ops-surface.d.ts +5 -5
- package/dist/access-admin-ops-surface.js +19 -18
- package/dist/access-authorization-probe.d.ts +5 -5
- package/dist/access-authorization-probe.js +20 -19
- package/dist/access-boundary.d.ts +5 -5
- package/dist/access-boundary.js +19 -18
- package/dist/access-cli.js +39 -38
- package/dist/access-cli.js.map +1 -1
- package/dist/access-extraction-force-flush.d.ts +5 -5
- package/dist/access-extraction-force-flush.js +19 -18
- package/dist/access-http-lcm-compaction.d.ts +5 -5
- package/dist/access-http-lifecycle-flush.d.ts +5 -5
- package/dist/access-http.d.ts +5 -5
- package/dist/access-http.js +24 -23
- package/dist/access-identity-continuity-surface.d.ts +4 -4
- package/dist/access-identity-continuity-surface.js +19 -18
- package/dist/access-lcm-surface.d.ts +5 -5
- package/dist/access-lcm-surface.js +19 -18
- package/dist/access-mcp.d.ts +5 -5
- package/dist/access-mcp.js +22 -21
- package/dist/access-namespace-preflight.js +19 -18
- package/dist/access-observe-write-surface.d.ts +5 -5
- package/dist/access-observe-write-surface.js +19 -18
- package/dist/access-operations-batch.js +20 -19
- package/dist/access-operations.d.ts +5 -5
- package/dist/access-operations.js +21 -20
- package/dist/access-recall-concurrency.d.ts +5 -5
- package/dist/access-recall-concurrency.js +19 -18
- package/dist/access-recall-response.d.ts +5 -5
- package/dist/access-recall-response.js +19 -18
- package/dist/access-recall-surface.d.ts +5 -5
- package/dist/access-recall-surface.js +19 -18
- package/dist/access-schema.d.ts +4 -4
- package/dist/{access-service-D9zIBlpp.d.ts → access-service-C2WYT1pO.d.ts} +3 -3
- package/dist/access-service-helpers.d.ts +5 -5
- package/dist/access-service.d.ts +5 -5
- package/dist/access-service.js +19 -18
- package/dist/access-surface-catalog.d.ts +5 -5
- package/dist/access-wearables-meetings-surface.d.ts +2 -2
- package/dist/bootstrap.d.ts +4 -4
- package/dist/briefing.d.ts +1 -1
- package/dist/briefing.js +10 -9
- package/dist/buffer.d.ts +1 -1
- package/dist/{capsule-merge-2H2IUTBT.js → capsule-merge-IDWJPCWK.js} +77 -8
- package/dist/capsule-merge-IDWJPCWK.js.map +1 -0
- package/dist/causal-consolidation.js +11 -10
- package/dist/causal-consolidation.js.map +1 -1
- package/dist/{chunk-65ZPVYTA.js → chunk-3CE77VAP.js} +55 -5
- package/dist/chunk-3CE77VAP.js.map +1 -0
- package/dist/chunk-4J7G5SY4.js +338 -0
- package/dist/chunk-4J7G5SY4.js.map +1 -0
- package/dist/{chunk-EO7X2LDK.js → chunk-4TAD3B56.js} +2 -2
- package/dist/{chunk-QHYB4MJV.js → chunk-5ZGHUWTT.js} +2 -2
- package/dist/{chunk-TCIWHK3N.js → chunk-6D5D5A4M.js} +5 -5
- package/dist/{chunk-BIXWNHIL.js → chunk-6TF4M2LB.js} +5 -5
- package/dist/{chunk-FHYGLITW.js → chunk-AKELMJO2.js} +217 -45
- package/dist/{chunk-FHYGLITW.js.map → chunk-AKELMJO2.js.map} +1 -1
- package/dist/{chunk-FBUE6PD3.js → chunk-BEQOZOYZ.js} +21 -4
- package/dist/chunk-BEQOZOYZ.js.map +1 -0
- package/dist/{chunk-SA3WJJF2.js → chunk-BGLDKAYY.js} +2 -2
- package/dist/{chunk-OPRP6Q4Z.js → chunk-DKKZ6SO2.js} +3 -3
- package/dist/{chunk-6TAUHL33.js → chunk-DLVPUX7U.js} +10 -2
- package/dist/chunk-DLVPUX7U.js.map +1 -0
- package/dist/{chunk-QNWXCJ76.js → chunk-ENTCVTQR.js} +18 -1
- package/dist/{chunk-QNWXCJ76.js.map → chunk-ENTCVTQR.js.map} +1 -1
- package/dist/{chunk-AEPYA55F.js → chunk-FE7MUX7M.js} +2 -2
- package/dist/{chunk-GHR7WHZX.js → chunk-GORHSN5C.js} +2 -2
- package/dist/{chunk-7TEZUUGM.js → chunk-HUS2XN3T.js} +2 -2
- package/dist/{chunk-XWDZQIYU.js → chunk-IJAQCBGV.js} +2 -2
- package/dist/{chunk-TJLLYV2X.js → chunk-IMEXE4XS.js} +7 -7
- package/dist/{chunk-IZXTZ7BF.js → chunk-JYLN6KHH.js} +6 -6
- package/dist/{chunk-HEVWWPTL.js → chunk-LH3KXIBJ.js} +17 -17
- package/dist/{chunk-EH5U2YCX.js → chunk-M3DBB2ND.js} +2 -2
- package/dist/{chunk-XABS455Y.js → chunk-NBAEGFXT.js} +5 -5
- package/dist/{chunk-T4HH5Q3U.js → chunk-OJRLTZQM.js} +3 -3
- package/dist/{chunk-7ZHGPX56.js → chunk-PRP3M5Y3.js} +2 -2
- package/dist/{chunk-Y2ZD2RVG.js → chunk-PYTUBWAS.js} +2 -2
- package/dist/{chunk-4TGZCYHH.js → chunk-Q3CVY7LV.js} +1954 -1642
- package/dist/chunk-Q3CVY7LV.js.map +1 -0
- package/dist/{chunk-PH3ZWL3W.js → chunk-Q53RLEW7.js} +2 -2
- package/dist/{chunk-Y6OWJ3V5.js → chunk-RY2XZTFN.js} +2 -2
- package/dist/{chunk-2SHIWGY7.js → chunk-RY7CHVGE.js} +2 -2
- package/dist/{chunk-7VUAG236.js → chunk-T3FVAHM7.js} +4 -4
- package/dist/{chunk-2LTDWSR6.js → chunk-TSH56VPU.js} +2 -2
- package/dist/{chunk-J6SLNQRO.js → chunk-UBWOCQ3I.js} +6 -2
- package/dist/chunk-UBWOCQ3I.js.map +1 -0
- package/dist/{chunk-5FHE4JI7.js → chunk-VEUVON5I.js} +2 -2
- package/dist/{chunk-KEWUNL7P.js → chunk-WET4M3R6.js} +2 -2
- package/dist/{chunk-SLPLPGJQ.js → chunk-WL2S2UBB.js} +5 -5
- package/dist/{chunk-AHZYNPLX.js → chunk-YVMVVE4B.js} +2 -2
- package/dist/{chunk-5HTAJCTO.js → chunk-ZB3YODID.js} +15 -15
- package/dist/{cli-mFX-QQvx.d.ts → cli-jkmzdT8P.d.ts} +3 -3
- package/dist/cli.d.ts +6 -6
- package/dist/cli.js +34 -33
- package/dist/compounding/engine.d.ts +1 -1
- package/dist/compounding/engine.js +10 -9
- package/dist/connectors/codex-materialize-runner.js +10 -9
- package/dist/connectors/index.js +10 -9
- package/dist/consolidation-provenance-check.d.ts +1 -1
- package/dist/consolidation-provenance-check.js +8 -2
- package/dist/consolidation-undo.d.ts +1 -1
- package/dist/consolidation-undo.js +10 -1
- package/dist/consolidation-undo.js.map +1 -1
- package/dist/contradiction/index.d.ts +1 -1
- package/dist/corpus-watermark.js +12 -11
- package/dist/entity-retrieval.d.ts +1 -1
- package/dist/entity-retrieval.js +10 -9
- package/dist/explicit-capture.d.ts +4 -4
- package/dist/explicit-capture.js +6 -3
- package/dist/extraction.js +10 -9
- package/dist/{forget-4UY2EOKH.js → forget-DNAJ66ZD.js} +2 -2
- package/dist/index.d.ts +10 -10
- package/dist/index.js +39 -38
- package/dist/maintenance/memory-governance.js +10 -9
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.d.ts +1 -1
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +10 -9
- package/dist/maintenance/rebuild-memory-projection.d.ts +1 -1
- package/dist/maintenance/rebuild-memory-projection.js +11 -10
- package/dist/{maintenance-70Wq118b.d.ts → maintenance-Ha9Dg93M.d.ts} +1 -1
- package/dist/mcp-memory-inspector-app.d.ts +5 -5
- package/dist/memory-worth-outcomes.d.ts +1 -1
- package/dist/namespaces/migrate.d.ts +1 -1
- package/dist/namespaces/migrate.js +11 -10
- package/dist/namespaces/storage.d.ts +1 -1
- package/dist/namespaces/storage.js +10 -9
- package/dist/offline-sync-impression-drain.js +3 -3
- package/dist/operator-doctor-corpus.js +13 -12
- package/dist/operator-toolkit.d.ts +1 -1
- package/dist/operator-toolkit.js +17 -16
- package/dist/orchestration/compression-guideline-coordinator.d.ts +1 -1
- package/dist/orchestration/maintenance.d.ts +2 -2
- package/dist/orchestration/maintenance.js +15 -14
- package/dist/{orchestrator-BH8LT-NX.d.ts → orchestrator-DV_u9bfx.d.ts} +3 -3
- package/dist/orchestrator.d.ts +4 -4
- package/dist/orchestrator.js +39 -38
- package/dist/page-versioning.js +7 -1
- package/dist/semantic-consolidation.js +11 -10
- package/dist/semantic-rule-promotion.js +10 -9
- package/dist/semantic-rule-verifier.js +10 -9
- package/dist/{service-CrxXHz5T.d.ts → service-JxXXY-Eh.d.ts} +1 -1
- package/dist/source-agent-qualifier.js +10 -9
- package/dist/{storage-CyWa1Jm6.d.ts → storage-BbH4HDUS.d.ts} +30 -26
- package/dist/storage.d.ts +1 -1
- package/dist/storage.js +9 -8
- package/dist/temporal-supersession.d.ts +1 -1
- package/dist/tier-migration.d.ts +1 -1
- package/dist/transfer/capsule-import.js +8 -2
- package/dist/verified-recall.js +10 -9
- package/package.json +2 -2
- package/src/binary-lifecycle/pipeline.ts +52 -1
- package/src/consolidation-undo.ts +4 -0
- package/src/curation/index.ts +41 -5
- package/src/lifecycle/tombstones.ts +40 -0
- package/src/maintenance/memory-governance.ts +4 -0
- package/src/page-versioning.ts +16 -1
- package/src/review/index.ts +97 -13
- package/src/spaces/index.ts +127 -6
- package/src/storage/citation-hash-source.ts +97 -0
- package/src/storage/entity-canonical-id-lock.ts +33 -0
- package/src/storage/entity-canonical-id-migration-adapter.ts +8 -4
- package/src/storage/entity-canonical-id-migration.ts +129 -77
- package/src/storage/entity-canonical-id-references.ts +557 -0
- package/src/storage/entity-ref-repair.ts +171 -0
- package/src/storage/entity-store.ts +163 -2
- package/src/storage/tombstone-blocked-capture-sync.ts +18 -0
- package/src/storage.ts +363 -396
- package/src/transfer/capsule-import.ts +91 -3
- package/src/transfer/capsule-merge.ts +128 -10
- package/dist/capsule-merge-2H2IUTBT.js.map +0 -1
- package/dist/chunk-4TGZCYHH.js.map +0 -1
- package/dist/chunk-65ZPVYTA.js.map +0 -1
- package/dist/chunk-6TAUHL33.js.map +0 -1
- package/dist/chunk-FBUE6PD3.js.map +0 -1
- package/dist/chunk-J6SLNQRO.js.map +0 -1
- /package/dist/{chunk-EO7X2LDK.js.map → chunk-4TAD3B56.js.map} +0 -0
- /package/dist/{chunk-QHYB4MJV.js.map → chunk-5ZGHUWTT.js.map} +0 -0
- /package/dist/{chunk-TCIWHK3N.js.map → chunk-6D5D5A4M.js.map} +0 -0
- /package/dist/{chunk-BIXWNHIL.js.map → chunk-6TF4M2LB.js.map} +0 -0
- /package/dist/{chunk-SA3WJJF2.js.map → chunk-BGLDKAYY.js.map} +0 -0
- /package/dist/{chunk-OPRP6Q4Z.js.map → chunk-DKKZ6SO2.js.map} +0 -0
- /package/dist/{chunk-AEPYA55F.js.map → chunk-FE7MUX7M.js.map} +0 -0
- /package/dist/{chunk-GHR7WHZX.js.map → chunk-GORHSN5C.js.map} +0 -0
- /package/dist/{chunk-7TEZUUGM.js.map → chunk-HUS2XN3T.js.map} +0 -0
- /package/dist/{chunk-XWDZQIYU.js.map → chunk-IJAQCBGV.js.map} +0 -0
- /package/dist/{chunk-TJLLYV2X.js.map → chunk-IMEXE4XS.js.map} +0 -0
- /package/dist/{chunk-IZXTZ7BF.js.map → chunk-JYLN6KHH.js.map} +0 -0
- /package/dist/{chunk-HEVWWPTL.js.map → chunk-LH3KXIBJ.js.map} +0 -0
- /package/dist/{chunk-EH5U2YCX.js.map → chunk-M3DBB2ND.js.map} +0 -0
- /package/dist/{chunk-XABS455Y.js.map → chunk-NBAEGFXT.js.map} +0 -0
- /package/dist/{chunk-T4HH5Q3U.js.map → chunk-OJRLTZQM.js.map} +0 -0
- /package/dist/{chunk-7ZHGPX56.js.map → chunk-PRP3M5Y3.js.map} +0 -0
- /package/dist/{chunk-Y2ZD2RVG.js.map → chunk-PYTUBWAS.js.map} +0 -0
- /package/dist/{chunk-PH3ZWL3W.js.map → chunk-Q53RLEW7.js.map} +0 -0
- /package/dist/{chunk-Y6OWJ3V5.js.map → chunk-RY2XZTFN.js.map} +0 -0
- /package/dist/{chunk-2SHIWGY7.js.map → chunk-RY7CHVGE.js.map} +0 -0
- /package/dist/{chunk-7VUAG236.js.map → chunk-T3FVAHM7.js.map} +0 -0
- /package/dist/{chunk-2LTDWSR6.js.map → chunk-TSH56VPU.js.map} +0 -0
- /package/dist/{chunk-5FHE4JI7.js.map → chunk-VEUVON5I.js.map} +0 -0
- /package/dist/{chunk-KEWUNL7P.js.map → chunk-WET4M3R6.js.map} +0 -0
- /package/dist/{chunk-SLPLPGJQ.js.map → chunk-WL2S2UBB.js.map} +0 -0
- /package/dist/{chunk-AHZYNPLX.js.map → chunk-YVMVVE4B.js.map} +0 -0
- /package/dist/{chunk-5HTAJCTO.js.map → chunk-ZB3YODID.js.map} +0 -0
- /package/dist/{forget-4UY2EOKH.js.map → forget-DNAJ66ZD.js.map} +0 -0
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
import {
|
|
17
17
|
ActivityStore,
|
|
18
18
|
MaintenanceScheduler
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-JYLN6KHH.js";
|
|
20
20
|
import {
|
|
21
21
|
migrateFromEngram
|
|
22
22
|
} from "./chunk-7HYPN2GC.js";
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
import {
|
|
33
33
|
CompoundingEngine,
|
|
34
34
|
defaultTierMigrationCycleBudget
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-IJAQCBGV.js";
|
|
36
36
|
import {
|
|
37
37
|
SharedContextManager
|
|
38
38
|
} from "./chunk-AS7YMSL6.js";
|
|
@@ -198,7 +198,7 @@ import {
|
|
|
198
198
|
buildEntityRecallSection,
|
|
199
199
|
entityRecentTranscriptLookbackHours,
|
|
200
200
|
readRecentEntityTranscriptEntries
|
|
201
|
-
} from "./chunk-
|
|
201
|
+
} from "./chunk-RY2XZTFN.js";
|
|
202
202
|
import {
|
|
203
203
|
buildEventOrderRecallSection,
|
|
204
204
|
shouldRecallEventOrderEvidence
|
|
@@ -214,7 +214,7 @@ import {
|
|
|
214
214
|
ensureBuiltInWearableConnectors,
|
|
215
215
|
getWearableConnector,
|
|
216
216
|
listWearableConnectors
|
|
217
|
-
} from "./chunk-
|
|
217
|
+
} from "./chunk-LH3KXIBJ.js";
|
|
218
218
|
import {
|
|
219
219
|
normalizeReplaySessionKey
|
|
220
220
|
} from "./chunk-AJVLDJU6.js";
|
|
@@ -224,14 +224,14 @@ import {
|
|
|
224
224
|
import {
|
|
225
225
|
compareVerifiedEpisodeResults,
|
|
226
226
|
searchVerifiedEpisodes
|
|
227
|
-
} from "./chunk-
|
|
227
|
+
} from "./chunk-4TAD3B56.js";
|
|
228
228
|
import {
|
|
229
229
|
ThreadingManager
|
|
230
230
|
} from "./chunk-OJP3N7UK.js";
|
|
231
231
|
import {
|
|
232
232
|
compareVerifiedSemanticRuleResults,
|
|
233
233
|
searchVerifiedSemanticRules
|
|
234
|
-
} from "./chunk-
|
|
234
|
+
} from "./chunk-PRP3M5Y3.js";
|
|
235
235
|
import {
|
|
236
236
|
searchWorkProductLedgerEntries
|
|
237
237
|
} from "./chunk-ZRWB5D4H.js";
|
|
@@ -244,11 +244,11 @@ import {
|
|
|
244
244
|
import {
|
|
245
245
|
runNamespaceMaintenanceFanout,
|
|
246
246
|
summarizeNamespaceMaintenanceHealth
|
|
247
|
-
} from "./chunk-
|
|
247
|
+
} from "./chunk-IMEXE4XS.js";
|
|
248
248
|
import {
|
|
249
249
|
NamespaceCatalog,
|
|
250
250
|
planNamespaceMaintenance
|
|
251
|
-
} from "./chunk-
|
|
251
|
+
} from "./chunk-6D5D5A4M.js";
|
|
252
252
|
import {
|
|
253
253
|
isAboveImportanceThreshold,
|
|
254
254
|
scoreImportance
|
|
@@ -283,7 +283,7 @@ import {
|
|
|
283
283
|
materializeAfterSemanticConsolidation,
|
|
284
284
|
parseConsolidationResponse,
|
|
285
285
|
parseOperatorAwareConsolidationResponse
|
|
286
|
-
} from "./chunk-
|
|
286
|
+
} from "./chunk-FE7MUX7M.js";
|
|
287
287
|
import {
|
|
288
288
|
buildBehaviorSignalsForMemory,
|
|
289
289
|
dedupeBehaviorSignalsByMemoryAndHash
|
|
@@ -322,7 +322,7 @@ import {
|
|
|
322
322
|
} from "./chunk-LBJBNWS2.js";
|
|
323
323
|
import {
|
|
324
324
|
MeetingsInputError
|
|
325
|
-
} from "./chunk-
|
|
325
|
+
} from "./chunk-WL2S2UBB.js";
|
|
326
326
|
import {
|
|
327
327
|
WearablesInputError,
|
|
328
328
|
describeErrorForOperator
|
|
@@ -340,10 +340,10 @@ import {
|
|
|
340
340
|
capturePassiveCorrections,
|
|
341
341
|
clusterByKey,
|
|
342
342
|
detectPassiveCorrections
|
|
343
|
-
} from "./chunk-
|
|
343
|
+
} from "./chunk-ZB3YODID.js";
|
|
344
344
|
import {
|
|
345
345
|
importCapsule
|
|
346
|
-
} from "./chunk-
|
|
346
|
+
} from "./chunk-3CE77VAP.js";
|
|
347
347
|
import {
|
|
348
348
|
isCodingGraphInstalled
|
|
349
349
|
} from "./chunk-VQ7B2Q6M.js";
|
|
@@ -385,7 +385,7 @@ import {
|
|
|
385
385
|
} from "./chunk-QDW3E4RD.js";
|
|
386
386
|
import {
|
|
387
387
|
shouldSkipImplicitExtraction
|
|
388
|
-
} from "./chunk-
|
|
388
|
+
} from "./chunk-Q53RLEW7.js";
|
|
389
389
|
import {
|
|
390
390
|
NamespaceSearchRouter,
|
|
391
391
|
namespaceCollectionName
|
|
@@ -399,7 +399,7 @@ import {
|
|
|
399
399
|
} from "./chunk-CYEPCZN5.js";
|
|
400
400
|
import {
|
|
401
401
|
NamespaceStorageRouter
|
|
402
|
-
} from "./chunk-
|
|
402
|
+
} from "./chunk-PYTUBWAS.js";
|
|
403
403
|
import {
|
|
404
404
|
writeConversationChunks
|
|
405
405
|
} from "./chunk-72A4L5JJ.js";
|
|
@@ -462,7 +462,7 @@ import {
|
|
|
462
462
|
} from "./chunk-NRV4Y3PM.js";
|
|
463
463
|
import {
|
|
464
464
|
buildChainFollowupGenerator
|
|
465
|
-
} from "./chunk-
|
|
465
|
+
} from "./chunk-6TF4M2LB.js";
|
|
466
466
|
import {
|
|
467
467
|
QmdResultResolver,
|
|
468
468
|
StorageManager,
|
|
@@ -481,7 +481,7 @@ import {
|
|
|
481
481
|
reconstructFusionInputs,
|
|
482
482
|
selfDeps,
|
|
483
483
|
serializeFusionDay
|
|
484
|
-
} from "./chunk-
|
|
484
|
+
} from "./chunk-Q3CVY7LV.js";
|
|
485
485
|
import {
|
|
486
486
|
bodyIsEscaped,
|
|
487
487
|
decodeTranscriptBody,
|
|
@@ -494,17 +494,7 @@ import {
|
|
|
494
494
|
} from "./chunk-UHVXE24Y.js";
|
|
495
495
|
import {
|
|
496
496
|
buildRetiredFactTombstoneInputs
|
|
497
|
-
} from "./chunk-
|
|
498
|
-
import {
|
|
499
|
-
applyTemporalSupersession,
|
|
500
|
-
normalizeSupersessionKey,
|
|
501
|
-
shouldFilterSupersededFromRecall,
|
|
502
|
-
supersessionKeysForFact
|
|
503
|
-
} from "./chunk-DNHVPZOD.js";
|
|
504
|
-
import {
|
|
505
|
-
isValidAsOf,
|
|
506
|
-
isValidityExpiredNow
|
|
507
|
-
} from "./chunk-6CIAGZ6X.js";
|
|
497
|
+
} from "./chunk-ENTCVTQR.js";
|
|
508
498
|
import {
|
|
509
499
|
attachCitation,
|
|
510
500
|
hasCitationForTemplate,
|
|
@@ -531,7 +521,7 @@ import {
|
|
|
531
521
|
} from "./chunk-DM2T26WE.js";
|
|
532
522
|
import {
|
|
533
523
|
ContentHashIndex
|
|
534
|
-
} from "./chunk-
|
|
524
|
+
} from "./chunk-BEQOZOYZ.js";
|
|
535
525
|
import {
|
|
536
526
|
TAG_LIMITS,
|
|
537
527
|
composeMemoryEnvelope,
|
|
@@ -552,6 +542,26 @@ import {
|
|
|
552
542
|
import {
|
|
553
543
|
bumpMemoryCorpusVersionForDir
|
|
554
544
|
} from "./chunk-IJ7HK452.js";
|
|
545
|
+
import {
|
|
546
|
+
HistoricalEntityCanonicalIdCache,
|
|
547
|
+
canonicalizeEntityRefFrontmatter,
|
|
548
|
+
classifyEntityRefWritePath,
|
|
549
|
+
readEntityRefFromFrontmatter,
|
|
550
|
+
repairContentAfterJournalMove,
|
|
551
|
+
repairContentAfterJournalMoveSync,
|
|
552
|
+
requestEntityCanonicalIdReconcile,
|
|
553
|
+
requestEntityCanonicalIdReconcileSync
|
|
554
|
+
} from "./chunk-4J7G5SY4.js";
|
|
555
|
+
import {
|
|
556
|
+
applyTemporalSupersession,
|
|
557
|
+
normalizeSupersessionKey,
|
|
558
|
+
shouldFilterSupersededFromRecall,
|
|
559
|
+
supersessionKeysForFact
|
|
560
|
+
} from "./chunk-DNHVPZOD.js";
|
|
561
|
+
import {
|
|
562
|
+
isValidAsOf,
|
|
563
|
+
isValidityExpiredNow
|
|
564
|
+
} from "./chunk-6CIAGZ6X.js";
|
|
555
565
|
import {
|
|
556
566
|
buildQmdRecallCacheKey,
|
|
557
567
|
getCachedQmdRecall,
|
|
@@ -19092,6 +19102,7 @@ function emptyManifest() {
|
|
|
19092
19102
|
import fsp4 from "fs/promises";
|
|
19093
19103
|
import path20 from "path";
|
|
19094
19104
|
import crypto3 from "crypto";
|
|
19105
|
+
var historicalIdCache = new HistoricalEntityCanonicalIdCache();
|
|
19095
19106
|
function isRecallCorpusMarkdown(mdPath, memoryDir) {
|
|
19096
19107
|
const rel = path20.relative(memoryDir, mdPath);
|
|
19097
19108
|
if (rel.startsWith("..") || path20.isAbsolute(rel)) return false;
|
|
@@ -19290,7 +19301,34 @@ async function stageRedirect(memoryDir, assets, log2, dryRun, readMarkdownFile,
|
|
|
19290
19301
|
let writeFailCount = 0;
|
|
19291
19302
|
for (const update of updates) {
|
|
19292
19303
|
try {
|
|
19293
|
-
|
|
19304
|
+
const stateDir = path20.join(memoryDir, "state");
|
|
19305
|
+
const kind = classifyEntityRefWritePath(memoryDir, update.mdPath);
|
|
19306
|
+
if (kind === "memory") {
|
|
19307
|
+
const idsAtWrite = historicalIdCache.get(stateDir);
|
|
19308
|
+
const written = canonicalizeEntityRefFrontmatter(update.content, idsAtWrite);
|
|
19309
|
+
const originalBytes = await readMarkdownFile(update.mdPath).catch(() => null);
|
|
19310
|
+
await writeMarkdownFile(update.mdPath, written);
|
|
19311
|
+
try {
|
|
19312
|
+
await repairContentAfterJournalMove({
|
|
19313
|
+
stateDir,
|
|
19314
|
+
cache: historicalIdCache,
|
|
19315
|
+
idsAtWrite,
|
|
19316
|
+
rawContent: update.content,
|
|
19317
|
+
lastWritten: written,
|
|
19318
|
+
rewrite: (next) => writeMarkdownFile(update.mdPath, next)
|
|
19319
|
+
});
|
|
19320
|
+
} catch (err) {
|
|
19321
|
+
if (originalBytes !== null) {
|
|
19322
|
+
await writeMarkdownFile(update.mdPath, originalBytes).catch(() => void 0);
|
|
19323
|
+
}
|
|
19324
|
+
throw err;
|
|
19325
|
+
}
|
|
19326
|
+
} else {
|
|
19327
|
+
await writeMarkdownFile(update.mdPath, update.content);
|
|
19328
|
+
if (kind === "entity") {
|
|
19329
|
+
await requestEntityCanonicalIdReconcile(stateDir);
|
|
19330
|
+
}
|
|
19331
|
+
}
|
|
19294
19332
|
if (isRecallCorpusMarkdown(update.mdPath, memoryDir)) {
|
|
19295
19333
|
bumpMemoryCorpusVersionForDir(memoryDir);
|
|
19296
19334
|
}
|
|
@@ -20512,6 +20550,7 @@ function loadExistingMemories(memoryDir) {
|
|
|
20512
20550
|
}
|
|
20513
20551
|
return result;
|
|
20514
20552
|
}
|
|
20553
|
+
var historicalIdCache2 = new HistoricalEntityCanonicalIdCache();
|
|
20515
20554
|
function writeStatement(stmt, memoryDir) {
|
|
20516
20555
|
const now = /* @__PURE__ */ new Date();
|
|
20517
20556
|
const dateDir = now.toISOString().split("T")[0];
|
|
@@ -20520,7 +20559,8 @@ function writeStatement(stmt, memoryDir) {
|
|
|
20520
20559
|
fs3.mkdirSync(dir, { recursive: true });
|
|
20521
20560
|
const fileName = `${stmt.category}-${Date.now()}-${stmt.id.slice(0, 8)}.md`;
|
|
20522
20561
|
const filePath = path23.join(dir, fileName);
|
|
20523
|
-
const
|
|
20562
|
+
const historicalIds = historicalIdCache2.get(path23.join(memoryDir, "state"));
|
|
20563
|
+
const rawBody = `${[
|
|
20524
20564
|
"---",
|
|
20525
20565
|
`id: ${stmt.id}`,
|
|
20526
20566
|
`category: ${stmt.category}`,
|
|
@@ -20534,12 +20574,28 @@ function writeStatement(stmt, memoryDir) {
|
|
|
20534
20574
|
`provenanceFile: ${stmt.provenance.relativePath}`,
|
|
20535
20575
|
`provenanceHash: ${stmt.provenance.sourceFileHash}`,
|
|
20536
20576
|
"---"
|
|
20537
|
-
].filter(Boolean).join("\n")
|
|
20538
|
-
const body = `${frontmatter}
|
|
20577
|
+
].filter(Boolean).join("\n")}
|
|
20539
20578
|
|
|
20540
20579
|
${stmt.content}
|
|
20541
20580
|
`;
|
|
20581
|
+
const body = canonicalizeEntityRefFrontmatter(rawBody, historicalIds);
|
|
20542
20582
|
fs3.writeFileSync(filePath, body);
|
|
20583
|
+
try {
|
|
20584
|
+
repairContentAfterJournalMoveSync({
|
|
20585
|
+
stateDir: path23.join(memoryDir, "state"),
|
|
20586
|
+
cache: historicalIdCache2,
|
|
20587
|
+
idsAtWrite: historicalIds,
|
|
20588
|
+
rawContent: rawBody,
|
|
20589
|
+
lastWritten: body,
|
|
20590
|
+
rewrite: (next) => fs3.writeFileSync(filePath, next)
|
|
20591
|
+
});
|
|
20592
|
+
} catch (err) {
|
|
20593
|
+
try {
|
|
20594
|
+
fs3.unlinkSync(filePath);
|
|
20595
|
+
} catch {
|
|
20596
|
+
}
|
|
20597
|
+
throw err;
|
|
20598
|
+
}
|
|
20543
20599
|
bumpMemoryCorpusVersionForDir(memoryDir);
|
|
20544
20600
|
return filePath;
|
|
20545
20601
|
}
|
|
@@ -20828,6 +20884,39 @@ function walkMdFiles(dir, memoryRootReal, categoryRootReal, callback) {
|
|
|
20828
20884
|
// src/review/index.ts
|
|
20829
20885
|
import fs5 from "fs";
|
|
20830
20886
|
import path25 from "path";
|
|
20887
|
+
var historicalIdCache3 = new HistoricalEntityCanonicalIdCache();
|
|
20888
|
+
function writeReviewFileCanonicalized(memoryDir, filePath, content) {
|
|
20889
|
+
const stateDir = path25.join(memoryDir, "state");
|
|
20890
|
+
const idsAtWrite = historicalIdCache3.get(stateDir);
|
|
20891
|
+
let originalBytes = null;
|
|
20892
|
+
try {
|
|
20893
|
+
originalBytes = fs5.readFileSync(filePath, "utf8");
|
|
20894
|
+
} catch {
|
|
20895
|
+
originalBytes = null;
|
|
20896
|
+
}
|
|
20897
|
+
const written = canonicalizeEntityRefFrontmatter(content, idsAtWrite);
|
|
20898
|
+
fs5.writeFileSync(filePath, written, "utf8");
|
|
20899
|
+
try {
|
|
20900
|
+
repairContentAfterJournalMoveSync({
|
|
20901
|
+
stateDir,
|
|
20902
|
+
cache: historicalIdCache3,
|
|
20903
|
+
idsAtWrite,
|
|
20904
|
+
rawContent: content,
|
|
20905
|
+
lastWritten: written,
|
|
20906
|
+
rewrite: (next) => fs5.writeFileSync(filePath, next, "utf8")
|
|
20907
|
+
});
|
|
20908
|
+
} catch (err) {
|
|
20909
|
+
try {
|
|
20910
|
+
if (originalBytes === null) {
|
|
20911
|
+
fs5.unlinkSync(filePath);
|
|
20912
|
+
} else {
|
|
20913
|
+
fs5.writeFileSync(filePath, originalBytes, "utf8");
|
|
20914
|
+
}
|
|
20915
|
+
} catch {
|
|
20916
|
+
}
|
|
20917
|
+
throw err;
|
|
20918
|
+
}
|
|
20919
|
+
}
|
|
20831
20920
|
var DEFAULT_CONFIDENCE_THRESHOLD = 0.7;
|
|
20832
20921
|
function realMemoryRoot(memoryDir) {
|
|
20833
20922
|
try {
|
|
@@ -20976,7 +21065,8 @@ function approveItem(memoryDir, itemId, options) {
|
|
|
20976
21065
|
const fm = parseFrontmatter4(content);
|
|
20977
21066
|
if (!fm) return { itemId, action: "approve", message: "Could not parse frontmatter" };
|
|
20978
21067
|
const blockedBy = typeof fm.blockedBy === "string" ? fm.blockedBy : null;
|
|
20979
|
-
|
|
21068
|
+
const fireBlockedRevocation = () => {
|
|
21069
|
+
if (!blockedBy || !options.onApproveBlockedMemory) return;
|
|
20980
21070
|
try {
|
|
20981
21071
|
const maybe = options.onApproveBlockedMemory(blockedBy, itemId);
|
|
20982
21072
|
if (maybe && typeof maybe.then === "function") {
|
|
@@ -20984,7 +21074,7 @@ function approveItem(memoryDir, itemId, options) {
|
|
|
20984
21074
|
}
|
|
20985
21075
|
} catch {
|
|
20986
21076
|
}
|
|
20987
|
-
}
|
|
21077
|
+
};
|
|
20988
21078
|
const updatedContent = updateFrontmatterFields(content, {
|
|
20989
21079
|
confidence: "0.9",
|
|
20990
21080
|
confidenceTier: "high",
|
|
@@ -20996,7 +21086,8 @@ function approveItem(memoryDir, itemId, options) {
|
|
|
20996
21086
|
...blockedBy ? { blockedBy: null, tombstoneBlockTier: null, status: "active" } : {}
|
|
20997
21087
|
});
|
|
20998
21088
|
if (found.location === "category") {
|
|
20999
|
-
|
|
21089
|
+
writeReviewFileCanonicalized(memoryDir, found.filePath, updatedContent);
|
|
21090
|
+
fireBlockedRevocation();
|
|
21000
21091
|
return {
|
|
21001
21092
|
itemId,
|
|
21002
21093
|
action: "approve",
|
|
@@ -21011,8 +21102,28 @@ function approveItem(memoryDir, itemId, options) {
|
|
|
21011
21102
|
ensureSafeDirectory(rootReal, targetDir);
|
|
21012
21103
|
const outputPath = path25.join(targetDir, dateDir, path25.basename(found.filePath));
|
|
21013
21104
|
ensureSafeDirectory(rootReal, path25.dirname(outputPath));
|
|
21014
|
-
const
|
|
21105
|
+
const reviewStateDir = path25.join(memoryDir, "state");
|
|
21106
|
+
const idsAtWrite = historicalIdCache3.get(reviewStateDir);
|
|
21107
|
+
const promotedWritten = canonicalizeEntityRefFrontmatter(updatedContent, idsAtWrite);
|
|
21108
|
+
const promotedPath = writeFileWithoutClobber(outputPath, promotedWritten, itemId);
|
|
21109
|
+
try {
|
|
21110
|
+
repairContentAfterJournalMoveSync({
|
|
21111
|
+
stateDir: reviewStateDir,
|
|
21112
|
+
cache: historicalIdCache3,
|
|
21113
|
+
idsAtWrite,
|
|
21114
|
+
rawContent: updatedContent,
|
|
21115
|
+
lastWritten: promotedWritten,
|
|
21116
|
+
rewrite: (next) => fs5.writeFileSync(promotedPath, next, "utf8")
|
|
21117
|
+
});
|
|
21118
|
+
} catch (err) {
|
|
21119
|
+
try {
|
|
21120
|
+
fs5.unlinkSync(promotedPath);
|
|
21121
|
+
} catch {
|
|
21122
|
+
}
|
|
21123
|
+
throw err;
|
|
21124
|
+
}
|
|
21015
21125
|
fs5.unlinkSync(found.filePath);
|
|
21126
|
+
fireBlockedRevocation();
|
|
21016
21127
|
return {
|
|
21017
21128
|
itemId,
|
|
21018
21129
|
action: "approve",
|
|
@@ -21031,13 +21142,13 @@ function dismissItem(memoryDir, itemId, options) {
|
|
|
21031
21142
|
return { itemId, action: "dismiss", message: "Dismissed and removed" };
|
|
21032
21143
|
}
|
|
21033
21144
|
const content = fs5.readFileSync(found.filePath, "utf8");
|
|
21034
|
-
|
|
21145
|
+
writeReviewFileCanonicalized(
|
|
21146
|
+
memoryDir,
|
|
21035
21147
|
found.filePath,
|
|
21036
21148
|
updateFrontmatterFields(content, {
|
|
21037
21149
|
reviewDismissed: "true",
|
|
21038
21150
|
reviewDismissedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
21039
|
-
})
|
|
21040
|
-
"utf8"
|
|
21151
|
+
})
|
|
21041
21152
|
);
|
|
21042
21153
|
return {
|
|
21043
21154
|
itemId,
|
|
@@ -21056,7 +21167,7 @@ function flagItem(memoryDir, itemId, options) {
|
|
|
21056
21167
|
flagged: "true",
|
|
21057
21168
|
flaggedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
21058
21169
|
});
|
|
21059
|
-
|
|
21170
|
+
writeReviewFileCanonicalized(memoryDir, found.filePath, fixed);
|
|
21060
21171
|
return {
|
|
21061
21172
|
itemId,
|
|
21062
21173
|
action: "flag",
|
|
@@ -21426,6 +21537,7 @@ import { spawnSync } from "child_process";
|
|
|
21426
21537
|
import crypto7 from "crypto";
|
|
21427
21538
|
import fs7 from "fs";
|
|
21428
21539
|
import path27 from "path";
|
|
21540
|
+
var historicalIdCache4 = new HistoricalEntityCanonicalIdCache();
|
|
21429
21541
|
var MANIFEST_VERSION = 1;
|
|
21430
21542
|
var MANIFEST_LOCK_STALE_MS = 3e4;
|
|
21431
21543
|
var MANIFEST_LOCK_TIMEOUT_MS = MANIFEST_LOCK_STALE_MS + 1e4;
|
|
@@ -21999,6 +22111,17 @@ function copyMemories(sourceDir, targetDir, options) {
|
|
|
21999
22111
|
fs7.mkdirSync(targetDir, { recursive: true });
|
|
22000
22112
|
const targetRoot = fs7.realpathSync(targetDir);
|
|
22001
22113
|
const sourceFiles = walkMd2(sourceRoot);
|
|
22114
|
+
const sourceEntityIds = new Set(
|
|
22115
|
+
sourceFiles.filter((p) => {
|
|
22116
|
+
const rp = safeRealpath(p);
|
|
22117
|
+
if (!rp || !isPathInsideRoot(rp, sourceRoot)) return false;
|
|
22118
|
+
const rel = path27.relative(sourceRoot, rp);
|
|
22119
|
+
const mapped = path27.resolve(targetRoot, rel);
|
|
22120
|
+
if (!isPathInsideRoot(mapped, targetRoot)) return false;
|
|
22121
|
+
return classifyEntityRefWritePath(targetRoot, mapped) === "entity";
|
|
22122
|
+
}).map((p) => path27.basename(p, ".md"))
|
|
22123
|
+
);
|
|
22124
|
+
let reconcileNeeded = false;
|
|
22002
22125
|
for (const sourcePath of sourceFiles) {
|
|
22003
22126
|
const sourceRealPath = safeRealpath(sourcePath);
|
|
22004
22127
|
if (!sourceRealPath || !isPathInsideRoot(sourceRealPath, sourceRoot)) {
|
|
@@ -22017,6 +22140,11 @@ function copyMemories(sourceDir, targetDir, options) {
|
|
|
22017
22140
|
skipped++;
|
|
22018
22141
|
continue;
|
|
22019
22142
|
}
|
|
22143
|
+
const targetKind = classifyEntityRefWritePath(targetRoot, targetPath);
|
|
22144
|
+
const idsAtCompare = historicalIdCache4.get(path27.join(targetRoot, "state"));
|
|
22145
|
+
const sourceRef = targetKind === "memory" ? readEntityRefFromFrontmatter(content) : null;
|
|
22146
|
+
const refHasSourceClaimant = sourceRef !== null && sourceEntityIds.has(sourceRef);
|
|
22147
|
+
const canonicalContent = targetKind === "memory" && !refHasSourceClaimant ? canonicalizeEntityRefFrontmatter(content, idsAtCompare) : content;
|
|
22020
22148
|
const sourceHash = hashContent4(content);
|
|
22021
22149
|
if (options?.filterIds?.length) {
|
|
22022
22150
|
const fm = parseSimpleFrontmatter(content);
|
|
@@ -22040,7 +22168,11 @@ function copyMemories(sourceDir, targetDir, options) {
|
|
|
22040
22168
|
if (fs7.existsSync(targetPath) && !options?.force) {
|
|
22041
22169
|
const targetContent = fs7.readFileSync(targetPath, "utf8");
|
|
22042
22170
|
const targetHash = hashContent4(targetContent);
|
|
22043
|
-
if (
|
|
22171
|
+
if (hashContent4(canonicalContent) === targetHash && historicalIdCache4.get(path27.join(targetRoot, "state")) === idsAtCompare) {
|
|
22172
|
+
skipped++;
|
|
22173
|
+
continue;
|
|
22174
|
+
}
|
|
22175
|
+
if (hashContent4(canonicalContent) !== targetHash && sourceHash !== targetHash) {
|
|
22044
22176
|
conflicts.push({
|
|
22045
22177
|
memoryId: parseSimpleFrontmatter(content)?.id ?? relativePath,
|
|
22046
22178
|
sourcePath,
|
|
@@ -22051,8 +22183,6 @@ function copyMemories(sourceDir, targetDir, options) {
|
|
|
22051
22183
|
});
|
|
22052
22184
|
continue;
|
|
22053
22185
|
}
|
|
22054
|
-
skipped++;
|
|
22055
|
-
continue;
|
|
22056
22186
|
}
|
|
22057
22187
|
fs7.mkdirSync(path27.dirname(targetPath), { recursive: true });
|
|
22058
22188
|
const targetParentRealPath = safeRealpath(path27.dirname(targetPath));
|
|
@@ -22060,10 +22190,52 @@ function copyMemories(sourceDir, targetDir, options) {
|
|
|
22060
22190
|
skipped++;
|
|
22061
22191
|
continue;
|
|
22062
22192
|
}
|
|
22063
|
-
|
|
22193
|
+
const stateDir = path27.join(targetRoot, "state");
|
|
22194
|
+
if (targetKind === "memory" && !refHasSourceClaimant) {
|
|
22195
|
+
const idsAtWrite = historicalIdCache4.get(stateDir);
|
|
22196
|
+
const written = canonicalizeEntityRefFrontmatter(content, idsAtWrite);
|
|
22197
|
+
let priorTarget = null;
|
|
22198
|
+
try {
|
|
22199
|
+
priorTarget = fs7.readFileSync(targetPath, "utf8");
|
|
22200
|
+
} catch {
|
|
22201
|
+
priorTarget = null;
|
|
22202
|
+
}
|
|
22203
|
+
fs7.writeFileSync(targetPath, written);
|
|
22204
|
+
try {
|
|
22205
|
+
repairContentAfterJournalMoveSync({
|
|
22206
|
+
stateDir,
|
|
22207
|
+
cache: historicalIdCache4,
|
|
22208
|
+
idsAtWrite,
|
|
22209
|
+
rawContent: content,
|
|
22210
|
+
lastWritten: written,
|
|
22211
|
+
rewrite: (next) => fs7.writeFileSync(targetPath, next)
|
|
22212
|
+
});
|
|
22213
|
+
} catch (err) {
|
|
22214
|
+
try {
|
|
22215
|
+
if (priorTarget === null) {
|
|
22216
|
+
fs7.unlinkSync(targetPath);
|
|
22217
|
+
} else {
|
|
22218
|
+
fs7.writeFileSync(targetPath, priorTarget);
|
|
22219
|
+
}
|
|
22220
|
+
} catch {
|
|
22221
|
+
}
|
|
22222
|
+
throw err;
|
|
22223
|
+
}
|
|
22224
|
+
} else if (targetKind === "memory") {
|
|
22225
|
+
fs7.writeFileSync(targetPath, content);
|
|
22226
|
+
reconcileNeeded = true;
|
|
22227
|
+
} else {
|
|
22228
|
+
fs7.writeFileSync(targetPath, content);
|
|
22229
|
+
if (targetKind === "entity") {
|
|
22230
|
+
reconcileNeeded = true;
|
|
22231
|
+
}
|
|
22232
|
+
}
|
|
22064
22233
|
merged++;
|
|
22065
22234
|
bumpMemoryCorpusVersionForDir(targetRoot);
|
|
22066
22235
|
}
|
|
22236
|
+
if (reconcileNeeded) {
|
|
22237
|
+
requestEntityCanonicalIdReconcileSync(path27.join(targetRoot, "state"));
|
|
22238
|
+
}
|
|
22067
22239
|
return { merged, conflicts, skipped };
|
|
22068
22240
|
}
|
|
22069
22241
|
function hashContent4(content) {
|
|
@@ -23751,4 +23923,4 @@ export {
|
|
|
23751
23923
|
filterRecallCandidates,
|
|
23752
23924
|
Orchestrator
|
|
23753
23925
|
};
|
|
23754
|
-
//# sourceMappingURL=chunk-
|
|
23926
|
+
//# sourceMappingURL=chunk-AKELMJO2.js.map
|