@remnic/core 9.45.2 → 9.45.4
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/abort-error.d.ts +2 -1
- package/dist/abort-error.js +3 -1
- package/dist/access-admin-ops-surface.d.ts +14 -10
- package/dist/access-admin-ops-surface.js +84 -76
- package/dist/access-audit.js +2 -2
- package/dist/access-authorization-probe.d.ts +14 -10
- package/dist/access-authorization-probe.js +85 -77
- package/dist/access-boundary.d.ts +15 -11
- package/dist/access-boundary.js +84 -76
- package/dist/access-citation-namespace.js +2 -2
- package/dist/access-cli.js +193 -181
- package/dist/access-cli.js.map +1 -1
- package/dist/access-coding-context-resolution.d.ts +16 -0
- package/dist/access-coding-context-resolution.js +13 -0
- package/dist/access-coding-context-resolution.js.map +1 -0
- package/dist/access-extraction-force-flush.d.ts +14 -10
- package/dist/access-extraction-force-flush.js +84 -76
- package/dist/access-health-types.d.ts +2 -1
- package/dist/access-http-lcm-compaction.d.ts +16 -12
- package/dist/access-http-lcm-compaction.js +3 -3
- package/dist/access-http-lifecycle-flush.d.ts +14 -10
- package/dist/access-http-lifecycle-flush.js +2 -2
- package/dist/access-http-offline-stream.d.ts +123 -0
- package/dist/access-http-offline-stream.js +10 -0
- package/dist/access-http-offline-stream.js.map +1 -0
- package/dist/access-http-query.js +84 -76
- package/dist/access-http.d.ts +15 -10
- package/dist/access-http.js +105 -92
- package/dist/access-identity-continuity-surface.d.ts +9 -8
- package/dist/access-identity-continuity-surface.js +84 -76
- package/dist/access-lcm-surface.d.ts +14 -10
- package/dist/access-lcm-surface.js +84 -76
- package/dist/access-mcp-output-schemas.js +1 -1
- package/dist/access-mcp.d.ts +14 -10
- package/dist/access-mcp.js +95 -83
- package/dist/access-memory-search-fanout.d.ts +3 -2
- package/dist/{access-namespace-preflight-5yZ4g6F8.d.ts → access-namespace-preflight-CWUDwB4M.d.ts} +1 -1
- package/dist/access-namespace-preflight.d.ts +4 -3
- package/dist/access-namespace-preflight.js +84 -76
- package/dist/access-observe-helpers.d.ts +1 -0
- package/dist/access-observe-helpers.js +1 -1
- package/dist/access-observe-write-surface.d.ts +16 -10
- package/dist/access-observe-write-surface.js +84 -76
- package/dist/access-offline-manifest.d.ts +104 -0
- package/dist/access-offline-manifest.js +45 -0
- package/dist/access-offline-manifest.js.map +1 -0
- package/dist/access-operations-batch.js +86 -78
- package/dist/access-operations.d.ts +18 -14
- package/dist/access-operations.js +91 -80
- package/dist/access-recall-concurrency.d.ts +16 -26
- package/dist/access-recall-concurrency.js +86 -77
- package/dist/access-recall-response.d.ts +18 -14
- package/dist/access-recall-response.js +84 -76
- package/dist/access-recall-surface.d.ts +29 -24
- package/dist/access-recall-surface.js +84 -76
- package/dist/access-schema.d.ts +84 -84
- package/dist/access-schema.js +3 -3
- package/dist/{access-service-CiJRsgAB.d.ts → access-service-CsU-ljFD.d.ts} +25 -16
- package/dist/access-service-helpers.d.ts +14 -10
- package/dist/access-service.d.ts +14 -10
- package/dist/access-service.js +84 -76
- package/dist/access-surface-catalog.d.ts +14 -10
- package/dist/access-surface-catalog.js +4 -0
- package/dist/access-surface-catalog.js.map +1 -1
- package/dist/access-wearables-meetings-surface.d.ts +4 -3
- package/dist/action-confidence.d.ts +2 -1
- package/dist/active-memory-bridge.d.ts +2 -1
- package/dist/active-recall.d.ts +2 -1
- package/dist/active-recall.js +10 -8
- package/dist/active-recall.js.map +1 -1
- package/dist/adapters/index.js +7 -7
- package/dist/adapters/registry.js +3 -3
- package/dist/{auto-sync-5OE5QOZB.js → auto-sync-UPTUVE4X.js} +6 -6
- package/dist/behavior-learner.d.ts +2 -1
- package/dist/behavior-learner.js +1 -1
- package/dist/behavior-signals.d.ts +2 -1
- package/dist/bootstrap.d.ts +9 -8
- package/dist/briefing.d.ts +3 -2
- package/dist/briefing.js +23 -22
- package/dist/buffer-surprise-report.d.ts +2 -1
- package/dist/buffer-turn-helpers.d.ts +2 -1
- package/dist/buffer.d.ts +3 -2
- package/dist/buffer.js +12 -11
- package/dist/bulk-import/index.d.ts +4 -3
- package/dist/calibration.d.ts +2 -1
- package/dist/capabilities.d.ts +2 -1
- package/dist/{capsule-merge-IDWJPCWK.js → capsule-merge-Q6AR3XL7.js} +67 -54
- package/dist/capsule-merge-Q6AR3XL7.js.map +1 -0
- package/dist/{catalog-scBmy0sO.d.ts → catalog-bctMURhN.d.ts} +1 -1
- package/dist/causal-behavior.d.ts +2 -1
- package/dist/causal-behavior.js +2 -2
- package/dist/causal-chain.js +2 -2
- package/dist/causal-consolidation.d.ts +2 -1
- package/dist/causal-consolidation.js +27 -26
- package/dist/causal-consolidation.js.map +1 -1
- package/dist/causal-retrieval.js +2 -2
- package/dist/causal-trajectory-graph.d.ts +2 -1
- package/dist/causal-trajectory.js +1 -1
- package/dist/{chunk-VUPTKTDV.js → chunk-2MRHJNWL.js} +3 -3
- package/dist/{chunk-JBPKEARU.js → chunk-2QSZNTDO.js} +7 -7
- package/dist/{chunk-5IVLTFOV.js → chunk-44N6ESJ4.js} +2 -2
- package/dist/{chunk-WOCNN776.js → chunk-4POAMKV6.js} +100 -41
- package/dist/chunk-4POAMKV6.js.map +1 -0
- package/dist/{chunk-HO3QBJEY.js → chunk-5546W5SI.js} +2 -2
- package/dist/{chunk-U7GW7NE7.js → chunk-5CEECY6P.js} +10 -10
- package/dist/{chunk-4UH4BTGK.js → chunk-5SNZSWWR.js} +82 -82
- package/dist/{chunk-6CZPDBJS.js → chunk-5U7ID3EZ.js} +3 -3
- package/dist/{chunk-GF22HWS2.js → chunk-6NNNURLK.js} +7 -7
- package/dist/chunk-773TRRGT.js +36 -0
- package/dist/chunk-773TRRGT.js.map +1 -0
- package/dist/chunk-7CITSYSH.js +242 -0
- package/dist/chunk-7CITSYSH.js.map +1 -0
- package/dist/{chunk-227UFSEQ.js → chunk-7RZJWZ46.js} +5 -5
- package/dist/{chunk-E5UK4VPE.js → chunk-7SHJHPTY.js} +5 -5
- package/dist/{chunk-UVIKWC7M.js → chunk-7YERSTN7.js} +17 -17
- package/dist/{chunk-DLVPUX7U.js → chunk-7YKVM5H3.js} +8 -6
- package/dist/chunk-7YKVM5H3.js.map +1 -0
- package/dist/{chunk-3CE77VAP.js → chunk-A4JMGKCD.js} +87 -74
- package/dist/chunk-A4JMGKCD.js.map +1 -0
- package/dist/chunk-A5KNZSNA.js +26 -0
- package/dist/chunk-A5KNZSNA.js.map +1 -0
- package/dist/{chunk-S2NCTZGJ.js → chunk-AJQ57VV3.js} +15 -15
- package/dist/chunk-AJQ57VV3.js.map +1 -0
- package/dist/{chunk-CUM2BBPN.js → chunk-AUMWZSE7.js} +19 -10
- package/dist/chunk-AUMWZSE7.js.map +1 -0
- package/dist/{chunk-XYTOI63Z.js → chunk-BGHFOD5A.js} +19 -11
- package/dist/chunk-BGHFOD5A.js.map +1 -0
- package/dist/{chunk-BUE5E2HL.js → chunk-BGLY7EEM.js} +5 -314
- package/dist/chunk-BGLY7EEM.js.map +1 -0
- package/dist/chunk-BIPBQQFI.js +44 -0
- package/dist/chunk-BIPBQQFI.js.map +1 -0
- package/dist/{chunk-S5SLVSVY.js → chunk-BQIFZ2MP.js} +5 -5
- package/dist/chunk-BTTPKDIL.js +34 -0
- package/dist/{chunk-PVGDJXVK.js.map → chunk-BTTPKDIL.js.map} +1 -1
- package/dist/{chunk-E53DSZEN.js → chunk-C26TE27X.js} +3 -3
- package/dist/{chunk-LZ4LDKHZ.js → chunk-CLB32OHM.js} +6 -6
- package/dist/{chunk-Q6IP2ARR.js → chunk-CSOYVTRX.js} +2 -2
- package/dist/{chunk-XOQSEF7X.js → chunk-CVILPI77.js} +6 -6
- package/dist/chunk-D3I2MCN7.js +29 -0
- package/dist/chunk-D3I2MCN7.js.map +1 -0
- package/dist/{chunk-A5OJCXZL.js → chunk-DSUAAZZX.js} +15 -4
- package/dist/chunk-DSUAAZZX.js.map +1 -0
- package/dist/{chunk-HREE4JHI.js → chunk-DYVMXPCF.js} +486 -287
- package/dist/chunk-DYVMXPCF.js.map +1 -0
- package/dist/{chunk-J7VGGECD.js → chunk-DZPFMQZ7.js} +1 -1
- package/dist/chunk-DZPFMQZ7.js.map +1 -0
- package/dist/{chunk-PDLBLTOK.js → chunk-EITZHSX6.js} +9 -9
- package/dist/{chunk-D3J5SLQK.js → chunk-EJHEWCGQ.js} +81 -20
- package/dist/chunk-EJHEWCGQ.js.map +1 -0
- package/dist/{chunk-WUNIWKY4.js → chunk-ELIL2A37.js} +6 -6
- package/dist/{chunk-E6PNLPGJ.js → chunk-FZP32336.js} +806 -470
- package/dist/chunk-FZP32336.js.map +1 -0
- package/dist/{chunk-4L6HUREQ.js → chunk-G7A5HLUS.js} +23 -17
- package/dist/chunk-G7A5HLUS.js.map +1 -0
- package/dist/{chunk-CINZGPSJ.js → chunk-GUMZC2BO.js} +2 -2
- package/dist/{chunk-H24WNPA2.js → chunk-GWFSVJ4P.js} +3 -3
- package/dist/{chunk-7XC2HX75.js → chunk-GYPQL6XN.js} +157 -16
- package/dist/chunk-GYPQL6XN.js.map +1 -0
- package/dist/{chunk-TSH56VPU.js → chunk-HAYSYUAB.js} +2 -2
- package/dist/{chunk-TDHTVMPG.js → chunk-HFPASSFV.js} +7 -2
- package/dist/chunk-HFPASSFV.js.map +1 -0
- package/dist/chunk-J2WC5LF4.js +395 -0
- package/dist/chunk-J2WC5LF4.js.map +1 -0
- package/dist/{chunk-PKNLM44P.js → chunk-JH6BPLOP.js} +9 -9
- package/dist/{chunk-KXB4VXHY.js → chunk-JIYDRBVZ.js} +2 -2
- package/dist/chunk-JV3C2MNQ.js +74 -0
- package/dist/chunk-JV3C2MNQ.js.map +1 -0
- package/dist/{chunk-AV5ZEH4M.js → chunk-KVJRXN2E.js} +2 -2
- package/dist/{chunk-JVLCVFQ4.js → chunk-KXEFRMCF.js} +3 -3
- package/dist/{chunk-WFTIGIIS.js → chunk-L6CQ7WIW.js} +5 -5
- package/dist/{chunk-EJUEXZHX.js → chunk-LLJMAULE.js} +2 -2
- package/dist/{chunk-N5Z4EVOR.js → chunk-LNEWDF2A.js} +36 -11
- package/dist/chunk-LNEWDF2A.js.map +1 -0
- package/dist/{chunk-AS7YMSL6.js → chunk-M23RF3LJ.js} +4 -4
- package/dist/{chunk-UYLMNVY6.js → chunk-MDISBSYA.js} +16 -9
- package/dist/chunk-MDISBSYA.js.map +1 -0
- package/dist/{chunk-3F2LKUMU.js → chunk-NIS256NW.js} +2 -2
- package/dist/{chunk-YIAA2X3D.js → chunk-NK5RGJ65.js} +3 -3
- package/dist/chunk-NLDVVWCL.js +84 -0
- package/dist/chunk-NLDVVWCL.js.map +1 -0
- package/dist/{chunk-OQ5PRDDS.js → chunk-NTOIP2E6.js} +6 -6
- package/dist/{chunk-HLPD7B7P.js → chunk-NUEQKLNB.js} +2 -2
- package/dist/{chunk-4J7G5SY4.js → chunk-NZBZ7IS2.js} +72 -24
- package/dist/chunk-NZBZ7IS2.js.map +1 -0
- package/dist/{chunk-3TBLDMJA.js → chunk-O4KMGRXE.js} +5 -2
- package/dist/chunk-O4KMGRXE.js.map +1 -0
- package/dist/{chunk-33PLLLL7.js → chunk-P7NGM24P.js} +6 -6
- package/dist/{chunk-7TWUCYER.js → chunk-PNRA7FAD.js} +7 -7
- package/dist/{chunk-5I4M26Q7.js → chunk-QBSFOKY6.js} +4 -4
- package/dist/{chunk-QJAQNXWI.js → chunk-QCECHYZL.js} +76 -79
- package/dist/chunk-QCECHYZL.js.map +1 -0
- package/dist/{chunk-P4DRWEYC.js → chunk-QVSBTCVP.js} +2 -2
- package/dist/{chunk-AAIUERNB.js → chunk-R5RFK3CB.js} +6 -6
- package/dist/{chunk-WDISJRMG.js → chunk-RMMVQQA6.js} +2 -2
- package/dist/{chunk-KWMXR7XS.js → chunk-S2V7RUCL.js} +8 -1
- package/dist/{chunk-KWMXR7XS.js.map → chunk-S2V7RUCL.js.map} +1 -1
- package/dist/{chunk-5SM35XZR.js → chunk-S5NZBKKQ.js} +2 -2
- package/dist/{chunk-VNA7W7QF.js → chunk-SVH57F5Z.js} +12 -4
- package/dist/chunk-SVH57F5Z.js.map +1 -0
- package/dist/{chunk-WIPEXG6R.js → chunk-SXIMQLGV.js} +2 -2
- package/dist/{chunk-RVLJEII5.js → chunk-SYUBB3WM.js} +256 -187
- package/dist/chunk-SYUBB3WM.js.map +1 -0
- package/dist/{chunk-OAEQLRCY.js → chunk-TN76AKO3.js} +5 -5
- package/dist/{chunk-QN25OCUF.js → chunk-TQ4GD737.js} +5 -5
- package/dist/{chunk-VCD4PSK2.js → chunk-TQZ4DVBC.js} +7 -4
- package/dist/chunk-TQZ4DVBC.js.map +1 -0
- package/dist/{chunk-7K5Q6COX.js → chunk-TVVEYCNW.js} +4 -4
- package/dist/{chunk-DNWXFTLD.js → chunk-TYISDI6B.js} +2 -2
- package/dist/{chunk-4LMA77JH.js → chunk-U2VLVBBH.js} +3 -3
- package/dist/{chunk-5ZE7QHTK.js → chunk-ULVR5KG7.js} +5 -5
- package/dist/{chunk-NVRYW264.js → chunk-UQWIKLQK.js} +18 -15
- package/dist/chunk-UQWIKLQK.js.map +1 -0
- package/dist/{chunk-YV32N67O.js → chunk-URS5GSM7.js} +1 -1
- package/dist/chunk-URS5GSM7.js.map +1 -0
- package/dist/{chunk-4B77XSG5.js → chunk-UV72DEZD.js} +5 -5
- package/dist/{chunk-S2BBISHU.js → chunk-VANZKHTN.js} +3 -3
- package/dist/chunk-VHFXP27N.js +250 -0
- package/dist/chunk-VHFXP27N.js.map +1 -0
- package/dist/{chunk-3Y224NYC.js → chunk-VYISFWVX.js} +2 -2
- package/dist/{chunk-TIHMZFIV.js → chunk-W3IC7QOY.js} +3 -3
- package/dist/{chunk-NRV4Y3PM.js → chunk-W4FBGYGK.js} +1 -1
- package/dist/{chunk-P2BM76KT.js → chunk-WAS4HV46.js} +174 -43
- package/dist/chunk-WAS4HV46.js.map +1 -0
- package/dist/{chunk-57QKLRBV.js → chunk-WB7JSQCP.js} +2 -1
- package/dist/chunk-WB7JSQCP.js.map +1 -0
- package/dist/chunk-WGP57SR3.js +68 -0
- package/dist/chunk-WGP57SR3.js.map +1 -0
- package/dist/{chunk-ECK75GDJ.js → chunk-WQIHRA5F.js} +43 -24
- package/dist/chunk-WQIHRA5F.js.map +1 -0
- package/dist/{chunk-MU7ZHSZE.js → chunk-WZFAPHIK.js} +2 -2
- package/dist/{chunk-T2TTP3KU.js → chunk-X4IDNPOS.js} +2 -2
- package/dist/{chunk-BLAKS3CP.js → chunk-XL3TATMJ.js} +3 -3
- package/dist/{chunk-W4XJFLAL.js → chunk-XPRJSHNI.js} +2 -2
- package/dist/{chunk-5TFP4CUL.js → chunk-XQ3HXAQH.js} +14 -11
- package/dist/chunk-XQ3HXAQH.js.map +1 -0
- package/dist/{chunk-VWAXN2BN.js → chunk-XSFHWBQO.js} +93 -31
- package/dist/chunk-XSFHWBQO.js.map +1 -0
- package/dist/{chunk-DL7ZD3JH.js → chunk-XTAUXTDO.js} +14 -9
- package/dist/chunk-XTAUXTDO.js.map +1 -0
- package/dist/{chunk-JE7EK33X.js → chunk-Y7HRYCNW.js} +2 -2
- package/dist/{chunk-E6EE5B67.js → chunk-YK6BDDHP.js} +4 -4
- package/dist/{chunk-ES36HTSC.js → chunk-YLHM5BQQ.js} +3 -3
- package/dist/{chunk-RN7DY3FC.js → chunk-YMAQDHQM.js} +31 -12
- package/dist/chunk-YMAQDHQM.js.map +1 -0
- package/dist/{chunk-ULARSG5Z.js → chunk-YN6ASZUG.js} +10 -8
- package/dist/{chunk-ULARSG5Z.js.map → chunk-YN6ASZUG.js.map} +1 -1
- package/dist/{chunk-IKKWIPYN.js → chunk-YYQAKIDJ.js} +37 -1
- package/dist/chunk-YYQAKIDJ.js.map +1 -0
- package/dist/{chunk-BJKPPZ6Z.js → chunk-ZFGZ6PZ2.js} +2 -2
- package/dist/{chunk-CJ2ZR7UA.js → chunk-ZI32MKDW.js} +267 -214
- package/dist/chunk-ZI32MKDW.js.map +1 -0
- package/dist/{chunk-64UDOIMI.js → chunk-ZLQ37WJX.js} +2 -2
- package/dist/chunk-ZMAYKGPN.js +351 -0
- package/dist/chunk-ZMAYKGPN.js.map +1 -0
- package/dist/{cli-BUGN3d6_.d.ts → cli-BBHDtG36.d.ts} +5 -5
- package/dist/cli.d.ts +16 -12
- package/dist/cli.js +138 -124
- package/dist/compounding/engine.d.ts +3 -2
- package/dist/compounding/engine.js +24 -23
- package/dist/compounding/preference-consolidator.d.ts +2 -1
- package/dist/compression-optimizer.d.ts +2 -1
- package/dist/config.d.ts +2 -1
- package/dist/config.js +10 -8
- package/dist/connectors/codex-materialize-runner.d.ts +2 -1
- package/dist/connectors/codex-materialize-runner.js +23 -22
- package/dist/connectors/codex-materialize.d.ts +2 -1
- package/dist/connectors/index.d.ts +2 -1
- package/dist/connectors/index.js +26 -25
- package/dist/consolidation-provenance-check.d.ts +3 -2
- package/dist/consolidation-provenance-check.js +4 -4
- package/dist/consolidation-undo.d.ts +3 -2
- package/dist/consolidation-undo.js +10 -7
- package/dist/consolidation-undo.js.map +1 -1
- package/dist/contradiction/index.d.ts +3 -2
- package/dist/converge-config.d.ts +2 -1
- package/dist/convergence-refresh.d.ts +4 -3
- package/dist/convergence-refresh.js +27 -26
- package/dist/conversation-index/backend.d.ts +2 -1
- package/dist/conversation-index/backend.js +2 -2
- package/dist/conversation-index/chunker.d.ts +2 -1
- package/dist/conversation-index/faiss-adapter.d.ts +2 -1
- package/dist/conversation-index/indexer.d.ts +2 -1
- package/dist/conversation-index/search.d.ts +2 -1
- package/dist/corpus-watermark.d.ts +2 -1
- package/dist/corpus-watermark.js +42 -41
- package/dist/day-summary.d.ts +2 -1
- package/dist/delinearize.d.ts +2 -1
- package/dist/direct-answer-wiring.d.ts +2 -1
- package/dist/direct-answer-wiring.js +2 -2
- package/dist/direct-answer.d.ts +2 -1
- package/dist/embedding-fallback.d.ts +2 -1
- package/dist/embedding-fallback.js +2 -2
- package/dist/enrichment/index.d.ts +2 -1
- package/dist/entity-retrieval-boundaries.js +1 -1
- package/dist/entity-retrieval.d.ts +3 -2
- package/dist/entity-retrieval.js +24 -23
- package/dist/entity-schema.d.ts +2 -1
- package/dist/explicit-capture.d.ts +9 -8
- package/dist/explicit-capture.js +11 -9
- package/dist/external-wiki-access.d.ts +127 -0
- package/dist/external-wiki-access.js +186 -0
- package/dist/external-wiki-access.js.map +1 -0
- package/dist/external-wiki-cli.d.ts +13 -0
- package/dist/external-wiki-cli.js +96 -0
- package/dist/external-wiki-cli.js.map +1 -0
- package/dist/external-wiki-collection-registration.d.ts +39 -0
- package/dist/external-wiki-collection-registration.js +79 -0
- package/dist/external-wiki-collection-registration.js.map +1 -0
- package/dist/external-wiki-collection.d.ts +50 -0
- package/dist/external-wiki-collection.js +387 -0
- package/dist/external-wiki-collection.js.map +1 -0
- package/dist/external-wiki-config.d.ts +13 -0
- package/dist/external-wiki-config.js +13 -0
- package/dist/external-wiki-config.js.map +1 -0
- package/dist/external-wiki-guard.d.ts +11 -0
- package/dist/external-wiki-guard.js +18 -0
- package/dist/external-wiki-guard.js.map +1 -0
- package/dist/external-wiki-mcp-tools.d.ts +123 -0
- package/dist/external-wiki-mcp-tools.js +8 -0
- package/dist/external-wiki-mcp-tools.js.map +1 -0
- package/dist/external-wiki-search.d.ts +42 -0
- package/dist/external-wiki-search.js +11 -0
- package/dist/external-wiki-search.js.map +1 -0
- package/dist/external-wiki.d.ts +43 -0
- package/dist/external-wiki.js +16 -0
- package/dist/external-wiki.js.map +1 -0
- package/dist/extraction-error-classification.d.ts +2 -1
- package/dist/extraction-faithfulness.d.ts +2 -1
- package/dist/extraction-judge-telemetry.d.ts +2 -1
- package/dist/extraction-judge-training.d.ts +2 -1
- package/dist/extraction-judge.d.ts +2 -1
- package/dist/extraction-liveness.d.ts +2 -1
- package/dist/extraction-source-grounding-helpers.d.ts +5 -3
- package/dist/extraction-source-grounding-helpers.js +1 -1
- package/dist/extraction-source-grounding-rules.d.ts +2 -1
- package/dist/extraction-source-grounding-rules.js +2 -2
- package/dist/extraction-source-grounding.d.ts +2 -1
- package/dist/extraction-source-grounding.js +5 -5
- package/dist/extraction.d.ts +2 -1
- package/dist/extraction.js +45 -43
- package/dist/fallback-llm.d.ts +2 -1
- package/dist/graph-dashboard-diff.d.ts +2 -1
- package/dist/graph-dashboard-key.d.ts +2 -1
- package/dist/graph-dashboard-parser.d.ts +2 -1
- package/dist/graph-edge-reinforcement.d.ts +2 -1
- package/dist/graph-snapshot.d.ts +2 -1
- package/dist/graph.d.ts +2 -1
- package/dist/harmonic-retrieval.js +2 -2
- package/dist/importance.d.ts +2 -1
- package/dist/importers/index.d.ts +2 -1
- package/dist/in-flight-reads.d.ts +2 -1
- package/dist/index.d.ts +732 -720
- package/dist/index.js +291 -259
- package/dist/intent.d.ts +2 -1
- package/dist/lcm/engine.d.ts +2 -1
- package/dist/lcm/engine.js +3 -3
- package/dist/lcm/index.d.ts +2 -1
- package/dist/lcm/index.js +8 -8
- package/dist/lcm/tools.d.ts +2 -1
- package/dist/lifecycle.d.ts +2 -1
- package/dist/live-connectors-runner.d.ts +2 -1
- package/dist/local-llm.d.ts +2 -1
- package/dist/local-llm.js +2 -2
- package/dist/local-model-endpoint.d.ts +2 -1
- package/dist/maintenance/memory-governance.d.ts +2 -1
- package/dist/maintenance/memory-governance.js +24 -23
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.d.ts +3 -2
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +24 -23
- package/dist/maintenance/rebuild-memory-projection.d.ts +3 -2
- package/dist/maintenance/rebuild-memory-projection.js +26 -25
- package/dist/{maintenance-LbuS2rUA.d.ts → maintenance-D2mveyCd.d.ts} +3 -3
- package/dist/mcp-memory-inspector-app.d.ts +14 -10
- package/dist/mcp-read-only-tools.js +1 -1
- package/dist/memory-action-policy.d.ts +2 -1
- package/dist/memory-cache.d.ts +2 -1
- package/dist/memory-lifecycle-ledger-utils.d.ts +2 -1
- package/dist/memory-projection-store.d.ts +2 -1
- package/dist/memory-provenance.d.ts +2 -1
- package/dist/memory-worth-outcomes.d.ts +3 -2
- package/dist/models-json.d.ts +2 -1
- package/dist/namespaces/migrate.d.ts +4 -3
- package/dist/namespaces/migrate.js +40 -39
- package/dist/namespaces/principal.d.ts +2 -1
- package/dist/namespaces/search.d.ts +2 -1
- package/dist/namespaces/search.js +18 -18
- package/dist/namespaces/storage.d.ts +4 -3
- package/dist/namespaces/storage.js +23 -22
- package/dist/native-knowledge.d.ts +2 -1
- package/dist/offline-sync-impression-drain.d.ts +2 -1
- package/dist/offline-sync-impression-drain.js +11 -9
- package/dist/offline-sync.d.ts +29 -3
- package/dist/offline-sync.js +6 -2
- package/dist/operator-doctor-corpus.d.ts +2 -1
- package/dist/operator-doctor-corpus.js +45 -44
- package/dist/operator-doctor-replica.d.ts +2 -1
- package/dist/operator-doctor-replica.js +3 -3
- package/dist/operator-toolkit.d.ts +4 -3
- package/dist/operator-toolkit.js +59 -55
- package/dist/orchestration/compression-guideline-coordinator.d.ts +3 -2
- package/dist/orchestration/maintenance.d.ts +5 -4
- package/dist/orchestration/maintenance.js +36 -33
- package/dist/{orchestrator-rHiWt32X.d.ts → orchestrator-DJYlwiUv.d.ts} +14 -7
- package/dist/orchestrator.d.ts +9 -8
- package/dist/orchestrator.js +201 -189
- package/dist/page-versioning.js +3 -3
- package/dist/patterns-cli.d.ts +2 -1
- package/dist/{pipeline-W_97O8BV.d.ts → pipeline-CNjY4wk3.d.ts} +1 -1
- package/dist/policy-runtime.d.ts +2 -1
- package/dist/policy-runtime.js +1 -1
- package/dist/proactive-contention.d.ts +2 -1
- package/dist/provenance.d.ts +2 -1
- package/dist/provenance.js +2 -2
- package/dist/{qmd-LWtMofAf.d.ts → qmd-C0UDZidt.d.ts} +9 -7
- package/dist/qmd-preflight.d.ts +5 -4
- package/dist/qmd-preflight.js +2 -2
- package/dist/qmd-recall-cache.d.ts +2 -1
- package/dist/qmd.d.ts +4 -3
- package/dist/qmd.js +5 -5
- package/dist/recall-concurrency-config.d.ts +2 -1
- package/dist/recall-disclosure-escalation.d.ts +2 -1
- package/dist/recall-explain-renderer.d.ts +2 -1
- package/dist/recall-explain-renderer.js +3 -3
- package/dist/recall-memory-map.d.ts +2 -1
- package/dist/recall-planner-llm.d.ts +2 -1
- package/dist/recall-state.d.ts +2 -1
- package/dist/recall-tag-filter.d.ts +2 -1
- package/dist/recall-timings.d.ts +2 -1
- package/dist/recall-xray-cli.d.ts +2 -1
- package/dist/recall-xray-cli.js +4 -4
- package/dist/recall-xray-renderer.d.ts +2 -1
- package/dist/recall-xray-renderer.js +3 -3
- package/dist/recall-xray.d.ts +8 -1
- package/dist/recall-xray.js +2 -2
- package/dist/reconcile/cursor.d.ts +12 -2
- package/dist/reconcile/cursor.js +46 -7
- package/dist/reconcile/cursor.js.map +1 -1
- package/dist/reconcile/manifest.d.ts +9 -2
- package/dist/reconcile/manifest.js +15 -268
- package/dist/reconcile/manifest.js.map +1 -1
- package/dist/reconcile/plan.d.ts +6 -2
- package/dist/reconcile/plan.js +4 -4
- package/dist/replay/normalizers/chatgpt.d.ts +2 -1
- package/dist/replay/normalizers/claude.d.ts +2 -1
- package/dist/replay/normalizers/openclaw.d.ts +2 -1
- package/dist/replay/normalizers/shared.d.ts +2 -1
- package/dist/replay/runner.d.ts +2 -1
- package/dist/replay/types.d.ts +2 -1
- package/dist/replica-divergence.d.ts +2 -1
- package/dist/replica-divergence.js +2 -2
- package/dist/replica-peers-config.d.ts +2 -1
- package/dist/resolve-auth-token.d.ts +2 -1
- package/dist/resume-bundles.js +12 -10
- package/dist/retrieval-agents.d.ts +4 -3
- package/dist/retrieval-agents.js +2 -2
- package/dist/retrieval-tiers.d.ts +2 -1
- package/dist/routing/engine.d.ts +2 -1
- package/dist/routing/store.d.ts +2 -1
- package/dist/salvage-envelope.d.ts +2 -1
- package/dist/schemas.d.ts +76 -76
- package/dist/{scope-profiles-BiQKOE-p.d.ts → scope-profiles-BJzp2F5A.d.ts} +1 -1
- package/dist/search/embed-helper.d.ts +2 -1
- package/dist/search/embed-helper.js +3 -3
- package/dist/search/factory.d.ts +4 -2
- package/dist/search/factory.js +20 -18
- package/dist/search/index.d.ts +2 -1
- package/dist/search/index.js +22 -22
- package/dist/search/lancedb-backend.d.ts +2 -1
- package/dist/search/lancedb-backend.js +4 -4
- package/dist/search/meilisearch-backend.d.ts +2 -1
- package/dist/search/meilisearch-backend.js +4 -4
- package/dist/search/noop-backend.d.ts +2 -1
- package/dist/search/orama-backend.d.ts +2 -1
- package/dist/search/orama-backend.js +4 -4
- package/dist/search/port.d.ts +18 -1
- package/dist/search/port.js +1 -1
- package/dist/search/remote-backend.d.ts +2 -1
- package/dist/search/remote-backend.js +2 -2
- package/dist/secure-store/index.js +2 -2
- package/dist/{semantic-consolidation-dHYCyqgh.d.ts → semantic-consolidation-D4KAZO2G.d.ts} +1 -1
- package/dist/semantic-consolidation.d.ts +3 -2
- package/dist/semantic-consolidation.js +25 -24
- package/dist/semantic-rule-promotion.js +23 -22
- package/dist/semantic-rule-verifier.d.ts +2 -1
- package/dist/semantic-rule-verifier.js +24 -23
- package/dist/{service-DJG3KCQ4.d.ts → service-BeDxSqE-.d.ts} +2 -2
- package/dist/session-observer-bands.d.ts +2 -1
- package/dist/session-observer-state.d.ts +2 -1
- package/dist/shared-context/manager.d.ts +10 -9
- package/dist/shared-context/manager.js +2 -2
- package/dist/signal.d.ts +2 -1
- package/dist/source-agent-qualifier.d.ts +2 -1
- package/dist/source-agent-qualifier.js +42 -40
- package/dist/{storage-F9FVh-w9.d.ts → storage-DfjxusTE.d.ts} +24 -12
- package/dist/storage.d.ts +3 -2
- package/dist/storage.js +25 -24
- package/dist/summarizer.d.ts +2 -1
- package/dist/summarizer.js +5 -5
- package/dist/summary-snapshot.d.ts +2 -1
- package/dist/temporal-supersession.d.ts +3 -2
- package/dist/temporal-timeline-recall.d.ts +2 -1
- package/dist/temporal-validity.d.ts +2 -1
- package/dist/threading.d.ts +2 -1
- package/dist/tier-migration.d.ts +3 -2
- package/dist/tier-routing.d.ts +2 -1
- package/dist/tool-scoped-memory.d.ts +5 -1
- package/dist/tool-scoped-memory.js +3 -1
- package/dist/topics.d.ts +2 -1
- package/dist/transcript.d.ts +2 -1
- package/dist/transfer/capsule-import.js +4 -4
- package/dist/transfer/types.d.ts +66 -66
- package/dist/trust-score-stage.d.ts +2 -1
- package/dist/trust-score.d.ts +2 -1
- package/dist/{types-rEwubvim.d.ts → types-yX_FwERf.d.ts} +8 -1
- package/dist/types.d.ts +2 -1
- package/dist/types.js +1 -1
- package/dist/utility-runtime.d.ts +2 -1
- package/dist/verified-recall.js +24 -23
- package/dist/write-envelope.d.ts +2 -1
- package/package.json +2 -2
- package/src/abort-error.ts +17 -0
- package/src/access-admin-ops-surface.ts +1 -0
- package/src/access-boundary.ts +1 -0
- package/src/access-coding-context-resolution.ts +42 -0
- package/src/access-extraction-force-flush.ts +38 -2
- package/src/access-http-lcm-compaction.ts +5 -2
- package/src/access-http-offline-stream.ts +79 -0
- package/src/access-http.test.ts +310 -3
- package/src/access-http.ts +85 -21
- package/src/access-mcp-output-schemas.ts +36 -0
- package/src/access-mcp.test.ts +95 -1
- package/src/access-mcp.ts +7 -9
- package/src/access-observe-helpers.ts +64 -22
- package/src/access-observe-write-surface.ts +8 -0
- package/src/access-offline-manifest.ts +54 -0
- package/src/access-operations-batch.ts +3 -3
- package/src/access-operations.ts +13 -7
- package/src/access-recall-concurrency.ts +3 -27
- package/src/access-recall-surface.ts +3 -0
- package/src/access-service-health.test.ts +32 -7
- package/src/access-service-namespace.test.ts +55 -0
- package/src/access-service-observe-idempotency.test.ts +34 -2
- package/src/access-service-observe-lcm-parity.test.ts +138 -3
- package/src/access-service-observe-scope.test.ts +160 -1
- package/src/access-service-offline-file-content.test.ts +345 -1
- package/src/access-service.ts +86 -59
- package/src/access-surface-catalog.ts +4 -0
- package/src/admin/admin-surfaces.ts +2 -0
- package/src/binary-lifecycle/pipeline.test.ts +106 -1
- package/src/binary-lifecycle/pipeline.ts +3 -0
- package/src/coding/git-context.test.ts +47 -0
- package/src/coding/git-context.ts +129 -27
- package/src/config.test.ts +24 -0
- package/src/config.ts +9 -12
- package/src/connector-provenance.test.ts +101 -0
- package/src/consolidation-undo.ts +3 -0
- package/src/converge-conflict-policy-type.test.ts +15 -0
- package/src/convergence-refresh.ts +14 -2
- package/src/correction/correction-access-wiring.ts +9 -7
- package/src/correction/correction-executor.test.ts +206 -2
- package/src/correction/correction-executor.ts +29 -20
- package/src/correction/correction-planner.test.ts +36 -0
- package/src/correction/correction-planner.ts +9 -15
- package/src/correction/correction-service.ts +3 -1
- package/src/correction/correction-storage-integration.test.ts +77 -0
- package/src/correction/correction-surfaces.test.ts +41 -28
- package/src/correction/passive-capture.test.ts +59 -0
- package/src/correction/passive-capture.ts +4 -1
- package/src/entity-retrieval-boundaries.ts +17 -4
- package/src/entity-retrieval.ts +27 -6
- package/src/external-wiki-access.test.ts +65 -0
- package/src/external-wiki-access.ts +31 -0
- package/src/external-wiki-cli.ts +92 -0
- package/src/external-wiki-collection-registration.test.ts +163 -0
- package/src/external-wiki-collection-registration.ts +101 -0
- package/src/external-wiki-collection.test.ts +502 -0
- package/src/external-wiki-collection.ts +503 -0
- package/src/external-wiki-config.test.ts +135 -0
- package/src/external-wiki-config.ts +100 -0
- package/src/external-wiki-guard.ts +83 -0
- package/src/external-wiki-mcp-tools.ts +23 -0
- package/src/external-wiki-search.test.ts +301 -0
- package/src/external-wiki-search.ts +362 -0
- package/src/external-wiki.test.ts +240 -0
- package/src/external-wiki.ts +453 -0
- package/src/extraction-scope-source-agent.test.ts +21 -0
- package/src/extraction-source-grounding-helpers.ts +243 -53
- package/src/extraction-source-grounding-rules.ts +133 -39
- package/src/extraction-source-grounding.test.ts +363 -33
- package/src/extraction-timeout.test.ts +1 -0
- package/src/extraction-watermark.test.ts +150 -7
- package/src/extraction.ts +8 -1
- package/src/index.ts +8 -0
- package/src/mcp-read-only-tools.ts +1 -0
- package/src/offline-sync.test.ts +194 -0
- package/src/offline-sync.ts +217 -13
- package/src/orchestration/external-wiki-recall-guard.test.ts +94 -0
- package/src/orchestration/extraction-persist.ts +19 -2
- package/src/orchestration/extraction-run-helpers.ts +37 -19
- package/src/orchestration/extraction-run.test.ts +171 -2
- package/src/orchestration/extraction-run.ts +11 -13
- package/src/orchestration/extraction-watermark.ts +106 -17
- package/src/orchestration/generic-recall-paths.ts +14 -0
- package/src/orchestration/orchestrator-helpers.ts +2 -0
- package/src/orchestration/orchestrator-init.ts +9 -0
- package/src/orchestration/recall-internal-deps.ts +6 -0
- package/src/orchestration/recall-internal.ts +154 -33
- package/src/orchestration/recall-rerank-coordinator.ts +60 -25
- package/src/orchestration/recall-search-pipeline.test.ts +75 -1
- package/src/orchestration/recall-search-pipeline.ts +50 -10
- package/src/orchestrator-convergence-refresh.test.ts +36 -2
- package/src/orchestrator.ts +13 -3
- package/src/page-versioning.ts +5 -19
- package/src/procedural/procedure-recall.ts +5 -1
- package/src/provenance-surfaces.test.ts +3 -0
- package/src/qmd-client.test.ts +78 -17
- package/src/qmd.test.ts +24 -0
- package/src/qmd.ts +224 -315
- package/src/recall-explain-renderer.ts +3 -0
- package/src/recall-rerank-coordinator.test.ts +61 -0
- package/src/recall-xray-renderer.test.ts +6 -0
- package/src/recall-xray.test.ts +88 -1
- package/src/recall-xray.ts +15 -0
- package/src/reconcile/cursor.test.ts +48 -0
- package/src/reconcile/cursor.ts +58 -11
- package/src/reconcile/manifest.test.ts +4 -0
- package/src/reconcile/manifest.ts +41 -51
- package/src/reconcile/plan.test.ts +4 -0
- package/src/reconcile/plan.ts +29 -16
- package/src/search/factory.ts +6 -6
- package/src/search/port.ts +25 -9
- package/src/secure-store/secure-fs.ts +20 -12
- package/src/secure-store/secure-store.test.ts +41 -2
- package/src/spaces/index.test.ts +61 -2
- package/src/spaces/index.ts +44 -18
- package/src/storage/entity-alias-config.ts +97 -0
- package/src/storage/entity-canonical-id-lock.ts +53 -23
- package/src/storage/entity-canonical-id-migration.ts +53 -22
- package/src/storage/entity-canonical-id-references.ts +3 -0
- package/src/storage/entity-id-safety.ts +7 -0
- package/src/storage/entity-store.ts +6 -2
- package/src/storage/memory-frontmatter-metadata.ts +4 -9
- package/src/storage/memory-migration-serialization.ts +10 -15
- package/src/storage/tombstone-blocked-capture-mutation.ts +52 -64
- package/src/storage/tombstone-blocked-capture-sync.ts +244 -199
- package/src/storage-deletion-revisions.test.ts +91 -0
- package/src/storage-fact-hash-index-defer.test.ts +446 -163
- package/src/storage.ts +534 -245
- package/src/tool-scoped-memory.ts +10 -0
- package/src/transfer/capsule-import.ts +13 -0
- package/src/transfer/capsule-merge.ts +13 -0
- package/src/trust-score-recall-paths.test.ts +75 -1
- package/src/types.ts +7 -3
- package/dist/capsule-merge-IDWJPCWK.js.map +0 -1
- package/dist/chunk-3CE77VAP.js.map +0 -1
- package/dist/chunk-3TBLDMJA.js.map +0 -1
- package/dist/chunk-4J7G5SY4.js.map +0 -1
- package/dist/chunk-4L6HUREQ.js.map +0 -1
- package/dist/chunk-57QKLRBV.js.map +0 -1
- package/dist/chunk-5TFP4CUL.js.map +0 -1
- package/dist/chunk-7XC2HX75.js.map +0 -1
- package/dist/chunk-A5OJCXZL.js.map +0 -1
- package/dist/chunk-BUE5E2HL.js.map +0 -1
- package/dist/chunk-CJ2ZR7UA.js.map +0 -1
- package/dist/chunk-CUM2BBPN.js.map +0 -1
- package/dist/chunk-D3J5SLQK.js.map +0 -1
- package/dist/chunk-DL7ZD3JH.js.map +0 -1
- package/dist/chunk-DLVPUX7U.js.map +0 -1
- package/dist/chunk-E6PNLPGJ.js.map +0 -1
- package/dist/chunk-ECK75GDJ.js.map +0 -1
- package/dist/chunk-HREE4JHI.js.map +0 -1
- package/dist/chunk-IKKWIPYN.js.map +0 -1
- package/dist/chunk-J7VGGECD.js.map +0 -1
- package/dist/chunk-N5Z4EVOR.js.map +0 -1
- package/dist/chunk-NVRYW264.js.map +0 -1
- package/dist/chunk-P2BM76KT.js.map +0 -1
- package/dist/chunk-PVGDJXVK.js +0 -21
- package/dist/chunk-QJAQNXWI.js.map +0 -1
- package/dist/chunk-RN7DY3FC.js.map +0 -1
- package/dist/chunk-RVLJEII5.js.map +0 -1
- package/dist/chunk-S2NCTZGJ.js.map +0 -1
- package/dist/chunk-TDHTVMPG.js.map +0 -1
- package/dist/chunk-UYLMNVY6.js.map +0 -1
- package/dist/chunk-VCD4PSK2.js.map +0 -1
- package/dist/chunk-VNA7W7QF.js.map +0 -1
- package/dist/chunk-VWAXN2BN.js.map +0 -1
- package/dist/chunk-WOCNN776.js.map +0 -1
- package/dist/chunk-XYTOI63Z.js.map +0 -1
- package/dist/chunk-YV32N67O.js.map +0 -1
- /package/dist/{auto-sync-5OE5QOZB.js.map → auto-sync-UPTUVE4X.js.map} +0 -0
- /package/dist/{chunk-VUPTKTDV.js.map → chunk-2MRHJNWL.js.map} +0 -0
- /package/dist/{chunk-JBPKEARU.js.map → chunk-2QSZNTDO.js.map} +0 -0
- /package/dist/{chunk-5IVLTFOV.js.map → chunk-44N6ESJ4.js.map} +0 -0
- /package/dist/{chunk-HO3QBJEY.js.map → chunk-5546W5SI.js.map} +0 -0
- /package/dist/{chunk-U7GW7NE7.js.map → chunk-5CEECY6P.js.map} +0 -0
- /package/dist/{chunk-4UH4BTGK.js.map → chunk-5SNZSWWR.js.map} +0 -0
- /package/dist/{chunk-6CZPDBJS.js.map → chunk-5U7ID3EZ.js.map} +0 -0
- /package/dist/{chunk-GF22HWS2.js.map → chunk-6NNNURLK.js.map} +0 -0
- /package/dist/{chunk-227UFSEQ.js.map → chunk-7RZJWZ46.js.map} +0 -0
- /package/dist/{chunk-E5UK4VPE.js.map → chunk-7SHJHPTY.js.map} +0 -0
- /package/dist/{chunk-UVIKWC7M.js.map → chunk-7YERSTN7.js.map} +0 -0
- /package/dist/{chunk-S5SLVSVY.js.map → chunk-BQIFZ2MP.js.map} +0 -0
- /package/dist/{chunk-E53DSZEN.js.map → chunk-C26TE27X.js.map} +0 -0
- /package/dist/{chunk-LZ4LDKHZ.js.map → chunk-CLB32OHM.js.map} +0 -0
- /package/dist/{chunk-Q6IP2ARR.js.map → chunk-CSOYVTRX.js.map} +0 -0
- /package/dist/{chunk-XOQSEF7X.js.map → chunk-CVILPI77.js.map} +0 -0
- /package/dist/{chunk-PDLBLTOK.js.map → chunk-EITZHSX6.js.map} +0 -0
- /package/dist/{chunk-WUNIWKY4.js.map → chunk-ELIL2A37.js.map} +0 -0
- /package/dist/{chunk-CINZGPSJ.js.map → chunk-GUMZC2BO.js.map} +0 -0
- /package/dist/{chunk-H24WNPA2.js.map → chunk-GWFSVJ4P.js.map} +0 -0
- /package/dist/{chunk-TSH56VPU.js.map → chunk-HAYSYUAB.js.map} +0 -0
- /package/dist/{chunk-PKNLM44P.js.map → chunk-JH6BPLOP.js.map} +0 -0
- /package/dist/{chunk-KXB4VXHY.js.map → chunk-JIYDRBVZ.js.map} +0 -0
- /package/dist/{chunk-AV5ZEH4M.js.map → chunk-KVJRXN2E.js.map} +0 -0
- /package/dist/{chunk-JVLCVFQ4.js.map → chunk-KXEFRMCF.js.map} +0 -0
- /package/dist/{chunk-WFTIGIIS.js.map → chunk-L6CQ7WIW.js.map} +0 -0
- /package/dist/{chunk-EJUEXZHX.js.map → chunk-LLJMAULE.js.map} +0 -0
- /package/dist/{chunk-AS7YMSL6.js.map → chunk-M23RF3LJ.js.map} +0 -0
- /package/dist/{chunk-3F2LKUMU.js.map → chunk-NIS256NW.js.map} +0 -0
- /package/dist/{chunk-YIAA2X3D.js.map → chunk-NK5RGJ65.js.map} +0 -0
- /package/dist/{chunk-OQ5PRDDS.js.map → chunk-NTOIP2E6.js.map} +0 -0
- /package/dist/{chunk-HLPD7B7P.js.map → chunk-NUEQKLNB.js.map} +0 -0
- /package/dist/{chunk-33PLLLL7.js.map → chunk-P7NGM24P.js.map} +0 -0
- /package/dist/{chunk-7TWUCYER.js.map → chunk-PNRA7FAD.js.map} +0 -0
- /package/dist/{chunk-5I4M26Q7.js.map → chunk-QBSFOKY6.js.map} +0 -0
- /package/dist/{chunk-P4DRWEYC.js.map → chunk-QVSBTCVP.js.map} +0 -0
- /package/dist/{chunk-AAIUERNB.js.map → chunk-R5RFK3CB.js.map} +0 -0
- /package/dist/{chunk-WDISJRMG.js.map → chunk-RMMVQQA6.js.map} +0 -0
- /package/dist/{chunk-5SM35XZR.js.map → chunk-S5NZBKKQ.js.map} +0 -0
- /package/dist/{chunk-WIPEXG6R.js.map → chunk-SXIMQLGV.js.map} +0 -0
- /package/dist/{chunk-OAEQLRCY.js.map → chunk-TN76AKO3.js.map} +0 -0
- /package/dist/{chunk-QN25OCUF.js.map → chunk-TQ4GD737.js.map} +0 -0
- /package/dist/{chunk-7K5Q6COX.js.map → chunk-TVVEYCNW.js.map} +0 -0
- /package/dist/{chunk-DNWXFTLD.js.map → chunk-TYISDI6B.js.map} +0 -0
- /package/dist/{chunk-4LMA77JH.js.map → chunk-U2VLVBBH.js.map} +0 -0
- /package/dist/{chunk-5ZE7QHTK.js.map → chunk-ULVR5KG7.js.map} +0 -0
- /package/dist/{chunk-4B77XSG5.js.map → chunk-UV72DEZD.js.map} +0 -0
- /package/dist/{chunk-S2BBISHU.js.map → chunk-VANZKHTN.js.map} +0 -0
- /package/dist/{chunk-3Y224NYC.js.map → chunk-VYISFWVX.js.map} +0 -0
- /package/dist/{chunk-TIHMZFIV.js.map → chunk-W3IC7QOY.js.map} +0 -0
- /package/dist/{chunk-NRV4Y3PM.js.map → chunk-W4FBGYGK.js.map} +0 -0
- /package/dist/{chunk-MU7ZHSZE.js.map → chunk-WZFAPHIK.js.map} +0 -0
- /package/dist/{chunk-T2TTP3KU.js.map → chunk-X4IDNPOS.js.map} +0 -0
- /package/dist/{chunk-BLAKS3CP.js.map → chunk-XL3TATMJ.js.map} +0 -0
- /package/dist/{chunk-W4XJFLAL.js.map → chunk-XPRJSHNI.js.map} +0 -0
- /package/dist/{chunk-JE7EK33X.js.map → chunk-Y7HRYCNW.js.map} +0 -0
- /package/dist/{chunk-E6EE5B67.js.map → chunk-YK6BDDHP.js.map} +0 -0
- /package/dist/{chunk-ES36HTSC.js.map → chunk-YLHM5BQQ.js.map} +0 -0
- /package/dist/{chunk-BJKPPZ6Z.js.map → chunk-ZFGZ6PZ2.js.map} +0 -0
- /package/dist/{chunk-64UDOIMI.js.map → chunk-ZLQ37WJX.js.map} +0 -0
|
@@ -16,9 +16,11 @@ import path from "node:path";
|
|
|
16
16
|
import test from "node:test";
|
|
17
17
|
|
|
18
18
|
import { EngramMcpServer } from "./access-mcp.js";
|
|
19
|
+
import { getOperation } from "./access-boundary.js";
|
|
19
20
|
import { memoryStoreOperation } from "./access-operations.js";
|
|
20
21
|
import type {
|
|
21
22
|
EngramAccessMemoryStoreRequest,
|
|
23
|
+
EngramAccessRecallRequest,
|
|
22
24
|
EngramAccessService,
|
|
23
25
|
EngramAccessWriteResponse,
|
|
24
26
|
} from "./access-service.js";
|
|
@@ -117,6 +119,26 @@ test("memory_store via MCP with no sourceConnector (operator) → service receiv
|
|
|
117
119
|
);
|
|
118
120
|
});
|
|
119
121
|
|
|
122
|
+
test("recall operation forwards only the server-resolved connector", async () => {
|
|
123
|
+
const captured: EngramAccessRecallRequest[] = [];
|
|
124
|
+
const service = {
|
|
125
|
+
recall: (request: EngramAccessRecallRequest) => {
|
|
126
|
+
captured.push(request);
|
|
127
|
+
return Promise.resolve({});
|
|
128
|
+
},
|
|
129
|
+
} as unknown as EngramAccessService;
|
|
130
|
+
const recallOperation = getOperation("recall");
|
|
131
|
+
assert.ok(recallOperation);
|
|
132
|
+
|
|
133
|
+
await recallOperation.run(
|
|
134
|
+
{ query: "shared namespace query", sourceConnector: "spoofed-client" },
|
|
135
|
+
{ service, sourceConnector: "chatgpt" },
|
|
136
|
+
);
|
|
137
|
+
|
|
138
|
+
assert.equal(captured.length, 1);
|
|
139
|
+
assert.equal(captured[0]?.sourceConnector, "chatgpt");
|
|
140
|
+
});
|
|
141
|
+
|
|
120
142
|
// ---------------------------------------------------------------------------
|
|
121
143
|
// Test 4: client-supplied sourceConnector in args is IGNORED
|
|
122
144
|
// ---------------------------------------------------------------------------
|
|
@@ -217,3 +239,82 @@ test("StorageManager.writeMemory without sourceConnector → frontmatter omits i
|
|
|
217
239
|
await rm(baseDir, { recursive: true, force: true });
|
|
218
240
|
}
|
|
219
241
|
});
|
|
242
|
+
|
|
243
|
+
test("StorageManager classifies connector-attributed tool memories at write time", async () => {
|
|
244
|
+
StorageManager.clearAllStaticCaches();
|
|
245
|
+
const baseDir = await mkdtemp(path.join(os.tmpdir(), "prov-tool-scope-"));
|
|
246
|
+
try {
|
|
247
|
+
const storage = new StorageManager(baseDir);
|
|
248
|
+
await storage.ensureDirectories();
|
|
249
|
+
|
|
250
|
+
const { id } = await storage.writeMemory(
|
|
251
|
+
"fact",
|
|
252
|
+
"Use the search tool with a path argument.",
|
|
253
|
+
{ sourceConnector: "chatgpt" },
|
|
254
|
+
);
|
|
255
|
+
|
|
256
|
+
assert.equal((await storage.getMemoryById(id))?.frontmatter.toolScoped, true);
|
|
257
|
+
} finally {
|
|
258
|
+
StorageManager.clearAllStaticCaches();
|
|
259
|
+
await rm(baseDir, { recursive: true, force: true });
|
|
260
|
+
}
|
|
261
|
+
});
|
|
262
|
+
|
|
263
|
+
test("StorageManager leaves unattributed tool-like memories unpartitioned", async () => {
|
|
264
|
+
StorageManager.clearAllStaticCaches();
|
|
265
|
+
const baseDir = await mkdtemp(path.join(os.tmpdir(), "prov-tool-scope-"));
|
|
266
|
+
try {
|
|
267
|
+
const storage = new StorageManager(baseDir);
|
|
268
|
+
await storage.ensureDirectories();
|
|
269
|
+
|
|
270
|
+
const { id } = await storage.writeMemory(
|
|
271
|
+
"fact",
|
|
272
|
+
"Use the search tool with a path argument.",
|
|
273
|
+
);
|
|
274
|
+
|
|
275
|
+
assert.equal((await storage.getMemoryById(id))?.frontmatter.toolScoped, undefined);
|
|
276
|
+
} finally {
|
|
277
|
+
StorageManager.clearAllStaticCaches();
|
|
278
|
+
await rm(baseDir, { recursive: true, force: true });
|
|
279
|
+
}
|
|
280
|
+
});
|
|
281
|
+
|
|
282
|
+
test("StorageManager preserves an explicit structured tool classification", async () => {
|
|
283
|
+
StorageManager.clearAllStaticCaches();
|
|
284
|
+
const baseDir = await mkdtemp(path.join(os.tmpdir(), "prov-tool-scope-"));
|
|
285
|
+
try {
|
|
286
|
+
const storage = new StorageManager(baseDir);
|
|
287
|
+
await storage.ensureDirectories();
|
|
288
|
+
|
|
289
|
+
const { id } = await storage.writeMemory(
|
|
290
|
+
"procedure",
|
|
291
|
+
"Workflow for locating an implementation",
|
|
292
|
+
{ sourceConnector: "chatgpt", toolScoped: true },
|
|
293
|
+
);
|
|
294
|
+
|
|
295
|
+
assert.equal((await storage.getMemoryById(id))?.frontmatter.toolScoped, true);
|
|
296
|
+
} finally {
|
|
297
|
+
StorageManager.clearAllStaticCaches();
|
|
298
|
+
await rm(baseDir, { recursive: true, force: true });
|
|
299
|
+
}
|
|
300
|
+
});
|
|
301
|
+
test("StorageManager preserves connector partition metadata on artifacts", async () => {
|
|
302
|
+
StorageManager.clearAllStaticCaches();
|
|
303
|
+
const baseDir = await mkdtemp(path.join(os.tmpdir(), "prov-artifact-tool-scope-"));
|
|
304
|
+
try {
|
|
305
|
+
const storage = new StorageManager(baseDir);
|
|
306
|
+
await storage.ensureDirectories();
|
|
307
|
+
const id = await storage.writeArtifact("Use the search tool with a path argument.", {
|
|
308
|
+
sourceConnector: "chatgpt",
|
|
309
|
+
toolScoped: true,
|
|
310
|
+
});
|
|
311
|
+
const artifact = (await storage.searchArtifacts("search tool", 10)).find(
|
|
312
|
+
(candidate) => candidate.frontmatter.id === id,
|
|
313
|
+
);
|
|
314
|
+
assert.equal(artifact?.frontmatter.sourceConnector, "chatgpt");
|
|
315
|
+
assert.equal(artifact?.frontmatter.toolScoped, true);
|
|
316
|
+
} finally {
|
|
317
|
+
StorageManager.clearAllStaticCaches();
|
|
318
|
+
await rm(baseDir, { recursive: true, force: true });
|
|
319
|
+
}
|
|
320
|
+
});
|
|
@@ -27,6 +27,7 @@ import type { StorageManager } from "./storage.js";
|
|
|
27
27
|
import type { VersioningConfig } from "./page-versioning.js";
|
|
28
28
|
import { bumpMemoryCorpusVersionForDir } from "./memory-corpus-version.js";
|
|
29
29
|
import { requestEntityCanonicalIdReconcile } from "./storage/entity-canonical-id-references.js";
|
|
30
|
+
import { withRawEntityPageMutation } from "./storage/entity-canonical-id-lock.js";
|
|
30
31
|
import { getVersion } from "./page-versioning.js";
|
|
31
32
|
|
|
32
33
|
/**
|
|
@@ -643,6 +644,7 @@ export async function runConsolidationUndo(options: {
|
|
|
643
644
|
}
|
|
644
645
|
try {
|
|
645
646
|
await mkdir(path.dirname(p.sourcePath), { recursive: true });
|
|
647
|
+
await withRawEntityPageMutation(memoryDir, p.sourcePath, async () => {
|
|
646
648
|
// Use exclusive create (wx / O_EXCL) so that if another process
|
|
647
649
|
// recreates the source file between planning and execution, this
|
|
648
650
|
// write fails with EEXIST instead of silently overwriting the new
|
|
@@ -658,6 +660,7 @@ export async function runConsolidationUndo(options: {
|
|
|
658
660
|
// Restored bytes predate the current migration journal and can carry
|
|
659
661
|
// legacy entity references (issue #2213) — request one reconcile pass.
|
|
660
662
|
await requestEntityCanonicalIdReconcile(path.join(memoryDir, "state"));
|
|
663
|
+
});
|
|
661
664
|
result.restores.push({
|
|
662
665
|
entry: p.entry,
|
|
663
666
|
sourcePath: p.sourcePath,
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import test from "node:test";
|
|
3
|
+
|
|
4
|
+
import type { ReconcileConflictPolicy } from "./reconcile/plan.js";
|
|
5
|
+
import type { ConvergeConflictPolicy } from "./types.js";
|
|
6
|
+
|
|
7
|
+
type Equal<Left, Right> = (<Value>() => Value extends Left ? 1 : 2) extends <Value>() => Value extends Right ? 1 : 2
|
|
8
|
+
? true
|
|
9
|
+
: false;
|
|
10
|
+
|
|
11
|
+
const conflictPolicyNamesAreEquivalent: Equal<ReconcileConflictPolicy, ConvergeConflictPolicy> = true;
|
|
12
|
+
|
|
13
|
+
test("ReconcileConflictPolicy remains a type alias for ConvergeConflictPolicy", () => {
|
|
14
|
+
assert.equal(conflictPolicyNamesAreEquivalent, true);
|
|
15
|
+
});
|
|
@@ -9,12 +9,24 @@ type ConvergenceStorage = NonNullable<RebuildMemoryProjectionOptions["storage"]>
|
|
|
9
9
|
export async function refreshConvergedNamespaces(
|
|
10
10
|
namespaces: readonly string[],
|
|
11
11
|
namespaceSearchRouter: Pick<NamespaceSearchRouter, "updateNamespacesDetailed">,
|
|
12
|
-
getStorage: (namespace: string) => Promise<ConvergenceStorage
|
|
12
|
+
getStorage: (namespace: string) => Promise<ConvergenceStorage>,
|
|
13
|
+
searchEnabled: boolean,
|
|
13
14
|
): Promise<void> {
|
|
14
15
|
const targetNamespaces = Array.from(new Set(namespaces.map((namespace) => namespace.trim()).filter(Boolean)));
|
|
15
16
|
if (targetNamespaces.length === 0) return;
|
|
16
17
|
|
|
17
|
-
await namespaceSearchRouter.updateNamespacesDetailed(
|
|
18
|
+
const searchResult = await namespaceSearchRouter.updateNamespacesDetailed(
|
|
19
|
+
targetNamespaces,
|
|
20
|
+
undefined,
|
|
21
|
+
{ strict: true },
|
|
22
|
+
);
|
|
23
|
+
if (searchEnabled) {
|
|
24
|
+
const eligible = new Set(searchResult.eligibleNamespaces);
|
|
25
|
+
const skipped = targetNamespaces.filter((namespace) => !eligible.has(namespace));
|
|
26
|
+
if (skipped.length > 0) {
|
|
27
|
+
throw new Error(`search refresh skipped namespaces: ${skipped.join(", ")}`);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
18
30
|
|
|
19
31
|
for (const namespace of targetNamespaces) {
|
|
20
32
|
const storage = await getStorage(namespace);
|
|
@@ -25,7 +25,8 @@ import { throwIfAborted } from "../abort-error.js";
|
|
|
25
25
|
import { composeMemoryEnvelope, isMemoryCategory } from "../write-envelope.js";
|
|
26
26
|
import { log } from "../logger.js";
|
|
27
27
|
import { createHash } from "node:crypto";
|
|
28
|
-
import {
|
|
28
|
+
import { REDACTION_RULES_SUBDIR } from "../extraction-redaction-rules.js";
|
|
29
|
+
import { writeFileAtomically } from "../maintenance/atomic-file.js";
|
|
29
30
|
import type { Orchestrator } from "../orchestrator.js";
|
|
30
31
|
import type { MemoryFile, MemoryStatus, PluginConfig } from "../types.js";
|
|
31
32
|
import { stripAttributesSuffix } from "../structured-attributes.js";
|
|
@@ -568,6 +569,7 @@ async function rescopeMemoryFn(
|
|
|
568
569
|
...(fm.entityRef ? { entityRef: fm.entityRef } : {}),
|
|
569
570
|
...(fm.structuredAttributes ? { structuredAttributes: fm.structuredAttributes } : {}),
|
|
570
571
|
...(fm.valid_at ? { validAt: fm.valid_at } : {}),
|
|
572
|
+
...(fm.sourceConnector ? { sourceConnector: fm.sourceConnector } : {}),
|
|
571
573
|
},
|
|
572
574
|
{ source: `correction:rescope:${namespace}` },
|
|
573
575
|
{ salvage: true },
|
|
@@ -581,6 +583,7 @@ async function rescopeMemoryFn(
|
|
|
581
583
|
...(fm.memoryKind ? { memoryKind: fm.memoryKind } : {}),
|
|
582
584
|
...(Array.isArray(fm.links) ? { links: fm.links } : {}),
|
|
583
585
|
...(fm.intentGoal ? { intentGoal: fm.intentGoal } : {}),
|
|
586
|
+
...(fm.toolScoped ? { toolScoped: true as const } : {}),
|
|
584
587
|
});
|
|
585
588
|
if (destBlocked) {
|
|
586
589
|
// #1645: destination tombstone-blocked the rescope (pending_review). Don't
|
|
@@ -703,14 +706,14 @@ async function registerRedactionRuleFn(
|
|
|
703
706
|
namespace: string,
|
|
704
707
|
pattern: string,
|
|
705
708
|
abortSignal?: AbortSignal,
|
|
709
|
+
writeRule: (outputPath: string, content: string) => Promise<unknown> = writeFileAtomically,
|
|
706
710
|
): Promise<void> {
|
|
707
711
|
// Persist the redaction rule under state/ so extraction consults it the
|
|
708
712
|
// same way tombstones are consulted (route through the same chokepoint).
|
|
709
713
|
throwIfAborted(abortSignal, "correction apply aborted");
|
|
710
714
|
const storage = await wiring.orchestrator.getStorage(namespace);
|
|
711
715
|
throwIfAborted(abortSignal, "correction apply aborted");
|
|
712
|
-
const dir = path.join(storage.dir,
|
|
713
|
-
await mkdir(dir, { recursive: true });
|
|
716
|
+
const dir = path.join(storage.dir, REDACTION_RULES_SUBDIR);
|
|
714
717
|
throwIfAborted(abortSignal, "correction apply aborted");
|
|
715
718
|
// Idempotent: filename is a slug + short hash of the full pattern so
|
|
716
719
|
// re-registering the same pattern overwrites rather than duplicates, while
|
|
@@ -721,12 +724,10 @@ async function registerRedactionRuleFn(
|
|
|
721
724
|
const patternHash = createHash("sha256").update(pattern).digest("hex").slice(0, 16);
|
|
722
725
|
const slug = `${slugBase}-${patternHash}`;
|
|
723
726
|
throwIfAborted(abortSignal, "correction apply aborted");
|
|
724
|
-
await
|
|
727
|
+
await writeRule(
|
|
725
728
|
path.join(dir, `${slug}.json`),
|
|
726
729
|
`${JSON.stringify({ pattern, namespace, createdAt: new Date().toISOString() })}\n`,
|
|
727
|
-
"utf-8",
|
|
728
730
|
);
|
|
729
|
-
throwIfAborted(abortSignal, "correction apply aborted");
|
|
730
731
|
}
|
|
731
732
|
|
|
732
733
|
async function appendAuditRecordFn(
|
|
@@ -761,7 +762,6 @@ async function appendAuditRecordFn(
|
|
|
761
762
|
),
|
|
762
763
|
{},
|
|
763
764
|
);
|
|
764
|
-
throwIfAborted(abortSignal, "correction apply aborted");
|
|
765
765
|
return id;
|
|
766
766
|
}
|
|
767
767
|
|
|
@@ -1081,6 +1081,8 @@ export {
|
|
|
1081
1081
|
isEligibleCorrectionCandidate,
|
|
1082
1082
|
applyEditMemory,
|
|
1083
1083
|
appendTombstoneFn,
|
|
1084
|
+
appendAuditRecordFn,
|
|
1085
|
+
registerRedactionRuleFn,
|
|
1084
1086
|
retireMemoryFn,
|
|
1085
1087
|
rescopeMemoryFn,
|
|
1086
1088
|
writeReplacementMemory,
|
|
@@ -516,6 +516,69 @@ test("supersede retries loser retirement after a transient failure", async () =>
|
|
|
516
516
|
});
|
|
517
517
|
});
|
|
518
518
|
|
|
519
|
+
test("#2206 cancellation terminalizes a plan after a replacement commits but retirement fails", async () => {
|
|
520
|
+
await withTempDir(async (dir) => {
|
|
521
|
+
const candidates = new Map<string, PlannerCandidate>([
|
|
522
|
+
["mem-old", { memoryId: "mem-old", path: "facts/mem-old.md", content: "old", excerpt: "old", score: 1 }],
|
|
523
|
+
]);
|
|
524
|
+
const state: FakeState = {
|
|
525
|
+
memories: new Map([["mem-old", fakeMemory({ memoryId: "mem-old", content: "old" })]]),
|
|
526
|
+
tombstones: [],
|
|
527
|
+
redactionRules: [],
|
|
528
|
+
auditRecords: [],
|
|
529
|
+
propagateCalls: 0,
|
|
530
|
+
writtenReplacements: [],
|
|
531
|
+
};
|
|
532
|
+
const plannerDeps: PlannerDeps = {
|
|
533
|
+
...makePlannerDeps(dir, candidates),
|
|
534
|
+
classifyAndDraft: async () => ({
|
|
535
|
+
classification: "outdated",
|
|
536
|
+
confidence: 0.9,
|
|
537
|
+
actions: [
|
|
538
|
+
{ kind: "supersede", loserId: "mem-old", replacement: { content: "new" } },
|
|
539
|
+
{ kind: "redaction_rule", pattern: "later-action" },
|
|
540
|
+
],
|
|
541
|
+
relevance: [{ memoryId: "mem-old", why: "x" }],
|
|
542
|
+
warnings: [],
|
|
543
|
+
}),
|
|
544
|
+
};
|
|
545
|
+
const planner = new CorrectionPlanner(plannerDeps);
|
|
546
|
+
const plan = await planner.plan({ text: "old", targetIds: ["mem-old"] }, ["default"]);
|
|
547
|
+
const abortController = new AbortController();
|
|
548
|
+
const deps = makeExecutorDeps(state);
|
|
549
|
+
let retirementAttempted = false;
|
|
550
|
+
deps.retireMemory = async () => {
|
|
551
|
+
retirementAttempted = true;
|
|
552
|
+
abortController.abort(new Error("correction deadline exceeded"));
|
|
553
|
+
throw new Error("injected retirement failure");
|
|
554
|
+
};
|
|
555
|
+
|
|
556
|
+
const outcome = await new CorrectionExecutor(deps, planner).apply("default", plan.planId, {
|
|
557
|
+
confirm: true,
|
|
558
|
+
abortSignal: abortController.signal,
|
|
559
|
+
});
|
|
560
|
+
|
|
561
|
+
assert.equal(retirementAttempted, true, "the cancellation must be injected from retirement");
|
|
562
|
+
assert.equal(outcome.status, "partial");
|
|
563
|
+
assert.equal((await planner.loadPlan("default", plan.planId))?.status, "partial");
|
|
564
|
+
assert.equal(state.writtenReplacements.length, 1);
|
|
565
|
+
assert.equal(state.memories.get("mem-old")?.status, "active");
|
|
566
|
+
assert.deepEqual(state.redactionRules, []);
|
|
567
|
+
assert.equal(
|
|
568
|
+
outcome.results.some((result) => result.action.kind === "redaction_rule" && result.status === "skipped"),
|
|
569
|
+
true,
|
|
570
|
+
);
|
|
571
|
+
const supersedeResults = outcome.results.filter((result) => result.action.kind === "supersede");
|
|
572
|
+
assert.deepEqual(
|
|
573
|
+
supersedeResults.map((result) => result.status),
|
|
574
|
+
["applied", "failed"],
|
|
575
|
+
"the outcome must expose the committed replacement and failed retirement",
|
|
576
|
+
);
|
|
577
|
+
assert.match(supersedeResults[1]?.error ?? "", /injected retirement failure/);
|
|
578
|
+
assert.equal(state.auditRecords.length, 1);
|
|
579
|
+
});
|
|
580
|
+
});
|
|
581
|
+
|
|
519
582
|
test("tombstone emitted per retract; validUntil absent when bi-temporal OFF", async () => {
|
|
520
583
|
await withTempDir(async (dir) => {
|
|
521
584
|
const candidates = new Map<string, PlannerCandidate>([
|
|
@@ -934,7 +997,7 @@ test("#2128 cancellation after tombstone commit terminalizes the correction plan
|
|
|
934
997
|
});
|
|
935
998
|
});
|
|
936
999
|
|
|
937
|
-
test("#
|
|
1000
|
+
test("#2206 cancellation after audit commit terminalizes an empty correction plan", async () => {
|
|
938
1001
|
await withTempDir(async (dir) => {
|
|
939
1002
|
const state: FakeState = {
|
|
940
1003
|
memories: new Map(),
|
|
@@ -950,8 +1013,40 @@ test("#2128 late cancellation before any mutation restores an applying plan to p
|
|
|
950
1013
|
const deps = makeExecutorDeps(state);
|
|
951
1014
|
const appendAuditRecord = deps.appendAuditRecord;
|
|
952
1015
|
deps.appendAuditRecord = async (namespace, record, signal) => {
|
|
1016
|
+
const auditId = await appendAuditRecord(namespace, record, signal);
|
|
953
1017
|
abortController.abort(new Error("caller disconnected"));
|
|
954
|
-
return
|
|
1018
|
+
return auditId;
|
|
1019
|
+
};
|
|
1020
|
+
const executor = new CorrectionExecutor(deps, planner);
|
|
1021
|
+
|
|
1022
|
+
const outcome = await executor.apply("default", plan.planId, {
|
|
1023
|
+
confirm: true,
|
|
1024
|
+
abortSignal: abortController.signal,
|
|
1025
|
+
});
|
|
1026
|
+
assert.equal(outcome.status, "applied");
|
|
1027
|
+
assert.equal(state.auditRecords.length, 1);
|
|
1028
|
+
assert.equal((await planner.loadPlan("default", plan.planId))?.status, "applied");
|
|
1029
|
+
});
|
|
1030
|
+
});
|
|
1031
|
+
|
|
1032
|
+
test("#2206 cancellation before audit commit restores an empty correction plan to pending", async () => {
|
|
1033
|
+
await withTempDir(async (dir) => {
|
|
1034
|
+
const state: FakeState = {
|
|
1035
|
+
memories: new Map(),
|
|
1036
|
+
tombstones: [],
|
|
1037
|
+
redactionRules: [],
|
|
1038
|
+
auditRecords: [],
|
|
1039
|
+
propagateCalls: 0,
|
|
1040
|
+
writtenReplacements: [],
|
|
1041
|
+
};
|
|
1042
|
+
const planner = new CorrectionPlanner(makePlannerDeps(dir, new Map()));
|
|
1043
|
+
const plan = await planner.plan({ text: "nothing matches" }, ["default"]);
|
|
1044
|
+
const abortController = new AbortController();
|
|
1045
|
+
const deps = makeExecutorDeps(state);
|
|
1046
|
+
deps.appendAuditRecord = async () => {
|
|
1047
|
+
const reason = new Error("caller disconnected");
|
|
1048
|
+
abortController.abort(reason);
|
|
1049
|
+
throw reason;
|
|
955
1050
|
};
|
|
956
1051
|
const executor = new CorrectionExecutor(deps, planner);
|
|
957
1052
|
|
|
@@ -959,6 +1054,7 @@ test("#2128 late cancellation before any mutation restores an applying plan to p
|
|
|
959
1054
|
() => executor.apply("default", plan.planId, { confirm: true, abortSignal: abortController.signal }),
|
|
960
1055
|
/caller disconnected/,
|
|
961
1056
|
);
|
|
1057
|
+
assert.equal(state.auditRecords.length, 0);
|
|
962
1058
|
assert.equal((await planner.loadPlan("default", plan.planId))?.status, "pending");
|
|
963
1059
|
});
|
|
964
1060
|
});
|
|
@@ -1140,9 +1236,117 @@ test("#2128 cancellation skips unstarted actions after a committed edit", async
|
|
|
1140
1236
|
assert.equal(state.memories.get("mem-edit")?.content, "edited");
|
|
1141
1237
|
assert.deepEqual(state.redactionRules, [], "the cancelled plan must not start its second action");
|
|
1142
1238
|
assert.equal(state.auditRecords.length, 1);
|
|
1239
|
+
const skipped = outcome.results.filter((result) => result.status === "skipped");
|
|
1240
|
+
assert.deepEqual(skipped.map((result) => result.action), [
|
|
1241
|
+
{ kind: "redaction_rule", pattern: "secret-token-\\d+" },
|
|
1242
|
+
]);
|
|
1243
|
+
assert.deepEqual(state.auditRecords[0]?.outcome.results, outcome.results);
|
|
1143
1244
|
});
|
|
1144
1245
|
});
|
|
1145
1246
|
|
|
1247
|
+
test("#2206 cancellation interrupts rescope authorization before any destination write", async () => {
|
|
1248
|
+
for (const priorEditCommitted of [false, true]) {
|
|
1249
|
+
await withTempDir(async (dir) => {
|
|
1250
|
+
const candidates = new Map<string, PlannerCandidate>([
|
|
1251
|
+
["mem-rescope", {
|
|
1252
|
+
memoryId: "mem-rescope",
|
|
1253
|
+
path: "facts/mem-rescope.md",
|
|
1254
|
+
content: "move me",
|
|
1255
|
+
excerpt: "move me",
|
|
1256
|
+
score: 1,
|
|
1257
|
+
}],
|
|
1258
|
+
]);
|
|
1259
|
+
if (priorEditCommitted) {
|
|
1260
|
+
candidates.set("mem-edit", {
|
|
1261
|
+
memoryId: "mem-edit",
|
|
1262
|
+
path: "facts/mem-edit.md",
|
|
1263
|
+
content: "edit me",
|
|
1264
|
+
excerpt: "edit me",
|
|
1265
|
+
score: 1,
|
|
1266
|
+
});
|
|
1267
|
+
}
|
|
1268
|
+
const state: FakeState = {
|
|
1269
|
+
memories: new Map([
|
|
1270
|
+
["mem-rescope", fakeMemory({ memoryId: "mem-rescope", content: "move me" })],
|
|
1271
|
+
...(priorEditCommitted
|
|
1272
|
+
? [["mem-edit", fakeMemory({ memoryId: "mem-edit", content: "edit me" })] as const]
|
|
1273
|
+
: []),
|
|
1274
|
+
]),
|
|
1275
|
+
tombstones: [],
|
|
1276
|
+
redactionRules: [],
|
|
1277
|
+
auditRecords: [],
|
|
1278
|
+
propagateCalls: 0,
|
|
1279
|
+
writtenReplacements: [],
|
|
1280
|
+
};
|
|
1281
|
+
const actions: CorrectionAction[] = [
|
|
1282
|
+
...(priorEditCommitted
|
|
1283
|
+
? [{ kind: "edit", memoryId: "mem-edit", patch: "edited" } as const]
|
|
1284
|
+
: []),
|
|
1285
|
+
{ kind: "rescope", memoryId: "mem-rescope", toNamespace: "destination" },
|
|
1286
|
+
];
|
|
1287
|
+
const plannerDeps: PlannerDeps = {
|
|
1288
|
+
...makePlannerDeps(dir, candidates),
|
|
1289
|
+
classifyAndDraft: async () => ({
|
|
1290
|
+
classification: "outdated",
|
|
1291
|
+
confidence: 0.9,
|
|
1292
|
+
actions,
|
|
1293
|
+
relevance: [...candidates.values()].map((candidate) => ({
|
|
1294
|
+
memoryId: candidate.memoryId,
|
|
1295
|
+
why: "test",
|
|
1296
|
+
})),
|
|
1297
|
+
warnings: [],
|
|
1298
|
+
}),
|
|
1299
|
+
};
|
|
1300
|
+
const planner = new CorrectionPlanner(plannerDeps);
|
|
1301
|
+
const plan = await planner.plan(
|
|
1302
|
+
{ text: "move memory", targetIds: [...candidates.keys()] },
|
|
1303
|
+
["default"],
|
|
1304
|
+
);
|
|
1305
|
+
const abortController = new AbortController();
|
|
1306
|
+
const started = Promise.withResolvers<void>();
|
|
1307
|
+
const authorization = Promise.withResolvers<boolean>();
|
|
1308
|
+
let forwardedSignal: AbortSignal | undefined;
|
|
1309
|
+
const applyResult = new CorrectionExecutor(makeExecutorDeps(state), planner)
|
|
1310
|
+
.apply("default", plan.planId, {
|
|
1311
|
+
confirm: true,
|
|
1312
|
+
abortSignal: abortController.signal,
|
|
1313
|
+
canWriteDestination: async (_namespace, abortSignal) => {
|
|
1314
|
+
forwardedSignal = abortSignal;
|
|
1315
|
+
started.resolve();
|
|
1316
|
+
return authorization.promise;
|
|
1317
|
+
},
|
|
1318
|
+
})
|
|
1319
|
+
.then(
|
|
1320
|
+
(outcome) => ({ ok: true as const, outcome }),
|
|
1321
|
+
(error: unknown) => ({ ok: false as const, error }),
|
|
1322
|
+
);
|
|
1323
|
+
|
|
1324
|
+
await started.promise;
|
|
1325
|
+
abortController.abort(new Error("correction deadline exceeded"));
|
|
1326
|
+
assert.equal(forwardedSignal, abortController.signal);
|
|
1327
|
+
assert.equal(forwardedSignal?.aborted, true);
|
|
1328
|
+
authorization.resolve(true);
|
|
1329
|
+
const result = await applyResult;
|
|
1330
|
+
assert.equal(state.memories.get("mem-rescope")?.status, "active");
|
|
1331
|
+
if (priorEditCommitted) {
|
|
1332
|
+
assert.equal(result.ok, true);
|
|
1333
|
+
assert.equal(result.outcome?.status, "partial");
|
|
1334
|
+
assert.equal(
|
|
1335
|
+
result.outcome?.results.some(
|
|
1336
|
+
(entry) => entry.action.kind === "rescope" && entry.status === "skipped",
|
|
1337
|
+
),
|
|
1338
|
+
true,
|
|
1339
|
+
);
|
|
1340
|
+
assert.equal((await planner.loadPlan("default", plan.planId))?.status, "partial");
|
|
1341
|
+
} else {
|
|
1342
|
+
assert.equal(result.ok, false);
|
|
1343
|
+
assert.match(String(result.error), /correction deadline exceeded|correction apply aborted/);
|
|
1344
|
+
assert.equal((await planner.loadPlan("default", plan.planId))?.status, "pending");
|
|
1345
|
+
}
|
|
1346
|
+
});
|
|
1347
|
+
}
|
|
1348
|
+
});
|
|
1349
|
+
|
|
1146
1350
|
test("Of0pz: supersede with a missing loser writes NO replacement (preflight before write)", async () => {
|
|
1147
1351
|
await withTempDir(async (dir) => {
|
|
1148
1352
|
const candidates = new Map<string, PlannerCandidate>([
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
* (`markConsumed`) under `serializeMutations` keyed by plan id (rule 40).
|
|
25
25
|
*/
|
|
26
26
|
|
|
27
|
-
import { throwIfAborted } from "../abort-error.js";
|
|
27
|
+
import { raceAbort, throwIfAborted } from "../abort-error.js";
|
|
28
28
|
import { log } from "../logger.js";
|
|
29
29
|
import { serializeMutations } from "../utils/serialize-mutations.js";
|
|
30
30
|
import {
|
|
@@ -201,7 +201,7 @@ export class CorrectionExecutor {
|
|
|
201
201
|
* thread: authorize-rescope-destination). Defaults to allow when the
|
|
202
202
|
* source namespace already resolves to a writable scope (single-tenant).
|
|
203
203
|
*/
|
|
204
|
-
canWriteDestination?: (namespace: string) => Promise<boolean>;
|
|
204
|
+
canWriteDestination?: (namespace: string, abortSignal?: AbortSignal) => Promise<boolean>;
|
|
205
205
|
}
|
|
206
206
|
): Promise<CorrectionOutcome> {
|
|
207
207
|
throwIfAborted(opts.abortSignal, "correction apply aborted");
|
|
@@ -220,7 +220,7 @@ export class CorrectionExecutor {
|
|
|
220
220
|
private async applyInternal(
|
|
221
221
|
namespace: string,
|
|
222
222
|
planId: string,
|
|
223
|
-
canWriteDestination?: (namespace: string) => Promise<boolean>,
|
|
223
|
+
canWriteDestination?: (namespace: string, abortSignal?: AbortSignal) => Promise<boolean>,
|
|
224
224
|
abortSignal?: AbortSignal
|
|
225
225
|
): Promise<CorrectionOutcome> {
|
|
226
226
|
throwIfAborted(abortSignal, "correction apply aborted");
|
|
@@ -307,10 +307,9 @@ export class CorrectionExecutor {
|
|
|
307
307
|
}
|
|
308
308
|
};
|
|
309
309
|
let mutationCommitted = false;
|
|
310
|
-
let cancellationSafeAfterCommit = false;
|
|
311
310
|
let cancellationRequestedAfterCommit = false;
|
|
312
311
|
const throwIfAbortedBeforeCommit = (): void => {
|
|
313
|
-
if (!mutationCommitted
|
|
312
|
+
if (!mutationCommitted) {
|
|
314
313
|
throwIfAborted(abortSignal, "correction apply aborted");
|
|
315
314
|
}
|
|
316
315
|
};
|
|
@@ -409,7 +408,6 @@ export class CorrectionExecutor {
|
|
|
409
408
|
retirementResult.status === "applied"
|
|
410
409
|
) {
|
|
411
410
|
retiredReplacementActions.add(action);
|
|
412
|
-
cancellationSafeAfterCommit = true;
|
|
413
411
|
}
|
|
414
412
|
} catch (err) {
|
|
415
413
|
if (abortSignal?.aborted) {
|
|
@@ -435,7 +433,6 @@ export class CorrectionExecutor {
|
|
|
435
433
|
abortSignal
|
|
436
434
|
);
|
|
437
435
|
mutationCommitted = true;
|
|
438
|
-
cancellationSafeAfterCommit = true;
|
|
439
436
|
results.push({ action, status: "applied", memoryId: editedId });
|
|
440
437
|
appliedTouched.push(editedId);
|
|
441
438
|
} catch (err) {
|
|
@@ -457,7 +454,6 @@ export class CorrectionExecutor {
|
|
|
457
454
|
abortSignal
|
|
458
455
|
);
|
|
459
456
|
mutationCommitted = true;
|
|
460
|
-
cancellationSafeAfterCommit = true;
|
|
461
457
|
results.push({ action, status: "applied" });
|
|
462
458
|
} catch (err) {
|
|
463
459
|
if (abortSignal?.aborted) {
|
|
@@ -501,7 +497,6 @@ export class CorrectionExecutor {
|
|
|
501
497
|
);
|
|
502
498
|
if (results.at(-1)?.status === "applied") {
|
|
503
499
|
mutationCommitted = true;
|
|
504
|
-
cancellationSafeAfterCommit = true;
|
|
505
500
|
}
|
|
506
501
|
if (results.at(-1)?.action === action && results.at(-1)?.status === "applied") {
|
|
507
502
|
removeFailedResultsFor(action);
|
|
@@ -518,7 +513,6 @@ export class CorrectionExecutor {
|
|
|
518
513
|
);
|
|
519
514
|
if (results.at(-1)?.status === "applied") {
|
|
520
515
|
mutationCommitted = true;
|
|
521
|
-
cancellationSafeAfterCommit = true;
|
|
522
516
|
}
|
|
523
517
|
if (results.at(-1)?.action === action && results.at(-1)?.status === "applied") {
|
|
524
518
|
removeFailedResultsFor(action);
|
|
@@ -530,7 +524,13 @@ export class CorrectionExecutor {
|
|
|
530
524
|
// the write ACL (review thread: authorize-rescope-destination).
|
|
531
525
|
// canWriteDestination defaults to allow when absent (single-tenant,
|
|
532
526
|
// where the source namespace already resolved to a writable scope).
|
|
533
|
-
const allowed = canWriteDestination
|
|
527
|
+
const allowed = canWriteDestination
|
|
528
|
+
? await raceAbort(
|
|
529
|
+
canWriteDestination(action.toNamespace, abortSignal),
|
|
530
|
+
abortSignal,
|
|
531
|
+
"correction apply aborted",
|
|
532
|
+
)
|
|
533
|
+
: true;
|
|
534
534
|
if (!allowed) {
|
|
535
535
|
results.push({
|
|
536
536
|
action,
|
|
@@ -546,7 +546,6 @@ export class CorrectionExecutor {
|
|
|
546
546
|
abortSignal
|
|
547
547
|
);
|
|
548
548
|
mutationCommitted = true;
|
|
549
|
-
cancellationSafeAfterCommit = true;
|
|
550
549
|
// #1678 (thread OiiV6): report the DESTINATION memory id, not the
|
|
551
550
|
// source. The source is archived by the move; callers that re-fetch
|
|
552
551
|
// the reported id need the live (destination) memory, otherwise they
|
|
@@ -589,14 +588,25 @@ export class CorrectionExecutor {
|
|
|
589
588
|
const propagationWarnings: string[] = [];
|
|
590
589
|
if (appliedTouched.length > 0) {
|
|
591
590
|
try {
|
|
592
|
-
await this.deps.propagate(namespace, appliedTouched,
|
|
591
|
+
await this.deps.propagate(namespace, appliedTouched, mutationCommitted ? undefined : abortSignal);
|
|
593
592
|
} catch (err) {
|
|
594
|
-
if (
|
|
593
|
+
if (!mutationCommitted && abortSignal?.aborted) throw err;
|
|
595
594
|
propagationWarnings.push(`propagation failed (non-fatal): ${errMsg(err)}`);
|
|
596
595
|
}
|
|
597
596
|
}
|
|
598
597
|
|
|
599
598
|
await throwIfAbortedBeforeCommitAndReset();
|
|
599
|
+
if (cancellationRequestedAfterCommit) {
|
|
600
|
+
const recordedActions = new Set(results.map((result) => result.action));
|
|
601
|
+
for (const action of plan.actions) {
|
|
602
|
+
if (recordedActions.has(action)) continue;
|
|
603
|
+
results.push({
|
|
604
|
+
action,
|
|
605
|
+
status: "skipped",
|
|
606
|
+
error: "correction apply cancelled before action started",
|
|
607
|
+
});
|
|
608
|
+
}
|
|
609
|
+
}
|
|
600
610
|
// ── Phase 4: audit record ─────────────────────────────────────────────
|
|
601
611
|
const anyFailed = results.some((r) => r.status === "failed");
|
|
602
612
|
const status: CorrectionOutcome["status"] =
|
|
@@ -621,20 +631,19 @@ export class CorrectionExecutor {
|
|
|
621
631
|
outcome,
|
|
622
632
|
requestText: plan.request.text,
|
|
623
633
|
},
|
|
624
|
-
|
|
634
|
+
mutationCommitted ? undefined : abortSignal
|
|
625
635
|
);
|
|
626
636
|
outcome.auditMemoryId = auditId;
|
|
627
637
|
} catch (err) {
|
|
628
|
-
if (
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
638
|
+
if (!mutationCommitted && abortSignal?.aborted) {
|
|
639
|
+
await resetApplying();
|
|
640
|
+
throw err;
|
|
641
|
+
}
|
|
632
642
|
(outcome as CorrectionOutcome & { warnings?: string[] }).warnings = [
|
|
633
643
|
...propagationWarnings,
|
|
634
644
|
`audit record write failed (non-fatal): ${errMsg(err)}`,
|
|
635
645
|
];
|
|
636
646
|
}
|
|
637
|
-
await throwIfAbortedBeforeCommitAndReset();
|
|
638
647
|
|
|
639
648
|
// ── Phase 5: mark plan consumed ───────────────────────────────────────
|
|
640
649
|
// Corrections are already applied (phases 1-4 succeeded). A markConsumed
|