@remnic/core 9.26.0 → 9.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/access-admin-ops-surface.d.ts +13 -10
- package/dist/access-admin-ops-surface.js +43 -38
- package/dist/access-audit.js +2 -2
- package/dist/access-authorization-probe.d.ts +13 -10
- package/dist/access-authorization-probe.js +44 -39
- package/dist/access-boundary.d.ts +13 -10
- package/dist/access-boundary.js +43 -38
- package/dist/access-cli.js +100 -94
- package/dist/access-cli.js.map +1 -1
- package/dist/access-health-types.d.ts +10 -1
- package/dist/access-http-lcm-compaction.d.ts +13 -10
- package/dist/access-http.d.ts +13 -10
- package/dist/access-http.js +53 -48
- package/dist/access-identity-continuity-surface.d.ts +9 -8
- package/dist/access-identity-continuity-surface.js +43 -38
- package/dist/access-lcm-surface.d.ts +13 -10
- package/dist/access-lcm-surface.js +43 -38
- package/dist/access-mcp.d.ts +13 -10
- package/dist/access-mcp.js +48 -43
- package/dist/access-memory-search-fanout.d.ts +2 -2
- package/dist/{access-namespace-preflight-wRSZEO5V.d.ts → access-namespace-preflight-BiQ_-iUJ.d.ts} +1 -1
- package/dist/access-namespace-preflight.d.ts +3 -3
- package/dist/access-namespace-preflight.js +43 -38
- package/dist/access-observe-write-surface.d.ts +13 -10
- package/dist/access-observe-write-surface.js +43 -38
- package/dist/access-operations-batch.js +45 -40
- package/dist/access-operations.d.ts +16 -13
- package/dist/access-operations.js +47 -42
- package/dist/access-recall-concurrency.d.ts +13 -10
- package/dist/access-recall-concurrency.js +43 -38
- package/dist/access-recall-response.d.ts +13 -10
- package/dist/access-recall-response.js +43 -38
- package/dist/access-recall-surface.d.ts +13 -10
- package/dist/access-recall-surface.js +43 -38
- package/dist/access-schema.d.ts +80 -80
- package/dist/access-schema.js +4 -4
- package/dist/{access-service-DL8FJnTj.d.ts → access-service-CXkIgcGh.d.ts} +12 -8
- package/dist/access-service.d.ts +13 -10
- package/dist/access-service.js +43 -38
- package/dist/access-surface-catalog.d.ts +13 -10
- package/dist/access-wearables-meetings-surface.d.ts +4 -3
- package/dist/action-confidence.d.ts +1 -1
- package/dist/active-memory-bridge.d.ts +1 -1
- package/dist/active-recall.d.ts +1 -1
- package/dist/active-recall.js +4 -2
- package/dist/active-recall.js.map +1 -1
- package/dist/adapters/index.js +7 -7
- package/dist/adapters/registry.js +3 -3
- package/dist/behavior-learner.d.ts +1 -1
- package/dist/behavior-signals.d.ts +1 -1
- package/dist/bootstrap.d.ts +9 -8
- package/dist/briefing.d.ts +3 -2
- package/dist/briefing.js +12 -10
- package/dist/buffer-surprise-report.d.ts +1 -1
- package/dist/buffer.d.ts +3 -2
- package/dist/bulk-import/index.d.ts +3 -3
- package/dist/calibration.d.ts +1 -1
- package/dist/capabilities.d.ts +1 -1
- package/dist/{capsule-crypto-YO5QJ6L3.js → capsule-crypto-7FJQINUR.js} +2 -2
- package/dist/{catalog-BLLxZ5L5.d.ts → catalog-Bouj8Gfg.d.ts} +1 -1
- package/dist/causal-behavior.d.ts +1 -1
- package/dist/causal-consolidation.d.ts +1 -1
- package/dist/causal-consolidation.js +13 -11
- package/dist/causal-consolidation.js.map +1 -1
- package/dist/causal-trajectory-graph.d.ts +1 -1
- package/dist/{chunk-7RZJWZ46.js → chunk-227UFSEQ.js} +5 -5
- package/dist/{chunk-VGEH3STZ.js → chunk-2BEJ4XCF.js} +2 -2
- package/dist/{chunk-LIIQPDFN.js → chunk-2FYNLDKJ.js} +24 -3
- package/dist/chunk-2FYNLDKJ.js.map +1 -0
- package/dist/{chunk-BXLOS5AJ.js → chunk-2NLLXCJG.js} +2 -2
- package/dist/{chunk-6NNNURLK.js → chunk-2PHX3I5C.js} +8 -8
- package/dist/{chunk-YN4AUGNF.js → chunk-2TQ2UFKH.js} +65 -60
- package/dist/chunk-2TQ2UFKH.js.map +1 -0
- package/dist/{chunk-XAAIUXJO.js → chunk-3BSJBIZ3.js} +2 -2
- package/dist/{chunk-JCVQV6QX.js → chunk-3UOSVTFR.js} +11 -11
- package/dist/{chunk-AJ7QCSIS.js → chunk-7CPOZH6Y.js} +2 -2
- package/dist/{chunk-EXM2Q555.js → chunk-AHFZXUZM.js} +7 -5
- package/dist/chunk-AHFZXUZM.js.map +1 -0
- package/dist/{chunk-M2KGXXTL.js → chunk-ALTP3MFS.js} +2 -2
- package/dist/{chunk-77CNV7DY.js → chunk-BLAKS3CP.js} +4 -4
- package/dist/{chunk-FE5FKTCI.js → chunk-BR4UFMLO.js} +2 -2
- package/dist/chunk-CVILPI77.js +432 -0
- package/dist/chunk-CVILPI77.js.map +1 -0
- package/dist/{chunk-H2PBM562.js → chunk-DKQM5Q6Q.js} +2 -2
- package/dist/{chunk-CSXHRAJJ.js → chunk-EG64LXKL.js} +3 -3
- package/dist/{chunk-PTN6UAUA.js → chunk-ES36HTSC.js} +4 -4
- package/dist/{chunk-WMDRLTNA.js → chunk-EZWWCN7I.js} +2 -2
- package/dist/{chunk-XKGPIWGI.js → chunk-FBZTWUK5.js} +5 -5
- package/dist/{chunk-GJJBPI6I.js → chunk-FOCEI3TN.js} +6 -3
- package/dist/chunk-FOCEI3TN.js.map +1 -0
- package/dist/{chunk-Y6E37WRG.js → chunk-GJPCP5CA.js} +2 -2
- package/dist/{chunk-IHMXPG4P.js → chunk-GQSMYXKL.js} +6 -4
- package/dist/{chunk-IHMXPG4P.js.map → chunk-GQSMYXKL.js.map} +1 -1
- package/dist/{chunk-TGQ2NTWH.js → chunk-IJ6WHMFB.js} +16 -2
- package/dist/{chunk-TGQ2NTWH.js.map → chunk-IJ6WHMFB.js.map} +1 -1
- package/dist/{chunk-VDX2J7OX.js → chunk-IPLYGWQF.js} +6 -6
- package/dist/{chunk-XNUBF6RF.js → chunk-IYT632D5.js} +3 -3
- package/dist/{chunk-2QSZNTDO.js → chunk-JBPKEARU.js} +7 -7
- package/dist/{chunk-67DSDRUB.js → chunk-JIF3VRKQ.js} +8 -8
- package/dist/{chunk-V25OWXAC.js → chunk-JQ7T5VDC.js} +1 -1
- package/dist/chunk-JQ7T5VDC.js.map +1 -0
- package/dist/{chunk-MIFF37NN.js → chunk-KKBTBUVT.js} +2 -2
- package/dist/{chunk-ZHP4SUPB.js → chunk-LIHC3T43.js} +2 -2
- package/dist/{chunk-PX7VDW7R.js → chunk-MJPV4LBH.js} +79 -79
- package/dist/{chunk-PX7VDW7R.js.map → chunk-MJPV4LBH.js.map} +1 -1
- package/dist/{chunk-UGH6VPPO.js → chunk-MWTMTW2T.js} +2 -2
- package/dist/{chunk-F6LSNPPB.js → chunk-MXJ3VP6S.js} +6 -6
- package/dist/{chunk-KPWLZBXZ.js → chunk-NBNDVNJ2.js} +186 -25
- package/dist/chunk-NBNDVNJ2.js.map +1 -0
- package/dist/{chunk-M5EPMNS4.js → chunk-P2CLYN6H.js} +2 -2
- package/dist/{chunk-7XXCIO6X.js → chunk-PXQM2HOG.js} +13 -6
- package/dist/{chunk-7XXCIO6X.js.map → chunk-PXQM2HOG.js.map} +1 -1
- package/dist/{chunk-UZK7VVPD.js → chunk-Q5VJUNXA.js} +1858 -272
- package/dist/chunk-Q5VJUNXA.js.map +1 -0
- package/dist/{chunk-KGTD2KZJ.js → chunk-Q6YJW6KE.js} +2 -2
- package/dist/{chunk-X3SQYAPP.js → chunk-R372P2EH.js} +2 -2
- package/dist/{chunk-HBVOJNV4.js → chunk-RKXZ7P4V.js} +3 -3
- package/dist/chunk-RMMVQQA6.js +70 -0
- package/dist/chunk-RMMVQQA6.js.map +1 -0
- package/dist/{chunk-E6EAB4J6.js → chunk-S24E4MBQ.js} +14 -14
- package/dist/chunk-S24E4MBQ.js.map +1 -0
- package/dist/{chunk-RYHWZ52A.js → chunk-S2BBISHU.js} +4 -4
- package/dist/{chunk-LLISELSY.js → chunk-TBMRQZDY.js} +2 -2
- package/dist/{chunk-FMLKOL2Z.js → chunk-TC3VNKGX.js} +4 -4
- package/dist/{chunk-7K5Q6COX.js → chunk-TVVEYCNW.js} +4 -4
- package/dist/{chunk-2XP3PWL3.js → chunk-UR5SIN7H.js} +53 -35
- package/dist/chunk-UR5SIN7H.js.map +1 -0
- package/dist/{chunk-NKDVXEFU.js → chunk-VFNI3RPT.js} +2 -2
- package/dist/chunk-VNA7W7QF.js +134 -0
- package/dist/chunk-VNA7W7QF.js.map +1 -0
- package/dist/{chunk-PQPSZICJ.js → chunk-VYYNBJXH.js} +5 -5
- package/dist/chunk-WNIUPHWV.js +152 -0
- package/dist/chunk-WNIUPHWV.js.map +1 -0
- package/dist/chunk-WRJVB3C2.js +118 -0
- package/dist/chunk-WRJVB3C2.js.map +1 -0
- package/dist/{chunk-SN3ZESWQ.js → chunk-WVVK2RFM.js} +6 -6
- package/dist/{chunk-DQEMWVMT.js → chunk-X7Y7WX73.js} +1 -1
- package/dist/{chunk-4KKV7W62.js → chunk-YOBNCD3Z.js} +6 -6
- package/dist/chunk-YXZG5TVN.js +40 -0
- package/dist/chunk-YXZG5TVN.js.map +1 -0
- package/dist/{chunk-4DJQYKMN.js → chunk-ZIKENA2C.js} +2 -2
- package/dist/chunk-ZIKENA2C.js.map +1 -0
- package/dist/{chunk-SK3EYPKC.js → chunk-ZN4UZWMT.js} +2 -2
- package/dist/{cli-BoouX6LX.d.ts → cli-DJbkaZBU.d.ts} +5 -5
- package/dist/cli.d.ts +14 -12
- package/dist/cli.js +79 -74
- package/dist/compounding/engine.d.ts +3 -2
- package/dist/compounding/engine.js +12 -10
- package/dist/compounding/preference-consolidator.d.ts +1 -1
- package/dist/compression-optimizer.d.ts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/config.js +4 -2
- package/dist/connectors/codex-materialize-runner.d.ts +1 -1
- package/dist/connectors/codex-materialize-runner.js +12 -10
- package/dist/connectors/codex-materialize.d.ts +1 -1
- package/dist/connectors/index.d.ts +1 -1
- package/dist/connectors/index.js +12 -10
- package/dist/consolidation-provenance-check.d.ts +3 -2
- package/dist/consolidation-undo.d.ts +3 -2
- package/dist/contradiction/index.d.ts +3 -2
- package/dist/conversation-index/backend.d.ts +1 -1
- package/dist/conversation-index/backend.js +2 -2
- package/dist/conversation-index/chunker.d.ts +1 -1
- package/dist/conversation-index/faiss-adapter.d.ts +1 -1
- package/dist/conversation-index/indexer.d.ts +1 -1
- package/dist/conversation-index/search.d.ts +1 -1
- package/dist/corpus-watermark.d.ts +15 -2
- package/dist/corpus-watermark.js +25 -21
- package/dist/day-summary.d.ts +1 -1
- package/dist/delinearize.d.ts +1 -1
- package/dist/direct-answer-wiring.d.ts +1 -1
- package/dist/direct-answer.d.ts +1 -1
- package/dist/embedding-fallback.d.ts +1 -1
- package/dist/enrichment/index.d.ts +1 -1
- package/dist/entity-id-normalization.d.ts +4 -0
- package/dist/entity-id-normalization.js +10 -0
- package/dist/entity-id-normalization.js.map +1 -0
- package/dist/entity-retrieval-boundaries.d.ts +3 -0
- package/dist/entity-retrieval-boundaries.js +8 -0
- package/dist/entity-retrieval-boundaries.js.map +1 -0
- package/dist/entity-retrieval.d.ts +3 -2
- package/dist/entity-retrieval.js +13 -10
- package/dist/entity-schema.d.ts +1 -1
- package/dist/entity-schema.js +1 -1
- package/dist/explicit-capture.d.ts +9 -8
- package/dist/extraction-error-classification.d.ts +1 -1
- package/dist/extraction-faithfulness.d.ts +1 -1
- package/dist/extraction-judge-telemetry.d.ts +1 -1
- package/dist/extraction-judge-training.d.ts +1 -1
- package/dist/extraction-judge.d.ts +1 -1
- package/dist/extraction-liveness.d.ts +1 -1
- package/dist/extraction.d.ts +1 -1
- package/dist/fallback-llm.d.ts +1 -1
- package/dist/{first-start-migration-LEXL3XYL.js → first-start-migration-BKNGOFED.js} +4 -4
- package/dist/graph-dashboard-diff.d.ts +1 -1
- package/dist/graph-dashboard-key.d.ts +1 -1
- package/dist/graph-dashboard-parser.d.ts +1 -1
- package/dist/graph-edge-reinforcement.d.ts +1 -1
- package/dist/graph-snapshot.d.ts +1 -1
- package/dist/graph.d.ts +1 -1
- package/dist/importance.d.ts +1 -1
- package/dist/importers/index.d.ts +1 -1
- package/dist/in-flight-reads.d.ts +1 -1
- package/dist/index.d.ts +409 -407
- package/dist/index.js +147 -141
- package/dist/intent.d.ts +1 -1
- package/dist/lcm/engine.d.ts +1 -1
- package/dist/lcm/engine.js +3 -3
- package/dist/lcm/index.d.ts +1 -1
- package/dist/lcm/index.js +9 -9
- package/dist/lcm/tools.d.ts +1 -1
- package/dist/lifecycle.d.ts +1 -1
- package/dist/live-connectors-runner.d.ts +1 -1
- package/dist/local-llm.d.ts +1 -1
- package/dist/local-model-endpoint.d.ts +1 -1
- package/dist/maintenance/memory-governance.d.ts +1 -1
- package/dist/maintenance/memory-governance.js +12 -10
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.d.ts +3 -2
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +12 -10
- package/dist/maintenance/rebuild-memory-projection.d.ts +3 -2
- package/dist/maintenance/rebuild-memory-projection.js +13 -11
- package/dist/{maintenance-DD22oIx9.d.ts → maintenance-DveW6azo.d.ts} +3 -3
- package/dist/mcp-memory-inspector-app.d.ts +13 -10
- package/dist/memory-action-policy.d.ts +1 -1
- package/dist/memory-cache.d.ts +1 -1
- package/dist/memory-lifecycle-ledger-utils.d.ts +1 -1
- package/dist/memory-projection-mutations.d.ts +4 -0
- package/dist/memory-projection-mutations.js +15 -0
- package/dist/memory-projection-mutations.js.map +1 -0
- package/dist/memory-projection-store.d.ts +1 -1
- package/dist/memory-provenance.d.ts +1 -1
- package/dist/memory-worth-outcomes.d.ts +3 -2
- package/dist/models-json.d.ts +1 -1
- package/dist/namespaces/migrate.d.ts +4 -3
- package/dist/namespaces/migrate.js +22 -20
- package/dist/namespaces/principal.d.ts +1 -1
- package/dist/namespaces/search.d.ts +1 -1
- package/dist/namespaces/search.js +9 -9
- package/dist/namespaces/storage.d.ts +4 -3
- package/dist/namespaces/storage.js +12 -10
- package/dist/native-knowledge.d.ts +1 -1
- package/dist/offline-sync-impression-drain.d.ts +1 -1
- package/dist/offline-sync-impression-drain.js +3 -3
- package/dist/operator-doctor-corpus.d.ts +22 -3
- package/dist/operator-doctor-corpus.js +32 -22
- package/dist/operator-doctor-replica.d.ts +52 -0
- package/dist/operator-doctor-replica.js +15 -0
- package/dist/operator-doctor-replica.js.map +1 -0
- package/dist/operator-toolkit.d.ts +7 -3
- package/dist/operator-toolkit.js +33 -27
- package/dist/orchestration/compression-guideline-coordinator.d.ts +3 -2
- package/dist/orchestration/maintenance.d.ts +5 -4
- package/dist/orchestration/maintenance.js +17 -15
- package/dist/{orchestrator-CFJ_TG6D.d.ts → orchestrator-Cvlgpe6I.d.ts} +7 -7
- package/dist/orchestrator.d.ts +9 -8
- package/dist/orchestrator.js +99 -93
- package/dist/patterns-cli.d.ts +1 -1
- package/dist/{pipeline-Bq5zU6Bp.d.ts → pipeline-BveYVaz7.d.ts} +1 -1
- package/dist/policy-runtime.d.ts +1 -1
- package/dist/proactive-contention.d.ts +1 -1
- package/dist/provenance.d.ts +1 -1
- package/dist/{qmd-3ILJkC70.d.ts → qmd-CLWDsbYR.d.ts} +1 -1
- package/dist/qmd-preflight.d.ts +2 -2
- package/dist/qmd-recall-cache.d.ts +1 -1
- package/dist/qmd.d.ts +2 -2
- package/dist/recall-concurrency-config.d.ts +1 -1
- package/dist/recall-disclosure-escalation.d.ts +1 -1
- package/dist/recall-explain-renderer.d.ts +1 -1
- package/dist/recall-explain-renderer.js +3 -3
- package/dist/recall-memory-map.d.ts +1 -1
- package/dist/recall-planner-llm.d.ts +1 -1
- package/dist/recall-state.d.ts +1 -1
- package/dist/recall-state.js +2 -2
- package/dist/recall-tag-filter.d.ts +1 -1
- package/dist/recall-timings.d.ts +1 -1
- package/dist/recall-xray-cli.d.ts +1 -1
- package/dist/recall-xray-cli.js +4 -4
- package/dist/recall-xray-renderer.d.ts +1 -1
- package/dist/recall-xray-renderer.js +3 -3
- package/dist/recall-xray.d.ts +1 -1
- package/dist/recall-xray.js +2 -2
- package/dist/replay/normalizers/chatgpt.d.ts +1 -1
- package/dist/replay/normalizers/claude.d.ts +1 -1
- package/dist/replay/normalizers/openclaw.d.ts +1 -1
- package/dist/replay/normalizers/shared.d.ts +1 -1
- package/dist/replay/runner.d.ts +1 -1
- package/dist/replay/types.d.ts +1 -1
- package/dist/replica-divergence.d.ts +279 -0
- package/dist/replica-divergence.js +28 -0
- package/dist/replica-divergence.js.map +1 -0
- package/dist/replica-peers-config.d.ts +5 -0
- package/dist/replica-peers-config.js +13 -0
- package/dist/replica-peers-config.js.map +1 -0
- package/dist/resolve-auth-token.d.ts +21 -2
- package/dist/resolve-auth-token.js +5 -1
- package/dist/resume-bundles.js +5 -3
- package/dist/retrieval-agents.d.ts +2 -2
- package/dist/retrieval-tiers.d.ts +1 -1
- package/dist/routing/engine.d.ts +1 -1
- package/dist/routing/store.d.ts +1 -1
- package/dist/salvage-envelope.d.ts +1 -1
- package/dist/schemas.d.ts +76 -76
- package/dist/{scope-profiles-D0-ff4xT.d.ts → scope-profiles-BVf3DZ7z.d.ts} +1 -1
- package/dist/search/embed-helper.d.ts +1 -1
- package/dist/search/factory.d.ts +1 -1
- package/dist/search/factory.js +8 -8
- package/dist/search/index.d.ts +1 -1
- package/dist/search/index.js +13 -13
- package/dist/search/lancedb-backend.d.ts +1 -1
- package/dist/search/lancedb-backend.js +2 -2
- package/dist/search/meilisearch-backend.d.ts +1 -1
- package/dist/search/meilisearch-backend.js +2 -2
- package/dist/search/noop-backend.d.ts +1 -1
- package/dist/search/orama-backend.d.ts +1 -1
- package/dist/search/orama-backend.js +2 -2
- package/dist/search/port.d.ts +1 -1
- package/dist/search/remote-backend.d.ts +1 -1
- package/dist/{semantic-consolidation-4Tfh7c1g.d.ts → semantic-consolidation-DXLV47y2.d.ts} +1 -1
- package/dist/semantic-consolidation.d.ts +2 -2
- package/dist/semantic-consolidation.js +13 -11
- package/dist/semantic-rule-promotion.js +12 -10
- package/dist/semantic-rule-verifier.d.ts +1 -1
- package/dist/semantic-rule-verifier.js +12 -10
- package/dist/{service-Z8uzoAST.d.ts → service-DbgPTeMJ.d.ts} +2 -2
- package/dist/session-observer-bands.d.ts +1 -1
- package/dist/session-observer-state.d.ts +1 -1
- package/dist/shared-context/manager.d.ts +9 -9
- package/dist/signal.d.ts +1 -1
- package/dist/{storage-BZVMn8yJ.d.ts → storage-DOzTm8wG.d.ts} +13 -22
- package/dist/storage.d.ts +3 -2
- package/dist/storage.js +13 -10
- package/dist/summarizer.d.ts +1 -1
- package/dist/summary-snapshot.d.ts +1 -1
- package/dist/temporal-supersession.d.ts +3 -2
- package/dist/temporal-timeline-recall.d.ts +1 -1
- package/dist/temporal-validity.d.ts +1 -1
- package/dist/threading.d.ts +1 -1
- package/dist/tier-migration.d.ts +3 -2
- package/dist/tier-routing.d.ts +1 -1
- package/dist/topics.d.ts +1 -1
- package/dist/transcript.d.ts +1 -1
- package/dist/transfer/autodetect.js +1 -1
- package/dist/transfer/backup.js +2 -2
- package/dist/transfer/capsule-export.js +3 -3
- package/dist/transfer/capsule-import.js +2 -2
- package/dist/transfer/types.d.ts +66 -66
- package/dist/trust-score-stage.d.ts +1 -1
- package/dist/trust-score.d.ts +1 -1
- package/dist/{types-DHBxIF0s.d.ts → types-BA7W-_xy.d.ts} +53 -4
- package/dist/types.d.ts +1 -1
- package/dist/types.js +1 -1
- package/dist/utility-runtime.d.ts +1 -1
- package/dist/verified-recall.js +12 -10
- package/dist/write-envelope.d.ts +1 -1
- package/package.json +2 -2
- package/src/access-health-types.ts +8 -0
- package/src/access-http.test.ts +4 -0
- package/src/access-service-health.test.ts +23 -0
- package/src/access-service.ts +27 -4
- package/src/cli.ts +9 -7
- package/src/config.ts +2 -1
- package/src/corpus-watermark.test.ts +21 -0
- package/src/corpus-watermark.ts +25 -3
- package/src/entity-id-normalization.ts +55 -0
- package/src/entity-retrieval-boundaries.ts +134 -0
- package/src/entity-retrieval.ts +253 -27
- package/src/entity-schema.ts +2 -1
- package/src/memory-projection-mutations.ts +132 -0
- package/src/namespaces/storage.ts +5 -3
- package/src/operator-doctor-corpus.ts +41 -0
- package/src/operator-doctor-replica.test.ts +261 -0
- package/src/operator-doctor-replica.ts +129 -0
- package/src/operator-toolkit.ts +5 -4
- package/src/orchestration/orchestrator-init.ts +2 -2
- package/src/replica-divergence.test.ts +1475 -0
- package/src/replica-divergence.ts +910 -0
- package/src/replica-peers-config.ts +250 -0
- package/src/resolve-auth-token.ts +38 -0
- package/src/storage/entity-canonical-id-migration-adapter.ts +72 -0
- package/src/storage/entity-canonical-id-migration-runner.ts +68 -0
- package/src/storage/entity-canonical-id-migration.ts +904 -0
- package/src/storage/entity-store.ts +44 -0
- package/src/storage/memory-frontmatter-metadata.ts +17 -0
- package/src/storage/memory-migration-serialization.ts +37 -0
- package/src/storage/memory-read-store.ts +3 -2
- package/src/storage/profile-header.ts +898 -0
- package/src/storage-profile-timestamp.test.ts +3358 -0
- package/src/storage.ts +73 -77
- package/src/testing/subjects/profile-header-write.test.ts +71 -0
- package/src/types.ts +3 -3
- package/dist/chunk-2XP3PWL3.js.map +0 -1
- package/dist/chunk-4DJQYKMN.js.map +0 -1
- package/dist/chunk-E6EAB4J6.js.map +0 -1
- package/dist/chunk-EXM2Q555.js.map +0 -1
- package/dist/chunk-GJJBPI6I.js.map +0 -1
- package/dist/chunk-KPWLZBXZ.js.map +0 -1
- package/dist/chunk-LIIQPDFN.js.map +0 -1
- package/dist/chunk-UZK7VVPD.js.map +0 -1
- package/dist/chunk-V25OWXAC.js.map +0 -1
- package/dist/chunk-YN4AUGNF.js.map +0 -1
- /package/dist/{capsule-crypto-YO5QJ6L3.js.map → capsule-crypto-7FJQINUR.js.map} +0 -0
- /package/dist/{chunk-7RZJWZ46.js.map → chunk-227UFSEQ.js.map} +0 -0
- /package/dist/{chunk-VGEH3STZ.js.map → chunk-2BEJ4XCF.js.map} +0 -0
- /package/dist/{chunk-BXLOS5AJ.js.map → chunk-2NLLXCJG.js.map} +0 -0
- /package/dist/{chunk-6NNNURLK.js.map → chunk-2PHX3I5C.js.map} +0 -0
- /package/dist/{chunk-XAAIUXJO.js.map → chunk-3BSJBIZ3.js.map} +0 -0
- /package/dist/{chunk-JCVQV6QX.js.map → chunk-3UOSVTFR.js.map} +0 -0
- /package/dist/{chunk-AJ7QCSIS.js.map → chunk-7CPOZH6Y.js.map} +0 -0
- /package/dist/{chunk-M2KGXXTL.js.map → chunk-ALTP3MFS.js.map} +0 -0
- /package/dist/{chunk-77CNV7DY.js.map → chunk-BLAKS3CP.js.map} +0 -0
- /package/dist/{chunk-FE5FKTCI.js.map → chunk-BR4UFMLO.js.map} +0 -0
- /package/dist/{chunk-H2PBM562.js.map → chunk-DKQM5Q6Q.js.map} +0 -0
- /package/dist/{chunk-CSXHRAJJ.js.map → chunk-EG64LXKL.js.map} +0 -0
- /package/dist/{chunk-PTN6UAUA.js.map → chunk-ES36HTSC.js.map} +0 -0
- /package/dist/{chunk-WMDRLTNA.js.map → chunk-EZWWCN7I.js.map} +0 -0
- /package/dist/{chunk-XKGPIWGI.js.map → chunk-FBZTWUK5.js.map} +0 -0
- /package/dist/{chunk-Y6E37WRG.js.map → chunk-GJPCP5CA.js.map} +0 -0
- /package/dist/{chunk-VDX2J7OX.js.map → chunk-IPLYGWQF.js.map} +0 -0
- /package/dist/{chunk-XNUBF6RF.js.map → chunk-IYT632D5.js.map} +0 -0
- /package/dist/{chunk-2QSZNTDO.js.map → chunk-JBPKEARU.js.map} +0 -0
- /package/dist/{chunk-67DSDRUB.js.map → chunk-JIF3VRKQ.js.map} +0 -0
- /package/dist/{chunk-MIFF37NN.js.map → chunk-KKBTBUVT.js.map} +0 -0
- /package/dist/{chunk-ZHP4SUPB.js.map → chunk-LIHC3T43.js.map} +0 -0
- /package/dist/{chunk-UGH6VPPO.js.map → chunk-MWTMTW2T.js.map} +0 -0
- /package/dist/{chunk-F6LSNPPB.js.map → chunk-MXJ3VP6S.js.map} +0 -0
- /package/dist/{chunk-M5EPMNS4.js.map → chunk-P2CLYN6H.js.map} +0 -0
- /package/dist/{chunk-KGTD2KZJ.js.map → chunk-Q6YJW6KE.js.map} +0 -0
- /package/dist/{chunk-X3SQYAPP.js.map → chunk-R372P2EH.js.map} +0 -0
- /package/dist/{chunk-HBVOJNV4.js.map → chunk-RKXZ7P4V.js.map} +0 -0
- /package/dist/{chunk-RYHWZ52A.js.map → chunk-S2BBISHU.js.map} +0 -0
- /package/dist/{chunk-LLISELSY.js.map → chunk-TBMRQZDY.js.map} +0 -0
- /package/dist/{chunk-FMLKOL2Z.js.map → chunk-TC3VNKGX.js.map} +0 -0
- /package/dist/{chunk-7K5Q6COX.js.map → chunk-TVVEYCNW.js.map} +0 -0
- /package/dist/{chunk-NKDVXEFU.js.map → chunk-VFNI3RPT.js.map} +0 -0
- /package/dist/{chunk-PQPSZICJ.js.map → chunk-VYYNBJXH.js.map} +0 -0
- /package/dist/{chunk-SN3ZESWQ.js.map → chunk-WVVK2RFM.js.map} +0 -0
- /package/dist/{chunk-DQEMWVMT.js.map → chunk-X7Y7WX73.js.map} +0 -0
- /package/dist/{chunk-4KKV7W62.js.map → chunk-YOBNCD3Z.js.map} +0 -0
- /package/dist/{chunk-SK3EYPKC.js.map → chunk-ZN4UZWMT.js.map} +0 -0
- /package/dist/{first-start-migration-LEXL3XYL.js.map → first-start-migration-BKNGOFED.js.map} +0 -0
package/src/storage.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { readProjectionRebuiltAt } from "./maintenance/projection-support.js";
|
|
2
2
|
import {
|
|
3
|
-
access,
|
|
4
3
|
lstat,
|
|
5
4
|
readdir,
|
|
6
5
|
readFile,
|
|
@@ -9,7 +8,6 @@ import {
|
|
|
9
8
|
writeFile,
|
|
10
9
|
mkdir,
|
|
11
10
|
unlink,
|
|
12
|
-
rename,
|
|
13
11
|
appendFile,
|
|
14
12
|
open,
|
|
15
13
|
} from "node:fs/promises";
|
|
@@ -20,6 +18,7 @@ import path from "node:path";
|
|
|
20
18
|
import { log } from "./logger.js";
|
|
21
19
|
import { assertMemoryFrontmatterId, warnProjectionFallback } from "./storage-guards.js";
|
|
22
20
|
import { MemoryReadStore } from "./storage/memory-read-store.js";
|
|
21
|
+
import { renderProfileWithLastUpdated } from "./storage/profile-header.js";
|
|
23
22
|
import { readMaybeEncryptedLines, readMemoryActionEventRowsFromLines } from "./storage/secure-line-reader.js";
|
|
24
23
|
import {
|
|
25
24
|
appendLifecycleEventsSerialized,
|
|
@@ -34,10 +33,17 @@ import {
|
|
|
34
33
|
import { selfDeps } from "./orchestration/self-deps.js";
|
|
35
34
|
import { EntityStore } from "./storage/entity-store.js";
|
|
36
35
|
import { IdentityContinuityStore } from "./storage/identity-continuity-store.js";
|
|
36
|
+
import * as entityMigration from "./storage/entity-canonical-id-migration.js";
|
|
37
|
+
import {
|
|
38
|
+
runLegacyEntityCanonicalIdMigration,
|
|
39
|
+
type EntityCanonicalIdMigrationHost,
|
|
40
|
+
} from "./storage/entity-canonical-id-migration-adapter.js";
|
|
41
|
+
import { EntityCanonicalIdMigrationRunner } from "./storage/entity-canonical-id-migration-runner.js";
|
|
42
|
+
import { rememberRawFrontmatter } from "./storage/memory-frontmatter-metadata.js";
|
|
43
|
+
import { createMemoryEntityRefSerializer } from "./storage/memory-migration-serialization.js";
|
|
44
|
+
export { normalizeEntityName } from "./entity-id-normalization.js";
|
|
37
45
|
import { isErrnoCode } from "./utils/errno.js";
|
|
38
|
-
import {
|
|
39
|
-
import { RECALL_FALLBACK_DIRS, getCategoryDir, categoryDirName } from "./utils/category-dir.js";
|
|
40
|
-
import { assertPathInsideRoot } from "./utils/path-containment.js";
|
|
46
|
+
import { getCategoryDir, categoryDirName } from "./utils/category-dir.js";
|
|
41
47
|
import { decodeYamlScalar } from "./utils/yaml-scalar.js";
|
|
42
48
|
import {
|
|
43
49
|
qmdCollectionPathParts,
|
|
@@ -1094,52 +1100,6 @@ function inferCurrentStateStatus(
|
|
|
1094
1100
|
return inferMemoryStatus(frontmatter, pathRel, fallbackStatus);
|
|
1095
1101
|
}
|
|
1096
1102
|
|
|
1097
|
-
/** Built-in aliases for common structural normalizations (no personal data) */
|
|
1098
|
-
const BUILTIN_ALIASES: Record<string, string> = {
|
|
1099
|
-
openclaw: "openclaw",
|
|
1100
|
-
"open-claw": "openclaw",
|
|
1101
|
-
};
|
|
1102
|
-
|
|
1103
|
-
/**
|
|
1104
|
-
* Normalize an entity name to a canonical form.
|
|
1105
|
-
* Strips non-alphanumeric chars, collapses hyphens, removes type prefix duplication.
|
|
1106
|
-
* e.g. "My Project" → "my-project"
|
|
1107
|
-
*
|
|
1108
|
-
* Checks caller-provided user aliases first, then built-in aliases. Alias
|
|
1109
|
-
* tables are instance state on StorageManager (issue #1534) — use
|
|
1110
|
-
* `storageManager.normalizeEntityName(raw, type)` when normalizing within a
|
|
1111
|
-
* store, or pass `storageManager.entityAliases` explicitly. Without an
|
|
1112
|
-
* aliases argument only the built-in structural aliases apply.
|
|
1113
|
-
*/
|
|
1114
|
-
export function normalizeEntityName(raw: string, type: string, aliases?: Readonly<Record<string, string>>): string {
|
|
1115
|
-
// Strip type prefix if present (e.g. name="person-jane-doe", type="person")
|
|
1116
|
-
const rawStr = typeof raw === "string" ? raw : "";
|
|
1117
|
-
const typeStr = typeof type === "string" && type.trim().length > 0 ? type : "entity";
|
|
1118
|
-
|
|
1119
|
-
let name = rawStr.toLowerCase().trim();
|
|
1120
|
-
const typePrefix = `${typeStr.toLowerCase()}-`;
|
|
1121
|
-
if (name.startsWith(typePrefix)) {
|
|
1122
|
-
name = name.slice(typePrefix.length);
|
|
1123
|
-
}
|
|
1124
|
-
|
|
1125
|
-
// Replace non-alphanumeric with hyphens, collapse multiples, trim edges
|
|
1126
|
-
let normalized = name
|
|
1127
|
-
.replace(/[^a-z0-9]+/g, "-")
|
|
1128
|
-
.replace(/-+/g, "-")
|
|
1129
|
-
.replace(/^-|-$/g, "");
|
|
1130
|
-
|
|
1131
|
-
// Check caller-provided user aliases first, then built-in. Own-property and
|
|
1132
|
-
// string guards keep inherited object keys (e.g. an entity literally named
|
|
1133
|
-
// "constructor") and malformed alias values from corrupting canonical ids.
|
|
1134
|
-
const userAlias = aliases !== undefined && Object.hasOwn(aliases, normalized) ? aliases[normalized] : undefined;
|
|
1135
|
-
if (typeof userAlias === "string" && userAlias.length > 0) {
|
|
1136
|
-
normalized = userAlias;
|
|
1137
|
-
} else if (Object.hasOwn(BUILTIN_ALIASES, normalized)) {
|
|
1138
|
-
normalized = BUILTIN_ALIASES[normalized];
|
|
1139
|
-
}
|
|
1140
|
-
|
|
1141
|
-
return `${typeStr.toLowerCase()}-${normalized}`;
|
|
1142
|
-
}
|
|
1143
1103
|
|
|
1144
1104
|
/**
|
|
1145
1105
|
* Simple Levenshtein distance between two strings.
|
|
@@ -2134,24 +2094,39 @@ export class StorageManager {
|
|
|
2134
2094
|
* Set or clear the at-rest encryption key.
|
|
2135
2095
|
*
|
|
2136
2096
|
* Pass a 32-byte Buffer to enable encryption; pass null to clear
|
|
2137
|
-
* (lock) the store.
|
|
2097
|
+
* (lock) the store. The caller is responsible for key lifecycle —
|
|
2138
2098
|
* this method does not zero the buffer on replacement; the keyring
|
|
2139
|
-
* module (`keyring.ts`) owns zeroization.
|
|
2099
|
+
* module (`keyring.ts`) owns zeroization. The setter remains synchronous
|
|
2100
|
+
* for existing consumers; call `setSecureStoreKeyAndWait` when unlock must
|
|
2101
|
+
* await migration.
|
|
2140
2102
|
*/
|
|
2141
2103
|
setSecureStoreKey(key: Buffer | null, encryptOnWrite = true): void {
|
|
2104
|
+
if (!this.applySecureStoreKey(key, encryptOnWrite) || key === null) return;
|
|
2105
|
+
void this.entityCanonicalIdMigration.triggerAfterUnlock().catch((error: unknown) => {
|
|
2106
|
+
log.warn(
|
|
2107
|
+
`secure-store unlock migration failed: ${error instanceof Error ? error.message : String(error)}`,
|
|
2108
|
+
);
|
|
2109
|
+
});
|
|
2110
|
+
}
|
|
2111
|
+
|
|
2112
|
+
public async setSecureStoreKeyAndWait(key: Buffer | null, encryptOnWrite = true): Promise<void> {
|
|
2113
|
+
if (!this.applySecureStoreKey(key, encryptOnWrite) || key === null) return;
|
|
2114
|
+
await this.entityCanonicalIdMigration.triggerAfterUnlock();
|
|
2115
|
+
}
|
|
2116
|
+
|
|
2117
|
+
private applySecureStoreKey(key: Buffer | null, encryptOnWrite: boolean): boolean {
|
|
2118
|
+
const sameKey =
|
|
2119
|
+
this._secureStoreKey === key ||
|
|
2120
|
+
(this._secureStoreKey !== null && key !== null && this._secureStoreKey.equals(key));
|
|
2121
|
+
if (sameKey && this._secureStoreEncryptOnWrite === encryptOnWrite) return false;
|
|
2122
|
+
|
|
2142
2123
|
this._secureStoreKey = key;
|
|
2143
2124
|
this._secureStoreEncryptOnWrite = encryptOnWrite;
|
|
2144
|
-
// Route through the invalidation chokepoint (issue #1535): a key change
|
|
2145
|
-
// (or store lock) must evict every cache layer that may hold content
|
|
2146
|
-
// decrypted under the previous key, not just the entity layer.
|
|
2147
2125
|
invalidateAllForDir(this.baseDir);
|
|
2148
2126
|
this.invalidateKnowledgeIndexCache();
|
|
2149
|
-
// A key change flips resolveWriteKey(), so a file's plain/encrypted class on
|
|
2150
|
-
// the next full rewrite may differ from what was cached (issue #1909).
|
|
2151
2127
|
this.secureFileEncryptionSniffCache.clear();
|
|
2152
|
-
// Same rationale for the behavior-signals dedup key cache (issue #1909):
|
|
2153
|
-
// drop it on a key change so a re-encrypted/re-decrypted ledger is reloaded.
|
|
2154
2128
|
this.behaviorSignalsKeyCache = null;
|
|
2129
|
+
return true;
|
|
2155
2130
|
}
|
|
2156
2131
|
|
|
2157
2132
|
private getEntityCacheSecureStoreKey(): string {
|
|
@@ -2339,6 +2314,7 @@ export class StorageManager {
|
|
|
2339
2314
|
// loadAliases() explicitly — every creation path must still get the
|
|
2340
2315
|
// store's own aliases, never an empty or foreign table.
|
|
2341
2316
|
this.loadAliasesSync();
|
|
2317
|
+
this.loadHistoricalEntityCanonicalIdsSync();
|
|
2342
2318
|
}
|
|
2343
2319
|
|
|
2344
2320
|
/** Set the process-wide hot-memories cache default (issue #1902). The
|
|
@@ -3596,9 +3572,17 @@ export class StorageManager {
|
|
|
3596
3572
|
* store loaded last rewrite every other store's canonical entity ids.
|
|
3597
3573
|
*/
|
|
3598
3574
|
private userAliases: Record<string, string> = {};
|
|
3599
|
-
|
|
3575
|
+
private historicalEntityCanonicalIds: Readonly<Record<string, string>> = {};
|
|
3576
|
+
private readonly entityCanonicalIdMigration = new EntityCanonicalIdMigrationRunner(
|
|
3577
|
+
() => !(this._secureStoreRequired && !this.isSecureStoreUnlocked()),
|
|
3578
|
+
() => this.runLegacyEntityCanonicalIdMigration(),
|
|
3579
|
+
() => entityMigration.getFingerprint(this.baseDir, this.entitiesDir, () => this.getCorpusScanVersion()),
|
|
3580
|
+
);
|
|
3600
3581
|
normalizeEntityName(raw: string, type: string): string {
|
|
3601
|
-
return
|
|
3582
|
+
return entityMigration.resolveHistoricalEntityCanonicalId(
|
|
3583
|
+
this.entityStore.normalizeEntityName(raw, type),
|
|
3584
|
+
this.historicalEntityCanonicalIds,
|
|
3585
|
+
);
|
|
3602
3586
|
}
|
|
3603
3587
|
|
|
3604
3588
|
/**
|
|
@@ -3645,8 +3629,24 @@ export class StorageManager {
|
|
|
3645
3629
|
log.debug("no config/aliases.json found — using built-in aliases only");
|
|
3646
3630
|
}
|
|
3647
3631
|
}
|
|
3632
|
+
private loadHistoricalEntityCanonicalIdsSync(): void {
|
|
3633
|
+
this.historicalEntityCanonicalIds = entityMigration.loadHistoricalEntityCanonicalIds(this.stateDir);
|
|
3634
|
+
}
|
|
3635
|
+
|
|
3636
|
+
private async runLegacyEntityCanonicalIdMigration(): Promise<string> {
|
|
3637
|
+
const completionFingerprint = await runLegacyEntityCanonicalIdMigration(
|
|
3638
|
+
this as unknown as EntityCanonicalIdMigrationHost,
|
|
3639
|
+
(content) => parseEntityFile(content, this.entitySchemas),
|
|
3640
|
+
(entity) => serializeEntityFile(entity, this.entitySchemas),
|
|
3641
|
+
createMemoryEntityRefSerializer(serializeFrontmatter),
|
|
3642
|
+
);
|
|
3643
|
+
this.loadHistoricalEntityCanonicalIdsSync();
|
|
3644
|
+
return completionFingerprint;
|
|
3645
|
+
}
|
|
3648
3646
|
|
|
3649
3647
|
async ensureDirectories(): Promise<void> {
|
|
3648
|
+
await mkdir(this.baseDir, { recursive: true });
|
|
3649
|
+
await entityMigration.validateRoots(this.baseDir, this.entitiesDir, this.stateDir, this.archiveDir);
|
|
3650
3650
|
const today = new Date().toISOString().slice(0, 10);
|
|
3651
3651
|
await mkdir(path.join(this.factsDir, today), { recursive: true });
|
|
3652
3652
|
await mkdir(path.join(this.proceduresDir, today), { recursive: true });
|
|
@@ -3661,6 +3661,7 @@ export class StorageManager {
|
|
|
3661
3661
|
await mkdir(this.identityAuditsWeeklyDir, { recursive: true });
|
|
3662
3662
|
await mkdir(this.identityAuditsMonthlyDir, { recursive: true });
|
|
3663
3663
|
await mkdir(path.join(this.baseDir, "config"), { recursive: true });
|
|
3664
|
+
await this.entityCanonicalIdMigration.ensure();
|
|
3664
3665
|
// Activate the corpus sentinel at setup (issue #1902, Cursor Medium): an
|
|
3665
3666
|
// existing corpus predating this feature has a size-0/absent sentinel, which
|
|
3666
3667
|
// getCachedMemories treats as a miss — so a read-heavy workload would never
|
|
@@ -3674,6 +3675,7 @@ export class StorageManager {
|
|
|
3674
3675
|
if (this.hotMemoriesCacheEnabled && this.getMemoryCorpusVersion() === 0) {
|
|
3675
3676
|
this.bumpMemoryCorpusVersion();
|
|
3676
3677
|
}
|
|
3678
|
+
await this.entityCanonicalIdMigration.markDirectoriesInitialized();
|
|
3677
3679
|
}
|
|
3678
3680
|
|
|
3679
3681
|
/**
|
|
@@ -4251,15 +4253,13 @@ export class StorageManager {
|
|
|
4251
4253
|
}
|
|
4252
4254
|
|
|
4253
4255
|
async writeProfile(content: string): Promise<void> {
|
|
4256
|
+
const stampedContent = renderProfileWithLastUpdated(content, new Date().toISOString());
|
|
4254
4257
|
await this.ensureDirectories();
|
|
4255
4258
|
await this.snapshotBeforeWrite(this.profilePath, "consolidation");
|
|
4256
|
-
await this.writeStorageSecureFile(this.profilePath,
|
|
4259
|
+
await this.writeStorageSecureFile(this.profilePath, stampedContent);
|
|
4257
4260
|
log.debug("updated profile.md");
|
|
4258
4261
|
}
|
|
4259
4262
|
|
|
4260
|
-
/**
|
|
4261
|
-
* Normalize a string for fuzzy profile dedup: lowercase, strip punctuation, collapse whitespace.
|
|
4262
|
-
*/
|
|
4263
4263
|
private static normalizeForDedup(s: string): string {
|
|
4264
4264
|
if (typeof s !== "string") return "";
|
|
4265
4265
|
return s
|
|
@@ -4308,15 +4308,13 @@ export class StorageManager {
|
|
|
4308
4308
|
const content = [
|
|
4309
4309
|
"# Behavioral Profile",
|
|
4310
4310
|
"",
|
|
4311
|
-
`*Last updated: ${new Date().toISOString()}*`,
|
|
4312
|
-
"",
|
|
4313
4311
|
...newBullets.map((b) => `- ${b}`),
|
|
4314
4312
|
"",
|
|
4315
4313
|
].join("\n");
|
|
4316
4314
|
await this.writeProfile(content);
|
|
4317
4315
|
} else {
|
|
4318
|
-
const
|
|
4319
|
-
|
|
4316
|
+
const withBullets =
|
|
4317
|
+
existing.trimEnd() + "\n" + newBullets.map((b) => `- ${b}`).join("\n") + "\n";
|
|
4320
4318
|
await this.writeProfile(withBullets);
|
|
4321
4319
|
}
|
|
4322
4320
|
}
|
|
@@ -4685,7 +4683,7 @@ export class StorageManager {
|
|
|
4685
4683
|
const raw = await readMaybeEncryptedFile(fullPath, this._secureStoreKey, this.baseDir);
|
|
4686
4684
|
const parsed = parseFrontmatter(raw);
|
|
4687
4685
|
if (!parsed) return null;
|
|
4688
|
-
return {
|
|
4686
|
+
return rememberRawFrontmatter({
|
|
4689
4687
|
path: fullPath,
|
|
4690
4688
|
frontmatter: normalizeFrontmatterForPath(
|
|
4691
4689
|
parsed.frontmatter,
|
|
@@ -4693,7 +4691,7 @@ export class StorageManager {
|
|
|
4693
4691
|
parsed.content
|
|
4694
4692
|
),
|
|
4695
4693
|
content: parsed.content,
|
|
4696
|
-
} satisfies MemoryFile;
|
|
4694
|
+
} satisfies MemoryFile, raw);
|
|
4697
4695
|
} catch (err) {
|
|
4698
4696
|
// Re-throw store-locked errors so a locked encrypted store fails
|
|
4699
4697
|
// loudly rather than appearing as an empty memory corpus (Cursor
|
|
@@ -4844,7 +4842,7 @@ export class StorageManager {
|
|
|
4844
4842
|
const raw = await readMaybeEncryptedFile(fullPath, this._secureStoreKey, this.baseDir);
|
|
4845
4843
|
const parsed = parseFrontmatter(raw);
|
|
4846
4844
|
if (parsed) {
|
|
4847
|
-
memories.push({
|
|
4845
|
+
memories.push(rememberRawFrontmatter({
|
|
4848
4846
|
path: fullPath,
|
|
4849
4847
|
frontmatter: normalizeFrontmatterForPath(
|
|
4850
4848
|
parsed.frontmatter,
|
|
@@ -4852,7 +4850,7 @@ export class StorageManager {
|
|
|
4852
4850
|
parsed.content
|
|
4853
4851
|
),
|
|
4854
4852
|
content: parsed.content,
|
|
4855
|
-
});
|
|
4853
|
+
}, raw));
|
|
4856
4854
|
}
|
|
4857
4855
|
} catch (err) {
|
|
4858
4856
|
// Re-throw store-locked errors — a locked encrypted store
|
|
@@ -6136,9 +6134,6 @@ export class StorageManager {
|
|
|
6136
6134
|
this.invalidateKnowledgeIndexCache();
|
|
6137
6135
|
}
|
|
6138
6136
|
|
|
6139
|
-
/**
|
|
6140
|
-
* Add an alias to an entity file. Deduplicates.
|
|
6141
|
-
*/
|
|
6142
6137
|
async addEntityAlias(name: string, alias: string): Promise<void> {
|
|
6143
6138
|
const filePath = path.join(this.entitiesDir, `${name}.md`);
|
|
6144
6139
|
let entity: EntityFile;
|
|
@@ -6157,6 +6152,7 @@ export class StorageManager {
|
|
|
6157
6152
|
entity.updated = new Date().toISOString();
|
|
6158
6153
|
await this.writeStorageSecureFile(filePath, serializeEntityFile(entity, this.entitySchemas));
|
|
6159
6154
|
this.invalidateKnowledgeIndexCache();
|
|
6155
|
+
this.bumpMemoryStatusVersion();
|
|
6160
6156
|
}
|
|
6161
6157
|
|
|
6162
6158
|
async updateEntitySynthesis(
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Profile-header write-boundary subject for the lifecycle scenario matrix.
|
|
3
|
+
* Profile content is not session state, so only the session-end mutation row
|
|
4
|
+
* applies; the remaining canonical rows are explicit skips rather than false
|
|
5
|
+
* extraction-lifecycle coverage.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import assert from "node:assert/strict";
|
|
9
|
+
|
|
10
|
+
import { StorageManager } from "../../storage.js";
|
|
11
|
+
import { type LifecycleSubject, type MatrixRow, runLifecycleMatrix } from "../lifecycle-matrix.js";
|
|
12
|
+
import { cleanupDir, mkTempMemoryDir } from "../orchestrator-lite.js";
|
|
13
|
+
|
|
14
|
+
interface ProfileHeaderState {
|
|
15
|
+
dir: string;
|
|
16
|
+
storage: StorageManager;
|
|
17
|
+
writeStartedAt?: number;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const STALE_PROFILE = [
|
|
21
|
+
"# Behavioral Profile",
|
|
22
|
+
"",
|
|
23
|
+
"*Last updated: 2024-01-02T03:04:05.000Z*",
|
|
24
|
+
"",
|
|
25
|
+
"- Profile content survives the write boundary.",
|
|
26
|
+
"",
|
|
27
|
+
].join("\n");
|
|
28
|
+
|
|
29
|
+
const subject: LifecycleSubject<ProfileHeaderState> = {
|
|
30
|
+
appliesTo(row: MatrixRow): boolean | string {
|
|
31
|
+
return row.id === "session-end"
|
|
32
|
+
? true
|
|
33
|
+
: "profile writes have no provider, restart, or replay variants; direct profile tests cover those boundaries";
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
async setup(row: MatrixRow): Promise<ProfileHeaderState> {
|
|
37
|
+
const dir = await mkTempMemoryDir(`profile-header-${row.id}`);
|
|
38
|
+
try {
|
|
39
|
+
return { dir, storage: new StorageManager(dir) };
|
|
40
|
+
} catch (error) {
|
|
41
|
+
await cleanupDir(dir);
|
|
42
|
+
throw error;
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
async exercise(state: ProfileHeaderState): Promise<void> {
|
|
47
|
+
state.writeStartedAt = Date.now();
|
|
48
|
+
await state.storage.writeProfile(STALE_PROFILE);
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
async invariants(state: ProfileHeaderState): Promise<void> {
|
|
52
|
+
const profile = await state.storage.readProfile();
|
|
53
|
+
const headers = profile.match(/^\*Last updated: .*\*$/gm) ?? [];
|
|
54
|
+
assert.equal(headers.length, 1, "profile writes leave one canonical Last updated header");
|
|
55
|
+
assert.notEqual(headers[0], "*Last updated: 2024-01-02T03:04:05.000Z*");
|
|
56
|
+
assert.match(profile, /^# Behavioral Profile$/m);
|
|
57
|
+
|
|
58
|
+
const timestamp = headers[0]?.match(/^\*Last updated: ([^*]+)\*$/)?.[1];
|
|
59
|
+
assert.ok(timestamp, "the canonical header contains an ISO timestamp");
|
|
60
|
+
const updatedAt = Date.parse(timestamp);
|
|
61
|
+
assert.ok(Number.isFinite(updatedAt), "the profile header timestamp is parseable");
|
|
62
|
+
assert.ok(updatedAt >= (state.writeStartedAt ?? 0), "the header advances at the write boundary");
|
|
63
|
+
assert.ok(updatedAt <= Date.now(), "the header is not in the future");
|
|
64
|
+
},
|
|
65
|
+
|
|
66
|
+
async teardown(state: ProfileHeaderState): Promise<void> {
|
|
67
|
+
await cleanupDir(state.dir);
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
runLifecycleMatrix("profile-header-write", subject);
|
package/src/types.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { MeetingsConfig } from "./meetings/types.js";
|
|
|
3
3
|
import type { ActivityConfig } from "./activity/types.js";
|
|
4
4
|
import type { WearablesConfig } from "./wearables/types.js";
|
|
5
5
|
import type { ExtractionLivenessConfig } from "./extraction-liveness.js";
|
|
6
|
+
import type { ReplicaPeersConfig } from "./replica-peers-config.js";
|
|
6
7
|
|
|
7
8
|
export type ReasoningEffort = "none" | "low" | "medium" | "high";
|
|
8
9
|
export type TriggerMode = "smart" | "every_n" | "time_based";
|
|
@@ -1208,9 +1209,8 @@ export interface PluginConfig extends BoundedJsonlStateConfig {
|
|
|
1208
1209
|
dreamsPhases: DreamsPhasesConfig;
|
|
1209
1210
|
procedural: ProceduralConfig;
|
|
1210
1211
|
extractionLiveness: ExtractionLivenessConfig;
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
*/
|
|
1212
|
+
replicaPeers: ReplicaPeersConfig;
|
|
1213
|
+
/** Claim-level provenance spans (#1575); see `ProvenanceConfig` for defaults. */
|
|
1214
1214
|
provenance: ProvenanceConfig;
|
|
1215
1215
|
/**
|
|
1216
1216
|
* Wearable transcript ingestion (Limitless / Bee / Omi connectors).
|