@remnic/core 10.0.14 → 10.0.15
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/abstraction-nodes.js +3 -2
- package/dist/access-admin-ops-surface.js +33 -31
- package/dist/access-authorization-probe.js +34 -32
- package/dist/access-boundary.js +33 -31
- package/dist/access-cli.js +87 -85
- package/dist/access-cli.js.map +1 -1
- package/dist/access-extraction-force-flush.js +33 -31
- package/dist/access-http-briefing.js +34 -32
- package/dist/access-http-query.js +35 -33
- package/dist/access-http.js +52 -50
- package/dist/access-identity-continuity-surface.js +33 -31
- package/dist/access-lcm-surface.js +33 -31
- package/dist/access-mcp.js +44 -42
- package/dist/access-namespace-preflight.js +33 -31
- package/dist/access-observe-write-category.js +4 -3
- package/dist/access-observe-write-surface.js +33 -31
- package/dist/access-offline-manifest.js +3 -2
- package/dist/access-operations-batch.js +36 -34
- package/dist/access-operations.js +43 -41
- package/dist/access-recall-concurrency.js +33 -31
- package/dist/access-recall-response.js +33 -31
- package/dist/access-recall-surface.js +33 -31
- package/dist/access-schema.js +3 -2
- package/dist/access-service.js +33 -31
- package/dist/access-surface-catalog.js +35 -33
- package/dist/access-surface-catalog.js.map +1 -1
- package/dist/active-recall.js +14 -12
- package/dist/active-recall.js.map +1 -1
- package/dist/briefing.js +10 -8
- package/dist/calibration.d.ts.map +1 -1
- package/dist/calibration.js +6 -3
- package/dist/calibration.js.map +1 -1
- package/dist/causal-behavior.js +4 -3
- package/dist/causal-behavior.js.map +1 -1
- package/dist/causal-chain.js +4 -3
- package/dist/causal-consolidation.js +14 -12
- package/dist/causal-consolidation.js.map +1 -1
- package/dist/causal-retrieval.js +4 -3
- package/dist/causal-retrieval.js.map +1 -1
- package/dist/causal-trajectory.js +3 -2
- package/dist/{chunk-J7JWFZHI.js → chunk-22RM2ZUJ.js} +37 -37
- package/dist/{chunk-63B2IZYE.js → chunk-23ZQPP2G.js} +6 -1
- package/dist/chunk-23ZQPP2G.js.map +1 -0
- package/dist/{chunk-YFMBHQRG.js → chunk-2PTH4PRL.js} +2 -2
- package/dist/{chunk-TITG2NBS.js → chunk-2PYHLSXK.js} +2 -2
- package/dist/{chunk-B6O2YLUR.js → chunk-2Z5DIDQD.js} +6 -1
- package/dist/chunk-2Z5DIDQD.js.map +1 -0
- package/dist/{chunk-KH2LKDX7.js → chunk-33G67YZF.js} +2 -2
- package/dist/{chunk-LCKVXX5F.js → chunk-3GNIJUUE.js} +2 -2
- package/dist/{chunk-SWIKABKI.js → chunk-3Q3XD3NO.js} +2 -2
- package/dist/{chunk-4KY5GSMB.js → chunk-4PDTVVSW.js} +2 -2
- package/dist/{chunk-HM7RHKS4.js → chunk-4RNBLLZR.js} +2 -2
- package/dist/{chunk-PAZ35RJ4.js → chunk-4SCZZ3U7.js} +240 -55
- package/dist/chunk-4SCZZ3U7.js.map +1 -0
- package/dist/{chunk-Y4NKEXQT.js → chunk-5ATSXCAG.js} +3 -3
- package/dist/{chunk-JDZFIR2S.js → chunk-5KGYTX5O.js} +2 -2
- package/dist/{chunk-NW2E4CI2.js → chunk-5SMR542T.js} +2 -2
- package/dist/{chunk-S7LWX2PQ.js → chunk-655FVTCD.js} +2 -2
- package/dist/{chunk-ZSH2NRDV.js → chunk-6WGMZQGG.js} +2 -2
- package/dist/{chunk-W47S5TIH.js → chunk-7VQ6AI7H.js} +2 -2
- package/dist/{chunk-G7NYVKD6.js → chunk-B2NXOVZN.js} +2 -2
- package/dist/{chunk-N7KYEVLK.js → chunk-BK2BVLZW.js} +2 -2
- package/dist/{chunk-QJ622LTI.js → chunk-BQOGQULP.js} +30 -8
- package/dist/chunk-BQOGQULP.js.map +1 -0
- package/dist/{chunk-S2I7DL5Q.js → chunk-C2RW36YR.js} +2 -2
- package/dist/{chunk-P5NQN4JE.js → chunk-C6JMGAMO.js} +6 -2
- package/dist/chunk-C6JMGAMO.js.map +1 -0
- package/dist/{chunk-6LG7BWKW.js → chunk-CFZ4SXXH.js} +2 -2
- package/dist/{chunk-BLVHDY2U.js → chunk-DOWACHYO.js} +5 -2
- package/dist/chunk-DOWACHYO.js.map +1 -0
- package/dist/{chunk-4OSG5Y6M.js → chunk-DPSOFK4D.js} +2 -2
- package/dist/{chunk-QOZJCSFO.js → chunk-DQR2LD3V.js} +2 -2
- package/dist/{chunk-EBA5DA77.js → chunk-EOU6V4IN.js} +2 -2
- package/dist/{chunk-5WCJLQTM.js → chunk-F2772ATT.js} +2 -2
- package/dist/{chunk-46EST7JO.js → chunk-F2XNSIPP.js} +2 -2
- package/dist/{chunk-PZHQWFR3.js → chunk-G3UUAQOD.js} +2 -2
- package/dist/{chunk-YE36AJL7.js → chunk-GCVDFX66.js} +2 -2
- package/dist/{chunk-FFOVKNQV.js → chunk-GFAM2LTC.js} +2 -2
- package/dist/{chunk-T2YX56QI.js → chunk-GQJKVQJR.js} +2 -2
- package/dist/{chunk-L5DAHSEZ.js → chunk-GWVNGDJW.js} +2 -2
- package/dist/{chunk-N45NEBOD.js → chunk-GZXXPCWJ.js} +3 -3
- package/dist/{chunk-EPJDSQHF.js → chunk-H5IUN433.js} +2 -2
- package/dist/{chunk-EUAIYYYR.js → chunk-H6FREOYX.js} +7 -7
- package/dist/{chunk-FSIMZNBC.js → chunk-HBAOOSHU.js} +2 -2
- package/dist/{chunk-Q4E24IRR.js → chunk-HDN7IVIO.js} +14 -11
- package/dist/chunk-HDN7IVIO.js.map +1 -0
- package/dist/{chunk-T3FMRLWQ.js → chunk-HFSPY26A.js} +2 -2
- package/dist/{chunk-GH7AOMJD.js → chunk-IJMDBYCO.js} +2 -2
- package/dist/{chunk-JQ7XU625.js → chunk-IUCPLBDS.js} +6 -6
- package/dist/{chunk-WSGPFRBH.js → chunk-IWD33CF4.js} +2 -2
- package/dist/{chunk-4IHBN6WU.js → chunk-JKMIGCK6.js} +2 -2
- package/dist/{chunk-ROBHL3GL.js → chunk-JWX2Q6HS.js} +2 -2
- package/dist/{chunk-4O6WRBGE.js → chunk-KJXP6RUG.js} +5 -1
- package/dist/chunk-KJXP6RUG.js.map +1 -0
- package/dist/{chunk-JIHMUOOS.js → chunk-KLJVTZ3R.js} +3 -3
- package/dist/{chunk-FP4JYE66.js → chunk-KW4AJ7T3.js} +2 -2
- package/dist/{chunk-NIRQGDYC.js → chunk-L5VCT7LU.js} +5 -1
- package/dist/chunk-L5VCT7LU.js.map +1 -0
- package/dist/{chunk-LS2FHUML.js → chunk-LQ5SS4OP.js} +3 -3
- package/dist/{chunk-SIIRTDJ4.js → chunk-LWFWZTWX.js} +2 -2
- package/dist/{chunk-BMWN7B3Y.js → chunk-LXATZLSC.js} +3 -3
- package/dist/{chunk-B665A6BO.js → chunk-MJIOGYKX.js} +2 -2
- package/dist/{chunk-RTKV5XHL.js → chunk-MO6N4QYY.js} +2 -2
- package/dist/{chunk-N4C7QKOG.js → chunk-MWWAQXZ6.js} +2 -2
- package/dist/{chunk-ZJVMUBYF.js → chunk-NHUX6GXA.js} +6 -6
- package/dist/{chunk-CB6ANA2I.js → chunk-NZCKG25S.js} +2 -2
- package/dist/{chunk-UMTCNEVQ.js → chunk-O2YPCFJT.js} +11 -11
- package/dist/{chunk-TZNDKTX5.js → chunk-OQR42XCN.js} +37 -33
- package/dist/chunk-OQR42XCN.js.map +1 -0
- package/dist/{chunk-JYZSRNR7.js → chunk-PIITB2YZ.js} +2 -2
- package/dist/chunk-PPUNC7UX.js +73 -0
- package/dist/chunk-PPUNC7UX.js.map +1 -0
- package/dist/{chunk-EQWEIIKQ.js → chunk-PQM3B54K.js} +6 -1
- package/dist/chunk-PQM3B54K.js.map +1 -0
- package/dist/{chunk-UQDG3YLN.js → chunk-PRU7OF3Y.js} +3 -3
- package/dist/{chunk-EU534WGS.js → chunk-PVHQSLNN.js} +7 -7
- package/dist/{chunk-5VC7J76U.js → chunk-QPH52AZB.js} +2 -2
- package/dist/{chunk-XISROV24.js → chunk-QSEUUQUF.js} +2 -2
- package/dist/chunk-QUIRIG2P.js +31 -0
- package/dist/chunk-QUIRIG2P.js.map +1 -0
- package/dist/{chunk-FUFAXVBA.js → chunk-RI2KCQHP.js} +6 -2
- package/dist/chunk-RI2KCQHP.js.map +1 -0
- package/dist/{chunk-QX6JN3O4.js → chunk-RP7PQWZM.js} +6 -6
- package/dist/{chunk-O2IPAX26.js → chunk-RTTPBBAN.js} +4 -4
- package/dist/{chunk-W5MCEVUS.js → chunk-RYYVMZBR.js} +2 -2
- package/dist/{chunk-WLMZ2L5P.js → chunk-T7ASDYNK.js} +2 -2
- package/dist/{chunk-P7TOIOT7.js → chunk-THEPGZBM.js} +2 -2
- package/dist/{chunk-QODKDRSP.js → chunk-TMC7HBED.js} +4 -4
- package/dist/{chunk-I7S55EOB.js → chunk-TPNCXSXP.js} +2 -2
- package/dist/{chunk-SS3IS2JR.js → chunk-UGYUBENJ.js} +2 -2
- package/dist/{chunk-GELS5Z5Z.js → chunk-V3TXIXXY.js} +3 -3
- package/dist/{chunk-WVADKFWV.js → chunk-VNZMZPAC.js} +2 -2
- package/dist/{chunk-JPTPS4OB.js → chunk-VPXIKBPX.js} +2 -2
- package/dist/{chunk-OP6N4H6A.js → chunk-W3FVQBGF.js} +2 -2
- package/dist/{chunk-DPR2WTN3.js → chunk-WGTR573G.js} +16 -16
- package/dist/{chunk-W3K3HITK.js → chunk-WLT6LTQP.js} +2 -2
- package/dist/{chunk-GMXWTJNU.js → chunk-XKRXN63M.js} +2 -2
- package/dist/{chunk-ZV65I6ME.js → chunk-XLBFX63V.js} +28 -25
- package/dist/chunk-XLBFX63V.js.map +1 -0
- package/dist/{chunk-KR6ZKECI.js → chunk-XYGQSDTH.js} +3 -3
- package/dist/{chunk-6WHJ2EAB.js → chunk-Z64TS5V4.js} +2 -2
- package/dist/{chunk-NHLLKEKK.js → chunk-ZAJLJ35W.js} +2 -2
- package/dist/{chunk-O4SGYW7H.js → chunk-ZKHSAMTE.js} +2 -2
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +72 -70
- package/dist/coding/export-okf-codegraph.js +9 -7
- package/dist/coding/export-okf-codegraph.js.map +1 -1
- package/dist/coding/pre-action-gate.js +4 -3
- package/dist/commitment-ledger.js +3 -2
- package/dist/compounding/engine.js +11 -9
- package/dist/config.js +14 -12
- package/dist/connectors/codex-materialize-runner.js +10 -8
- package/dist/connectors/index.js +10 -8
- package/dist/consolidation-provenance-check.d.ts.map +1 -1
- package/dist/consolidation-provenance-check.js +2 -1
- package/dist/contradiction/index.js +3 -2
- package/dist/convergence-refresh.js +12 -10
- package/dist/corpus-watermark.js +12 -10
- package/dist/correction/correction-planner.d.ts.map +1 -1
- package/dist/cue-anchors.js +4 -3
- package/dist/deep-recall-http-glue.js +4 -3
- package/dist/{dreams-ledger-567VKVOU.js → dreams-ledger-UCHHRQ4R.js} +3 -2
- package/dist/entity-retrieval.js +10 -8
- package/dist/eval-trajectory-store.js +4 -3
- package/dist/eval-trajectory.js +4 -3
- package/dist/evals.js +3 -2
- package/dist/external-wiki-access.js +34 -32
- package/dist/extraction.js +12 -10
- package/dist/{first-start-migration-6A5BJPDW.js → first-start-migration-QVD22WWS.js} +6 -5
- package/dist/{first-start-migration-6A5BJPDW.js.map → first-start-migration-QVD22WWS.js.map} +1 -1
- package/dist/harmonic-construction.js +5 -4
- package/dist/harmonic-retrieval.js +14 -12
- package/dist/harmonic-source-lookup.js +3 -2
- package/dist/index.js +87 -85
- package/dist/json-store.d.ts.map +1 -1
- package/dist/json-store.js +2 -1
- package/dist/location/index.js +12 -10
- package/dist/maintenance/dreams-ledger.d.ts.map +1 -1
- package/dist/maintenance/memory-governance.d.ts.map +1 -1
- package/dist/maintenance/memory-governance.js +10 -8
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +10 -8
- package/dist/maintenance/rebuild-memory-projection-runner.js +12 -10
- package/dist/maintenance/rebuild-memory-projection.js +11 -9
- package/dist/memory-browse-operations.js +34 -32
- package/dist/namespaces/migrate.js +11 -9
- package/dist/namespaces/search.js +7 -6
- package/dist/namespaces/storage.d.ts.map +1 -1
- package/dist/namespaces/storage.js +10 -8
- package/dist/objective-state-writers.js +4 -3
- package/dist/objective-state.js +3 -2
- package/dist/offline-sync-snapshot-stream.js +3 -2
- package/dist/offline-sync.d.ts.map +1 -1
- package/dist/offline-sync.js +2 -1
- package/dist/operator-doctor-corpus.js +13 -11
- package/dist/operator-toolkit.js +25 -23
- package/dist/orchestration/maintenance.js +20 -18
- package/dist/orchestrator.js +87 -85
- package/dist/profiling.d.ts.map +1 -1
- package/dist/profiling.js +2 -1
- package/dist/recall-navigation-operations.js +34 -32
- package/dist/recall-navigation.js +33 -31
- package/dist/{resolution-7AY36LGJ.js → resolution-ZU5BIAJA.js} +4 -3
- package/dist/resume-bundles.js +19 -17
- package/dist/retrieval-agents.d.ts +1 -1
- package/dist/retrieval-agents.d.ts.map +1 -1
- package/dist/retrieval-agents.js +7 -1
- package/dist/search/document-scanner.d.ts.map +1 -1
- package/dist/search/document-scanner.js +2 -1
- package/dist/search/factory.js +6 -5
- package/dist/search/index.js +6 -5
- package/dist/search/lancedb-backend.js +3 -2
- package/dist/search/meilisearch-backend.js +3 -2
- package/dist/search/orama-backend.js +3 -2
- package/dist/semantic-consolidation.js +11 -9
- package/dist/semantic-rule-promotion.js +10 -8
- package/dist/semantic-rule-verifier.js +10 -8
- package/dist/source-agent-qualifier.js +10 -8
- package/dist/standup/build.js +10 -8
- package/dist/storage/entity-canonical-id-migration.d.ts.map +1 -1
- package/dist/storage/entity-store.d.ts +32 -1
- package/dist/storage/entity-store.d.ts.map +1 -1
- package/dist/storage/memory-read-store.d.ts.map +1 -1
- package/dist/storage/supersession-audit.d.ts.map +1 -1
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +9 -7
- package/dist/support-passport/index.js +36 -34
- package/dist/{tier-stats-RQM76XYY.js → tier-stats-C3IAMS4X.js} +6 -5
- package/dist/{tier-stats-RQM76XYY.js.map → tier-stats-C3IAMS4X.js.map} +1 -1
- package/dist/transcript.d.ts.map +1 -1
- package/dist/transcript.js +2 -1
- package/dist/transfer/export-okf.js +10 -8
- package/dist/trust-zones.js +3 -2
- package/dist/utility-learner.js +4 -3
- package/dist/utility-runtime.js +5 -4
- package/dist/utility-telemetry.js +3 -2
- package/dist/utils/macos-replication-junk.d.ts +32 -0
- package/dist/utils/macos-replication-junk.d.ts.map +1 -0
- package/dist/utils/malformed-entity-record.d.ts +24 -0
- package/dist/utils/malformed-entity-record.d.ts.map +1 -0
- package/dist/verified-recall.js +10 -8
- package/dist/who-knows-cli.js +11 -9
- package/dist/who-knows.js +10 -8
- package/dist/work-product-ledger.js +3 -2
- package/package.json +2 -2
- package/src/calibration.ts +3 -2
- package/src/cli.ts +2 -2
- package/src/consolidation-provenance-check.ts +2 -0
- package/src/correction/correction-planner.ts +3 -2
- package/src/json-store.ts +3 -0
- package/src/macos-replication-junk-scanners.test.ts +275 -0
- package/src/maintenance/dreams-ledger.ts +2 -0
- package/src/maintenance/memory-governance.ts +2 -0
- package/src/namespaces/storage.ts +2 -0
- package/src/offline-sync-macos-junk.test.ts +169 -0
- package/src/offline-sync.ts +7 -0
- package/src/profiling.ts +2 -1
- package/src/retrieval-agents.ts +29 -12
- package/src/search/document-scanner.ts +4 -0
- package/src/storage/entity-canonical-id-migration.ts +56 -13
- package/src/storage/entity-store.ts +173 -15
- package/src/storage/memory-read-store.ts +30 -5
- package/src/storage/supersession-audit.ts +2 -0
- package/src/storage.ts +3 -2
- package/src/transcript.ts +11 -10
- package/src/utils/macos-replication-junk.test.ts +46 -0
- package/src/utils/macos-replication-junk.ts +65 -0
- package/src/utils/malformed-entity-record.ts +101 -0
- package/dist/chunk-4O6WRBGE.js.map +0 -1
- package/dist/chunk-63B2IZYE.js.map +0 -1
- package/dist/chunk-B6O2YLUR.js.map +0 -1
- package/dist/chunk-BLVHDY2U.js.map +0 -1
- package/dist/chunk-EQWEIIKQ.js.map +0 -1
- package/dist/chunk-FUFAXVBA.js.map +0 -1
- package/dist/chunk-NIRQGDYC.js.map +0 -1
- package/dist/chunk-P5NQN4JE.js.map +0 -1
- package/dist/chunk-PAZ35RJ4.js.map +0 -1
- package/dist/chunk-Q4E24IRR.js.map +0 -1
- package/dist/chunk-QJ622LTI.js.map +0 -1
- package/dist/chunk-TZNDKTX5.js.map +0 -1
- package/dist/chunk-ZV65I6ME.js.map +0 -1
- /package/dist/{chunk-J7JWFZHI.js.map → chunk-22RM2ZUJ.js.map} +0 -0
- /package/dist/{chunk-YFMBHQRG.js.map → chunk-2PTH4PRL.js.map} +0 -0
- /package/dist/{chunk-TITG2NBS.js.map → chunk-2PYHLSXK.js.map} +0 -0
- /package/dist/{chunk-KH2LKDX7.js.map → chunk-33G67YZF.js.map} +0 -0
- /package/dist/{chunk-LCKVXX5F.js.map → chunk-3GNIJUUE.js.map} +0 -0
- /package/dist/{chunk-SWIKABKI.js.map → chunk-3Q3XD3NO.js.map} +0 -0
- /package/dist/{chunk-4KY5GSMB.js.map → chunk-4PDTVVSW.js.map} +0 -0
- /package/dist/{chunk-HM7RHKS4.js.map → chunk-4RNBLLZR.js.map} +0 -0
- /package/dist/{chunk-Y4NKEXQT.js.map → chunk-5ATSXCAG.js.map} +0 -0
- /package/dist/{chunk-JDZFIR2S.js.map → chunk-5KGYTX5O.js.map} +0 -0
- /package/dist/{chunk-NW2E4CI2.js.map → chunk-5SMR542T.js.map} +0 -0
- /package/dist/{chunk-S7LWX2PQ.js.map → chunk-655FVTCD.js.map} +0 -0
- /package/dist/{chunk-ZSH2NRDV.js.map → chunk-6WGMZQGG.js.map} +0 -0
- /package/dist/{chunk-W47S5TIH.js.map → chunk-7VQ6AI7H.js.map} +0 -0
- /package/dist/{chunk-G7NYVKD6.js.map → chunk-B2NXOVZN.js.map} +0 -0
- /package/dist/{chunk-N7KYEVLK.js.map → chunk-BK2BVLZW.js.map} +0 -0
- /package/dist/{chunk-S2I7DL5Q.js.map → chunk-C2RW36YR.js.map} +0 -0
- /package/dist/{chunk-6LG7BWKW.js.map → chunk-CFZ4SXXH.js.map} +0 -0
- /package/dist/{chunk-4OSG5Y6M.js.map → chunk-DPSOFK4D.js.map} +0 -0
- /package/dist/{chunk-QOZJCSFO.js.map → chunk-DQR2LD3V.js.map} +0 -0
- /package/dist/{chunk-EBA5DA77.js.map → chunk-EOU6V4IN.js.map} +0 -0
- /package/dist/{chunk-5WCJLQTM.js.map → chunk-F2772ATT.js.map} +0 -0
- /package/dist/{chunk-46EST7JO.js.map → chunk-F2XNSIPP.js.map} +0 -0
- /package/dist/{chunk-PZHQWFR3.js.map → chunk-G3UUAQOD.js.map} +0 -0
- /package/dist/{chunk-YE36AJL7.js.map → chunk-GCVDFX66.js.map} +0 -0
- /package/dist/{chunk-FFOVKNQV.js.map → chunk-GFAM2LTC.js.map} +0 -0
- /package/dist/{chunk-T2YX56QI.js.map → chunk-GQJKVQJR.js.map} +0 -0
- /package/dist/{chunk-L5DAHSEZ.js.map → chunk-GWVNGDJW.js.map} +0 -0
- /package/dist/{chunk-N45NEBOD.js.map → chunk-GZXXPCWJ.js.map} +0 -0
- /package/dist/{chunk-EPJDSQHF.js.map → chunk-H5IUN433.js.map} +0 -0
- /package/dist/{chunk-EUAIYYYR.js.map → chunk-H6FREOYX.js.map} +0 -0
- /package/dist/{chunk-FSIMZNBC.js.map → chunk-HBAOOSHU.js.map} +0 -0
- /package/dist/{chunk-T3FMRLWQ.js.map → chunk-HFSPY26A.js.map} +0 -0
- /package/dist/{chunk-GH7AOMJD.js.map → chunk-IJMDBYCO.js.map} +0 -0
- /package/dist/{chunk-JQ7XU625.js.map → chunk-IUCPLBDS.js.map} +0 -0
- /package/dist/{chunk-WSGPFRBH.js.map → chunk-IWD33CF4.js.map} +0 -0
- /package/dist/{chunk-4IHBN6WU.js.map → chunk-JKMIGCK6.js.map} +0 -0
- /package/dist/{chunk-ROBHL3GL.js.map → chunk-JWX2Q6HS.js.map} +0 -0
- /package/dist/{chunk-JIHMUOOS.js.map → chunk-KLJVTZ3R.js.map} +0 -0
- /package/dist/{chunk-FP4JYE66.js.map → chunk-KW4AJ7T3.js.map} +0 -0
- /package/dist/{chunk-LS2FHUML.js.map → chunk-LQ5SS4OP.js.map} +0 -0
- /package/dist/{chunk-SIIRTDJ4.js.map → chunk-LWFWZTWX.js.map} +0 -0
- /package/dist/{chunk-BMWN7B3Y.js.map → chunk-LXATZLSC.js.map} +0 -0
- /package/dist/{chunk-B665A6BO.js.map → chunk-MJIOGYKX.js.map} +0 -0
- /package/dist/{chunk-RTKV5XHL.js.map → chunk-MO6N4QYY.js.map} +0 -0
- /package/dist/{chunk-N4C7QKOG.js.map → chunk-MWWAQXZ6.js.map} +0 -0
- /package/dist/{chunk-ZJVMUBYF.js.map → chunk-NHUX6GXA.js.map} +0 -0
- /package/dist/{chunk-CB6ANA2I.js.map → chunk-NZCKG25S.js.map} +0 -0
- /package/dist/{chunk-UMTCNEVQ.js.map → chunk-O2YPCFJT.js.map} +0 -0
- /package/dist/{chunk-JYZSRNR7.js.map → chunk-PIITB2YZ.js.map} +0 -0
- /package/dist/{chunk-UQDG3YLN.js.map → chunk-PRU7OF3Y.js.map} +0 -0
- /package/dist/{chunk-EU534WGS.js.map → chunk-PVHQSLNN.js.map} +0 -0
- /package/dist/{chunk-5VC7J76U.js.map → chunk-QPH52AZB.js.map} +0 -0
- /package/dist/{chunk-XISROV24.js.map → chunk-QSEUUQUF.js.map} +0 -0
- /package/dist/{chunk-QX6JN3O4.js.map → chunk-RP7PQWZM.js.map} +0 -0
- /package/dist/{chunk-O2IPAX26.js.map → chunk-RTTPBBAN.js.map} +0 -0
- /package/dist/{chunk-W5MCEVUS.js.map → chunk-RYYVMZBR.js.map} +0 -0
- /package/dist/{chunk-WLMZ2L5P.js.map → chunk-T7ASDYNK.js.map} +0 -0
- /package/dist/{chunk-P7TOIOT7.js.map → chunk-THEPGZBM.js.map} +0 -0
- /package/dist/{chunk-QODKDRSP.js.map → chunk-TMC7HBED.js.map} +0 -0
- /package/dist/{chunk-I7S55EOB.js.map → chunk-TPNCXSXP.js.map} +0 -0
- /package/dist/{chunk-SS3IS2JR.js.map → chunk-UGYUBENJ.js.map} +0 -0
- /package/dist/{chunk-GELS5Z5Z.js.map → chunk-V3TXIXXY.js.map} +0 -0
- /package/dist/{chunk-WVADKFWV.js.map → chunk-VNZMZPAC.js.map} +0 -0
- /package/dist/{chunk-JPTPS4OB.js.map → chunk-VPXIKBPX.js.map} +0 -0
- /package/dist/{chunk-OP6N4H6A.js.map → chunk-W3FVQBGF.js.map} +0 -0
- /package/dist/{chunk-DPR2WTN3.js.map → chunk-WGTR573G.js.map} +0 -0
- /package/dist/{chunk-W3K3HITK.js.map → chunk-WLT6LTQP.js.map} +0 -0
- /package/dist/{chunk-GMXWTJNU.js.map → chunk-XKRXN63M.js.map} +0 -0
- /package/dist/{chunk-KR6ZKECI.js.map → chunk-XYGQSDTH.js.map} +0 -0
- /package/dist/{chunk-6WHJ2EAB.js.map → chunk-Z64TS5V4.js.map} +0 -0
- /package/dist/{chunk-NHLLKEKK.js.map → chunk-ZAJLJ35W.js.map} +0 -0
- /package/dist/{chunk-O4SGYW7H.js.map → chunk-ZKHSAMTE.js.map} +0 -0
- /package/dist/{dreams-ledger-567VKVOU.js.map → dreams-ledger-UCHHRQ4R.js.map} +0 -0
- /package/dist/{resolution-7AY36LGJ.js.map → resolution-ZU5BIAJA.js.map} +0 -0
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
} from "./chunk-ULM7JCDH.js";
|
|
17
17
|
import {
|
|
18
18
|
resolveEvalStoreDir
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-JKMIGCK6.js";
|
|
20
20
|
|
|
21
21
|
// src/eval-trajectory-store.ts
|
|
22
22
|
import { mkdir, readFile, rename, rm, writeFile } from "fs/promises";
|
|
@@ -237,4 +237,4 @@ export {
|
|
|
237
237
|
writeEvalTrajectoryReport,
|
|
238
238
|
readEvalTrajectoryReport
|
|
239
239
|
};
|
|
240
|
-
//# sourceMappingURL=chunk-
|
|
240
|
+
//# sourceMappingURL=chunk-PIITB2YZ.js.map
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
// src/utils/malformed-entity-record.ts
|
|
2
|
+
function entityRecordFlags(content) {
|
|
3
|
+
const body = entityRecordBody(content);
|
|
4
|
+
let hasName = false;
|
|
5
|
+
let hasType = false;
|
|
6
|
+
let start = 0;
|
|
7
|
+
while (start <= body.length) {
|
|
8
|
+
const newline = body.indexOf("\n", start);
|
|
9
|
+
const end = newline === -1 ? body.length : newline;
|
|
10
|
+
let line = body.slice(start, end);
|
|
11
|
+
if (line.endsWith("\r")) line = line.slice(0, -1);
|
|
12
|
+
if (!hasName && line.startsWith("# ") && line.slice(2).trim().length > 0) hasName = true;
|
|
13
|
+
if (!hasType && line.startsWith("**Type:**") && line.slice("**Type:**".length).trim().length > 0) {
|
|
14
|
+
hasType = true;
|
|
15
|
+
}
|
|
16
|
+
if (hasName && hasType) return { hasName, hasType };
|
|
17
|
+
if (newline === -1) break;
|
|
18
|
+
start = newline + 1;
|
|
19
|
+
}
|
|
20
|
+
return { hasName, hasType };
|
|
21
|
+
}
|
|
22
|
+
function isUnnamedEntityRecord(content) {
|
|
23
|
+
return !entityRecordFlags(content).hasName;
|
|
24
|
+
}
|
|
25
|
+
function entityBodyHasText(content) {
|
|
26
|
+
const body = entityRecordBody(content);
|
|
27
|
+
for (let i = 0; i < body.length; i++) {
|
|
28
|
+
const char = body.charCodeAt(i);
|
|
29
|
+
if (char !== 32 && char !== 9 && char !== 10 && char !== 13) return true;
|
|
30
|
+
}
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
function isPopulatedUnnamedEntityRecord(content) {
|
|
34
|
+
return isUnnamedEntityRecord(content) && entityBodyHasText(content);
|
|
35
|
+
}
|
|
36
|
+
function isShapedUnnamedEntityRecord(content) {
|
|
37
|
+
if (!isUnnamedEntityRecord(content)) return false;
|
|
38
|
+
const body = entityRecordBody(content);
|
|
39
|
+
let start = 0;
|
|
40
|
+
while (start <= body.length) {
|
|
41
|
+
const newline = body.indexOf("\n", start);
|
|
42
|
+
const end = newline === -1 ? body.length : newline;
|
|
43
|
+
let line = body.slice(start, end);
|
|
44
|
+
if (line.endsWith("\r")) line = line.slice(0, -1);
|
|
45
|
+
if (line.startsWith("#") || line.startsWith("**Type:**")) return true;
|
|
46
|
+
if (newline === -1) break;
|
|
47
|
+
start = newline + 1;
|
|
48
|
+
}
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
function isMalformedEntityRecord(content) {
|
|
52
|
+
const flags = entityRecordFlags(content);
|
|
53
|
+
return !flags.hasName || !flags.hasType;
|
|
54
|
+
}
|
|
55
|
+
function entityRecordBody(content) {
|
|
56
|
+
const firstNewline = content.indexOf("\n");
|
|
57
|
+
if (firstNewline === -1) return content;
|
|
58
|
+
const firstLine = content.slice(0, firstNewline).endsWith("\r") ? content.slice(0, firstNewline - 1) : content.slice(0, firstNewline);
|
|
59
|
+
if (firstLine !== "---") return content;
|
|
60
|
+
const close = content.indexOf("\n---", firstNewline + 1);
|
|
61
|
+
if (close === -1) return content;
|
|
62
|
+
let rest = close + "\n---".length;
|
|
63
|
+
if (content.charAt(rest) === "\r") rest += 1;
|
|
64
|
+
if (content.charAt(rest) === "\n") rest += 1;
|
|
65
|
+
return content.slice(rest);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export {
|
|
69
|
+
isPopulatedUnnamedEntityRecord,
|
|
70
|
+
isShapedUnnamedEntityRecord,
|
|
71
|
+
isMalformedEntityRecord
|
|
72
|
+
};
|
|
73
|
+
//# sourceMappingURL=chunk-PPUNC7UX.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utils/malformed-entity-record.ts"],"sourcesContent":["/**\n * Heading and type flags for an entity markdown body.\n *\n * The heading rule matches `parseEntityFile`: a line must start with `# `\n * (hash, space) and the remainder must contain a name. A tab after `#`\n * is not a heading. The type rule matches a `**Type:**` line with a\n * non-empty value. A missing type line is still readable: the parser\n * defaults the type to `other`.\n */\nfunction entityRecordFlags(content: string): { hasName: boolean; hasType: boolean } {\n const body = entityRecordBody(content);\n let hasName = false;\n let hasType = false;\n let start = 0;\n while (start <= body.length) {\n const newline = body.indexOf(\"\\n\", start);\n const end = newline === -1 ? body.length : newline;\n let line = body.slice(start, end);\n if (line.endsWith(\"\\r\")) line = line.slice(0, -1);\n if (!hasName && line.startsWith(\"# \") && line.slice(2).trim().length > 0) hasName = true;\n if (!hasType && line.startsWith(\"**Type:**\") && line.slice(\"**Type:**\".length).trim().length > 0) {\n hasType = true;\n }\n if (hasName && hasType) return { hasName, hasType };\n if (newline === -1) break;\n start = newline + 1;\n }\n return { hasName, hasType };\n}\n\n/**\n * No `# ` name. A named file whose type line is absent stays readable:\n * `parseEntityFile` defaults the type to `other`.\n */\nexport function isUnnamedEntityRecord(content: string): boolean {\n return !entityRecordFlags(content).hasName;\n}\n\nfunction entityBodyHasText(content: string): boolean {\n const body = entityRecordBody(content);\n for (let i = 0; i < body.length; i++) {\n const char = body.charCodeAt(i);\n if (char !== 32 && char !== 9 && char !== 10 && char !== 13) return true;\n }\n return false;\n}\n\n/**\n * Unnamed entity body that still has text. An empty body under frontmatter\n * stays readable so a canonical filename can supply the type. A tab heading,\n * a blank `# ` heading, or prose with no name does not.\n */\nexport function isPopulatedUnnamedEntityRecord(content: string): boolean {\n return isUnnamedEntityRecord(content) && entityBodyHasText(content);\n}\n\n/**\n * Unnamed file that still looks like an entity record (`#` or `**Type:**`).\n * Direct filename recall keeps unstructured placeholders such as \"content\".\n */\nexport function isShapedUnnamedEntityRecord(content: string): boolean {\n if (!isUnnamedEntityRecord(content)) return false;\n const body = entityRecordBody(content);\n let start = 0;\n while (start <= body.length) {\n const newline = body.indexOf(\"\\n\", start);\n const end = newline === -1 ? body.length : newline;\n let line = body.slice(start, end);\n if (line.endsWith(\"\\r\")) line = line.slice(0, -1);\n if (line.startsWith(\"#\") || line.startsWith(\"**Type:**\")) return true;\n if (newline === -1) break;\n start = newline + 1;\n }\n return false;\n}\n\n/**\n * Migration gate. Canonical ids are derived from name and type, and the\n * old startup throw required an explicit `**Type:**` line. Files that\n * only have a heading stay on disk and are not renamed. Listing does not\n * use this predicate: `parseEntityFile` defaults a missing type to `other`.\n */\nexport function isMalformedEntityRecord(content: string): boolean {\n const flags = entityRecordFlags(content);\n return !flags.hasName || !flags.hasType;\n}\n\nfunction entityRecordBody(content: string): string {\n const firstNewline = content.indexOf(\"\\n\");\n if (firstNewline === -1) return content;\n const firstLine = content.slice(0, firstNewline).endsWith(\"\\r\")\n ? content.slice(0, firstNewline - 1)\n : content.slice(0, firstNewline);\n if (firstLine !== \"---\") return content;\n const close = content.indexOf(\"\\n---\", firstNewline + 1);\n if (close === -1) return content;\n let rest = close + \"\\n---\".length;\n if (content.charAt(rest) === \"\\r\") rest += 1;\n if (content.charAt(rest) === \"\\n\") rest += 1;\n return content.slice(rest);\n}\n"],"mappings":";AASA,SAAS,kBAAkB,SAAyD;AAClF,QAAM,OAAO,iBAAiB,OAAO;AACrC,MAAI,UAAU;AACd,MAAI,UAAU;AACd,MAAI,QAAQ;AACZ,SAAO,SAAS,KAAK,QAAQ;AAC3B,UAAM,UAAU,KAAK,QAAQ,MAAM,KAAK;AACxC,UAAM,MAAM,YAAY,KAAK,KAAK,SAAS;AAC3C,QAAI,OAAO,KAAK,MAAM,OAAO,GAAG;AAChC,QAAI,KAAK,SAAS,IAAI,EAAG,QAAO,KAAK,MAAM,GAAG,EAAE;AAChD,QAAI,CAAC,WAAW,KAAK,WAAW,IAAI,KAAK,KAAK,MAAM,CAAC,EAAE,KAAK,EAAE,SAAS,EAAG,WAAU;AACpF,QAAI,CAAC,WAAW,KAAK,WAAW,WAAW,KAAK,KAAK,MAAM,YAAY,MAAM,EAAE,KAAK,EAAE,SAAS,GAAG;AAChG,gBAAU;AAAA,IACZ;AACA,QAAI,WAAW,QAAS,QAAO,EAAE,SAAS,QAAQ;AAClD,QAAI,YAAY,GAAI;AACpB,YAAQ,UAAU;AAAA,EACpB;AACA,S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AQ,MAAM,GAAG,YAAY;AACjC,MAAI,cAAc,MAAO,QAAO;AAChC,QAAM,QAAQ,QAAQ,QAAQ,SAAS,eAAe,CAAC;AACvD,MAAI,UAAU,GAAI,QAAO;AACzB,MAAI,OAAO,QAAQ,QAAQ;AAC3B,MAAI,QAAQ,OAAO,IAAI,MAAM,KAAM,SAAQ;AAC3C,MAAI,QAAQ,OAAO,IAAI,MAAM,KAAM,SAAQ;AAC3C,SAAO,QAAQ,MAAM,IAAI;AAC3B;","names":[]}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isMacOsReplicationJunkBasename
|
|
3
|
+
} from "./chunk-QUIRIG2P.js";
|
|
4
|
+
|
|
1
5
|
// src/maintenance/dreams-ledger.ts
|
|
2
6
|
import path from "path";
|
|
3
7
|
import { createReadStream } from "fs";
|
|
@@ -289,6 +293,7 @@ async function listMemoryFiles(memoryDir) {
|
|
|
289
293
|
}
|
|
290
294
|
for (const entry of entries) {
|
|
291
295
|
if (entry.isSymbolicLink()) continue;
|
|
296
|
+
if (isMacOsReplicationJunkBasename(entry.name)) continue;
|
|
292
297
|
const full = path.join(dir, entry.name);
|
|
293
298
|
if (entry.isDirectory()) {
|
|
294
299
|
if (entry.name === "state" || entry.name === "archive" || entry.name === "namespaces" || entry.name === ".git") continue;
|
|
@@ -313,4 +318,4 @@ export {
|
|
|
313
318
|
runDreamsPhase,
|
|
314
319
|
summarizeGovernanceResultForDreams
|
|
315
320
|
};
|
|
316
|
-
//# sourceMappingURL=chunk-
|
|
321
|
+
//# sourceMappingURL=chunk-PQM3B54K.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/maintenance/dreams-ledger.ts"],"sourcesContent":["/**\n * dreams-ledger.ts — per-phase telemetry for the Dreams consolidation pipeline.\n *\n * Every scheduled or manual phase run appends one JSONL entry to\n * <memoryDir>/state/dreams-ledger.jsonl\n *\n * The entry records which phase ran, how long it took, and a small\n * itemsProcessed counter so `remnic dreams status` can aggregate the last\n * 24-hour window without scanning the full memory corpus.\n *\n * This module is intentionally side-effect-free on import (no fs calls at\n * module load time) so tests can import it without touching the filesystem.\n */\n\nimport path from \"node:path\";\nimport { createReadStream, type ReadStream } from \"node:fs\";\nimport { appendFile, lstat, mkdir, readdir, readFile } from \"node:fs/promises\";\nimport { createInterface } from \"node:readline\";\nimport { isMacOsReplicationJunkBasename } from \"../utils/macos-replication-junk.js\";\n\n// ── Types ─────────────────────────────────────────────────────────────────────\n\n/** The three named phases of the Dreams consolidation pipeline. */\nexport type DreamsPhase = \"lightSleep\" | \"rem\" | \"deepSleep\";\n\n/**\n * One entry written to the dreams ledger for every phase run.\n * Older entries that predate this field simply won't have it (no backfill).\n */\nexport interface DreamsLedgerEntry {\n /** Schema version — always 1 for entries written by this module. */\n schemaVersion: 1;\n /** ISO-8601 timestamp when the phase run started. */\n startedAt: string;\n /** ISO-8601 timestamp when the phase run completed. */\n completedAt: string;\n /** Wall-clock duration in milliseconds. */\n durationMs: number;\n /**\n * Which Dreams phase this entry represents.\n * - `lightSleep` — recent activity scoring + clustering\n * - `rem` — cross-session synthesis, supersession, consolidation\n * - `deepSleep` — tier migration, page-version snapshots, archive\n */\n phase: DreamsPhase;\n /** How many memory items were evaluated (scored / clustered / migrated). */\n itemsProcessed: number;\n /** Whether this was a dry-run (no writes committed). */\n dryRun: boolean;\n /**\n * How the phase was triggered.\n * - `scheduled` — invoked by the governance cron or orchestrator maintenance pass\n * - `manual` — invoked via `remnic dreams run`\n */\n trigger: \"scheduled\" | \"manual\";\n /** Free-form notes for debugging (optional, never required). */\n notes?: string;\n}\n\n/** Aggregated stats for a single phase over a time window. */\nexport interface DreamsPhaseStatus {\n phase: DreamsPhase;\n /** Number of phase runs in the window. */\n runCount: number;\n /** Total wall-clock milliseconds across all runs in the window. */\n totalDurationMs: number;\n /** Total items processed across all runs in the window. */\n totalItemsProcessed: number;\n /** ISO-8601 timestamp of the most recent completed run, or null if none. */\n lastRunAt: string | null;\n /** Duration of the most recent run in ms, or null if none. */\n lastDurationMs: number | null;\n}\n\n/** Shape returned by `getDreamsStatus` — the canonical telemetry response. */\nexport interface DreamsStatusResult {\n /** ISO-8601 start of the query window (inclusive). */\n windowStart: string;\n /** ISO-8601 end of the query window (exclusive). */\n windowEnd: string;\n /** Per-phase summaries, always present for all three phases. */\n phases: {\n lightSleep: DreamsPhaseStatus;\n rem: DreamsPhaseStatus;\n deepSleep: DreamsPhaseStatus;\n };\n}\n\n// ── Path helpers ──────────────────────────────────────────────────────────────\n\nexport function dreamsLedgerPath(memoryDir: string): string {\n return path.join(memoryDir, \"state\", \"dreams-ledger.jsonl\");\n}\n\n// ── Writer ────────────────────────────────────────────────────────────────────\n\n/**\n * Append a single entry to the dreams ledger.\n * Creates the file (and its parent directory) if needed.\n * Uses `appendFile` (O_APPEND) so concurrent callers never overwrite each other.\n */\nexport async function appendDreamsLedgerEntry(\n memoryDir: string,\n entry: DreamsLedgerEntry,\n): Promise<void> {\n const ledgerPath = dreamsLedgerPath(memoryDir);\n await mkdir(path.dirname(ledgerPath), { recursive: true });\n await appendFile(ledgerPath, JSON.stringify(entry) + \"\\n\", \"utf-8\");\n}\n\n// ── Reader ────────────────────────────────────────────────────────────────────\n\n/**\n * Parse and validate one ledger line into a `DreamsLedgerEntry`, or `null` when\n * blank/malformed/incomplete. Shared by the streaming reader and the windowed\n * status aggregator so both apply the identical fail-open guard.\n */\nfunction parseDreamsLedgerLine(line: string): DreamsLedgerEntry | null {\n const trimmed = line.trim();\n if (!trimmed) return null;\n let parsed: Record<string, unknown>;\n try {\n const raw = JSON.parse(trimmed);\n if (typeof raw !== \"object\" || raw === null) return null;\n parsed = raw as Record<string, unknown>;\n } catch {\n return null; // Malformed JSON — skip (fail-open).\n }\n\n // Required, strongly-typed fields. A row missing or mistyping any of these is\n // not a usable telemetry entry.\n const phase = parsed.phase;\n if (phase !== \"lightSleep\" && phase !== \"rem\" && phase !== \"deepSleep\") return null;\n if (\n typeof parsed.startedAt !== \"string\" ||\n typeof parsed.completedAt !== \"string\" ||\n typeof parsed.durationMs !== \"number\" ||\n typeof parsed.itemsProcessed !== \"number\"\n ) {\n return null;\n }\n\n // Optional fields: absence is tolerated (older entries predate them, no\n // backfill), but a PRESENT value with the wrong type/value marks the row\n // malformed and skips it — never silently coerced to a default (issue #1910).\n if (\"schemaVersion\" in parsed && parsed.schemaVersion !== 1) return null;\n if (\"dryRun\" in parsed && typeof parsed.dryRun !== \"boolean\") return null;\n if (\"trigger\" in parsed && parsed.trigger !== \"manual\" && parsed.trigger !== \"scheduled\") {\n return null;\n }\n\n return {\n schemaVersion: 1,\n startedAt: parsed.startedAt,\n completedAt: parsed.completedAt,\n durationMs: parsed.durationMs,\n phase,\n itemsProcessed: parsed.itemsProcessed,\n dryRun: parsed.dryRun === true,\n trigger: parsed.trigger === \"manual\" ? \"manual\" : \"scheduled\",\n notes: typeof parsed.notes === \"string\" ? parsed.notes : undefined,\n };\n}\n\n/**\n * Stream the dreams ledger line-by-line. The ledger is plaintext `appendFile`\n * (never encrypted), so a raw line stream is safe at any size — heap stays\n * O(1) in the file, unlike the previous whole-file `readFile` + `split`.\n * Yields nothing when the ledger does not exist yet.\n */\nexport async function* streamDreamsLedgerLines(memoryDir: string): AsyncGenerator<string> {\n const ledgerPath = dreamsLedgerPath(memoryDir);\n let input: ReadStream;\n try {\n input = createReadStream(ledgerPath, { encoding: \"utf8\" });\n } catch (err) {\n if ((err as NodeJS.ErrnoException).code === \"ENOENT\") return;\n throw err;\n }\n const rl = createInterface({ input, crlfDelay: Infinity });\n try {\n for await (const line of rl) yield line;\n } catch (err) {\n if ((err as NodeJS.ErrnoException).code === \"ENOENT\") return;\n throw err;\n } finally {\n // Close the readline interface AND destroy the underlying stream. When a\n // consumer stops early (e.g. `getDreamsStatus` breaks out), the generator's\n // `.return()` runs this finally; `rl.close()` alone leaves the file\n // descriptor open, so destroy the stream to release it (issue #1910).\n rl.close();\n input.destroy();\n }\n}\n\n/**\n * Parse all valid `DreamsLedgerEntry` rows from the ledger file. Thin wrapper\n * over the line stream so any caller that genuinely needs every row still\n * works; `getDreamsStatus` streams directly and filters in-window instead.\n * Malformed lines are silently skipped (resilience over strictness for\n * telemetry).\n */\nexport async function readDreamsLedgerEntries(memoryDir: string): Promise<DreamsLedgerEntry[]> {\n const entries: DreamsLedgerEntry[] = [];\n for await (const line of streamDreamsLedgerLines(memoryDir)) {\n const entry = parseDreamsLedgerLine(line);\n if (entry) entries.push(entry);\n }\n return entries;\n}\n\n// ── Aggregator ────────────────────────────────────────────────────────────────\n\nconst ALL_PHASES: DreamsPhase[] = [\"lightSleep\", \"rem\", \"deepSleep\"];\nconst MAX_WINDOW_HOURS = 24 * 365 * 100;\n\nexport function normalizeDreamsStatusWindowHours(value: unknown, fallback = 24): number {\n const raw = value === undefined || value === null ? fallback : value;\n if (\n typeof raw !== \"number\" ||\n !Number.isFinite(raw) ||\n !Number.isInteger(raw) ||\n raw < 1 ||\n raw > MAX_WINDOW_HOURS\n ) {\n throw new RangeError(`windowHours must be a positive integer no greater than ${MAX_WINDOW_HOURS}`);\n }\n return raw;\n}\n\n/**\n * Build per-phase 24-hour summary.\n *\n * @param memoryDir The memory directory (parent of `state/`).\n * @param windowHours How many hours to look back (default 24).\n * @param now Reference time (default `new Date()`).\n */\nexport async function getDreamsStatus(\n memoryDir: string,\n windowHours = 24,\n now: Date = new Date(),\n): Promise<DreamsStatusResult> {\n const boundedWindowHours = normalizeDreamsStatusWindowHours(windowHours);\n const nowMs = now.getTime();\n if (!Number.isFinite(nowMs)) {\n throw new RangeError(\"now must be a valid Date\");\n }\n const windowMs = boundedWindowHours * 60 * 60 * 1000;\n const windowStart = new Date(nowMs - windowMs);\n const windowEnd = now;\n if (!Number.isFinite(windowStart.getTime())) {\n throw new RangeError(\"windowHours produces an invalid status window\");\n }\n\n const windowStartMs = windowStart.getTime();\n const windowEndMs = windowEnd.getTime();\n\n const statusMap = new Map<DreamsPhase, DreamsPhaseStatus>();\n for (const phase of ALL_PHASES) {\n statusMap.set(phase, {\n phase,\n runCount: 0,\n totalDurationMs: 0,\n totalItemsProcessed: 0,\n lastRunAt: null,\n lastDurationMs: null,\n });\n }\n\n // Stream the ledger and aggregate every in-window row inline, so heap use is\n // O(number of phases) regardless of window or file size (issue #1910) — no\n // per-row array and no row cap, so a large in-window window is still counted\n // in full rather than truncated.\n for await (const line of streamDreamsLedgerLines(memoryDir)) {\n const entry = parseDreamsLedgerLine(line);\n if (!entry) continue;\n const ts = Date.parse(entry.completedAt);\n if (!Number.isFinite(ts) || ts < windowStartMs || ts >= windowEndMs) continue;\n const status = statusMap.get(entry.phase);\n if (!status) continue;\n status.runCount += 1;\n status.totalDurationMs += entry.durationMs;\n status.totalItemsProcessed += entry.itemsProcessed;\n // Track the most recent run (by completedAt).\n if (status.lastRunAt === null || ts > Date.parse(status.lastRunAt)) {\n status.lastRunAt = entry.completedAt;\n status.lastDurationMs = entry.durationMs;\n }\n }\n\n return {\n windowStart: windowStart.toISOString(),\n windowEnd: windowEnd.toISOString(),\n phases: {\n lightSleep: statusMap.get(\"lightSleep\")!,\n rem: statusMap.get(\"rem\")!,\n deepSleep: statusMap.get(\"deepSleep\")!,\n },\n };\n}\n\n// ── Phase runner (PR 4/4: manual invocation) ─────────────────────────────────\n\nexport interface DreamsRunOptions {\n memoryDir: string;\n phase: DreamsPhase;\n dryRun?: boolean;\n}\n\n/** Public result shape — identical to what HTTP, MCP, and CLI surfaces expose. */\nexport interface DreamsRunResult {\n phase: DreamsPhase;\n dryRun: boolean;\n durationMs: number;\n itemsProcessed: number;\n notes?: string;\n}\n\n/** Internal result shape returned by `runDreamsPhase` — includes the raw ledger entry. */\nexport interface DreamsRunResultInternal extends DreamsRunResult {\n ledgerEntry?: DreamsLedgerEntry;\n}\n\nexport async function recordDreamsPhaseRun(options: {\n memoryDir: string;\n phase: DreamsPhase;\n trigger: DreamsLedgerEntry[\"trigger\"];\n dryRun?: boolean;\n itemsProcessed: number;\n notes?: string;\n startedAt?: string;\n completedAt?: string;\n}): Promise<DreamsLedgerEntry> {\n const startedAt = options.startedAt ?? new Date().toISOString();\n const completedAt = options.completedAt ?? new Date().toISOString();\n const durationMs = Math.max(0, Date.parse(completedAt) - Date.parse(startedAt));\n const ledgerEntry: DreamsLedgerEntry = {\n schemaVersion: 1,\n startedAt,\n completedAt,\n durationMs: Number.isFinite(durationMs) ? durationMs : 0,\n phase: options.phase,\n itemsProcessed: Math.max(0, Math.floor(options.itemsProcessed)),\n dryRun: options.dryRun === true,\n trigger: options.trigger,\n notes: options.notes,\n };\n if (!ledgerEntry.dryRun) {\n await appendDreamsLedgerEntry(options.memoryDir, ledgerEntry);\n }\n return ledgerEntry;\n}\n\n/**\n * Manually invoke a single Dreams phase pass.\n *\n * For light sleep and REM: runs a lightweight scan against the observation\n * ledger and returns a count of items that would be (or were, if not dry-run)\n * processed. The actual heavy consolidation is long-running and orchestrator-\n * bound; the manual surface delegates to existing ledger utilities and returns\n * the phase telemetry so callers get the same shape as a scheduled run.\n *\n * For deep sleep: delegates to the memory governance run (shadow mode when\n * dryRun is true, apply mode otherwise).\n */\nexport async function runDreamsPhase(\n options: DreamsRunOptions,\n governanceRunner?: (opts: { memoryDir: string; dryRun: boolean }) => Promise<{ scannedMemories: number; appliedActionCount: number; notes?: string }>,\n phaseRunner?: (opts: { memoryDir: string; phase: Exclude<DreamsPhase, \"deepSleep\"> }) => Promise<{ itemsProcessed: number; notes?: string }>,\n): Promise<DreamsRunResultInternal> {\n const { memoryDir, phase, dryRun = false } = options;\n const startedAt = new Date().toISOString();\n\n let itemsProcessed = 0;\n let notes: string | undefined;\n\n if (phase === \"lightSleep\") {\n // Dry-run light sleep counts recent observation entries as a preview.\n // Live runs must be backed by the orchestrator phase runner so the command\n // never reports success without executing the phase.\n if (!dryRun) {\n if (!phaseRunner) {\n throw new Error(\"light-sleep manual runs require a phase runner\");\n }\n const result = await phaseRunner({ memoryDir, phase });\n itemsProcessed = Math.max(0, Math.floor(result.itemsProcessed));\n notes = result.notes ?? `scored ${itemsProcessed} memories`;\n } else {\n // Light sleep: count observation ledger entries from the last 24h as a\n // proxy for \"items scored\". The live value-scoring pass runs through the\n // phase runner above.\n try {\n const ledgerPath = path.join(memoryDir, \"state\", \"observation-ledger\", \"rebuilt-observations.jsonl\");\n let raw = \"\";\n try {\n raw = await readFile(ledgerPath, \"utf-8\");\n } catch {\n // No ledger yet — zero items.\n }\n const lines = raw.split(\"\\n\").filter((l) => l.trim().length > 0);\n const nowMs = Date.now();\n const cutoff = nowMs - 24 * 60 * 60 * 1000;\n itemsProcessed = lines.filter((line) => {\n try {\n const obj = JSON.parse(line) as {\n hour?: string;\n timestamp?: string;\n ts?: string;\n };\n const timestamp = typeof obj.hour === \"string\"\n ? obj.hour\n : typeof obj.ts === \"string\"\n ? obj.ts\n : typeof obj.timestamp === \"string\"\n ? obj.timestamp\n : null;\n if (!timestamp) return false;\n const ms = Date.parse(timestamp);\n return Number.isFinite(ms) && ms >= cutoff && ms < nowMs;\n } catch {\n return false;\n }\n }).length;\n notes = `dry-run: would score ${itemsProcessed} observation entries`;\n } catch (err) {\n throw new Error(`light-sleep scan failed: ${err instanceof Error ? err.message : String(err)}`);\n }\n }\n } else if (phase === \"rem\") {\n if (!dryRun) {\n if (!phaseRunner) {\n throw new Error(\"REM manual runs require a phase runner\");\n }\n const result = await phaseRunner({ memoryDir, phase });\n itemsProcessed = Math.max(0, Math.floor(result.itemsProcessed));\n notes = result.notes ?? `REM pass assessed ${itemsProcessed} memories`;\n } else {\n // REM dry-runs estimate candidates without synthesizing or archiving.\n try {\n const stateFilePath = path.join(memoryDir, \"state\", \"semantic-consolidation-last-run.json\");\n let lastRunAt: string | null = null;\n try {\n const stateRaw = await readFile(stateFilePath, \"utf-8\");\n const stateData = JSON.parse(stateRaw) as { lastRunAt?: string };\n lastRunAt = stateData.lastRunAt ?? null;\n } catch {\n // No state file — never run.\n }\n const memFiles = await listMemoryFiles(memoryDir);\n itemsProcessed = memFiles.length;\n notes = `dry-run: ${itemsProcessed} memories would enter REM consolidation pass${lastRunAt ? ` (last run: ${lastRunAt})` : \" (never run)\"}`;\n } catch (err) {\n throw new Error(`REM scan failed: ${err instanceof Error ? err.message : String(err)}`);\n }\n }\n } else {\n // deep sleep\n if (governanceRunner) {\n try {\n const result = await governanceRunner({ memoryDir, dryRun });\n itemsProcessed = result.scannedMemories;\n notes = result.notes ?? (dryRun ? `dry-run: ${result.appliedActionCount} actions proposed` : `${result.appliedActionCount} actions applied`);\n } catch (err) {\n throw new Error(`deep-sleep governance run failed: ${err instanceof Error ? err.message : String(err)}`);\n }\n } else {\n // Fallback: count memory files.\n const memFiles = await listMemoryFiles(memoryDir);\n itemsProcessed = memFiles.length;\n notes = dryRun\n ? `dry-run: ${itemsProcessed} memories eligible for deep-sleep governance`\n : `assessed ${itemsProcessed} memories for deep-sleep governance`;\n }\n }\n\n const completedAt = new Date().toISOString();\n const durationMs = Math.max(0, Date.parse(completedAt) - Date.parse(startedAt));\n let ledgerEntry: DreamsLedgerEntry | undefined;\n try {\n ledgerEntry = await recordDreamsPhaseRun({\n memoryDir,\n startedAt,\n completedAt,\n phase,\n itemsProcessed,\n dryRun,\n trigger: \"manual\",\n notes,\n });\n } catch {\n // Telemetry is best-effort: the phase work has already completed.\n }\n\n return {\n phase,\n dryRun,\n durationMs: ledgerEntry?.durationMs ?? durationMs,\n itemsProcessed,\n notes,\n ledgerEntry,\n };\n}\n\n// ── Shared governance result mapping ──────────────────────────────────────────\n\nexport function summarizeGovernanceResultForDreams(\n govResult: {\n summary?: { scannedMemories?: number };\n proposedActions: unknown[];\n appliedActions: unknown[];\n reviewQueue: unknown[];\n },\n dryRun: boolean,\n): { scannedMemories: number; appliedActionCount: number; notes?: string } {\n const proposedCount = govResult.proposedActions.length;\n const appliedCount = govResult.appliedActions.length;\n const scannedCount =\n typeof govResult.summary?.scannedMemories === \"number\" &&\n Number.isFinite(govResult.summary.scannedMemories)\n ? Math.max(0, Math.floor(govResult.summary.scannedMemories))\n : govResult.reviewQueue.length;\n return {\n scannedMemories: scannedCount,\n appliedActionCount: appliedCount,\n notes: dryRun\n ? `shadow mode: ${proposedCount} actions proposed`\n : `applied ${appliedCount} actions`,\n };\n}\n\n// ── Internal helpers ──────────────────────────────────────────────────────────\n\nasync function listMemoryFiles(memoryDir: string): Promise<string[]> {\n const out: string[] = [];\n try {\n const root = await lstat(memoryDir);\n if (root.isSymbolicLink()) {\n throw new Error(`memoryDir must not be a symlink: ${memoryDir}`);\n }\n if (!root.isDirectory()) return out;\n } catch (err) {\n if (err instanceof Error && /must not be a symlink/.test(err.message)) {\n throw err;\n }\n return out;\n }\n\n async function walk(dir: string): Promise<void> {\n let entries: Array<{ name: string; isDirectory(): boolean; isFile(): boolean; isSymbolicLink(): boolean }>;\n try {\n entries = (await readdir(dir, { withFileTypes: true })) as typeof entries;\n } catch {\n return;\n }\n for (const entry of entries) {\n if (entry.isSymbolicLink()) continue;\n if (isMacOsReplicationJunkBasename(entry.name)) continue;\n const full = path.join(dir, entry.name);\n if (entry.isDirectory()) {\n // Skip state/ and archive/ subdirs.\n if (\n entry.name === \"state\" ||\n entry.name === \"archive\" ||\n entry.name === \"namespaces\" ||\n entry.name === \".git\"\n ) continue;\n await walk(full);\n } else if (entry.isFile() && entry.name.endsWith(\".md\")) {\n out.push(full);\n }\n }\n }\n\n await walk(memoryDir);\n return out;\n}\n"],"mappings":";;;;;AAcA,OAAO,UAAU;AACjB,SAAS,wBAAyC;AAClD,SAAS,YAAY,OAAO,OAAO,SAAS,gBAAgB;AAC5D,SAAS,uBAAuB;AAyEzB,SAAS,iBAAiB,WAA2B;AAC1D,SAAO,KAAK,KAAK,WAAW,SAAS,qBAAqB;AAC5D;AASA,eAAsB,wBACpB,WACA,OACe;AACf,QAAM,aAAa,iBAAiB,SAAS;AAC7C,QAAM,MAAM,KAAK,QAAQ,UAAU,GAAG,EAAE,WAAW,KAAK,CAAC;AACzD,QAAM,WAAW,YAAY,KAAK,UAAU,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pB,OAAO,SACH,gBAAgB,aAAa,sBAC7B,WAAW,YAAY;AAAA,EAC7B;AACF;AAIA,eAAe,gBAAgB,WAAsC;AACnE,QAAM,MAAgB,CAAC;AACvB,MAAI;AACF,UAAM,OAAO,MAAM,MAAM,SAAS;AAClC,QAAI,KAAK,eAAe,GAAG;AACzB,YAAM,IAAI,MAAM,oCAAoC,SAAS,EAAE;AAAA,IACjE;AACA,QAAI,CAAC,KAAK,YAAY,EAAG,QAAO;AAAA,EAClC,SAAS,KAAK;AACZ,QAAI,eAAe,SAAS,wBAAwB,KAAK,IAAI,OAAO,GAAG;AACrE,YAAM;AAAA,IACR;AACA,WAAO;AAAA,EACT;AAEA,iBAAe,KAAK,KAA4B;AAC9C,QAAI;AACJ,QAAI;AACF,gBAAW,MAAM,QAAQ,KAAK,EAAE,eAAe,KAAK,CAAC;AAAA,IACvD,QAAQ;AACN;AAAA,IACF;AACA,eAAW,SAAS,SAAS;AAC3B,UAAI,MAAM,eAAe,EAAG;AAC5B,UAAI,+BAA+B,MAAM,IAAI,EAAG;AAChD,YAAM,OAAO,KAAK,KAAK,KAAK,MAAM,IAAI;AACtC,UAAI,MAAM,YAAY,GAAG;AAEvB,YACE,MAAM,SAAS,WACf,MAAM,SAAS,aACf,MAAM,SAAS,gBACf,MAAM,SAAS,OACf;AACF,cAAM,KAAK,IAAI;AAAA,MACjB,WAAW,MAAM,OAAO,KAAK,MAAM,KAAK,SAAS,KAAK,GAAG;AACvD,YAAI,KAAK,IAAI;AAAA,MACf;AAAA,IACF;AAAA,EACF;AAEA,QAAM,KAAK,SAAS;AACpB,SAAO;AACT;","names":[]}
|
|
@@ -8,11 +8,11 @@ import {
|
|
|
8
8
|
} from "./chunk-OQJKY3Z5.js";
|
|
9
9
|
import {
|
|
10
10
|
resolveDefaultNamespaceRoot
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-RI2KCQHP.js";
|
|
12
12
|
import {
|
|
13
13
|
StorageManager,
|
|
14
14
|
readRawMemoryDocument
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-4SCZZ3U7.js";
|
|
16
16
|
import {
|
|
17
17
|
parseContinuityImprovementLoops
|
|
18
18
|
} from "./chunk-LDXUBPMO.js";
|
|
@@ -1869,4 +1869,4 @@ export {
|
|
|
1869
1869
|
defaultTierMigrationCycleBudget,
|
|
1870
1870
|
CompoundingEngine
|
|
1871
1871
|
};
|
|
1872
|
-
//# sourceMappingURL=chunk-
|
|
1872
|
+
//# sourceMappingURL=chunk-PRU7OF3Y.js.map
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveWorkProductLedgerDir,
|
|
3
3
|
validateWorkProductLedgerEntry
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-B2NXOVZN.js";
|
|
5
5
|
import {
|
|
6
6
|
TranscriptManager
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-HDN7IVIO.js";
|
|
8
8
|
import {
|
|
9
9
|
resolveCommitmentLedgerDir,
|
|
10
10
|
validateCommitmentLedgerEntry
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-ZAJLJ35W.js";
|
|
12
12
|
import {
|
|
13
13
|
parseConfig
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-VPXIKBPX.js";
|
|
15
15
|
import {
|
|
16
16
|
resolveObjectiveStateStoreDir,
|
|
17
17
|
validateObjectiveStateSnapshot
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-4RNBLLZR.js";
|
|
19
19
|
import {
|
|
20
20
|
assertIsoRecordedAt,
|
|
21
21
|
assertSafePathSegment,
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
import {
|
|
29
29
|
listJsonFiles,
|
|
30
30
|
readJsonFile
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-2Z5DIDQD.js";
|
|
32
32
|
|
|
33
33
|
// src/resume-bundles.ts
|
|
34
34
|
import path from "path";
|
|
@@ -268,4 +268,4 @@ export {
|
|
|
268
268
|
recordResumeBundle,
|
|
269
269
|
getResumeBundleStatus
|
|
270
270
|
};
|
|
271
|
-
//# sourceMappingURL=chunk-
|
|
271
|
+
//# sourceMappingURL=chunk-PVHQSLNN.js.map
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
import {
|
|
11
11
|
readJsonFile,
|
|
12
12
|
writeJsonFileAtomic
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-2Z5DIDQD.js";
|
|
14
14
|
import {
|
|
15
15
|
isPathInsideStorageRoot,
|
|
16
16
|
isSafeLegacyPathSegment
|
|
@@ -131,4 +131,4 @@ export {
|
|
|
131
131
|
readHarmonicSourceMemory,
|
|
132
132
|
readUnresolvedHarmonicSources
|
|
133
133
|
};
|
|
134
|
-
//# sourceMappingURL=chunk-
|
|
134
|
+
//# sourceMappingURL=chunk-QPH52AZB.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
listNamespaces
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-V3TXIXXY.js";
|
|
4
4
|
import {
|
|
5
5
|
capabilityAllowsNamespace
|
|
6
6
|
} from "./chunk-IG747LRN.js";
|
|
@@ -282,4 +282,4 @@ export {
|
|
|
282
282
|
computeServiceCorpusWatermarks,
|
|
283
283
|
computeServiceCorpusCensus
|
|
284
284
|
};
|
|
285
|
-
//# sourceMappingURL=chunk-
|
|
285
|
+
//# sourceMappingURL=chunk-QSEUUQUF.js.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// src/utils/macos-replication-junk.ts
|
|
2
|
+
var warnedJunkDirectories = /* @__PURE__ */ new Set();
|
|
3
|
+
function isMacOsReplicationJunkBasename(basename) {
|
|
4
|
+
return basename === ".DS_Store" || basename.startsWith("._");
|
|
5
|
+
}
|
|
6
|
+
function withoutMacOsReplicationJunk(entries, basenameOf) {
|
|
7
|
+
const kept = [];
|
|
8
|
+
let ignored = 0;
|
|
9
|
+
for (const entry of entries) {
|
|
10
|
+
if (isMacOsReplicationJunkBasename(basenameOf(entry))) {
|
|
11
|
+
ignored += 1;
|
|
12
|
+
continue;
|
|
13
|
+
}
|
|
14
|
+
kept.push(entry);
|
|
15
|
+
}
|
|
16
|
+
return { kept, ignored };
|
|
17
|
+
}
|
|
18
|
+
function warnIgnoredMacOsReplicationJunk(directoryKey, count, warn) {
|
|
19
|
+
if (count <= 0) return;
|
|
20
|
+
const key = `${directoryKey}\0${count}`;
|
|
21
|
+
if (warnedJunkDirectories.has(key)) return;
|
|
22
|
+
warnedJunkDirectories.add(key);
|
|
23
|
+
warn(`ignored ${count} macOS replication junk file(s) (._* and .DS_Store)`);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export {
|
|
27
|
+
isMacOsReplicationJunkBasename,
|
|
28
|
+
withoutMacOsReplicationJunk,
|
|
29
|
+
warnIgnoredMacOsReplicationJunk
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=chunk-QUIRIG2P.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utils/macos-replication-junk.ts"],"sourcesContent":["/**\n * macOS Finder metadata that arrives through Mac-to-Linux copies.\n *\n * AppleDouble sidecars are named `._` plus the real file's basename\n * (`._project-notes.md` beside `project-notes.md`). Finder also writes\n * `.DS_Store` into any directory it opens. Neither is a Remnic record.\n * Directory scanners and replication must ignore them so they are never\n * parsed as entities, memories, or sync objects.\n *\n * QMD's own indexer already drops every hidden path (`dot: false` plus a\n * hidden-segment filter). Callers that build index inputs themselves still\n * use this helper so the non-QMD scanners stay in parity.\n */\n\nconst warnedJunkDirectories = new Set<string>();\n\n/** True for an AppleDouble sidecar or a Finder `.DS_Store` file. */\nexport function isMacOsReplicationJunkBasename(basename: string): boolean {\n return basename === \".DS_Store\" || basename.startsWith(\"._\");\n}\n\n/** True when the final path segment is macOS replication junk. */\nexport function isMacOsReplicationJunkRelativePath(relPath: string): boolean {\n const normalized = relPath.includes(\"\\\\\") ? relPath.replaceAll(\"\\\\\", \"/\") : relPath;\n const slash = normalized.lastIndexOf(\"/\");\n const basename = slash === -1 ? normalized : normalized.slice(slash + 1);\n return isMacOsReplicationJunkBasename(basename);\n}\n\n/**\n * Drop junk names from a directory listing. `ignored` is the count of\n * names removed, so the caller can emit one summary warning.\n */\nexport function withoutMacOsReplicationJunk<T>(\n entries: readonly T[],\n basenameOf: (entry: T) => string\n): { kept: T[]; ignored: number } {\n const kept: T[] = [];\n let ignored = 0;\n for (const entry of entries) {\n if (isMacOsReplicationJunkBasename(basenameOf(entry))) {\n ignored += 1;\n continue;\n }\n kept.push(entry);\n }\n return { kept, ignored };\n}\n\n/**\n * Emit at most one junk warning per directory and count. A later scan of\n * the same directory (entity migration, then entity load) stays quiet\n * instead of repeating the same summary.\n */\nexport function warnIgnoredMacOsReplicationJunk(\n directoryKey: string,\n count: number,\n warn: (message: string) => void\n): void {\n if (count <= 0) return;\n const key = `${directoryKey}\\0${count}`;\n if (warnedJunkDirectories.has(key)) return;\n warnedJunkDirectories.add(key);\n warn(`ignored ${count} macOS replication junk file(s) (._* and .DS_Store)`);\n}\n"],"mappings":";AAcA,IAAM,wBAAwB,oBAAI,IAAY;AAGvC,SAAS,+BAA+B,UAA2B;AACxE,SAAO,aAAa,eAAe,SAAS,WAAW,IAAI;AAC7D;AAcO,SAAS,4BACd,SACA,YACgC;AAChC,QAAM,OAAY,CAAC;AACnB,MAAI,UAAU;AACd,aAAW,SAAS,SAAS;AAC3B,QAAI,+BAA+B,WAAW,KAAK,CAAC,GAAG;AACrD,iBAAW;AACX;AAAA,IACF;AACA,SAAK,KAAK,KAAK;AAAA,EACjB;AACA,SAAO,EAAE,MAAM,QAAQ;AACzB;AAOO,SAAS,gCACd,cACA,OACA,MACM;AACN,MAAI,SAAS,EAAG;AAChB,QAAM,MAAM,GAAG,YAAY,KAAK,KAAK;AACrC,MAAI,sBAAsB,IAAI,GAAG,EAAG;AACpC,wBAAsB,IAAI,GAAG;AAC7B,OAAK,WAAW,KAAK,qDAAqD;AAC5E;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
StorageManager
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-4SCZZ3U7.js";
|
|
4
4
|
import {
|
|
5
5
|
keyring_exports,
|
|
6
6
|
secureStoreDir
|
|
@@ -20,6 +20,9 @@ import {
|
|
|
20
20
|
resolveNamespaceCapabilities,
|
|
21
21
|
resolveRecallAuxiliaryCapabilities
|
|
22
22
|
} from "./chunk-C5LWPYS3.js";
|
|
23
|
+
import {
|
|
24
|
+
isMacOsReplicationJunkBasename
|
|
25
|
+
} from "./chunk-QUIRIG2P.js";
|
|
23
26
|
import {
|
|
24
27
|
ALL_CATEGORY_DIRS
|
|
25
28
|
} from "./chunk-VS2IYZRU.js";
|
|
@@ -42,6 +45,7 @@ async function hasStoredEntries(p) {
|
|
|
42
45
|
if (!entry.isDirectory()) return true;
|
|
43
46
|
const children = await readdir(p, { withFileTypes: true });
|
|
44
47
|
for (const child of children) {
|
|
48
|
+
if (isMacOsReplicationJunkBasename(child.name)) continue;
|
|
45
49
|
const childPath = path.join(p, child.name);
|
|
46
50
|
if (child.isSymbolicLink() || child.isFile()) return true;
|
|
47
51
|
if (child.isDirectory() && await hasStoredEntries(childPath)) return true;
|
|
@@ -412,4 +416,4 @@ export {
|
|
|
412
416
|
resolveNamespaceStorageRoot,
|
|
413
417
|
NamespaceStorageRouter
|
|
414
418
|
};
|
|
415
|
-
//# sourceMappingURL=chunk-
|
|
419
|
+
//# sourceMappingURL=chunk-RI2KCQHP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/namespaces/storage.ts"],"sourcesContent":["import { resolveNamespaceCapabilities, resolveRecallAuxiliaryCapabilities } from \"../capabilities.js\";\nimport path from \"node:path\";\nimport { access, lstat, readdir } from \"node:fs/promises\";\nimport { isSafeRouteNamespace } from \"../routing/engine.js\";\nimport { StorageManager } from \"../storage.js\";\nimport { keyring, secureStoreDir } from \"../secure-store/index.js\";\nimport type { PluginConfig } from \"../types.js\";\nimport { ALL_CATEGORY_DIRS } from \"../utils/category-dir.js\";\nimport { isMacOsReplicationJunkBasename } from \"../utils/macos-replication-junk.js\";\nimport {\n namespaceIdentityLegacyToken,\n namespaceIdentityToken,\n normalizeNamespaceIdentity,\n} from \"./identity.js\";\nimport type { NamespaceCatalog } from \"./catalog.js\";\nimport { MutationSerializer } from \"../utils/serialize-mutations.js\";\n\nasync function exists(p: string): Promise<boolean> {\n try {\n await access(p);\n return true;\n } catch {\n return false;\n }\n}\n\nasync function hasStoredEntries(p: string): Promise<boolean> {\n try {\n const entry = await lstat(p);\n if (entry.isSymbolicLink()) return true;\n if (!entry.isDirectory()) return true;\n const children = await readdir(p, { withFileTypes: true });\n for (const child of children) {\n if (isMacOsReplicationJunkBasename(child.name)) continue;\n const childPath = path.join(p, child.name);\n if (child.isSymbolicLink() || child.isFile()) return true;\n if (child.isDirectory() && (await hasStoredEntries(childPath))) return true;\n }\n return false;\n } catch {\n return false;\n }\n}\n\n// Build a per-namespace directory under `<memoryDir>/namespaces` and assert the\n// resolved path stays inside that base. Namespace identifiers can originate from\n// operator config (config.defaultNamespace) and request-derived routing, so this\n// containment check prevents directory traversal (CodeQL js/path-injection).\n// For safe segments this returns exactly `path.join(base, segment)`, so there is\n// no behavioral change for valid namespaces.\nfunction resolveNamespaceDir(memoryDir: string, segment: string): string {\n // Mirror isSafeRouteNamespace's separator/parent-ref rejection (without its\n // 64-char cap, so identity tokens still pass). Rejecting separators and \"..\"\n // up front keeps the value a single contained child of <memoryDir>/namespaces.\n if (\n segment.length === 0 ||\n segment.includes(\"/\") ||\n segment.includes(\"\\\\\") ||\n segment.includes(\"..\") ||\n path.isAbsolute(segment)\n ) {\n throw new Error(`unsafe namespace path segment: ${segment}`);\n }\n return path.join(memoryDir, \"namespaces\", segment);\n}\n\nconst LEGACY_NAMESPACE_CONTENT_CHILDREN = [\n ...ALL_CATEGORY_DIRS,\n \"entities\",\n \"artifacts\",\n \"identity\",\n \"config\",\n \"summaries\",\n \"profile.md\",\n] as const;\n\nconst LEGACY_NAMESPACE_RUNTIME_CHILDREN = [\"state\"] as const;\n\nasync function hasAnyLegacyData(\n rootDir: string,\n options: { includeRuntimeState?: boolean } = {},\n): Promise<boolean> {\n const children = options.includeRuntimeState === true\n ? [...LEGACY_NAMESPACE_CONTENT_CHILDREN, ...LEGACY_NAMESPACE_RUNTIME_CHILDREN]\n : LEGACY_NAMESPACE_CONTENT_CHILDREN;\n for (const child of children) {\n if (await hasStoredEntries(path.join(rootDir, child))) return true;\n }\n return false;\n}\n\nasync function hasAnyNamespaceStorageMarker(\n rootDir: string,\n options: { includeRuntimeState?: boolean } = {},\n): Promise<boolean> {\n const children = options.includeRuntimeState === true\n ? [...LEGACY_NAMESPACE_CONTENT_CHILDREN, ...LEGACY_NAMESPACE_RUNTIME_CHILDREN]\n : LEGACY_NAMESPACE_CONTENT_CHILDREN;\n for (const child of children) {\n if (await exists(path.join(rootDir, child))) return true;\n }\n return false;\n}\n\n/**\n * Storage routing for namespaces.\n *\n * Compatibility note:\n * - When namespaces are enabled, existing raw namespace roots are preserved.\n * New namespace roots use tokenized names under `memoryDir/namespaces/<token>`.\n * - The default namespace continues to use the legacy `memoryDir` root unless the caller\n * has created `memoryDir/namespaces/<defaultNamespace>` (in which case we use that).\n *\n * This avoids surprising \"lost memories\" when an install flips namespaces on without\n * migrating existing data.\n */\n/**\n * Optional hooks for the storage router. `onResolve` fires whenever a namespace's\n * storage is resolved/created, so a downstream consumer (e.g. the namespace\n * catalog, issue #1499) can register the namespace. The hook MUST NOT throw into\n * the router; the router invokes it defensively and a hook failure never affects\n * storage resolution.\n *\n * The hook MAY return (or resolve to) a boolean indicating whether the\n * registration actually PERSISTED (round 6, codex P2 — NEFoX). When it resolves\n * to `false` (a dropped/no-op registration), the router does NOT mark the\n * (namespace, storageDir) pair as notified, so the next resolve RETRIES it\n * instead of suppressing it forever. A `void`/`undefined` result is treated as\n * success (legacy hooks).\n */\nexport interface NamespaceStorageRouterHooks {\n onResolve?: (\n namespace: string,\n storageDir: string,\n ) => void | boolean | Promise<void | boolean>;\n}\n\n/**\n * Resolve the runtime storage root for the configured DEFAULT namespace.\n *\n * Shared between the live router (`NamespaceStorageRouter.defaultNamespaceRoot`)\n * and the rebuildable catalog (`NamespaceCatalog.rebuildFromDisk`) so the two\n * can never diverge (CLAUDE.md rule #22/#42 — read & write paths resolve through\n * the same logic). The contract is: while legacy memory data still lives\n * directly under `memoryDir`, the default root stays `memoryDir`; only once the\n * legacy root is empty and a `namespaces/<default|token>` dir holds data does\n * the default migrate into that tokenized/legacy-named dir.\n */\nexport async function resolveDefaultNamespaceRoot(config: PluginConfig): Promise<string> {\n if (!resolveNamespaceCapabilities(config).namespaces) {\n return config.memoryDir;\n }\n\n // Build the legacy default root from the NORMALIZED (trimmed) name so a\n // whitespace-padded `defaultNamespace` still finds the live `namespaces/default`\n // root (NIabe). `storageFor()` classifies the trimmed value as the default, and\n // the on-disk legacy dir is created under the trimmed name; using the raw spaced\n // name here would look for `namespaces/<spaced>` and miss the real root, falling\n // back to memoryDir/tokenized. `namespaceIdentityToken` already normalizes\n // internally, so the tokenized path is unaffected.\n const defaultIdentity = normalizeNamespaceIdentity(config.defaultNamespace);\n const defaultNfdIdentity = defaultIdentity.normalize(\"NFD\");\n const legacyNsDir = resolveNamespaceDir(config.memoryDir, defaultIdentity);\n const legacyNfdNsDir = resolveNamespaceDir(config.memoryDir, defaultNfdIdentity);\n const tokenizedNsDir = resolveNamespaceDir(\n config.memoryDir,\n namespaceIdentityToken(defaultIdentity),\n );\n const legacyTokenNsDir = resolveNamespaceDir(\n config.memoryDir,\n namespaceIdentityLegacyToken(defaultNfdIdentity),\n );\n const tokenizedHasData =\n (await exists(tokenizedNsDir)) &&\n (await hasAnyNamespaceStorageMarker(tokenizedNsDir, { includeRuntimeState: true }));\n const legacyTokenHasData =\n (await exists(legacyTokenNsDir)) &&\n (await hasAnyNamespaceStorageMarker(legacyTokenNsDir, { includeRuntimeState: true }));\n const legacyHasData =\n (await exists(legacyNsDir)) &&\n (await hasAnyNamespaceStorageMarker(legacyNsDir, { includeRuntimeState: true }));\n const legacyNfdHasData =\n legacyNfdNsDir !== legacyNsDir &&\n (await exists(legacyNfdNsDir)) &&\n (await hasAnyNamespaceStorageMarker(legacyNfdNsDir, { includeRuntimeState: true }));\n const nsDir = tokenizedHasData\n ? tokenizedNsDir\n : legacyTokenHasData\n ? legacyTokenNsDir\n : legacyHasData\n ? legacyNsDir\n : legacyNfdHasData\n ? legacyNfdNsDir\n : (await exists(legacyNsDir))\n ? legacyNsDir\n : legacyNfdNsDir !== legacyNsDir && (await exists(legacyNfdNsDir))\n ? legacyNfdNsDir\n : tokenizedNsDir;\n return (await exists(nsDir)) && !(await hasAnyLegacyData(config.memoryDir))\n ? nsDir\n : config.memoryDir;\n}\n\n/**\n * Resolve the runtime storage root for ANY namespace exactly as the live router\n * would (`NamespaceStorageRouter.namespaceRoot`). Shared so the rebuildable\n * catalog records the SAME on-disk root the router routes to — a recall/read\n * touch must not guess `namespaces/<token>` when the router actually serves a\n * legacy raw-name dir or a migrated default root (CLAUDE.md rule #22/#42; round\n * 4, cursor Medium). The default namespace delegates to `resolveDefaultNamespaceRoot`;\n * every other namespace prefers the tokenized root when it has a storage marker,\n * else a legacy raw-name dir when present, else the tokenized root.\n */\nexport async function resolveNamespaceStorageRoot(\n config: PluginConfig,\n namespace: string,\n): Promise<string> {\n if (!resolveNamespaceCapabilities(config).namespaces) return config.memoryDir;\n // Compare on NORMALIZED identity so a whitespace-padded configured default name\n // still routes to the default root rather than a tokenized non-default dir\n // (NH-FH). The catalog keys records by the same normalized identity.\n if (normalizeNamespaceIdentity(namespace) === normalizeNamespaceIdentity(config.defaultNamespace)) {\n return resolveDefaultNamespaceRoot(config);\n }\n const normalized = normalizeNamespaceIdentity(namespace);\n const legacyExactNamespace = namespace.trim();\n const legacyNfdNamespace = normalized.normalize(\"NFD\");\n const legacyRoot = resolveNamespaceDir(config.memoryDir, normalized);\n const legacyExactRoot =\n legacyExactNamespace !== normalized && isSafeRouteNamespace(legacyExactNamespace)\n ? resolveNamespaceDir(config.memoryDir, legacyExactNamespace)\n : null;\n const legacyNfdRoot =\n legacyNfdNamespace !== normalized\n ? resolveNamespaceDir(config.memoryDir, legacyNfdNamespace)\n : null;\n const tokenizedRoot = resolveNamespaceDir(config.memoryDir, namespaceIdentityToken(normalized));\n const legacyTokenRoots = [\n namespaceIdentityLegacyToken(legacyExactNamespace),\n namespaceIdentityLegacyToken(legacyNfdNamespace),\n ]\n .filter((token, index, tokens) => tokens.indexOf(token) === index)\n .map((token) => resolveNamespaceDir(config.memoryDir, token));\n for (const candidate of [tokenizedRoot, ...legacyTokenRoots]) {\n if (\n (await exists(candidate)) &&\n (await hasAnyNamespaceStorageMarker(candidate, { includeRuntimeState: true }))\n ) {\n return candidate;\n }\n }\n for (const candidate of [legacyRoot, legacyExactRoot, legacyNfdRoot]) {\n if (candidate && (await exists(candidate))) return candidate;\n }\n return tokenizedRoot;\n}\n\nexport class NamespaceStorageRouter {\n private readonly cache = new Map<string, StorageManager>();\n private defaultNsRootResolved: string | null = null;\n // Dedup the resolve hook (round 6, cursor Medium — NCNL2). Recall/extraction\n // call `storageFor` repeatedly; firing `onResolve` (→ catalog loadCompacted +\n // append) on every cache hit grows `namespaces.jsonl` without bound between\n // rebuilds. We fire the hook only when the (namespace, storageDir) pair is new\n // or its dir changed, so a steady-state cache hit is a no-op for the catalog.\n private readonly notifiedResolved = new Map<string, string>();\n // Instance-scoped serializer for the resolve hook (issue #1524 adoption).\n // Replaces the bespoke `inFlightResolved` marker-then-clear pattern: the\n // serializer's per-key chain strictly orders concurrent notifications for the\n // SAME namespace, and the task re-checks `notifiedResolved` once it runs, so a\n // burst of cache hits before the first hook settles collapses to a single\n // hook invocation (the once-per-namespace intent). Recovery is preserved —\n // one rejected hook never poisons subsequent notifications for that key.\n private readonly resolveSerializer = new MutationSerializer();\n // (namespace, storageDir) pairs whose resolve hook is currently pending. Set SYNCHRONOUSLY in\n // notifyResolved (before queueing) so a burst of concurrent storageFor()\n // cache hits collapses onto the one in-flight hook instead of each enqueuing\n // its own task. Cleared when the queued hook settles. Without this, a dropped\n // hook (returns false on a rebuild-lock timeout) leaves notifiedResolved\n // unset, so every queued sibling task would re-run the hook — N serial lock\n // waits (cursor Medium 06f58a7c, codex P2).\n private readonly inFlightResolveHooks = new Set<string>();\n // Tracks every in-flight resolve-hook promise so callers can deterministically\n // await the fire-and-forget registrations that `storageFor()` kicks off (see\n // `whenResolveHooksSettled`). Entries are removed as each hook settles, so the\n // set holds at most one promise per concurrently-resolving namespace.\n private readonly pendingResolveHooks = new Set<Promise<unknown>>();\n // Pending post-write catalog touch promises (#1522). Like pendingResolveHooks,\n // lets tests await fire-and-forget write touches deterministically.\n private readonly pendingWriteTouches = new Set<Promise<unknown>>();\n\n // Normalized (trimmed) default namespace identity (NH-FH). `storageFor`\n // normalizes its input, so default-namespace branches must compare against the\n // normalized config default too — otherwise a whitespace-padded configured\n // default name routes the default namespace to a tokenized non-default root.\n private readonly defaultNamespaceIdentity: string;\n\n /** #2019: hook fired when a new namespace storage is created via storageFor. */\n onStorageCreated?: (storage: StorageManager, namespace: string) => void;\n\n constructor(\n private readonly config: PluginConfig,\n private readonly hooks: NamespaceStorageRouterHooks = {},\n /** Catalog reference for post-write/read touches (issue #1522 chokepoint). */\n private readonly catalog?: NamespaceCatalog,\n ) {\n this.defaultNamespaceIdentity = normalizeNamespaceIdentity(config.defaultNamespace);\n }\n\n private async defaultNamespaceRoot(): Promise<string> {\n this.defaultNsRootResolved = await resolveDefaultNamespaceRoot(this.config);\n return this.defaultNsRootResolved;\n }\n\n private async namespaceRoot(namespace: string): Promise<string> {\n // NOTE: only used after defaultNamespaceRoot() resolution.\n if (!resolveNamespaceCapabilities(this.config).namespaces) return this.config.memoryDir;\n if (normalizeNamespaceIdentity(namespace) === this.defaultNamespaceIdentity) {\n return this.defaultNsRootResolved ?? this.config.memoryDir;\n }\n return resolveNamespaceStorageRoot(this.config, namespace);\n }\n\n async storageFor(namespace: string): Promise<StorageManager> {\n const ns = normalizeNamespaceIdentity(namespace || this.config.defaultNamespace);\n if (ns !== this.defaultNamespaceIdentity && !isSafeRouteNamespace(ns)) {\n throw new Error(`unsafe namespace: ${ns}`);\n }\n // Even when the default namespace is exempt from the check above, every\n // on-disk path is built through resolveNamespaceDir(), which rejects\n // traversal segments — so an unsafe configured default still cannot escape\n // <memoryDir>/namespaces (CodeQL js/path-injection).\n\n let root: string;\n if (ns === this.defaultNamespaceIdentity) {\n root = await this.defaultNamespaceRoot();\n const cached = this.cache.get(ns);\n if (cached && cached.dir === root) {\n await this.applySecureStoreConfig(cached);\n this.notifyResolved(ns, root);\n return cached;\n }\n } else {\n const cached = this.cache.get(ns);\n root = await this.namespaceRoot(ns);\n if (cached && cached.dir === root) {\n await this.applySecureStoreConfig(cached);\n this.notifyResolved(ns, root);\n return cached;\n }\n }\n\n // Pass the hot-memories cache gate explicitly (issue #1902, Codex P2): a\n // per-namespace child root is never registered in the per-dir default map,\n // so without this it would fall back to the process-wide default and ignore\n // THIS daemon's hotMemoriesCacheEnabled config. Threading it from config\n // keeps every namespace storage aligned with its owning orchestrator.\n const sm = new StorageManager(\n root,\n this.config.entitySchemas,\n this.config.hotMemoriesCacheEnabled,\n );\n // Register this child root's gate AND TTL in the per-dir maps (issue #1902,\n // Codex P2). The constructor override above fixes the child's own gate, but\n // its TTL is resolved via the per-dir map (hotCacheTtlMs); an unregistered\n // child root would fall back to the last process-wide TTL and could inherit\n // another daemon's value. Registering keyed by root keeps both per-dir.\n StorageManager.setHotMemoriesCacheDefault(\n root,\n this.config.hotMemoriesCacheEnabled,\n this.config.hotMemoriesCacheTtlMs,\n );\n const { scopedCacheInvalidationEnabled } = this.config;\n StorageManager.setScopedCacheInvalidationDefault(root, scopedCacheInvalidationEnabled);\n // Propagate the inline-attribution template so that router-created storages\n // (used by extraction and shared-promotion paths) strip citations consistently,\n // matching the behaviour of the primary this.storage instance in the orchestrator.\n sm.citationTemplate = this.config.inlineSourceAttributionFormat;\n // #1522: install the post-write catalog touch at the chokepoint — every\n // successful write on this StorageManager records the namespace touch.\n this.bindCatalogWriteHook(sm, ns);\n // #1579: apply the tombstone non-resurrection config so every namespace\n // storage enforces the invariant at its own writeMemory chokepoint.\n this.applyTombstonesConfig(sm, ns);\n // #2033: install the secure-store context on router-created stores. The\n // orchestrator keys ONLY its primary default-namespace storage; without\n // this, a store resolved through the router reads isSecureStoreUnlocked()\n // === false even after the operator unlocked the keyring, so secure-store\n // recovery paths (e.g. the CLI lifecycle-ledger rebuild) refuse an encrypted\n // ledger they could actually rewrite, and namespace writes could silently\n // fall back to plaintext. Mirror the orchestrator's setup exactly.\n await this.applySecureStoreConfig(sm);\n this.cache.set(ns, sm);\n // #2019: let the orchestrator wire write-triggered prioritized embedding on\n // every router-created namespace storage, not just the primary default store.\n this.onStorageCreated?.(sm, ns);\n this.notifyResolved(ns, root);\n return sm;\n }\n\n /**\n * Fire the resolve hook defensively. A hook failure (e.g. a catalog write\n * error) MUST NOT crash storage resolution — see CLAUDE.md gotcha #13.\n *\n * Issue #1524 adoption: hook invocations for the SAME namespace are now\n * strictly ordered through the shared `MutationSerializer` rather than the\n * bespoke `inFlightResolved` marker-then-clear pattern. The serializer\n * guarantees one in-flight hook per namespace; a concurrent burst of\n * `storageFor()` cache hits collapses to a single hook invocation because\n * each queued task re-checks `notifiedResolved` before invoking the hook. A\n * dropped (`false`) or rejected hook leaves `notifiedResolved` unset so the\n * next `storageFor()` retries — the serializer recovers from the rejection,\n * so a failed hook never poisons later notifications.\n */\n private notifyResolved(namespace: string, storageDir: string): void {\n const hook = this.hooks.onResolve;\n if (!hook) return;\n // Permanent dedup: skip once we've SUCCESSFULLY notified this exact\n // (namespace, storageDir). A changed dir (rare: migration/realignment)\n // still re-fires once. The mark is set ONLY AFTER the hook succeeds, so a\n // dropped registration (e.g. rebuild-lock timeout) is RETRIED on the next\n // cache hit instead of being suppressed forever (round 6, cursor Medium —\n // ND3EJ).\n if (this.notifiedResolved.get(namespace) === storageDir) return;\n // In-flight dedup (cursor Medium 06f58a7c, codex P2): if a hook for THIS\n // namespace is already pending, collapse this call onto it instead of\n // enqueueing another task. The serializer strictly orders queued tasks, but\n // ordering alone is not enough — when the first hook returns `false`\n // (dropped touch, e.g. rebuild-lock timeout), `notifiedResolved` stays\n // unset, so each queued sibling task would pass its re-check and re-run the\n // hook. With the real catalog hook each retry can spend the full lock wait,\n // so N cache hits during a rebuild leave N serial background lock attempts.\n // Collapsing here means at most ONE hook runs per in-flight registration;\n // its result (set `notifiedResolved` on success, leave unset on drop)\n // decides whether a LATER `storageFor()` retries — collapsing loses\n // nothing because the drop is already retried on the next cache hit.\n // Keyed by the composite (namespace, storageDir) so a CHANGED dir\n // (migration/realignment) for the same namespace still gets its own hook —\n // it is NOT collapsed onto the old dir's pending registration (cursor\n // Medium, codex P2).\n const inFlightKey = namespace + \"\\u0000\" + storageDir;\n if (this.inFlightResolveHooks.has(inFlightKey)) return;\n this.inFlightResolveHooks.add(inFlightKey);\n // Queue through the serializer. Concurrent calls for the same namespace\n // strictly order here; the 2nd call's task runs only after the 1st's hook\n // settles, by which point `notifiedResolved` is either set (no-op) or still\n // unset (retry). The returned promise is tracked for\n // `whenResolveHooksSettled()`. Rejections from the task body are caught so\n // they never reach the caller (best-effort hook contract); the serializer's\n // recovered tail still lets subsequent notifications run.\n const task = async (): Promise<void> => {\n // Re-check after queueing: a prior task in this same chain may have just\n // marked the pair as notified.\n if (this.notifiedResolved.get(namespace) === storageDir) return;\n try {\n // Hook may be sync or async; Promise.resolve normalizes both. A result\n // of `false` means the registration was dropped/no-op (e.g. rebuild-lock\n // timeout) — leave notifiedResolved UNSET so the next storageFor retries\n // (round 6, codex P2 — NEFoX). `void`/`undefined` is success for legacy\n // hooks. A rejection leaves notifiedResolved unset for the same reason.\n const persisted = await Promise.resolve(hook(namespace, storageDir));\n if (persisted !== false) {\n this.notifiedResolved.set(namespace, storageDir);\n }\n } catch {\n // Best-effort: a hook failure MUST NOT crash storage resolution. Leave\n // notifiedResolved unset so a later storageFor retries the registration.\n }\n };\n const queued = this.resolveSerializer.serialize(namespace, task);\n this.pendingResolveHooks.add(queued);\n // Clear the in-flight marker when the hook settles so a subsequent\n // storageFor() can retry after a drop, or short-circuit via notifiedResolved\n // after a success.\n const cleanup = (): void => {\n this.inFlightResolveHooks.delete(inFlightKey);\n this.pendingResolveHooks.delete(queued);\n };\n void queued.then(cleanup, cleanup);\n }\n\n /**\n * Install the post-write catalog touch hook on an externally-constructed\n * StorageManager (issue #1522). Used by the orchestrator for the legacy\n * default-namespace storage (`this.storage`) that bypasses the router.\n */\n bindCatalogWriteHook(sm: StorageManager, namespace: string): void {\n // Issue #1903: pure state-file writes only touch the catalog when explicitly\n // opted in. Router-created storages (storageFor) and the legacy default\n // storage both flow through here, so this is the single wiring point.\n sm.touchStateWrites = this.config.namespacesCatalogTouchStateWrites === true;\n sm.onCatalogWrite = () => this.touchCatalogWrite(namespace, sm.dir);\n }\n\n /**\n * Install the tombstone config on an externally-constructed StorageManager\n * (issue #1579). Mirrors `bindCatalogWriteHook` — used for the legacy\n * default-namespace storage that bypasses the router. Router-created\n * storages are wired inline in `storageFor()` via `applyTombstonesConfig`.\n */\n bindTombstonesConfig(\n sm: StorageManager,\n namespace: string,\n config: { enabled: boolean; semanticMatch: boolean; semanticThreshold: number },\n ): void {\n this.tombstonesGlobalConfig = { ...config };\n sm.setTombstonesConfig({ ...config, namespace });\n }\n\n private tombstonesGlobalConfig: {\n enabled: boolean;\n semanticMatch: boolean;\n semanticThreshold: number;\n } = { enabled: false, semanticMatch: false, semanticThreshold: 0.9 };\n\n /**\n * Apply the tombstone config to a router-created StorageManager. Called\n * inline in `storageFor()` so every namespace storage enforces the\n * non-resurrection invariant, namespace-scoped (rule 42).\n */\n private applyTombstonesConfig(sm: StorageManager, namespace: string): void {\n sm.setTombstonesConfig({ ...this.tombstonesGlobalConfig, namespace });\n }\n\n /**\n * Install the at-rest secure-store context on a router-created StorageManager\n * (#2033). Mirrors the orchestrator's primary-storage setup: mark the store\n * required so a locked store throws instead of silently writing plaintext, and\n * install the master key when the process-local keyring already holds it (the\n * operator unlocked). The secure store is one key per memory ROOT (single\n * header + per-file path-bound AAD), so every namespace store keys off the\n * root keyring id — exactly the id the orchestrator and `secure-store unlock`\n * register under. No-op when secure-store is disabled.\n */\n private async applySecureStoreConfig(sm: StorageManager): Promise<void> {\n if (!resolveRecallAuxiliaryCapabilities(this.config).secureStore) return;\n sm.setSecureStoreRequired(true);\n const existingKey = keyring.getKey(secureStoreDir(this.config.memoryDir));\n if (existingKey) {\n await sm.setSecureStoreKeyAndWait(existingKey, this.config.secureStoreEncryptOnWrite);\n }\n }\n\n /**\n * Post-write catalog touch (issue #1522 chokepoint). Called by every\n * StorageManager's post-write hook AFTER a successful write. Best-effort\n * and failure-tolerant — a catalog error MUST NOT affect the primary write\n * (gotcha #13, rule #40). Fire-and-forget by design.\n */\n private touchCatalogWrite(namespace: string, storageDir: string): void {\n if (!this.catalog) return;\n const touch = this.catalog\n .markWrite(namespace, { discoveredBy: \"write\", storageDir })\n .catch(() => undefined);\n this.pendingWriteTouches.add(touch);\n void touch.then(\n () => { this.pendingWriteTouches.delete(touch); },\n () => { this.pendingWriteTouches.delete(touch); },\n );\n }\n\n /**\n * Record a namespace read in the catalog (issue #1522 chokepoint move).\n * Best-effort and failure-tolerant. Used by recall paths so the read touch\n * lives in the storage layer, not at the caller.\n */\n recordRead(namespace: string, storageDir?: string): void {\n if (!this.catalog) return;\n const ns = normalizeNamespaceIdentity(namespace || this.config.defaultNamespace);\n void this.catalog\n .markRead(ns, { discoveredBy: \"read\", storageDir })\n .catch(() => undefined);\n }\n /**\n * Record a namespace write touch in the catalog (issue #1522). Best-effort\n * and failure-tolerant. Used by consolidation/cleanup passes that may mutate\n * the store via delete-only paths (e.g. entity-file merges, TTL cleanup) so\n * the namespace's lastWriteAt stays fresh even when no explicit write went\n * through the storage chokepoint. This is NOT a substitute for the chokepoint\n * — it's a belt-and-suspenders for paths the chokepoint doesn't cover.\n */\n recordWrite(namespace: string, storageDir?: string): void {\n if (!this.catalog) return;\n const ns = normalizeNamespaceIdentity(namespace || this.config.defaultNamespace);\n const touch = this.catalog\n .markWrite(ns, { discoveredBy: \"write\", storageDir })\n .catch(() => undefined);\n this.pendingWriteTouches.add(touch);\n void touch.then(\n () => { this.pendingWriteTouches.delete(touch); },\n () => { this.pendingWriteTouches.delete(touch); },\n );\n }\n\n /**\n * Resolve once every in-flight post-write catalog touch has settled (#1522).\n * Mirrors `whenResolveHooksSettled()`: the StorageManager's post-write hook\n * fires the catalog touch fire-and-forget, so tests asserting lastWriteAt\n * moved should await this instead of racing a timer.\n */\n async whenWriteTouchesSettled(): Promise<void> {\n // Flush any coalesced (buffered) touches first so their appends join the\n // pending set below — otherwise this could resolve while a buffered touch's\n // lastWriteAt is still unwritten on disk (#1903, Cursor). No-op when\n // coalescing is disabled (window 0) or the catalog is inert.\n await this.catalog?.flushPendingTouches().catch(() => undefined);\n while (this.pendingWriteTouches.size > 0) {\n await Promise.allSettled([...this.pendingWriteTouches]);\n }\n }\n\n /**\n * Resolve once every in-flight `onResolve` registration has settled.\n *\n * `storageFor()` fires the resolve hook fire-and-forget, so its catalog side\n * effect (e.g. `registerResolved(...)`) is not observable the moment\n * `storageFor()` returns. Callers that must act on that side effect — notably\n * tests asserting the catalog was updated — should await this instead of\n * racing a timer. Resolves immediately when no hook is registered or nothing\n * is in flight. The loop re-checks because a settling hook could, in\n * principle, trigger a follow-on resolution.\n */\n async whenResolveHooksSettled(): Promise<void> {\n while (this.pendingResolveHooks.size > 0) {\n await Promise.allSettled([...this.pendingResolveHooks]);\n }\n }\n\n /**\n * #2019: iterate the currently cached router storages with their namespace so\n * callers can wire hooks on stores resolved before the hook was installed.\n */\n forEachCachedStorage(fn: (storage: StorageManager, namespace: string) => void): void {\n for (const [namespace, storage] of this.cache) fn(storage, namespace);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,UAAU;AACjB,SAAS,QAAQ,OAAO,eAAe;AAevC,eAAe,OAAO,GAA6B;AACjD,MAAI;AACF,UAAM,OAAO,CAAC;AACd,WAAO;AAAA,EACT,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAEA,eAAe,iBAAiB,GAA6B;AAC3D,MAAI;AACF,UAAM,QAAQ,MAAM,MAAM,CAAC;AAC3B,QAAI,MAAM,eAAe,EAAG,QAAO;AACnC,QAAI,CAAC,MAAM,YAAY,EAAG,QAAO;AACjC,UAAM,WAAW,MAAM,QAAQ,GAAG,EAAE,eAAe,KAAK,CAAC;AACzD,eAAW,SAAS,UAAU;AAC5B,UAAI,+BAA+B,MAAM,IAAI,EAAG;AAChD,YAAM,YAAY,KAAK,KAAK,GAAG,MAAM,IAAI;AACzC,UAAI,MAAM,eAAe,KAAK,MAAM,OAAO,EAAG,QAAO;AACrD,UAAI,MAAM,YAAY,KAAM,MAAM,iBAAiB,SAAS,EAAI,QAAO;AAAA,IACzE;AACA,WAAO;AAAA,EACT,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAQA,SAAS,oBAAoB,WAAmB,SAAyB;AAIvE,MACE,QAAQ,WAAW,KACnB,QAAQ,SAAS,GAAG,KACpB,QAAQ,SAAS,IAAI,KACrB,QAAQ,SAAS,IAAI,KACrB,KAAK,WAAW,OAAO,GACvB;AACA,UAAM,IAAI,MAAM,kCAAkC,OAAO,EAAE;AAAA,EAC7D;AACA,SAAO,KAAK,KAAK,WAAW,cAAc,OAAO;AACnD;AAEA,IAAM,oCAAoC;AAAA,EACxC,GAAG;AAAA,EACH;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,IAAM,oCA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AAS,WAAW,CAAC,EACnD,MAAM,MAAM,MAAS;AACxB,SAAK,oBAAoB,IAAI,KAAK;AAClC,SAAK,MAAM;AAAA,MACT,MAAM;AAAE,aAAK,oBAAoB,OAAO,KAAK;AAAA,MAAG;AAAA,MAChD,MAAM;AAAE,aAAK,oBAAoB,OAAO,KAAK;AAAA,MAAG;AAAA,IAClD;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,MAAM,0BAAyC;AAK7C,UAAM,KAAK,SAAS,oBAAoB,EAAE,MAAM,MAAM,MAAS;AAC/D,WAAO,KAAK,oBAAoB,OAAO,GAAG;AACxC,YAAM,QAAQ,WAAW,CAAC,GAAG,KAAK,mBAAmB,CAAC;AAAA,IACxD;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaA,MAAM,0BAAyC;AAC7C,WAAO,KAAK,oBAAoB,OAAO,GAAG;AACxC,YAAM,QAAQ,WAAW,CAAC,GAAG,KAAK,mBAAmB,CAAC;AAAA,IACxD;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,qBAAqB,IAAgE;AACnF,eAAW,CAAC,WAAW,OAAO,KAAK,KAAK,MAAO,IAAG,SAAS,SAAS;AAAA,EACtE;AACF;","names":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
buildStandup,
|
|
3
3
|
parseStandupDate
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-5KGYTX5O.js";
|
|
5
5
|
import {
|
|
6
6
|
backfillMemoryStorage,
|
|
7
7
|
runLocationBackfill,
|
|
@@ -9,23 +9,23 @@ import {
|
|
|
9
9
|
runLocationDay,
|
|
10
10
|
runLocationStatus,
|
|
11
11
|
runLocationSync
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-XYGQSDTH.js";
|
|
13
13
|
import {
|
|
14
14
|
externalWikiSearchOperation
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-DPSOFK4D.js";
|
|
16
16
|
import {
|
|
17
17
|
DECISION_SUBCOMMANDS,
|
|
18
18
|
DELTA_SUBCOMMANDS,
|
|
19
19
|
defineOperation,
|
|
20
20
|
isCodegraphToolName
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-XLBFX63V.js";
|
|
22
22
|
import {
|
|
23
23
|
CorrectionContractError
|
|
24
24
|
} from "./chunk-ETSJD5IV.js";
|
|
25
25
|
import {
|
|
26
26
|
memoryStoreRequestSchema,
|
|
27
27
|
retainedCategoryAlias
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-RYYVMZBR.js";
|
|
29
29
|
import {
|
|
30
30
|
serializeMutations,
|
|
31
31
|
withHeldFileLock
|
|
@@ -1916,4 +1916,4 @@ export {
|
|
|
1916
1916
|
codegraphIngestTracesOperation,
|
|
1917
1917
|
REGISTERED_OPERATIONS
|
|
1918
1918
|
};
|
|
1919
|
-
//# sourceMappingURL=chunk-
|
|
1919
|
+
//# sourceMappingURL=chunk-RP7PQWZM.js.map
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
LanceDbBackend
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-655FVTCD.js";
|
|
4
4
|
import {
|
|
5
5
|
MeilisearchBackend
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-GQJKVQJR.js";
|
|
7
7
|
import {
|
|
8
8
|
NoopSearchBackend
|
|
9
9
|
} from "./chunk-CYEPCZN5.js";
|
|
10
10
|
import {
|
|
11
11
|
OramaBackend
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-HFSPY26A.js";
|
|
13
13
|
import {
|
|
14
14
|
RemoteSearchBackend
|
|
15
15
|
} from "./chunk-7VO6E5UD.js";
|
|
@@ -179,4 +179,4 @@ export {
|
|
|
179
179
|
createConversationSearchBackend,
|
|
180
180
|
createConversationIndexRuntime
|
|
181
181
|
};
|
|
182
|
-
//# sourceMappingURL=chunk-
|
|
182
|
+
//# sourceMappingURL=chunk-RTTPBBAN.js.map
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
import {
|
|
13
13
|
OFFLINE_SYNC_FILE_CONTENT_MAX_CHUNK_BYTES,
|
|
14
14
|
OFFLINE_SYNC_MAX_MTIME_MS
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-23ZQPP2G.js";
|
|
16
16
|
import {
|
|
17
17
|
validateArchiveRelativePath
|
|
18
18
|
} from "./chunk-GCGJW34D.js";
|
|
@@ -563,4 +563,4 @@ export {
|
|
|
563
563
|
actionConfidenceRequestSchema,
|
|
564
564
|
validateRequest
|
|
565
565
|
};
|
|
566
|
-
//# sourceMappingURL=chunk-
|
|
566
|
+
//# sourceMappingURL=chunk-RYYVMZBR.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
defineOperation
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-XLBFX63V.js";
|
|
4
4
|
import {
|
|
5
5
|
EngramAccessInputError
|
|
6
6
|
} from "./chunk-3MUKQQ7A.js";
|
|
@@ -71,4 +71,4 @@ defineOperation({
|
|
|
71
71
|
})
|
|
72
72
|
})
|
|
73
73
|
});
|
|
74
|
-
//# sourceMappingURL=chunk-
|
|
74
|
+
//# sourceMappingURL=chunk-T7ASDYNK.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
getOperation,
|
|
4
4
|
operationRequiresAuthorizedNamespace,
|
|
5
5
|
operationUsesPrincipalNamespace
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-XLBFX63V.js";
|
|
7
7
|
import {
|
|
8
8
|
assertOperationAuthorizationAllowed
|
|
9
9
|
} from "./chunk-IG747LRN.js";
|
|
@@ -60,4 +60,4 @@ export {
|
|
|
60
60
|
authorizationProbeNamespaces,
|
|
61
61
|
authorizationProbeRequiresPrincipalNamespace
|
|
62
62
|
};
|
|
63
|
-
//# sourceMappingURL=chunk-
|
|
63
|
+
//# sourceMappingURL=chunk-THEPGZBM.js.map
|
|
@@ -49,16 +49,16 @@ import {
|
|
|
49
49
|
} from "./chunk-KIUVEMBI.js";
|
|
50
50
|
import {
|
|
51
51
|
getOperation
|
|
52
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-XLBFX63V.js";
|
|
53
53
|
import {
|
|
54
54
|
WHO_KNOWS_MCP_TOOLS
|
|
55
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-4PDTVVSW.js";
|
|
56
56
|
import {
|
|
57
57
|
PROMOTION_CANDIDATES_MCP_TOOLS
|
|
58
58
|
} from "./chunk-STBX5X6B.js";
|
|
59
59
|
import {
|
|
60
60
|
validateRequest
|
|
61
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-RYYVMZBR.js";
|
|
62
62
|
import {
|
|
63
63
|
SUPPORT_PASSPORT_SOURCE_MEMORY_ID_MAX_LENGTH
|
|
64
64
|
} from "./chunk-PWPIERBM.js";
|
|
@@ -3986,4 +3986,4 @@ export {
|
|
|
3986
3986
|
MCP_MIGRATED_OPERATIONS,
|
|
3987
3987
|
EngramMcpServer
|
|
3988
3988
|
};
|
|
3989
|
-
//# sourceMappingURL=chunk-
|
|
3989
|
+
//# sourceMappingURL=chunk-TMC7HBED.js.map
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
SupportPassportError,
|
|
3
3
|
SupportPassportOwnerCreateGrantRequestSchema,
|
|
4
4
|
getOperation
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-XLBFX63V.js";
|
|
6
6
|
|
|
7
7
|
// src/support-passport/access-http.ts
|
|
8
8
|
var OWNER_ROOT = "/engram/v1/support-passport";
|
|
@@ -137,4 +137,4 @@ export {
|
|
|
137
137
|
SUPPORT_PASSPORT_OWNER_HTTP_ROUTES,
|
|
138
138
|
handleSupportPassportOwnerHttp
|
|
139
139
|
};
|
|
140
|
-
//# sourceMappingURL=chunk-
|
|
140
|
+
//# sourceMappingURL=chunk-TPNCXSXP.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
StorageManager
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-4SCZZ3U7.js";
|
|
4
4
|
import {
|
|
5
5
|
composeMemoryEnvelope
|
|
6
6
|
} from "./chunk-5LRV557D.js";
|
|
@@ -546,4 +546,4 @@ export {
|
|
|
546
546
|
setSemanticRulePromotionTestHooks,
|
|
547
547
|
promoteSemanticRuleFromMemory
|
|
548
548
|
};
|
|
549
|
-
//# sourceMappingURL=chunk-
|
|
549
|
+
//# sourceMappingURL=chunk-UGYUBENJ.js.map
|