@remnic/core 9.29.1 → 9.30.1
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 +11 -11
- package/dist/access-admin-ops-surface.js +19 -18
- package/dist/access-authorization-probe.d.ts +11 -11
- package/dist/access-authorization-probe.js +20 -19
- package/dist/access-boundary.d.ts +11 -11
- package/dist/access-boundary.js +19 -18
- package/dist/access-citation-namespace.js +2 -2
- package/dist/access-cli.js +45 -44
- package/dist/access-cli.js.map +1 -1
- package/dist/access-health-types.d.ts +1 -1
- package/dist/access-http-lcm-compaction.d.ts +11 -11
- package/dist/access-http.d.ts +11 -11
- package/dist/access-http.js +25 -24
- package/dist/access-identity-continuity-surface.d.ts +8 -8
- package/dist/access-identity-continuity-surface.js +19 -18
- package/dist/access-lcm-surface.d.ts +10 -10
- package/dist/access-lcm-surface.js +19 -18
- package/dist/access-mcp.d.ts +11 -11
- package/dist/access-mcp.js +23 -22
- package/dist/access-memory-search-fanout.d.ts +2 -2
- package/dist/{access-namespace-preflight-DCXBkDp0.d.ts → access-namespace-preflight-VfXssvoI.d.ts} +1 -1
- package/dist/access-namespace-preflight.d.ts +3 -3
- package/dist/access-namespace-preflight.js +19 -18
- package/dist/access-observe-write-surface.d.ts +10 -10
- package/dist/access-observe-write-surface.js +19 -18
- package/dist/access-operations-batch.js +20 -19
- package/dist/access-operations.d.ts +11 -11
- package/dist/access-operations.js +22 -21
- package/dist/access-recall-concurrency.d.ts +11 -11
- package/dist/access-recall-concurrency.js +19 -18
- package/dist/access-recall-response.d.ts +10 -10
- package/dist/access-recall-response.js +19 -18
- package/dist/access-recall-surface.d.ts +10 -10
- package/dist/access-recall-surface.js +19 -18
- package/dist/access-schema.js +3 -3
- package/dist/{access-service-DvPW_M5j.d.ts → access-service-B5RwVsTV.d.ts} +7 -7
- package/dist/access-service.d.ts +11 -11
- package/dist/access-service.js +19 -18
- package/dist/access-surface-catalog.d.ts +11 -11
- 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 +3 -3
- package/dist/behavior-learner.d.ts +1 -1
- package/dist/behavior-signals.d.ts +1 -1
- package/dist/bootstrap.d.ts +8 -8
- package/dist/briefing.d.ts +3 -2
- package/dist/briefing.js +10 -9
- 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/{catalog-BIVgftWu.d.ts → catalog-V7inUQdp.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 +11 -10
- package/dist/causal-consolidation.js.map +1 -1
- package/dist/causal-trajectory-graph.d.ts +1 -1
- package/dist/{chunk-FZRQZW4H.js → chunk-2EUVEDF5.js} +2 -2
- package/dist/{chunk-PBUZNGMX.js → chunk-4WKA6I65.js} +20 -20
- package/dist/{chunk-PBUZNGMX.js.map → chunk-4WKA6I65.js.map} +1 -1
- package/dist/{chunk-AIK5W3IW.js → chunk-5TFP4CUL.js} +68 -2
- package/dist/chunk-5TFP4CUL.js.map +1 -0
- package/dist/{chunk-3JNDOAQ2.js → chunk-5W4ZLBEZ.js} +9 -9
- package/dist/{chunk-5ZCUDWD4.js → chunk-62U4J2GN.js} +2 -2
- package/dist/{chunk-IGPEJVBY.js → chunk-66772WBP.js} +2 -2
- package/dist/{chunk-EP5BVCRI.js → chunk-6BNE62PM.js} +2 -2
- package/dist/{chunk-AAP5T6QG.js → chunk-6DNMUYEE.js} +2 -2
- package/dist/{chunk-35DL7IOI.js → chunk-6FUPCJUL.js} +7 -7
- package/dist/{chunk-JP3YPDAW.js → chunk-6U7F52DE.js} +19 -19
- package/dist/{chunk-E4OCKU67.js → chunk-7XC2HX75.js} +2 -2
- package/dist/{chunk-OVRQLAYR.js → chunk-AZ5BTEKX.js} +2 -2
- package/dist/{chunk-2AXMQWCN.js → chunk-CZRYLSSW.js} +3 -3
- package/dist/chunk-FBUE6PD3.js +1769 -0
- package/dist/chunk-FBUE6PD3.js.map +1 -0
- package/dist/{chunk-PTSNLEXK.js → chunk-FDAMS4PK.js} +2 -2
- package/dist/{chunk-WL5EBRDH.js → chunk-FFAZ2XFU.js} +9 -8
- package/dist/chunk-FFAZ2XFU.js.map +1 -0
- package/dist/{chunk-2GXM5N5A.js → chunk-GIBMDSJ2.js} +2 -2
- package/dist/{chunk-E5OBR6CJ.js → chunk-H5CPS5JP.js} +3 -3
- package/dist/{chunk-2D7FEUCK.js → chunk-I5NLEENJ.js} +2 -2
- package/dist/{chunk-DRBXHRXE.js → chunk-IB26HVAJ.js} +2 -2
- package/dist/{chunk-QDKK63Y7.js → chunk-IC6CBHCA.js} +3 -3
- package/dist/{chunk-IAEAFLF2.js → chunk-JCBWCYEJ.js} +2 -2
- package/dist/{chunk-3PDOVUHC.js → chunk-KXB4VXHY.js} +2 -2
- package/dist/{chunk-WU7TTVOD.js → chunk-LBOD4U5B.js} +7 -7
- package/dist/{chunk-UBKEQOTD.js → chunk-LGHKJABJ.js} +3 -3
- package/dist/{chunk-VSURVXKY.js → chunk-M3C2V3PV.js} +10 -10
- package/dist/{chunk-OFHFH655.js → chunk-MJCGLM25.js} +8 -8
- package/dist/{chunk-OYJKSZIQ.js → chunk-NHWB6HG2.js} +2 -2
- package/dist/{chunk-TC3VNKGX.js → chunk-NM2WP3B7.js} +4 -4
- package/dist/{chunk-GAWOEQEQ.js → chunk-P5PXWTW7.js} +2 -2
- package/dist/chunk-PH3ZWL3W.js +786 -0
- package/dist/chunk-PH3ZWL3W.js.map +1 -0
- package/dist/{chunk-2QMKMVHH.js → chunk-QNWXCJ76.js} +2 -2
- package/dist/{chunk-JMQUBRV6.js → chunk-RGIWINDN.js} +340 -771
- package/dist/chunk-RGIWINDN.js.map +1 -0
- package/dist/{chunk-WRFBW2TT.js → chunk-SPJXKAVF.js} +3 -3
- package/dist/{chunk-HKJCMOT6.js → chunk-TH2LSRMG.js} +2 -2
- package/dist/{chunk-CW4AGY3G.js → chunk-VI2JQPNQ.js} +2 -2
- package/dist/{chunk-OP6F6L3S.js → chunk-W5EG6LE3.js} +2 -2
- package/dist/{chunk-DEBHXHJR.js → chunk-WIPEXG6R.js} +2 -2
- package/dist/{chunk-SH6YO3LT.js → chunk-WVO4G37W.js} +2 -2
- package/dist/{chunk-FUYEVEX7.js → chunk-YNQBRLC5.js} +24 -22
- package/dist/chunk-YNQBRLC5.js.map +1 -0
- package/dist/{chunk-7L45JFPW.js → chunk-YTQNQ4KB.js} +14 -14
- package/dist/{chunk-PKRIQL3V.js → chunk-YTSNAUXN.js} +2 -2
- package/dist/{chunk-5QDRGWT2.js → chunk-ZPSVBSOF.js} +4 -4
- package/dist/{cli-CxoSOiG0.d.ts → cli-C4GbETPC.d.ts} +5 -5
- package/dist/cli.d.ts +13 -13
- package/dist/cli.js +36 -35
- package/dist/compounding/engine.d.ts +3 -2
- package/dist/compounding/engine.js +10 -9
- 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 +3 -3
- package/dist/connectors/codex-materialize-runner.d.ts +1 -1
- package/dist/connectors/codex-materialize-runner.js +10 -9
- package/dist/connectors/codex-materialize.d.ts +1 -1
- package/dist/connectors/index.d.ts +1 -1
- package/dist/connectors/index.js +10 -9
- 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/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 +1 -1
- package/dist/corpus-watermark.js +12 -11
- 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-retrieval.d.ts +3 -2
- package/dist/entity-retrieval.js +10 -9
- package/dist/entity-schema.d.ts +1 -1
- package/dist/explicit-capture.d.ts +52 -10
- package/dist/explicit-capture.js +13 -1
- 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-source-grounding-rules.d.ts +1 -1
- package/dist/extraction-source-grounding.d.ts +1 -1
- package/dist/extraction.d.ts +1 -1
- package/dist/fallback-llm.d.ts +1 -1
- package/dist/{forget-HRPLVB3W.js → forget-4UY2EOKH.js} +3 -3
- 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 +19 -19
- package/dist/index.js +47 -45
- package/dist/intent.d.ts +1 -1
- package/dist/lcm/engine.d.ts +1 -1
- package/dist/lcm/index.d.ts +1 -1
- 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 +10 -9
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.d.ts +2 -2
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +10 -9
- package/dist/maintenance/rebuild-memory-projection.d.ts +3 -2
- package/dist/maintenance/rebuild-memory-projection.js +11 -10
- package/dist/{maintenance-Cb-PjxQd.d.ts → maintenance-CL30NWtc.d.ts} +3 -3
- package/dist/mcp-memory-inspector-app.d.ts +11 -11
- 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-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 +11 -10
- package/dist/namespaces/principal.d.ts +1 -1
- package/dist/namespaces/search.d.ts +1 -1
- package/dist/namespaces/storage.d.ts +4 -3
- package/dist/namespaces/storage.js +10 -9
- 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 +5 -5
- package/dist/offline-sync.js +2 -2
- package/dist/operator-doctor-corpus.d.ts +1 -1
- package/dist/operator-doctor-corpus.js +13 -12
- package/dist/operator-doctor-replica.d.ts +1 -1
- package/dist/operator-toolkit.d.ts +4 -3
- package/dist/operator-toolkit.js +18 -17
- package/dist/orchestration/compression-guideline-coordinator.d.ts +3 -2
- package/dist/orchestration/maintenance.d.ts +5 -4
- package/dist/orchestration/maintenance.js +15 -14
- package/dist/{orchestrator-5GKqb_HL.d.ts → orchestrator-CKTCRwWV.d.ts} +7 -7
- package/dist/orchestrator.d.ts +8 -8
- package/dist/orchestrator.js +45 -44
- package/dist/patterns-cli.d.ts +1 -1
- package/dist/{pipeline-3Qi1TpRo.d.ts → pipeline-B7wj4rRZ.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/{purge-YSGX5BOG.js → purge-533FZLS4.js} +16 -9
- package/dist/purge-533FZLS4.js.map +1 -0
- package/dist/qmd-preflight.d.ts +2 -2
- package/dist/{qmd-D9JqzzRX.d.ts → qmd-q9tg4dHp.d.ts} +1 -1
- 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-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-renderer.d.ts +1 -1
- package/dist/recall-xray.d.ts +1 -1
- 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 +1 -1
- package/dist/replica-peers-config.d.ts +1 -1
- package/dist/resolve-auth-token.d.ts +1 -1
- package/dist/resume-bundles.js +4 -4
- 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/{scope-profiles-C4g6_UdP.d.ts → scope-profiles-CWDyglPM.d.ts} +1 -1
- package/dist/search/embed-helper.d.ts +1 -1
- package/dist/search/factory.d.ts +1 -1
- package/dist/search/index.d.ts +1 -1
- package/dist/search/lancedb-backend.d.ts +1 -1
- package/dist/search/meilisearch-backend.d.ts +1 -1
- package/dist/search/noop-backend.d.ts +1 -1
- package/dist/search/orama-backend.d.ts +1 -1
- package/dist/search/port.d.ts +1 -1
- package/dist/search/remote-backend.d.ts +1 -1
- package/dist/secure-store/index.js +2 -2
- package/dist/{semantic-consolidation-BrxqnzTW.d.ts → semantic-consolidation-BUE3deLn.d.ts} +1 -1
- package/dist/semantic-consolidation.d.ts +2 -2
- package/dist/semantic-consolidation.js +11 -10
- package/dist/semantic-rule-promotion.js +10 -9
- package/dist/semantic-rule-verifier.d.ts +1 -1
- package/dist/semantic-rule-verifier.js +10 -9
- package/dist/{service-Bi1JgxdP.d.ts → service-CXgM0bQG.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 +1 -1
- package/dist/signal.d.ts +1 -1
- package/dist/{storage-CcH6yPk2.d.ts → storage-DysJq-XH.d.ts} +163 -27
- package/dist/storage.d.ts +3 -2
- package/dist/storage.js +12 -10
- package/dist/summarizer.d.ts +1 -1
- package/dist/summarizer.js +3 -3
- package/dist/summary-snapshot.d.ts +1 -1
- package/dist/summary-snapshot.js +2 -2
- 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/trust-score-stage.d.ts +1 -1
- package/dist/trust-score.d.ts +1 -1
- package/dist/{types-Dg0w9ADr.d.ts → types-aPPzhnjT.d.ts} +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/utility-runtime.d.ts +1 -1
- package/dist/utils/serialize-mutations.d.ts +11 -7
- package/dist/utils/serialize-mutations.js +1 -1
- package/dist/verified-recall.js +10 -9
- package/dist/write-envelope.d.ts +1 -1
- package/package.json +2 -2
- package/src/access-observe-write-surface.ts +1 -1
- package/src/access-service-coding-write.test.ts +40 -0
- package/src/explicit-capture.test.ts +1110 -1
- package/src/explicit-capture.ts +534 -135
- package/src/maintenance/purge.test.ts +157 -1
- package/src/maintenance/purge.ts +15 -9
- package/src/orchestration/recall-internal-deps.ts +385 -0
- package/src/orchestration/recall-internal.ts +16 -375
- package/src/secure-store/secure-fs.ts +78 -1
- package/src/storage/content-hash-index.ts +43 -17
- package/src/storage/tombstone-blocked-capture-index.ts +562 -0
- package/src/storage/tombstone-blocked-capture-mutation.ts +284 -0
- package/src/storage/tombstone-blocked-capture-sync.ts +872 -0
- package/src/storage-fact-hash-index-defer.test.ts +2900 -57
- package/src/storage.ts +266 -265
- package/src/testing/subjects/tombstone-blocked-capture.test.ts +181 -0
- package/src/utils/serialize-mutations.test.ts +4 -1
- package/src/utils/serialize-mutations.ts +26 -27
- package/dist/chunk-55MDBZLC.js +0 -490
- package/dist/chunk-55MDBZLC.js.map +0 -1
- package/dist/chunk-AIK5W3IW.js.map +0 -1
- package/dist/chunk-FUYEVEX7.js.map +0 -1
- package/dist/chunk-JMQUBRV6.js.map +0 -1
- package/dist/chunk-WL5EBRDH.js.map +0 -1
- package/dist/purge-YSGX5BOG.js.map +0 -1
- /package/dist/{chunk-FZRQZW4H.js.map → chunk-2EUVEDF5.js.map} +0 -0
- /package/dist/{chunk-3JNDOAQ2.js.map → chunk-5W4ZLBEZ.js.map} +0 -0
- /package/dist/{chunk-5ZCUDWD4.js.map → chunk-62U4J2GN.js.map} +0 -0
- /package/dist/{chunk-IGPEJVBY.js.map → chunk-66772WBP.js.map} +0 -0
- /package/dist/{chunk-EP5BVCRI.js.map → chunk-6BNE62PM.js.map} +0 -0
- /package/dist/{chunk-AAP5T6QG.js.map → chunk-6DNMUYEE.js.map} +0 -0
- /package/dist/{chunk-35DL7IOI.js.map → chunk-6FUPCJUL.js.map} +0 -0
- /package/dist/{chunk-JP3YPDAW.js.map → chunk-6U7F52DE.js.map} +0 -0
- /package/dist/{chunk-E4OCKU67.js.map → chunk-7XC2HX75.js.map} +0 -0
- /package/dist/{chunk-OVRQLAYR.js.map → chunk-AZ5BTEKX.js.map} +0 -0
- /package/dist/{chunk-2AXMQWCN.js.map → chunk-CZRYLSSW.js.map} +0 -0
- /package/dist/{chunk-PTSNLEXK.js.map → chunk-FDAMS4PK.js.map} +0 -0
- /package/dist/{chunk-2GXM5N5A.js.map → chunk-GIBMDSJ2.js.map} +0 -0
- /package/dist/{chunk-E5OBR6CJ.js.map → chunk-H5CPS5JP.js.map} +0 -0
- /package/dist/{chunk-2D7FEUCK.js.map → chunk-I5NLEENJ.js.map} +0 -0
- /package/dist/{chunk-DRBXHRXE.js.map → chunk-IB26HVAJ.js.map} +0 -0
- /package/dist/{chunk-QDKK63Y7.js.map → chunk-IC6CBHCA.js.map} +0 -0
- /package/dist/{chunk-IAEAFLF2.js.map → chunk-JCBWCYEJ.js.map} +0 -0
- /package/dist/{chunk-3PDOVUHC.js.map → chunk-KXB4VXHY.js.map} +0 -0
- /package/dist/{chunk-WU7TTVOD.js.map → chunk-LBOD4U5B.js.map} +0 -0
- /package/dist/{chunk-UBKEQOTD.js.map → chunk-LGHKJABJ.js.map} +0 -0
- /package/dist/{chunk-VSURVXKY.js.map → chunk-M3C2V3PV.js.map} +0 -0
- /package/dist/{chunk-OFHFH655.js.map → chunk-MJCGLM25.js.map} +0 -0
- /package/dist/{chunk-OYJKSZIQ.js.map → chunk-NHWB6HG2.js.map} +0 -0
- /package/dist/{chunk-TC3VNKGX.js.map → chunk-NM2WP3B7.js.map} +0 -0
- /package/dist/{chunk-GAWOEQEQ.js.map → chunk-P5PXWTW7.js.map} +0 -0
- /package/dist/{chunk-2QMKMVHH.js.map → chunk-QNWXCJ76.js.map} +0 -0
- /package/dist/{chunk-WRFBW2TT.js.map → chunk-SPJXKAVF.js.map} +0 -0
- /package/dist/{chunk-HKJCMOT6.js.map → chunk-TH2LSRMG.js.map} +0 -0
- /package/dist/{chunk-CW4AGY3G.js.map → chunk-VI2JQPNQ.js.map} +0 -0
- /package/dist/{chunk-OP6F6L3S.js.map → chunk-W5EG6LE3.js.map} +0 -0
- /package/dist/{chunk-DEBHXHJR.js.map → chunk-WIPEXG6R.js.map} +0 -0
- /package/dist/{chunk-SH6YO3LT.js.map → chunk-WVO4G37W.js.map} +0 -0
- /package/dist/{chunk-7L45JFPW.js.map → chunk-YTQNQ4KB.js.map} +0 -0
- /package/dist/{chunk-PKRIQL3V.js.map → chunk-YTSNAUXN.js.map} +0 -0
- /package/dist/{chunk-5QDRGWT2.js.map → chunk-ZPSVBSOF.js.map} +0 -0
- /package/dist/{forget-HRPLVB3W.js.map → forget-4UY2EOKH.js.map} +0 -0
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tombstone-blocked-capture lifecycle subject for the scenario-matrix harness
|
|
3
|
+
* (issue #1993). Every row drives the real durable targeted index so coverage
|
|
4
|
+
* cannot be satisfied by mapping this stateful path to an unrelated subject.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import assert from "node:assert/strict";
|
|
8
|
+
import { readFile } from "node:fs/promises";
|
|
9
|
+
import path from "node:path";
|
|
10
|
+
|
|
11
|
+
import type { MemoryFile } from "../../types.js";
|
|
12
|
+
import { StorageManager } from "../../storage.js";
|
|
13
|
+
import { ContentHashIndex } from "../../storage/content-hash-index.js";
|
|
14
|
+
import { buildExplicitCaptureDedupKey } from "../../storage/tombstone-blocked-capture-index.js";
|
|
15
|
+
import { type LifecycleSubject, type MatrixRow, runLifecycleMatrix } from "../lifecycle-matrix.js";
|
|
16
|
+
import { cleanupDir, mkTempMemoryDir } from "../orchestrator-lite.js";
|
|
17
|
+
|
|
18
|
+
interface TombstoneLifecycleState {
|
|
19
|
+
readonly memoryDir: string;
|
|
20
|
+
readonly stateDir: string;
|
|
21
|
+
storage: StorageManager;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
async function readMemory(storage: StorageManager, id: string): Promise<MemoryFile> {
|
|
25
|
+
const memory = (await storage.readAllMemories()).find((entry) => entry.frontmatter.id === id);
|
|
26
|
+
assert.ok(memory, `expected persisted lifecycle memory ${id}`);
|
|
27
|
+
return memory;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
async function addBlocked(
|
|
31
|
+
state: TombstoneLifecycleState,
|
|
32
|
+
content: string,
|
|
33
|
+
sourceConnector: string | undefined
|
|
34
|
+
): Promise<MemoryFile> {
|
|
35
|
+
const result = await state.storage.writeMemory("fact", content, {
|
|
36
|
+
source: "explicit-inline-review",
|
|
37
|
+
confidence: 0.2,
|
|
38
|
+
tags: ["review"],
|
|
39
|
+
status: "pending_review",
|
|
40
|
+
contentHashSource: content,
|
|
41
|
+
...(sourceConnector === undefined ? {} : { sourceConnector }),
|
|
42
|
+
});
|
|
43
|
+
const pending = await readMemory(state.storage, result.id);
|
|
44
|
+
await state.storage.writeMemoryFrontmatter(pending, {
|
|
45
|
+
status: "pending_review",
|
|
46
|
+
blockedBy: "tombstone-1",
|
|
47
|
+
tombstoneBlockTier: "exact",
|
|
48
|
+
});
|
|
49
|
+
return await readMemory(state.storage, result.id);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
async function assertMembership(
|
|
53
|
+
state: TombstoneLifecycleState,
|
|
54
|
+
content: string,
|
|
55
|
+
sourceConnector: string | undefined,
|
|
56
|
+
expected: boolean
|
|
57
|
+
): Promise<void> {
|
|
58
|
+
const result = await state.storage.checkTombstoneBlockedExplicitCapture(content, "fact", sourceConnector);
|
|
59
|
+
assert.equal(result.has, expected);
|
|
60
|
+
assert.equal(result.authoritative, true, "a published index must answer authoritatively");
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const subject: LifecycleSubject<TombstoneLifecycleState> = {
|
|
64
|
+
async setup(row: MatrixRow): Promise<TombstoneLifecycleState> {
|
|
65
|
+
const memoryDir = await mkTempMemoryDir(`tombstone-${row.id}`);
|
|
66
|
+
try {
|
|
67
|
+
const stateDir = path.join(memoryDir, "state");
|
|
68
|
+
return {
|
|
69
|
+
memoryDir,
|
|
70
|
+
stateDir,
|
|
71
|
+
storage: new StorageManager(memoryDir),
|
|
72
|
+
};
|
|
73
|
+
} catch (err) {
|
|
74
|
+
await cleanupDir(memoryDir);
|
|
75
|
+
throw err;
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
async exercise(state: TombstoneLifecycleState, row: MatrixRow): Promise<void> {
|
|
79
|
+
const content = `The tombstone lifecycle row is ${row.id}.`;
|
|
80
|
+
switch (row.id) {
|
|
81
|
+
case "explicit-provider-identity":
|
|
82
|
+
await addBlocked(state, content, "openclaw");
|
|
83
|
+
return;
|
|
84
|
+
case "sparse-metadata-with-binding":
|
|
85
|
+
await addBlocked(state, content, undefined);
|
|
86
|
+
return;
|
|
87
|
+
case "sparse-metadata-without-binding":
|
|
88
|
+
await addBlocked(state, content, "remembered-provider");
|
|
89
|
+
return;
|
|
90
|
+
case "provider-rebinding": {
|
|
91
|
+
const before = await addBlocked(state, content, "provider-a");
|
|
92
|
+
await state.storage.writeMemoryFrontmatter(before, {
|
|
93
|
+
sourceConnector: "provider-b",
|
|
94
|
+
});
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
case "restart-reload-recovery": {
|
|
98
|
+
await addBlocked(state, content, "openclaw");
|
|
99
|
+
state.storage = new StorageManager(state.memoryDir);
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
case "compaction-flush":
|
|
103
|
+
await addBlocked(state, `${content} First.`, "openclaw");
|
|
104
|
+
await addBlocked(state, `${content} Second.`, "openclaw");
|
|
105
|
+
return;
|
|
106
|
+
case "before-reset": {
|
|
107
|
+
const before = await addBlocked(state, content, "openclaw");
|
|
108
|
+
await state.storage.writeMemoryFrontmatter(before, {
|
|
109
|
+
status: "active",
|
|
110
|
+
blockedBy: undefined,
|
|
111
|
+
tombstoneBlockTier: undefined,
|
|
112
|
+
});
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
case "session-end":
|
|
116
|
+
await addBlocked(state, content, "openclaw");
|
|
117
|
+
await state.storage.checkTombstoneBlockedExplicitCapture(content, "fact", "openclaw");
|
|
118
|
+
return;
|
|
119
|
+
case "dedupe-replay":
|
|
120
|
+
await addBlocked(state, content, "openclaw");
|
|
121
|
+
await addBlocked(state, content, "openclaw");
|
|
122
|
+
return;
|
|
123
|
+
default: {
|
|
124
|
+
const exhaustive: never = row.id;
|
|
125
|
+
throw new Error(`unhandled row ${String(exhaustive)}`);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
|
|
130
|
+
async invariants(state: TombstoneLifecycleState, row: MatrixRow): Promise<void> {
|
|
131
|
+
const content = `The tombstone lifecycle row is ${row.id}.`;
|
|
132
|
+
switch (row.id) {
|
|
133
|
+
case "explicit-provider-identity":
|
|
134
|
+
case "sparse-metadata-with-binding":
|
|
135
|
+
case "restart-reload-recovery":
|
|
136
|
+
case "session-end": {
|
|
137
|
+
const sourceConnector = row.id === "sparse-metadata-with-binding" ? undefined : "openclaw";
|
|
138
|
+
await assertMembership(state, content, sourceConnector, true);
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
case "sparse-metadata-without-binding":
|
|
142
|
+
await assertMembership(state, content, undefined, false);
|
|
143
|
+
await assertMembership(state, content, "remembered-provider", true);
|
|
144
|
+
return;
|
|
145
|
+
case "provider-rebinding":
|
|
146
|
+
await assertMembership(state, content, "provider-a", false);
|
|
147
|
+
await assertMembership(state, content, "provider-b", true);
|
|
148
|
+
return;
|
|
149
|
+
case "compaction-flush":
|
|
150
|
+
await assertMembership(state, `${content} First.`, "openclaw", true);
|
|
151
|
+
await assertMembership(state, `${content} Second.`, "openclaw", true);
|
|
152
|
+
return;
|
|
153
|
+
case "before-reset":
|
|
154
|
+
await assertMembership(state, content, "openclaw", false);
|
|
155
|
+
return;
|
|
156
|
+
case "dedupe-replay": {
|
|
157
|
+
await assertMembership(state, content, "openclaw", true);
|
|
158
|
+
const raw = await readFile(path.join(state.stateDir, "tombstone-blocked-capture", "fact-hashes.txt"), "utf8");
|
|
159
|
+
const keyHash = ContentHashIndex.computeHash(buildExplicitCaptureDedupKey(content, "fact", "openclaw"));
|
|
160
|
+
assert.equal(
|
|
161
|
+
raw
|
|
162
|
+
.trim()
|
|
163
|
+
.split("\n")
|
|
164
|
+
.filter((line) => line === keyHash).length,
|
|
165
|
+
1
|
|
166
|
+
);
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
default: {
|
|
170
|
+
const exhaustive: never = row.id;
|
|
171
|
+
throw new Error(`unhandled row ${String(exhaustive)}`);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
|
|
176
|
+
async teardown(state: TombstoneLifecycleState): Promise<void> {
|
|
177
|
+
await cleanupDir(state.memoryDir);
|
|
178
|
+
},
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
runLifecycleMatrix("tombstone-blocked-capture", subject);
|
|
@@ -851,17 +851,20 @@ test("withHeldFileLock runs task(false) best-effort when the lock directory cann
|
|
|
851
851
|
const lockPath = path.join(blocker, "nested.lock");
|
|
852
852
|
|
|
853
853
|
let acquired = true; // expect false
|
|
854
|
+
let failure: "timeout" | "error" | undefined;
|
|
854
855
|
let ran = false;
|
|
855
856
|
await withHeldFileLock(
|
|
856
857
|
lockPath,
|
|
857
858
|
{ staleMs: 5_000, maxWaitMs: 50 },
|
|
858
|
-
async (a) => {
|
|
859
|
+
async (a, lock) => {
|
|
859
860
|
acquired = a;
|
|
861
|
+
failure = lock.failure;
|
|
860
862
|
ran = true;
|
|
861
863
|
},
|
|
862
864
|
);
|
|
863
865
|
assert.equal(ran, true, "task ran despite lock-dir setup failure");
|
|
864
866
|
assert.equal(acquired, false, "task ran best-effort (acquired=false) without the lock");
|
|
867
|
+
assert.equal(failure, "error", "lock setup failures must be distinguishable from contention timeouts");
|
|
865
868
|
} finally {
|
|
866
869
|
await rm(dir, { recursive: true, force: true });
|
|
867
870
|
}
|
|
@@ -230,6 +230,12 @@ export interface HeldFileLockController {
|
|
|
230
230
|
* `false`) this always resolves `false` — there is no lock to hold.
|
|
231
231
|
*/
|
|
232
232
|
refresh(): Promise<boolean>;
|
|
233
|
+
/**
|
|
234
|
+
* Why the lock was not acquired. `timeout` means a busy peer consumed the
|
|
235
|
+
* bounded wait; `error` means acquisition failed due to filesystem setup or
|
|
236
|
+
* I/O and must not be retried as contention.
|
|
237
|
+
*/
|
|
238
|
+
readonly failure?: "timeout" | "error";
|
|
233
239
|
}
|
|
234
240
|
|
|
235
241
|
/** Default bounded acquisition wait, mirroring the catalog. */
|
|
@@ -249,6 +255,7 @@ interface HeldLock {
|
|
|
249
255
|
readonly path: string;
|
|
250
256
|
readonly ownerId: string;
|
|
251
257
|
}
|
|
258
|
+
type LockAcquisitionFailure = { readonly failure: "timeout" | "error" };
|
|
252
259
|
|
|
253
260
|
/**
|
|
254
261
|
* Run `task` under an exclusive on-disk lock at `lockPath`.
|
|
@@ -264,13 +271,11 @@ interface HeldLock {
|
|
|
264
271
|
* id / timestamp, so its content differs and is left untouched.
|
|
265
272
|
*
|
|
266
273
|
* `task` receives `acquired: boolean` — `true` when we hold the lock, `false`
|
|
267
|
-
* when acquisition
|
|
268
|
-
*
|
|
269
|
-
*
|
|
270
|
-
*
|
|
271
|
-
*
|
|
272
|
-
* ignores the flag is still assignable (`() => Promise<T>` ⊆
|
|
273
|
-
* `(acquired: boolean) => Promise<T>` in TypeScript).
|
|
274
|
+
* when acquisition is unavailable. The controller's `failure` field
|
|
275
|
+
* distinguishes a bounded busy-lock timeout from a permanent filesystem
|
|
276
|
+
* acquisition error.
|
|
277
|
+
* This explicit callback keeps the lock utility as the single lock home while
|
|
278
|
+
* allowing callers to choose their timeout and failure policy.
|
|
274
279
|
*
|
|
275
280
|
* Release is ownership-checked: we only `unlink` a lock whose content still
|
|
276
281
|
* identifies THIS acquirer (same owner id), so a replacement created after we
|
|
@@ -344,13 +349,11 @@ export async function withHeldFileLock<T>(
|
|
|
344
349
|
const ownerId = randomUUID();
|
|
345
350
|
const lockDir = path.dirname(lockPath);
|
|
346
351
|
|
|
347
|
-
const
|
|
348
|
-
if (
|
|
349
|
-
|
|
350
|
-
// do (the catalog touch path will drop its append); we never crash the
|
|
351
|
-
// primary op on contention.
|
|
352
|
-
return task(false, { refresh: async () => false });
|
|
352
|
+
const acquisition = await acquireLock(lockPath, lockDir, ownerId, opts, maxWaitMs, pollMs);
|
|
353
|
+
if ("failure" in acquisition) {
|
|
354
|
+
return task(false, { refresh: async () => false, failure: acquisition.failure });
|
|
353
355
|
}
|
|
356
|
+
const held = acquisition;
|
|
354
357
|
|
|
355
358
|
// Heartbeat: while WE hold the lock, refresh its mtime so age-based stale
|
|
356
359
|
// detection sees an active holder and does not break us out from under
|
|
@@ -437,10 +440,9 @@ function formatInvalidNumber(value: unknown): string {
|
|
|
437
440
|
}
|
|
438
441
|
|
|
439
442
|
/**
|
|
440
|
-
* Atomically create the lock file, looping until acquired
|
|
441
|
-
*
|
|
442
|
-
*
|
|
443
|
-
* crashing the guarded op, matching the catalog.
|
|
443
|
+
* Atomically create the lock file, looping until acquired or the bounded
|
|
444
|
+
* deadline. Reports `timeout` for a busy lock and `error` for permanent
|
|
445
|
+
* filesystem setup/I/O failures so callers can choose the safe policy.
|
|
444
446
|
*/
|
|
445
447
|
async function acquireLock(
|
|
446
448
|
lockPath: string,
|
|
@@ -449,15 +451,12 @@ async function acquireLock(
|
|
|
449
451
|
opts: HeldFileLockOptions,
|
|
450
452
|
maxWaitMs: number,
|
|
451
453
|
pollMs: number,
|
|
452
|
-
): Promise<HeldLock |
|
|
454
|
+
): Promise<HeldLock | LockAcquisitionFailure> {
|
|
453
455
|
try {
|
|
454
456
|
await mkdir(lockDir, { recursive: true });
|
|
455
457
|
} catch {
|
|
456
|
-
// Lock-directory setup failure
|
|
457
|
-
|
|
458
|
-
// lock contract is best-effort. Return undefined so task(false) runs
|
|
459
|
-
// instead of rejecting (codex P2 review).
|
|
460
|
-
return undefined;
|
|
458
|
+
// Lock-directory setup failure is a permanent acquisition error.
|
|
459
|
+
return { failure: "error" };
|
|
461
460
|
}
|
|
462
461
|
const deadline = Date.now() + maxWaitMs;
|
|
463
462
|
for (;;) {
|
|
@@ -486,18 +485,18 @@ async function acquireLock(
|
|
|
486
485
|
}
|
|
487
486
|
if (!wroteMeta) {
|
|
488
487
|
await unlink(lockPath).catch(() => undefined);
|
|
489
|
-
return
|
|
488
|
+
return { failure: "error" };
|
|
490
489
|
}
|
|
491
490
|
return { path: lockPath, ownerId };
|
|
492
491
|
} catch (err) {
|
|
493
492
|
if ((err as NodeJS.ErrnoException | undefined)?.code !== "EEXIST") {
|
|
494
|
-
// Unexpected
|
|
495
|
-
return
|
|
493
|
+
// Unexpected filesystem errors are permanent acquisition failures.
|
|
494
|
+
return { failure: "error" };
|
|
496
495
|
}
|
|
497
496
|
// Lock exists: break it if stale, then poll. breakStaleLock is
|
|
498
497
|
// replacement-safe (NG7Bg) and never throws.
|
|
499
498
|
await breakStaleLock(lockPath, opts.staleMs, opts.onBeforeBreakStaleUnlinkForTest);
|
|
500
|
-
if (Date.now() >= deadline) return
|
|
499
|
+
if (Date.now() >= deadline) return { failure: "timeout" };
|
|
501
500
|
// Cap the sleep to the remaining budget so a large pollMs cannot block
|
|
502
501
|
// acquisition far past maxWaitMs (e.g. maxWaitMs=1000, pollMs=60000
|
|
503
502
|
// would otherwise block ~60s instead of 1s — codex P2).
|