@remnic/core 1.1.12 → 1.1.14
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-cli.d.ts +2 -1
- package/dist/access-cli.js +263 -82
- package/dist/access-cli.js.map +1 -1
- package/dist/access-http.d.ts +26 -60
- package/dist/access-http.js +43 -29
- package/dist/access-mcp.d.ts +24 -6
- package/dist/access-mcp.js +35 -28
- package/dist/access-schema.d.ts +9 -6
- package/dist/access-schema.js +7 -5
- package/dist/access-service-DcCDmNYC.d.ts +1542 -0
- package/dist/access-service.d.ts +25 -7
- package/dist/access-service.js +33 -26
- package/dist/active-memory-bridge.js +2 -2
- package/dist/active-recall.js +11 -3
- package/dist/active-recall.js.map +1 -1
- package/dist/adapters/claude-code.d.ts +24 -0
- package/dist/adapters/claude-code.js +9 -0
- package/dist/adapters/codex.d.ts +25 -0
- package/dist/adapters/codex.js +9 -0
- package/dist/adapters/hermes.d.ts +35 -0
- package/dist/adapters/hermes.js +9 -0
- package/dist/adapters/index.d.ts +6 -0
- package/dist/adapters/index.js +26 -0
- package/dist/adapters/registry.d.ts +20 -0
- package/dist/adapters/registry.js +13 -0
- package/dist/adapters/replit.d.ts +28 -0
- package/dist/adapters/replit.js +9 -0
- package/dist/adapters/types.d.ts +43 -0
- package/dist/adapters/types.js +8 -0
- package/dist/bootstrap.d.ts +20 -5
- package/dist/boxes.d.ts +7 -0
- package/dist/boxes.js +1 -1
- package/dist/briefing.d.ts +5 -3
- package/dist/briefing.js +9 -6
- package/dist/buffer-surprise-report.js +1 -1
- package/dist/buffer.d.ts +18 -4
- package/dist/buffer.js +1 -1
- package/dist/calibration.js +4 -4
- package/dist/capsule-cli.d.ts +4 -4
- package/dist/capsule-cli.js +1 -1
- package/dist/capsule-crypto-5CYAGVC5.js +18 -0
- package/dist/capsule-merge-4MGKE7C5.js +189 -0
- package/dist/causal-behavior.d.ts +8 -28
- package/dist/causal-behavior.js +6 -3
- package/dist/causal-behavior.js.map +1 -1
- package/dist/causal-chain.js +3 -2
- package/dist/causal-consolidation.d.ts +1 -1
- package/dist/causal-consolidation.js +24 -13
- package/dist/causal-consolidation.js.map +1 -1
- package/dist/causal-retrieval.js +3 -3
- package/dist/causal-trajectory.js +1 -1
- package/dist/chunk-25MQ7IHJ.js +427 -0
- package/dist/chunk-25MQ7IHJ.js.map +1 -0
- package/dist/chunk-2F2W355T.js +256 -0
- package/dist/chunk-2F2W355T.js.map +1 -0
- package/dist/chunk-2KI4QFHU.js +228 -0
- package/dist/chunk-2KI4QFHU.js.map +1 -0
- package/dist/chunk-2PRQG7PV.js +86 -0
- package/dist/chunk-2PRQG7PV.js.map +1 -0
- package/dist/chunk-2QR3XXIC.js +2272 -0
- package/dist/chunk-2QR3XXIC.js.map +1 -0
- package/dist/chunk-2WWLHTZY.js +121 -0
- package/dist/chunk-326G7DJK.js +2185 -0
- package/dist/chunk-326G7DJK.js.map +1 -0
- package/dist/chunk-34DQE4KF.js +174 -0
- package/dist/chunk-34DQE4KF.js.map +1 -0
- package/dist/chunk-3APJ5EVB.js +601 -0
- package/dist/chunk-3APJ5EVB.js.map +1 -0
- package/dist/chunk-3HPAPHUK.js +51 -0
- package/dist/chunk-3HPAPHUK.js.map +1 -0
- package/dist/chunk-3JXBXXM2.js +69 -0
- package/dist/chunk-3JXBXXM2.js.map +1 -0
- package/dist/chunk-3KW65B36.js +681 -0
- package/dist/chunk-3KW65B36.js.map +1 -0
- package/dist/chunk-3UXOZBHV.js +20 -0
- package/dist/chunk-3UXOZBHV.js.map +1 -0
- package/dist/chunk-3VAL7ZL2.js +266 -0
- package/dist/chunk-3VAL7ZL2.js.map +1 -0
- package/dist/chunk-3Y4P7RXM.js +31 -0
- package/dist/chunk-3Y4P7RXM.js.map +1 -0
- package/dist/chunk-47VWKCAF.js +273 -0
- package/dist/chunk-47VWKCAF.js.map +1 -0
- package/dist/chunk-4CRG46BG.js +271 -0
- package/dist/chunk-5375UYTQ.js +914 -0
- package/dist/chunk-5375UYTQ.js.map +1 -0
- package/dist/chunk-56K5QLHX.js +506 -0
- package/dist/chunk-56K5QLHX.js.map +1 -0
- package/dist/chunk-5RGLBDQF.js +596 -0
- package/dist/chunk-5RGLBDQF.js.map +1 -0
- package/dist/chunk-5UZXUTVO.js +9 -0
- package/dist/chunk-5UZXUTVO.js.map +1 -0
- package/dist/chunk-65PG43EQ.js +105 -0
- package/dist/chunk-65PG43EQ.js.map +1 -0
- package/dist/chunk-66DHUKLO.js +57 -0
- package/dist/chunk-66DHUKLO.js.map +1 -0
- package/dist/chunk-6FC5EGNV.js +46 -0
- package/dist/chunk-6FC5EGNV.js.map +1 -0
- package/dist/chunk-6H2TESSP.js +62 -0
- package/dist/chunk-6H2TESSP.js.map +1 -0
- package/dist/chunk-6LVVDPJ4.js +32 -0
- package/dist/chunk-6LVVDPJ4.js.map +1 -0
- package/dist/chunk-6RVI47ZR.js +159 -0
- package/dist/chunk-6RVI47ZR.js.map +1 -0
- package/dist/chunk-7AAT6G4Q.js +5117 -0
- package/dist/chunk-7AAT6G4Q.js.map +1 -0
- package/dist/chunk-7DTASS5T.js +29 -0
- package/dist/chunk-7DTASS5T.js.map +1 -0
- package/dist/chunk-7IASACLB.js +596 -0
- package/dist/chunk-7MNMYOFP.js +32 -0
- package/dist/chunk-7MNMYOFP.js.map +1 -0
- package/dist/chunk-7N4KAIGN.js +133 -0
- package/dist/chunk-7N4KAIGN.js.map +1 -0
- package/dist/chunk-7OZ53EXP.js +101 -0
- package/dist/chunk-7OZ53EXP.js.map +1 -0
- package/dist/chunk-7XYTQGCC.js +134 -0
- package/dist/chunk-7XYTQGCC.js.map +1 -0
- package/dist/chunk-A2XUIMJ3.js +341 -0
- package/dist/chunk-A2XUIMJ3.js.map +1 -0
- package/dist/chunk-AGZQD76C.js +201 -0
- package/dist/chunk-AGZQD76C.js.map +1 -0
- package/dist/chunk-APO3DCMU.js +361 -0
- package/dist/chunk-APO3DCMU.js.map +1 -0
- package/dist/chunk-BFBF3XEF.js +283 -0
- package/dist/chunk-BFBF3XEF.js.map +1 -0
- package/dist/chunk-BJ3KMYTB.js +1974 -0
- package/dist/chunk-BJ3KMYTB.js.map +1 -0
- package/dist/chunk-CHEL3SKB.js +6758 -0
- package/dist/chunk-CHEL3SKB.js.map +1 -0
- package/dist/chunk-CQZRLNMV.js +1491 -0
- package/dist/chunk-CQZRLNMV.js.map +1 -0
- package/dist/chunk-D46YSIYX.js +892 -0
- package/dist/chunk-D46YSIYX.js.map +1 -0
- package/dist/chunk-DINWEURR.js +648 -0
- package/dist/chunk-DINWEURR.js.map +1 -0
- package/dist/chunk-DK5LDEQM.js +530 -0
- package/dist/chunk-DK5LDEQM.js.map +1 -0
- package/dist/chunk-DOM4GKSW.js +34 -0
- package/dist/chunk-DOM4GKSW.js.map +1 -0
- package/dist/chunk-EDTHC6UD.js +1075 -0
- package/dist/chunk-EFJ3MQ4V.js +721 -0
- package/dist/chunk-EHRTFRWW.js +89 -0
- package/dist/chunk-EHRTFRWW.js.map +1 -0
- package/dist/chunk-FAJ7FZYM.js +11 -0
- package/dist/chunk-FAJ7FZYM.js.map +1 -0
- package/dist/chunk-FBYESMQ2.js +570 -0
- package/dist/chunk-FDU6HUUL.js +147 -0
- package/dist/chunk-FF4KLI5W.js +99 -0
- package/dist/chunk-FF4KLI5W.js.map +1 -0
- package/dist/chunk-FIT6DMX6.js +310 -0
- package/dist/chunk-FIT6DMX6.js.map +1 -0
- package/dist/chunk-FJ43PRLT.js +272 -0
- package/dist/chunk-FJ43PRLT.js.map +1 -0
- package/dist/chunk-FKFMOY3N.js +32 -0
- package/dist/chunk-FKFMOY3N.js.map +1 -0
- package/dist/chunk-FLTNHQK6.js +262 -0
- package/dist/chunk-FLTNHQK6.js.map +1 -0
- package/dist/chunk-GA454ALV.js +12436 -0
- package/dist/chunk-GA454ALV.js.map +1 -0
- package/dist/chunk-GGKRUQOO.js +228 -0
- package/dist/chunk-GIF42EW3.js +63 -0
- package/dist/chunk-GIF42EW3.js.map +1 -0
- package/dist/chunk-GL6I6MEQ.js +647 -0
- package/dist/chunk-H3ME6L6D.js +709 -0
- package/dist/chunk-H3ME6L6D.js.map +1 -0
- package/dist/chunk-HHLLAQGZ.js +1 -0
- package/dist/chunk-HXXBL2KD.js +2040 -0
- package/dist/chunk-I5V2VDIW.js +219 -0
- package/dist/chunk-I5V2VDIW.js.map +1 -0
- package/dist/chunk-I6K5FBRQ.js +35 -0
- package/dist/chunk-I6K5FBRQ.js.map +1 -0
- package/dist/chunk-ICRIXAP2.js +121 -0
- package/dist/chunk-ICRIXAP2.js.map +1 -0
- package/dist/chunk-J4EB7DNW.js +11 -0
- package/dist/chunk-J4EB7DNW.js.map +1 -0
- package/dist/chunk-JLFA7DQG.js +62 -0
- package/dist/chunk-JLFA7DQG.js.map +1 -0
- package/dist/chunk-KJTKLXTH.js +9 -0
- package/dist/chunk-KJTKLXTH.js.map +1 -0
- package/dist/chunk-KLAO5DGL.js +917 -0
- package/dist/chunk-KLAO5DGL.js.map +1 -0
- package/dist/chunk-KNKUID7G.js +183 -0
- package/dist/chunk-KOSORCJG.js +624 -0
- package/dist/chunk-KOSORCJG.js.map +1 -0
- package/dist/chunk-KUJVMMZQ.js +1262 -0
- package/dist/chunk-KUJVMMZQ.js.map +1 -0
- package/dist/chunk-LCR46JY5.js +123 -0
- package/dist/chunk-LCR46JY5.js.map +1 -0
- package/dist/chunk-LLQ2LLWF.js +148 -0
- package/dist/chunk-LLQ2LLWF.js.map +1 -0
- package/dist/chunk-LPMVBPA3.js +236 -0
- package/dist/chunk-LT3NLYSI.js +50 -0
- package/dist/chunk-LT3NLYSI.js.map +1 -0
- package/dist/chunk-LUDTDZLK.js +287 -0
- package/dist/chunk-LUDTDZLK.js.map +1 -0
- package/dist/chunk-M23FSH32.js +3963 -0
- package/dist/chunk-M23FSH32.js.map +1 -0
- package/dist/chunk-MC26UJIM.js +118 -0
- package/dist/chunk-ME6ESPZU.js +119 -0
- package/dist/chunk-ME6ESPZU.js.map +1 -0
- package/dist/chunk-MGKYQQYF.js +272 -0
- package/dist/chunk-MJFNCJXV.js +66 -0
- package/dist/chunk-MJFNCJXV.js.map +1 -0
- package/dist/chunk-MSWG7JI6.js +237 -0
- package/dist/chunk-MSWG7JI6.js.map +1 -0
- package/dist/chunk-MT25YHYH.js +141 -0
- package/dist/chunk-MT25YHYH.js.map +1 -0
- package/dist/chunk-MT4HVDUZ.js +53 -0
- package/dist/chunk-MY6TPVXW.js +219 -0
- package/dist/chunk-N2D6GXBM.js +267 -0
- package/dist/chunk-N2D6GXBM.js.map +1 -0
- package/dist/chunk-NJ3MJQZX.js +46 -0
- package/dist/chunk-NJ3MJQZX.js.map +1 -0
- package/dist/chunk-NMZY542O.js +335 -0
- package/dist/chunk-NMZY542O.js.map +1 -0
- package/dist/chunk-NNVTUXEB.js +23 -0
- package/dist/chunk-NZL6GGQE.js +375 -0
- package/dist/chunk-NZL6GGQE.js.map +1 -0
- package/dist/chunk-P4NEIHUT.js +108 -0
- package/dist/chunk-P7FMDTKL.js +103 -0
- package/dist/chunk-P7FMDTKL.js.map +1 -0
- package/dist/chunk-PHK3HARR.js +32 -0
- package/dist/chunk-PHK3HARR.js.map +1 -0
- package/dist/chunk-PIRJPV5T.js +98 -0
- package/dist/chunk-PIRJPV5T.js.map +1 -0
- package/dist/chunk-PK7H5L6Y.js +159 -0
- package/dist/chunk-PK7H5L6Y.js.map +1 -0
- package/dist/chunk-PR5FBTFU.js +233 -0
- package/dist/chunk-PR5FBTFU.js.map +1 -0
- package/dist/chunk-PU63GXWS.js +174 -0
- package/dist/chunk-PU63GXWS.js.map +1 -0
- package/dist/chunk-PZIAX57I.js +124 -0
- package/dist/chunk-PZIAX57I.js.map +1 -0
- package/dist/chunk-Q7P4WJDP.js +26 -0
- package/dist/chunk-Q7P4WJDP.js.map +1 -0
- package/dist/chunk-QQUAB63I.js +63 -0
- package/dist/chunk-QQUAB63I.js.map +1 -0
- package/dist/chunk-QRNI5JBH.js +18 -0
- package/dist/chunk-RHY3HH7P.js +601 -0
- package/dist/chunk-RHY3HH7P.js.map +1 -0
- package/dist/chunk-RRF5UOBJ.js +91 -0
- package/dist/chunk-RXDLTSWT.js +124 -0
- package/dist/chunk-RXDLTSWT.js.map +1 -0
- package/dist/chunk-RYED3SPJ.js +42 -0
- package/dist/chunk-RYED3SPJ.js.map +1 -0
- package/dist/chunk-S7KDBTWT.js +106 -0
- package/dist/chunk-S7KDBTWT.js.map +1 -0
- package/dist/chunk-SEDEKFYQ.js +1 -0
- package/dist/chunk-TECVW3JP.js +36 -0
- package/dist/chunk-TECVW3JP.js.map +1 -0
- package/dist/chunk-TFO23QT4.js +88 -0
- package/dist/chunk-TFO23QT4.js.map +1 -0
- package/dist/chunk-TK4UEOSK.js +76 -0
- package/dist/chunk-TK4UEOSK.js.map +1 -0
- package/dist/chunk-TKWGAOLV.js +122 -0
- package/dist/chunk-TKWGAOLV.js.map +1 -0
- package/dist/chunk-TMM4S4IJ.js +597 -0
- package/dist/chunk-TMM4S4IJ.js.map +1 -0
- package/dist/chunk-TMQLARTH.js +188 -0
- package/dist/chunk-TMQLARTH.js.map +1 -0
- package/dist/chunk-TPDBFYEG.js +130 -0
- package/dist/chunk-TPDBFYEG.js.map +1 -0
- package/dist/chunk-TPMQ3G6Z.js +145 -0
- package/dist/chunk-TPMQ3G6Z.js.map +1 -0
- package/dist/chunk-TZOLIGIG.js +61 -0
- package/dist/chunk-TZOLIGIG.js.map +1 -0
- package/dist/chunk-U3PN77QT.js +113 -0
- package/dist/chunk-U3WSW6PZ.js +277 -0
- package/dist/chunk-U4SCL7B7.js +640 -0
- package/dist/chunk-U4SCL7B7.js.map +1 -0
- package/dist/chunk-UWK5OXUJ.js +156 -0
- package/dist/chunk-UWK5OXUJ.js.map +1 -0
- package/dist/chunk-UWVJF25J.js +74 -0
- package/dist/chunk-UXHQAFNA.js +1317 -0
- package/dist/chunk-UXHQAFNA.js.map +1 -0
- package/dist/chunk-V5OCT34X.js +1 -0
- package/dist/chunk-VLXA6PI2.js +304 -0
- package/dist/chunk-VLXA6PI2.js.map +1 -0
- package/dist/chunk-VNO6ZJ35.js +500 -0
- package/dist/chunk-VNO6ZJ35.js.map +1 -0
- package/dist/chunk-VW676BEI.js +827 -0
- package/dist/chunk-VW676BEI.js.map +1 -0
- package/dist/chunk-W3LR522O.js +2296 -0
- package/dist/chunk-W4L6CZKA.js +96 -0
- package/dist/chunk-W4L6CZKA.js.map +1 -0
- package/dist/chunk-W4RVMTHR.js +372 -0
- package/dist/chunk-W4RVMTHR.js.map +1 -0
- package/dist/chunk-WEHSQBFR.js +188 -0
- package/dist/chunk-WEHSQBFR.js.map +1 -0
- package/dist/chunk-WELDCG6C.js +380 -0
- package/dist/chunk-WELDCG6C.js.map +1 -0
- package/dist/chunk-WZYKANL3.js +2800 -0
- package/dist/chunk-WZYKANL3.js.map +1 -0
- package/dist/chunk-XIG5PDM7.js +48 -0
- package/dist/chunk-XJNBEDFE.js +193 -0
- package/dist/chunk-XJNBEDFE.js.map +1 -0
- package/dist/chunk-XVVIG67A.js +291 -0
- package/dist/chunk-XVVIG67A.js.map +1 -0
- package/dist/chunk-XVZ7B3HG.js +135 -0
- package/dist/chunk-YBPYIAA5.js +73 -0
- package/dist/chunk-YBPYIAA5.js.map +1 -0
- package/dist/chunk-Z734BLO3.js +21 -0
- package/dist/chunk-Z734BLO3.js.map +1 -0
- package/dist/chunk-ZKSK55RC.js +269 -0
- package/dist/chunk-ZKSK55RC.js.map +1 -0
- package/dist/chunk-ZTFCYYEZ.js +69 -0
- package/dist/chunk-ZTFCYYEZ.js.map +1 -0
- package/dist/chunk-ZY2MNJR6.js +329 -0
- package/dist/chunk-ZY2MNJR6.js.map +1 -0
- package/dist/cli-D3VpkVwB.d.ts +1136 -0
- package/dist/cli.d.ts +39 -10
- package/dist/cli.js +108 -49
- package/dist/commitment-ledger.js +1 -1
- package/dist/compat/checks.d.ts +5 -0
- package/dist/compat/checks.js +11 -0
- package/dist/compat/checks.js.map +1 -0
- package/dist/compat/types.d.ts +30 -0
- package/dist/compat/types.js +1 -0
- package/dist/compat/types.js.map +1 -0
- package/dist/compounding/engine.d.ts +221 -0
- package/dist/compounding/engine.js +32 -0
- package/dist/compounding/engine.js.map +1 -0
- package/dist/compounding/preference-consolidator.d.ts +92 -0
- package/dist/compounding/preference-consolidator.js +553 -0
- package/dist/compounding/preference-consolidator.js.map +1 -0
- package/dist/config.d.ts +4 -2
- package/dist/config.js +9 -4
- package/dist/conflict-policy-DyJ2wd-h.d.ts +4 -0
- package/dist/connectors/codex-materialize-runner.d.ts +64 -0
- package/dist/connectors/codex-materialize-runner.js +33 -0
- package/dist/connectors/codex-materialize-runner.js.map +1 -0
- package/dist/connectors/codex-materialize.d.ts +195 -0
- package/dist/connectors/codex-materialize.js +38 -0
- package/dist/connectors/codex-materialize.js.map +1 -0
- package/dist/connectors/index.d.ts +444 -0
- package/dist/connectors/index.js +115 -0
- package/dist/connectors/index.js.map +1 -0
- package/dist/connectors-cli-CwbyjGR7.d.ts +257 -0
- package/dist/connectors-cli.d.ts +1 -1
- package/dist/consolidation-provenance-check.d.ts +3 -1
- package/dist/consolidation-undo.d.ts +3 -1
- package/dist/contradiction/index.d.ts +258 -0
- package/dist/contradiction/index.js +43 -0
- package/dist/contradiction/index.js.map +1 -0
- package/dist/contradiction-review-ATP4S6IC.js +30 -0
- package/dist/contradiction-review-ATP4S6IC.js.map +1 -0
- package/dist/contradiction-scan-5A4IDZV5.js +13 -0
- package/dist/contradiction-scan-5A4IDZV5.js.map +1 -0
- package/dist/conversation-index/backend.d.ts +97 -0
- package/dist/conversation-index/backend.js +13 -0
- package/dist/conversation-index/backend.js.map +1 -0
- package/dist/conversation-index/chunker.d.ts +16 -0
- package/dist/conversation-index/chunker.js +8 -0
- package/dist/conversation-index/chunker.js.map +1 -0
- package/dist/conversation-index/cleanup.d.ts +11 -0
- package/dist/conversation-index/cleanup.js +9 -0
- package/dist/conversation-index/cleanup.js.map +1 -0
- package/dist/conversation-index/faiss-adapter.d.ts +6 -0
- package/dist/conversation-index/faiss-adapter.js +16 -0
- package/dist/conversation-index/faiss-adapter.js.map +1 -0
- package/dist/conversation-index/indexer.d.ts +23 -0
- package/dist/conversation-index/indexer.js +15 -0
- package/dist/conversation-index/indexer.js.map +1 -0
- package/dist/conversation-index/search.d.ts +6 -0
- package/dist/conversation-index/search.js +11 -0
- package/dist/conversation-index/search.js.map +1 -0
- package/dist/embedding-fallback.js +2 -2
- package/dist/enrichment/index.d.ts +163 -0
- package/dist/enrichment/index.js +18 -0
- package/dist/enrichment/index.js.map +1 -0
- package/dist/entity-retrieval.d.ts +4 -2
- package/dist/entity-retrieval.js +8 -5
- package/dist/evals.js +1 -1
- package/dist/explicit-capture.d.ts +20 -5
- package/dist/explicit-capture.js +2 -2
- package/dist/extraction-judge-training.js +1 -1
- package/dist/extraction.js +8 -8
- package/dist/faiss-adapter-CzPghc4C.d.ts +70 -0
- package/dist/fallback-llm.d.ts +2 -0
- package/dist/fallback-llm.js +4 -4
- package/dist/graph-edge-decay-5DI5GUNL.js +207 -0
- package/dist/index.d.ts +66 -711
- package/dist/index.js +556 -2680
- package/dist/index.js.map +1 -1
- package/dist/lcm/archive.d.ts +89 -0
- package/dist/lcm/archive.js +12 -0
- package/dist/lcm/archive.js.map +1 -0
- package/dist/lcm/dag.d.ts +48 -0
- package/dist/lcm/dag.js +8 -0
- package/dist/lcm/dag.js.map +1 -0
- package/dist/lcm/engine.d.ts +116 -0
- package/dist/lcm/engine.js +20 -0
- package/dist/lcm/engine.js.map +1 -0
- package/dist/lcm/index.d.ts +12 -0
- package/dist/lcm/index.js +44 -0
- package/dist/lcm/index.js.map +1 -0
- package/dist/lcm/queue.d.ts +62 -0
- package/dist/lcm/queue.js +8 -0
- package/dist/lcm/queue.js.map +1 -0
- package/dist/lcm/recall.d.ts +20 -0
- package/dist/lcm/recall.js +8 -0
- package/dist/lcm/recall.js.map +1 -0
- package/dist/lcm/schema.d.ts +16 -0
- package/dist/lcm/schema.js +14 -0
- package/dist/lcm/schema.js.map +1 -0
- package/dist/lcm/summarizer.d.ts +38 -0
- package/dist/lcm/summarizer.js +12 -0
- package/dist/lcm/summarizer.js.map +1 -0
- package/dist/lcm/tools.d.ts +29 -0
- package/dist/lcm/tools.js +8 -0
- package/dist/lcm/tools.js.map +1 -0
- package/dist/live-connectors-runner.js +5 -5
- package/dist/local-llm.js +3 -3
- package/dist/maintenance/archive-observations.d.ts +18 -0
- package/dist/maintenance/archive-observations.js +8 -0
- package/dist/maintenance/archive-observations.js.map +1 -0
- package/dist/maintenance/backup-stamp.d.ts +3 -0
- package/dist/maintenance/backup-stamp.js +8 -0
- package/dist/maintenance/backup-stamp.js.map +1 -0
- package/dist/maintenance/memory-governance-cron.d.ts +85 -0
- package/dist/maintenance/memory-governance-cron.js +22 -0
- package/dist/maintenance/memory-governance-cron.js.map +1 -0
- package/dist/maintenance/memory-governance.d.ts +137 -0
- package/dist/maintenance/memory-governance.js +40 -0
- package/dist/maintenance/memory-governance.js.map +1 -0
- package/dist/maintenance/migrate-observations.d.ts +18 -0
- package/dist/maintenance/migrate-observations.js +9 -0
- package/dist/maintenance/migrate-observations.js.map +1 -0
- package/dist/maintenance/observation-ledger-utils.d.ts +10 -0
- package/dist/maintenance/observation-ledger-utils.js +10 -0
- package/dist/maintenance/observation-ledger-utils.js.map +1 -0
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.d.ts +15 -0
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +28 -0
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js.map +1 -0
- package/dist/maintenance/rebuild-memory-projection.d.ts +77 -0
- package/dist/maintenance/rebuild-memory-projection.js +35 -0
- package/dist/maintenance/rebuild-memory-projection.js.map +1 -0
- package/dist/maintenance/rebuild-observations.d.ts +17 -0
- package/dist/maintenance/rebuild-observations.js +9 -0
- package/dist/maintenance/rebuild-observations.js.map +1 -0
- package/dist/mcp-memory-inspector-app.d.ts +24 -6
- package/dist/memory-projection-store.d.ts +108 -3
- package/dist/memory-projection-store.js +2 -1
- package/dist/memory-worth-outcomes.d.ts +4 -2
- package/dist/migrate/from-engram.d.ts +24 -0
- package/dist/migrate/from-engram.js +12 -0
- package/dist/migrate/from-engram.js.map +1 -0
- package/dist/namespaces/migrate.d.ts +50 -0
- package/dist/namespaces/migrate.js +50 -0
- package/dist/namespaces/migrate.js.map +1 -0
- package/dist/namespaces/principal.d.ts +17 -0
- package/dist/namespaces/principal.js +16 -0
- package/dist/namespaces/principal.js.map +1 -0
- package/dist/namespaces/search.d.ts +46 -0
- package/dist/namespaces/search.js +28 -0
- package/dist/namespaces/search.js.map +1 -0
- package/dist/namespaces/storage.d.ts +32 -0
- package/dist/namespaces/storage.js +28 -0
- package/dist/namespaces/storage.js.map +1 -0
- package/dist/network/tailscale.d.ts +41 -0
- package/dist/network/tailscale.js +9 -0
- package/dist/network/tailscale.js.map +1 -0
- package/dist/network/webdav.d.ts +39 -0
- package/dist/network/webdav.js +10 -0
- package/dist/network/webdav.js.map +1 -0
- package/dist/objective-state-writers.js +2 -2
- package/dist/operator-toolkit.d.ts +4 -2
- package/dist/operator-toolkit.js +32 -14
- package/dist/opik-exporter.js +2 -2
- package/dist/opik-exporter.js.map +1 -1
- package/dist/orchestrator-DuWl9Hwx.d.ts +1244 -0
- package/dist/orchestrator.d.ts +22 -7
- package/dist/orchestrator.js +79 -44
- package/dist/path-MR5JPYOP.js +9 -0
- package/dist/path-MR5JPYOP.js.map +1 -0
- package/dist/qmd-recall-cache.d.ts +1 -1
- package/dist/qmd.d.ts +102 -3
- package/dist/qmd.js +23 -5
- package/dist/recall-explain-renderer.js +3 -3
- package/dist/recall-xray-cli.js +4 -4
- package/dist/recall-xray-renderer.js +3 -3
- package/dist/recall-xray.js +2 -2
- package/dist/replay/normalizers/chatgpt.d.ts +6 -0
- package/dist/replay/normalizers/chatgpt.js +11 -0
- package/dist/replay/normalizers/chatgpt.js.map +1 -0
- package/dist/replay/normalizers/claude.d.ts +6 -0
- package/dist/replay/normalizers/claude.js +11 -0
- package/dist/replay/normalizers/claude.js.map +1 -0
- package/dist/replay/normalizers/openclaw.d.ts +6 -0
- package/dist/replay/normalizers/openclaw.js +11 -0
- package/dist/replay/normalizers/openclaw.js.map +1 -0
- package/dist/replay/normalizers/shared.d.ts +16 -0
- package/dist/replay/normalizers/shared.js +14 -0
- package/dist/replay/normalizers/shared.js.map +1 -0
- package/dist/replay/runner.d.ts +35 -0
- package/dist/replay/runner.js +16 -0
- package/dist/replay/runner.js.map +1 -0
- package/dist/replay/types.d.ts +57 -0
- package/dist/replay/types.js +19 -0
- package/dist/replay/types.js.map +1 -0
- package/dist/resolution-B7FNQSSP.js +12 -0
- package/dist/resolution-B7FNQSSP.js.map +1 -0
- package/dist/resolve-provider-secret.js +2 -2
- package/dist/resume-bundles.js +8 -6
- package/dist/retrieval-agents.d.ts +1 -1
- package/dist/routing/engine.d.ts +35 -0
- package/dist/routing/engine.js +16 -0
- package/dist/routing/engine.js.map +1 -0
- package/dist/routing/store.d.ts +27 -0
- package/dist/routing/store.js +10 -0
- package/dist/routing/store.js.map +1 -0
- package/dist/runtime/better-sqlite.d.ts +8 -0
- package/dist/runtime/better-sqlite.js +10 -0
- package/dist/runtime/better-sqlite.js.map +1 -0
- package/dist/runtime/child-process.d.ts +32 -0
- package/dist/runtime/child-process.js +10 -0
- package/dist/runtime/child-process.js.map +1 -0
- package/dist/runtime/env.d.ts +5 -0
- package/dist/runtime/env.js +12 -0
- package/dist/runtime/env.js.map +1 -0
- package/dist/schemas.d.ts +22 -22
- package/dist/sdk-compat.js +1 -1
- package/dist/search/document-scanner.d.ts +22 -0
- package/dist/search/document-scanner.js +8 -0
- package/dist/search/document-scanner.js.map +1 -0
- package/dist/search/embed-helper.d.ts +35 -0
- package/dist/search/embed-helper.js +9 -0
- package/dist/search/embed-helper.js.map +1 -0
- package/dist/search/factory.d.ts +32 -0
- package/dist/search/factory.js +29 -0
- package/dist/search/factory.js.map +1 -0
- package/dist/search/index.d.ts +15 -0
- package/dist/search/index.js +50 -0
- package/dist/search/index.js.map +1 -0
- package/dist/search/lancedb-backend.d.ts +51 -0
- package/dist/search/lancedb-backend.js +10 -0
- package/dist/search/lancedb-backend.js.map +1 -0
- package/dist/search/meilisearch-backend.d.ts +48 -0
- package/dist/search/meilisearch-backend.js +10 -0
- package/dist/search/meilisearch-backend.js.map +1 -0
- package/dist/search/noop-backend.d.ts +26 -0
- package/dist/search/noop-backend.js +8 -0
- package/dist/search/noop-backend.js.map +1 -0
- package/dist/search/orama-backend.d.ts +53 -0
- package/dist/search/orama-backend.js +10 -0
- package/dist/search/orama-backend.js.map +1 -0
- package/dist/search/port.d.ts +61 -0
- package/dist/search/port.js +1 -0
- package/dist/search/port.js.map +1 -0
- package/dist/search/remote-backend.d.ts +39 -0
- package/dist/search/remote-backend.js +9 -0
- package/dist/search/remote-backend.js.map +1 -0
- package/dist/secure-store/index.d.ts +890 -0
- package/dist/secure-store/index.js +156 -0
- package/dist/secure-store/index.js.map +1 -0
- package/dist/semantic-VwGI14Ok.d.ts +69 -0
- package/dist/semantic-consolidation-4HkHWgeI.d.ts +180 -0
- package/dist/semantic-consolidation.d.ts +2 -2
- package/dist/semantic-consolidation.js +13 -6
- package/dist/semantic-rule-promotion.js +8 -5
- package/dist/semantic-rule-verifier.js +8 -5
- package/dist/shared-context/manager.d.ts +131 -0
- package/dist/shared-context/manager.js +15 -0
- package/dist/shared-context/manager.js.map +1 -0
- package/dist/skills-registry.js +13 -1
- package/dist/skills-registry.js.map +1 -1
- package/dist/state-store-VZU2IA53.js +16 -0
- package/dist/state-store-VZU2IA53.js.map +1 -0
- package/dist/storage-paths.d.ts +9 -0
- package/dist/storage-paths.js +20 -0
- package/dist/storage-paths.js.map +1 -0
- package/dist/storage.d.ts +3 -1
- package/dist/storage.js +7 -4
- package/dist/summarizer.d.ts +5 -0
- package/dist/summarizer.js +9 -8
- package/dist/summary-snapshot.js +2 -1
- package/dist/surfaces/dreams.d.ts +16 -0
- package/dist/surfaces/dreams.js +282 -0
- package/dist/surfaces/dreams.js.map +1 -0
- package/dist/surfaces/heartbeat.d.ts +17 -0
- package/dist/surfaces/heartbeat.js +265 -0
- package/dist/surfaces/heartbeat.js.map +1 -0
- package/dist/temporal-supersession.d.ts +3 -1
- package/dist/threading.d.ts +5 -0
- package/dist/threading.js +2 -1
- package/dist/tier-migration.d.ts +4 -2
- package/dist/tokens.js +2 -2
- package/dist/transcript.d.ts +15 -1
- package/dist/transcript.js +2 -1
- package/dist/transfer/autodetect.d.ts +4 -0
- package/dist/transfer/autodetect.js +15 -0
- package/dist/transfer/autodetect.js.map +1 -0
- package/dist/transfer/backup.d.ts +21 -0
- package/dist/transfer/backup.js +17 -0
- package/dist/transfer/backup.js.map +1 -0
- package/dist/transfer/capsule-export.d.ts +113 -0
- package/dist/transfer/capsule-export.js +19 -0
- package/dist/transfer/capsule-export.js.map +1 -0
- package/dist/transfer/capsule-import.d.ts +124 -0
- package/dist/transfer/capsule-import.js +16 -0
- package/dist/transfer/capsule-import.js.map +1 -0
- package/dist/transfer/constants.d.ts +13 -0
- package/dist/transfer/constants.js +12 -0
- package/dist/transfer/constants.js.map +1 -0
- package/dist/transfer/export-json.d.ts +11 -0
- package/dist/transfer/export-json.js +11 -0
- package/dist/transfer/export-json.js.map +1 -0
- package/dist/transfer/export-md.d.ts +10 -0
- package/dist/transfer/export-md.js +13 -0
- package/dist/transfer/export-md.js.map +1 -0
- package/dist/transfer/export-sqlite.d.ts +9 -0
- package/dist/transfer/export-sqlite.js +12 -0
- package/dist/transfer/export-sqlite.js.map +1 -0
- package/dist/transfer/fs-utils.d.ts +61 -0
- package/dist/transfer/fs-utils.js +40 -0
- package/dist/transfer/fs-utils.js.map +1 -0
- package/dist/transfer/import-json.d.ts +16 -0
- package/dist/transfer/import-json.js +13 -0
- package/dist/transfer/import-json.js.map +1 -0
- package/dist/transfer/import-md.d.ts +14 -0
- package/dist/transfer/import-md.js +11 -0
- package/dist/transfer/import-md.js.map +1 -0
- package/dist/transfer/import-sqlite.d.ts +14 -0
- package/dist/transfer/import-sqlite.js +12 -0
- package/dist/transfer/import-sqlite.js.map +1 -0
- package/dist/transfer/sqlite-schema.d.ts +4 -0
- package/dist/transfer/sqlite-schema.js +10 -0
- package/dist/transfer/sqlite-schema.js.map +1 -0
- package/dist/transfer/types.d.ts +916 -0
- package/dist/transfer/types.js +30 -0
- package/dist/transfer/types.js.map +1 -0
- package/dist/types.d.ts +28 -1
- package/dist/types.js +1 -1
- package/dist/verified-recall.js +9 -6
- package/dist/work/board.d.ts +43 -0
- package/dist/work/board.js +14 -0
- package/dist/work/board.js.map +1 -0
- package/dist/work/boundary.d.ts +8 -0
- package/dist/work/boundary.js +14 -0
- package/dist/work/boundary.js.map +1 -0
- package/dist/work/storage.d.ts +39 -0
- package/dist/work/storage.js +11 -0
- package/dist/work/storage.js.map +1 -0
- package/dist/work/types.d.ts +75 -0
- package/dist/work/types.js +1 -0
- package/dist/work/types.js.map +1 -0
- package/package.json +2767 -6
- package/scripts/faiss_index.py +816 -0
- package/scripts/faiss_requirements.txt +3 -0
- package/skills/remnic-entities/SKILL.md +51 -0
- package/skills/remnic-memory-workflow/SKILL.md +61 -0
- package/skills/remnic-recall/SKILL.md +51 -0
- package/skills/remnic-remember/SKILL.md +56 -0
- package/skills/remnic-search/SKILL.md +51 -0
- package/skills/remnic-status/SKILL.md +51 -0
- package/src/abort-error.test.ts +49 -0
- package/src/abort-error.ts +46 -0
- package/src/abstraction-nodes.ts +162 -0
- package/src/access-audit.test.ts +178 -0
- package/src/access-audit.ts +125 -0
- package/src/access-cli.test.ts +439 -0
- package/src/access-cli.ts +438 -0
- package/src/access-http.test.ts +225 -0
- package/src/access-http.ts +1899 -0
- package/src/access-idempotency.ts +232 -0
- package/src/access-mcp.test.ts +568 -0
- package/src/access-mcp.ts +3056 -0
- package/src/access-schema-pi.test.ts +60 -0
- package/src/access-schema.ts +522 -0
- package/src/access-service-namespace.test.ts +123 -0
- package/src/access-service.ts +5629 -0
- package/src/action-confidence.test.ts +206 -0
- package/src/action-confidence.ts +466 -0
- package/src/active-memory-bridge.test.ts +285 -0
- package/src/active-memory-bridge.ts +217 -0
- package/src/active-recall.test.ts +484 -0
- package/src/active-recall.ts +459 -0
- package/src/adapters/claude-code.ts +56 -0
- package/src/adapters/codex.ts +57 -0
- package/src/adapters/hermes.ts +64 -0
- package/src/adapters/index.ts +6 -0
- package/src/adapters/registry.ts +41 -0
- package/src/adapters/replit.ts +55 -0
- package/src/adapters/types.ts +51 -0
- package/src/behavior-learner.ts +144 -0
- package/src/behavior-signals.ts +73 -0
- package/src/binary-lifecycle/backend.ts +117 -0
- package/src/binary-lifecycle/index.ts +35 -0
- package/src/binary-lifecycle/manifest.ts +79 -0
- package/src/binary-lifecycle/pipeline.ts +352 -0
- package/src/binary-lifecycle/scanner.ts +89 -0
- package/src/binary-lifecycle/types.ts +89 -0
- package/src/bootstrap.ts +178 -0
- package/src/boxes.ts +521 -0
- package/src/briefing.test.ts +1535 -0
- package/src/briefing.ts +1382 -0
- package/src/buffer-session.test.ts +443 -0
- package/src/buffer-surprise-report.ts +176 -0
- package/src/buffer-surprise-telemetry.test.ts +606 -0
- package/src/buffer-surprise-trigger.test.ts +766 -0
- package/src/buffer-surprise.test.ts +339 -0
- package/src/buffer-surprise.ts +203 -0
- package/src/buffer.ts +900 -0
- package/src/bulk-import/cli-command.test.ts +204 -0
- package/src/bulk-import/index.ts +34 -0
- package/src/bulk-import/pipeline.test.ts +445 -0
- package/src/bulk-import/pipeline.ts +178 -0
- package/src/bulk-import/registry.test.ts +151 -0
- package/src/bulk-import/registry.ts +72 -0
- package/src/bulk-import/types.test.ts +272 -0
- package/src/bulk-import/types.ts +145 -0
- package/src/calibration.ts +394 -0
- package/src/capsule-cli.test.ts +398 -0
- package/src/capsule-cli.ts +565 -0
- package/src/causal-behavior.ts +308 -0
- package/src/causal-chain.ts +419 -0
- package/src/causal-consolidation.ts +370 -0
- package/src/causal-retrieval.ts +286 -0
- package/src/causal-trajectory-graph.ts +60 -0
- package/src/causal-trajectory.ts +303 -0
- package/src/chunking.ts +220 -0
- package/src/citations.ts +232 -0
- package/src/cli.ts +9403 -0
- package/src/codex-cli-fallback.ts +162 -0
- package/src/codex-thread-key.ts +1 -0
- package/src/coding/access-coding-context.test.ts +197 -0
- package/src/coding/coding-branch-scope.test.ts +281 -0
- package/src/coding/coding-namespace.test.ts +360 -0
- package/src/coding/coding-namespace.ts +412 -0
- package/src/coding/coding-orchestrator.test.ts +249 -0
- package/src/coding/git-context.test.ts +507 -0
- package/src/coding/git-context.ts +336 -0
- package/src/coding/mcp-set-coding-context.test.ts +174 -0
- package/src/coding/review-context.test.ts +316 -0
- package/src/coding/review-context.ts +349 -0
- package/src/coding/wire-coding-context.test.ts +468 -0
- package/src/commitment-ledger.test.ts +78 -0
- package/src/commitment-ledger.ts +337 -0
- package/src/compat/checks.test.ts +206 -0
- package/src/compat/checks.ts +716 -0
- package/src/compat/types.ts +33 -0
- package/src/compounding/engine.ts +1686 -0
- package/src/compounding/preference-consolidator.ts +778 -0
- package/src/compression-optimizer.ts +312 -0
- package/src/config.test.ts +930 -0
- package/src/config.ts +3807 -0
- package/src/connectors/codex/instructions.md +160 -0
- package/src/connectors/codex/resources/namespace-cheatsheet.md +48 -0
- package/src/connectors/codex-marketplace.ts +500 -0
- package/src/connectors/codex-materialize-runner.ts +212 -0
- package/src/connectors/codex-materialize.ts +983 -0
- package/src/connectors/coerce.ts +62 -0
- package/src/connectors/index.test.ts +1570 -0
- package/src/connectors/index.ts +3222 -0
- package/src/connectors/live/framework.ts +164 -0
- package/src/connectors/live/github.test.ts +1218 -0
- package/src/connectors/live/github.ts +1068 -0
- package/src/connectors/live/gmail.test.ts +1706 -0
- package/src/connectors/live/gmail.ts +1293 -0
- package/src/connectors/live/google-drive.test.ts +696 -0
- package/src/connectors/live/google-drive.ts +724 -0
- package/src/connectors/live/index.ts +101 -0
- package/src/connectors/live/live-connectors.test.ts +689 -0
- package/src/connectors/live/notion.test.ts +1109 -0
- package/src/connectors/live/notion.ts +978 -0
- package/src/connectors/live/registry.ts +103 -0
- package/src/connectors/live/state-store.ts +399 -0
- package/src/connectors/live/transient-errors.ts +150 -0
- package/src/connectors/weclone-installer.test.ts +850 -0
- package/src/connectors-cli.ts +513 -0
- package/src/console/state.test.ts +224 -0
- package/src/console/state.ts +514 -0
- package/src/console/trace.test.ts +813 -0
- package/src/console/trace.ts +603 -0
- package/src/console/tui.test.ts +582 -0
- package/src/console/tui.ts +508 -0
- package/src/consolidation-operator.ts +182 -0
- package/src/consolidation-provenance-check.ts +551 -0
- package/src/consolidation-undo.ts +718 -0
- package/src/contradiction/contradiction-judge.test.ts +189 -0
- package/src/contradiction/contradiction-judge.ts +333 -0
- package/src/contradiction/contradiction-review.ts +574 -0
- package/src/contradiction/contradiction-scan.ts +504 -0
- package/src/contradiction/contradiction.test.ts +2230 -0
- package/src/contradiction/index.ts +37 -0
- package/src/contradiction/resolution.ts +383 -0
- package/src/conversation-index/backend.ts +323 -0
- package/src/conversation-index/chunker.ts +47 -0
- package/src/conversation-index/cleanup.ts +53 -0
- package/src/conversation-index/faiss-adapter.ts +384 -0
- package/src/conversation-index/indexer.test.ts +164 -0
- package/src/conversation-index/indexer.ts +192 -0
- package/src/conversation-index/search.ts +37 -0
- package/src/cross-namespace-budget.test.ts +275 -0
- package/src/cross-namespace-budget.ts +365 -0
- package/src/cue-anchors.ts +163 -0
- package/src/curation/index.ts +544 -0
- package/src/dashboard-runtime.ts +337 -0
- package/src/day-summary.ts +122 -0
- package/src/dedup/index.ts +330 -0
- package/src/dedup/semantic.test.ts +1577 -0
- package/src/dedup/semantic.ts +148 -0
- package/src/delinearize.ts +193 -0
- package/src/direct-answer-wiring.test.ts +473 -0
- package/src/direct-answer-wiring.ts +180 -0
- package/src/direct-answer.test.ts +484 -0
- package/src/direct-answer.ts +273 -0
- package/src/embedding-fallback.ts +565 -0
- package/src/enrichment/audit.ts +89 -0
- package/src/enrichment/index.ts +27 -0
- package/src/enrichment/pipeline.ts +197 -0
- package/src/enrichment/provider-registry.ts +85 -0
- package/src/enrichment/types.ts +100 -0
- package/src/enrichment/web-search-provider.ts +63 -0
- package/src/entity-retrieval.ts +774 -0
- package/src/entity-schema.ts +239 -0
- package/src/evals.ts +1312 -0
- package/src/event-order-recall.test.ts +4164 -0
- package/src/event-order-recall.ts +2802 -0
- package/src/evidence-pack.test.ts +89 -0
- package/src/evidence-pack.ts +388 -0
- package/src/explicit-capture.ts +530 -0
- package/src/explicit-cue-recall.test.ts +3019 -0
- package/src/explicit-cue-recall.ts +5545 -0
- package/src/extraction-judge-telemetry.ts +234 -0
- package/src/extraction-judge-training.ts +221 -0
- package/src/extraction-judge.ts +846 -0
- package/src/extraction-timeout.test.ts +265 -0
- package/src/extraction.ts +2719 -0
- package/src/fallback-llm.test.ts +1060 -0
- package/src/fallback-llm.ts +918 -0
- package/src/focused-list-recall.test.ts +734 -0
- package/src/focused-list-recall.ts +1160 -0
- package/src/graph-dashboard-diff.ts +35 -0
- package/src/graph-dashboard-key.ts +5 -0
- package/src/graph-dashboard-parser.ts +104 -0
- package/src/graph-edge-reinforcement.ts +192 -0
- package/src/graph-events.ts +151 -0
- package/src/graph-recall.test.ts +164 -0
- package/src/graph-recall.ts +189 -0
- package/src/graph-retrieval.test.ts +809 -0
- package/src/graph-retrieval.ts +823 -0
- package/src/graph-snapshot.ts +329 -0
- package/src/graph.ts +813 -0
- package/src/harmonic-retrieval.ts +223 -0
- package/src/himem.ts +154 -0
- package/src/hygiene.ts +87 -0
- package/src/identity-continuity.ts +333 -0
- package/src/importance.ts +328 -0
- package/src/importers/base.test.ts +294 -0
- package/src/importers/base.ts +436 -0
- package/src/importers/index.ts +21 -0
- package/src/index.ts +1204 -0
- package/src/intent.ts +154 -0
- package/src/json-extract.ts +85 -0
- package/src/json-store.ts +42 -0
- package/src/lcm/archive.ts +617 -0
- package/src/lcm/dag.ts +199 -0
- package/src/lcm/engine.ts +645 -0
- package/src/lcm/index.ts +7 -0
- package/src/lcm/queue.test.ts +178 -0
- package/src/lcm/queue.ts +200 -0
- package/src/lcm/recall.ts +117 -0
- package/src/lcm/schema.ts +154 -0
- package/src/lcm/summarizer.ts +235 -0
- package/src/lcm/tools.ts +191 -0
- package/src/lcm-engine.test.ts +660 -0
- package/src/legacy-hook-compat.test.ts +20 -0
- package/src/legacy-hook-compat.ts +45 -0
- package/src/lifecycle.ts +289 -0
- package/src/live-connectors-runner.ts +385 -0
- package/src/local-llm-qos.test.ts +303 -0
- package/src/local-llm-thinking.test.ts +292 -0
- package/src/local-llm.ts +1464 -0
- package/src/logger.ts +49 -0
- package/src/maintenance/archive-observations.ts +147 -0
- package/src/maintenance/backup-stamp.ts +3 -0
- package/src/maintenance/dreams-ledger.ts +516 -0
- package/src/maintenance/first-start-migration.ts +362 -0
- package/src/maintenance/forget.test.ts +206 -0
- package/src/maintenance/forget.ts +126 -0
- package/src/maintenance/graph-edge-decay.test.ts +409 -0
- package/src/maintenance/graph-edge-decay.ts +394 -0
- package/src/maintenance/memory-governance-cron.ts +447 -0
- package/src/maintenance/memory-governance.ts +1039 -0
- package/src/maintenance/migrate-observations.ts +216 -0
- package/src/maintenance/observation-ledger-utils.ts +54 -0
- package/src/maintenance/pattern-reinforcement.test.ts +875 -0
- package/src/maintenance/pattern-reinforcement.ts +369 -0
- package/src/maintenance/purge.ts +334 -0
- package/src/maintenance/rebuild-memory-lifecycle-ledger.ts +78 -0
- package/src/maintenance/rebuild-memory-projection.ts +1234 -0
- package/src/maintenance/rebuild-observations.ts +178 -0
- package/src/maintenance/tier-stats.test.ts +378 -0
- package/src/maintenance/tier-stats.ts +222 -0
- package/src/mcp-memory-inspector-app.ts +421 -0
- package/src/memory-action-policy.ts +80 -0
- package/src/memory-cache.ts +208 -0
- package/src/memory-extension/claude-code-publisher.ts +51 -0
- package/src/memory-extension/codex-publisher.ts +149 -0
- package/src/memory-extension/hermes-publisher.ts +51 -0
- package/src/memory-extension/index.ts +100 -0
- package/src/memory-extension/shared-instructions.ts +133 -0
- package/src/memory-extension/types.ts +86 -0
- package/src/memory-extension-host/host-discovery.ts +276 -0
- package/src/memory-extension-host/index.ts +14 -0
- package/src/memory-extension-host/render-extensions-block.ts +73 -0
- package/src/memory-extension-host/types.ts +21 -0
- package/src/memory-lifecycle-ledger-utils.ts +116 -0
- package/src/memory-projection-format.ts +11 -0
- package/src/memory-projection-store.ts +951 -0
- package/src/memory-provenance.test.ts +196 -0
- package/src/memory-provenance.ts +484 -0
- package/src/memory-worth-bench.test.ts +71 -0
- package/src/memory-worth-bench.ts +265 -0
- package/src/memory-worth-filter.test.ts +209 -0
- package/src/memory-worth-filter.ts +204 -0
- package/src/memory-worth-frontmatter.test.ts +311 -0
- package/src/memory-worth-outcomes.test.ts +316 -0
- package/src/memory-worth-outcomes.ts +286 -0
- package/src/memory-worth.test.ts +317 -0
- package/src/memory-worth.ts +215 -0
- package/src/message-parts/index.ts +806 -0
- package/src/message-parts/message-parts.test.ts +421 -0
- package/src/migrate/from-engram.ts +789 -0
- package/src/model-registry.ts +313 -0
- package/src/models-json.ts +76 -0
- package/src/namespaces/migrate.ts +187 -0
- package/src/namespaces/path.ts +25 -0
- package/src/namespaces/principal.test.ts +195 -0
- package/src/namespaces/principal.ts +86 -0
- package/src/namespaces/search.test.ts +105 -0
- package/src/namespaces/search.ts +233 -0
- package/src/namespaces/storage.ts +74 -0
- package/src/native-knowledge.ts +1823 -0
- package/src/negative.ts +72 -0
- package/src/network/tailscale.ts +179 -0
- package/src/network/webdav.ts +385 -0
- package/src/objective-state-writers.ts +951 -0
- package/src/objective-state.ts +320 -0
- package/src/onboarding/index.ts +529 -0
- package/src/openai-chat-compat.ts +56 -0
- package/src/operator-toolkit.ts +2132 -0
- package/src/opik-exporter.test.ts +72 -0
- package/src/opik-exporter.ts +587 -0
- package/src/orchestrator-extraction-queue.test.ts +197 -0
- package/src/orchestrator-flush.test.ts +1171 -0
- package/src/orchestrator-pattern-reinforcement.test.ts +128 -0
- package/src/orchestrator-source-attribution.test.ts +701 -0
- package/src/orchestrator.ts +16368 -0
- package/src/page-versioning.ts +450 -0
- package/src/patterns-cli.ts +574 -0
- package/src/peers/index.ts +54 -0
- package/src/peers/migrate-from-identity-anchor.test.ts +291 -0
- package/src/peers/migrate-from-identity-anchor.ts +350 -0
- package/src/peers/peers.test.ts +419 -0
- package/src/peers/profile-reasoner.ts +694 -0
- package/src/peers/storage.ts +1350 -0
- package/src/peers/types.ts +138 -0
- package/src/plugin-id.ts +84 -0
- package/src/policy-runtime.ts +209 -0
- package/src/procedural/procedure-miner.ts +150 -0
- package/src/procedural/procedure-recall.ts +93 -0
- package/src/procedural/procedure-stats.ts +213 -0
- package/src/procedural/procedure-types.ts +132 -0
- package/src/procedural/reinforcement-core.test.ts +132 -0
- package/src/procedural/reinforcement-core.ts +73 -0
- package/src/profiling.test.ts +263 -0
- package/src/profiling.ts +435 -0
- package/src/projection/index.ts +398 -0
- package/src/qmd-recall-cache.test.ts +138 -0
- package/src/qmd-recall-cache.ts +111 -0
- package/src/qmd.test.ts +258 -0
- package/src/qmd.ts +2614 -0
- package/src/reasoning-trace-recall.ts +201 -0
- package/src/reasoning-trace-types.ts +235 -0
- package/src/recall-audit-anomaly.test.ts +246 -0
- package/src/recall-audit-anomaly.ts +297 -0
- package/src/recall-audit.test.ts +51 -0
- package/src/recall-audit.ts +72 -0
- package/src/recall-budget-config.test.ts +87 -0
- package/src/recall-disclosure-escalation.test.ts +196 -0
- package/src/recall-disclosure-escalation.ts +158 -0
- package/src/recall-disclosure-shaping.test.ts +146 -0
- package/src/recall-disclosure.test.ts +214 -0
- package/src/recall-explain-renderer.test.ts +140 -0
- package/src/recall-explain-renderer.ts +356 -0
- package/src/recall-mmr.test.ts +808 -0
- package/src/recall-mmr.ts +607 -0
- package/src/recall-qos.test.ts +85 -0
- package/src/recall-qos.ts +82 -0
- package/src/recall-query-policy.ts +221 -0
- package/src/recall-state.test.ts +233 -0
- package/src/recall-state.ts +456 -0
- package/src/recall-tag-filter.ts +143 -0
- package/src/recall-tokenization.ts +35 -0
- package/src/recall-xray-cli.test.ts +118 -0
- package/src/recall-xray-cli.ts +100 -0
- package/src/recall-xray-disclosure-telemetry.test.ts +183 -0
- package/src/recall-xray-renderer.test.ts +539 -0
- package/src/recall-xray-renderer.ts +487 -0
- package/src/recall-xray.test.ts +503 -0
- package/src/recall-xray.ts +621 -0
- package/src/reconstruct.ts +41 -0
- package/src/release-changelog.ts +35 -0
- package/src/relevance.ts +67 -0
- package/src/replay/normalizers/chatgpt.ts +133 -0
- package/src/replay/normalizers/claude.ts +102 -0
- package/src/replay/normalizers/openclaw.ts +119 -0
- package/src/replay/normalizers/shared.ts +69 -0
- package/src/replay/runner.ts +197 -0
- package/src/replay/types.ts +143 -0
- package/src/rerank.test.ts +48 -0
- package/src/rerank.ts +176 -0
- package/src/resolve-auth-token.test.ts +226 -0
- package/src/resolve-auth-token.ts +151 -0
- package/src/resolve-provider-secret.test.ts +187 -0
- package/src/resolve-provider-secret.ts +410 -0
- package/src/response-guidance-recall.test.ts +3952 -0
- package/src/response-guidance-recall.ts +4431 -0
- package/src/resume-bundles.ts +415 -0
- package/src/retrieval-agents.ts +623 -0
- package/src/retrieval-tiers.ts +25 -0
- package/src/retrieval.ts +104 -0
- package/src/review/index.test.ts +201 -0
- package/src/review/index.ts +536 -0
- package/src/routing/engine.ts +162 -0
- package/src/routing/store.ts +321 -0
- package/src/runtime/better-sqlite.test.ts +32 -0
- package/src/runtime/better-sqlite.ts +76 -0
- package/src/runtime/child-process.ts +67 -0
- package/src/runtime/env.ts +48 -0
- package/src/sanitize.ts +58 -0
- package/src/schemas.ts +449 -0
- package/src/sdk-compat.ts +87 -0
- package/src/search/document-scanner.ts +96 -0
- package/src/search/embed-helper.ts +142 -0
- package/src/search/factory.ts +189 -0
- package/src/search/index.ts +10 -0
- package/src/search/lancedb-backend.ts +342 -0
- package/src/search/meilisearch-backend.ts +232 -0
- package/src/search/noop-backend.ts +57 -0
- package/src/search/orama-backend.ts +358 -0
- package/src/search/port.ts +86 -0
- package/src/search/remote-backend.ts +124 -0
- package/src/secure-store/cipher.ts +271 -0
- package/src/secure-store/cli-handlers.ts +355 -0
- package/src/secure-store/cli-renderer.ts +131 -0
- package/src/secure-store/header.ts +373 -0
- package/src/secure-store/index.ts +137 -0
- package/src/secure-store/kdf.ts +263 -0
- package/src/secure-store/keyring.ts +106 -0
- package/src/secure-store/metadata.ts +394 -0
- package/src/secure-store/passphrase-reader.ts +252 -0
- package/src/secure-store/secure-fs.ts +571 -0
- package/src/secure-store/secure-store.test.ts +755 -0
- package/src/semantic-chunking.ts +545 -0
- package/src/semantic-consolidation.test.ts +182 -0
- package/src/semantic-consolidation.ts +432 -0
- package/src/semantic-rule-promotion.ts +183 -0
- package/src/semantic-rule-verifier.ts +160 -0
- package/src/session-integrity.ts +569 -0
- package/src/session-observer-bands.ts +11 -0
- package/src/session-observer-state.ts +346 -0
- package/src/session-toggles.test.ts +96 -0
- package/src/session-toggles.ts +159 -0
- package/src/shared-context/manager.ts +810 -0
- package/src/signal.ts +84 -0
- package/src/skills-registry.test.ts +277 -0
- package/src/skills-registry.ts +120 -0
- package/src/source-attribution-roundtrip.test.ts +215 -0
- package/src/source-attribution.test.ts +1425 -0
- package/src/source-attribution.ts +639 -0
- package/src/spaces/index.ts +627 -0
- package/src/storage-paths.ts +117 -0
- package/src/storage.ts +6657 -0
- package/src/store-contract.ts +55 -0
- package/src/summarizer.ts +844 -0
- package/src/summary-snapshot.test.ts +681 -0
- package/src/summary-snapshot.ts +238 -0
- package/src/surfaces/dreams.test.ts +394 -0
- package/src/surfaces/dreams.ts +346 -0
- package/src/surfaces/heartbeat.test.ts +415 -0
- package/src/surfaces/heartbeat.ts +325 -0
- package/src/sync/index.ts +308 -0
- package/src/targeted-fact-recall.test.ts +1694 -0
- package/src/targeted-fact-recall.ts +2905 -0
- package/src/taxonomy/default-taxonomy.ts +87 -0
- package/src/taxonomy/index.ts +26 -0
- package/src/taxonomy/resolver-doc-generator.ts +57 -0
- package/src/taxonomy/resolver.ts +184 -0
- package/src/taxonomy/taxonomy-loader.ts +186 -0
- package/src/taxonomy/types.ts +48 -0
- package/src/telemetry-transcript.ts +70 -0
- package/src/temporal-index.ts +890 -0
- package/src/temporal-supersession.test.ts +2703 -0
- package/src/temporal-supersession.ts +493 -0
- package/src/temporal-validity.test.ts +448 -0
- package/src/temporal-validity.ts +123 -0
- package/src/threading.ts +395 -0
- package/src/tier-migration.ts +124 -0
- package/src/tier-routing.ts +102 -0
- package/src/tmt.ts +462 -0
- package/src/tokens.test.ts +178 -0
- package/src/tokens.ts +279 -0
- package/src/topics.ts +147 -0
- package/src/training-export/cli-date-validation.test.ts +258 -0
- package/src/training-export/converter.test.ts +452 -0
- package/src/training-export/converter.ts +319 -0
- package/src/training-export/date-parse.ts +117 -0
- package/src/training-export/index.ts +26 -0
- package/src/training-export/registry.test.ts +85 -0
- package/src/training-export/registry.ts +57 -0
- package/src/training-export/types.ts +31 -0
- package/src/transcript.ts +1179 -0
- package/src/transfer/autodetect.ts +30 -0
- package/src/transfer/backup.ts +138 -0
- package/src/transfer/capsule-crypto.ts +485 -0
- package/src/transfer/capsule-encrypt.test.ts +690 -0
- package/src/transfer/capsule-export.ts +543 -0
- package/src/transfer/capsule-fork.ts +375 -0
- package/src/transfer/capsule-import.ts +564 -0
- package/src/transfer/capsule-merge.ts +433 -0
- package/src/transfer/conflict-policy.ts +16 -0
- package/src/transfer/constants.ts +13 -0
- package/src/transfer/exclusions.ts +37 -0
- package/src/transfer/export-json.ts +65 -0
- package/src/transfer/export-md.ts +59 -0
- package/src/transfer/export-sqlite.ts +52 -0
- package/src/transfer/fs-utils.ts +269 -0
- package/src/transfer/import-json.ts +108 -0
- package/src/transfer/import-md.ts +84 -0
- package/src/transfer/import-sqlite.ts +100 -0
- package/src/transfer/integrity.ts +71 -0
- package/src/transfer/sqlite-schema.ts +16 -0
- package/src/transfer/types.ts +297 -0
- package/src/trust-zones.ts +1186 -0
- package/src/types.ts +3074 -0
- package/src/user-model.test.ts +124 -0
- package/src/user-model.ts +162 -0
- package/src/utility-learner.ts +353 -0
- package/src/utility-runtime.ts +88 -0
- package/src/utility-telemetry.ts +215 -0
- package/src/utils/category-dir.ts +44 -0
- package/src/utils/errno.ts +6 -0
- package/src/utils/iso-timestamp.test.ts +37 -0
- package/src/utils/iso-timestamp.ts +164 -0
- package/src/utils/path.ts +26 -0
- package/src/verified-recall.ts +138 -0
- package/src/version-utils.test.ts +10 -0
- package/src/version-utils.ts +9 -0
- package/src/whitespace.ts +10 -0
- package/src/work/board.ts +359 -0
- package/src/work/boundary.ts +107 -0
- package/src/work/storage.ts +436 -0
- package/src/work/types.ts +82 -0
- package/src/work-product-ledger.ts +265 -0
- package/dist/access-service-DDjzFALq.d.ts +0 -2088
- package/dist/capsule-crypto-SJS5VVAP.js +0 -18
- package/dist/capsule-export-7QNCBZOQ.js +0 -17
- package/dist/capsule-import-EPBHD2EN.js +0 -16
- package/dist/capsule-merge-DI7PNQ2H.js +0 -189
- package/dist/chunk-23ZZK64Y.js +0 -26
- package/dist/chunk-23ZZK64Y.js.map +0 -1
- package/dist/chunk-242S3I2A.js +0 -647
- package/dist/chunk-2LGMW3DJ.js +0 -111
- package/dist/chunk-3B6KIRBH.js +0 -5213
- package/dist/chunk-3B6KIRBH.js.map +0 -1
- package/dist/chunk-457A4P3L.js +0 -119
- package/dist/chunk-457A4P3L.js.map +0 -1
- package/dist/chunk-4IS4SXIQ.js +0 -2040
- package/dist/chunk-4YM32CRU.js +0 -721
- package/dist/chunk-6TBWYBJ3.js +0 -236
- package/dist/chunk-74EMIVE4.js +0 -329
- package/dist/chunk-74EMIVE4.js.map +0 -1
- package/dist/chunk-767ODGE6.js +0 -183
- package/dist/chunk-7V22HTMD.js +0 -623
- package/dist/chunk-7V22HTMD.js.map +0 -1
- package/dist/chunk-7ZM3BFKK.js +0 -9705
- package/dist/chunk-7ZM3BFKK.js.map +0 -1
- package/dist/chunk-AQJNPMOA.js +0 -643
- package/dist/chunk-AQJNPMOA.js.map +0 -1
- package/dist/chunk-ASAITVLA.js +0 -64
- package/dist/chunk-ASAITVLA.js.map +0 -1
- package/dist/chunk-BBE34QBJ.js +0 -275
- package/dist/chunk-BBE34QBJ.js.map +0 -1
- package/dist/chunk-BZSQEPRW.js +0 -14710
- package/dist/chunk-BZSQEPRW.js.map +0 -1
- package/dist/chunk-CPKTBRS2.js +0 -891
- package/dist/chunk-CPKTBRS2.js.map +0 -1
- package/dist/chunk-D4GAOFF6.js +0 -562
- package/dist/chunk-D4GAOFF6.js.map +0 -1
- package/dist/chunk-D54LZC5L.js +0 -147
- package/dist/chunk-DF3RVK3X.js +0 -119
- package/dist/chunk-DF3RVK3X.js.map +0 -1
- package/dist/chunk-DZZPC36E.js +0 -1451
- package/dist/chunk-DZZPC36E.js.map +0 -1
- package/dist/chunk-E2UCDP5S.js +0 -570
- package/dist/chunk-E6K4NIEU.js +0 -747
- package/dist/chunk-E6K4NIEU.js.map +0 -1
- package/dist/chunk-EEQLFRUM.js +0 -89
- package/dist/chunk-ETOW6ACV.js +0 -158
- package/dist/chunk-ETOW6ACV.js.map +0 -1
- package/dist/chunk-FMEBPEAO.js +0 -347
- package/dist/chunk-FMEBPEAO.js.map +0 -1
- package/dist/chunk-FQDPCE3I.js +0 -1837
- package/dist/chunk-FQDPCE3I.js.map +0 -1
- package/dist/chunk-FYIYMQ5N.js +0 -221
- package/dist/chunk-FYIYMQ5N.js.map +0 -1
- package/dist/chunk-G2WADRQ3.js +0 -219
- package/dist/chunk-G4SK7DSQ.js +0 -121
- package/dist/chunk-GVPWB7EY.js +0 -390
- package/dist/chunk-GVPWB7EY.js.map +0 -1
- package/dist/chunk-HELQZFZO.js +0 -1075
- package/dist/chunk-HL5LRPNA.js +0 -1914
- package/dist/chunk-HL5LRPNA.js.map +0 -1
- package/dist/chunk-HQZVVSVB.js +0 -147
- package/dist/chunk-HQZVVSVB.js.map +0 -1
- package/dist/chunk-HY3L4WKC.js +0 -2195
- package/dist/chunk-HY3L4WKC.js.map +0 -1
- package/dist/chunk-IB3BFHGN.js +0 -228
- package/dist/chunk-IXEJRKCZ.js +0 -18
- package/dist/chunk-JBMSGZEQ.js +0 -441
- package/dist/chunk-JBMSGZEQ.js.map +0 -1
- package/dist/chunk-JESOB2HO.js +0 -108
- package/dist/chunk-JKDVIE52.js +0 -272
- package/dist/chunk-JRNQ3RNA.js +0 -284
- package/dist/chunk-JRNQ3RNA.js.map +0 -1
- package/dist/chunk-K6WK37A6.js +0 -865
- package/dist/chunk-K6WK37A6.js.map +0 -1
- package/dist/chunk-MARWOCVP.js +0 -48
- package/dist/chunk-MNU6ZBWT.js +0 -4454
- package/dist/chunk-MNU6ZBWT.js.map +0 -1
- package/dist/chunk-N5AKDXAI.js +0 -74
- package/dist/chunk-OA3L7BFR.js +0 -183
- package/dist/chunk-OA3L7BFR.js.map +0 -1
- package/dist/chunk-OR64ZGRZ.js +0 -23
- package/dist/chunk-P77UEOU2.js +0 -1521
- package/dist/chunk-P77UEOU2.js.map +0 -1
- package/dist/chunk-PH4C2U43.js +0 -239
- package/dist/chunk-PH4C2U43.js.map +0 -1
- package/dist/chunk-RVPLBATS.js +0 -1586
- package/dist/chunk-RVPLBATS.js.map +0 -1
- package/dist/chunk-U5JMRGKX.js +0 -340
- package/dist/chunk-U5JMRGKX.js.map +0 -1
- package/dist/chunk-URB2WSKZ.js +0 -350
- package/dist/chunk-URB2WSKZ.js.map +0 -1
- package/dist/chunk-UVMUAWVT.js +0 -596
- package/dist/chunk-WEJG4TB5.js +0 -118
- package/dist/chunk-X7HPGUVG.js +0 -271
- package/dist/chunk-XAMBKFQS.js +0 -2777
- package/dist/chunk-XAMBKFQS.js.map +0 -1
- package/dist/chunk-XJKFSSDW.js +0 -726
- package/dist/chunk-XJKFSSDW.js.map +0 -1
- package/dist/chunk-XMHBH5H6.js +0 -283
- package/dist/chunk-XMHBH5H6.js.map +0 -1
- package/dist/chunk-XMVFHBHT.js +0 -277
- package/dist/chunk-Y3VMVTYX.js +0 -53
- package/dist/chunk-YNB73F22.js +0 -137
- package/dist/chunk-YNB73F22.js.map +0 -1
- package/dist/chunk-Z2E7VW55.js +0 -335
- package/dist/chunk-Z2E7VW55.js.map +0 -1
- package/dist/chunk-ZG7PTKBK.js +0 -2296
- package/dist/chunk-ZNQN6ZTA.js +0 -135
- package/dist/chunk-ZVTKDVVM.js +0 -827
- package/dist/chunk-ZVTKDVVM.js.map +0 -1
- package/dist/cli-BR8KpIU0.d.ts +0 -1259
- package/dist/codex-materialize-CQlLTzke.d.ts +0 -139
- package/dist/connectors-cli-DFGtY2DB.d.ts +0 -257
- package/dist/contradiction-review-5LTTVDQV.js +0 -22
- package/dist/contradiction-scan-QTXAMBUA.js +0 -414
- package/dist/contradiction-scan-QTXAMBUA.js.map +0 -1
- package/dist/engine-35M5BKQ7.js +0 -28
- package/dist/fs-utils-IRVUFB6G.js +0 -30
- package/dist/graph-edge-decay-PWB63GRE.js +0 -207
- package/dist/memory-governance-IMPQZXFC.js +0 -37
- package/dist/memory-projection-store-CY8TU40w.d.ts +0 -222
- package/dist/orchestrator-DDMPqU6R.d.ts +0 -1792
- package/dist/path-RMTY5Y5A.js +0 -9
- package/dist/port-B6VEDIkC.d.ts +0 -53
- package/dist/resolution-YGIBORXI.js +0 -101
- package/dist/resolution-YGIBORXI.js.map +0 -1
- package/dist/secure-store-4R2GSO7S.js +0 -156
- package/dist/semantic-consolidation-ByBXb-sf.d.ts +0 -180
- package/dist/state-store-3EH7HYIN.js +0 -16
- package/dist/types-V3FJ26TF.js +0 -30
- /package/dist/{capsule-crypto-SJS5VVAP.js.map → adapters/claude-code.js.map} +0 -0
- /package/dist/{capsule-export-7QNCBZOQ.js.map → adapters/codex.js.map} +0 -0
- /package/dist/{capsule-import-EPBHD2EN.js.map → adapters/hermes.js.map} +0 -0
- /package/dist/{contradiction-review-5LTTVDQV.js.map → adapters/index.js.map} +0 -0
- /package/dist/{engine-35M5BKQ7.js.map → adapters/registry.js.map} +0 -0
- /package/dist/{fs-utils-IRVUFB6G.js.map → adapters/replit.js.map} +0 -0
- /package/dist/{memory-governance-IMPQZXFC.js.map → adapters/types.js.map} +0 -0
- /package/dist/{path-RMTY5Y5A.js.map → capsule-crypto-5CYAGVC5.js.map} +0 -0
- /package/dist/{capsule-merge-DI7PNQ2H.js.map → capsule-merge-4MGKE7C5.js.map} +0 -0
- /package/dist/{chunk-G4SK7DSQ.js.map → chunk-2WWLHTZY.js.map} +0 -0
- /package/dist/{chunk-X7HPGUVG.js.map → chunk-4CRG46BG.js.map} +0 -0
- /package/dist/{chunk-UVMUAWVT.js.map → chunk-7IASACLB.js.map} +0 -0
- /package/dist/{chunk-HELQZFZO.js.map → chunk-EDTHC6UD.js.map} +0 -0
- /package/dist/{chunk-4YM32CRU.js.map → chunk-EFJ3MQ4V.js.map} +0 -0
- /package/dist/{chunk-E2UCDP5S.js.map → chunk-FBYESMQ2.js.map} +0 -0
- /package/dist/{chunk-D54LZC5L.js.map → chunk-FDU6HUUL.js.map} +0 -0
- /package/dist/{chunk-IB3BFHGN.js.map → chunk-GGKRUQOO.js.map} +0 -0
- /package/dist/{chunk-242S3I2A.js.map → chunk-GL6I6MEQ.js.map} +0 -0
- /package/dist/{secure-store-4R2GSO7S.js.map → chunk-HHLLAQGZ.js.map} +0 -0
- /package/dist/{chunk-4IS4SXIQ.js.map → chunk-HXXBL2KD.js.map} +0 -0
- /package/dist/{chunk-767ODGE6.js.map → chunk-KNKUID7G.js.map} +0 -0
- /package/dist/{chunk-6TBWYBJ3.js.map → chunk-LPMVBPA3.js.map} +0 -0
- /package/dist/{chunk-WEJG4TB5.js.map → chunk-MC26UJIM.js.map} +0 -0
- /package/dist/{chunk-JKDVIE52.js.map → chunk-MGKYQQYF.js.map} +0 -0
- /package/dist/{chunk-Y3VMVTYX.js.map → chunk-MT4HVDUZ.js.map} +0 -0
- /package/dist/{chunk-G2WADRQ3.js.map → chunk-MY6TPVXW.js.map} +0 -0
- /package/dist/{chunk-OR64ZGRZ.js.map → chunk-NNVTUXEB.js.map} +0 -0
- /package/dist/{chunk-JESOB2HO.js.map → chunk-P4NEIHUT.js.map} +0 -0
- /package/dist/{chunk-IXEJRKCZ.js.map → chunk-QRNI5JBH.js.map} +0 -0
- /package/dist/{chunk-EEQLFRUM.js.map → chunk-RRF5UOBJ.js.map} +0 -0
- /package/dist/{state-store-3EH7HYIN.js.map → chunk-SEDEKFYQ.js.map} +0 -0
- /package/dist/{chunk-2LGMW3DJ.js.map → chunk-U3PN77QT.js.map} +0 -0
- /package/dist/{chunk-XMVFHBHT.js.map → chunk-U3WSW6PZ.js.map} +0 -0
- /package/dist/{chunk-N5AKDXAI.js.map → chunk-UWVJF25J.js.map} +0 -0
- /package/dist/{types-V3FJ26TF.js.map → chunk-V5OCT34X.js.map} +0 -0
- /package/dist/{chunk-ZG7PTKBK.js.map → chunk-W3LR522O.js.map} +0 -0
- /package/dist/{chunk-MARWOCVP.js.map → chunk-XIG5PDM7.js.map} +0 -0
- /package/dist/{chunk-ZNQN6ZTA.js.map → chunk-XVZ7B3HG.js.map} +0 -0
- /package/dist/{graph-edge-decay-PWB63GRE.js.map → graph-edge-decay-5DI5GUNL.js.map} +0 -0
package/dist/chunk-FQDPCE3I.js
DELETED
|
@@ -1,1837 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
StorageManager
|
|
3
|
-
} from "./chunk-3B6KIRBH.js";
|
|
4
|
-
import {
|
|
5
|
-
parseContinuityImprovementLoops
|
|
6
|
-
} from "./chunk-QSVPYQPG.js";
|
|
7
|
-
import {
|
|
8
|
-
sanitizeMemoryContent
|
|
9
|
-
} from "./chunk-FVQJYWH7.js";
|
|
10
|
-
import {
|
|
11
|
-
expandTildePath
|
|
12
|
-
} from "./chunk-IXEJRKCZ.js";
|
|
13
|
-
import {
|
|
14
|
-
log
|
|
15
|
-
} from "./chunk-2ODBA7MQ.js";
|
|
16
|
-
|
|
17
|
-
// src/compounding/engine.ts
|
|
18
|
-
import { createHash } from "crypto";
|
|
19
|
-
import { mkdir as mkdir2, readFile as readFile2, readdir as readdir2, unlink, writeFile as writeFile2 } from "fs/promises";
|
|
20
|
-
import path2 from "path";
|
|
21
|
-
|
|
22
|
-
// src/shared-context/manager.ts
|
|
23
|
-
import { mkdir, readFile, readdir, appendFile, writeFile, stat } from "fs/promises";
|
|
24
|
-
import path from "path";
|
|
25
|
-
import { z } from "zod";
|
|
26
|
-
var SharedFeedbackEntrySchema = z.object({
|
|
27
|
-
agent: z.string().min(1),
|
|
28
|
-
decision: z.enum(["approved", "approved_with_feedback", "rejected"]),
|
|
29
|
-
reason: z.string().min(1),
|
|
30
|
-
date: z.string().min(8),
|
|
31
|
-
// ISO-ish; keep loose
|
|
32
|
-
learning: z.string().optional(),
|
|
33
|
-
outcome: z.string().optional(),
|
|
34
|
-
severity: z.enum(["low", "medium", "high"]).optional(),
|
|
35
|
-
confidence: z.number().min(0).max(1).optional(),
|
|
36
|
-
workflow: z.string().min(1).optional(),
|
|
37
|
-
tags: z.array(z.string().min(1)).optional(),
|
|
38
|
-
evidenceWindowStart: z.string().min(8).optional(),
|
|
39
|
-
evidenceWindowEnd: z.string().min(8).optional(),
|
|
40
|
-
refs: z.array(z.string()).optional()
|
|
41
|
-
});
|
|
42
|
-
function safeSlug(s) {
|
|
43
|
-
let slug = s.toLowerCase().replace(/[^a-z0-9]+/g, "-");
|
|
44
|
-
let start = 0;
|
|
45
|
-
while (start < slug.length && slug[start] === "-") start++;
|
|
46
|
-
let end = slug.length;
|
|
47
|
-
while (end > start && slug[end - 1] === "-") end--;
|
|
48
|
-
return slug.slice(start, end).slice(0, 80) || "output";
|
|
49
|
-
}
|
|
50
|
-
function ymd(d) {
|
|
51
|
-
return d.toISOString().slice(0, 10);
|
|
52
|
-
}
|
|
53
|
-
var CROSS_SIGNAL_STOPWORDS = /* @__PURE__ */ new Set([
|
|
54
|
-
"a",
|
|
55
|
-
"an",
|
|
56
|
-
"and",
|
|
57
|
-
"are",
|
|
58
|
-
"as",
|
|
59
|
-
"at",
|
|
60
|
-
"be",
|
|
61
|
-
"by",
|
|
62
|
-
"for",
|
|
63
|
-
"from",
|
|
64
|
-
"has",
|
|
65
|
-
"have",
|
|
66
|
-
"in",
|
|
67
|
-
"is",
|
|
68
|
-
"it",
|
|
69
|
-
"of",
|
|
70
|
-
"on",
|
|
71
|
-
"or",
|
|
72
|
-
"that",
|
|
73
|
-
"the",
|
|
74
|
-
"this",
|
|
75
|
-
"to",
|
|
76
|
-
"was",
|
|
77
|
-
"were",
|
|
78
|
-
"with",
|
|
79
|
-
"agent",
|
|
80
|
-
"output",
|
|
81
|
-
"today",
|
|
82
|
-
"daily",
|
|
83
|
-
"notes",
|
|
84
|
-
"note",
|
|
85
|
-
"summary"
|
|
86
|
-
]);
|
|
87
|
-
function extractTopicTokens(text, maxTokens = 12) {
|
|
88
|
-
const seen = /* @__PURE__ */ new Set();
|
|
89
|
-
const out = [];
|
|
90
|
-
const tokens = text.toLowerCase().replace(/[^a-z0-9\s]/g, " ").split(/\s+/).map((token) => token.trim()).filter((token) => token.length >= 4).filter((token) => !CROSS_SIGNAL_STOPWORDS.has(token));
|
|
91
|
-
for (const token of tokens) {
|
|
92
|
-
if (seen.has(token)) continue;
|
|
93
|
-
seen.add(token);
|
|
94
|
-
out.push(token);
|
|
95
|
-
if (out.length >= maxTokens) break;
|
|
96
|
-
}
|
|
97
|
-
return out;
|
|
98
|
-
}
|
|
99
|
-
function stripYamlFrontmatter(text) {
|
|
100
|
-
if (!text.startsWith("---\n")) return text;
|
|
101
|
-
const closing = text.indexOf("\n---\n", 4);
|
|
102
|
-
if (closing === -1) return text;
|
|
103
|
-
return text.slice(closing + 5);
|
|
104
|
-
}
|
|
105
|
-
function semanticRoot(token) {
|
|
106
|
-
let root = token.toLowerCase();
|
|
107
|
-
if (root.endsWith("izations") && root.length > 9) {
|
|
108
|
-
root = `${root.slice(0, -8)}ize`;
|
|
109
|
-
} else if (root.endsWith("ization") && root.length > 8) {
|
|
110
|
-
root = `${root.slice(0, -7)}ize`;
|
|
111
|
-
} else if (root.endsWith("isations") && root.length > 9) {
|
|
112
|
-
root = `${root.slice(0, -8)}ise`;
|
|
113
|
-
} else if (root.endsWith("isation") && root.length > 8) {
|
|
114
|
-
root = `${root.slice(0, -7)}ise`;
|
|
115
|
-
} else {
|
|
116
|
-
const suffixes = [
|
|
117
|
-
"ations",
|
|
118
|
-
"ation",
|
|
119
|
-
"ments",
|
|
120
|
-
"ment",
|
|
121
|
-
"ingly",
|
|
122
|
-
"edly",
|
|
123
|
-
"ings",
|
|
124
|
-
"ing",
|
|
125
|
-
"ers",
|
|
126
|
-
"er",
|
|
127
|
-
"ies",
|
|
128
|
-
"ied",
|
|
129
|
-
"ions",
|
|
130
|
-
"ion",
|
|
131
|
-
"es",
|
|
132
|
-
"ed",
|
|
133
|
-
"s"
|
|
134
|
-
];
|
|
135
|
-
for (const suffix of suffixes) {
|
|
136
|
-
if (root.length > suffix.length + 3 && root.endsWith(suffix)) {
|
|
137
|
-
root = root.slice(0, -suffix.length);
|
|
138
|
-
break;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
if (root.length > 4 && root.endsWith("e")) {
|
|
143
|
-
root = root.slice(0, -1);
|
|
144
|
-
}
|
|
145
|
-
return root;
|
|
146
|
-
}
|
|
147
|
-
function mergeOverlaps(base, extra) {
|
|
148
|
-
const merged = /* @__PURE__ */ new Map();
|
|
149
|
-
for (const entry of [...base, ...extra]) {
|
|
150
|
-
const existing = merged.get(entry.token);
|
|
151
|
-
if (existing) {
|
|
152
|
-
for (const agent of entry.agents) existing.agents.add(agent);
|
|
153
|
-
for (const sourcePath of entry.sourcePaths) existing.sourcePaths.add(sourcePath);
|
|
154
|
-
} else {
|
|
155
|
-
merged.set(entry.token, {
|
|
156
|
-
agents: new Set(entry.agents),
|
|
157
|
-
sourcePaths: new Set(entry.sourcePaths)
|
|
158
|
-
});
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
return [...merged.entries()].map(([token, value]) => ({
|
|
162
|
-
token,
|
|
163
|
-
agents: [...value.agents].sort(),
|
|
164
|
-
sourcePaths: [...value.sourcePaths].sort(),
|
|
165
|
-
agentCount: value.agents.size
|
|
166
|
-
})).filter((entry) => entry.agentCount >= 2).sort((a, b) => b.agentCount - a.agentCount || a.token.localeCompare(b.token));
|
|
167
|
-
}
|
|
168
|
-
async function computeSemanticOverlapCandidates(sources, maxCandidates, timeoutAtMs) {
|
|
169
|
-
const tokenRows = [];
|
|
170
|
-
for (const source of sources) {
|
|
171
|
-
for (const token of source.topics) {
|
|
172
|
-
if (Date.now() >= timeoutAtMs) return { overlaps: [], candidateCount: tokenRows.length, timedOut: true };
|
|
173
|
-
await new Promise((resolve) => setImmediate(resolve));
|
|
174
|
-
tokenRows.push({ token, agent: source.agent, path: source.path });
|
|
175
|
-
if (tokenRows.length >= maxCandidates) break;
|
|
176
|
-
}
|
|
177
|
-
if (tokenRows.length >= maxCandidates) break;
|
|
178
|
-
}
|
|
179
|
-
const byRoot = /* @__PURE__ */ new Map();
|
|
180
|
-
for (const row of tokenRows) {
|
|
181
|
-
if (Date.now() >= timeoutAtMs) return { overlaps: [], candidateCount: tokenRows.length, timedOut: true };
|
|
182
|
-
await new Promise((resolve) => setImmediate(resolve));
|
|
183
|
-
const root = semanticRoot(row.token);
|
|
184
|
-
if (root.length < 4) continue;
|
|
185
|
-
const rootGroup = byRoot.get(root) ?? /* @__PURE__ */ new Map();
|
|
186
|
-
const tokenGroup = rootGroup.get(row.token) ?? { agents: /* @__PURE__ */ new Set(), paths: /* @__PURE__ */ new Set() };
|
|
187
|
-
tokenGroup.agents.add(row.agent);
|
|
188
|
-
tokenGroup.paths.add(row.path);
|
|
189
|
-
rootGroup.set(row.token, tokenGroup);
|
|
190
|
-
byRoot.set(root, rootGroup);
|
|
191
|
-
}
|
|
192
|
-
const overlaps = [];
|
|
193
|
-
for (const [root, tokenMap] of byRoot.entries()) {
|
|
194
|
-
if (Date.now() >= timeoutAtMs) return { overlaps: [], candidateCount: tokenRows.length, timedOut: true };
|
|
195
|
-
await new Promise((resolve) => setImmediate(resolve));
|
|
196
|
-
if (tokenMap.size < 2) continue;
|
|
197
|
-
const agents = /* @__PURE__ */ new Set();
|
|
198
|
-
const sourcePaths = /* @__PURE__ */ new Set();
|
|
199
|
-
for (const value of tokenMap.values()) {
|
|
200
|
-
for (const agent of value.agents) agents.add(agent);
|
|
201
|
-
for (const sourcePath of value.paths) sourcePaths.add(sourcePath);
|
|
202
|
-
}
|
|
203
|
-
if (agents.size < 2) continue;
|
|
204
|
-
overlaps.push({
|
|
205
|
-
token: `semantic:${root}`,
|
|
206
|
-
agents: [...agents].sort(),
|
|
207
|
-
sourcePaths: [...sourcePaths].sort(),
|
|
208
|
-
agentCount: agents.size
|
|
209
|
-
});
|
|
210
|
-
}
|
|
211
|
-
overlaps.sort((a, b) => b.agentCount - a.agentCount || a.token.localeCompare(b.token));
|
|
212
|
-
return {
|
|
213
|
-
overlaps,
|
|
214
|
-
candidateCount: tokenRows.length,
|
|
215
|
-
timedOut: false
|
|
216
|
-
};
|
|
217
|
-
}
|
|
218
|
-
async function computeSemanticOverlapsWithTimeout(sources, timeoutMs, maxCandidates) {
|
|
219
|
-
const safeTimeoutMs = Math.max(1, Math.floor(timeoutMs));
|
|
220
|
-
const safeMaxCandidates = Math.max(0, Math.floor(maxCandidates));
|
|
221
|
-
if (safeMaxCandidates === 0 || sources.length === 0) {
|
|
222
|
-
return { overlaps: [], candidateCount: 0, timedOut: false };
|
|
223
|
-
}
|
|
224
|
-
const timeoutAtMs = Date.now() + safeTimeoutMs;
|
|
225
|
-
return computeSemanticOverlapCandidates(sources, safeMaxCandidates, timeoutAtMs);
|
|
226
|
-
}
|
|
227
|
-
function feedbackDecisionPriority(decision) {
|
|
228
|
-
switch (decision) {
|
|
229
|
-
case "rejected":
|
|
230
|
-
return 3;
|
|
231
|
-
case "approved_with_feedback":
|
|
232
|
-
return 2;
|
|
233
|
-
case "approved":
|
|
234
|
-
return 1;
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
function feedbackSeverityPriority(severity) {
|
|
238
|
-
switch (severity) {
|
|
239
|
-
case "high":
|
|
240
|
-
return 3;
|
|
241
|
-
case "medium":
|
|
242
|
-
return 2;
|
|
243
|
-
case "low":
|
|
244
|
-
return 1;
|
|
245
|
-
default:
|
|
246
|
-
return 0;
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
function compareFeedbackPriority(a, b) {
|
|
250
|
-
return feedbackDecisionPriority(b.decision) - feedbackDecisionPriority(a.decision) || feedbackSeverityPriority(b.severity) - feedbackSeverityPriority(a.severity) || a.date.localeCompare(b.date);
|
|
251
|
-
}
|
|
252
|
-
function formatFeedbackLine(entry) {
|
|
253
|
-
const extras = [`feedback: ${entry.date}`];
|
|
254
|
-
if (entry.severity) extras.push(`severity: ${entry.severity}`);
|
|
255
|
-
if (entry.refs?.length) extras.push(`refs: ${entry.refs.join(", ")}`);
|
|
256
|
-
return `- [${entry.agent}] ${entry.decision}: ${entry.reason} [${extras.join("; ")}]`;
|
|
257
|
-
}
|
|
258
|
-
function formatOverlapLine(entry) {
|
|
259
|
-
return `- \`${entry.token}\` (${entry.agentCount} agents: ${entry.agents.join(", ")}) [sources: ${entry.sourcePaths.join(", ")}]`;
|
|
260
|
-
}
|
|
261
|
-
function resolveSharedContextDir(config) {
|
|
262
|
-
return typeof config.sharedContextDir === "string" && config.sharedContextDir.length > 0 ? expandTildePath(config.sharedContextDir) : path.join(expandTildePath(config.workspaceDir), "shared-context");
|
|
263
|
-
}
|
|
264
|
-
var SharedContextManager = class {
|
|
265
|
-
constructor(config) {
|
|
266
|
-
this.config = config;
|
|
267
|
-
const base = resolveSharedContextDir(config);
|
|
268
|
-
this.dir = base;
|
|
269
|
-
this.prioritiesPath = path.join(base, "priorities.md");
|
|
270
|
-
this.prioritiesInboxPath = path.join(base, "priorities.inbox.md");
|
|
271
|
-
this.outputsDir = path.join(base, "agent-outputs");
|
|
272
|
-
this.roundtableDir = path.join(base, "roundtable");
|
|
273
|
-
this.feedbackDir = path.join(base, "feedback");
|
|
274
|
-
this.feedbackInboxPath = path.join(this.feedbackDir, "inbox.jsonl");
|
|
275
|
-
this.crossSignalsDir = path.join(base, "cross-signals");
|
|
276
|
-
}
|
|
277
|
-
config;
|
|
278
|
-
dir;
|
|
279
|
-
prioritiesPath;
|
|
280
|
-
prioritiesInboxPath;
|
|
281
|
-
outputsDir;
|
|
282
|
-
roundtableDir;
|
|
283
|
-
feedbackDir;
|
|
284
|
-
feedbackInboxPath;
|
|
285
|
-
crossSignalsDir;
|
|
286
|
-
async ensureStructure() {
|
|
287
|
-
await mkdir(this.dir, { recursive: true });
|
|
288
|
-
await mkdir(this.outputsDir, { recursive: true });
|
|
289
|
-
await mkdir(this.roundtableDir, { recursive: true });
|
|
290
|
-
await mkdir(this.feedbackDir, { recursive: true });
|
|
291
|
-
await mkdir(this.crossSignalsDir, { recursive: true });
|
|
292
|
-
await mkdir(path.join(this.dir, "staging"), { recursive: true });
|
|
293
|
-
await mkdir(path.join(this.dir, "kpis"), { recursive: true });
|
|
294
|
-
await mkdir(path.join(this.dir, "calendar"), { recursive: true });
|
|
295
|
-
await mkdir(path.join(this.dir, "content-calendar"), { recursive: true });
|
|
296
|
-
await this.ensureFile(
|
|
297
|
-
this.prioritiesPath,
|
|
298
|
-
[
|
|
299
|
-
"# Priorities",
|
|
300
|
-
"",
|
|
301
|
-
"This is the shared priority stack. Agents should read this before acting.",
|
|
302
|
-
"",
|
|
303
|
-
"## Current",
|
|
304
|
-
"- (empty)",
|
|
305
|
-
"",
|
|
306
|
-
"## Notes",
|
|
307
|
-
"- (empty)",
|
|
308
|
-
""
|
|
309
|
-
].join("\n")
|
|
310
|
-
);
|
|
311
|
-
await this.ensureFile(
|
|
312
|
-
this.prioritiesInboxPath,
|
|
313
|
-
[
|
|
314
|
-
"# Priorities Inbox",
|
|
315
|
-
"",
|
|
316
|
-
"Append-only inbox. Curator merges into priorities.md.",
|
|
317
|
-
""
|
|
318
|
-
].join("\n")
|
|
319
|
-
);
|
|
320
|
-
await this.ensureFile(this.feedbackInboxPath, "");
|
|
321
|
-
}
|
|
322
|
-
async ensureFile(fp, content) {
|
|
323
|
-
try {
|
|
324
|
-
await stat(fp);
|
|
325
|
-
} catch {
|
|
326
|
-
await writeFile(fp, content, "utf-8");
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
async readPriorities() {
|
|
330
|
-
try {
|
|
331
|
-
return await readFile(this.prioritiesPath, "utf-8");
|
|
332
|
-
} catch {
|
|
333
|
-
return "";
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
async readLatestRoundtable() {
|
|
337
|
-
try {
|
|
338
|
-
const files = (await readdir(this.roundtableDir)).filter((f) => f.endsWith(".md")).sort().reverse();
|
|
339
|
-
const fp = files[0] ? path.join(this.roundtableDir, files[0]) : null;
|
|
340
|
-
if (!fp) return "";
|
|
341
|
-
return await readFile(fp, "utf-8");
|
|
342
|
-
} catch {
|
|
343
|
-
return "";
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
async readLatestCrossSignals() {
|
|
347
|
-
try {
|
|
348
|
-
const files = (await readdir(this.crossSignalsDir)).filter((f) => f.endsWith(".md")).sort().reverse();
|
|
349
|
-
const fp = files[0] ? path.join(this.crossSignalsDir, files[0]) : null;
|
|
350
|
-
if (!fp) return "";
|
|
351
|
-
return await readFile(fp, "utf-8");
|
|
352
|
-
} catch {
|
|
353
|
-
return "";
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
async writeAgentOutput(opts) {
|
|
357
|
-
const createdAt = opts.createdAt ?? /* @__PURE__ */ new Date();
|
|
358
|
-
const date = ymd(createdAt);
|
|
359
|
-
const time = createdAt.toISOString().slice(11, 19).replace(/:/g, "");
|
|
360
|
-
const slug = safeSlug(opts.title);
|
|
361
|
-
const dir = path.join(this.outputsDir, opts.agentId, date);
|
|
362
|
-
await mkdir(dir, { recursive: true });
|
|
363
|
-
const fp = path.join(dir, `${time}-${slug}.md`);
|
|
364
|
-
const body = `---
|
|
365
|
-
kind: agent_output
|
|
366
|
-
agent: ${opts.agentId}
|
|
367
|
-
createdAt: ${createdAt.toISOString()}
|
|
368
|
-
title: ${opts.title.replace(/\n/g, " ").slice(0, 200)}
|
|
369
|
-
---
|
|
370
|
-
|
|
371
|
-
` + opts.content.trimEnd() + "\n";
|
|
372
|
-
await writeFile(fp, body, "utf-8");
|
|
373
|
-
return fp;
|
|
374
|
-
}
|
|
375
|
-
async appendFeedback(entry) {
|
|
376
|
-
const parsed = SharedFeedbackEntrySchema.parse(entry);
|
|
377
|
-
await appendFile(this.feedbackInboxPath, JSON.stringify(parsed) + "\n", "utf-8");
|
|
378
|
-
}
|
|
379
|
-
async appendPrioritiesInbox(opts) {
|
|
380
|
-
const stamp = (/* @__PURE__ */ new Date()).toISOString();
|
|
381
|
-
const lines = [
|
|
382
|
-
"",
|
|
383
|
-
`## ${stamp} (${opts.agentId})`,
|
|
384
|
-
"",
|
|
385
|
-
opts.text.trimEnd(),
|
|
386
|
-
""
|
|
387
|
-
].join("\n");
|
|
388
|
-
await appendFile(this.prioritiesInboxPath, lines, "utf-8");
|
|
389
|
-
}
|
|
390
|
-
async synthesizeCrossSignals(opts) {
|
|
391
|
-
const date = opts.date ?? ymd(/* @__PURE__ */ new Date());
|
|
392
|
-
const maxSummaryItems = Math.max(1, opts.maxSummaryItems ?? 8);
|
|
393
|
-
const outputs = [];
|
|
394
|
-
try {
|
|
395
|
-
const agents = await readdir(this.outputsDir, { withFileTypes: true });
|
|
396
|
-
for (const a of agents) {
|
|
397
|
-
if (!a.isDirectory()) continue;
|
|
398
|
-
const dayDir = path.join(this.outputsDir, a.name, date);
|
|
399
|
-
try {
|
|
400
|
-
const files = (await readdir(dayDir)).filter((f) => f.endsWith(".md")).sort();
|
|
401
|
-
for (const f of files) {
|
|
402
|
-
const p = path.join(dayDir, f);
|
|
403
|
-
const raw = await readFile(p, "utf-8");
|
|
404
|
-
const title = (raw.match(/^title:\s*(.+)$/m)?.[1] ?? f).trim();
|
|
405
|
-
outputs.push({ agent: a.name, path: p, title, raw });
|
|
406
|
-
}
|
|
407
|
-
} catch {
|
|
408
|
-
}
|
|
409
|
-
}
|
|
410
|
-
} catch {
|
|
411
|
-
}
|
|
412
|
-
const feedback = [];
|
|
413
|
-
try {
|
|
414
|
-
const raw = await readFile(this.feedbackInboxPath, "utf-8");
|
|
415
|
-
for (const line of raw.split("\n")) {
|
|
416
|
-
if (!line.trim()) continue;
|
|
417
|
-
try {
|
|
418
|
-
const obj = JSON.parse(line);
|
|
419
|
-
const parsed = SharedFeedbackEntrySchema.safeParse(obj);
|
|
420
|
-
if (!parsed.success) continue;
|
|
421
|
-
if (String(parsed.data.date).startsWith(date)) feedback.push(parsed.data);
|
|
422
|
-
} catch {
|
|
423
|
-
}
|
|
424
|
-
}
|
|
425
|
-
} catch {
|
|
426
|
-
}
|
|
427
|
-
const sources = outputs.map((output) => {
|
|
428
|
-
const body = stripYamlFrontmatter(output.raw);
|
|
429
|
-
return {
|
|
430
|
-
agent: output.agent,
|
|
431
|
-
path: output.path,
|
|
432
|
-
title: output.title,
|
|
433
|
-
topics: extractTopicTokens(`${output.title}
|
|
434
|
-
${body}`)
|
|
435
|
-
};
|
|
436
|
-
});
|
|
437
|
-
const overlapMap = /* @__PURE__ */ new Map();
|
|
438
|
-
for (const source of sources) {
|
|
439
|
-
for (const token of source.topics) {
|
|
440
|
-
const existing = overlapMap.get(token);
|
|
441
|
-
if (existing) {
|
|
442
|
-
existing.agents.add(source.agent);
|
|
443
|
-
existing.sourcePaths.add(source.path);
|
|
444
|
-
} else {
|
|
445
|
-
overlapMap.set(token, {
|
|
446
|
-
agents: /* @__PURE__ */ new Set([source.agent]),
|
|
447
|
-
sourcePaths: /* @__PURE__ */ new Set([source.path])
|
|
448
|
-
});
|
|
449
|
-
}
|
|
450
|
-
}
|
|
451
|
-
}
|
|
452
|
-
const overlaps = [...overlapMap.entries()].map(([token, v]) => ({
|
|
453
|
-
token,
|
|
454
|
-
agents: [...v.agents].sort(),
|
|
455
|
-
sourcePaths: [...v.sourcePaths].sort(),
|
|
456
|
-
agentCount: v.agents.size
|
|
457
|
-
})).filter((entry) => entry.agentCount >= 2).sort((a, b) => b.agentCount - a.agentCount || a.token.localeCompare(b.token));
|
|
458
|
-
const semanticEnabled = this.config.sharedCrossSignalSemanticEnabled === true || this.config.crossSignalsSemanticEnabled === true;
|
|
459
|
-
const semanticTimeoutMs = this.config.sharedCrossSignalSemanticTimeoutMs ?? this.config.crossSignalsSemanticTimeoutMs ?? 4e3;
|
|
460
|
-
const semanticMaxCandidates = this.config.sharedCrossSignalSemanticMaxCandidates ?? 120;
|
|
461
|
-
let semanticApplied = false;
|
|
462
|
-
let semanticTimedOut = false;
|
|
463
|
-
let semanticCandidateCount = 0;
|
|
464
|
-
let semanticAddedOverlapCount = 0;
|
|
465
|
-
let mergedOverlaps = overlaps;
|
|
466
|
-
if (semanticEnabled) {
|
|
467
|
-
try {
|
|
468
|
-
const semanticResult = await computeSemanticOverlapsWithTimeout(
|
|
469
|
-
sources,
|
|
470
|
-
semanticTimeoutMs,
|
|
471
|
-
semanticMaxCandidates
|
|
472
|
-
);
|
|
473
|
-
semanticTimedOut = semanticResult.timedOut;
|
|
474
|
-
semanticCandidateCount = semanticResult.candidateCount;
|
|
475
|
-
if (!semanticResult.timedOut && semanticResult.overlaps.length > 0) {
|
|
476
|
-
mergedOverlaps = mergeOverlaps(overlaps, semanticResult.overlaps);
|
|
477
|
-
semanticAddedOverlapCount = Math.max(0, mergedOverlaps.length - overlaps.length);
|
|
478
|
-
semanticApplied = semanticAddedOverlapCount > 0;
|
|
479
|
-
}
|
|
480
|
-
} catch (err) {
|
|
481
|
-
log.warn(`shared-context semantic cross-signals failed; fail-open to deterministic output: ${err}`);
|
|
482
|
-
}
|
|
483
|
-
}
|
|
484
|
-
const feedbackByDecision = {
|
|
485
|
-
approved: 0,
|
|
486
|
-
approved_with_feedback: 0,
|
|
487
|
-
rejected: 0
|
|
488
|
-
};
|
|
489
|
-
for (const entry of feedback) {
|
|
490
|
-
feedbackByDecision[entry.decision] += 1;
|
|
491
|
-
}
|
|
492
|
-
const report = {
|
|
493
|
-
date,
|
|
494
|
-
generatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
495
|
-
sourceCount: sources.length,
|
|
496
|
-
feedbackCount: feedback.length,
|
|
497
|
-
feedbackByDecision,
|
|
498
|
-
feedbackEntries: [...feedback].sort(compareFeedbackPriority),
|
|
499
|
-
sources,
|
|
500
|
-
overlaps: mergedOverlaps,
|
|
501
|
-
semantic: {
|
|
502
|
-
enabled: semanticEnabled,
|
|
503
|
-
applied: semanticApplied,
|
|
504
|
-
timedOut: semanticTimedOut,
|
|
505
|
-
candidateCount: semanticCandidateCount,
|
|
506
|
-
maxCandidates: Math.max(0, Math.floor(semanticMaxCandidates)),
|
|
507
|
-
addedOverlapCount: semanticAddedOverlapCount
|
|
508
|
-
}
|
|
509
|
-
};
|
|
510
|
-
const crossSignalsPath = path.join(this.crossSignalsDir, `${date}.json`);
|
|
511
|
-
await writeFile(crossSignalsPath, `${JSON.stringify(report, null, 2)}
|
|
512
|
-
`, "utf-8");
|
|
513
|
-
const recurringThemeLines = mergedOverlaps.length === 0 ? ["- No multi-agent topic overlap detected."] : mergedOverlaps.slice(0, maxSummaryItems).map((entry) => formatOverlapLine(entry));
|
|
514
|
-
const riskSignals = [...feedback].filter((entry) => entry.decision !== "approved" || entry.severity === "high" || entry.severity === "medium").sort(compareFeedbackPriority).slice(0, maxSummaryItems);
|
|
515
|
-
const riskLines = riskSignals.length === 0 ? ["- No explicit blockers or elevated review risks recorded."] : riskSignals.map((entry) => formatFeedbackLine(entry));
|
|
516
|
-
const promotionCandidates = mergedOverlaps.filter((entry) => entry.agentCount >= 3).slice(0, maxSummaryItems);
|
|
517
|
-
const promotionLines = promotionCandidates.length === 0 ? ["- No promotion candidates yet."] : promotionCandidates.map(
|
|
518
|
-
(entry) => `- Consider promoting \`${entry.token}\` into priorities or operating rules [sources: ${entry.sourcePaths.join(", ")}]`
|
|
519
|
-
);
|
|
520
|
-
const crossSignalsMarkdown = [
|
|
521
|
-
`# Cross-Signals \u2014 ${date}`,
|
|
522
|
-
"",
|
|
523
|
-
"## Overview",
|
|
524
|
-
`- Source outputs analyzed: ${sources.length}`,
|
|
525
|
-
`- Feedback entries analyzed: ${feedback.length}`,
|
|
526
|
-
`- Decision totals: approved=${feedbackByDecision.approved}, approved_with_feedback=${feedbackByDecision.approved_with_feedback}, rejected=${feedbackByDecision.rejected}`,
|
|
527
|
-
`- Semantic enhancer: ${semanticEnabled ? semanticTimedOut ? "enabled (timed out, fail-open)" : semanticApplied ? "enabled (applied)" : "enabled (no additional overlaps)" : "disabled"}`,
|
|
528
|
-
`- JSON report: ${crossSignalsPath}`,
|
|
529
|
-
"",
|
|
530
|
-
"## Recurring Themes",
|
|
531
|
-
...recurringThemeLines,
|
|
532
|
-
"",
|
|
533
|
-
"## Risks And Blockers",
|
|
534
|
-
...riskLines,
|
|
535
|
-
"",
|
|
536
|
-
"## Potential Promotions",
|
|
537
|
-
...promotionLines,
|
|
538
|
-
"",
|
|
539
|
-
"## Sources",
|
|
540
|
-
...sources.length === 0 ? ["- (none)"] : sources.map(
|
|
541
|
-
(source) => `- [${source.agent}] ${source.title} (${source.path})`
|
|
542
|
-
),
|
|
543
|
-
""
|
|
544
|
-
].join("\n");
|
|
545
|
-
const crossSignalsMarkdownPath = path.join(this.crossSignalsDir, `${date}.md`);
|
|
546
|
-
await writeFile(crossSignalsMarkdownPath, crossSignalsMarkdown, "utf-8");
|
|
547
|
-
return {
|
|
548
|
-
date,
|
|
549
|
-
crossSignalsPath,
|
|
550
|
-
crossSignalsMarkdownPath,
|
|
551
|
-
overlapCount: mergedOverlaps.length,
|
|
552
|
-
report
|
|
553
|
-
};
|
|
554
|
-
}
|
|
555
|
-
async curateDaily(opts) {
|
|
556
|
-
const date = opts.date ?? ymd(/* @__PURE__ */ new Date());
|
|
557
|
-
const maxChars = Math.max(2e3, opts.maxChars ?? 2e4);
|
|
558
|
-
const crossSignals = await this.synthesizeCrossSignals({ date });
|
|
559
|
-
const feedbackLines = crossSignals.report.feedbackEntries.length === 0 ? ["- (none)"] : crossSignals.report.feedbackEntries.map((entry) => formatFeedbackLine(entry));
|
|
560
|
-
const overlapBullets = crossSignals.report.overlaps.length === 0 ? ["- No multi-agent topic overlap detected."] : crossSignals.report.overlaps.slice(0, 8).map((entry) => formatOverlapLine(entry));
|
|
561
|
-
const md = [
|
|
562
|
-
`# Roundtable \u2014 ${date}`,
|
|
563
|
-
"",
|
|
564
|
-
"## Notable Agent Outputs",
|
|
565
|
-
...crossSignals.report.sources.length === 0 ? ["- (none)"] : crossSignals.report.sources.map((source) => `- ${source.title} (${source.path})`),
|
|
566
|
-
"",
|
|
567
|
-
"## Feedback (Approve/Reject)",
|
|
568
|
-
...feedbackLines,
|
|
569
|
-
"",
|
|
570
|
-
"## Cross-Signals",
|
|
571
|
-
`- Source outputs analyzed: ${crossSignals.report.sourceCount}`,
|
|
572
|
-
`- Feedback entries analyzed: ${crossSignals.report.feedbackCount}`,
|
|
573
|
-
`- Decision totals: approved=${crossSignals.report.feedbackByDecision.approved}, approved_with_feedback=${crossSignals.report.feedbackByDecision.approved_with_feedback}, rejected=${crossSignals.report.feedbackByDecision.rejected}`,
|
|
574
|
-
`- Semantic enhancer: ${crossSignals.report.semantic.enabled ? crossSignals.report.semantic.timedOut ? "enabled (timed out, fail-open)" : crossSignals.report.semantic.applied ? "enabled (applied)" : "enabled (no additional overlaps)" : "disabled"}`,
|
|
575
|
-
`- Cross-signals JSON: ${crossSignals.crossSignalsPath}`,
|
|
576
|
-
`- Cross-signals markdown: ${crossSignals.crossSignalsMarkdownPath}`,
|
|
577
|
-
...overlapBullets,
|
|
578
|
-
""
|
|
579
|
-
];
|
|
580
|
-
const out = md.join("\n");
|
|
581
|
-
const trimmed = out.length > maxChars ? out.slice(0, maxChars) + "\n\n...(trimmed)\n" : out;
|
|
582
|
-
const roundtablePath = path.join(this.roundtableDir, `${date}.md`);
|
|
583
|
-
await writeFile(roundtablePath, trimmed, "utf-8");
|
|
584
|
-
log.info(`shared-context curated daily roundtable: ${roundtablePath}`);
|
|
585
|
-
return {
|
|
586
|
-
date,
|
|
587
|
-
roundtablePath,
|
|
588
|
-
crossSignalsPath: crossSignals.crossSignalsPath,
|
|
589
|
-
crossSignalsMarkdownPath: crossSignals.crossSignalsMarkdownPath,
|
|
590
|
-
overlapCount: crossSignals.overlapCount
|
|
591
|
-
};
|
|
592
|
-
}
|
|
593
|
-
};
|
|
594
|
-
|
|
595
|
-
// src/compounding/engine.ts
|
|
596
|
-
var COMPOUNDING_VERSION = 2;
|
|
597
|
-
var RETIREMENT_WINDOW_WEEKS = 8;
|
|
598
|
-
function stableSlug(value) {
|
|
599
|
-
return value.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 80) || "item";
|
|
600
|
-
}
|
|
601
|
-
function tokenizeRecallQuery(text) {
|
|
602
|
-
const seen = /* @__PURE__ */ new Set();
|
|
603
|
-
const out = [];
|
|
604
|
-
for (const token of text.toLowerCase().replace(/[^a-z0-9\s]+/g, " ").split(/\s+/).map((part) => part.trim()).filter((part) => part.length >= 3)) {
|
|
605
|
-
if (seen.has(token)) continue;
|
|
606
|
-
seen.add(token);
|
|
607
|
-
out.push(token);
|
|
608
|
-
}
|
|
609
|
-
return out;
|
|
610
|
-
}
|
|
611
|
-
function weekIdToIndex(weekId) {
|
|
612
|
-
const match = weekId.match(/^(\d{4})-W(\d{2})$/);
|
|
613
|
-
if (!match) return Number.POSITIVE_INFINITY;
|
|
614
|
-
const year = Number(match[1]);
|
|
615
|
-
const week = Number(match[2]);
|
|
616
|
-
if (!Number.isInteger(year) || !Number.isInteger(week) || week < 1 || week > 53) {
|
|
617
|
-
return Number.POSITIVE_INFINITY;
|
|
618
|
-
}
|
|
619
|
-
const jan4 = new Date(Date.UTC(year, 0, 4));
|
|
620
|
-
const jan4Day = jan4.getUTCDay() || 7;
|
|
621
|
-
const isoWeekOneStart = new Date(jan4);
|
|
622
|
-
isoWeekOneStart.setUTCDate(jan4.getUTCDate() - (jan4Day - 1));
|
|
623
|
-
const targetWeekStart = new Date(isoWeekOneStart);
|
|
624
|
-
targetWeekStart.setUTCDate(isoWeekOneStart.getUTCDate() + (week - 1) * 7);
|
|
625
|
-
return Math.floor(targetWeekStart.getTime() / (7 * 24 * 60 * 60 * 1e3));
|
|
626
|
-
}
|
|
627
|
-
function normalizeConfidence(value) {
|
|
628
|
-
if (typeof value !== "number" || !Number.isFinite(value)) return null;
|
|
629
|
-
const clamped = Math.max(0, Math.min(1, value));
|
|
630
|
-
return Number(clamped.toFixed(3));
|
|
631
|
-
}
|
|
632
|
-
function normalizeTags(tags) {
|
|
633
|
-
if (!Array.isArray(tags)) return [];
|
|
634
|
-
return [...new Set(tags.map((tag) => String(tag).trim()).filter((tag) => tag.length > 0))].sort();
|
|
635
|
-
}
|
|
636
|
-
function normalizeEvidenceWindow(start, end) {
|
|
637
|
-
const safeStart = typeof start === "string" && start.trim().length > 0 ? start : null;
|
|
638
|
-
const safeEnd = typeof end === "string" && end.trim().length > 0 ? end : null;
|
|
639
|
-
return { start: safeStart, end: safeEnd };
|
|
640
|
-
}
|
|
641
|
-
function mergeEvidenceWindows(current, next) {
|
|
642
|
-
return {
|
|
643
|
-
start: current.start === null ? next.start : next.start === null ? current.start : current.start <= next.start ? current.start : next.start,
|
|
644
|
-
end: current.end === null ? next.end : next.end === null ? current.end : current.end >= next.end ? current.end : next.end
|
|
645
|
-
};
|
|
646
|
-
}
|
|
647
|
-
function stableMistakeId(category, pattern, agent, workflow) {
|
|
648
|
-
return [
|
|
649
|
-
category,
|
|
650
|
-
agent ? stableSlug(agent) : "global",
|
|
651
|
-
workflow ? stableSlug(workflow) : "default",
|
|
652
|
-
stableSlug(pattern).slice(0, 48)
|
|
653
|
-
].join(":");
|
|
654
|
-
}
|
|
655
|
-
function stableRubricId(kind, subject) {
|
|
656
|
-
return `${kind}:${stableSlug(subject)}`;
|
|
657
|
-
}
|
|
658
|
-
function stablePromotionCandidateId(sourceType, subject, content) {
|
|
659
|
-
const digest = createHash("sha256").update(`${sourceType}\0${subject}\0${content}`).digest("hex").slice(0, 12);
|
|
660
|
-
return `${sourceType}:${digest}`;
|
|
661
|
-
}
|
|
662
|
-
function rubricArtifactFileName(entry, slugCollisions) {
|
|
663
|
-
const slug = stableSlug(entry.subject);
|
|
664
|
-
if ((slugCollisions.get(slug) ?? 0) <= 1) return `${slug}.md`;
|
|
665
|
-
const suffix = createHash("sha256").update(`${entry.kind}:${entry.subject}`).digest("hex").slice(0, 8);
|
|
666
|
-
return `${slug}-${suffix}.md`;
|
|
667
|
-
}
|
|
668
|
-
function inferLegacyMistakeScope(pattern) {
|
|
669
|
-
const separatorIndex = pattern.indexOf(":");
|
|
670
|
-
if (separatorIndex <= 0) return { agent: null, workflow: null };
|
|
671
|
-
const subject = pattern.slice(0, separatorIndex).trim();
|
|
672
|
-
return {
|
|
673
|
-
agent: subject.length > 0 ? subject : null,
|
|
674
|
-
workflow: null
|
|
675
|
-
};
|
|
676
|
-
}
|
|
677
|
-
function inferLegacyMistakeMetadata(pattern) {
|
|
678
|
-
if (pattern.startsWith("memory-action/")) {
|
|
679
|
-
return {
|
|
680
|
-
category: "action",
|
|
681
|
-
agent: null,
|
|
682
|
-
workflow: "memory-actions"
|
|
683
|
-
};
|
|
684
|
-
}
|
|
685
|
-
const scope = inferLegacyMistakeScope(pattern);
|
|
686
|
-
return {
|
|
687
|
-
category: "feedback",
|
|
688
|
-
agent: scope.agent,
|
|
689
|
-
workflow: scope.workflow
|
|
690
|
-
};
|
|
691
|
-
}
|
|
692
|
-
function normalizePromotionWhitespace(value) {
|
|
693
|
-
return value.replace(/\s+/g, " ").trim();
|
|
694
|
-
}
|
|
695
|
-
function stripTrailingPromotionPunctuation(value) {
|
|
696
|
-
return value.replace(/[,:;]+$/g, "").trim();
|
|
697
|
-
}
|
|
698
|
-
function extractExplicitIfThenRule(value) {
|
|
699
|
-
const normalized = normalizePromotionWhitespace(value);
|
|
700
|
-
const match = normalized.match(/^if\b([\s\S]+?)\bthen\b([\s\S]+?)(?:[.!?])?$/i);
|
|
701
|
-
if (!match) return null;
|
|
702
|
-
const condition = stripTrailingPromotionPunctuation(normalizePromotionWhitespace(match[1] ?? ""));
|
|
703
|
-
const outcome = stripTrailingPromotionPunctuation(normalizePromotionWhitespace(match[2] ?? ""));
|
|
704
|
-
if (condition.length === 0 || outcome.length === 0) return null;
|
|
705
|
-
return `IF ${condition} THEN ${outcome}.`;
|
|
706
|
-
}
|
|
707
|
-
function normalizePromotedGuidanceContent(value) {
|
|
708
|
-
const explicitRule = extractExplicitIfThenRule(value);
|
|
709
|
-
if (explicitRule) return explicitRule;
|
|
710
|
-
const normalized = normalizePromotionWhitespace(value);
|
|
711
|
-
if (normalized.length === 0) return normalized;
|
|
712
|
-
return /[.!?]$/.test(normalized) ? normalized : `${normalized}.`;
|
|
713
|
-
}
|
|
714
|
-
function canonicalPromotionContentKey(value) {
|
|
715
|
-
return normalizePromotedGuidanceContent(value).toLowerCase();
|
|
716
|
-
}
|
|
717
|
-
function lessonContentFromPattern(pattern, agent) {
|
|
718
|
-
if (!agent) return normalizePromotionWhitespace(pattern);
|
|
719
|
-
const prefix = `${agent}:`;
|
|
720
|
-
if (!pattern.startsWith(prefix)) return normalizePromotionWhitespace(pattern);
|
|
721
|
-
const withoutPrefix = pattern.slice(prefix.length).trim();
|
|
722
|
-
return withoutPrefix.length > 0 ? normalizePromotionWhitespace(withoutPrefix) : normalizePromotionWhitespace(pattern);
|
|
723
|
-
}
|
|
724
|
-
function promotionCategoryForContent(content) {
|
|
725
|
-
return extractExplicitIfThenRule(content) ? "rule" : "principle";
|
|
726
|
-
}
|
|
727
|
-
function clampPromotionScore(value) {
|
|
728
|
-
if (!Number.isFinite(value)) return 0.65;
|
|
729
|
-
return Number(Math.max(0.65, Math.min(0.98, value)).toFixed(3));
|
|
730
|
-
}
|
|
731
|
-
function defaultTierMigrationCycleBudget(config, trigger) {
|
|
732
|
-
if (trigger === "extraction") {
|
|
733
|
-
const limit2 = 12;
|
|
734
|
-
return {
|
|
735
|
-
limit: limit2,
|
|
736
|
-
scanLimit: limit2 * 4,
|
|
737
|
-
minIntervalMs: 6e4
|
|
738
|
-
};
|
|
739
|
-
}
|
|
740
|
-
const limit = config.qmdTierAutoBackfillEnabled ? 200 : 50;
|
|
741
|
-
return {
|
|
742
|
-
limit,
|
|
743
|
-
scanLimit: limit * 4,
|
|
744
|
-
minIntervalMs: config.qmdTierAutoBackfillEnabled ? 12e4 : 3e5
|
|
745
|
-
};
|
|
746
|
-
}
|
|
747
|
-
function isoWeekId(d) {
|
|
748
|
-
const dt = new Date(Date.UTC(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate()));
|
|
749
|
-
const day = dt.getUTCDay() || 7;
|
|
750
|
-
dt.setUTCDate(dt.getUTCDate() + 4 - day);
|
|
751
|
-
const yearStart = new Date(Date.UTC(dt.getUTCFullYear(), 0, 1));
|
|
752
|
-
const week = Math.ceil(((dt.getTime() - yearStart.getTime()) / 864e5 + 1) / 7);
|
|
753
|
-
const yyyy = dt.getUTCFullYear();
|
|
754
|
-
return `${yyyy}-W${String(week).padStart(2, "0")}`;
|
|
755
|
-
}
|
|
756
|
-
function isoMonthId(d) {
|
|
757
|
-
return `${d.getUTCFullYear()}-${String(d.getUTCMonth() + 1).padStart(2, "0")}`;
|
|
758
|
-
}
|
|
759
|
-
function monthIdFromIsoWeek(weekId) {
|
|
760
|
-
const match = weekId.match(/^(\d{4})-W(\d{2})$/);
|
|
761
|
-
if (!match) return isoMonthId(/* @__PURE__ */ new Date());
|
|
762
|
-
const year = Number(match[1]);
|
|
763
|
-
const week = Number(match[2]);
|
|
764
|
-
const jan4 = new Date(Date.UTC(year, 0, 4));
|
|
765
|
-
const jan4Day = jan4.getUTCDay() || 7;
|
|
766
|
-
const isoWeekOneMonday = new Date(jan4);
|
|
767
|
-
isoWeekOneMonday.setUTCDate(jan4.getUTCDate() - (jan4Day - 1));
|
|
768
|
-
const monday = new Date(isoWeekOneMonday);
|
|
769
|
-
monday.setUTCDate(isoWeekOneMonday.getUTCDate() + (week - 1) * 7);
|
|
770
|
-
return isoMonthId(monday);
|
|
771
|
-
}
|
|
772
|
-
function cadenceStaleWindowMs(cadence) {
|
|
773
|
-
switch (cadence) {
|
|
774
|
-
case "daily":
|
|
775
|
-
return 2 * 24 * 60 * 60 * 1e3;
|
|
776
|
-
case "weekly":
|
|
777
|
-
return 10 * 24 * 60 * 60 * 1e3;
|
|
778
|
-
case "monthly":
|
|
779
|
-
return 45 * 24 * 60 * 60 * 1e3;
|
|
780
|
-
case "quarterly":
|
|
781
|
-
return 120 * 24 * 60 * 60 * 1e3;
|
|
782
|
-
default:
|
|
783
|
-
return 45 * 24 * 60 * 60 * 1e3;
|
|
784
|
-
}
|
|
785
|
-
}
|
|
786
|
-
var CompoundingEngine = class {
|
|
787
|
-
constructor(config, storage = new StorageManager(config.memoryDir)) {
|
|
788
|
-
this.config = config;
|
|
789
|
-
this.storage = storage;
|
|
790
|
-
this.weeklyDir = path2.join(config.memoryDir, "compounding", "weekly");
|
|
791
|
-
this.rubricsDir = path2.join(config.memoryDir, "compounding", "rubrics");
|
|
792
|
-
this.rubricsIndexPath = path2.join(this.rubricsDir, "index.json");
|
|
793
|
-
this.rubricsAgentsDir = path2.join(this.rubricsDir, "agents");
|
|
794
|
-
this.rubricsWorkflowsDir = path2.join(this.rubricsDir, "workflows");
|
|
795
|
-
this.rubricsPath = path2.join(config.memoryDir, "compounding", "rubrics.md");
|
|
796
|
-
this.mistakesPath = path2.join(config.memoryDir, "compounding", "mistakes.json");
|
|
797
|
-
this.feedbackInboxPath = path2.join(resolveSharedContextDir(config), "feedback", "inbox.jsonl");
|
|
798
|
-
this.identityAuditWeeklyDir = path2.join(config.memoryDir, "identity", "audits", "weekly");
|
|
799
|
-
this.identityAuditMonthlyDir = path2.join(config.memoryDir, "identity", "audits", "monthly");
|
|
800
|
-
this.memoryActionEventsPath = path2.join(config.memoryDir, "state", "memory-actions.jsonl");
|
|
801
|
-
}
|
|
802
|
-
config;
|
|
803
|
-
storage;
|
|
804
|
-
weeklyDir;
|
|
805
|
-
rubricsDir;
|
|
806
|
-
rubricsIndexPath;
|
|
807
|
-
rubricsAgentsDir;
|
|
808
|
-
rubricsWorkflowsDir;
|
|
809
|
-
rubricsPath;
|
|
810
|
-
mistakesPath;
|
|
811
|
-
feedbackInboxPath;
|
|
812
|
-
identityAuditWeeklyDir;
|
|
813
|
-
identityAuditMonthlyDir;
|
|
814
|
-
memoryActionEventsPath;
|
|
815
|
-
async ensureDirs() {
|
|
816
|
-
await mkdir2(this.weeklyDir, { recursive: true });
|
|
817
|
-
await mkdir2(path2.dirname(this.mistakesPath), { recursive: true });
|
|
818
|
-
await mkdir2(path2.dirname(this.rubricsPath), { recursive: true });
|
|
819
|
-
await mkdir2(this.rubricsDir, { recursive: true });
|
|
820
|
-
await mkdir2(this.rubricsAgentsDir, { recursive: true });
|
|
821
|
-
await mkdir2(this.rubricsWorkflowsDir, { recursive: true });
|
|
822
|
-
}
|
|
823
|
-
async synthesizeWeekly(opts) {
|
|
824
|
-
await this.ensureDirs();
|
|
825
|
-
const weekId = opts?.weekId ?? isoWeekId(/* @__PURE__ */ new Date());
|
|
826
|
-
const entries = await this.readFeedbackEntriesForWeek(weekId);
|
|
827
|
-
const actionEvents = await this.readActionEventsForWeek(weekId);
|
|
828
|
-
const actionPatterns = this.buildActionFailurePatterns(actionEvents);
|
|
829
|
-
const outcomeSummary = this.buildActionOutcomeSummary(actionEvents);
|
|
830
|
-
const previousMistakes = await this.readMistakes();
|
|
831
|
-
const mistakes = this.buildMistakes(entries, actionPatterns, weekId, previousMistakes?.registry ?? []);
|
|
832
|
-
const rubrics = this.buildRubricSnapshot(entries, outcomeSummary);
|
|
833
|
-
let promotionCandidates = this.config.compoundingSemanticEnabled ? this.derivePromotionCandidates(outcomeSummary, mistakes.registry, rubrics) : [];
|
|
834
|
-
if (this.config.cmcConsolidationEnabled) {
|
|
835
|
-
try {
|
|
836
|
-
const { deriveCausalPromotionCandidates, materializeAfterCausalConsolidation } = await import("./causal-consolidation.js");
|
|
837
|
-
const causalCandidates = await deriveCausalPromotionCandidates({
|
|
838
|
-
memoryDir: this.config.memoryDir,
|
|
839
|
-
causalTrajectoryStoreDir: this.config.causalTrajectoryStoreDir,
|
|
840
|
-
gatewayConfig: this.config.gatewayConfig,
|
|
841
|
-
gatewayAgentId: this.config.modelSource === "gateway" ? this.config.gatewayAgentId || void 0 : void 0,
|
|
842
|
-
workspaceDir: this.config.workspaceDir,
|
|
843
|
-
pluginConfig: this.config,
|
|
844
|
-
config: {
|
|
845
|
-
minRecurrence: this.config.cmcConsolidationMinRecurrence,
|
|
846
|
-
minSessions: this.config.cmcConsolidationMinSessions,
|
|
847
|
-
successThreshold: this.config.cmcConsolidationSuccessThreshold
|
|
848
|
-
}
|
|
849
|
-
});
|
|
850
|
-
if (causalCandidates.length > 0) {
|
|
851
|
-
promotionCandidates = [...promotionCandidates, ...causalCandidates];
|
|
852
|
-
}
|
|
853
|
-
try {
|
|
854
|
-
await materializeAfterCausalConsolidation({
|
|
855
|
-
config: this.config,
|
|
856
|
-
memoryDir: this.config.memoryDir
|
|
857
|
-
});
|
|
858
|
-
} catch (materializeError) {
|
|
859
|
-
log.warn(
|
|
860
|
-
`[cmc] Codex materialize post-hook failed (non-fatal): ${materializeError instanceof Error ? materializeError.message : String(materializeError)}`
|
|
861
|
-
);
|
|
862
|
-
}
|
|
863
|
-
} catch (error) {
|
|
864
|
-
log.warn(`[cmc] causal consolidation in synthesizeWeekly failed (non-fatal): ${error instanceof Error ? error.message : String(error)}`);
|
|
865
|
-
}
|
|
866
|
-
}
|
|
867
|
-
if (this.config.calibrationEnabled) {
|
|
868
|
-
try {
|
|
869
|
-
const { runCalibrationConsolidation } = await import("./calibration.js");
|
|
870
|
-
const calRules = await runCalibrationConsolidation({
|
|
871
|
-
memoryDir: this.config.memoryDir,
|
|
872
|
-
gatewayConfig: this.config.gatewayConfig,
|
|
873
|
-
gatewayAgentId: this.config.modelSource === "gateway" ? this.config.gatewayAgentId || void 0 : void 0,
|
|
874
|
-
workspaceDir: this.config.workspaceDir
|
|
875
|
-
});
|
|
876
|
-
log.debug(`[calibration] weekly synthesis produced ${calRules.length} calibration rule(s)`);
|
|
877
|
-
} catch (error) {
|
|
878
|
-
log.warn(`[calibration] weekly consolidation failed (non-fatal): ${error instanceof Error ? error.message : String(error)}`);
|
|
879
|
-
}
|
|
880
|
-
}
|
|
881
|
-
const continuity = this.config.continuityAuditEnabled ? await this.readContinuityAuditReferences(weekId) : { monthId: monthIdFromIsoWeek(weekId), weeklyPath: null, monthlyPath: null };
|
|
882
|
-
const reportPath = path2.join(this.weeklyDir, `${weekId}.md`);
|
|
883
|
-
const md = this.formatWeeklyReport(weekId, entries, mistakes.patterns, mistakes.details, continuity, outcomeSummary, promotionCandidates);
|
|
884
|
-
await writeFile2(reportPath, md, "utf-8");
|
|
885
|
-
const reportJsonPath = path2.join(this.weeklyDir, `${weekId}.json`);
|
|
886
|
-
const weeklyArtifact = {
|
|
887
|
-
version: COMPOUNDING_VERSION,
|
|
888
|
-
generatedAt: mistakes.updatedAt,
|
|
889
|
-
weekId,
|
|
890
|
-
feedback: {
|
|
891
|
-
count: entries.length,
|
|
892
|
-
byDecision: {
|
|
893
|
-
approved: entries.filter((wrapped) => wrapped.entry.decision === "approved").length,
|
|
894
|
-
approved_with_feedback: entries.filter((wrapped) => wrapped.entry.decision === "approved_with_feedback").length,
|
|
895
|
-
rejected: entries.filter((wrapped) => wrapped.entry.decision === "rejected").length
|
|
896
|
-
},
|
|
897
|
-
entries: entries.map((wrapped) => ({
|
|
898
|
-
agent: wrapped.entry.agent,
|
|
899
|
-
workflow: wrapped.entry.workflow ?? null,
|
|
900
|
-
decision: wrapped.entry.decision,
|
|
901
|
-
reason: wrapped.entry.reason,
|
|
902
|
-
learning: wrapped.entry.learning?.trim() || null,
|
|
903
|
-
outcome: wrapped.entry.outcome?.trim() || null,
|
|
904
|
-
severity: wrapped.entry.severity ?? null,
|
|
905
|
-
confidence: normalizeConfidence(wrapped.entry.confidence),
|
|
906
|
-
tags: normalizeTags(wrapped.entry.tags),
|
|
907
|
-
provenance: `${path2.basename(wrapped.sourcePath)}:L${wrapped.sourceLine}#${wrapped.entryId}`,
|
|
908
|
-
evidenceWindow: normalizeEvidenceWindow(wrapped.entry.evidenceWindowStart, wrapped.entry.evidenceWindowEnd)
|
|
909
|
-
}))
|
|
910
|
-
},
|
|
911
|
-
mistakes: {
|
|
912
|
-
count: mistakes.patterns.length,
|
|
913
|
-
patterns: mistakes.patterns,
|
|
914
|
-
registry: mistakes.registry
|
|
915
|
-
},
|
|
916
|
-
rubrics,
|
|
917
|
-
outcomes: outcomeSummary,
|
|
918
|
-
promotionCandidates,
|
|
919
|
-
continuity
|
|
920
|
-
};
|
|
921
|
-
await writeFile2(reportJsonPath, JSON.stringify(weeklyArtifact, null, 2) + "\n", "utf-8");
|
|
922
|
-
const rubricsMarkdown = this.formatRubrics(outcomeSummary, rubrics);
|
|
923
|
-
await writeFile2(this.rubricsPath, rubricsMarkdown, "utf-8");
|
|
924
|
-
await writeFile2(this.rubricsIndexPath, JSON.stringify(rubrics, null, 2) + "\n", "utf-8");
|
|
925
|
-
await this.syncRubricArtifacts(rubrics);
|
|
926
|
-
await writeFile2(
|
|
927
|
-
this.mistakesPath,
|
|
928
|
-
JSON.stringify({
|
|
929
|
-
version: COMPOUNDING_VERSION,
|
|
930
|
-
updatedAt: mistakes.updatedAt,
|
|
931
|
-
patterns: mistakes.patterns,
|
|
932
|
-
registry: mistakes.registry
|
|
933
|
-
}, null, 2) + "\n",
|
|
934
|
-
"utf-8"
|
|
935
|
-
);
|
|
936
|
-
log.info(
|
|
937
|
-
`compounding: wrote weekly=${reportPath} weeklyJson=${reportJsonPath} rubrics=${this.rubricsPath} rubricsIndex=${this.rubricsIndexPath} mistakes=${this.mistakesPath}`
|
|
938
|
-
);
|
|
939
|
-
return {
|
|
940
|
-
weekId,
|
|
941
|
-
reportPath,
|
|
942
|
-
reportJsonPath,
|
|
943
|
-
rubricsPath: this.rubricsPath,
|
|
944
|
-
rubricsIndexPath: this.rubricsIndexPath,
|
|
945
|
-
mistakesCount: mistakes.patterns.length,
|
|
946
|
-
promotionCandidateCount: promotionCandidates.length
|
|
947
|
-
};
|
|
948
|
-
}
|
|
949
|
-
async promoteCandidate(opts) {
|
|
950
|
-
const report = {
|
|
951
|
-
enabled: this.config.compoundingEnabled === true && this.config.compoundingSemanticEnabled === true,
|
|
952
|
-
dryRun: opts.dryRun === true,
|
|
953
|
-
weekId: opts.weekId,
|
|
954
|
-
promoted: [],
|
|
955
|
-
skipped: []
|
|
956
|
-
};
|
|
957
|
-
if (!report.enabled) {
|
|
958
|
-
report.skipped.push({ weekId: opts.weekId, candidateId: opts.candidateId, reason: "disabled" });
|
|
959
|
-
return report;
|
|
960
|
-
}
|
|
961
|
-
const artifact = await this.readWeeklyArtifact(opts.weekId);
|
|
962
|
-
if (!artifact) {
|
|
963
|
-
report.skipped.push({ weekId: opts.weekId, candidateId: opts.candidateId, reason: "weekly-artifact-missing" });
|
|
964
|
-
return report;
|
|
965
|
-
}
|
|
966
|
-
const candidate = artifact.promotionCandidates.find((entry) => entry.id === opts.candidateId);
|
|
967
|
-
if (!candidate) {
|
|
968
|
-
report.skipped.push({ weekId: opts.weekId, candidateId: opts.candidateId, reason: "candidate-not-found" });
|
|
969
|
-
return report;
|
|
970
|
-
}
|
|
971
|
-
const content = normalizePromotedGuidanceContent(candidate.content);
|
|
972
|
-
const persistedContent = sanitizeMemoryContent(content).text;
|
|
973
|
-
const storage = opts.storage ?? new StorageManager(this.config.memoryDir);
|
|
974
|
-
const existing = (await storage.readAllMemories()).find(
|
|
975
|
-
(memory) => memory.frontmatter.category === candidate.category && memory.frontmatter.status !== "archived" && memory.frontmatter.status !== "forgotten" && canonicalPromotionContentKey(memory.content) === canonicalPromotionContentKey(persistedContent)
|
|
976
|
-
);
|
|
977
|
-
if (existing) {
|
|
978
|
-
report.skipped.push({
|
|
979
|
-
weekId: opts.weekId,
|
|
980
|
-
candidateId: opts.candidateId,
|
|
981
|
-
reason: "duplicate-guidance",
|
|
982
|
-
existingMemoryId: existing.frontmatter.id
|
|
983
|
-
});
|
|
984
|
-
return report;
|
|
985
|
-
}
|
|
986
|
-
const tags = [
|
|
987
|
-
"compounding",
|
|
988
|
-
"compounding-promotion",
|
|
989
|
-
`compounding-source-${candidate.sourceType}`,
|
|
990
|
-
...candidate.agent ? [`agent:${stableSlug(candidate.agent)}`] : [],
|
|
991
|
-
...candidate.workflow ? [`workflow:${stableSlug(candidate.workflow)}`] : []
|
|
992
|
-
];
|
|
993
|
-
const uniqueTags = [...new Set(tags)];
|
|
994
|
-
const lineage = [`compounding:${opts.weekId}:${opts.candidateId}`];
|
|
995
|
-
const confidence = clampPromotionScore(candidate.score);
|
|
996
|
-
if (opts.dryRun === true) {
|
|
997
|
-
report.promoted.push({
|
|
998
|
-
id: `dry-run:${opts.weekId}:${opts.candidateId}`,
|
|
999
|
-
candidateId: opts.candidateId,
|
|
1000
|
-
category: candidate.category,
|
|
1001
|
-
content: persistedContent,
|
|
1002
|
-
confidence,
|
|
1003
|
-
tags: uniqueTags,
|
|
1004
|
-
lineage
|
|
1005
|
-
});
|
|
1006
|
-
return report;
|
|
1007
|
-
}
|
|
1008
|
-
const id = await storage.writeMemory(candidate.category, persistedContent, {
|
|
1009
|
-
source: "compounding-promotion",
|
|
1010
|
-
tags: uniqueTags,
|
|
1011
|
-
confidence,
|
|
1012
|
-
lineage,
|
|
1013
|
-
memoryKind: "note"
|
|
1014
|
-
});
|
|
1015
|
-
report.promoted.push({
|
|
1016
|
-
id,
|
|
1017
|
-
candidateId: opts.candidateId,
|
|
1018
|
-
category: candidate.category,
|
|
1019
|
-
content: persistedContent,
|
|
1020
|
-
confidence,
|
|
1021
|
-
tags: uniqueTags,
|
|
1022
|
-
lineage
|
|
1023
|
-
});
|
|
1024
|
-
return report;
|
|
1025
|
-
}
|
|
1026
|
-
async synthesizeContinuityAudit(opts) {
|
|
1027
|
-
const period = opts?.period === "monthly" ? "monthly" : "weekly";
|
|
1028
|
-
const key = opts?.key?.trim() || (period === "weekly" ? isoWeekId(/* @__PURE__ */ new Date()) : isoMonthId(/* @__PURE__ */ new Date()));
|
|
1029
|
-
const nowIso = (/* @__PURE__ */ new Date()).toISOString();
|
|
1030
|
-
const [identityAnchor, improvementLoopsRaw, openIncidents, closedIncidents, mistakes] = await Promise.all([
|
|
1031
|
-
this.readOptionalIdentityAnchorForAudit(),
|
|
1032
|
-
this.readOptionalImprovementLoopsForAudit(),
|
|
1033
|
-
this.readContinuityIncidentsForAudit(200, "open"),
|
|
1034
|
-
this.readContinuityIncidentsForAudit(200, "closed"),
|
|
1035
|
-
this.readMistakes()
|
|
1036
|
-
]);
|
|
1037
|
-
const anchorPresent = (identityAnchor ?? "").trim().length > 0;
|
|
1038
|
-
const improvementLoops = improvementLoopsRaw ? parseContinuityImprovementLoops(improvementLoopsRaw) : [];
|
|
1039
|
-
const activeLoops = improvementLoops.filter((loop) => loop.status === "active");
|
|
1040
|
-
const staleActiveLoops = activeLoops.filter((loop) => {
|
|
1041
|
-
const reviewedAt = Date.parse(loop.lastReviewed);
|
|
1042
|
-
if (!Number.isFinite(reviewedAt)) return true;
|
|
1043
|
-
return Date.now() - reviewedAt > cadenceStaleWindowMs(loop.cadence);
|
|
1044
|
-
});
|
|
1045
|
-
const hardeningCandidates = [];
|
|
1046
|
-
if (!anchorPresent) {
|
|
1047
|
-
hardeningCandidates.push("Create/update identity anchor baseline and verify recovery injection path.");
|
|
1048
|
-
}
|
|
1049
|
-
if (openIncidents.length > 0) {
|
|
1050
|
-
hardeningCandidates.push(
|
|
1051
|
-
`Close or downgrade ${openIncidents.length} open continuity incident${openIncidents.length === 1 ? "" : "s"}.`
|
|
1052
|
-
);
|
|
1053
|
-
}
|
|
1054
|
-
if (improvementLoops.length === 0) {
|
|
1055
|
-
hardeningCandidates.push("Initialize continuity improvement-loops register with cadence and kill conditions.");
|
|
1056
|
-
} else if (staleActiveLoops.length > 0) {
|
|
1057
|
-
hardeningCandidates.push(
|
|
1058
|
-
`Review stale active continuity loop${staleActiveLoops.length === 1 ? "" : "s"}: ${staleActiveLoops.slice(0, 3).map((loop) => loop.id).join(", ")}.`
|
|
1059
|
-
);
|
|
1060
|
-
}
|
|
1061
|
-
if ((mistakes?.patterns.length ?? 0) > 0) {
|
|
1062
|
-
hardeningCandidates.push("Review latest compounding mistakes and convert one pattern into preventive continuity rule.");
|
|
1063
|
-
}
|
|
1064
|
-
const nextAction = hardeningCandidates[0] ?? "No critical drift detected; keep weekly/monthly continuity audit cadence.";
|
|
1065
|
-
const lines = [
|
|
1066
|
-
`# Continuity Audit \u2014 ${period} ${key}`,
|
|
1067
|
-
"",
|
|
1068
|
-
`Generated: ${nowIso}`,
|
|
1069
|
-
`Scope: ${period}`,
|
|
1070
|
-
"",
|
|
1071
|
-
"## Signal Summary",
|
|
1072
|
-
`- Identity anchor present: ${anchorPresent ? "yes" : "no"}`,
|
|
1073
|
-
`- Improvement loops tracked: ${improvementLoops.length}`,
|
|
1074
|
-
`- Active improvement loops: ${activeLoops.length}`,
|
|
1075
|
-
`- Stale active loops: ${staleActiveLoops.length}`,
|
|
1076
|
-
`- Open incidents: ${openIncidents.length}`,
|
|
1077
|
-
`- Closed incidents: ${closedIncidents.length}`,
|
|
1078
|
-
`- Compounding mistake patterns: ${mistakes?.patterns.length ?? 0}`,
|
|
1079
|
-
"",
|
|
1080
|
-
"## Drift Checks",
|
|
1081
|
-
`- Identity anchor drift: ${anchorPresent ? "pass" : "needs attention"}`,
|
|
1082
|
-
`- Incident backlog: ${openIncidents.length === 0 ? "pass" : "needs attention"}`,
|
|
1083
|
-
`- Improvement-loop coverage: ${improvementLoops.length > 0 ? "pass" : "needs attention"}`,
|
|
1084
|
-
`- Improvement-loop freshness: ${staleActiveLoops.length === 0 ? "pass" : "needs attention"}`,
|
|
1085
|
-
"",
|
|
1086
|
-
"## Stale Rule Detection",
|
|
1087
|
-
`- Open incidents older than closure window: ${openIncidents.length > 0 ? "possible" : "none detected"}`,
|
|
1088
|
-
`- Stale active continuity loops: ${staleActiveLoops.length > 0 ? staleActiveLoops.map((l) => l.id).join(", ") : "none detected"}`,
|
|
1089
|
-
`- Preventive rule coverage on closed incidents: ${closedIncidents.some((i) => (i.preventiveRule ?? "").trim().length > 0) ? "present" : "not detected"}`,
|
|
1090
|
-
"",
|
|
1091
|
-
"## Next Hardening Action",
|
|
1092
|
-
`- ${nextAction}`,
|
|
1093
|
-
"",
|
|
1094
|
-
"## Open Incident IDs",
|
|
1095
|
-
...openIncidents.length > 0 ? openIncidents.slice(0, 20).map((i) => `- ${i.id}`) : ["- (none)"],
|
|
1096
|
-
""
|
|
1097
|
-
];
|
|
1098
|
-
const reportPath = await this.storage.writeIdentityAudit(period, key, lines.join("\n"));
|
|
1099
|
-
return { period, key, reportPath };
|
|
1100
|
-
}
|
|
1101
|
-
async readMistakes() {
|
|
1102
|
-
try {
|
|
1103
|
-
const raw = await readFile2(this.mistakesPath, "utf-8");
|
|
1104
|
-
const parsed = JSON.parse(raw);
|
|
1105
|
-
if (!parsed || !Array.isArray(parsed.patterns)) return null;
|
|
1106
|
-
if (!Array.isArray(parsed.registry)) {
|
|
1107
|
-
const updatedAt = typeof parsed.updatedAt === "string" && parsed.updatedAt.length > 0 ? parsed.updatedAt : (/* @__PURE__ */ new Date(0)).toISOString();
|
|
1108
|
-
parsed.registry = parsed.patterns.map((pattern) => {
|
|
1109
|
-
const metadata = inferLegacyMistakeMetadata(pattern);
|
|
1110
|
-
return {
|
|
1111
|
-
id: stableMistakeId(metadata.category, pattern, metadata.agent, metadata.workflow),
|
|
1112
|
-
pattern,
|
|
1113
|
-
category: metadata.category,
|
|
1114
|
-
status: "active",
|
|
1115
|
-
agent: metadata.agent,
|
|
1116
|
-
workflow: metadata.workflow,
|
|
1117
|
-
tags: [],
|
|
1118
|
-
severity: null,
|
|
1119
|
-
confidence: null,
|
|
1120
|
-
outcome: null,
|
|
1121
|
-
provenance: [],
|
|
1122
|
-
firstSeenAt: updatedAt,
|
|
1123
|
-
lastSeenAt: updatedAt,
|
|
1124
|
-
recurrenceCount: 1,
|
|
1125
|
-
lastWeekId: isoWeekId(new Date(updatedAt)),
|
|
1126
|
-
evidenceWindow: { start: null, end: null }
|
|
1127
|
-
};
|
|
1128
|
-
});
|
|
1129
|
-
}
|
|
1130
|
-
return parsed;
|
|
1131
|
-
} catch {
|
|
1132
|
-
return null;
|
|
1133
|
-
}
|
|
1134
|
-
}
|
|
1135
|
-
async readRubrics() {
|
|
1136
|
-
try {
|
|
1137
|
-
const raw = await readFile2(this.rubricsIndexPath, "utf-8");
|
|
1138
|
-
const parsed = JSON.parse(raw);
|
|
1139
|
-
if (!parsed || !Array.isArray(parsed.agents) || !Array.isArray(parsed.workflows)) return null;
|
|
1140
|
-
parsed.agents = parsed.agents.map((entry) => this.normalizeRubricEntry(entry));
|
|
1141
|
-
parsed.workflows = parsed.workflows.map((entry) => this.normalizeRubricEntry(entry));
|
|
1142
|
-
return parsed;
|
|
1143
|
-
} catch {
|
|
1144
|
-
return null;
|
|
1145
|
-
}
|
|
1146
|
-
}
|
|
1147
|
-
async readWeeklyArtifact(weekId) {
|
|
1148
|
-
try {
|
|
1149
|
-
const raw = await readFile2(path2.join(this.weeklyDir, `${weekId}.json`), "utf-8");
|
|
1150
|
-
const parsed = JSON.parse(raw);
|
|
1151
|
-
if (!parsed || parsed.weekId !== weekId || !Array.isArray(parsed.promotionCandidates)) {
|
|
1152
|
-
return null;
|
|
1153
|
-
}
|
|
1154
|
-
return parsed;
|
|
1155
|
-
} catch {
|
|
1156
|
-
return null;
|
|
1157
|
-
}
|
|
1158
|
-
}
|
|
1159
|
-
async buildRecallSection(query, opts) {
|
|
1160
|
-
const [mistakes, rubrics] = await Promise.all([
|
|
1161
|
-
this.readMistakes(),
|
|
1162
|
-
this.readRubrics()
|
|
1163
|
-
]);
|
|
1164
|
-
const maxPatterns = Math.max(0, Math.floor(opts?.maxPatterns ?? 40));
|
|
1165
|
-
const maxRubrics = Math.max(0, Math.floor(opts?.maxRubrics ?? 4));
|
|
1166
|
-
const queryTokens = tokenizeRecallQuery(query);
|
|
1167
|
-
const activePatterns = (mistakes?.registry ?? []).filter((entry) => entry.status === "active").sort(
|
|
1168
|
-
(a, b) => b.recurrenceCount - a.recurrenceCount || b.lastSeenAt.localeCompare(a.lastSeenAt) || a.pattern.localeCompare(b.pattern)
|
|
1169
|
-
);
|
|
1170
|
-
const topPatterns = activePatterns.slice(0, maxPatterns);
|
|
1171
|
-
const allRubrics = [
|
|
1172
|
-
...rubrics?.workflows ?? [],
|
|
1173
|
-
...rubrics?.agents ?? []
|
|
1174
|
-
];
|
|
1175
|
-
const scoredRubrics = allRubrics.map((entry) => ({
|
|
1176
|
-
entry,
|
|
1177
|
-
score: this.scoreRubricForQuery(entry, queryTokens)
|
|
1178
|
-
})).sort(
|
|
1179
|
-
(a, b) => b.score - a.score || b.entry.observations.length - a.entry.observations.length || a.entry.subject.localeCompare(b.entry.subject)
|
|
1180
|
-
);
|
|
1181
|
-
const topRubrics = scoredRubrics.filter((item) => item.score > 0 || queryTokens.length === 0).slice(0, maxRubrics).map((item) => item.entry);
|
|
1182
|
-
if (topPatterns.length === 0 && topRubrics.length === 0) return null;
|
|
1183
|
-
const lines = [
|
|
1184
|
-
"## Institutional Learning (Compounded)",
|
|
1185
|
-
""
|
|
1186
|
-
];
|
|
1187
|
-
if (topPatterns.length > 0) {
|
|
1188
|
-
lines.push("Avoid repeating these patterns:");
|
|
1189
|
-
for (const entry of topPatterns) {
|
|
1190
|
-
const scope = entry.workflow ?? entry.agent ?? null;
|
|
1191
|
-
const metadata = [`recurrence=${entry.recurrenceCount}`];
|
|
1192
|
-
if (scope) metadata.push(`scope=${scope}`);
|
|
1193
|
-
lines.push(`- ${entry.pattern} _(${metadata.join(", ")})_`);
|
|
1194
|
-
}
|
|
1195
|
-
lines.push("");
|
|
1196
|
-
}
|
|
1197
|
-
if (topRubrics.length > 0) {
|
|
1198
|
-
lines.push("Active rubrics:");
|
|
1199
|
-
for (const rubric of topRubrics) {
|
|
1200
|
-
const notes = rubric.observations.slice(0, 2).join("; ");
|
|
1201
|
-
lines.push(`- ${rubric.kind} ${rubric.subject}: ${notes}`);
|
|
1202
|
-
}
|
|
1203
|
-
}
|
|
1204
|
-
return lines.join("\n");
|
|
1205
|
-
}
|
|
1206
|
-
tierMigrationCycleBudget(trigger) {
|
|
1207
|
-
return defaultTierMigrationCycleBudget(this.config, trigger);
|
|
1208
|
-
}
|
|
1209
|
-
async readFeedbackEntriesForWeek(weekId) {
|
|
1210
|
-
const out = [];
|
|
1211
|
-
try {
|
|
1212
|
-
const raw = await readFile2(this.feedbackInboxPath, "utf-8");
|
|
1213
|
-
const lines = raw.split("\n");
|
|
1214
|
-
for (let idx = 0; idx < lines.length; idx += 1) {
|
|
1215
|
-
const line = lines[idx];
|
|
1216
|
-
if (!line.trim()) continue;
|
|
1217
|
-
try {
|
|
1218
|
-
const obj = JSON.parse(line);
|
|
1219
|
-
const parsed = SharedFeedbackEntrySchema.safeParse(obj);
|
|
1220
|
-
if (!parsed.success) continue;
|
|
1221
|
-
const d = new Date(parsed.data.date);
|
|
1222
|
-
if (!Number.isFinite(d.getTime())) continue;
|
|
1223
|
-
if (isoWeekId(d) !== weekId) continue;
|
|
1224
|
-
const sourceLine = idx + 1;
|
|
1225
|
-
out.push({
|
|
1226
|
-
entry: parsed.data,
|
|
1227
|
-
sourceLine,
|
|
1228
|
-
sourcePath: this.feedbackInboxPath,
|
|
1229
|
-
entryId: `${parsed.data.agent}-${parsed.data.date}-${sourceLine}`.replace(/[^a-zA-Z0-9._:-]/g, "_")
|
|
1230
|
-
});
|
|
1231
|
-
} catch {
|
|
1232
|
-
}
|
|
1233
|
-
}
|
|
1234
|
-
} catch {
|
|
1235
|
-
}
|
|
1236
|
-
return out;
|
|
1237
|
-
}
|
|
1238
|
-
buildActionFailurePatterns(events) {
|
|
1239
|
-
const out = [];
|
|
1240
|
-
for (const event of events) {
|
|
1241
|
-
const failed = event.outcome === "failed" || event.outcome === "skipped";
|
|
1242
|
-
if (!failed && event.policyDecision === null) continue;
|
|
1243
|
-
const suffix = event.reason && event.reason.trim().length > 0 ? ` - ${event.reason.trim().slice(0, 140)}` : "";
|
|
1244
|
-
out.push(
|
|
1245
|
-
`memory-action/${event.namespace}: ${event.action} ${event.outcome}${event.policyDecision ? `/${event.policyDecision}` : ""}${suffix}`
|
|
1246
|
-
);
|
|
1247
|
-
}
|
|
1248
|
-
return out;
|
|
1249
|
-
}
|
|
1250
|
-
async readActionEventsForWeek(weekId) {
|
|
1251
|
-
const out = [];
|
|
1252
|
-
const rows = await this.storage.readMemoryActionEventRows(Number.MAX_SAFE_INTEGER);
|
|
1253
|
-
for (const row of rows) {
|
|
1254
|
-
const event = row.event;
|
|
1255
|
-
const ts = new Date(event.timestamp);
|
|
1256
|
-
if (!Number.isFinite(ts.getTime()) || isoWeekId(ts) !== weekId) continue;
|
|
1257
|
-
out.push({
|
|
1258
|
-
line: row.line,
|
|
1259
|
-
action: event.action,
|
|
1260
|
-
outcome: event.outcome,
|
|
1261
|
-
policyDecision: event.policyDecision === "deny" || event.policyDecision === "defer" ? event.policyDecision : null,
|
|
1262
|
-
namespace: typeof event.namespace === "string" && event.namespace.length > 0 ? event.namespace : "default",
|
|
1263
|
-
reason: typeof event.reason === "string" ? event.reason : null
|
|
1264
|
-
});
|
|
1265
|
-
}
|
|
1266
|
-
return out;
|
|
1267
|
-
}
|
|
1268
|
-
buildActionOutcomeSummary(events) {
|
|
1269
|
-
const byAction = /* @__PURE__ */ new Map();
|
|
1270
|
-
for (const event of events) {
|
|
1271
|
-
const key = event.action;
|
|
1272
|
-
const acc = byAction.get(key) ?? {
|
|
1273
|
-
counts: { applied: 0, skipped: 0, failed: 0 },
|
|
1274
|
-
provenance: /* @__PURE__ */ new Set()
|
|
1275
|
-
};
|
|
1276
|
-
if (event.outcome === "applied") acc.counts.applied += 1;
|
|
1277
|
-
else if (event.outcome === "skipped") acc.counts.skipped += 1;
|
|
1278
|
-
else acc.counts.failed += 1;
|
|
1279
|
-
acc.provenance.add(`${path2.basename(this.memoryActionEventsPath)}:L${event.line}`);
|
|
1280
|
-
byAction.set(key, acc);
|
|
1281
|
-
}
|
|
1282
|
-
const out = [];
|
|
1283
|
-
for (const [action, data] of byAction.entries()) {
|
|
1284
|
-
const total = data.counts.applied + data.counts.skipped + data.counts.failed;
|
|
1285
|
-
if (total <= 0) continue;
|
|
1286
|
-
const weightedScore = Number(((data.counts.applied * 1 - data.counts.skipped * 0.5 - data.counts.failed * 1.5) / total).toFixed(3));
|
|
1287
|
-
out.push({
|
|
1288
|
-
action,
|
|
1289
|
-
counts: data.counts,
|
|
1290
|
-
total,
|
|
1291
|
-
weightedScore,
|
|
1292
|
-
provenance: [...data.provenance].sort().slice(0, 8)
|
|
1293
|
-
});
|
|
1294
|
-
}
|
|
1295
|
-
out.sort((a, b) => b.total - a.total || b.weightedScore - a.weightedScore || a.action.localeCompare(b.action));
|
|
1296
|
-
return out;
|
|
1297
|
-
}
|
|
1298
|
-
derivePromotionCandidates(summary, mistakes, rubrics) {
|
|
1299
|
-
const deduped = /* @__PURE__ */ new Map();
|
|
1300
|
-
const upsert = (candidate) => {
|
|
1301
|
-
const key = `${candidate.category}:${canonicalPromotionContentKey(candidate.content)}`;
|
|
1302
|
-
const existing = deduped.get(key);
|
|
1303
|
-
if (!existing) {
|
|
1304
|
-
deduped.set(key, candidate);
|
|
1305
|
-
return;
|
|
1306
|
-
}
|
|
1307
|
-
const mergedProvenance = [.../* @__PURE__ */ new Set([...existing.provenance, ...candidate.provenance])];
|
|
1308
|
-
if (candidate.score > existing.score) {
|
|
1309
|
-
deduped.set(key, {
|
|
1310
|
-
...candidate,
|
|
1311
|
-
provenance: mergedProvenance
|
|
1312
|
-
});
|
|
1313
|
-
return;
|
|
1314
|
-
}
|
|
1315
|
-
existing.provenance = mergedProvenance;
|
|
1316
|
-
};
|
|
1317
|
-
for (const item of summary) {
|
|
1318
|
-
if (item.total < 3) continue;
|
|
1319
|
-
if (item.weightedScore < 0.3) continue;
|
|
1320
|
-
const content = normalizePromotedGuidanceContent(
|
|
1321
|
-
`Prefer ${item.action} when the same workflow recurs; this week's outcomes were applied=${item.counts.applied}, skipped=${item.counts.skipped}, failed=${item.counts.failed}.`
|
|
1322
|
-
);
|
|
1323
|
-
upsert({
|
|
1324
|
-
id: stablePromotionCandidateId("action-outcome", item.action, content),
|
|
1325
|
-
sourceType: "action-outcome",
|
|
1326
|
-
subject: item.action,
|
|
1327
|
-
category: promotionCategoryForContent(content),
|
|
1328
|
-
content,
|
|
1329
|
-
score: item.weightedScore,
|
|
1330
|
-
rationale: "High applied ratio with low failure/skips in weekly outcome telemetry.",
|
|
1331
|
-
outcome: item.counts,
|
|
1332
|
-
provenance: item.provenance,
|
|
1333
|
-
agent: null,
|
|
1334
|
-
workflow: "memory-actions"
|
|
1335
|
-
});
|
|
1336
|
-
}
|
|
1337
|
-
for (const entry of mistakes) {
|
|
1338
|
-
if (entry.status !== "active") continue;
|
|
1339
|
-
if (entry.recurrenceCount < 2) continue;
|
|
1340
|
-
const content = normalizePromotedGuidanceContent(lessonContentFromPattern(entry.pattern, entry.agent));
|
|
1341
|
-
if (content.length === 0) continue;
|
|
1342
|
-
const confidence = entry.confidence ?? 0.75;
|
|
1343
|
-
const score = Number(Math.min(0.97, 0.45 + Math.min(entry.recurrenceCount, 6) * 0.08 + confidence * 0.15).toFixed(3));
|
|
1344
|
-
upsert({
|
|
1345
|
-
id: stablePromotionCandidateId("mistake-pattern", entry.id, content),
|
|
1346
|
-
sourceType: "mistake-pattern",
|
|
1347
|
-
subject: entry.pattern,
|
|
1348
|
-
category: promotionCategoryForContent(content),
|
|
1349
|
-
content,
|
|
1350
|
-
score,
|
|
1351
|
-
rationale: `Recurring lesson still active after ${entry.recurrenceCount} confirmations in the mistake registry.`,
|
|
1352
|
-
outcome: null,
|
|
1353
|
-
provenance: entry.provenance.length > 0 ? entry.provenance : [`mistakes.json#${entry.id}`],
|
|
1354
|
-
agent: entry.agent,
|
|
1355
|
-
workflow: entry.workflow
|
|
1356
|
-
});
|
|
1357
|
-
}
|
|
1358
|
-
for (const rubric of [...rubrics.workflows, ...rubrics.agents]) {
|
|
1359
|
-
for (const observation of this.getRubricObservationEntries(rubric)) {
|
|
1360
|
-
if (this.isSyntheticOutcomeRubricObservation(observation.note)) continue;
|
|
1361
|
-
const evidenceCount = observation.provenance.length;
|
|
1362
|
-
if (evidenceCount < 2) continue;
|
|
1363
|
-
const content = normalizePromotedGuidanceContent(observation.note);
|
|
1364
|
-
if (content.length === 0) continue;
|
|
1365
|
-
const score = Number(Math.min(0.95, 0.5 + Math.min(evidenceCount, 5) * 0.08).toFixed(3));
|
|
1366
|
-
upsert({
|
|
1367
|
-
id: stablePromotionCandidateId("rubric", `${rubric.id}:${observation.note}`, content),
|
|
1368
|
-
sourceType: "rubric",
|
|
1369
|
-
subject: `${rubric.kind}:${rubric.subject}`,
|
|
1370
|
-
category: promotionCategoryForContent(content),
|
|
1371
|
-
content,
|
|
1372
|
-
score,
|
|
1373
|
-
rationale: `Rubric guidance repeated across ${evidenceCount} supporting observations.`,
|
|
1374
|
-
outcome: null,
|
|
1375
|
-
provenance: observation.provenance,
|
|
1376
|
-
agent: rubric.kind === "agent" ? rubric.subject : null,
|
|
1377
|
-
workflow: rubric.kind === "workflow" ? rubric.subject : null
|
|
1378
|
-
});
|
|
1379
|
-
}
|
|
1380
|
-
}
|
|
1381
|
-
return [...deduped.values()].sort((a, b) => b.score - a.score || a.subject.localeCompare(b.subject)).slice(0, 10);
|
|
1382
|
-
}
|
|
1383
|
-
buildMistakes(entries, actionPatterns = [], weekId, previousRegistry = []) {
|
|
1384
|
-
const patterns = [];
|
|
1385
|
-
const evidenceByPattern = /* @__PURE__ */ new Map();
|
|
1386
|
-
for (const wrapped of entries) {
|
|
1387
|
-
const e = wrapped.entry;
|
|
1388
|
-
const pattern = e.learning && e.learning.trim().length > 0 ? `${e.agent}: ${e.learning.trim()}` : e.decision === "rejected" ? `${e.agent}: ${e.reason.trim()}`.slice(0, 240) : null;
|
|
1389
|
-
if (!pattern) continue;
|
|
1390
|
-
const provenance = [`${path2.basename(wrapped.sourcePath)}:L${wrapped.sourceLine}#${wrapped.entryId}`];
|
|
1391
|
-
patterns.push({ pattern, provenance });
|
|
1392
|
-
const previous = evidenceByPattern.get(pattern) ?? {
|
|
1393
|
-
category: "feedback",
|
|
1394
|
-
agent: e.agent,
|
|
1395
|
-
workflow: e.workflow ?? null,
|
|
1396
|
-
tags: /* @__PURE__ */ new Set(),
|
|
1397
|
-
severity: e.severity ?? null,
|
|
1398
|
-
confidence: normalizeConfidence(e.confidence),
|
|
1399
|
-
outcome: e.outcome?.trim() || null,
|
|
1400
|
-
timestamps: [],
|
|
1401
|
-
evidenceWindow: normalizeEvidenceWindow(e.evidenceWindowStart, e.evidenceWindowEnd)
|
|
1402
|
-
};
|
|
1403
|
-
for (const tag of normalizeTags(e.tags)) previous.tags.add(tag);
|
|
1404
|
-
previous.timestamps.push(e.date);
|
|
1405
|
-
if (previous.workflow === null && e.workflow) previous.workflow = e.workflow;
|
|
1406
|
-
if (previous.severity === null && e.severity) previous.severity = e.severity;
|
|
1407
|
-
if (previous.confidence === null) previous.confidence = normalizeConfidence(e.confidence);
|
|
1408
|
-
if (previous.outcome === null && e.outcome) previous.outcome = e.outcome.trim();
|
|
1409
|
-
const nextEvidenceWindow = normalizeEvidenceWindow(e.evidenceWindowStart, e.evidenceWindowEnd);
|
|
1410
|
-
previous.evidenceWindow = mergeEvidenceWindows(previous.evidenceWindow, nextEvidenceWindow);
|
|
1411
|
-
evidenceByPattern.set(pattern, previous);
|
|
1412
|
-
}
|
|
1413
|
-
for (const pattern of actionPatterns) {
|
|
1414
|
-
patterns.push({ pattern, provenance: [`${path2.basename(this.memoryActionEventsPath)}:*`] });
|
|
1415
|
-
const previous = evidenceByPattern.get(pattern) ?? {
|
|
1416
|
-
category: "action",
|
|
1417
|
-
agent: null,
|
|
1418
|
-
workflow: "memory-actions",
|
|
1419
|
-
tags: /* @__PURE__ */ new Set(),
|
|
1420
|
-
severity: "medium",
|
|
1421
|
-
confidence: null,
|
|
1422
|
-
outcome: null,
|
|
1423
|
-
timestamps: [],
|
|
1424
|
-
evidenceWindow: { start: null, end: null }
|
|
1425
|
-
};
|
|
1426
|
-
evidenceByPattern.set(pattern, previous);
|
|
1427
|
-
}
|
|
1428
|
-
const byPattern = /* @__PURE__ */ new Map();
|
|
1429
|
-
for (const item of patterns) {
|
|
1430
|
-
const existing = byPattern.get(item.pattern) ?? /* @__PURE__ */ new Set();
|
|
1431
|
-
for (const provenance of item.provenance) existing.add(provenance);
|
|
1432
|
-
byPattern.set(item.pattern, existing);
|
|
1433
|
-
}
|
|
1434
|
-
const details = [...byPattern.entries()].map(([pattern, provenance]) => ({ pattern, provenance: [...provenance].sort() })).slice(0, 500);
|
|
1435
|
-
const previousById = new Map(previousRegistry.map((entry) => [entry.id, entry]));
|
|
1436
|
-
const previousByPattern = new Map(previousRegistry.map((entry) => [entry.pattern, entry]));
|
|
1437
|
-
const registry = details.map((detail) => {
|
|
1438
|
-
const evidence = evidenceByPattern.get(detail.pattern);
|
|
1439
|
-
const id = stableMistakeId(
|
|
1440
|
-
evidence?.category ?? "feedback",
|
|
1441
|
-
detail.pattern,
|
|
1442
|
-
evidence?.agent ?? null,
|
|
1443
|
-
evidence?.workflow ?? null
|
|
1444
|
-
);
|
|
1445
|
-
const previous = previousById.get(id) ?? previousByPattern.get(detail.pattern);
|
|
1446
|
-
const timestamps = (evidence?.timestamps ?? []).filter((value) => typeof value === "string" && value.length > 0).sort();
|
|
1447
|
-
const firstSeenAt = previous?.firstSeenAt ?? timestamps[0] ?? (/* @__PURE__ */ new Date()).toISOString();
|
|
1448
|
-
const lastSeenAt = timestamps[timestamps.length - 1] ?? previous?.lastSeenAt ?? firstSeenAt;
|
|
1449
|
-
return {
|
|
1450
|
-
id,
|
|
1451
|
-
pattern: detail.pattern,
|
|
1452
|
-
category: evidence?.category ?? "feedback",
|
|
1453
|
-
status: "active",
|
|
1454
|
-
agent: evidence?.agent ?? null,
|
|
1455
|
-
workflow: evidence?.workflow ?? null,
|
|
1456
|
-
tags: evidence ? [...evidence.tags].sort() : [],
|
|
1457
|
-
severity: evidence?.severity ?? null,
|
|
1458
|
-
confidence: evidence?.confidence ?? null,
|
|
1459
|
-
outcome: evidence?.outcome ?? null,
|
|
1460
|
-
provenance: detail.provenance,
|
|
1461
|
-
firstSeenAt,
|
|
1462
|
-
lastSeenAt,
|
|
1463
|
-
recurrenceCount: previous?.lastWeekId === weekId ? previous.recurrenceCount : (previous?.recurrenceCount ?? 0) + 1,
|
|
1464
|
-
lastWeekId: weekId,
|
|
1465
|
-
evidenceWindow: evidence?.evidenceWindow ?? { start: null, end: null },
|
|
1466
|
-
retiredAt: null
|
|
1467
|
-
};
|
|
1468
|
-
});
|
|
1469
|
-
const seenIds = new Set(registry.map((entry) => entry.id));
|
|
1470
|
-
const seenPatterns = new Set(registry.map((entry) => entry.pattern));
|
|
1471
|
-
for (const previous of previousRegistry) {
|
|
1472
|
-
if (seenIds.has(previous.id) || seenPatterns.has(previous.pattern)) continue;
|
|
1473
|
-
const staleWeeks = weekIdToIndex(weekId) - weekIdToIndex(previous.lastWeekId);
|
|
1474
|
-
registry.push({
|
|
1475
|
-
...previous,
|
|
1476
|
-
status: staleWeeks >= RETIREMENT_WINDOW_WEEKS ? "retired" : previous.status,
|
|
1477
|
-
retiredAt: staleWeeks >= RETIREMENT_WINDOW_WEEKS ? previous.retiredAt ?? (/* @__PURE__ */ new Date()).toISOString() : previous.retiredAt ?? null
|
|
1478
|
-
});
|
|
1479
|
-
}
|
|
1480
|
-
registry.sort(
|
|
1481
|
-
(a, b) => Number(b.status === "active") - Number(a.status === "active") || b.recurrenceCount - a.recurrenceCount || b.lastSeenAt.localeCompare(a.lastSeenAt) || a.pattern.localeCompare(b.pattern)
|
|
1482
|
-
);
|
|
1483
|
-
return {
|
|
1484
|
-
version: COMPOUNDING_VERSION,
|
|
1485
|
-
updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1486
|
-
patterns: details.map((d) => d.pattern),
|
|
1487
|
-
details,
|
|
1488
|
-
registry
|
|
1489
|
-
};
|
|
1490
|
-
}
|
|
1491
|
-
formatWeeklyReport(weekId, entries, patterns, patternDetails, continuity, outcomeSummary, promotionCandidates) {
|
|
1492
|
-
const byAgent = /* @__PURE__ */ new Map();
|
|
1493
|
-
for (const wrapped of entries) {
|
|
1494
|
-
const list = byAgent.get(wrapped.entry.agent) ?? [];
|
|
1495
|
-
list.push(wrapped);
|
|
1496
|
-
byAgent.set(wrapped.entry.agent, list);
|
|
1497
|
-
}
|
|
1498
|
-
const lines = [
|
|
1499
|
-
`# Weekly Compounding \u2014 ${weekId}`,
|
|
1500
|
-
"",
|
|
1501
|
-
"This file is generated by Engram's compounding engine (v5.0).",
|
|
1502
|
-
"",
|
|
1503
|
-
"## Summary",
|
|
1504
|
-
`- Feedback entries: ${entries.length}`,
|
|
1505
|
-
`- Mistake patterns: ${patterns.length}`,
|
|
1506
|
-
"",
|
|
1507
|
-
"## By Agent"
|
|
1508
|
-
];
|
|
1509
|
-
if (byAgent.size === 0) {
|
|
1510
|
-
lines.push("- (none)");
|
|
1511
|
-
} else {
|
|
1512
|
-
for (const [agent, list] of Array.from(byAgent.entries()).sort((a, b) => a[0].localeCompare(b[0]))) {
|
|
1513
|
-
const approved = list.filter((e) => e.entry.decision === "approved").length;
|
|
1514
|
-
const awf = list.filter((e) => e.entry.decision === "approved_with_feedback").length;
|
|
1515
|
-
const rejected = list.filter((e) => e.entry.decision === "rejected").length;
|
|
1516
|
-
lines.push(`### ${agent}`);
|
|
1517
|
-
lines.push(`- approved: ${approved}`);
|
|
1518
|
-
lines.push(`- approved_with_feedback: ${awf}`);
|
|
1519
|
-
lines.push(`- rejected: ${rejected}`);
|
|
1520
|
-
const provenance = list.slice(0, 3).map((e) => `${path2.basename(e.sourcePath)}:L${e.sourceLine}#${e.entryId}`);
|
|
1521
|
-
if (provenance.length > 0) {
|
|
1522
|
-
lines.push(`- provenance: ${provenance.join(", ")}`);
|
|
1523
|
-
}
|
|
1524
|
-
lines.push("");
|
|
1525
|
-
}
|
|
1526
|
-
}
|
|
1527
|
-
lines.push("## Patterns (Avoid / Prefer)");
|
|
1528
|
-
if (patterns.length === 0) {
|
|
1529
|
-
lines.push("- (none yet)");
|
|
1530
|
-
} else {
|
|
1531
|
-
const detailMap = new Map(patternDetails.map((d) => [d.pattern, d.provenance]));
|
|
1532
|
-
for (const p of patterns.slice(0, 100)) {
|
|
1533
|
-
const provenance = detailMap.get(p) ?? [];
|
|
1534
|
-
if (provenance.length > 0) {
|
|
1535
|
-
lines.push(`- ${p} _(source: ${provenance.join(", ")})_`);
|
|
1536
|
-
} else {
|
|
1537
|
-
lines.push(`- ${p}`);
|
|
1538
|
-
}
|
|
1539
|
-
}
|
|
1540
|
-
}
|
|
1541
|
-
lines.push("");
|
|
1542
|
-
lines.push("## Outcome Weighting");
|
|
1543
|
-
if (outcomeSummary.length === 0) {
|
|
1544
|
-
lines.push("- (no action outcomes recorded this week)");
|
|
1545
|
-
} else {
|
|
1546
|
-
for (const item of outcomeSummary.slice(0, 20)) {
|
|
1547
|
-
lines.push(
|
|
1548
|
-
`- ${item.action}: applied=${item.counts.applied}, skipped=${item.counts.skipped}, failed=${item.counts.failed}, weight=${item.weightedScore} _(source: ${item.provenance.join(", ")})_`
|
|
1549
|
-
);
|
|
1550
|
-
}
|
|
1551
|
-
}
|
|
1552
|
-
lines.push("");
|
|
1553
|
-
if (this.config.compoundingSemanticEnabled) {
|
|
1554
|
-
lines.push("## Promotion Candidates (Advisory)");
|
|
1555
|
-
if (promotionCandidates.length === 0) {
|
|
1556
|
-
lines.push("- (no advisory promotion candidates this week)");
|
|
1557
|
-
} else {
|
|
1558
|
-
for (const candidate of promotionCandidates) {
|
|
1559
|
-
const outcomeSummaryText = candidate.outcome ? ` outcomes[a=${candidate.outcome.applied}, s=${candidate.outcome.skipped}, f=${candidate.outcome.failed}]` : "";
|
|
1560
|
-
lines.push(
|
|
1561
|
-
`- [${candidate.sourceType}] ${candidate.subject} -> ${candidate.content} (category=${candidate.category}, score=${candidate.score}, id=${candidate.id}): ${candidate.rationale}${outcomeSummaryText} _(source: ${candidate.provenance.join(", ")})_`
|
|
1562
|
-
);
|
|
1563
|
-
}
|
|
1564
|
-
}
|
|
1565
|
-
lines.push("");
|
|
1566
|
-
lines.push("_Advisory only: no automatic promotion write is performed by this report. Use `compounding_promote_candidate` or `openclaw engram compounding-promote` to persist one manually._");
|
|
1567
|
-
lines.push("");
|
|
1568
|
-
}
|
|
1569
|
-
if (this.config.continuityAuditEnabled) {
|
|
1570
|
-
lines.push("## Continuity Audits");
|
|
1571
|
-
if (continuity.weeklyPath) {
|
|
1572
|
-
lines.push(`- weekly: ${continuity.weeklyPath}`);
|
|
1573
|
-
} else {
|
|
1574
|
-
lines.push(`- weekly: (missing for ${weekId})`);
|
|
1575
|
-
}
|
|
1576
|
-
if (continuity.monthlyPath) {
|
|
1577
|
-
lines.push(`- monthly: ${continuity.monthlyPath}`);
|
|
1578
|
-
} else {
|
|
1579
|
-
lines.push(`- monthly: (missing for ${continuity.monthId})`);
|
|
1580
|
-
}
|
|
1581
|
-
lines.push("");
|
|
1582
|
-
}
|
|
1583
|
-
return lines.join("\n");
|
|
1584
|
-
}
|
|
1585
|
-
buildRubricSnapshot(entries, outcomeSummary) {
|
|
1586
|
-
const updatedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
1587
|
-
const byAgent = /* @__PURE__ */ new Map();
|
|
1588
|
-
const byWorkflow = /* @__PURE__ */ new Map();
|
|
1589
|
-
for (const wrapped of entries) {
|
|
1590
|
-
const note = (wrapped.entry.learning && wrapped.entry.learning.trim().length > 0 ? wrapped.entry.learning : wrapped.entry.decision === "rejected" ? wrapped.entry.reason : "").trim();
|
|
1591
|
-
if (!note) continue;
|
|
1592
|
-
const provenance = `${path2.basename(wrapped.sourcePath)}:L${wrapped.sourceLine}#${wrapped.entryId}`;
|
|
1593
|
-
const agentEntry = byAgent.get(wrapped.entry.agent) ?? {
|
|
1594
|
-
id: stableRubricId("agent", wrapped.entry.agent),
|
|
1595
|
-
kind: "agent",
|
|
1596
|
-
subject: wrapped.entry.agent,
|
|
1597
|
-
observations: [],
|
|
1598
|
-
tags: [],
|
|
1599
|
-
provenance: [],
|
|
1600
|
-
observationEntries: [],
|
|
1601
|
-
updatedAt
|
|
1602
|
-
};
|
|
1603
|
-
this.addRubricObservation(agentEntry, note, provenance);
|
|
1604
|
-
agentEntry.tags = normalizeTags([...agentEntry.tags, ...normalizeTags(wrapped.entry.tags)]);
|
|
1605
|
-
byAgent.set(wrapped.entry.agent, agentEntry);
|
|
1606
|
-
const workflow = wrapped.entry.workflow?.trim();
|
|
1607
|
-
if (!workflow) continue;
|
|
1608
|
-
const workflowEntry = byWorkflow.get(workflow) ?? {
|
|
1609
|
-
id: stableRubricId("workflow", workflow),
|
|
1610
|
-
kind: "workflow",
|
|
1611
|
-
subject: workflow,
|
|
1612
|
-
observations: [],
|
|
1613
|
-
tags: [],
|
|
1614
|
-
provenance: [],
|
|
1615
|
-
observationEntries: [],
|
|
1616
|
-
updatedAt
|
|
1617
|
-
};
|
|
1618
|
-
this.addRubricObservation(workflowEntry, note, provenance);
|
|
1619
|
-
workflowEntry.tags = normalizeTags([...workflowEntry.tags, ...normalizeTags(wrapped.entry.tags)]);
|
|
1620
|
-
byWorkflow.set(workflow, workflowEntry);
|
|
1621
|
-
}
|
|
1622
|
-
for (const item of outcomeSummary) {
|
|
1623
|
-
const workflowEntry = byWorkflow.get(item.action) ?? {
|
|
1624
|
-
id: stableRubricId("workflow", item.action),
|
|
1625
|
-
kind: "workflow",
|
|
1626
|
-
subject: item.action,
|
|
1627
|
-
observations: [],
|
|
1628
|
-
tags: [],
|
|
1629
|
-
provenance: [],
|
|
1630
|
-
observationEntries: [],
|
|
1631
|
-
updatedAt
|
|
1632
|
-
};
|
|
1633
|
-
this.addRubricObservation(
|
|
1634
|
-
workflowEntry,
|
|
1635
|
-
`Outcome weight=${item.weightedScore} (applied=${item.counts.applied}, skipped=${item.counts.skipped}, failed=${item.counts.failed})`,
|
|
1636
|
-
...item.provenance
|
|
1637
|
-
);
|
|
1638
|
-
byWorkflow.set(item.action, workflowEntry);
|
|
1639
|
-
}
|
|
1640
|
-
return {
|
|
1641
|
-
updatedAt,
|
|
1642
|
-
agents: [...byAgent.values()].sort((a, b) => a.subject.localeCompare(b.subject)),
|
|
1643
|
-
workflows: [...byWorkflow.values()].sort((a, b) => a.subject.localeCompare(b.subject))
|
|
1644
|
-
};
|
|
1645
|
-
}
|
|
1646
|
-
formatRubrics(outcomeSummary, snapshot) {
|
|
1647
|
-
const lines = [
|
|
1648
|
-
"# Compounding Rubrics",
|
|
1649
|
-
"",
|
|
1650
|
-
`Generated: ${snapshot.updatedAt}`,
|
|
1651
|
-
"",
|
|
1652
|
-
"Stable, deterministic rubric snapshot generated from weekly feedback + action outcomes.",
|
|
1653
|
-
""
|
|
1654
|
-
];
|
|
1655
|
-
lines.push("## Agent Rubrics");
|
|
1656
|
-
if (snapshot.agents.length === 0) {
|
|
1657
|
-
lines.push("- (none yet)");
|
|
1658
|
-
} else {
|
|
1659
|
-
for (const rubric of snapshot.agents) {
|
|
1660
|
-
lines.push(`### ${rubric.subject}`);
|
|
1661
|
-
const observations = this.getRubricObservationEntries(rubric).slice(0, 8);
|
|
1662
|
-
if (observations.length === 0) {
|
|
1663
|
-
lines.push("- No rubric deltas this week.");
|
|
1664
|
-
} else {
|
|
1665
|
-
for (const observation of observations) {
|
|
1666
|
-
const provenance = observation.provenance.join(", ");
|
|
1667
|
-
lines.push(`- ${observation.note}${provenance ? ` _(source: ${provenance})_` : ""}`);
|
|
1668
|
-
}
|
|
1669
|
-
}
|
|
1670
|
-
lines.push("");
|
|
1671
|
-
}
|
|
1672
|
-
}
|
|
1673
|
-
lines.push("## Workflow Rubrics");
|
|
1674
|
-
if (snapshot.workflows.length === 0) {
|
|
1675
|
-
lines.push("- (none yet)");
|
|
1676
|
-
} else {
|
|
1677
|
-
for (const rubric of snapshot.workflows) {
|
|
1678
|
-
lines.push(`### ${rubric.subject}`);
|
|
1679
|
-
for (const observation of this.getRubricObservationEntries(rubric).slice(0, 8)) {
|
|
1680
|
-
const provenance = observation.provenance.join(", ");
|
|
1681
|
-
lines.push(`- ${observation.note}${provenance ? ` _(source: ${provenance})_` : ""}`);
|
|
1682
|
-
}
|
|
1683
|
-
lines.push("");
|
|
1684
|
-
}
|
|
1685
|
-
}
|
|
1686
|
-
lines.push("## Action Outcome Signals");
|
|
1687
|
-
if (outcomeSummary.length === 0) {
|
|
1688
|
-
lines.push("- (none yet)");
|
|
1689
|
-
} else {
|
|
1690
|
-
for (const item of outcomeSummary.slice(0, 20)) {
|
|
1691
|
-
lines.push(
|
|
1692
|
-
`- ${item.action}: weight=${item.weightedScore} (applied=${item.counts.applied}, skipped=${item.counts.skipped}, failed=${item.counts.failed})`
|
|
1693
|
-
);
|
|
1694
|
-
}
|
|
1695
|
-
}
|
|
1696
|
-
lines.push("");
|
|
1697
|
-
return lines.join("\n");
|
|
1698
|
-
}
|
|
1699
|
-
async syncRubricArtifacts(snapshot) {
|
|
1700
|
-
await this.replaceRubricDirectory(this.rubricsAgentsDir, snapshot.agents);
|
|
1701
|
-
await this.replaceRubricDirectory(this.rubricsWorkflowsDir, snapshot.workflows);
|
|
1702
|
-
}
|
|
1703
|
-
async replaceRubricDirectory(dir, entries) {
|
|
1704
|
-
await mkdir2(dir, { recursive: true });
|
|
1705
|
-
try {
|
|
1706
|
-
const names = await readdir2(dir);
|
|
1707
|
-
await Promise.all(
|
|
1708
|
-
names.filter((name) => name.endsWith(".md")).map((name) => unlink(path2.join(dir, name)).catch(() => void 0))
|
|
1709
|
-
);
|
|
1710
|
-
} catch {
|
|
1711
|
-
}
|
|
1712
|
-
const slugCollisions = /* @__PURE__ */ new Map();
|
|
1713
|
-
for (const entry of entries) {
|
|
1714
|
-
const slug = stableSlug(entry.subject);
|
|
1715
|
-
slugCollisions.set(slug, (slugCollisions.get(slug) ?? 0) + 1);
|
|
1716
|
-
}
|
|
1717
|
-
await Promise.all(entries.map(async (entry) => {
|
|
1718
|
-
const observationEntries = this.getRubricObservationEntries(entry);
|
|
1719
|
-
const body = [
|
|
1720
|
-
`# ${entry.kind === "agent" ? "Agent" : "Workflow"} Rubric \u2014 ${entry.subject}`,
|
|
1721
|
-
"",
|
|
1722
|
-
`Updated: ${entry.updatedAt}`,
|
|
1723
|
-
"",
|
|
1724
|
-
"## Observations",
|
|
1725
|
-
...observationEntries.length > 0 ? observationEntries.map((item) => `- ${item.note}`) : ["- (none yet)"],
|
|
1726
|
-
"",
|
|
1727
|
-
"## Provenance",
|
|
1728
|
-
...entry.provenance.length > 0 ? entry.provenance.map((item) => `- ${item}`) : ["- (none yet)"],
|
|
1729
|
-
""
|
|
1730
|
-
].join("\n");
|
|
1731
|
-
const fileName = rubricArtifactFileName(entry, slugCollisions);
|
|
1732
|
-
await writeFile2(path2.join(dir, fileName), body, "utf-8");
|
|
1733
|
-
}));
|
|
1734
|
-
}
|
|
1735
|
-
scoreRubricForQuery(entry, queryTokens) {
|
|
1736
|
-
if (queryTokens.length === 0) return entry.observations.length;
|
|
1737
|
-
const haystack = [entry.subject, ...entry.observations, ...entry.tags].join(" ").toLowerCase();
|
|
1738
|
-
let score = 0;
|
|
1739
|
-
for (const token of queryTokens) {
|
|
1740
|
-
if (haystack.includes(token)) score += 2;
|
|
1741
|
-
if (entry.subject.toLowerCase().includes(token)) score += 2;
|
|
1742
|
-
}
|
|
1743
|
-
if (score === 0) return 0;
|
|
1744
|
-
return score + Math.min(entry.observations.length, 3);
|
|
1745
|
-
}
|
|
1746
|
-
normalizeRubricEntry(entry) {
|
|
1747
|
-
const normalizedEntries = this.getRubricObservationEntries(entry);
|
|
1748
|
-
return {
|
|
1749
|
-
...entry,
|
|
1750
|
-
observations: normalizedEntries.map((item) => item.note),
|
|
1751
|
-
provenance: [...new Set(normalizedEntries.flatMap((item) => item.provenance))],
|
|
1752
|
-
observationEntries: normalizedEntries
|
|
1753
|
-
};
|
|
1754
|
-
}
|
|
1755
|
-
getRubricObservationEntries(entry) {
|
|
1756
|
-
if (Array.isArray(entry.observationEntries) && entry.observationEntries.length > 0) {
|
|
1757
|
-
return entry.observationEntries.map((item) => ({
|
|
1758
|
-
note: item.note,
|
|
1759
|
-
provenance: [...new Set(item.provenance)].sort()
|
|
1760
|
-
}));
|
|
1761
|
-
}
|
|
1762
|
-
return entry.observations.map((note, index) => ({
|
|
1763
|
-
note,
|
|
1764
|
-
provenance: entry.provenance[index] ? [entry.provenance[index]] : entry.provenance[0] ? [entry.provenance[0]] : []
|
|
1765
|
-
}));
|
|
1766
|
-
}
|
|
1767
|
-
isSyntheticOutcomeRubricObservation(note) {
|
|
1768
|
-
return note.trimStart().startsWith("Outcome weight=");
|
|
1769
|
-
}
|
|
1770
|
-
addRubricObservation(entry, note, ...provenance) {
|
|
1771
|
-
const normalized = this.normalizeRubricEntry(entry);
|
|
1772
|
-
const existing = normalized.observationEntries?.find((item) => item.note === note);
|
|
1773
|
-
if (existing) {
|
|
1774
|
-
existing.provenance = [.../* @__PURE__ */ new Set([...existing.provenance, ...provenance])].sort();
|
|
1775
|
-
} else {
|
|
1776
|
-
normalized.observationEntries?.push({
|
|
1777
|
-
note,
|
|
1778
|
-
provenance: [...new Set(provenance)].sort()
|
|
1779
|
-
});
|
|
1780
|
-
}
|
|
1781
|
-
entry.observationEntries = normalized.observationEntries;
|
|
1782
|
-
entry.observations = normalized.observationEntries?.map((item) => item.note) ?? [];
|
|
1783
|
-
entry.provenance = [...new Set((normalized.observationEntries ?? []).flatMap((item) => item.provenance))];
|
|
1784
|
-
}
|
|
1785
|
-
async readOptionalIdentityAnchorForAudit() {
|
|
1786
|
-
try {
|
|
1787
|
-
return await this.storage.readIdentityAnchor();
|
|
1788
|
-
} catch {
|
|
1789
|
-
return null;
|
|
1790
|
-
}
|
|
1791
|
-
}
|
|
1792
|
-
async readOptionalImprovementLoopsForAudit() {
|
|
1793
|
-
try {
|
|
1794
|
-
return await this.storage.readIdentityImprovementLoops();
|
|
1795
|
-
} catch {
|
|
1796
|
-
return null;
|
|
1797
|
-
}
|
|
1798
|
-
}
|
|
1799
|
-
async readContinuityIncidentsForAudit(limit, state) {
|
|
1800
|
-
try {
|
|
1801
|
-
return await this.storage.readContinuityIncidents(limit, state);
|
|
1802
|
-
} catch {
|
|
1803
|
-
return [];
|
|
1804
|
-
}
|
|
1805
|
-
}
|
|
1806
|
-
async readOptionalIdentityAuditForReference(period, key) {
|
|
1807
|
-
try {
|
|
1808
|
-
return await this.storage.readIdentityAudit(period, key);
|
|
1809
|
-
} catch {
|
|
1810
|
-
return null;
|
|
1811
|
-
}
|
|
1812
|
-
}
|
|
1813
|
-
async readContinuityAuditReferences(weekId) {
|
|
1814
|
-
const monthId = monthIdFromIsoWeek(weekId);
|
|
1815
|
-
const weeklyPath = path2.join(this.identityAuditWeeklyDir, `${weekId}.md`);
|
|
1816
|
-
const monthlyPath = path2.join(this.identityAuditMonthlyDir, `${monthId}.md`);
|
|
1817
|
-
const [weeklyAudit, monthlyAudit] = await Promise.all([
|
|
1818
|
-
this.readOptionalIdentityAuditForReference("weekly", weekId),
|
|
1819
|
-
this.readOptionalIdentityAuditForReference("monthly", monthId)
|
|
1820
|
-
]);
|
|
1821
|
-
const weeklyExists = (weeklyAudit ?? "").trim().length > 0;
|
|
1822
|
-
const monthlyExists = (monthlyAudit ?? "").trim().length > 0;
|
|
1823
|
-
return {
|
|
1824
|
-
weekId,
|
|
1825
|
-
monthId,
|
|
1826
|
-
weeklyPath: weeklyExists ? weeklyPath : null,
|
|
1827
|
-
monthlyPath: monthlyExists ? monthlyPath : null
|
|
1828
|
-
};
|
|
1829
|
-
}
|
|
1830
|
-
};
|
|
1831
|
-
|
|
1832
|
-
export {
|
|
1833
|
-
SharedContextManager,
|
|
1834
|
-
defaultTierMigrationCycleBudget,
|
|
1835
|
-
CompoundingEngine
|
|
1836
|
-
};
|
|
1837
|
-
//# sourceMappingURL=chunk-FQDPCE3I.js.map
|