@remnic/core 9.65.8 → 9.66.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/access-admin-ops-surface.d.ts +11 -12
- package/dist/access-admin-ops-surface.js +49 -46
- package/dist/access-authorization-probe.d.ts +11 -12
- package/dist/access-authorization-probe.js +50 -47
- package/dist/access-boundary.d.ts +11 -12
- package/dist/access-boundary.js +49 -46
- package/dist/access-citation-namespace.js +3 -3
- package/dist/access-cli.js +111 -106
- package/dist/access-cli.js.map +1 -1
- package/dist/access-coding-context-resolution.d.ts +1 -2
- package/dist/access-coding-context-resolution.js +2 -2
- package/dist/access-extraction-force-flush.d.ts +11 -12
- package/dist/access-extraction-force-flush.js +49 -46
- package/dist/access-health-types.d.ts +1 -2
- package/dist/access-http-lcm-compaction.d.ts +11 -12
- package/dist/access-http-lifecycle-flush.d.ts +11 -12
- package/dist/access-http-offline-stream.d.ts +11 -12
- package/dist/access-http-query.d.ts +2 -3
- package/dist/access-http-query.js +51 -48
- package/dist/access-http.d.ts +12 -13
- package/dist/access-http.js +68 -65
- package/dist/access-identity-continuity-surface.d.ts +9 -10
- package/dist/access-identity-continuity-surface.js +49 -46
- package/dist/access-lcm-surface.d.ts +11 -12
- package/dist/access-lcm-surface.js +49 -46
- package/dist/access-mcp-output-schemas.js +1 -1
- package/dist/access-mcp.d.ts +11 -12
- package/dist/access-mcp.js +62 -59
- package/dist/access-memory-search-fanout.d.ts +2 -3
- package/dist/{access-namespace-preflight-CpAOrS-9.d.ts → access-namespace-preflight-CLWUoMyW.d.ts} +1 -1
- package/dist/access-namespace-preflight.d.ts +3 -4
- package/dist/access-namespace-preflight.js +49 -46
- package/dist/access-observe-write-surface.d.ts +11 -12
- package/dist/access-observe-write-surface.js +49 -46
- package/dist/access-offline-manifest.d.ts +9 -10
- package/dist/access-offline-manifest.js +15 -15
- package/dist/access-operations-batch.js +54 -51
- package/dist/access-operations.d.ts +17 -18
- package/dist/access-operations.js +59 -56
- package/dist/access-recall-concurrency.d.ts +11 -12
- package/dist/access-recall-concurrency.js +49 -46
- package/dist/access-recall-response.d.ts +11 -12
- package/dist/access-recall-response.js +49 -46
- package/dist/access-recall-surface.d.ts +11 -12
- package/dist/access-recall-surface.js +49 -46
- package/dist/access-schema.d.ts +83 -83
- package/dist/access-schema.js +7 -7
- package/dist/{access-service-Diu61Cfv.d.ts → access-service-CEUE1Isj.d.ts} +66 -66
- package/dist/access-service-helpers.d.ts +11 -12
- package/dist/access-service.d.ts +11 -12
- package/dist/access-service.js +49 -46
- package/dist/access-surface-catalog.d.ts +11 -12
- package/dist/access-surface-catalog.js +53 -48
- package/dist/access-surface-catalog.js.map +1 -1
- package/dist/access-wearables-meetings-surface.d.ts +3 -4
- package/dist/action-confidence.d.ts +1 -2
- package/dist/active-memory-bridge.d.ts +1 -2
- package/dist/active-memory-bridge.js +2 -2
- package/dist/active-recall.d.ts +1 -2
- package/dist/active-recall.js +11 -11
- package/dist/ambient-provenance.d.ts +1 -2
- package/dist/artifact-search.d.ts +1 -2
- package/dist/{auto-sync-2YPITIWN.js → auto-sync-Q6Q2FVSC.js} +9 -9
- package/dist/behavior-learner.d.ts +1 -2
- package/dist/behavior-signals.d.ts +1 -2
- package/dist/bootstrap.d.ts +9 -10
- package/dist/briefing-window.d.ts +2 -3
- package/dist/briefing.d.ts +2 -3
- package/dist/briefing.js +23 -23
- package/dist/buffer-surprise-report.d.ts +1 -2
- package/dist/buffer-turn-helpers.d.ts +1 -2
- package/dist/buffer.d.ts +2 -3
- package/dist/buffer.js +20 -4
- package/dist/bulk-import/index.d.ts +3 -4
- package/dist/calibration.d.ts +1 -2
- package/dist/calibration.js +1 -1
- package/dist/capabilities.d.ts +1 -2
- package/dist/{capsule-merge-SGIVB3WA.js → capsule-merge-SEHERWWP.js} +4 -4
- package/dist/{catalog-9f-vEQLS.d.ts → catalog-D1HgugTA.d.ts} +1 -1
- package/dist/causal-behavior.d.ts +1 -2
- package/dist/causal-consolidation.d.ts +1 -2
- package/dist/causal-consolidation.js +24 -24
- package/dist/causal-trajectory-graph.d.ts +1 -2
- package/dist/{chunk-LEPOP46W.js → chunk-227UFSEQ.js} +4 -4
- package/dist/{chunk-NPFUNWNX.js → chunk-23CVL7HS.js} +2 -2
- package/dist/{chunk-PO7NXBG2.js → chunk-2GF27PGH.js} +5 -5
- package/dist/{chunk-MY2BC6UE.js → chunk-2LBAFHOQ.js} +11 -11
- package/dist/{chunk-AZMLH5UT.js → chunk-33MFRY25.js} +2 -2
- package/dist/{chunk-UEBDCMOO.js → chunk-3TSU662L.js} +3 -3
- package/dist/{chunk-CAMNRAJF.js → chunk-4FHRZD5T.js} +2 -2
- package/dist/{chunk-FP7YTTVO.js → chunk-4OFKZAJG.js} +2 -1
- package/dist/chunk-4OFKZAJG.js.map +1 -0
- package/dist/{chunk-S5XOSTYM.js → chunk-4STAANV7.js} +3 -3
- package/dist/{chunk-LKYIOCWL.js → chunk-56IV4J5W.js} +546 -96
- package/dist/chunk-56IV4J5W.js.map +1 -0
- package/dist/{chunk-4F4AQFWL.js → chunk-6CEGSTBD.js} +10 -10
- package/dist/{chunk-JYSN42VN.js → chunk-6QDXA26G.js} +235 -181
- package/dist/chunk-6QDXA26G.js.map +1 -0
- package/dist/{chunk-MDD2RINF.js → chunk-6RUHELWR.js} +3 -3
- package/dist/{chunk-WNXYT4MK.js → chunk-72OIT7KS.js} +4 -4
- package/dist/{chunk-KQAFEZQX.js → chunk-7LCGFUMB.js} +4 -4
- package/dist/{chunk-SNOIKAHM.js → chunk-7UTDHQZ5.js} +3 -3
- package/dist/{chunk-5HK3CJAR.js → chunk-7XOG75AU.js} +3 -3
- package/dist/{chunk-7BDZTALN.js → chunk-AJTG3CP7.js} +12 -2
- package/dist/chunk-AJTG3CP7.js.map +1 -0
- package/dist/{chunk-2LWQSV6A.js → chunk-AL3UYZ5N.js} +3 -2
- package/dist/chunk-AL3UYZ5N.js.map +1 -0
- package/dist/{chunk-UPFNQJC7.js → chunk-CN4VKV3S.js} +2 -2
- package/dist/{chunk-PMVPCZJZ.js → chunk-CTCGHNWN.js} +6 -6
- package/dist/{chunk-EGBDFJ36.js → chunk-DD5JFCWM.js} +2 -2
- package/dist/{chunk-XBGHAAKR.js → chunk-DDX6KIXF.js} +2 -2
- package/dist/{chunk-JIYDRBVZ.js → chunk-DJORULH3.js} +2 -2
- package/dist/{chunk-UENKPWCS.js → chunk-DMEHOEC7.js} +6 -6
- package/dist/{chunk-7KQB4EBS.js → chunk-DUAJKRR2.js} +2 -2
- package/dist/{chunk-XDL5CYZN.js → chunk-EEOUMG3J.js} +2 -1
- package/dist/{chunk-XDL5CYZN.js.map → chunk-EEOUMG3J.js.map} +1 -1
- package/dist/{chunk-SEEJOGQX.js → chunk-EFQCDJZ2.js} +4 -4
- package/dist/{chunk-Q57GOHLF.js → chunk-EGALNSZ4.js} +3 -3
- package/dist/{chunk-KCT36JAW.js → chunk-ESNFSSO4.js} +2 -2
- package/dist/{chunk-XQ3HXAQH.js → chunk-ET2CNMLD.js} +4 -4
- package/dist/{chunk-PU56CXZA.js → chunk-EZSCW4EM.js} +2 -2
- package/dist/{chunk-HMZKGHMD.js → chunk-FESUGFIL.js} +3 -3
- package/dist/{chunk-3A2NJP2U.js → chunk-FKKGCGYL.js} +3 -3
- package/dist/{chunk-BWGCOLEL.js → chunk-FTTJRVB7.js} +2 -2
- package/dist/{chunk-ODU2CNNX.js → chunk-FYWLSFFS.js} +2 -2
- package/dist/{chunk-W2BAGGEW.js → chunk-GEJKYA7D.js} +33 -24
- package/dist/{chunk-W2BAGGEW.js.map → chunk-GEJKYA7D.js.map} +1 -1
- package/dist/chunk-GSKINLAK.js +267 -0
- package/dist/chunk-GSKINLAK.js.map +1 -0
- package/dist/{chunk-3PKAS6VL.js → chunk-GX6FTSYH.js} +2 -2
- package/dist/{chunk-76DIF5KT.js → chunk-H7VDIF2V.js} +2 -2
- package/dist/{chunk-F7XUD3PL.js → chunk-HJXA6ZM7.js} +2 -2
- package/dist/{chunk-4QEYREAV.js → chunk-HNPE66LB.js} +2 -2
- package/dist/{chunk-P36Z4JRA.js → chunk-I5VB44ZK.js} +2 -2
- package/dist/{chunk-EUYWQ7TS.js → chunk-IEZ6CGTW.js} +2 -2
- package/dist/{chunk-OXRRJXPR.js → chunk-IHGMRDEE.js} +275 -1678
- package/dist/chunk-IHGMRDEE.js.map +1 -0
- package/dist/{chunk-5DHKCO52.js → chunk-IVIAHQBR.js} +2 -2
- package/dist/{chunk-TFR3HG4K.js → chunk-J3OND5QT.js} +4 -4
- package/dist/{chunk-UW5NPZJ2.js → chunk-JALOAKSZ.js} +59 -7
- package/dist/chunk-JALOAKSZ.js.map +1 -0
- package/dist/{chunk-5ACCD4L7.js → chunk-JRRQ747T.js} +7 -7
- package/dist/{chunk-V4IDF3EZ.js → chunk-JTWZKNUH.js} +5 -5
- package/dist/chunk-K66OY4EI.js +202 -0
- package/dist/chunk-K66OY4EI.js.map +1 -0
- package/dist/{chunk-XAB6STPO.js → chunk-KODXCHXJ.js} +17 -3
- package/dist/chunk-KODXCHXJ.js.map +1 -0
- package/dist/{chunk-KZIF6XHX.js → chunk-KXIXO76C.js} +28 -15
- package/dist/chunk-KXIXO76C.js.map +1 -0
- package/dist/{chunk-5RWZH6PH.js → chunk-L4X4PJYK.js} +2 -2
- package/dist/{chunk-UTQUEHC7.js → chunk-LUDBXTBJ.js} +8 -8
- package/dist/{chunk-XNWXSGHS.js → chunk-MAH64N55.js} +28 -10
- package/dist/chunk-MAH64N55.js.map +1 -0
- package/dist/{chunk-LDKPDODJ.js → chunk-ME35HVDJ.js} +2 -2
- package/dist/{chunk-DPCXDG7G.js → chunk-MJRGVXPQ.js} +2 -2
- package/dist/{chunk-773TRRGT.js → chunk-MJUCDM3C.js} +2 -2
- package/dist/{chunk-T6ILXUAH.js → chunk-MN5NOOI7.js} +2 -2
- package/dist/{chunk-AHPIFKNG.js → chunk-N4F7ZSSG.js} +2 -2
- package/dist/{chunk-JOZUBF4A.js → chunk-NACLNNFQ.js} +2 -2
- package/dist/{chunk-LC2BDILZ.js → chunk-NBP4EX5N.js} +2 -2
- package/dist/{chunk-ZVPVTPGI.js → chunk-NNZFPYYX.js} +4 -4
- package/dist/{chunk-DA7ITC5Z.js → chunk-O57GM3FR.js} +2 -2
- package/dist/{chunk-7VZFRUQU.js → chunk-O7ERGZDA.js} +5 -5
- package/dist/{chunk-3SZD4CYO.js → chunk-OAJMQKQR.js} +3 -3
- package/dist/{chunk-HSZMX3ZJ.js → chunk-ODW5GDFE.js} +2 -2
- package/dist/{chunk-7WOWGRAU.js → chunk-PEBH5DCK.js} +10 -7
- package/dist/{chunk-7WOWGRAU.js.map → chunk-PEBH5DCK.js.map} +1 -1
- package/dist/{chunk-J2WC5LF4.js → chunk-QBC33MPY.js} +2 -1
- package/dist/{chunk-T7XP6IZE.js → chunk-QCRJMU5V.js} +2 -2
- package/dist/chunk-QJCWK2A7.js +1466 -0
- package/dist/chunk-QJCWK2A7.js.map +1 -0
- package/dist/{chunk-YEUXERJ6.js → chunk-RDGKVH6T.js} +7 -3
- package/dist/{chunk-YEUXERJ6.js.map → chunk-RDGKVH6T.js.map} +1 -1
- package/dist/{chunk-OA2O2GJ4.js → chunk-RZ3IZIJG.js} +3 -3
- package/dist/{chunk-UL4MKZHI.js → chunk-SN4JXNLL.js} +2 -2
- package/dist/chunk-TB2MJRI6.js +866 -0
- package/dist/chunk-TB2MJRI6.js.map +1 -0
- package/dist/{chunk-7PHI6GUI.js → chunk-TEZ2HTC7.js} +42 -2
- package/dist/chunk-TEZ2HTC7.js.map +1 -0
- package/dist/{chunk-CPA5NBHN.js → chunk-TNGH4ZYI.js} +2 -2
- package/dist/{chunk-F3NVYTTA.js → chunk-TNXNECAN.js} +6 -6
- package/dist/{chunk-BEC4YBNA.js → chunk-TVW4C7PV.js} +2 -2
- package/dist/{chunk-UFKPQBXH.js → chunk-U62OK7BB.js} +2 -2
- package/dist/{chunk-AX7UXCHJ.js → chunk-UYA36DQ7.js} +2 -1
- package/dist/chunk-UYA36DQ7.js.map +1 -0
- package/dist/{chunk-DEACDKE3.js → chunk-VCKWULAK.js} +112 -87
- package/dist/chunk-VCKWULAK.js.map +1 -0
- package/dist/chunk-VOSWUO3K.js +100 -0
- package/dist/chunk-VOSWUO3K.js.map +1 -0
- package/dist/{chunk-TUHBYJXL.js → chunk-VQ4AMTGZ.js} +1 -1
- package/dist/{chunk-3BCULS4U.js → chunk-VQNRICAQ.js} +145 -507
- package/dist/chunk-VQNRICAQ.js.map +1 -0
- package/dist/{chunk-H2YSH3DG.js → chunk-WKAXBXVA.js} +2 -2
- package/dist/{chunk-HRHO3ZNG.js → chunk-WKJFIMVN.js} +2 -2
- package/dist/{chunk-SXIMQLGV.js → chunk-WVGXCBOC.js} +2 -2
- package/dist/{chunk-CRML27CO.js → chunk-X5YYSAZX.js} +4 -4
- package/dist/{chunk-FZEEWOI2.js → chunk-XJJYSX6F.js} +2 -2
- package/dist/{chunk-U7EW2W4W.js → chunk-XKNHFDTT.js} +26 -6
- package/dist/chunk-XKNHFDTT.js.map +1 -0
- package/dist/{chunk-UG6VXIOK.js → chunk-XSTNGNJP.js} +2 -2
- package/dist/{chunk-YDPAE2RD.js → chunk-YFLLGRXO.js} +2 -2
- package/dist/{chunk-LPNCR4QK.js → chunk-YXFCALVT.js} +12 -12
- package/dist/{chunk-Q4WONDMJ.js → chunk-YYGZJPOK.js} +2 -2
- package/dist/{chunk-GTO56JY5.js → chunk-ZJPM7GZ3.js} +2 -2
- package/dist/{chunk-LOXHYCVS.js → chunk-ZW4VXELZ.js} +2 -2
- package/dist/{cli-O3F-ht3i.d.ts → cli-BEkm2MEf.d.ts} +5 -5
- package/dist/cli.d.ts +13 -14
- package/dist/cli.js +90 -85
- package/dist/coding/export-okf-codegraph.d.ts +56 -0
- package/dist/coding/export-okf-codegraph.js +526 -0
- package/dist/coding/export-okf-codegraph.js.map +1 -0
- package/dist/coding/pre-action-gate.d.ts +1 -2
- package/dist/compounding/engine.d.ts +2 -3
- package/dist/compounding/engine.js +24 -24
- package/dist/compounding/preference-consolidator.d.ts +1 -2
- package/dist/compression-optimizer.d.ts +1 -2
- package/dist/config.d.ts +1 -2
- package/dist/config.js +11 -11
- package/dist/connectors/codex-materialize-runner.d.ts +1 -2
- package/dist/connectors/codex-materialize-runner.js +23 -23
- package/dist/connectors/codex-materialize.d.ts +1 -2
- package/dist/connectors/index.d.ts +1 -2
- package/dist/connectors/index.js +23 -23
- package/dist/consolidation-provenance-check.d.ts +2 -3
- package/dist/consolidation-provenance-check.js +4 -4
- package/dist/consolidation-undo.d.ts +2 -3
- package/dist/consolidation-undo.js +3 -3
- package/dist/contradiction/index.d.ts +3 -4
- package/dist/contradiction/index.js +9 -9
- package/dist/{contradiction-scan-AKUWPX5N.js → contradiction-scan-NOYMFG66.js} +3 -3
- package/dist/converge-config.d.ts +1 -2
- package/dist/convergence-refresh.d.ts +2 -3
- package/dist/convergence-refresh.js +25 -25
- package/dist/conversation-index/backend.d.ts +1 -2
- package/dist/conversation-index/backend.js +2 -2
- package/dist/conversation-index/chunker.d.ts +1 -2
- package/dist/conversation-index/faiss-adapter.d.ts +1 -2
- package/dist/conversation-index/indexer.d.ts +1 -2
- package/dist/conversation-index/search.d.ts +1 -2
- package/dist/corpus-watermark.d.ts +1 -2
- package/dist/corpus-watermark.js +25 -25
- package/dist/cross-lingual-recall.d.ts +1 -2
- package/dist/day-summary.d.ts +1 -2
- package/dist/delinearize.d.ts +1 -2
- package/dist/dependency-propagation-config.d.ts +1 -2
- package/dist/{dependency-propagation-delivery-CL6RWXTA.d.ts → dependency-propagation-delivery-BCpeo14F.d.ts} +1 -1
- package/dist/direct-answer-wiring.d.ts +1 -2
- package/dist/direct-answer.d.ts +1 -2
- package/dist/embedding-fallback.d.ts +1 -2
- package/dist/enrichment/index.d.ts +1 -2
- package/dist/entity-origin-fields.d.ts +1 -2
- package/dist/entity-retrieval.d.ts +2 -3
- package/dist/entity-retrieval.js +23 -23
- package/dist/entity-schema.d.ts +1 -2
- package/dist/episodic-context.d.ts +1 -2
- package/dist/eval-trajectory-contracts.d.ts +1 -2
- package/dist/eval-trajectory-store.d.ts +1 -2
- package/dist/eval-trajectory.d.ts +1 -2
- package/dist/explicit-capture.d.ts +9 -10
- package/dist/explicit-capture.js +11 -11
- package/dist/external-wiki-access.d.ts +11 -12
- package/dist/external-wiki-access.js +50 -47
- package/dist/external-wiki-collection-registration.d.ts +1 -2
- package/dist/external-wiki-collection.d.ts +1 -2
- package/dist/external-wiki-mcp-tools.d.ts +11 -12
- package/dist/extraction-error-classification.d.ts +1 -2
- package/dist/extraction-faithfulness.d.ts +1 -2
- package/dist/extraction-faithfulness.js +2 -2
- package/dist/extraction-judge-telemetry.d.ts +1 -2
- package/dist/extraction-judge-training.d.ts +1 -2
- package/dist/extraction-judge.d.ts +1 -2
- package/dist/extraction-judge.js +2 -2
- package/dist/extraction-liveness.d.ts +1 -2
- package/dist/extraction-normalization.d.ts +1 -2
- package/dist/extraction-prompt.d.ts +1 -2
- package/dist/extraction-source-grounding-rules.d.ts +1 -2
- package/dist/extraction-source-grounding.d.ts +1 -2
- package/dist/extraction.d.ts +1 -2
- package/dist/extraction.js +32 -29
- package/dist/fallback-llm.d.ts +7 -2
- package/dist/fallback-llm.js +1 -1
- package/dist/{first-start-migration-4NETATFF.js → first-start-migration-KHIMCBIC.js} +3 -3
- package/dist/graph-dashboard-diff.d.ts +1 -2
- package/dist/graph-dashboard-key.d.ts +1 -2
- package/dist/graph-dashboard-parser.d.ts +1 -2
- package/dist/graph-edge-reinforcement.d.ts +1 -2
- package/dist/graph-path-reconstruction.d.ts +1 -2
- package/dist/graph-path-scoring.d.ts +1 -2
- package/dist/graph-snapshot.d.ts +1 -2
- package/dist/graph.d.ts +1 -2
- package/dist/harmonic-retrieval.js +1 -1
- package/dist/importance.d.ts +1 -2
- package/dist/importers/index.d.ts +1 -2
- package/dist/in-flight-reads.d.ts +1 -2
- package/dist/{index-C7Xep6S9.d.ts → index-D_pyMUaP.d.ts} +2 -2
- package/dist/index.d.ts +929 -700
- package/dist/index.js +167 -132
- package/dist/intent.d.ts +1 -2
- package/dist/lcm/engine.d.ts +1 -2
- package/dist/lcm/index.d.ts +1 -2
- package/dist/lcm/tools.d.ts +1 -2
- package/dist/lifecycle.d.ts +1 -2
- package/dist/live-connectors-runner.d.ts +1 -2
- package/dist/local-llm.d.ts +1 -2
- package/dist/local-model-endpoint.d.ts +1 -2
- package/dist/location/index.d.ts +315 -6
- package/dist/location/index.js +151 -19
- package/dist/maintenance/memory-governance.d.ts +1 -2
- package/dist/maintenance/memory-governance.js +23 -23
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.d.ts +2 -3
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +23 -23
- package/dist/maintenance/rebuild-memory-projection.d.ts +2 -3
- package/dist/maintenance/rebuild-memory-projection.js +24 -24
- package/dist/{maintenance-CJ-xqFp0.d.ts → maintenance-DDUX9d6D.d.ts} +3 -3
- package/dist/mcp-memory-inspector-app.d.ts +11 -12
- package/dist/mcp-read-only-tools.js +1 -1
- package/dist/memory-action-policy.d.ts +1 -2
- package/dist/memory-cache.d.ts +1 -2
- package/dist/memory-controller.d.ts +1 -2
- package/dist/memory-lifecycle-ledger-utils.d.ts +1 -2
- package/dist/memory-projection-mutations.js +3 -3
- package/dist/memory-projection-store.d.ts +1 -2
- package/dist/memory-projection-store.js +1 -1
- package/dist/memory-provenance.d.ts +1 -2
- package/dist/memory-snapshot.d.ts +1 -2
- package/dist/memory-subject-cli.d.ts +11 -12
- package/dist/memory-subject.d.ts +11 -12
- package/dist/memory-subject.js +4 -4
- package/dist/memory-worth-outcomes.d.ts +2 -3
- package/dist/models-json.d.ts +1 -2
- package/dist/namespaces/migrate.d.ts +3 -4
- package/dist/namespaces/migrate.js +24 -24
- package/dist/namespaces/principal.d.ts +1 -2
- package/dist/namespaces/search.d.ts +1 -2
- package/dist/namespaces/search.js +5 -5
- package/dist/namespaces/storage.d.ts +3 -4
- package/dist/namespaces/storage.js +23 -23
- package/dist/native-knowledge.d.ts +1 -2
- package/dist/offline-sync-file-io.js +3 -3
- package/dist/offline-sync-impression-drain.d.ts +1 -2
- package/dist/offline-sync-impression-drain.js +9 -9
- package/dist/offline-sync.js +4 -4
- package/dist/operator-doctor-corpus.d.ts +1 -2
- package/dist/operator-doctor-corpus.js +26 -26
- package/dist/operator-doctor-replica.d.ts +1 -2
- package/dist/operator-toolkit.d.ts +3 -4
- package/dist/operator-toolkit.js +42 -42
- package/dist/orchestration/compression-guideline-coordinator.d.ts +2 -3
- package/dist/orchestration/maintenance.d.ts +4 -5
- package/dist/orchestration/maintenance.js +37 -36
- package/dist/{orchestrator-BsntWxLy.d.ts → orchestrator-3F4jihCo.d.ts} +8 -8
- package/dist/orchestrator.d.ts +9 -10
- package/dist/orchestrator.js +111 -106
- package/dist/page-versioning.js +3 -3
- package/dist/patterns-cli.d.ts +1 -2
- package/dist/{pipeline-CVoysPm2.d.ts → pipeline-CB1dj6Uh.d.ts} +1 -1
- package/dist/policy-runtime.d.ts +1 -2
- package/dist/proactive-contention.d.ts +1 -2
- package/dist/provenance.d.ts +1 -2
- package/dist/{public-http-CuOxlTC2.d.ts → public-http-34-JIAGQ.d.ts} +1 -1
- package/dist/{purge-GB7PZHT2.js → purge-OP6BEDFY.js} +2 -2
- package/dist/{qmd-DWMAGA5l.d.ts → qmd-edLLZXc5.d.ts} +1 -1
- package/dist/qmd-preflight.d.ts +2 -3
- package/dist/qmd-recall-cache.d.ts +1 -2
- package/dist/qmd.d.ts +2 -3
- package/dist/recall-concurrency-config.d.ts +1 -2
- package/dist/recall-disclosure-escalation.d.ts +1 -2
- package/dist/recall-explain-renderer.d.ts +1 -2
- package/dist/recall-memory-map.d.ts +1 -2
- package/dist/recall-planner-llm.d.ts +1 -2
- package/dist/recall-planner-llm.js +1 -1
- package/dist/recall-state.d.ts +1 -2
- package/dist/recall-tag-filter.d.ts +1 -2
- package/dist/recall-timings.d.ts +1 -2
- package/dist/recall-xray-cli.d.ts +1 -2
- package/dist/recall-xray-renderer.d.ts +1 -2
- package/dist/recall-xray.d.ts +1 -2
- package/dist/reconcile/cursor.d.ts +1 -2
- package/dist/reconcile/manifest.d.ts +1 -2
- package/dist/reconcile/manifest.js +4 -4
- package/dist/reconcile/plan.d.ts +1 -2
- package/dist/replay/normalizers/chatgpt.d.ts +1 -2
- package/dist/replay/normalizers/claude.d.ts +1 -2
- package/dist/replay/normalizers/openclaw.d.ts +1 -2
- package/dist/replay/normalizers/shared.d.ts +1 -2
- package/dist/replay/runner.d.ts +1 -2
- package/dist/replay/types.d.ts +1 -2
- package/dist/replica-divergence.d.ts +1 -2
- package/dist/replica-peers-config.d.ts +1 -2
- package/dist/{resolution-XWBPKYFB.js → resolution-4DLI3IOR.js} +10 -10
- package/dist/resolve-auth-token.d.ts +1 -2
- package/dist/resume-bundles.js +12 -12
- package/dist/retrieval-agents.d.ts +2 -3
- package/dist/retrieval-tiers.d.ts +1 -2
- package/dist/routing/engine.d.ts +1 -2
- package/dist/routing/store.d.ts +1 -2
- package/dist/salvage-envelope.d.ts +1 -2
- package/dist/salvage-envelope.js +6 -6
- package/dist/schemas.d.ts +639 -174
- package/dist/schemas.js +3 -1
- package/dist/{scope-profiles-CPWkW_dI.d.ts → scope-profiles-BF2lu81V.d.ts} +1 -1
- package/dist/search/document-scanner.js +1 -1
- package/dist/search/embed-helper.d.ts +1 -2
- package/dist/search/factory.d.ts +1 -2
- package/dist/search/factory.js +4 -4
- package/dist/search/index.d.ts +1 -2
- package/dist/search/index.js +4 -4
- package/dist/search/lancedb-backend.d.ts +1 -2
- package/dist/search/lancedb-backend.js +1 -1
- package/dist/search/meilisearch-backend.d.ts +1 -2
- package/dist/search/meilisearch-backend.js +1 -1
- package/dist/search/noop-backend.d.ts +1 -2
- package/dist/search/orama-backend.d.ts +1 -2
- package/dist/search/orama-backend.js +1 -1
- package/dist/search/port.d.ts +1 -2
- package/dist/search/remote-backend.d.ts +1 -2
- package/dist/secure-store/index.js +3 -3
- package/dist/{semantic-consolidation-CNFVBXFc.d.ts → semantic-consolidation-5OuWXBRt.d.ts} +1 -1
- package/dist/semantic-consolidation.d.ts +2 -3
- package/dist/semantic-consolidation.js +24 -24
- package/dist/semantic-rule-promotion.js +23 -23
- package/dist/semantic-rule-verifier.d.ts +1 -2
- package/dist/semantic-rule-verifier.js +23 -23
- package/dist/{service-Bb-JIdQ0.d.ts → service-CrqEhLXD.d.ts} +2 -2
- package/dist/session-observer-bands.d.ts +1 -2
- package/dist/session-observer-state.d.ts +1 -2
- package/dist/shared-context/manager.d.ts +7 -8
- package/dist/signal.d.ts +1 -2
- package/dist/source-agent-qualifier.d.ts +1 -2
- package/dist/source-agent-qualifier.js +30 -27
- package/dist/standup/build.d.ts +16 -0
- package/dist/standup/build.js +17 -0
- package/dist/standup/build.js.map +1 -0
- package/dist/{storage-CukrlNKk.d.ts → storage-BQn-xnxm.d.ts} +1 -1
- package/dist/storage.d.ts +2 -3
- package/dist/storage.js +22 -22
- package/dist/subject-config.d.ts +1 -2
- package/dist/subject-config.js +5 -5
- package/dist/summarizer.d.ts +1 -2
- package/dist/summarizer.js +2 -2
- package/dist/summary-snapshot.d.ts +1 -2
- package/dist/support-passport/index.d.ts +16 -17
- package/dist/support-passport/index.js +52 -49
- package/dist/temporal-supersession.d.ts +2 -3
- package/dist/temporal-timeline-recall.d.ts +1 -2
- package/dist/temporal-validity.d.ts +1 -2
- package/dist/threading.d.ts +1 -2
- package/dist/tier-migration.d.ts +2 -3
- package/dist/tier-routing.d.ts +1 -2
- package/dist/tier-routing.js +2 -2
- package/dist/{tier-stats-4B5IJ3NE.js → tier-stats-2TOW3QNL.js} +3 -3
- package/dist/topics.d.ts +1 -2
- package/dist/transcript.d.ts +1 -2
- package/dist/transfer/capsule-export.js +2 -2
- package/dist/transfer/capsule-import.js +5 -5
- package/dist/transfer/export-okf.d.ts +39 -0
- package/dist/transfer/export-okf.js +112 -0
- package/dist/transfer/export-okf.js.map +1 -0
- package/dist/transfer/types.d.ts +78 -78
- package/dist/trust-score-stage.d.ts +1 -2
- package/dist/trust-score.d.ts +1 -2
- package/dist/{types-djxQlxJ7.d.ts → types-BRpcNjHZ.d.ts} +117 -2
- package/dist/types.d.ts +1 -2
- package/dist/utility-runtime.d.ts +1 -2
- package/dist/verified-recall.js +23 -23
- package/dist/who-knows-cli.d.ts +11 -12
- package/dist/who-knows-cli.js +24 -24
- package/dist/who-knows.d.ts +11 -12
- package/dist/who-knows.js +23 -23
- package/dist/write-envelope.d.ts +1 -2
- package/dist/write-envelope.js +5 -5
- package/package.json +34 -3
- package/src/access-admin-ops-surface.ts +6 -1
- package/src/access-boundary.ts +1 -0
- package/src/access-http.ts +3 -1
- package/src/access-mcp-output-schemas.ts +1 -0
- package/src/access-mcp.ts +3 -3
- package/src/access-operations.ts +1 -0
- package/src/access-service-offline-file-content.test.ts +63 -0
- package/src/access-surface-catalog.ts +2 -0
- package/src/activity/config.test.ts +1 -0
- package/src/activity/config.ts +21 -1
- package/src/activity/index.ts +1 -0
- package/src/activity/timeline/build.ts +279 -0
- package/src/activity/timeline/categories.ts +111 -0
- package/src/activity/timeline/classify.ts +110 -0
- package/src/activity/timeline/corrections.ts +145 -0
- package/src/activity/timeline/index.ts +6 -0
- package/src/activity/timeline/timeline.test.ts +277 -0
- package/src/activity/timeline/types.ts +106 -0
- package/src/activity/types.ts +6 -0
- package/src/cli/okf-commands.ts +45 -0
- package/src/cli.ts +2 -2
- package/src/coding/export-okf-codegraph.test.ts +381 -0
- package/src/coding/export-okf-codegraph.ts +565 -0
- package/src/config.test.ts +1 -0
- package/src/extraction-prompt-safety.test.ts +14 -2
- package/src/extraction.ts +21 -1
- package/src/fallback-llm.test.ts +134 -0
- package/src/fallback-llm.ts +77 -5
- package/src/location/access-operations.ts +17 -8
- package/src/location/backfill.ts +137 -0
- package/src/location/config.test.ts +3 -0
- package/src/location/config.ts +46 -2
- package/src/location/http-glue.ts +1 -1
- package/src/location/index.ts +3 -0
- package/src/location/intervals.ts +1 -0
- package/src/location/matching.test.ts +65 -0
- package/src/location/matching.ts +354 -0
- package/src/location/mcp-tools.ts +2 -1
- package/src/location/surfaces.test.ts +15 -2
- package/src/location/surfaces.ts +95 -18
- package/src/location/tagging.test.ts +119 -0
- package/src/location/tagging.ts +277 -0
- package/src/location/types.ts +23 -1
- package/src/mcp-read-only-tools.ts +1 -0
- package/src/memory-projection-store.ts +3 -1
- package/src/okf/cli.ts +18 -5
- package/src/okf/config.ts +5 -0
- package/src/okf/index-files.test.ts +60 -0
- package/src/okf/index-files.ts +114 -0
- package/src/okf/render.ts +133 -0
- package/src/okf/type-mapping.test.ts +3 -0
- package/src/okf/type-mapping.ts +2 -0
- package/src/orchestration/extraction-run.ts +2 -1
- package/src/orchestration/generic-recall-paths.ts +4 -3
- package/src/schemas.ts +17 -1
- package/src/standup/access-operations.ts +14 -0
- package/src/standup/build.test.ts +34 -0
- package/src/standup/build.ts +115 -0
- package/src/standup/http-glue.ts +15 -0
- package/src/standup/mcp-tools.ts +16 -0
- package/src/support-passport/card-projection.ts +1 -0
- package/src/support-passport/card-service-commit-forwarding.test.ts +1 -0
- package/src/support-passport/card-service.test.ts +75 -1
- package/src/support-passport/card-service.ts +6 -3
- package/src/support-passport/card-state.ts +5 -1
- package/src/support-passport/offline-sync-guard.ts +14 -1
- package/src/transfer/export-okf.test.ts +164 -0
- package/src/transfer/export-okf.ts +286 -0
- package/dist/chunk-2LWQSV6A.js.map +0 -1
- package/dist/chunk-3BCULS4U.js.map +0 -1
- package/dist/chunk-7BDZTALN.js.map +0 -1
- package/dist/chunk-7PHI6GUI.js.map +0 -1
- package/dist/chunk-AX7UXCHJ.js.map +0 -1
- package/dist/chunk-DEACDKE3.js.map +0 -1
- package/dist/chunk-FP7YTTVO.js.map +0 -1
- package/dist/chunk-JYSN42VN.js.map +0 -1
- package/dist/chunk-KZIF6XHX.js.map +0 -1
- package/dist/chunk-LKYIOCWL.js.map +0 -1
- package/dist/chunk-OXRRJXPR.js.map +0 -1
- package/dist/chunk-U7EW2W4W.js.map +0 -1
- package/dist/chunk-UW5NPZJ2.js.map +0 -1
- package/dist/chunk-XAB6STPO.js.map +0 -1
- package/dist/chunk-XNWXSGHS.js.map +0 -1
- package/dist/types-CM86alG1.d.ts +0 -89
- /package/dist/{auto-sync-2YPITIWN.js.map → auto-sync-Q6Q2FVSC.js.map} +0 -0
- /package/dist/{capsule-merge-SGIVB3WA.js.map → capsule-merge-SEHERWWP.js.map} +0 -0
- /package/dist/{chunk-LEPOP46W.js.map → chunk-227UFSEQ.js.map} +0 -0
- /package/dist/{chunk-NPFUNWNX.js.map → chunk-23CVL7HS.js.map} +0 -0
- /package/dist/{chunk-PO7NXBG2.js.map → chunk-2GF27PGH.js.map} +0 -0
- /package/dist/{chunk-MY2BC6UE.js.map → chunk-2LBAFHOQ.js.map} +0 -0
- /package/dist/{chunk-AZMLH5UT.js.map → chunk-33MFRY25.js.map} +0 -0
- /package/dist/{chunk-UEBDCMOO.js.map → chunk-3TSU662L.js.map} +0 -0
- /package/dist/{chunk-CAMNRAJF.js.map → chunk-4FHRZD5T.js.map} +0 -0
- /package/dist/{chunk-S5XOSTYM.js.map → chunk-4STAANV7.js.map} +0 -0
- /package/dist/{chunk-4F4AQFWL.js.map → chunk-6CEGSTBD.js.map} +0 -0
- /package/dist/{chunk-MDD2RINF.js.map → chunk-6RUHELWR.js.map} +0 -0
- /package/dist/{chunk-WNXYT4MK.js.map → chunk-72OIT7KS.js.map} +0 -0
- /package/dist/{chunk-KQAFEZQX.js.map → chunk-7LCGFUMB.js.map} +0 -0
- /package/dist/{chunk-SNOIKAHM.js.map → chunk-7UTDHQZ5.js.map} +0 -0
- /package/dist/{chunk-5HK3CJAR.js.map → chunk-7XOG75AU.js.map} +0 -0
- /package/dist/{chunk-UPFNQJC7.js.map → chunk-CN4VKV3S.js.map} +0 -0
- /package/dist/{chunk-PMVPCZJZ.js.map → chunk-CTCGHNWN.js.map} +0 -0
- /package/dist/{chunk-EGBDFJ36.js.map → chunk-DD5JFCWM.js.map} +0 -0
- /package/dist/{chunk-XBGHAAKR.js.map → chunk-DDX6KIXF.js.map} +0 -0
- /package/dist/{chunk-JIYDRBVZ.js.map → chunk-DJORULH3.js.map} +0 -0
- /package/dist/{chunk-UENKPWCS.js.map → chunk-DMEHOEC7.js.map} +0 -0
- /package/dist/{chunk-7KQB4EBS.js.map → chunk-DUAJKRR2.js.map} +0 -0
- /package/dist/{chunk-SEEJOGQX.js.map → chunk-EFQCDJZ2.js.map} +0 -0
- /package/dist/{chunk-Q57GOHLF.js.map → chunk-EGALNSZ4.js.map} +0 -0
- /package/dist/{chunk-KCT36JAW.js.map → chunk-ESNFSSO4.js.map} +0 -0
- /package/dist/{chunk-XQ3HXAQH.js.map → chunk-ET2CNMLD.js.map} +0 -0
- /package/dist/{chunk-PU56CXZA.js.map → chunk-EZSCW4EM.js.map} +0 -0
- /package/dist/{chunk-HMZKGHMD.js.map → chunk-FESUGFIL.js.map} +0 -0
- /package/dist/{chunk-3A2NJP2U.js.map → chunk-FKKGCGYL.js.map} +0 -0
- /package/dist/{chunk-BWGCOLEL.js.map → chunk-FTTJRVB7.js.map} +0 -0
- /package/dist/{chunk-ODU2CNNX.js.map → chunk-FYWLSFFS.js.map} +0 -0
- /package/dist/{chunk-3PKAS6VL.js.map → chunk-GX6FTSYH.js.map} +0 -0
- /package/dist/{chunk-76DIF5KT.js.map → chunk-H7VDIF2V.js.map} +0 -0
- /package/dist/{chunk-F7XUD3PL.js.map → chunk-HJXA6ZM7.js.map} +0 -0
- /package/dist/{chunk-4QEYREAV.js.map → chunk-HNPE66LB.js.map} +0 -0
- /package/dist/{chunk-P36Z4JRA.js.map → chunk-I5VB44ZK.js.map} +0 -0
- /package/dist/{chunk-EUYWQ7TS.js.map → chunk-IEZ6CGTW.js.map} +0 -0
- /package/dist/{chunk-5DHKCO52.js.map → chunk-IVIAHQBR.js.map} +0 -0
- /package/dist/{chunk-TFR3HG4K.js.map → chunk-J3OND5QT.js.map} +0 -0
- /package/dist/{chunk-5ACCD4L7.js.map → chunk-JRRQ747T.js.map} +0 -0
- /package/dist/{chunk-V4IDF3EZ.js.map → chunk-JTWZKNUH.js.map} +0 -0
- /package/dist/{chunk-5RWZH6PH.js.map → chunk-L4X4PJYK.js.map} +0 -0
- /package/dist/{chunk-UTQUEHC7.js.map → chunk-LUDBXTBJ.js.map} +0 -0
- /package/dist/{chunk-LDKPDODJ.js.map → chunk-ME35HVDJ.js.map} +0 -0
- /package/dist/{chunk-DPCXDG7G.js.map → chunk-MJRGVXPQ.js.map} +0 -0
- /package/dist/{chunk-773TRRGT.js.map → chunk-MJUCDM3C.js.map} +0 -0
- /package/dist/{chunk-T6ILXUAH.js.map → chunk-MN5NOOI7.js.map} +0 -0
- /package/dist/{chunk-AHPIFKNG.js.map → chunk-N4F7ZSSG.js.map} +0 -0
- /package/dist/{chunk-JOZUBF4A.js.map → chunk-NACLNNFQ.js.map} +0 -0
- /package/dist/{chunk-LC2BDILZ.js.map → chunk-NBP4EX5N.js.map} +0 -0
- /package/dist/{chunk-ZVPVTPGI.js.map → chunk-NNZFPYYX.js.map} +0 -0
- /package/dist/{chunk-DA7ITC5Z.js.map → chunk-O57GM3FR.js.map} +0 -0
- /package/dist/{chunk-7VZFRUQU.js.map → chunk-O7ERGZDA.js.map} +0 -0
- /package/dist/{chunk-3SZD4CYO.js.map → chunk-OAJMQKQR.js.map} +0 -0
- /package/dist/{chunk-HSZMX3ZJ.js.map → chunk-ODW5GDFE.js.map} +0 -0
- /package/dist/{chunk-J2WC5LF4.js.map → chunk-QBC33MPY.js.map} +0 -0
- /package/dist/{chunk-T7XP6IZE.js.map → chunk-QCRJMU5V.js.map} +0 -0
- /package/dist/{chunk-OA2O2GJ4.js.map → chunk-RZ3IZIJG.js.map} +0 -0
- /package/dist/{chunk-UL4MKZHI.js.map → chunk-SN4JXNLL.js.map} +0 -0
- /package/dist/{chunk-CPA5NBHN.js.map → chunk-TNGH4ZYI.js.map} +0 -0
- /package/dist/{chunk-F3NVYTTA.js.map → chunk-TNXNECAN.js.map} +0 -0
- /package/dist/{chunk-BEC4YBNA.js.map → chunk-TVW4C7PV.js.map} +0 -0
- /package/dist/{chunk-UFKPQBXH.js.map → chunk-U62OK7BB.js.map} +0 -0
- /package/dist/{chunk-TUHBYJXL.js.map → chunk-VQ4AMTGZ.js.map} +0 -0
- /package/dist/{chunk-H2YSH3DG.js.map → chunk-WKAXBXVA.js.map} +0 -0
- /package/dist/{chunk-HRHO3ZNG.js.map → chunk-WKJFIMVN.js.map} +0 -0
- /package/dist/{chunk-SXIMQLGV.js.map → chunk-WVGXCBOC.js.map} +0 -0
- /package/dist/{chunk-CRML27CO.js.map → chunk-X5YYSAZX.js.map} +0 -0
- /package/dist/{chunk-FZEEWOI2.js.map → chunk-XJJYSX6F.js.map} +0 -0
- /package/dist/{chunk-UG6VXIOK.js.map → chunk-XSTNGNJP.js.map} +0 -0
- /package/dist/{chunk-YDPAE2RD.js.map → chunk-YFLLGRXO.js.map} +0 -0
- /package/dist/{chunk-LPNCR4QK.js.map → chunk-YXFCALVT.js.map} +0 -0
- /package/dist/{chunk-Q4WONDMJ.js.map → chunk-YYGZJPOK.js.map} +0 -0
- /package/dist/{chunk-GTO56JY5.js.map → chunk-ZJPM7GZ3.js.map} +0 -0
- /package/dist/{chunk-LOXHYCVS.js.map → chunk-ZW4VXELZ.js.map} +0 -0
- /package/dist/{contradiction-scan-AKUWPX5N.js.map → contradiction-scan-NOYMFG66.js.map} +0 -0
- /package/dist/{first-start-migration-4NETATFF.js.map → first-start-migration-KHIMCBIC.js.map} +0 -0
- /package/dist/{purge-GB7PZHT2.js.map → purge-OP6BEDFY.js.map} +0 -0
- /package/dist/{resolution-XWBPKYFB.js.map → resolution-4DLI3IOR.js.map} +0 -0
- /package/dist/{tier-stats-4B5IJ3NE.js.map → tier-stats-2TOW3QNL.js.map} +0 -0
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { readdirSync, readFileSync, statSync, unlinkSync } from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
|
|
4
|
+
import { writeFileAtomically } from "../maintenance/atomic-file.js";
|
|
5
|
+
import { normalizeProjectionPreview } from "../memory-projection-format.js";
|
|
6
|
+
import { OKF_RESERVED_BASENAMES } from "./type-mapping.js";
|
|
7
|
+
|
|
8
|
+
export const OKF_INDEX_MARKER = "<!-- remnic-okf-index -->";
|
|
9
|
+
|
|
10
|
+
const INDEXED_ROOTS = ["entities", "facts", "corrections", "summaries"] as const;
|
|
11
|
+
|
|
12
|
+
export interface OkfIndexReport {
|
|
13
|
+
written: string[];
|
|
14
|
+
removed: string[];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export async function runOkfIndexMaintenance(
|
|
18
|
+
memoryDir: string,
|
|
19
|
+
enabled: boolean,
|
|
20
|
+
): Promise<OkfIndexReport> {
|
|
21
|
+
const written: string[] = [];
|
|
22
|
+
const removed: string[] = [];
|
|
23
|
+
const dirs = collectIndexDirs(memoryDir);
|
|
24
|
+
for (const dir of dirs) {
|
|
25
|
+
const indexPath = path.join(dir, "index.md");
|
|
26
|
+
if (!enabled) {
|
|
27
|
+
if (isGeneratedIndex(indexPath)) {
|
|
28
|
+
unlinkSync(indexPath);
|
|
29
|
+
removed.push(indexPath);
|
|
30
|
+
}
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
const next = renderIndex(dir);
|
|
34
|
+
if (next === null) continue;
|
|
35
|
+
if (isUnchangedGenerated(indexPath, next)) continue;
|
|
36
|
+
await writeFileAtomically(indexPath, next);
|
|
37
|
+
written.push(indexPath);
|
|
38
|
+
}
|
|
39
|
+
return { written, removed };
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function collectIndexDirs(memoryDir: string): string[] {
|
|
43
|
+
const dirs = [memoryDir];
|
|
44
|
+
for (const root of INDEXED_ROOTS) {
|
|
45
|
+
const full = path.join(memoryDir, root);
|
|
46
|
+
if (!isDir(full)) continue;
|
|
47
|
+
dirs.push(full);
|
|
48
|
+
if (root === "facts") {
|
|
49
|
+
for (const entry of safeList(full)) {
|
|
50
|
+
const child = path.join(full, entry);
|
|
51
|
+
if (isDir(child) && /^\d{4}-\d{2}-\d{2}$/.test(entry)) dirs.push(child);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return dirs;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function renderIndex(dir: string): string | null {
|
|
59
|
+
const entries = safeList(dir)
|
|
60
|
+
.filter((name) => name.endsWith(".md") && OKF_RESERVED_BASENAMES[name] !== true)
|
|
61
|
+
.sort((a, b) => a.localeCompare(b));
|
|
62
|
+
if (entries.length === 0) return null;
|
|
63
|
+
const lines = [OKF_INDEX_MARKER, "", `# ${path.basename(dir)}`, ""];
|
|
64
|
+
for (const name of entries) {
|
|
65
|
+
const preview = previewFile(path.join(dir, name));
|
|
66
|
+
lines.push(`* [${titleFrom(name, preview)}](${name}) - ${preview}`);
|
|
67
|
+
}
|
|
68
|
+
lines.push("");
|
|
69
|
+
return lines.join("\n");
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function previewFile(filePath: string): string {
|
|
73
|
+
try {
|
|
74
|
+
return normalizeProjectionPreview(readFileSync(filePath, "utf8"), 120);
|
|
75
|
+
} catch {
|
|
76
|
+
return "";
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function titleFrom(name: string, preview: string): string {
|
|
81
|
+
return preview.split(" ").slice(0, 8).join(" ") || name.replace(/\.md$/, "");
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function isGeneratedIndex(filePath: string): boolean {
|
|
85
|
+
try {
|
|
86
|
+
return readFileSync(filePath, "utf8").includes(OKF_INDEX_MARKER);
|
|
87
|
+
} catch {
|
|
88
|
+
return false;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function isUnchangedGenerated(filePath: string, next: string): boolean {
|
|
93
|
+
try {
|
|
94
|
+
return readFileSync(filePath, "utf8") === next;
|
|
95
|
+
} catch {
|
|
96
|
+
return false;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function isDir(dir: string): boolean {
|
|
101
|
+
try {
|
|
102
|
+
return statSync(dir).isDirectory();
|
|
103
|
+
} catch {
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function safeList(dir: string): string[] {
|
|
109
|
+
try {
|
|
110
|
+
return readdirSync(dir);
|
|
111
|
+
} catch {
|
|
112
|
+
return [];
|
|
113
|
+
}
|
|
114
|
+
}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared OKF bundle-rendering helpers (issues #1948 + #1950).
|
|
3
|
+
*
|
|
4
|
+
* One source of truth for the mechanics every OKF bundle exporter uses:
|
|
5
|
+
* deterministic frontmatter rendering, staging-directory file writes, the
|
|
6
|
+
* symlink-guarded atomic publish, and the bundle version stamp. The memory
|
|
7
|
+
* exporter (transfer/export-okf.ts) and the codegraph exporter
|
|
8
|
+
* (coding/export-okf-codegraph.ts) both consume this module so their
|
|
9
|
+
* bundles are byte-compatible in convention (rule 38 — deterministic
|
|
10
|
+
* rendering discipline; rule 9 — stable seam over shared mechanics).
|
|
11
|
+
*/
|
|
12
|
+
import { lstatSync, mkdirSync, readdirSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
13
|
+
import path from "node:path";
|
|
14
|
+
|
|
15
|
+
/** OKF spec version emitted in every bundle root index. */
|
|
16
|
+
export const OKF_EXPORT_VERSION = "0.1";
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Render a YAML frontmatter block from a flat field map.
|
|
20
|
+
*
|
|
21
|
+
* Key order: the canonical OKF keys first (`type`, `title`, `description`,
|
|
22
|
+
* `tags`, `timestamp`), everything else alphabetical — one deterministic
|
|
23
|
+
* layout so identical inputs always render byte-identical files. A key set
|
|
24
|
+
* to `undefined` is omitted; callers must not pass a key twice.
|
|
25
|
+
*/
|
|
26
|
+
export function renderFrontmatter(fields: Record<string, unknown>): string {
|
|
27
|
+
const keys = Object.keys(fields).sort((a, b) => {
|
|
28
|
+
const order = ["type", "title", "description", "tags", "timestamp"];
|
|
29
|
+
const ai = order.indexOf(a);
|
|
30
|
+
const bi = order.indexOf(b);
|
|
31
|
+
if (ai >= 0 || bi >= 0) return (ai < 0 ? 99 : ai) - (bi < 0 ? 99 : bi);
|
|
32
|
+
return a.localeCompare(b);
|
|
33
|
+
});
|
|
34
|
+
const lines = keys.flatMap((key) => yamlLine(key, fields[key]));
|
|
35
|
+
return `---\n${lines.join("\n")}\n---\n\n`;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function yamlLine(key: string, value: unknown): string[] {
|
|
39
|
+
if (value === undefined) return [];
|
|
40
|
+
if (Array.isArray(value)) {
|
|
41
|
+
if (value.length === 0) return [`${key}: []`];
|
|
42
|
+
if (value.every((item) => typeof item !== "object" || item === null)) {
|
|
43
|
+
return [`${key}:`, ...value.map((item) => ` - ${yamlScalar(item)}`)];
|
|
44
|
+
}
|
|
45
|
+
return [`${key}: ${JSON.stringify(value)}`];
|
|
46
|
+
}
|
|
47
|
+
if (typeof value === "object" && value !== null) return [`${key}: ${JSON.stringify(value)}`];
|
|
48
|
+
return [`${key}: ${yamlScalar(value)}`];
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function yamlScalar(value: unknown): string {
|
|
52
|
+
if (typeof value === "string") {
|
|
53
|
+
if (value === "" || /[:#\n]/.test(value) || value !== value.trim()) return JSON.stringify(value);
|
|
54
|
+
return value;
|
|
55
|
+
}
|
|
56
|
+
return String(value);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Write one file into a bundle staging tree. `rel` is a POSIX-style
|
|
61
|
+
* bundle-relative path; parent directories are created as needed.
|
|
62
|
+
*/
|
|
63
|
+
export function writeBundleFile(root: string, rel: string, content: string): void {
|
|
64
|
+
const dest = path.join(root, ...rel.split("/"));
|
|
65
|
+
mkdirSync(path.dirname(dest), { recursive: true });
|
|
66
|
+
writeFileSync(dest, content, "utf8");
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Publish a staged bundle: refuse a non-empty target without `--force`,
|
|
71
|
+
* swap via rename so the target is never observed half-written, and keep a
|
|
72
|
+
* restorable backup when replacing an existing tree.
|
|
73
|
+
*/
|
|
74
|
+
export function publishBundle(staging: string, outDir: string, force: boolean): void {
|
|
75
|
+
let exists = false;
|
|
76
|
+
try {
|
|
77
|
+
const stat = lstatSync(outDir);
|
|
78
|
+
if (stat.isSymbolicLink()) throw new Error(`--out must not be a symlink: ${outDir}`);
|
|
79
|
+
exists = true;
|
|
80
|
+
const entries = readdirSync(outDir).filter((name) => name !== "." && name !== "..");
|
|
81
|
+
if (entries.length > 0 && !force) {
|
|
82
|
+
rmSync(staging, { recursive: true, force: true });
|
|
83
|
+
throw new Error(`--out ${outDir} is not empty; pass --force to replace it`);
|
|
84
|
+
}
|
|
85
|
+
} catch (err) {
|
|
86
|
+
if ((err as NodeJS.ErrnoException).code !== "ENOENT") throw err;
|
|
87
|
+
}
|
|
88
|
+
mkdirSync(path.dirname(outDir), { recursive: true });
|
|
89
|
+
if (exists && force) {
|
|
90
|
+
const backup = `${outDir}.okf-prev`;
|
|
91
|
+
try {
|
|
92
|
+
renameSync(outDir, backup);
|
|
93
|
+
} catch {
|
|
94
|
+
rmSync(staging, { recursive: true, force: true });
|
|
95
|
+
throw new Error(`cannot replace --out ${outDir}`);
|
|
96
|
+
}
|
|
97
|
+
try {
|
|
98
|
+
renameSync(staging, outDir);
|
|
99
|
+
rmSync(backup, { recursive: true, force: true });
|
|
100
|
+
} catch (err) {
|
|
101
|
+
try {
|
|
102
|
+
renameSync(backup, outDir);
|
|
103
|
+
} catch {
|
|
104
|
+
// Keep backup if restore fails.
|
|
105
|
+
}
|
|
106
|
+
throw err;
|
|
107
|
+
}
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
renameSync(staging, outDir);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Reject a --out path with a symlink anywhere in its component chain
|
|
115
|
+
* (pattern 42 + hermes-shim precedent): a symlinked component could aim
|
|
116
|
+
* the atomic rename outside the operator's chosen directory.
|
|
117
|
+
*/
|
|
118
|
+
export function rejectSymlinkPath(target: string): void {
|
|
119
|
+
let current = path.resolve(target);
|
|
120
|
+
while (true) {
|
|
121
|
+
try {
|
|
122
|
+
if (lstatSync(current).isSymbolicLink()) {
|
|
123
|
+
throw new Error(`--out path component is a symlink: ${current}`);
|
|
124
|
+
}
|
|
125
|
+
} catch (err) {
|
|
126
|
+
if ((err as NodeJS.ErrnoException).code !== "ENOENT") throw err;
|
|
127
|
+
}
|
|
128
|
+
const parent = path.dirname(current);
|
|
129
|
+
if (parent === current) break;
|
|
130
|
+
current = parent;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
@@ -49,6 +49,7 @@ test("parseOkfConfig treats false as a real disable", () => {
|
|
|
49
49
|
assert.deepEqual(parseOkfConfig({ conformanceEnabled: false, sweepEnabled: "false" }), {
|
|
50
50
|
conformanceEnabled: false,
|
|
51
51
|
sweepEnabled: false,
|
|
52
|
+
indexFilesEnabled: false,
|
|
52
53
|
});
|
|
53
54
|
assert.throws(() => parseOkfConfig("nope"), /okf must be an object/);
|
|
54
55
|
});
|
|
@@ -164,6 +165,7 @@ test("runOkfCliCommand handles help and rejects unexpected tokens", async () =>
|
|
|
164
165
|
memoryDir: "/tmp",
|
|
165
166
|
conformanceEnabled: true,
|
|
166
167
|
sweepEnabled: false,
|
|
168
|
+
indexFilesEnabled: false,
|
|
167
169
|
});
|
|
168
170
|
assert.equal(code, 0);
|
|
169
171
|
assert.match(chunks.join(""), /usage: remnic okf/);
|
|
@@ -176,6 +178,7 @@ test("runOkfCliCommand handles help and rejects unexpected tokens", async () =>
|
|
|
176
178
|
memoryDir: "/tmp",
|
|
177
179
|
conformanceEnabled: true,
|
|
178
180
|
sweepEnabled: false,
|
|
181
|
+
indexFilesEnabled: false,
|
|
179
182
|
});
|
|
180
183
|
assert.equal(code, 1);
|
|
181
184
|
assert.match(errChunks.join(""), new RegExp(`unexpected argument '${token}'`));
|
package/src/okf/type-mapping.ts
CHANGED
|
@@ -57,6 +57,8 @@ export function okfTypeForEntityKind(kind: string | undefined): string {
|
|
|
57
57
|
export const OKF_PROFILE_TYPE = "Profile";
|
|
58
58
|
export const OKF_QUESTION_TYPE = "Question";
|
|
59
59
|
export const OKF_DECISION_RECORD_TYPE = "Decision Record";
|
|
60
|
+
export const OKF_ARCHITECTURE_CARD_TYPE = "Architecture Card";
|
|
61
|
+
export const OKF_CODE_MODULE_TYPE = "Code Module";
|
|
60
62
|
|
|
61
63
|
/**
|
|
62
64
|
* OKF §6/§7 reserve `index.md` and `log.md` for bundle-level files with a
|
|
@@ -40,6 +40,7 @@ import {
|
|
|
40
40
|
type MemoryLifecycleCapabilitySet,
|
|
41
41
|
} from "../capabilities.js";
|
|
42
42
|
import { parseFlexibleIsoTimestamp } from "../utils/iso-timestamp.js";
|
|
43
|
+
import { tagPersistedMemories } from "../location/tagging.js";
|
|
43
44
|
import { log } from "../logger.js";
|
|
44
45
|
import type { PluginConfig, BufferTurn, ExtractionResult, MetaState, ExtractionFailureClass } from "../types.js";
|
|
45
46
|
import type { TierMigrationCycleSummary } from "../recall-state.js";
|
|
@@ -62,7 +63,6 @@ export class ExtractionDeadlineError extends Error {
|
|
|
62
63
|
}
|
|
63
64
|
}
|
|
64
65
|
|
|
65
|
-
|
|
66
66
|
/** Dependencies injected by the orchestrator. All stable references or
|
|
67
67
|
* live accessors — lazy getters for anything tests reassign
|
|
68
68
|
* post-construction (buffer, extraction, storageRouter, threading). */
|
|
@@ -1090,6 +1090,7 @@ export class ExtractionRunCoordinator {
|
|
|
1090
1090
|
log.warn("runExtraction: durable-commit callback failed", error);
|
|
1091
1091
|
}
|
|
1092
1092
|
const runPostPersistBestEffort = runExtractionPostPersistBestEffort.bind(null, runDeadlineAware);
|
|
1093
|
+
await tagPersistedMemories(storage, persistedIds, this.config);
|
|
1093
1094
|
const postPersist = await runExtractionPostPersist({
|
|
1094
1095
|
result,
|
|
1095
1096
|
storage,
|
|
@@ -9,6 +9,8 @@ import {
|
|
|
9
9
|
isLocationDayPath,
|
|
10
10
|
isMeetingRecordPath,
|
|
11
11
|
} from "./orchestrator-helpers.js";
|
|
12
|
+
import { OKF_RESERVED_BASENAMES } from "../okf/type-mapping.js";
|
|
13
|
+
|
|
12
14
|
|
|
13
15
|
export interface GenericRecallPathPolicy {
|
|
14
16
|
readonly memoryDir?: string;
|
|
@@ -230,9 +232,8 @@ export function isGenericRecallExcludedPath(
|
|
|
230
232
|
): boolean {
|
|
231
233
|
return (
|
|
232
234
|
isSearchExcludedPath(filePath, policy, source) ||
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
isTopLevelArchivePath(filePath, policy, source)
|
|
235
|
+
isTopLevelArchivePath(filePath, policy, source) ||
|
|
236
|
+
OKF_RESERVED_BASENAMES[path.basename(filePath)] === true
|
|
236
237
|
);
|
|
237
238
|
}
|
|
238
239
|
|
package/src/schemas.ts
CHANGED
|
@@ -181,7 +181,7 @@ export const ExtractedFactSchema = z.object({
|
|
|
181
181
|
.optional()
|
|
182
182
|
.nullable()
|
|
183
183
|
.describe(
|
|
184
|
-
'For category "reasoning_trace" only: a stored solution chain with ordered steps, a final answer, and an optional observed outcome. Require at least two steps.',
|
|
184
|
+
'For category "reasoning_trace" only: a stored solution chain with ordered steps, a final answer, and an optional observed outcome. Require at least two steps. IMPORTANT: must include a non-empty finalAnswer (or final_answer) — the JSON Schema sent to providers cannot enforce this constraint.',
|
|
185
185
|
),
|
|
186
186
|
eventTime: z
|
|
187
187
|
.string()
|
|
@@ -350,6 +350,22 @@ export const ExtractionResultSchema = z.object({
|
|
|
350
350
|
),
|
|
351
351
|
});
|
|
352
352
|
|
|
353
|
+
/**
|
|
354
|
+
* Provider-facing extraction contract. Keep this free of transforms/refinements:
|
|
355
|
+
* JSON Schema generators cannot faithfully represent salvageArray's ZodEffects.
|
|
356
|
+
* ExtractionResultSchema remains the authoritative tolerant parser after the
|
|
357
|
+
* provider returns.
|
|
358
|
+
*/
|
|
359
|
+
export const ExtractionProviderOutputSchema = z.object({
|
|
360
|
+
facts: z.array(ExtractedFactSchema),
|
|
361
|
+
profileUpdates: z.array(z.string()),
|
|
362
|
+
entities: z.array(EntityMentionSchema),
|
|
363
|
+
questions: z.array(ExtractedQuestionSchema),
|
|
364
|
+
identityReflection: z.string().optional().nullable(),
|
|
365
|
+
episodeTitle: z.string().optional().nullable(),
|
|
366
|
+
relationships: z.array(ExtractedRelationshipSchema).optional().nullable(),
|
|
367
|
+
});
|
|
368
|
+
|
|
353
369
|
export const ConsolidationItemSchema = z.object({
|
|
354
370
|
existingId: z
|
|
355
371
|
.string()
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
import { defineOperation } from "../access-boundary.js";
|
|
4
|
+
import { buildStandup, parseStandupDate } from "./build.js";
|
|
5
|
+
|
|
6
|
+
defineOperation({
|
|
7
|
+
name: "standup",
|
|
8
|
+
description: "Deterministic yesterday/today/blockers standup brief.",
|
|
9
|
+
fleetWide: true,
|
|
10
|
+
schema: z.object({ date: z.string().optional() }).strict(),
|
|
11
|
+
handler: async (input, ctx) => ({
|
|
12
|
+
result: buildStandup(ctx.service.memoryDir, parseStandupDate(input.date)),
|
|
13
|
+
}),
|
|
14
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import { mkdtemp, mkdir, writeFile, rm } from "node:fs/promises";
|
|
3
|
+
import os from "node:os";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import test from "node:test";
|
|
6
|
+
|
|
7
|
+
import { buildStandup, parseStandupDate, previousDate } from "./build.js";
|
|
8
|
+
|
|
9
|
+
test("parseStandupDate rejects garbage and defaults to UTC today", () => {
|
|
10
|
+
assert.equal(parseStandupDate(undefined, new Date("2026-08-18T12:00:00Z")), "2026-08-18");
|
|
11
|
+
assert.throws(() => parseStandupDate("nope"), /YYYY-MM-DD/);
|
|
12
|
+
assert.equal(previousDate("2026-08-18"), "2026-08-17");
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
test("buildStandup is deterministic and marks missing days", async () => {
|
|
16
|
+
const memoryDir = await mkdtemp(path.join(os.tmpdir(), "remnic-standup-"));
|
|
17
|
+
try {
|
|
18
|
+
await mkdir(path.join(memoryDir, "activity"), { recursive: true });
|
|
19
|
+
await writeFile(
|
|
20
|
+
path.join(memoryDir, "activity", "2026-08-18.md"),
|
|
21
|
+
"---\ndate: 2026-08-18\n---\n# Today\n- shipped standup\n- blocker: waiting on review\n",
|
|
22
|
+
"utf8",
|
|
23
|
+
);
|
|
24
|
+
const a = buildStandup(memoryDir, "2026-08-18");
|
|
25
|
+
const b = buildStandup(memoryDir, "2026-08-18");
|
|
26
|
+
assert.equal(a.markdown, b.markdown);
|
|
27
|
+
assert.equal(a.yesterday, "2026-08-17");
|
|
28
|
+
assert.match(a.markdown, /blocker: waiting on review/);
|
|
29
|
+
assert.match(a.activityGrid, /yesterday \| \./);
|
|
30
|
+
assert.match(a.activityGrid, /today \| x/);
|
|
31
|
+
} finally {
|
|
32
|
+
await rm(memoryDir, { recursive: true, force: true });
|
|
33
|
+
}
|
|
34
|
+
});
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
|
|
4
|
+
import { activityDigestPath, isValidActivityDate } from "../activity/digest.js";
|
|
5
|
+
|
|
6
|
+
export interface StandupBrief {
|
|
7
|
+
date: string;
|
|
8
|
+
yesterday: string;
|
|
9
|
+
today: string;
|
|
10
|
+
highlights: string[];
|
|
11
|
+
blockers: string[];
|
|
12
|
+
activityGrid: string;
|
|
13
|
+
markdown: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function parseStandupDate(raw: unknown, now = new Date()): string {
|
|
17
|
+
if (raw === undefined || raw === null || raw === "") {
|
|
18
|
+
return now.toISOString().slice(0, 10);
|
|
19
|
+
}
|
|
20
|
+
const value = String(raw);
|
|
21
|
+
if (!isValidActivityDate(value)) {
|
|
22
|
+
throw new Error(`invalid --date ${value}; expected YYYY-MM-DD`);
|
|
23
|
+
}
|
|
24
|
+
return value;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function previousDate(date: string): string {
|
|
28
|
+
const ms = Date.parse(`${date}T00:00:00Z`);
|
|
29
|
+
return new Date(ms - 86_400_000).toISOString().slice(0, 10);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function buildStandup(memoryDir: string, date: string): StandupBrief {
|
|
33
|
+
const yesterday = previousDate(date);
|
|
34
|
+
const todayBody = readOptional(activityDigestPath(memoryDir, date));
|
|
35
|
+
const yesterdayBody = readOptional(activityDigestPath(memoryDir, yesterday));
|
|
36
|
+
const highlights = extractHighlights(todayBody);
|
|
37
|
+
const blockers = extractBlockers(todayBody);
|
|
38
|
+
const activityGrid = renderGrid(yesterdayBody, todayBody);
|
|
39
|
+
const markdown = [
|
|
40
|
+
`# Standup ${date}`,
|
|
41
|
+
"",
|
|
42
|
+
`## Yesterday (${yesterday})`,
|
|
43
|
+
yesterdayBody ? firstLines(yesterdayBody, 8) : "_No activity digest._",
|
|
44
|
+
"",
|
|
45
|
+
`## Today (${date})`,
|
|
46
|
+
todayBody ? firstLines(todayBody, 8) : "_No activity digest._",
|
|
47
|
+
"",
|
|
48
|
+
"## Highlights",
|
|
49
|
+
...(highlights.length > 0 ? highlights.map((line) => `- ${line}`) : ["- _None._"]),
|
|
50
|
+
"",
|
|
51
|
+
"## Blockers",
|
|
52
|
+
...(blockers.length > 0 ? blockers.map((line) => `- ${line}`) : ["- _None._"]),
|
|
53
|
+
"",
|
|
54
|
+
"## Activity grid",
|
|
55
|
+
"",
|
|
56
|
+
activityGrid,
|
|
57
|
+
"",
|
|
58
|
+
].join("\n");
|
|
59
|
+
return {
|
|
60
|
+
date,
|
|
61
|
+
yesterday,
|
|
62
|
+
today: date,
|
|
63
|
+
highlights,
|
|
64
|
+
blockers,
|
|
65
|
+
activityGrid,
|
|
66
|
+
markdown,
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function readOptional(filePath: string): string | null {
|
|
71
|
+
try {
|
|
72
|
+
return readFileSync(filePath, "utf8");
|
|
73
|
+
} catch {
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function firstLines(body: string, n: number): string {
|
|
79
|
+
return body.split("\n").filter((line) => !line.startsWith("---")).slice(0, n).join("\n").trim() || "_Empty digest._";
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function extractHighlights(body: string | null): string[] {
|
|
83
|
+
if (!body) return [];
|
|
84
|
+
return body
|
|
85
|
+
.split("\n")
|
|
86
|
+
.map((line) => line.replace(/^[-*]\s+/, "").trim())
|
|
87
|
+
.filter((line) => line.length > 0 && !line.startsWith("#") && !line.startsWith("---"))
|
|
88
|
+
.slice(0, 5);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function extractBlockers(body: string | null): string[] {
|
|
92
|
+
if (!body) return [];
|
|
93
|
+
return body
|
|
94
|
+
.split("\n")
|
|
95
|
+
.map((line) => line.trim())
|
|
96
|
+
.filter((line) => /blocker|blocked|stuck|waiting/i.test(line))
|
|
97
|
+
.slice(0, 5);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function renderGrid(yesterday: string | null, today: string | null): string {
|
|
101
|
+
const y = yesterday ? "x" : ".";
|
|
102
|
+
const t = today ? "x" : ".";
|
|
103
|
+
return ["| day | digest |", "|---|---|", `| yesterday | ${y} |`, `| today | ${t} |`].join("\n");
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export function standupHelp(): string {
|
|
107
|
+
return `Usage: remnic standup [--date YYYY-MM-DD]
|
|
108
|
+
|
|
109
|
+
Deterministic yesterday/today/blockers brief plus an activity grid.
|
|
110
|
+
`;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export function standupMemoryDirPlaceholder(memoryDir: string): string {
|
|
114
|
+
return path.resolve(memoryDir);
|
|
115
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ServerResponse } from "node:http";
|
|
2
|
+
import { getOperation } from "../access-boundary.js";
|
|
3
|
+
import type { EngramAccessService } from "../access-service.js";
|
|
4
|
+
|
|
5
|
+
export async function respondStandup(
|
|
6
|
+
date: string | null,
|
|
7
|
+
res: ServerResponse,
|
|
8
|
+
respondJson: (res: ServerResponse, status: number, payload: unknown) => void,
|
|
9
|
+
service: EngramAccessService,
|
|
10
|
+
): Promise<void> {
|
|
11
|
+
const op = getOperation("standup");
|
|
12
|
+
if (!op) throw new Error("access-boundary: operation not registered: standup");
|
|
13
|
+
const output = (await op.run({ ...(date ? { date } : {}) }, { service })) as { result: unknown };
|
|
14
|
+
respondJson(res, 200, output.result);
|
|
15
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { McpTool } from "../access-mcp.js";
|
|
2
|
+
|
|
3
|
+
export const STANDUP_MCP_TOOLS: McpTool[] = [
|
|
4
|
+
{
|
|
5
|
+
name: "engram.standup",
|
|
6
|
+
description:
|
|
7
|
+
"Deterministic standup brief: yesterday highlights, today priorities, blockers, and an activity grid. Pass date as YYYY-MM-DD; default is today UTC.",
|
|
8
|
+
inputSchema: {
|
|
9
|
+
type: "object",
|
|
10
|
+
properties: {
|
|
11
|
+
date: { type: "string", description: "Standup day (YYYY-MM-DD). Defaults to today UTC." },
|
|
12
|
+
},
|
|
13
|
+
additionalProperties: false,
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
];
|
|
@@ -307,6 +307,7 @@ function parseSupportPassportCardMetadata(
|
|
|
307
307
|
export function hasLiveSupportPassportCard(memory: Pick<MemoryFile, "frontmatter" | "content">): boolean {
|
|
308
308
|
const metadata = parseSupportPassportCardMetadata(memory);
|
|
309
309
|
if (metadata?.fields.status !== "active" && metadata?.fields.status !== "pending_review") return false;
|
|
310
|
+
if (metadata.sourceMemoryIds.length === 0) return false;
|
|
310
311
|
return SupportPassportCardSchema.omit({ revision: true }).safeParse({
|
|
311
312
|
...metadata.fields,
|
|
312
313
|
statement: stripAttributesSuffix(memory.content),
|
|
@@ -56,6 +56,7 @@ test("rejected-draft recovery forwards the commit notification", async () => {
|
|
|
56
56
|
assert.ok(replacement);
|
|
57
57
|
const storage = {
|
|
58
58
|
getMemoryById: async (id: string) => (id === "draft-one" ? replaced : null),
|
|
59
|
+
getMemoryByIdIncludingArchived: async (id: string) => (id === "draft-one" ? replaced : null),
|
|
59
60
|
} as unknown as StorageManager;
|
|
60
61
|
const service = new SupportPassportCardService({
|
|
61
62
|
resolveOwner: async () => ({ principal: PRINCIPAL, namespace: NAMESPACE, storage }),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import assert from "node:assert/strict";
|
|
2
|
-
import { mkdtemp, readFile, rm } from "node:fs/promises";
|
|
2
|
+
import { mkdir, mkdtemp, readFile, rename, rm } from "node:fs/promises";
|
|
3
3
|
import { tmpdir } from "node:os";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { test } from "node:test";
|
|
@@ -1425,6 +1425,80 @@ test("retrying an interrupted pending-draft replacement reuses one approvable dr
|
|
|
1425
1425
|
}
|
|
1426
1426
|
});
|
|
1427
1427
|
|
|
1428
|
+
test("replacement recovery reads a cold-tier rejected predecessor (#2387)", async () => {
|
|
1429
|
+
const subject = await makeSubject();
|
|
1430
|
+
try {
|
|
1431
|
+
const draft = await subject.service.createManualDraft({
|
|
1432
|
+
principal: "owner:alice",
|
|
1433
|
+
title: "Quiet place",
|
|
1434
|
+
statement: "Offer me a quiet place.",
|
|
1435
|
+
category: "environment",
|
|
1436
|
+
reviewBy: OWNER_REVIEW_BY,
|
|
1437
|
+
});
|
|
1438
|
+
const originalWrite = subject.aliceStorage.writeMemoryFrontmatterIfUnchanged.bind(subject.aliceStorage);
|
|
1439
|
+
let interrupted = false;
|
|
1440
|
+
subject.aliceStorage.writeMemoryFrontmatterIfUnchanged = async (memory, patch, lifecycle) => {
|
|
1441
|
+
if (!interrupted && lifecycle?.reasonCode === "draft-replacement-complete") {
|
|
1442
|
+
interrupted = true;
|
|
1443
|
+
throw new Error("simulated process exit before the prepared marker cleared");
|
|
1444
|
+
}
|
|
1445
|
+
return await originalWrite(memory, patch, lifecycle);
|
|
1446
|
+
};
|
|
1447
|
+
|
|
1448
|
+
await assert.rejects(
|
|
1449
|
+
subject.service.replaceCard({
|
|
1450
|
+
principal: "owner:alice",
|
|
1451
|
+
cardId: draft.cardId,
|
|
1452
|
+
expectedRevision: draft.revision,
|
|
1453
|
+
title: "Quiet place and time",
|
|
1454
|
+
statement: "Offer me a quiet place and time.",
|
|
1455
|
+
category: "environment",
|
|
1456
|
+
reviewBy: OWNER_REVIEW_BY,
|
|
1457
|
+
}),
|
|
1458
|
+
/simulated process exit/
|
|
1459
|
+
);
|
|
1460
|
+
subject.aliceStorage.writeMemoryFrontmatterIfUnchanged = originalWrite;
|
|
1461
|
+
|
|
1462
|
+
// Interrupted state: the prior draft is durably rejected while the
|
|
1463
|
+
// replacement still carries its prepared marker. Simulate tier
|
|
1464
|
+
// migration demoting the rejected predecessor to the cold tier.
|
|
1465
|
+
const beforeRecovery = await subject.aliceStorage.readAllMemories();
|
|
1466
|
+
const replacement = beforeRecovery.find((memory) => memory.frontmatter.id !== draft.cardId);
|
|
1467
|
+
assert.ok(replacement);
|
|
1468
|
+
assert.equal(replacement.frontmatter.status, "pending_review");
|
|
1469
|
+
assert.equal(
|
|
1470
|
+
replacement.frontmatter.structuredAttributes?.["support-passport-draft-replacement-prepared"],
|
|
1471
|
+
"true"
|
|
1472
|
+
);
|
|
1473
|
+
const rejectedDraft = beforeRecovery.find((memory) => memory.frontmatter.id === draft.cardId);
|
|
1474
|
+
assert.ok(rejectedDraft);
|
|
1475
|
+
assert.equal(rejectedDraft.frontmatter.status, "rejected");
|
|
1476
|
+
const coldDir = path.join(subject.aliceStorage.dir, "cold", "preference");
|
|
1477
|
+
await mkdir(coldDir, { recursive: true });
|
|
1478
|
+
await rename(rejectedDraft.path, path.join(coldDir, path.basename(rejectedDraft.path)));
|
|
1479
|
+
StorageManager.clearAllStaticCaches();
|
|
1480
|
+
assert.equal(await subject.aliceStorage.getMemoryById(draft.cardId), null);
|
|
1481
|
+
const replacementCard = projectSupportPassportCard(replacement);
|
|
1482
|
+
assert.ok(replacementCard);
|
|
1483
|
+
const approved = await subject.service.approveCard({
|
|
1484
|
+
principal: "owner:alice",
|
|
1485
|
+
cardId: replacement.frontmatter.id,
|
|
1486
|
+
expectedRevision: replacementCard.card.revision,
|
|
1487
|
+
});
|
|
1488
|
+
assert.equal(approved.status, "active");
|
|
1489
|
+
|
|
1490
|
+
assert.deepEqual(
|
|
1491
|
+
(await subject.service.listCards({ principal: "owner:alice" })).map((card) => [card.cardId, card.status]),
|
|
1492
|
+
[[replacement.frontmatter.id, "active"]]
|
|
1493
|
+
);
|
|
1494
|
+
|
|
1495
|
+
const coldPredecessor = await subject.aliceStorage.getMemoryByIdIncludingArchived(draft.cardId);
|
|
1496
|
+
assert.equal(coldPredecessor?.frontmatter.status, "rejected");
|
|
1497
|
+
} finally {
|
|
1498
|
+
await subject.cleanup();
|
|
1499
|
+
}
|
|
1500
|
+
});
|
|
1501
|
+
|
|
1428
1502
|
test("retrying a recovered pending-draft replacement reuses the exact draft", async () => {
|
|
1429
1503
|
const subject = await makeSubject();
|
|
1430
1504
|
try {
|