@remnic/core 10.0.168 → 10.0.169
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/access-admin-ops-surface.js +138 -137
- package/dist/access-cli.js +138 -137
- package/dist/access-cli.js.map +1 -1
- package/dist/access-coding-context-resolution.js +11 -11
- package/dist/access-extraction-force-flush-preempt.js +138 -137
- package/dist/access-extraction-force-flush.js +138 -137
- package/dist/access-http-briefing.js +138 -137
- package/dist/access-http-query.js +138 -137
- package/dist/access-http.js +138 -137
- package/dist/access-identity-continuity-surface.js +138 -137
- package/dist/access-lcm-surface.js +138 -137
- package/dist/access-mcp.js +138 -137
- package/dist/access-observe-write-category.js +11 -11
- package/dist/access-observe-write-surface.js +138 -137
- package/dist/access-offline-manifest.js +9 -9
- package/dist/access-operations-batch.js +138 -137
- package/dist/access-operations.js +138 -137
- package/dist/access-recall-concurrency.js +138 -137
- package/dist/access-recall-excerpt-attribution.d.ts +19 -0
- package/dist/access-recall-excerpt-attribution.d.ts.map +1 -0
- package/dist/access-recall-excerpt-attribution.js +8 -0
- package/dist/access-recall-response.js +138 -137
- package/dist/access-recall-surface.d.ts.map +1 -1
- package/dist/access-recall-surface.js +138 -137
- package/dist/access-schema.js +10 -10
- package/dist/access-service.js +138 -137
- package/dist/active-recall.js +24 -24
- package/dist/adapters/index.js +4 -4
- package/dist/adapters/registry.js +2 -2
- package/dist/{auto-sync-L3M4RKJD.js → auto-sync-ACP5U5A3.js} +3 -3
- package/dist/binary-lifecycle/scanner.d.ts +2 -4
- package/dist/binary-lifecycle/scanner.d.ts.map +1 -1
- package/dist/briefing.js +13 -13
- package/dist/buffer-add-turns-bounded.d.ts +11 -1
- package/dist/buffer-add-turns-bounded.d.ts.map +1 -1
- package/dist/buffer-add-turns-bounded.js +3 -3
- package/dist/buffer-session-cap.d.ts +2 -2
- package/dist/buffer-session-cap.d.ts.map +1 -1
- package/dist/buffer-session-cap.js +1 -1
- package/dist/buffer.d.ts +3 -2
- package/dist/buffer.d.ts.map +1 -1
- package/dist/buffer.js +12 -12
- package/dist/calibration.d.ts +19 -2
- package/dist/calibration.d.ts.map +1 -1
- package/dist/calibration.js +28 -5
- package/dist/calibration.js.map +1 -1
- package/dist/{capsule-crypto-GWVG7LGC.js → capsule-crypto-7FJQINUR.js} +2 -2
- package/dist/{capsule-merge-VHBRF65A.js → capsule-merge-BADOICNP.js} +2 -2
- package/dist/causal-behavior.js +2 -2
- package/dist/causal-chain.js +2 -2
- package/dist/causal-consolidation.js +17 -17
- package/dist/causal-retrieval.js +2 -2
- package/dist/causal-trajectory-graph.js +3 -3
- package/dist/causal-trajectory.js +1 -1
- package/dist/{chunk-OWHERGF2.js → chunk-2NLLXCJG.js} +2 -2
- package/dist/{chunk-D6BOOYNJ.js → chunk-32OTLNAU.js} +271 -237
- package/dist/chunk-32OTLNAU.js.map +1 -0
- package/dist/{chunk-L7SEYUHS.js → chunk-3I3NXB6X.js} +3 -3
- package/dist/{chunk-4NBUHYUV.js → chunk-3LADDLAF.js} +5 -5
- package/dist/{chunk-2DL3OFLD.js → chunk-45GEJRIG.js} +2 -2
- package/dist/{chunk-5BE3FLKL.js → chunk-5KDDAQ6K.js} +8 -8
- package/dist/{chunk-BPCR5DZP.js → chunk-62YZOQFR.js} +5 -5
- package/dist/chunk-62YZOQFR.js.map +1 -0
- package/dist/{chunk-HLWXCDUQ.js → chunk-63A2BU2B.js} +5 -5
- package/dist/{chunk-MOUSHJAR.js → chunk-7FPI5MFB.js} +5 -5
- package/dist/{chunk-ZX546Y3Y.js → chunk-7OYDFIL4.js} +2 -2
- package/dist/{chunk-CKZWLAHN.js → chunk-ACPFBVUD.js} +2 -2
- package/dist/{chunk-BKTCVXMK.js → chunk-AHOYKJ5X.js} +3 -3
- package/dist/{chunk-WEHSQBFR.js → chunk-AIF6V2OX.js} +9 -4
- package/dist/chunk-AIF6V2OX.js.map +1 -0
- package/dist/{chunk-FGT7CUYZ.js → chunk-ALTLOHO7.js} +2 -2
- package/dist/{chunk-FMFCQRDM.js → chunk-AUFPPBC3.js} +3 -3
- package/dist/{chunk-OAQRZ4SV.js → chunk-B5KTTWC7.js} +2 -2
- package/dist/{chunk-73TPOGS4.js → chunk-BFBS7OFQ.js} +9 -9
- package/dist/{chunk-QFTK6EDM.js → chunk-BFZFNXOC.js} +13 -13
- package/dist/{chunk-ZQUOUPP3.js → chunk-BHRPZBAH.js} +4 -4
- package/dist/{chunk-4L25GAYL.js → chunk-CX24SVLK.js} +2 -2
- package/dist/{chunk-YY57TRKN.js → chunk-D5ZLTLHF.js} +2 -2
- package/dist/{chunk-WEFFO2MJ.js → chunk-D6YCETHG.js} +2 -2
- package/dist/{chunk-ZDZJNXL6.js → chunk-DK2VBJ6Q.js} +4 -4
- package/dist/{chunk-VRHY7Y5A.js → chunk-DPL5VO5V.js} +3 -3
- package/dist/{chunk-LVGTH6IQ.js → chunk-E7ATID4Z.js} +11 -11
- package/dist/{chunk-CKELO7Q6.js → chunk-FHWX2REL.js} +2 -2
- package/dist/{chunk-CUPILBIP.js → chunk-FMIM36I4.js} +2 -2
- package/dist/{chunk-OWM2VWNX.js → chunk-FSXYBIEZ.js} +25 -24
- package/dist/chunk-FSXYBIEZ.js.map +1 -0
- package/dist/{chunk-A5UOREWD.js → chunk-FWTGO4NE.js} +2 -2
- package/dist/{chunk-3SL52JKD.js → chunk-FZVROZKC.js} +5 -5
- package/dist/{chunk-U3BCW7GX.js → chunk-G3RLCVJC.js} +3 -3
- package/dist/{chunk-UYIBNDQE.js → chunk-GF5NN3LE.js} +2 -2
- package/dist/{chunk-7OCKK5M5.js → chunk-GWY5ZFHP.js} +6 -6
- package/dist/{chunk-AL3TCNSJ.js → chunk-H3MLOQ7F.js} +24 -53
- package/dist/chunk-H3MLOQ7F.js.map +1 -0
- package/dist/{chunk-TNRGWJYT.js → chunk-H4IU24V5.js} +2 -2
- package/dist/{chunk-T4BT4FQN.js → chunk-HH6PXQ2B.js} +3 -3
- package/dist/{chunk-FEUWI5QH.js → chunk-HHPY5SSE.js} +2 -2
- package/dist/{chunk-OM5ESBES.js → chunk-HQPFACXO.js} +2 -2
- package/dist/{chunk-QLQUAVVP.js → chunk-I7WPLMUX.js} +16 -16
- package/dist/chunk-I7WPLMUX.js.map +1 -0
- package/dist/{chunk-IMULTENA.js → chunk-ID65XTF3.js} +2 -2
- package/dist/{chunk-WWQMZBDI.js → chunk-IJVU4ILJ.js} +4 -4
- package/dist/{chunk-GBSXTTLP.js → chunk-ITGAGNX5.js} +2 -2
- package/dist/chunk-IUGOGDCP.js +39 -0
- package/dist/chunk-IUGOGDCP.js.map +1 -0
- package/dist/{chunk-3PNJZTDV.js → chunk-JGGNUEVD.js} +2 -2
- package/dist/{chunk-YYXYZM2I.js → chunk-JN7OSQJR.js} +2 -2
- package/dist/{chunk-4D2EY4WM.js → chunk-K2DTHNDY.js} +6 -6
- package/dist/{chunk-TH6OYP6I.js → chunk-K36RMINQ.js} +3 -3
- package/dist/{chunk-OZKVVUJB.js → chunk-KIM5VNZN.js} +2 -2
- package/dist/{chunk-BFPQJNFZ.js → chunk-LXSDEPEK.js} +60 -11
- package/dist/{chunk-BFPQJNFZ.js.map → chunk-LXSDEPEK.js.map} +1 -1
- package/dist/{chunk-ZWDDY4WF.js → chunk-M7CFCRWJ.js} +2 -2
- package/dist/{chunk-QPFM6DHY.js → chunk-MTJFK42O.js} +2 -2
- package/dist/{chunk-RO5EGRAI.js → chunk-N3FRR6II.js} +2 -2
- package/dist/{chunk-UMEUU66X.js → chunk-O3OEVYUR.js} +2 -2
- package/dist/{chunk-J74YOBB3.js → chunk-PFR6ZKQI.js} +8 -8
- package/dist/{chunk-TAD6QMMD.js → chunk-PRC7SZYM.js} +2 -2
- package/dist/{chunk-LWZNSQN3.js → chunk-PUQQPLVV.js} +3 -3
- package/dist/{chunk-LWZNSQN3.js.map → chunk-PUQQPLVV.js.map} +1 -1
- package/dist/{chunk-GMO3BGOF.js → chunk-QC2MHZDD.js} +1 -1
- package/dist/{chunk-FOTFLHBN.js → chunk-QPLI7LUU.js} +3 -2
- package/dist/chunk-QPLI7LUU.js.map +1 -0
- package/dist/{chunk-2MWKUVHT.js → chunk-RK7SE3BL.js} +5 -5
- package/dist/{chunk-HDWISXFH.js → chunk-RVAPK2S7.js} +2 -2
- package/dist/{chunk-5PUZV73Z.js → chunk-SEIGLG62.js} +11 -11
- package/dist/{chunk-AVWOULJH.js → chunk-SH3GOZWK.js} +2 -2
- package/dist/{chunk-PFLN6TTW.js → chunk-T3MCVSUC.js} +2 -2
- package/dist/{chunk-WQUGCOKF.js → chunk-TFA6HPOA.js} +4 -4
- package/dist/{chunk-CLVILSBR.js → chunk-TGQW3AMK.js} +22 -22
- package/dist/{chunk-YZYAYUJQ.js → chunk-TLRIRISJ.js} +4 -4
- package/dist/{chunk-7VIJUZYW.js → chunk-TQ4CELUR.js} +3 -3
- package/dist/{chunk-5QDTZIGH.js → chunk-U7KP6QFU.js} +2 -2
- package/dist/{chunk-BUKK5SWA.js → chunk-UPD5XDJX.js} +5 -5
- package/dist/{chunk-BUKK5SWA.js.map → chunk-UPD5XDJX.js.map} +1 -1
- package/dist/{chunk-QVXEXGIM.js → chunk-VF6SC4OD.js} +2 -2
- package/dist/{chunk-EZG54YDS.js → chunk-VKXJQF5C.js} +2 -2
- package/dist/{chunk-RFLC6PKQ.js → chunk-VMRPLHEU.js} +2 -2
- package/dist/{chunk-U2PSE7MB.js → chunk-VPEIWMUT.js} +2 -2
- package/dist/{chunk-X67XNZ64.js → chunk-W4EJMMPP.js} +10 -10
- package/dist/{chunk-RB7NXZ2E.js → chunk-W4Q65VJL.js} +2 -2
- package/dist/{chunk-HDDRVXX4.js → chunk-W5LJ3SJ7.js} +2 -2
- package/dist/{chunk-W7N7NWG5.js → chunk-WCJQ3OUP.js} +2 -2
- package/dist/{chunk-JIF22AXI.js → chunk-WGKIXNLY.js} +5 -2
- package/dist/{chunk-JIF22AXI.js.map → chunk-WGKIXNLY.js.map} +1 -1
- package/dist/{chunk-FFWFFAP3.js → chunk-WI2WTIMY.js} +14 -8
- package/dist/chunk-WI2WTIMY.js.map +1 -0
- package/dist/{chunk-UVYI6VIX.js → chunk-X7Y7WX73.js} +1 -1
- package/dist/{chunk-22V3CMIW.js → chunk-XJTRIHTH.js} +8 -8
- package/dist/{chunk-SIONKXLU.js → chunk-XTRC6SSS.js} +14 -14
- package/dist/{chunk-SBRUTD5O.js → chunk-YSATDEBY.js} +5 -5
- package/dist/{chunk-3YOX2BQD.js → chunk-YWMCV5HL.js} +3 -3
- package/dist/{chunk-L272A5QW.js → chunk-YYDUBGUF.js} +30 -22
- package/dist/chunk-YYDUBGUF.js.map +1 -0
- package/dist/{chunk-6QWFZ3X5.js → chunk-ZA6CYFAK.js} +2 -2
- package/dist/cli.js +138 -137
- package/dist/coding/export-okf-codegraph.js +24 -24
- package/dist/coding/pre-action-gate.js +2 -2
- package/dist/compounding/engine.js +14 -14
- package/dist/config.js +24 -24
- package/dist/connectors/codex-marketplace.d.ts.map +1 -1
- package/dist/connectors/codex-materialize-runner.js +14 -14
- package/dist/connectors/codex-materialize.d.ts.map +1 -1
- package/dist/connectors/codex-materialize.js +1 -1
- package/dist/connectors/index.js +15 -15
- package/dist/consolidation-provenance-check.js +2 -2
- package/dist/convergence-refresh.js +15 -15
- package/dist/conversation-index/backend.js +2 -2
- package/dist/corpus-watermark.js +15 -15
- package/dist/deep-recall-http-glue.js +11 -11
- package/dist/embedding-fallback.js +2 -2
- package/dist/entity-retrieval.js +14 -14
- package/dist/event-order-recall.js +3 -3
- package/dist/explicit-capture.js +138 -137
- package/dist/extraction-judge.js +1 -1
- package/dist/extraction-normalization.js +1 -1
- package/dist/extraction-span-materialize.js +2 -2
- package/dist/extraction.js +27 -27
- package/dist/{graph-edge-decay-BC3IO2J4.js → graph-edge-decay-CXTNJ7IQ.js} +6 -6
- package/dist/graph-edge-decay-CXTNJ7IQ.js.map +1 -0
- package/dist/graph-jsonl.js +4 -4
- package/dist/graph-snapshot.js +4 -4
- package/dist/graph.js +5 -5
- package/dist/harmonic-retrieval.js +13 -13
- package/dist/index.js +197 -196
- package/dist/lcm/index.js +3 -3
- package/dist/local-llm.js +2 -2
- package/dist/location/index.js +14 -14
- package/dist/maintenance/memory-governance.js +13 -13
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +13 -13
- package/dist/maintenance/rebuild-memory-projection-runner.js +15 -15
- package/dist/maintenance/rebuild-memory-projection.js +14 -14
- package/dist/memory-browse.js +5 -5
- package/dist/memory-controller.d.ts.map +1 -1
- package/dist/memory-controller.js +1 -1
- package/dist/namespaces/migrate.js +14 -14
- package/dist/namespaces/search.js +7 -7
- package/dist/namespaces/storage.d.ts.map +1 -1
- package/dist/namespaces/storage.js +13 -13
- package/dist/offline-sync-changeset-generations.js +4 -4
- package/dist/offline-sync-embedding-generation.js +3 -3
- package/dist/offline-sync-snapshot-stream.js +7 -7
- package/dist/offline-sync.js +6 -6
- package/dist/operator-doctor-corpus.js +16 -16
- package/dist/operator-toolkit.js +35 -35
- package/dist/orchestration/backlog-scheduler.d.ts +4 -0
- package/dist/orchestration/backlog-scheduler.d.ts.map +1 -1
- package/dist/orchestration/backlog-scheduler.js +149 -142
- package/dist/orchestration/backlog-scheduler.js.map +1 -1
- package/dist/orchestration/buffer-drain-runner.js +139 -138
- package/dist/orchestration/extraction-persist-citation.d.ts +2 -2
- package/dist/orchestration/extraction-persist-citation.d.ts.map +1 -1
- package/dist/orchestration/extraction-persist.d.ts.map +1 -1
- package/dist/orchestration/maintenance.js +23 -23
- package/dist/orchestration/recall-internal.d.ts.map +1 -1
- package/dist/orchestration/turn-ingestion-buffered.d.ts.map +1 -1
- package/dist/orchestrator.d.ts.map +1 -1
- package/dist/orchestrator.js +140 -139
- package/dist/qmd.js +4 -4
- package/dist/recall-navigation.js +138 -137
- package/dist/recall-state-view-admission.js +5 -5
- package/dist/recall-state-view-packet.d.ts.map +1 -1
- package/dist/recall-state-view-packet.js +30 -8
- package/dist/recall-state-view-packet.js.map +1 -1
- package/dist/recall-why-service.js +5 -5
- package/dist/reconcile/manifest.js +2 -2
- package/dist/resume-bundles.js +25 -25
- package/dist/search/factory.js +6 -6
- package/dist/search/index.js +8 -8
- package/dist/semantic-consolidation.js +18 -18
- package/dist/semantic-rule-promotion.js +13 -13
- package/dist/semantic-rule-verifier.js +13 -13
- package/dist/source-agent-qualifier.js +18 -18
- package/dist/source-attribution.d.ts +3 -3
- package/dist/source-attribution.d.ts.map +1 -1
- package/dist/source-attribution.js +1 -1
- package/dist/standup/build.js +13 -13
- package/dist/storage.d.ts +1 -0
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +12 -12
- package/dist/summarizer.d.ts +7 -1
- package/dist/summarizer.d.ts.map +1 -1
- package/dist/summarizer.js +3 -3
- package/dist/support-passport/index.js +16 -16
- package/dist/transfer/autodetect.js +3 -3
- package/dist/transfer/backup.js +2 -2
- package/dist/transfer/capsule-export.js +3 -3
- package/dist/transfer/capsule-import.js +3 -3
- package/dist/transfer/export-okf.js +13 -13
- package/dist/transfer/import-json.js +2 -2
- package/dist/transfer/import-md.js +2 -2
- package/dist/transfer/types.d.ts +15 -3
- package/dist/transfer/types.d.ts.map +1 -1
- package/dist/transfer/types.js +3 -1
- package/dist/verified-recall.js +13 -13
- package/dist/who-knows-cli.js +14 -14
- package/dist/who-knows.js +13 -13
- package/package.json +2 -2
- package/src/access-cli.test.ts +9 -9
- package/src/access-recall-excerpt-attribution.ts +69 -0
- package/src/access-recall-surface.ts +23 -21
- package/src/access-service-raw-excerpt-read-gate.test.ts +192 -11
- package/src/backlog-scheduler.test.ts +31 -0
- package/src/binary-lifecycle/scanner.ts +35 -14
- package/src/buffer-add-turns-bounded.ts +16 -2
- package/src/buffer-session-cap.ts +4 -4
- package/src/buffer.ts +5 -5
- package/src/calibration.ts +56 -4
- package/src/connectors/codex-marketplace-git.test.ts +267 -0
- package/src/connectors/codex-marketplace.ts +76 -13
- package/src/connectors/codex-materialize.ts +29 -55
- package/src/memory-controller.test.ts +11 -0
- package/src/memory-controller.ts +5 -1
- package/src/namespaces/storage.ts +1 -0
- package/src/orchestration/backlog-scheduler.ts +12 -3
- package/src/orchestration/extraction-persist-citation.ts +5 -3
- package/src/orchestration/extraction-persist.ts +15 -14
- package/src/orchestration/recall-internal.ts +2 -3
- package/src/orchestration/turn-ingestion-buffered.test.ts +52 -1
- package/src/orchestration/turn-ingestion-buffered.ts +26 -8
- package/src/orchestrator.ts +1 -0
- package/src/recall-state-view-packet.test.ts +40 -0
- package/src/recall-state-view-packet.ts +46 -9
- package/src/source-attribution.test.ts +57 -0
- package/src/source-attribution.ts +46 -43
- package/src/storage.ts +4 -3
- package/src/summarizer-shutdown.test.ts +49 -16
- package/src/summarizer.ts +13 -5
- package/src/testing/subjects/memory-maintenance.test.ts +293 -0
- package/src/transfer/capsule-export.ts +2 -1
- package/src/transfer/capsule-taxonomy-version.test.ts +70 -0
- package/src/transfer/types.ts +13 -3
- package/dist/chunk-AL3TCNSJ.js.map +0 -1
- package/dist/chunk-BPCR5DZP.js.map +0 -1
- package/dist/chunk-D6BOOYNJ.js.map +0 -1
- package/dist/chunk-FFWFFAP3.js.map +0 -1
- package/dist/chunk-FOTFLHBN.js.map +0 -1
- package/dist/chunk-L272A5QW.js.map +0 -1
- package/dist/chunk-OWM2VWNX.js.map +0 -1
- package/dist/chunk-QLQUAVVP.js.map +0 -1
- package/dist/chunk-WEHSQBFR.js.map +0 -1
- /package/dist/{capsule-crypto-GWVG7LGC.js.map → access-recall-excerpt-attribution.js.map} +0 -0
- /package/dist/{auto-sync-L3M4RKJD.js.map → auto-sync-ACP5U5A3.js.map} +0 -0
- /package/dist/{graph-edge-decay-BC3IO2J4.js.map → capsule-crypto-7FJQINUR.js.map} +0 -0
- /package/dist/{capsule-merge-VHBRF65A.js.map → capsule-merge-BADOICNP.js.map} +0 -0
- /package/dist/{chunk-OWHERGF2.js.map → chunk-2NLLXCJG.js.map} +0 -0
- /package/dist/{chunk-L7SEYUHS.js.map → chunk-3I3NXB6X.js.map} +0 -0
- /package/dist/{chunk-4NBUHYUV.js.map → chunk-3LADDLAF.js.map} +0 -0
- /package/dist/{chunk-2DL3OFLD.js.map → chunk-45GEJRIG.js.map} +0 -0
- /package/dist/{chunk-5BE3FLKL.js.map → chunk-5KDDAQ6K.js.map} +0 -0
- /package/dist/{chunk-HLWXCDUQ.js.map → chunk-63A2BU2B.js.map} +0 -0
- /package/dist/{chunk-MOUSHJAR.js.map → chunk-7FPI5MFB.js.map} +0 -0
- /package/dist/{chunk-ZX546Y3Y.js.map → chunk-7OYDFIL4.js.map} +0 -0
- /package/dist/{chunk-CKZWLAHN.js.map → chunk-ACPFBVUD.js.map} +0 -0
- /package/dist/{chunk-BKTCVXMK.js.map → chunk-AHOYKJ5X.js.map} +0 -0
- /package/dist/{chunk-FGT7CUYZ.js.map → chunk-ALTLOHO7.js.map} +0 -0
- /package/dist/{chunk-FMFCQRDM.js.map → chunk-AUFPPBC3.js.map} +0 -0
- /package/dist/{chunk-OAQRZ4SV.js.map → chunk-B5KTTWC7.js.map} +0 -0
- /package/dist/{chunk-73TPOGS4.js.map → chunk-BFBS7OFQ.js.map} +0 -0
- /package/dist/{chunk-QFTK6EDM.js.map → chunk-BFZFNXOC.js.map} +0 -0
- /package/dist/{chunk-ZQUOUPP3.js.map → chunk-BHRPZBAH.js.map} +0 -0
- /package/dist/{chunk-4L25GAYL.js.map → chunk-CX24SVLK.js.map} +0 -0
- /package/dist/{chunk-YY57TRKN.js.map → chunk-D5ZLTLHF.js.map} +0 -0
- /package/dist/{chunk-WEFFO2MJ.js.map → chunk-D6YCETHG.js.map} +0 -0
- /package/dist/{chunk-ZDZJNXL6.js.map → chunk-DK2VBJ6Q.js.map} +0 -0
- /package/dist/{chunk-VRHY7Y5A.js.map → chunk-DPL5VO5V.js.map} +0 -0
- /package/dist/{chunk-LVGTH6IQ.js.map → chunk-E7ATID4Z.js.map} +0 -0
- /package/dist/{chunk-CKELO7Q6.js.map → chunk-FHWX2REL.js.map} +0 -0
- /package/dist/{chunk-CUPILBIP.js.map → chunk-FMIM36I4.js.map} +0 -0
- /package/dist/{chunk-A5UOREWD.js.map → chunk-FWTGO4NE.js.map} +0 -0
- /package/dist/{chunk-3SL52JKD.js.map → chunk-FZVROZKC.js.map} +0 -0
- /package/dist/{chunk-U3BCW7GX.js.map → chunk-G3RLCVJC.js.map} +0 -0
- /package/dist/{chunk-UYIBNDQE.js.map → chunk-GF5NN3LE.js.map} +0 -0
- /package/dist/{chunk-7OCKK5M5.js.map → chunk-GWY5ZFHP.js.map} +0 -0
- /package/dist/{chunk-TNRGWJYT.js.map → chunk-H4IU24V5.js.map} +0 -0
- /package/dist/{chunk-T4BT4FQN.js.map → chunk-HH6PXQ2B.js.map} +0 -0
- /package/dist/{chunk-FEUWI5QH.js.map → chunk-HHPY5SSE.js.map} +0 -0
- /package/dist/{chunk-OM5ESBES.js.map → chunk-HQPFACXO.js.map} +0 -0
- /package/dist/{chunk-IMULTENA.js.map → chunk-ID65XTF3.js.map} +0 -0
- /package/dist/{chunk-WWQMZBDI.js.map → chunk-IJVU4ILJ.js.map} +0 -0
- /package/dist/{chunk-GBSXTTLP.js.map → chunk-ITGAGNX5.js.map} +0 -0
- /package/dist/{chunk-3PNJZTDV.js.map → chunk-JGGNUEVD.js.map} +0 -0
- /package/dist/{chunk-YYXYZM2I.js.map → chunk-JN7OSQJR.js.map} +0 -0
- /package/dist/{chunk-4D2EY4WM.js.map → chunk-K2DTHNDY.js.map} +0 -0
- /package/dist/{chunk-TH6OYP6I.js.map → chunk-K36RMINQ.js.map} +0 -0
- /package/dist/{chunk-OZKVVUJB.js.map → chunk-KIM5VNZN.js.map} +0 -0
- /package/dist/{chunk-ZWDDY4WF.js.map → chunk-M7CFCRWJ.js.map} +0 -0
- /package/dist/{chunk-QPFM6DHY.js.map → chunk-MTJFK42O.js.map} +0 -0
- /package/dist/{chunk-RO5EGRAI.js.map → chunk-N3FRR6II.js.map} +0 -0
- /package/dist/{chunk-UMEUU66X.js.map → chunk-O3OEVYUR.js.map} +0 -0
- /package/dist/{chunk-J74YOBB3.js.map → chunk-PFR6ZKQI.js.map} +0 -0
- /package/dist/{chunk-TAD6QMMD.js.map → chunk-PRC7SZYM.js.map} +0 -0
- /package/dist/{chunk-GMO3BGOF.js.map → chunk-QC2MHZDD.js.map} +0 -0
- /package/dist/{chunk-2MWKUVHT.js.map → chunk-RK7SE3BL.js.map} +0 -0
- /package/dist/{chunk-HDWISXFH.js.map → chunk-RVAPK2S7.js.map} +0 -0
- /package/dist/{chunk-5PUZV73Z.js.map → chunk-SEIGLG62.js.map} +0 -0
- /package/dist/{chunk-AVWOULJH.js.map → chunk-SH3GOZWK.js.map} +0 -0
- /package/dist/{chunk-PFLN6TTW.js.map → chunk-T3MCVSUC.js.map} +0 -0
- /package/dist/{chunk-WQUGCOKF.js.map → chunk-TFA6HPOA.js.map} +0 -0
- /package/dist/{chunk-CLVILSBR.js.map → chunk-TGQW3AMK.js.map} +0 -0
- /package/dist/{chunk-YZYAYUJQ.js.map → chunk-TLRIRISJ.js.map} +0 -0
- /package/dist/{chunk-7VIJUZYW.js.map → chunk-TQ4CELUR.js.map} +0 -0
- /package/dist/{chunk-5QDTZIGH.js.map → chunk-U7KP6QFU.js.map} +0 -0
- /package/dist/{chunk-QVXEXGIM.js.map → chunk-VF6SC4OD.js.map} +0 -0
- /package/dist/{chunk-EZG54YDS.js.map → chunk-VKXJQF5C.js.map} +0 -0
- /package/dist/{chunk-RFLC6PKQ.js.map → chunk-VMRPLHEU.js.map} +0 -0
- /package/dist/{chunk-U2PSE7MB.js.map → chunk-VPEIWMUT.js.map} +0 -0
- /package/dist/{chunk-X67XNZ64.js.map → chunk-W4EJMMPP.js.map} +0 -0
- /package/dist/{chunk-RB7NXZ2E.js.map → chunk-W4Q65VJL.js.map} +0 -0
- /package/dist/{chunk-HDDRVXX4.js.map → chunk-W5LJ3SJ7.js.map} +0 -0
- /package/dist/{chunk-W7N7NWG5.js.map → chunk-WCJQ3OUP.js.map} +0 -0
- /package/dist/{chunk-UVYI6VIX.js.map → chunk-X7Y7WX73.js.map} +0 -0
- /package/dist/{chunk-22V3CMIW.js.map → chunk-XJTRIHTH.js.map} +0 -0
- /package/dist/{chunk-SIONKXLU.js.map → chunk-XTRC6SSS.js.map} +0 -0
- /package/dist/{chunk-SBRUTD5O.js.map → chunk-YSATDEBY.js.map} +0 -0
- /package/dist/{chunk-3YOX2BQD.js.map → chunk-YWMCV5HL.js.map} +0 -0
- /package/dist/{chunk-6QWFZ3X5.js.map → chunk-ZA6CYFAK.js.map} +0 -0
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* #3611: `resolveGit` delegated git URLs to raw-URL resolution — only
|
|
3
|
+
* GitHub-HTTPS-shaped inputs survived; SSH URLs (git@host:o/r.git), GitLab,
|
|
4
|
+
* self-hosted remotes, and file:// / local-path git sources all threw
|
|
5
|
+
* "Git URL resolution requires a GitHub-format URL", and the error even
|
|
6
|
+
* misdirected to --type github, which cannot parse SSH form either.
|
|
7
|
+
*
|
|
8
|
+
* Root fix: resolve the manifest by really cloning the source
|
|
9
|
+
* (`git clone --depth 1`), then reading marketplace.json from the
|
|
10
|
+
* checkout. These tests use local file:// remotes so they are hermetic —
|
|
11
|
+
* the same code path carries SSH and hosted HTTPS URLs because git
|
|
12
|
+
* handles the transport.
|
|
13
|
+
*/
|
|
14
|
+
import assert from "node:assert/strict";
|
|
15
|
+
import { execFileSync } from "node:child_process";
|
|
16
|
+
import { existsSync } from "node:fs";
|
|
17
|
+
import { mkdir, mkdtemp, readdir, rm, writeFile } from "node:fs/promises";
|
|
18
|
+
import os from "node:os";
|
|
19
|
+
import path from "node:path";
|
|
20
|
+
import test from "node:test";
|
|
21
|
+
|
|
22
|
+
import { parseConfig } from "../config.js";
|
|
23
|
+
import { installFromMarketplace } from "./codex-marketplace.js";
|
|
24
|
+
|
|
25
|
+
const MANIFEST = JSON.stringify(
|
|
26
|
+
{
|
|
27
|
+
version: 1,
|
|
28
|
+
name: "test-market",
|
|
29
|
+
description: "fixture",
|
|
30
|
+
plugins: [
|
|
31
|
+
{
|
|
32
|
+
name: "demo",
|
|
33
|
+
version: "1.0.0",
|
|
34
|
+
description: "demo plugin",
|
|
35
|
+
repository: "owner/repo",
|
|
36
|
+
installType: "git",
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
},
|
|
40
|
+
null,
|
|
41
|
+
2,
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
function git(cwd: string, args: string[]): void {
|
|
45
|
+
execFileSync("git", args, {
|
|
46
|
+
cwd,
|
|
47
|
+
env: { ...process.env, GIT_TERMINAL_PROMPT: "0" },
|
|
48
|
+
stdio: ["ignore", "ignore", "ignore"],
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
async function makeGitRemote(): Promise<{ dir: string; fileUrl: string }> {
|
|
53
|
+
const dir = await mkdtemp(path.join(os.tmpdir(), "remnic-mkt-git-"));
|
|
54
|
+
git(dir, ["init", "-q", "-b", "main"]);
|
|
55
|
+
// Fleet git-identity-guard hook lives in a global core.hooksPath and
|
|
56
|
+
// refuses fixture commits; point this throwaway repo at an empty dir.
|
|
57
|
+
const noHooks = path.join(dir, ".no-hooks");
|
|
58
|
+
await mkdir(noHooks);
|
|
59
|
+
git(dir, ["config", "core.hooksPath", noHooks]);
|
|
60
|
+
git(dir, ["config", "user.email", "test@example.com"]);
|
|
61
|
+
git(dir, ["config", "user.name", "test"]);
|
|
62
|
+
await writeFile(path.join(dir, "marketplace.json"), MANIFEST);
|
|
63
|
+
git(dir, ["add", "marketplace.json"]);
|
|
64
|
+
git(dir, ["commit", "-qm", "init"]);
|
|
65
|
+
return { dir, fileUrl: `file://${dir}` };
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function marketplaceConfig(memoryDir: string) {
|
|
69
|
+
return parseConfig({
|
|
70
|
+
openaiApiKey: "sk-test",
|
|
71
|
+
memoryDir,
|
|
72
|
+
workspaceDir: path.join(memoryDir, "workspace"),
|
|
73
|
+
codexMarketplaceEnabled: true,
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
test("#3611 git source resolves a file:// remote by cloning", async () => {
|
|
78
|
+
const remote = await makeGitRemote();
|
|
79
|
+
const memoryDir = await mkdtemp(path.join(os.tmpdir(), "remnic-mkt-cfg-"));
|
|
80
|
+
try {
|
|
81
|
+
const result = await installFromMarketplace(
|
|
82
|
+
remote.fileUrl,
|
|
83
|
+
"git",
|
|
84
|
+
marketplaceConfig(memoryDir),
|
|
85
|
+
);
|
|
86
|
+
assert.equal(result.ok, true, result.message);
|
|
87
|
+
assert.deepEqual(result.pluginsFound, ["demo"]);
|
|
88
|
+
} finally {
|
|
89
|
+
await rm(remote.dir, { recursive: true, force: true });
|
|
90
|
+
await rm(memoryDir, { recursive: true, force: true });
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
test("#3611 git source resolves a local-path remote by cloning", async () => {
|
|
95
|
+
const remote = await makeGitRemote();
|
|
96
|
+
const memoryDir = await mkdtemp(path.join(os.tmpdir(), "remnic-mkt-cfg-"));
|
|
97
|
+
try {
|
|
98
|
+
const result = await installFromMarketplace(
|
|
99
|
+
remote.dir,
|
|
100
|
+
"git",
|
|
101
|
+
marketplaceConfig(memoryDir),
|
|
102
|
+
);
|
|
103
|
+
assert.equal(result.ok, true, result.message);
|
|
104
|
+
assert.deepEqual(result.pluginsFound, ["demo"]);
|
|
105
|
+
} finally {
|
|
106
|
+
await rm(remote.dir, { recursive: true, force: true });
|
|
107
|
+
await rm(memoryDir, { recursive: true, force: true });
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
test("#3611 ambient git config cannot re-enable ext:: or run hooks", async () => {
|
|
112
|
+
// w7X's second exploit: a hostile global gitconfig can re-enable the ext::
|
|
113
|
+
// transport (arbitrary command execution) and point hooksPath at a
|
|
114
|
+
// post-checkout hook that runs during our clone. The clone must run with
|
|
115
|
+
// GIT_CONFIG_NOSYSTEM/GIT_CONFIG_GLOBAL neutralized, a closed protocol
|
|
116
|
+
// allowlist, and hooks disabled.
|
|
117
|
+
const hostile = await mkdtemp(path.join(os.tmpdir(), "remnic-mkt-hostile-"));
|
|
118
|
+
const remote = await makeGitRemote();
|
|
119
|
+
const memoryDir = await mkdtemp(path.join(os.tmpdir(), "remnic-mkt-cfg-"));
|
|
120
|
+
const hooksDir = path.join(hostile, "hooks");
|
|
121
|
+
const hookMarker = path.join(hostile, "hook-ran");
|
|
122
|
+
const extMarker = path.join(hostile, "ext-ran");
|
|
123
|
+
try {
|
|
124
|
+
await mkdir(hooksDir);
|
|
125
|
+
await writeFile(
|
|
126
|
+
path.join(hooksDir, "post-checkout"),
|
|
127
|
+
`#!/bin/sh\ntouch ${hookMarker}\n`,
|
|
128
|
+
{ mode: 0o755 },
|
|
129
|
+
);
|
|
130
|
+
const cfgFile = path.join(hostile, "gitconfig");
|
|
131
|
+
await writeFile(
|
|
132
|
+
cfgFile,
|
|
133
|
+
`[protocol "ext"]\n\tallow = always\n[core]\n\thooksPath = ${hooksDir}\n`,
|
|
134
|
+
);
|
|
135
|
+
|
|
136
|
+
const prev = process.env.GIT_CONFIG_GLOBAL;
|
|
137
|
+
process.env.GIT_CONFIG_GLOBAL = cfgFile;
|
|
138
|
+
try {
|
|
139
|
+
const cloned = await installFromMarketplace(
|
|
140
|
+
remote.fileUrl,
|
|
141
|
+
"git",
|
|
142
|
+
marketplaceConfig(memoryDir),
|
|
143
|
+
);
|
|
144
|
+
assert.equal(cloned.ok, true, cloned.message);
|
|
145
|
+
assert.equal(
|
|
146
|
+
existsSync(hookMarker),
|
|
147
|
+
false,
|
|
148
|
+
"ambient hooksPath ran a post-checkout hook during clone",
|
|
149
|
+
);
|
|
150
|
+
|
|
151
|
+
const ext = await installFromMarketplace(
|
|
152
|
+
`ext::sh -c "touch ${extMarker}"`,
|
|
153
|
+
"git",
|
|
154
|
+
marketplaceConfig(memoryDir),
|
|
155
|
+
);
|
|
156
|
+
assert.equal(ext.ok, false, "ext:: transport must not be allowed");
|
|
157
|
+
assert.equal(
|
|
158
|
+
existsSync(extMarker),
|
|
159
|
+
false,
|
|
160
|
+
"ambient protocol.ext.allow=always let ext:: execute a command",
|
|
161
|
+
);
|
|
162
|
+
} finally {
|
|
163
|
+
if (prev === undefined) {
|
|
164
|
+
delete process.env.GIT_CONFIG_GLOBAL;
|
|
165
|
+
} else {
|
|
166
|
+
process.env.GIT_CONFIG_GLOBAL = prev;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
} finally {
|
|
170
|
+
await rm(hostile, { recursive: true, force: true });
|
|
171
|
+
await rm(remote.dir, { recursive: true, force: true });
|
|
172
|
+
await rm(memoryDir, { recursive: true, force: true });
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
test("#3611 a failed clone leaves no temp dir behind", async () => {
|
|
177
|
+
// w7X's third finding: mkdtemp ran before the clone, and the rm sat in a
|
|
178
|
+
// finally that only wrapped resolveLocal — every clone failure (including
|
|
179
|
+
// timeout) leaked remnic-marketplace-git-* dirs.
|
|
180
|
+
const memoryDir = await mkdtemp(path.join(os.tmpdir(), "remnic-mkt-cfg-"));
|
|
181
|
+
try {
|
|
182
|
+
const count = async () =>
|
|
183
|
+
(await readdir(os.tmpdir())).filter((d) =>
|
|
184
|
+
d.startsWith("remnic-marketplace-git-"),
|
|
185
|
+
).length;
|
|
186
|
+
const before = await count();
|
|
187
|
+
const result = await installFromMarketplace(
|
|
188
|
+
"file:///definitely/not/a/repo-3611",
|
|
189
|
+
"git",
|
|
190
|
+
marketplaceConfig(memoryDir),
|
|
191
|
+
);
|
|
192
|
+
assert.equal(result.ok, false);
|
|
193
|
+
assert.equal(await count(), before, "failed clone leaked a temp dir");
|
|
194
|
+
} finally {
|
|
195
|
+
await rm(memoryDir, { recursive: true, force: true });
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
test("#3611 scheme-less github.com/owner/repo resolves via the github route", async () => {
|
|
200
|
+
// Post-#3628 regression (Main's diff read): the removed regex also accepted
|
|
201
|
+
// scheme-less `github.com/owner/repo` and routed it to resolveGithub. With
|
|
202
|
+
// resolveGit = clone, the same string is treated as a local path and fails.
|
|
203
|
+
// The fix must restore the github route for that form — proven here by a
|
|
204
|
+
// stubbed fetch observing the raw.githubusercontent.com request.
|
|
205
|
+
const memoryDir = await mkdtemp(path.join(os.tmpdir(), "remnic-mkt-cfg-"));
|
|
206
|
+
const prevFetch = globalThis.fetch;
|
|
207
|
+
const calls: string[] = [];
|
|
208
|
+
globalThis.fetch = async (input: Parameters<typeof fetch>[0]) => {
|
|
209
|
+
calls.push(String(input));
|
|
210
|
+
return new Response(MANIFEST, { status: 200 });
|
|
211
|
+
};
|
|
212
|
+
try {
|
|
213
|
+
const result = await installFromMarketplace(
|
|
214
|
+
"github.com/owner/repo",
|
|
215
|
+
"git",
|
|
216
|
+
marketplaceConfig(memoryDir),
|
|
217
|
+
);
|
|
218
|
+
assert.equal(result.ok, true, result.message);
|
|
219
|
+
assert.deepEqual(result.pluginsFound, ["demo"]);
|
|
220
|
+
assert.ok(
|
|
221
|
+
calls.some((u) => u.includes("raw.githubusercontent.com/owner/repo")),
|
|
222
|
+
`expected a GitHub raw manifest fetch, got: ${calls.join(", ") || "(none)"}`,
|
|
223
|
+
);
|
|
224
|
+
} finally {
|
|
225
|
+
globalThis.fetch = prevFetch;
|
|
226
|
+
await rm(memoryDir, { recursive: true, force: true });
|
|
227
|
+
}
|
|
228
|
+
});
|
|
229
|
+
|
|
230
|
+
test("#3611 flag-shaped git source is rejected before clone", async () => {
|
|
231
|
+
const memoryDir = await mkdtemp(path.join(os.tmpdir(), "remnic-mkt-cfg-"));
|
|
232
|
+
try {
|
|
233
|
+
const result = await installFromMarketplace(
|
|
234
|
+
"--upload-pack=/bin/false",
|
|
235
|
+
"git",
|
|
236
|
+
marketplaceConfig(memoryDir),
|
|
237
|
+
);
|
|
238
|
+
assert.equal(result.ok, false);
|
|
239
|
+
assert.ok(
|
|
240
|
+
result.errors.some((e) => e.includes("must not look like a flag")),
|
|
241
|
+
`expected the flag guard, got: ${result.errors.join("; ")}`,
|
|
242
|
+
);
|
|
243
|
+
} finally {
|
|
244
|
+
await rm(memoryDir, { recursive: true, force: true });
|
|
245
|
+
}
|
|
246
|
+
});
|
|
247
|
+
|
|
248
|
+
test("#3611 non-repo git source fails as a clone error, not the stub", async () => {
|
|
249
|
+
const notRepo = await mkdtemp(path.join(os.tmpdir(), "remnic-mkt-notgit-"));
|
|
250
|
+
const memoryDir = await mkdtemp(path.join(os.tmpdir(), "remnic-mkt-cfg-"));
|
|
251
|
+
try {
|
|
252
|
+
const result = await installFromMarketplace(
|
|
253
|
+
`file://${notRepo}`,
|
|
254
|
+
"git",
|
|
255
|
+
marketplaceConfig(memoryDir),
|
|
256
|
+
);
|
|
257
|
+
assert.equal(result.ok, false);
|
|
258
|
+
assert.equal(result.pluginsFound.length, 0);
|
|
259
|
+
assert.ok(
|
|
260
|
+
!result.errors.some((e) => e.includes("GitHub-format URL")),
|
|
261
|
+
`must not fall back to the raw-URL delegation stub: ${result.errors.join("; ")}`,
|
|
262
|
+
);
|
|
263
|
+
} finally {
|
|
264
|
+
await rm(notRepo, { recursive: true, force: true });
|
|
265
|
+
await rm(memoryDir, { recursive: true, force: true });
|
|
266
|
+
}
|
|
267
|
+
});
|
|
@@ -17,8 +17,11 @@
|
|
|
17
17
|
* manifest files.
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
+
import { execFile, type ExecFileException } from "node:child_process";
|
|
20
21
|
import fs from "node:fs";
|
|
22
|
+
import os from "node:os";
|
|
21
23
|
import path from "node:path";
|
|
24
|
+
import { promisify } from "node:util";
|
|
22
25
|
|
|
23
26
|
import { log } from "../logger.js";
|
|
24
27
|
import type { PluginConfig } from "../types.js";
|
|
@@ -105,6 +108,11 @@ export const MARKETPLACE_MANIFEST_FILENAME = "marketplace.json";
|
|
|
105
108
|
/** Valid install types for validation. */
|
|
106
109
|
const VALID_INSTALL_TYPES = new Set<string>(["github", "git", "local", "url"]);
|
|
107
110
|
|
|
111
|
+
/** Bound on a manifest-fetching shallow clone (issue #3611). */
|
|
112
|
+
const GIT_CLONE_TIMEOUT_MS = 120_000;
|
|
113
|
+
|
|
114
|
+
const execFileAsync = promisify(execFile);
|
|
115
|
+
|
|
108
116
|
// ── Generate ──────────────────────────────────────────────────────────────
|
|
109
117
|
|
|
110
118
|
/**
|
|
@@ -445,27 +453,82 @@ async function resolveGithub(
|
|
|
445
453
|
/**
|
|
446
454
|
* Resolve marketplace.json from a git URL.
|
|
447
455
|
*
|
|
448
|
-
*
|
|
449
|
-
*
|
|
456
|
+
* Shallow-clones the source into a temp dir and reads the manifest from the
|
|
457
|
+
* checkout, so every transport git supports (HTTPS, SSH, file://, local
|
|
458
|
+
* paths, self-hosted) resolves the same way. The clone runs hermetically:
|
|
459
|
+
* ambient git config is ignored (a hostile ~/.gitconfig could re-enable the
|
|
460
|
+
* ext:: transport, which runs arbitrary commands), the protocol allowlist
|
|
461
|
+
* is closed to https/ssh/file, hooks and templates are neutralized, and
|
|
462
|
+
* GIT_TERMINAL_PROMPT=0 keeps a credential prompt from hanging the install.
|
|
450
463
|
*/
|
|
451
464
|
async function resolveGit(
|
|
452
465
|
gitUrl: string,
|
|
453
466
|
logger: MarketplaceLogger,
|
|
454
467
|
): Promise<MarketplaceManifest> {
|
|
455
|
-
//
|
|
456
|
-
//
|
|
457
|
-
|
|
458
|
-
|
|
468
|
+
// Scheme-less github.com/owner/repo is a form the pre-#3628 code accepted:
|
|
469
|
+
// git clone would treat it as a local path, so route it to the GitHub
|
|
470
|
+
// resolver instead.
|
|
471
|
+
const ghSchemaless = gitUrl.match(
|
|
472
|
+
/^github\.com\/([a-zA-Z0-9._-]+\/[a-zA-Z0-9._-]+?)(?:\.git)?$/u,
|
|
459
473
|
);
|
|
460
|
-
if (
|
|
461
|
-
|
|
462
|
-
return resolveGithub(ghMatch[1], logger);
|
|
474
|
+
if (ghSchemaless?.[1]) {
|
|
475
|
+
return resolveGithub(ghSchemaless[1], logger);
|
|
463
476
|
}
|
|
464
477
|
|
|
465
|
-
|
|
466
|
-
`
|
|
467
|
-
|
|
468
|
-
|
|
478
|
+
if (gitUrl.startsWith("-")) {
|
|
479
|
+
throw new Error(`Invalid git source: ${gitUrl} (must not look like a flag)`);
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), "remnic-marketplace-git-"));
|
|
483
|
+
const cloneDir = path.join(tmpDir, "repo");
|
|
484
|
+
const emptyTemplate = path.join(tmpDir, "template");
|
|
485
|
+
fs.mkdirSync(emptyTemplate);
|
|
486
|
+
|
|
487
|
+
try {
|
|
488
|
+
logger.debug?.(`cloning git source for marketplace manifest: ${gitUrl}`);
|
|
489
|
+
try {
|
|
490
|
+
await execFileAsync(
|
|
491
|
+
"git",
|
|
492
|
+
[
|
|
493
|
+
"-c",
|
|
494
|
+
"core.hooksPath=/dev/null",
|
|
495
|
+
"clone",
|
|
496
|
+
"--quiet",
|
|
497
|
+
"--depth",
|
|
498
|
+
"1",
|
|
499
|
+
"--template",
|
|
500
|
+
emptyTemplate,
|
|
501
|
+
"--",
|
|
502
|
+
gitUrl,
|
|
503
|
+
cloneDir,
|
|
504
|
+
],
|
|
505
|
+
{
|
|
506
|
+
env: {
|
|
507
|
+
...process.env,
|
|
508
|
+
GIT_TERMINAL_PROMPT: "0",
|
|
509
|
+
GIT_CONFIG_NOSYSTEM: "1",
|
|
510
|
+
GIT_CONFIG_GLOBAL: "/dev/null",
|
|
511
|
+
// Ambient GIT_CONFIG_KEY_*/GIT_CONFIG_VALUE_* pairs cannot inject
|
|
512
|
+
// config either.
|
|
513
|
+
GIT_CONFIG_COUNT: "0",
|
|
514
|
+
GIT_ALLOW_PROTOCOL: "https:ssh:file",
|
|
515
|
+
},
|
|
516
|
+
timeout: GIT_CLONE_TIMEOUT_MS,
|
|
517
|
+
},
|
|
518
|
+
);
|
|
519
|
+
} catch (err) {
|
|
520
|
+
// SAFETY: the only awaited call in the try block is the git clone, and
|
|
521
|
+
// execFile rejections are always ExecFileException carrying the child's
|
|
522
|
+
// stderr.
|
|
523
|
+
const stderr = (err as ExecFileException).stderr?.toString().trim();
|
|
524
|
+
const detail = stderr || (err instanceof Error ? err.message : String(err));
|
|
525
|
+
throw new Error(`Failed to clone git source ${gitUrl}: ${detail}`);
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
return resolveLocal(cloneDir, logger);
|
|
529
|
+
} finally {
|
|
530
|
+
fs.rmSync(tmpDir, { recursive: true, force: true });
|
|
531
|
+
}
|
|
469
532
|
}
|
|
470
533
|
|
|
471
534
|
// ── Helpers ───────────────────────────────────────────────────────────────
|
|
@@ -611,50 +611,30 @@ export function renderMemoryMd(ctx: RenderContext): string {
|
|
|
611
611
|
lines.push(`applies_to: cwd=*; reuse_rule=namespace-match`);
|
|
612
612
|
lines.push("");
|
|
613
613
|
|
|
614
|
-
// One
|
|
615
|
-
// memory category
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
614
|
+
// One task per namespace: there is no topic clustering yet, so a task per
|
|
615
|
+
// memory category would emit identical rollout lists under every task and
|
|
616
|
+
// claim per-task scoping that does not exist. The documented contract is a
|
|
617
|
+
// single task carrying all rollouts until real clustering lands (#3614).
|
|
618
|
+
const activeMemories = ctx.memories.filter(
|
|
619
|
+
(m) => !m.frontmatter.status || m.frontmatter.status === "active",
|
|
620
|
+
);
|
|
621
|
+
lines.push(`## Task 1: ${ctx.namespace} memories, outcome=surface-to-codex`);
|
|
622
|
+
lines.push("");
|
|
623
|
+
lines.push("### rollout_summary_files");
|
|
624
|
+
const rollouts = ctx.rolloutSummaries.slice(0, 5);
|
|
625
|
+
if (rollouts.length === 0) {
|
|
626
|
+
lines.push("- (none)");
|
|
627
|
+
} else {
|
|
628
|
+
for (const r of rollouts) {
|
|
623
629
|
lines.push(
|
|
624
630
|
`- rollout_summaries/${sanitizeSlug(r.slug)}.md (cwd=${r.cwd ?? "*"}, rollout_path=${r.rolloutPath ?? ""}, updated_at=${r.updatedAt ?? ""}, thread_id=${r.threadId ?? ""})`,
|
|
625
631
|
);
|
|
626
632
|
}
|
|
627
|
-
if (ctx.rolloutSummaries.length === 0) {
|
|
628
|
-
lines.push("- (none)");
|
|
629
|
-
}
|
|
630
|
-
lines.push("");
|
|
631
|
-
lines.push("### keywords");
|
|
632
|
-
lines.push(`- ${ctx.namespace}`);
|
|
633
|
-
lines.push("");
|
|
634
|
-
taskIndex += 1;
|
|
635
|
-
} else {
|
|
636
|
-
for (const [category, mems] of byCategory) {
|
|
637
|
-
lines.push(`## Task ${taskIndex}: ${category} memories, outcome=surface-to-codex`);
|
|
638
|
-
lines.push("");
|
|
639
|
-
lines.push("### rollout_summary_files");
|
|
640
|
-
const relevantRollouts = ctx.rolloutSummaries.slice(0, 5);
|
|
641
|
-
if (relevantRollouts.length === 0) {
|
|
642
|
-
lines.push("- (none)");
|
|
643
|
-
} else {
|
|
644
|
-
for (const r of relevantRollouts) {
|
|
645
|
-
lines.push(
|
|
646
|
-
`- rollout_summaries/${sanitizeSlug(r.slug)}.md (cwd=${r.cwd ?? "*"}, rollout_path=${r.rolloutPath ?? ""}, updated_at=${r.updatedAt ?? ""}, thread_id=${r.threadId ?? ""})`,
|
|
647
|
-
);
|
|
648
|
-
}
|
|
649
|
-
}
|
|
650
|
-
lines.push("");
|
|
651
|
-
lines.push("### keywords");
|
|
652
|
-
const keywords = collectKeywords(mems, category, ctx.namespace);
|
|
653
|
-
lines.push(`- ${keywords.join(", ")}`);
|
|
654
|
-
lines.push("");
|
|
655
|
-
taskIndex += 1;
|
|
656
|
-
}
|
|
657
633
|
}
|
|
634
|
+
lines.push("");
|
|
635
|
+
lines.push("### keywords");
|
|
636
|
+
lines.push(`- ${collectKeywords(activeMemories, ctx.namespace).join(", ")}`);
|
|
637
|
+
lines.push("");
|
|
658
638
|
|
|
659
639
|
lines.push("## User preferences");
|
|
660
640
|
const prefs = pickCategory(ctx.memories, ["preference"]);
|
|
@@ -932,18 +912,6 @@ function oneLineSummary(memory: MemoryFile): string {
|
|
|
932
912
|
return `${raw.slice(0, 157)}...`;
|
|
933
913
|
}
|
|
934
914
|
|
|
935
|
-
function groupMemoriesByCategory(memories: MemoryFile[]): Map<string, MemoryFile[]> {
|
|
936
|
-
const map = new Map<string, MemoryFile[]>();
|
|
937
|
-
for (const memory of memories) {
|
|
938
|
-
if (memory.frontmatter.status && memory.frontmatter.status !== "active") continue;
|
|
939
|
-
const category = memory.frontmatter.category ?? "unknown";
|
|
940
|
-
const list = map.get(category) ?? [];
|
|
941
|
-
list.push(memory);
|
|
942
|
-
map.set(category, list);
|
|
943
|
-
}
|
|
944
|
-
return map;
|
|
945
|
-
}
|
|
946
|
-
|
|
947
915
|
function pickCategory(memories: MemoryFile[], categories: string[]): MemoryFile[] {
|
|
948
916
|
const allowed = new Set(categories);
|
|
949
917
|
return memories.filter(
|
|
@@ -953,13 +921,19 @@ function pickCategory(memories: MemoryFile[], categories: string[]): MemoryFile[
|
|
|
953
921
|
);
|
|
954
922
|
}
|
|
955
923
|
|
|
956
|
-
function collectKeywords(memories: MemoryFile[],
|
|
924
|
+
function collectKeywords(memories: MemoryFile[], namespace: string): string[] {
|
|
957
925
|
const keywords = new Set<string>();
|
|
958
|
-
keywords.add(category);
|
|
959
926
|
keywords.add(namespace);
|
|
960
|
-
|
|
927
|
+
// Two passes so the tag flood cannot crowd out a category: every active
|
|
928
|
+
// memory's category is guaranteed a slot, then tags fill what remains.
|
|
929
|
+
for (const mem of memories) {
|
|
930
|
+
const category = (mem.frontmatter.category ?? "").trim();
|
|
931
|
+
if (category.length > 0) keywords.add(category);
|
|
932
|
+
}
|
|
933
|
+
for (const mem of memories) {
|
|
961
934
|
for (const tag of mem.frontmatter.tags ?? []) {
|
|
962
|
-
|
|
935
|
+
const trimmed = tag.trim();
|
|
936
|
+
if (trimmed.length > 0) keywords.add(trimmed);
|
|
963
937
|
}
|
|
964
938
|
}
|
|
965
939
|
return [...keywords].slice(0, 16);
|
|
@@ -283,6 +283,17 @@ test("an unreadable receipt-failure history keeps the gate closed", async () =>
|
|
|
283
283
|
assert.ok(result.demotionReasons.includes("recent_receipt_failures"));
|
|
284
284
|
});
|
|
285
285
|
|
|
286
|
+
test("a non-finite receipt-failure count keeps the gate closed", async () => {
|
|
287
|
+
const h = harness();
|
|
288
|
+
h.deps.recorder = {
|
|
289
|
+
...h.deps.recorder!,
|
|
290
|
+
trailingReceiptFailures: async () => Number.NaN,
|
|
291
|
+
};
|
|
292
|
+
const result = await new MemoryControllerCoordinator(h.deps).run({ prompt: RECALL_PROMPT });
|
|
293
|
+
assert.equal(result.effectiveMode, "shadow");
|
|
294
|
+
assert.ok(result.demotionReasons.includes("recent_receipt_failures"));
|
|
295
|
+
});
|
|
296
|
+
|
|
286
297
|
test("executor error or missing executor records a failure class and demotes next run", async () => {
|
|
287
298
|
const h = harness({
|
|
288
299
|
executors: {
|
package/src/memory-controller.ts
CHANGED
|
@@ -547,7 +547,11 @@ export class MemoryControllerCoordinator {
|
|
|
547
547
|
// Unknown receipt health keeps the gate closed.
|
|
548
548
|
recorded = 1;
|
|
549
549
|
}
|
|
550
|
-
if (Number.isFinite(recorded)
|
|
550
|
+
if (!Number.isFinite(recorded)) {
|
|
551
|
+
// A count that is not a real number is unreadable history too.
|
|
552
|
+
recorded = 1;
|
|
553
|
+
}
|
|
554
|
+
if (recorded > this.consecutiveReceiptFailures) {
|
|
551
555
|
this.consecutiveReceiptFailures = recorded;
|
|
552
556
|
}
|
|
553
557
|
}
|
|
@@ -376,6 +376,7 @@ export class NamespaceStorageRouter {
|
|
|
376
376
|
// (used by extraction and shared-promotion paths) strip citations consistently,
|
|
377
377
|
// matching the behaviour of the primary this.storage instance in the orchestrator.
|
|
378
378
|
sm.citationTemplate = this.config.inlineSourceAttributionFormat;
|
|
379
|
+
sm.citationTemplateHistory = this.config.inlineSourceAttributionFormatHistory;
|
|
379
380
|
// #1522: install the post-write catalog touch at the chokepoint — every
|
|
380
381
|
// successful write on this StorageManager records the namespace touch.
|
|
381
382
|
this.bindCatalogWriteHook(sm, ns);
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
|
|
28
28
|
import { randomUUID } from "node:crypto";
|
|
29
29
|
import { hostname } from "node:os";
|
|
30
|
+
import { resolveMaxTurnsPerSession } from "../buffer-session-cap.js";
|
|
30
31
|
import { log } from "../logger.js";
|
|
31
32
|
import type { Orchestrator } from "../orchestrator.js";
|
|
32
33
|
import type { BufferDrainClaims, DrainLease } from "../storage/buffer-drain-claims.js";
|
|
@@ -61,6 +62,10 @@ export interface BacklogSchedulerDeps {
|
|
|
61
62
|
breakerSnapshot?(): ProviderBreakerSnapshot;
|
|
62
63
|
/** Test seam: monotonic-ish clock for backoff windows. */
|
|
63
64
|
now?(): number;
|
|
65
|
+
/** The buffer's per-session turn cap. A live key holding this many turns
|
|
66
|
+
* refuses new captures, so discovery lists it before the claim page.
|
|
67
|
+
* Optional: without it, discovery keeps plain claim-page-first order. */
|
|
68
|
+
maxTurnsPerSession?(): number;
|
|
64
69
|
}
|
|
65
70
|
|
|
66
71
|
export interface BacklogSchedulerOptions {
|
|
@@ -285,6 +290,7 @@ export class BacklogScheduler {
|
|
|
285
290
|
|
|
286
291
|
/** Bounded discovery: ONE page of existing claims with pending turns */
|
|
287
292
|
private async discoverCandidates(): Promise<{ key: string; needsClaim: boolean }[]> {
|
|
293
|
+
const capped: { key: string; needsClaim: boolean }[] = [];
|
|
288
294
|
const out: { key: string; needsClaim: boolean }[] = [];
|
|
289
295
|
const seen = new Set<string>();
|
|
290
296
|
const pageLimit = Math.max(this.submissionLimit() * 4, 16);
|
|
@@ -294,13 +300,15 @@ export class BacklogScheduler {
|
|
|
294
300
|
out.push({ key: listed.key, needsClaim: false });
|
|
295
301
|
}
|
|
296
302
|
this.claimCursor = page.nextCursor;
|
|
303
|
+
const turnCap = this.deps.maxTurnsPerSession?.() ?? Number.POSITIVE_INFINITY;
|
|
297
304
|
for (const [key, counts] of await this.deps.liveBufferCounts()) {
|
|
298
|
-
|
|
305
|
+
const held = counts.turns + counts.retainedTurns;
|
|
306
|
+
if (held <= 0) continue;
|
|
299
307
|
if (seen.has(key) || this.deps.claims.isClaimed(key)) continue;
|
|
300
308
|
seen.add(key);
|
|
301
|
-
out.push({ key, needsClaim: true });
|
|
309
|
+
(held >= turnCap ? capped : out).push({ key, needsClaim: true });
|
|
302
310
|
}
|
|
303
|
-
return out;
|
|
311
|
+
return [...capped, ...out];
|
|
304
312
|
}
|
|
305
313
|
|
|
306
314
|
/** Submission bound: the queue's own concurrency limit, read with the
|
|
@@ -529,6 +537,7 @@ export function wireBacklogScheduler(
|
|
|
529
537
|
// The orchestrator's one shared provider breaker (foreground and every
|
|
530
538
|
// claim-backed drain accumulate toward the same threshold).
|
|
531
539
|
breakerSnapshot: () => orchestrator.getExtractionResilienceStatus().breaker,
|
|
540
|
+
maxTurnsPerSession: () => resolveMaxTurnsPerSession(orchestrator.config.bufferMaxTurnsPerSession),
|
|
532
541
|
},
|
|
533
542
|
options
|
|
534
543
|
);
|
|
@@ -11,11 +11,12 @@ export function normalizeStoredHashSource(
|
|
|
11
11
|
raw: string,
|
|
12
12
|
citationEnabled: boolean,
|
|
13
13
|
citationTemplate: string,
|
|
14
|
+
citationHistory: readonly string[] = [],
|
|
14
15
|
): string {
|
|
15
16
|
return ContentHashIndex.normalizeContent(
|
|
16
17
|
sanitizeMemoryContent(
|
|
17
|
-
citationEnabled && hasCitationForTemplate(raw, citationTemplate)
|
|
18
|
-
? stripCitationForTemplate(raw, citationTemplate)
|
|
18
|
+
citationEnabled && hasCitationForTemplate(raw, citationTemplate, citationHistory)
|
|
19
|
+
? stripCitationForTemplate(raw, citationTemplate, citationHistory)
|
|
19
20
|
: raw,
|
|
20
21
|
).text,
|
|
21
22
|
);
|
|
@@ -26,6 +27,7 @@ export function applyInlineCitation(
|
|
|
26
27
|
citationEnabled: boolean,
|
|
27
28
|
citationTemplate: string,
|
|
28
29
|
citationContextBase: Omit<CitationContext, "ts">,
|
|
30
|
+
citationHistory: readonly string[] = [],
|
|
29
31
|
): string {
|
|
30
32
|
if (!citationEnabled) return content;
|
|
31
33
|
if (typeof content !== "string" || content.length === 0) return content;
|
|
@@ -33,5 +35,5 @@ export function applyInlineCitation(
|
|
|
33
35
|
...citationContextBase,
|
|
34
36
|
ts: new Date().toISOString(),
|
|
35
37
|
};
|
|
36
|
-
return attachCitation(content, citationContext, citationTemplate);
|
|
38
|
+
return attachCitation(content, citationContext, citationTemplate, citationHistory);
|
|
37
39
|
}
|