@remnic/core 10.0.30 → 10.0.32
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 +47 -46
- package/dist/access-authorization-probe.js +48 -47
- package/dist/access-boundary.js +47 -46
- package/dist/access-cli.js +107 -107
- package/dist/access-extraction-force-flush.d.ts.map +1 -1
- package/dist/access-extraction-force-flush.js +47 -46
- package/dist/access-http-briefing.js +48 -47
- package/dist/access-http-query.js +49 -48
- package/dist/access-http.js +65 -64
- package/dist/access-identity-continuity-surface.js +47 -46
- package/dist/access-lcm-surface.js +47 -46
- package/dist/access-mcp.js +57 -56
- package/dist/access-namespace-preflight.js +47 -46
- package/dist/access-observe-write-surface.d.ts.map +1 -1
- package/dist/access-observe-write-surface.js +47 -46
- package/dist/access-offline-manifest.js +4 -4
- package/dist/access-operations-batch.js +48 -47
- package/dist/access-operations.js +55 -54
- package/dist/access-recall-concurrency.js +47 -46
- package/dist/access-recall-diagnostics.js +2 -2
- package/dist/access-recall-response.js +47 -46
- package/dist/access-recall-surface.js +47 -46
- package/dist/access-schema.d.ts +47 -47
- package/dist/access-service.js +47 -46
- package/dist/access-surface-catalog.js +49 -48
- package/dist/access-surface-catalog.js.map +1 -1
- package/dist/active-recall.js +20 -20
- package/dist/briefing.js +21 -21
- package/dist/buffer-turn-helpers.d.ts +20 -0
- package/dist/buffer-turn-helpers.d.ts.map +1 -1
- package/dist/buffer-turn-helpers.js +11 -3
- package/dist/buffer-turn.d.ts +50 -0
- package/dist/buffer-turn.d.ts.map +1 -0
- package/dist/buffer-turn.js +1 -0
- package/dist/buffer-turn.js.map +1 -0
- package/dist/buffer.d.ts +13 -1
- package/dist/buffer.d.ts.map +1 -1
- package/dist/buffer.js +4 -4
- package/dist/causal-consolidation.js +26 -26
- package/dist/{chunk-BIE3ZH3N.js → chunk-2IXEKMBJ.js} +143 -112
- package/dist/chunk-2IXEKMBJ.js.map +1 -0
- package/dist/{chunk-YGVZ4QOZ.js → chunk-3CRE3UZI.js} +2 -2
- package/dist/{chunk-YZTFQBYY.js → chunk-3GOPAWA7.js} +3 -3
- package/dist/{chunk-NAPHQ2MG.js → chunk-3IDNKOCE.js} +2 -2
- package/dist/{chunk-PYCTZ2HX.js → chunk-3VYNGM5A.js} +2 -2
- package/dist/{chunk-2XVLY424.js → chunk-42MM5DKK.js} +2 -2
- package/dist/{chunk-CKR7LXEK.js → chunk-464QR7WO.js} +255 -63
- package/dist/chunk-464QR7WO.js.map +1 -0
- package/dist/{chunk-3IXNL6SK.js → chunk-4ZTVOECF.js} +4 -4
- package/dist/{chunk-ETZUIRCI.js → chunk-53GYS3GG.js} +2 -2
- package/dist/{chunk-ZXTAHSQU.js → chunk-5GPHJ333.js} +2 -2
- package/dist/{chunk-AUYFUBBE.js → chunk-5HJCZ7SB.js} +4 -4
- package/dist/{chunk-52II7PB6.js → chunk-645WOU5I.js} +4 -4
- package/dist/{chunk-2WDMUQOH.js → chunk-64IO6ZEE.js} +2 -2
- package/dist/{chunk-OIIAIY7J.js → chunk-7SXUGYPE.js} +3 -3
- package/dist/{chunk-74IN6PV5.js → chunk-7WWITD3H.js} +4 -4
- package/dist/{chunk-7FZ4YVOH.js → chunk-A5ZY537U.js} +2 -2
- package/dist/{chunk-LDXNKEYB.js → chunk-A6PKEU7T.js} +1 -1
- package/dist/chunk-A6PKEU7T.js.map +1 -0
- package/dist/{chunk-VLBFSD7B.js → chunk-APRGEZQN.js} +2 -2
- package/dist/{chunk-XNROYP5E.js → chunk-AQ5XLA36.js} +2 -2
- package/dist/{chunk-K2REHR42.js → chunk-BDHYRMJC.js} +2 -2
- package/dist/{chunk-GQ7VWY6N.js → chunk-BQ6DGL6A.js} +2 -2
- package/dist/{chunk-4OE4UE2Y.js → chunk-D3EXT5KG.js} +2 -2
- package/dist/{chunk-MROA6OFU.js → chunk-DGBWPSM6.js} +2 -2
- package/dist/{chunk-NOMHXZD7.js → chunk-DNZ2CWPG.js} +2 -2
- package/dist/{chunk-HG2VVIKI.js → chunk-DZBMASSI.js} +12 -12
- package/dist/{chunk-NB2YX6X2.js → chunk-EXYDKAR6.js} +5 -5
- package/dist/{chunk-V4FI2TG6.js → chunk-F5FZ7DB4.js} +2 -2
- package/dist/{chunk-IY7DGT2Z.js → chunk-GDPTMK5V.js} +2 -2
- package/dist/{chunk-27OJ5G3D.js → chunk-GJBSEMC5.js} +7 -7
- package/dist/{chunk-MMBLOJJB.js → chunk-HMON55NJ.js} +85 -44
- package/dist/chunk-HMON55NJ.js.map +1 -0
- package/dist/{chunk-C2QVDLQV.js → chunk-HNTB7NIE.js} +2 -2
- package/dist/{chunk-4HNINU7Q.js → chunk-HSPEVXT5.js} +42 -42
- package/dist/{chunk-4QPW6JVI.js → chunk-ID2PLENW.js} +2 -2
- package/dist/{chunk-FN6OFDBZ.js → chunk-ID62FNER.js} +2 -2
- package/dist/{chunk-GSKW64NB.js → chunk-J6SZXAQ2.js} +2 -2
- package/dist/{chunk-3CHHQXAR.js → chunk-JTACUJP3.js} +2 -2
- package/dist/{chunk-3SN2D43X.js → chunk-K6RQ2KOX.js} +2 -2
- package/dist/{chunk-GWB7ZD2A.js → chunk-K6YJGWJP.js} +2 -2
- package/dist/{chunk-OANSZGAG.js → chunk-KFR343VH.js} +2 -2
- package/dist/{chunk-WC3V7HHP.js → chunk-KJZKO2M6.js} +2 -1
- package/dist/chunk-KJZKO2M6.js.map +1 -0
- package/dist/{chunk-T5IF2ZCE.js → chunk-KZMRMKC7.js} +81 -2
- package/dist/chunk-KZMRMKC7.js.map +1 -0
- package/dist/{chunk-NPO4ZQFY.js → chunk-LDXS746V.js} +3 -3
- package/dist/{chunk-UTXYOWDR.js → chunk-LGR54NYT.js} +3 -3
- package/dist/{chunk-UTXYOWDR.js.map → chunk-LGR54NYT.js.map} +1 -1
- package/dist/{chunk-DDLRKPR2.js → chunk-NKW27NU3.js} +2 -2
- package/dist/{chunk-4HYP4OKH.js → chunk-NU247WVX.js} +2 -2
- package/dist/{chunk-RRJ462HP.js → chunk-O6YJI5VX.js} +2 -2
- package/dist/{chunk-WYLBEJQI.js → chunk-OCWNT322.js} +4 -4
- package/dist/{chunk-UUYAW3JH.js → chunk-OIKLZCJD.js} +2 -2
- package/dist/{chunk-IO2UQVR2.js → chunk-OTWZXOJI.js} +2 -2
- package/dist/{chunk-OXYXMGRH.js → chunk-PGHYQMKZ.js} +11 -11
- package/dist/{chunk-LDEKVBVO.js → chunk-PZWW6MDE.js} +2 -2
- package/dist/{chunk-TFA6HPOA.js → chunk-QCP75JGO.js} +5 -5
- package/dist/{chunk-M236YHUH.js → chunk-RILIWZA6.js} +3 -3
- package/dist/{chunk-7VB3Y5OL.js → chunk-RRYN5FFC.js} +4 -4
- package/dist/{chunk-PZEADMX4.js → chunk-RU6WB55E.js} +9 -9
- package/dist/{chunk-VARNSLUW.js → chunk-SGII36L6.js} +2 -2
- package/dist/{chunk-KFKFK6G6.js → chunk-TB2J4PBY.js} +3 -3
- package/dist/{chunk-WQIYGYY6.js → chunk-TEUPXKC5.js} +2 -2
- package/dist/{chunk-VEB7NEON.js → chunk-U4BNX4R2.js} +3 -3
- package/dist/{chunk-7HFTCBCZ.js → chunk-UBBZFODO.js} +2 -2
- package/dist/{chunk-654GT5UP.js → chunk-UZDOPJ2P.js} +2 -2
- package/dist/{chunk-D4RV54HH.js → chunk-VAPVRDC4.js} +2 -2
- package/dist/{chunk-OXX4ORRL.js → chunk-W7X7XT7Z.js} +15 -15
- package/dist/{chunk-5NPZFXQH.js → chunk-WK7GFAQ2.js} +2 -2
- package/dist/{chunk-G6DAE2LT.js → chunk-WPCK6EJ2.js} +2 -2
- package/dist/{chunk-VKQI47DJ.js → chunk-Y7427SL7.js} +4 -4
- package/dist/{chunk-ZCRDYQL6.js → chunk-YGBWSKBD.js} +2 -2
- package/dist/{chunk-NCPR2FOJ.js → chunk-YXWLQHAW.js} +2 -2
- package/dist/{chunk-UM73Q46J.js → chunk-ZEMBRSKK.js} +2 -2
- package/dist/{chunk-TTIEXXL3.js → chunk-ZGP2XB4S.js} +16 -16
- package/dist/{chunk-UVUBLLM3.js → chunk-ZY4S5WMQ.js} +2 -2
- package/dist/cli.js +83 -82
- package/dist/coding/export-okf-codegraph.js +20 -20
- package/dist/compounding/engine.js +22 -22
- package/dist/config.js +20 -20
- package/dist/connectors/codex-materialize-runner.js +21 -21
- package/dist/connectors/index.js +21 -21
- package/dist/convergence-refresh.js +23 -23
- package/dist/conversation-index/backend.js +2 -2
- package/dist/corpus-watermark.js +23 -23
- package/dist/entity-retrieval.js +22 -22
- package/dist/event-order-recall.js +3 -3
- package/dist/external-wiki-access.js +48 -47
- package/dist/extraction.js +31 -31
- package/dist/harmonic-retrieval.js +21 -21
- package/dist/index.js +126 -126
- package/dist/lcm/engine.js +2 -2
- package/dist/lcm/index.js +2 -2
- package/dist/location/index.js +23 -23
- package/dist/maintenance/memory-governance.js +21 -21
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +21 -21
- package/dist/maintenance/rebuild-memory-projection-runner.js +23 -23
- package/dist/maintenance/rebuild-memory-projection.js +22 -22
- package/dist/memory-browse-operations.js +48 -47
- package/dist/namespaces/migrate.js +22 -22
- package/dist/namespaces/scope-profiles.d.ts +1 -0
- package/dist/namespaces/scope-profiles.d.ts.map +1 -1
- package/dist/namespaces/search.js +9 -9
- package/dist/namespaces/storage.js +21 -21
- package/dist/offline-sync-impression-drain.js +3 -3
- package/dist/operator-doctor-corpus.js +24 -24
- package/dist/operator-toolkit.js +32 -32
- package/dist/orchestration/maintenance.js +33 -33
- package/dist/orchestration/session-context.d.ts +6 -0
- package/dist/orchestration/session-context.d.ts.map +1 -1
- package/dist/orchestration/turn-ingestion.d.ts +35 -1
- package/dist/orchestration/turn-ingestion.d.ts.map +1 -1
- package/dist/orchestrator.d.ts +2 -32
- package/dist/orchestrator.d.ts.map +1 -1
- package/dist/orchestrator.js +107 -107
- package/dist/recall-explain-renderer.js +3 -3
- package/dist/recall-navigate-access.js +2 -2
- package/dist/recall-navigate-disclosure.js +2 -2
- package/dist/recall-navigate.js +2 -2
- package/dist/recall-navigation-operations.js +48 -47
- package/dist/recall-navigation.js +47 -46
- 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/relay/mission.d.ts +2 -2
- package/dist/resume-bundles.js +20 -20
- package/dist/schemas.d.ts +4 -4
- package/dist/search/factory.js +8 -8
- package/dist/search/index.js +13 -13
- package/dist/search/lancedb-backend.js +2 -2
- package/dist/search/meilisearch-backend.js +2 -2
- package/dist/search/orama-backend.js +2 -2
- package/dist/semantic-consolidation.js +22 -22
- package/dist/semantic-rule-promotion.js +21 -21
- package/dist/semantic-rule-verifier.js +21 -21
- package/dist/source-agent-qualifier.js +24 -24
- package/dist/standup/build.js +21 -21
- package/dist/storage.js +20 -20
- package/dist/support-passport/contracts.d.ts +6 -6
- package/dist/support-passport/grant-contracts.d.ts +4 -4
- package/dist/support-passport/index.js +50 -49
- package/dist/transfer/export-okf.js +21 -21
- package/dist/types.d.ts +3 -17
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +1 -1
- package/dist/verified-recall.js +21 -21
- package/dist/who-knows-cli.js +22 -22
- package/dist/who-knows.js +21 -21
- package/package.json +2 -2
- package/src/access-extraction-force-flush.ts +37 -25
- package/src/access-observe-acceptance-boundary.test.ts +172 -0
- package/src/access-observe-replay-durability.test.ts +2212 -0
- package/src/access-observe-write-surface.ts +36 -41
- package/src/access-service-observe-lcm-parity.test.ts +63 -39
- package/src/access-service-observe-scope.test.ts +3 -2
- package/src/buffer-turn-helpers.ts +120 -1
- package/src/buffer-turn.ts +50 -0
- package/src/buffer.ts +115 -49
- package/src/namespaces/scope-profiles.ts +1 -1
- package/src/orchestration/extraction-run.ts +1 -1
- package/src/orchestration/session-context.ts +117 -49
- package/src/orchestration/turn-ingestion.ts +313 -9
- package/src/orchestrator-flush.test.ts +16 -3
- package/src/orchestrator.ts +2 -32
- package/src/types.ts +3 -17
- package/dist/chunk-BIE3ZH3N.js.map +0 -1
- package/dist/chunk-CKR7LXEK.js.map +0 -1
- package/dist/chunk-LDXNKEYB.js.map +0 -1
- package/dist/chunk-MMBLOJJB.js.map +0 -1
- package/dist/chunk-T5IF2ZCE.js.map +0 -1
- package/dist/chunk-WC3V7HHP.js.map +0 -1
- /package/dist/{chunk-YGVZ4QOZ.js.map → chunk-3CRE3UZI.js.map} +0 -0
- /package/dist/{chunk-YZTFQBYY.js.map → chunk-3GOPAWA7.js.map} +0 -0
- /package/dist/{chunk-NAPHQ2MG.js.map → chunk-3IDNKOCE.js.map} +0 -0
- /package/dist/{chunk-PYCTZ2HX.js.map → chunk-3VYNGM5A.js.map} +0 -0
- /package/dist/{chunk-2XVLY424.js.map → chunk-42MM5DKK.js.map} +0 -0
- /package/dist/{chunk-3IXNL6SK.js.map → chunk-4ZTVOECF.js.map} +0 -0
- /package/dist/{chunk-ETZUIRCI.js.map → chunk-53GYS3GG.js.map} +0 -0
- /package/dist/{chunk-ZXTAHSQU.js.map → chunk-5GPHJ333.js.map} +0 -0
- /package/dist/{chunk-AUYFUBBE.js.map → chunk-5HJCZ7SB.js.map} +0 -0
- /package/dist/{chunk-52II7PB6.js.map → chunk-645WOU5I.js.map} +0 -0
- /package/dist/{chunk-2WDMUQOH.js.map → chunk-64IO6ZEE.js.map} +0 -0
- /package/dist/{chunk-OIIAIY7J.js.map → chunk-7SXUGYPE.js.map} +0 -0
- /package/dist/{chunk-74IN6PV5.js.map → chunk-7WWITD3H.js.map} +0 -0
- /package/dist/{chunk-7FZ4YVOH.js.map → chunk-A5ZY537U.js.map} +0 -0
- /package/dist/{chunk-VLBFSD7B.js.map → chunk-APRGEZQN.js.map} +0 -0
- /package/dist/{chunk-XNROYP5E.js.map → chunk-AQ5XLA36.js.map} +0 -0
- /package/dist/{chunk-K2REHR42.js.map → chunk-BDHYRMJC.js.map} +0 -0
- /package/dist/{chunk-GQ7VWY6N.js.map → chunk-BQ6DGL6A.js.map} +0 -0
- /package/dist/{chunk-4OE4UE2Y.js.map → chunk-D3EXT5KG.js.map} +0 -0
- /package/dist/{chunk-MROA6OFU.js.map → chunk-DGBWPSM6.js.map} +0 -0
- /package/dist/{chunk-NOMHXZD7.js.map → chunk-DNZ2CWPG.js.map} +0 -0
- /package/dist/{chunk-HG2VVIKI.js.map → chunk-DZBMASSI.js.map} +0 -0
- /package/dist/{chunk-NB2YX6X2.js.map → chunk-EXYDKAR6.js.map} +0 -0
- /package/dist/{chunk-V4FI2TG6.js.map → chunk-F5FZ7DB4.js.map} +0 -0
- /package/dist/{chunk-IY7DGT2Z.js.map → chunk-GDPTMK5V.js.map} +0 -0
- /package/dist/{chunk-27OJ5G3D.js.map → chunk-GJBSEMC5.js.map} +0 -0
- /package/dist/{chunk-C2QVDLQV.js.map → chunk-HNTB7NIE.js.map} +0 -0
- /package/dist/{chunk-4HNINU7Q.js.map → chunk-HSPEVXT5.js.map} +0 -0
- /package/dist/{chunk-4QPW6JVI.js.map → chunk-ID2PLENW.js.map} +0 -0
- /package/dist/{chunk-FN6OFDBZ.js.map → chunk-ID62FNER.js.map} +0 -0
- /package/dist/{chunk-GSKW64NB.js.map → chunk-J6SZXAQ2.js.map} +0 -0
- /package/dist/{chunk-3CHHQXAR.js.map → chunk-JTACUJP3.js.map} +0 -0
- /package/dist/{chunk-3SN2D43X.js.map → chunk-K6RQ2KOX.js.map} +0 -0
- /package/dist/{chunk-GWB7ZD2A.js.map → chunk-K6YJGWJP.js.map} +0 -0
- /package/dist/{chunk-OANSZGAG.js.map → chunk-KFR343VH.js.map} +0 -0
- /package/dist/{chunk-NPO4ZQFY.js.map → chunk-LDXS746V.js.map} +0 -0
- /package/dist/{chunk-DDLRKPR2.js.map → chunk-NKW27NU3.js.map} +0 -0
- /package/dist/{chunk-4HYP4OKH.js.map → chunk-NU247WVX.js.map} +0 -0
- /package/dist/{chunk-RRJ462HP.js.map → chunk-O6YJI5VX.js.map} +0 -0
- /package/dist/{chunk-WYLBEJQI.js.map → chunk-OCWNT322.js.map} +0 -0
- /package/dist/{chunk-UUYAW3JH.js.map → chunk-OIKLZCJD.js.map} +0 -0
- /package/dist/{chunk-IO2UQVR2.js.map → chunk-OTWZXOJI.js.map} +0 -0
- /package/dist/{chunk-OXYXMGRH.js.map → chunk-PGHYQMKZ.js.map} +0 -0
- /package/dist/{chunk-LDEKVBVO.js.map → chunk-PZWW6MDE.js.map} +0 -0
- /package/dist/{chunk-TFA6HPOA.js.map → chunk-QCP75JGO.js.map} +0 -0
- /package/dist/{chunk-M236YHUH.js.map → chunk-RILIWZA6.js.map} +0 -0
- /package/dist/{chunk-7VB3Y5OL.js.map → chunk-RRYN5FFC.js.map} +0 -0
- /package/dist/{chunk-PZEADMX4.js.map → chunk-RU6WB55E.js.map} +0 -0
- /package/dist/{chunk-VARNSLUW.js.map → chunk-SGII36L6.js.map} +0 -0
- /package/dist/{chunk-KFKFK6G6.js.map → chunk-TB2J4PBY.js.map} +0 -0
- /package/dist/{chunk-WQIYGYY6.js.map → chunk-TEUPXKC5.js.map} +0 -0
- /package/dist/{chunk-VEB7NEON.js.map → chunk-U4BNX4R2.js.map} +0 -0
- /package/dist/{chunk-7HFTCBCZ.js.map → chunk-UBBZFODO.js.map} +0 -0
- /package/dist/{chunk-654GT5UP.js.map → chunk-UZDOPJ2P.js.map} +0 -0
- /package/dist/{chunk-D4RV54HH.js.map → chunk-VAPVRDC4.js.map} +0 -0
- /package/dist/{chunk-OXX4ORRL.js.map → chunk-W7X7XT7Z.js.map} +0 -0
- /package/dist/{chunk-5NPZFXQH.js.map → chunk-WK7GFAQ2.js.map} +0 -0
- /package/dist/{chunk-G6DAE2LT.js.map → chunk-WPCK6EJ2.js.map} +0 -0
- /package/dist/{chunk-VKQI47DJ.js.map → chunk-Y7427SL7.js.map} +0 -0
- /package/dist/{chunk-ZCRDYQL6.js.map → chunk-YGBWSKBD.js.map} +0 -0
- /package/dist/{chunk-NCPR2FOJ.js.map → chunk-YXWLQHAW.js.map} +0 -0
- /package/dist/{chunk-UM73Q46J.js.map → chunk-ZEMBRSKK.js.map} +0 -0
- /package/dist/{chunk-TTIEXXL3.js.map → chunk-ZGP2XB4S.js.map} +0 -0
- /package/dist/{chunk-UVUBLLM3.js.map → chunk-ZY4S5WMQ.js.map} +0 -0
|
@@ -30,6 +30,7 @@ import {
|
|
|
30
30
|
NamespaceNotWritableError,
|
|
31
31
|
} from "./access-service.js";
|
|
32
32
|
import { applyBriefingLocationContext, reapplyCategoryCoercion, splitCanonicalWriteRequest } from "./access-observe-write-category.js";
|
|
33
|
+
import { abortError } from "./abort-error.js";
|
|
33
34
|
import { extractionForceFlush } from "./access-extraction-force-flush.js";
|
|
34
35
|
import { ObserveTranscriptPersister, observeTranscriptSessionKey } from "./access-observe-transcript.js";
|
|
35
36
|
import { FileCalendarSource, buildBriefing, parseBriefingFocus, parseBriefingWindow } from "./briefing.js";
|
|
@@ -841,19 +842,12 @@ export class AccessObserveWriteSurface {
|
|
|
841
842
|
// (the #1495 drift). Passing writeNamespaceOverride makes the extraction
|
|
842
843
|
// target deterministic and identical to LCM/objective-state (rule 39).
|
|
843
844
|
//
|
|
844
|
-
//
|
|
845
|
-
//
|
|
846
|
-
//
|
|
847
|
-
//
|
|
848
|
-
//
|
|
849
|
-
|
|
850
|
-
// from where LCM/objective-state/response wrote (`default`). Pinning the
|
|
851
|
-
// resolved writeNamespace forces all side effects onto the one scope-plan
|
|
852
|
-
// namespace. When namespaces are DISABLED the router collapses every
|
|
853
|
-
// namespace to one store, so leaving the override undefined preserves the
|
|
854
|
-
// existing single-store routing byte-for-byte.
|
|
855
|
-
const writeNamespaceOverride =
|
|
856
|
-
resolveNamespaceCapabilities(this.deps.orchestrator.config).namespaces === true ? writeNamespace : undefined;
|
|
845
|
+
// #3251: ALWAYS pin the already-resolved writeNamespace — including
|
|
846
|
+
// when namespaces are OFF (where the resolved value IS the collapsed
|
|
847
|
+
// default store). Accepted captures need an original actual storage
|
|
848
|
+
// target so a later namespaces-ON restart cannot retarget them to a
|
|
849
|
+
// newly-active principal/project namespace.
|
|
850
|
+
const writeNamespaceOverride = writeNamespace;
|
|
857
851
|
// Pin provenance PRINCIPAL to the scope plan's resolved principal (#1505
|
|
858
852
|
// thread 1). The scope plan already applied auth precedence
|
|
859
853
|
// (authenticatedPrincipal/principalOverride > resolvePrincipal(original
|
|
@@ -863,38 +857,39 @@ export class AccessObserveWriteSurface {
|
|
|
863
857
|
// existing behavior.
|
|
864
858
|
const principalOverride =
|
|
865
859
|
typeof scope.principal === "string" && scope.principal.length > 0 ? scope.principal : undefined;
|
|
866
|
-
//
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
860
|
+
// Acceptance waits for durable capture; cancellation only stops extraction.
|
|
861
|
+
const observeAbortController = new AbortController();
|
|
862
|
+
const preparationCancelled = observePreparation.isCancelled();
|
|
863
|
+
if (preparationCancelled) {
|
|
864
|
+
// Preserve capture even when its preparation was cancelled.
|
|
865
|
+
observeAbortController.abort(abortError("observe preparation cancelled"));
|
|
866
|
+
}
|
|
867
|
+
const trackedExtractionKey = this.pendingObserveExtractions.key(request.sessionKey, scope.principal, writeNamespace);
|
|
868
|
+
const ingestOptions: NonNullable<Parameters<Orchestrator["ingestReplayBatch"]>[1]> = {
|
|
869
|
+
archiveLcm: false,
|
|
870
|
+
extractionMode: "buffered",
|
|
871
|
+
writeNamespaceOverride,
|
|
872
|
+
principalOverride,
|
|
873
|
+
scopeProfileWritePlan: scope.scopeProfilePlan,
|
|
874
|
+
// Re-authorize current policy against the original project binding.
|
|
875
|
+
codingContext: this.deps.orchestrator.getCodingContextForSession(request.sessionKey) ?? undefined,
|
|
876
|
+
abortSignal: observeAbortController.signal,
|
|
877
|
+
};
|
|
878
|
+
if (request.authenticatedPrincipal !== undefined && request.authenticatedPrincipal.trim().length > 0) {
|
|
879
|
+
ingestOptions.sessionOwnerPrincipal = request.authenticatedPrincipal.trim();
|
|
880
|
+
}
|
|
881
|
+
// Track every job immediately, but don't retain cancelled preparation barriers.
|
|
882
|
+
if (!preparationCancelled) {
|
|
883
|
+
ingestOptions.onExtractionQueued = (extraction: Promise<void>) => {
|
|
884
|
+
extraction.catch((err) => {
|
|
885
885
|
log.error(`access-observe background extraction failed: ${err}`);
|
|
886
886
|
});
|
|
887
|
-
this.pendingObserveExtractions.track(
|
|
888
|
-
this.pendingObserveExtractions.key(request.sessionKey, scope.principal, writeNamespace),
|
|
889
|
-
extractionPromise,
|
|
890
|
-
observeAbortController
|
|
891
|
-
);
|
|
887
|
+
this.pendingObserveExtractions.track(trackedExtractionKey, extraction, observeAbortController);
|
|
892
888
|
extractionQueued = true;
|
|
893
|
-
}
|
|
894
|
-
// Synchronous enqueue failure (e.g. orchestrator disposed)
|
|
895
|
-
log.error(`access-observe extraction enqueue failed: ${err}`);
|
|
896
|
-
}
|
|
889
|
+
};
|
|
897
890
|
}
|
|
891
|
+
await this.deps.orchestrator.ingestReplayBatch(turns, ingestOptions);
|
|
892
|
+
// A native trigger may leave the durable capture pending rather than queued.
|
|
898
893
|
}
|
|
899
894
|
|
|
900
895
|
log.info(
|
|
@@ -512,7 +512,11 @@ test("#2128: force-flush waits for a pending observe extraction", async () => {
|
|
|
512
512
|
const pendingExtraction = new Promise<void>((resolve) => {
|
|
513
513
|
resolveExtraction = resolve;
|
|
514
514
|
});
|
|
515
|
-
|
|
515
|
+
// #3252 contract: observe awaits only durable capture; the actual extraction
|
|
516
|
+
// promise is handed to onExtractionQueued and tracked for force-flush.
|
|
517
|
+
probe.orch.ingestReplayBatch = async (_turns, options = {}) => {
|
|
518
|
+
options.onExtractionQueued?.(pendingExtraction);
|
|
519
|
+
};
|
|
516
520
|
const service = new EngramAccessService(probe.orch);
|
|
517
521
|
const sessionKey = "pending-observe-extraction";
|
|
518
522
|
|
|
@@ -547,10 +551,11 @@ test("#2128: pending extraction barriers stay isolated by authenticated principa
|
|
|
547
551
|
],
|
|
548
552
|
} as Partial<PluginConfig>);
|
|
549
553
|
const pending = new Map<string, () => void>();
|
|
550
|
-
probe.orch.ingestReplayBatch = async (_turns, options = {}) =>
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
+
probe.orch.ingestReplayBatch = async (_turns, options = {}) => {
|
|
555
|
+
const { promise, resolve } = Promise.withResolvers<void>();
|
|
556
|
+
pending.set(options.principalOverride ?? "", resolve);
|
|
557
|
+
options.onExtractionQueued?.(promise);
|
|
558
|
+
};
|
|
554
559
|
const service = new EngramAccessService(probe.orch);
|
|
555
560
|
const sessionKey = "shared-session";
|
|
556
561
|
|
|
@@ -595,10 +600,11 @@ test("#2128: pending extraction barriers stay isolated by authenticated principa
|
|
|
595
600
|
test("#2128: chained observes remain behind one force-flush barrier", async () => {
|
|
596
601
|
const probe = makeParityProbe({ namespacesEnabled: false } as Partial<PluginConfig>);
|
|
597
602
|
const resolvers: Array<() => void> = [];
|
|
598
|
-
probe.orch.ingestReplayBatch = async () =>
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
603
|
+
probe.orch.ingestReplayBatch = async (_turns, options = {}) => {
|
|
604
|
+
const { promise, resolve } = Promise.withResolvers<void>();
|
|
605
|
+
resolvers.push(resolve);
|
|
606
|
+
options.onExtractionQueued?.(promise);
|
|
607
|
+
};
|
|
602
608
|
const service = new EngramAccessService(probe.orch);
|
|
603
609
|
const sessionKey = "chained-observes";
|
|
604
610
|
|
|
@@ -628,12 +634,12 @@ test("#2128: a failed observe extraction is consumed after force-flush reports i
|
|
|
628
634
|
const probe = makeParityProbe({ namespacesEnabled: false } as Partial<PluginConfig>);
|
|
629
635
|
let rejectExtraction!: (error: Error) => void;
|
|
630
636
|
let extractionAttempt = 0;
|
|
631
|
-
probe.orch.ingestReplayBatch = async () => {
|
|
637
|
+
probe.orch.ingestReplayBatch = async (_turns, options = {}) => {
|
|
632
638
|
extractionAttempt += 1;
|
|
633
639
|
if (extractionAttempt > 1) return;
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
640
|
+
const { promise, reject } = Promise.withResolvers<void>();
|
|
641
|
+
rejectExtraction = reject;
|
|
642
|
+
options.onExtractionQueued?.(promise);
|
|
637
643
|
};
|
|
638
644
|
const service = new EngramAccessService(probe.orch);
|
|
639
645
|
const sessionKey = "failed-observe-extraction";
|
|
@@ -655,13 +661,13 @@ test("#2128: force-flush deadline cancels the pending observe extraction", async
|
|
|
655
661
|
let extractionSignal: AbortSignal | undefined;
|
|
656
662
|
probe.orch.ingestReplayBatch = async (_turns, options = {}) => {
|
|
657
663
|
extractionSignal = options.abortSignal;
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
664
|
+
const { promise, reject } = Promise.withResolvers<void>();
|
|
665
|
+
options.abortSignal?.addEventListener(
|
|
666
|
+
"abort",
|
|
667
|
+
() => reject(new Error("extraction cancelled")),
|
|
668
|
+
{ once: true },
|
|
669
|
+
);
|
|
670
|
+
options.onExtractionQueued?.(promise);
|
|
665
671
|
};
|
|
666
672
|
const service = new EngramAccessService(probe.orch);
|
|
667
673
|
const sessionKey = "deadline-cancelled-extraction";
|
|
@@ -689,13 +695,13 @@ test("#2128: force-flush abort signal cancels the pending observe extraction", a
|
|
|
689
695
|
let extractionSignal: AbortSignal | undefined;
|
|
690
696
|
probe.orch.ingestReplayBatch = async (_turns, options = {}) => {
|
|
691
697
|
extractionSignal = options.abortSignal;
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
698
|
+
const { promise, reject } = Promise.withResolvers<void>();
|
|
699
|
+
options.abortSignal?.addEventListener(
|
|
700
|
+
"abort",
|
|
701
|
+
() => reject(new Error("extraction cancelled")),
|
|
702
|
+
{ once: true },
|
|
703
|
+
);
|
|
704
|
+
options.onExtractionQueued?.(promise);
|
|
699
705
|
};
|
|
700
706
|
const service = new EngramAccessService(probe.orch);
|
|
701
707
|
const sessionKey = "abort-cancelled-extraction";
|
|
@@ -727,14 +733,14 @@ test("#2128: force-flush abort only cancels the resolved namespace barrier", asy
|
|
|
727
733
|
probe.orch.ingestReplayBatch = async (_turns, options = {}) => {
|
|
728
734
|
const namespace = options.writeNamespaceOverride ?? "";
|
|
729
735
|
extractionSignals.set(namespace, options.abortSignal);
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
736
|
+
const { promise, resolve, reject } = Promise.withResolvers<void>();
|
|
737
|
+
extractionResolvers.set(namespace, resolve);
|
|
738
|
+
options.abortSignal?.addEventListener(
|
|
739
|
+
"abort",
|
|
740
|
+
() => reject(options.abortSignal?.reason ?? new Error("extraction cancelled")),
|
|
741
|
+
{ once: true },
|
|
742
|
+
);
|
|
743
|
+
options.onExtractionQueued?.(promise);
|
|
738
744
|
};
|
|
739
745
|
const service = new EngramAccessService(probe.orch);
|
|
740
746
|
const sessionKey = "opaque-shared-session";
|
|
@@ -960,7 +966,14 @@ test("#2128: post-flush retained cleanup stops on abort or deadline", async (t)
|
|
|
960
966
|
assert.deepEqual(cleanupCalls[0], {
|
|
961
967
|
sessionKey: "pi-geek:cleanup-abort",
|
|
962
968
|
ownerPrincipal: "pi-geek",
|
|
963
|
-
options: {
|
|
969
|
+
options: {
|
|
970
|
+
abortSignal: abortController.signal,
|
|
971
|
+
deadlineMs: undefined,
|
|
972
|
+
// #3252: cleanup targets the pinned accepted-capture storage target.
|
|
973
|
+
writeNamespaceOverride: "default",
|
|
974
|
+
codingContext: undefined,
|
|
975
|
+
scopeProfileWritePlan: undefined,
|
|
976
|
+
},
|
|
964
977
|
});
|
|
965
978
|
|
|
966
979
|
const cleanupStartedPromise = new Promise<void>((resolve) => {
|
|
@@ -981,7 +994,14 @@ test("#2128: post-flush retained cleanup stops on abort or deadline", async (t)
|
|
|
981
994
|
assert.deepEqual(cleanupCalls[1], {
|
|
982
995
|
sessionKey: "pi-geek:cleanup-deadline",
|
|
983
996
|
ownerPrincipal: "pi-geek",
|
|
984
|
-
options: {
|
|
997
|
+
options: {
|
|
998
|
+
abortSignal: undefined,
|
|
999
|
+
deadlineMs: 5,
|
|
1000
|
+
// #3252: cleanup targets the pinned accepted-capture storage target.
|
|
1001
|
+
writeNamespaceOverride: "default",
|
|
1002
|
+
codingContext: undefined,
|
|
1003
|
+
scopeProfileWritePlan: undefined,
|
|
1004
|
+
},
|
|
985
1005
|
});
|
|
986
1006
|
t.mock.timers.tick(5);
|
|
987
1007
|
await assert.rejects(
|
|
@@ -1086,8 +1106,10 @@ test("#2206: abort during scope resolution cancels pre-resolution observe prepar
|
|
|
1086
1106
|
await assert.rejects(flush, /extraction force-flush aborted/);
|
|
1087
1107
|
releaseObserveScope();
|
|
1088
1108
|
const response = await observe;
|
|
1109
|
+
// Cancelled preparation aborts only the extraction; the durable capture is
|
|
1110
|
+
// preserved (#3252), so ingest is still called once with nothing queued.
|
|
1089
1111
|
assert.equal(response.extractionQueued, false);
|
|
1090
|
-
assert.equal(probe.extractionCalls.length,
|
|
1112
|
+
assert.equal(probe.extractionCalls.length, 1);
|
|
1091
1113
|
});
|
|
1092
1114
|
|
|
1093
1115
|
test("#2206: scope-resolution deadline cancels preparations by raw projectTag and cwd hints", async (t) => {
|
|
@@ -1164,8 +1186,10 @@ test("#2206: scope-resolution deadline cancels preparations by raw projectTag an
|
|
|
1164
1186
|
releaseObserveScope();
|
|
1165
1187
|
}
|
|
1166
1188
|
const response = await observe;
|
|
1189
|
+
// Cancelled preparation aborts only the extraction; the durable capture
|
|
1190
|
+
// is preserved (#3252), so ingest is still called once with nothing queued.
|
|
1167
1191
|
assert.equal(response.extractionQueued, false);
|
|
1168
|
-
assert.equal(probe.extractionCalls.length,
|
|
1192
|
+
assert.equal(probe.extractionCalls.length, 1);
|
|
1169
1193
|
}
|
|
1170
1194
|
});
|
|
1171
1195
|
|
|
@@ -649,8 +649,9 @@ test("#1495 namespacesEnabled:false ⇒ single-store behavior preserved", async
|
|
|
649
649
|
assert.equal(res.namespace, "default");
|
|
650
650
|
// No namespace prefix on the LCM key when the effective ns is the default.
|
|
651
651
|
assert.equal(probe.lcmCalls[0].sessionKey, "pi-geek:abc123");
|
|
652
|
-
//
|
|
653
|
-
|
|
652
|
+
// #3251: ALWAYS pin the resolved writeNamespace even when namespaces are
|
|
653
|
+
// disabled — the flat capture stores its original actual storage target.
|
|
654
|
+
assert.equal(probe.extractionCalls[0].writeNamespaceOverride, "default");
|
|
654
655
|
assert.deepEqual(
|
|
655
656
|
new Set(probe.extractionCalls[0].sessionKeys),
|
|
656
657
|
new Set(["pi-geek:abc123"]),
|
|
@@ -64,6 +64,43 @@ export function copyBufferTurn(turn: BufferTurn): BufferTurn {
|
|
|
64
64
|
if (typeof turn.ambientCapture === "boolean") {
|
|
65
65
|
copy.ambientCapture = turn.ambientCapture;
|
|
66
66
|
}
|
|
67
|
+
if (turn.sourceValidAt !== undefined) {
|
|
68
|
+
copy.sourceValidAt = turn.sourceValidAt;
|
|
69
|
+
}
|
|
70
|
+
if (turn.parts !== undefined) {
|
|
71
|
+
copy.parts = turn.parts;
|
|
72
|
+
}
|
|
73
|
+
if (turn.rawContent !== undefined) {
|
|
74
|
+
copy.rawContent = turn.rawContent;
|
|
75
|
+
}
|
|
76
|
+
if (turn.sourceFormat !== undefined) {
|
|
77
|
+
copy.sourceFormat = turn.sourceFormat;
|
|
78
|
+
}
|
|
79
|
+
// #3251 scope pins: strings copy by value; the plan object is an immutable
|
|
80
|
+
// config-derived identity passed by reference.
|
|
81
|
+
if (turn.writeNamespaceOverride !== undefined) {
|
|
82
|
+
copy.writeNamespaceOverride = turn.writeNamespaceOverride;
|
|
83
|
+
}
|
|
84
|
+
if (turn.principalOverride !== undefined) {
|
|
85
|
+
copy.principalOverride = turn.principalOverride;
|
|
86
|
+
}
|
|
87
|
+
if (turn.scopeProfileWritePlan !== undefined) {
|
|
88
|
+
copy.scopeProfileWritePlan = turn.scopeProfileWritePlan;
|
|
89
|
+
}
|
|
90
|
+
if (turn.acceptedCapture === true) {
|
|
91
|
+
copy.acceptedCapture = true;
|
|
92
|
+
}
|
|
93
|
+
const ctx = turn.codingContext;
|
|
94
|
+
if (ctx) {
|
|
95
|
+
// All four fields are identity inputs (branchScope uses branch) — copy
|
|
96
|
+
// explicitly as-is; never a spread of external input.
|
|
97
|
+
copy.codingContext = {
|
|
98
|
+
projectId: ctx.projectId,
|
|
99
|
+
branch: ctx.branch,
|
|
100
|
+
rootPath: ctx.rootPath,
|
|
101
|
+
defaultBranch: ctx.defaultBranch,
|
|
102
|
+
};
|
|
103
|
+
}
|
|
67
104
|
return copy;
|
|
68
105
|
}
|
|
69
106
|
|
|
@@ -81,8 +118,90 @@ export function bufferTurnsEqual(left: BufferTurn | undefined, right: BufferTurn
|
|
|
81
118
|
left.persistProcessedFingerprint === right.persistProcessedFingerprint &&
|
|
82
119
|
left.sourceConnector === right.sourceConnector &&
|
|
83
120
|
left.originRole === right.originRole &&
|
|
84
|
-
left.ambientCapture === right.ambientCapture
|
|
121
|
+
left.ambientCapture === right.ambientCapture &&
|
|
122
|
+
left.sourceValidAt === right.sourceValidAt &&
|
|
123
|
+
left.acceptedCapture === right.acceptedCapture &&
|
|
124
|
+
left.codingContext?.projectId === right.codingContext?.projectId &&
|
|
125
|
+
left.codingContext?.rootPath === right.codingContext?.rootPath &&
|
|
126
|
+
left.codingContext?.branch === right.codingContext?.branch &&
|
|
127
|
+
left.codingContext?.defaultBranch === right.codingContext?.defaultBranch &&
|
|
128
|
+
// #3251 scope pins compare by identity triple, not deep plan equality: a
|
|
129
|
+
// restart-rehydrated plan must still match the pin it was accepted under.
|
|
130
|
+
left.writeNamespaceOverride === right.writeNamespaceOverride &&
|
|
131
|
+
left.principalOverride === right.principalOverride &&
|
|
132
|
+
scopeProfilePlanIdentity(left.scopeProfileWritePlan) ===
|
|
133
|
+
scopeProfilePlanIdentity(right.scopeProfileWritePlan)
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/** Replace only the processed snapshot; callers without one retain legacy whole-slot semantics. */
|
|
138
|
+
export function selectRetainedDeferredTurns(
|
|
139
|
+
existing: readonly BufferTurn[],
|
|
140
|
+
turns: BufferTurn[],
|
|
141
|
+
max: number,
|
|
142
|
+
originalTurns?: readonly BufferTurn[],
|
|
143
|
+
): BufferTurn[] {
|
|
144
|
+
const others = originalTurns === undefined ? [] : existing.filter(
|
|
145
|
+
(turn) => !originalTurns.some((original) => bufferTurnsEqual(turn, original)),
|
|
85
146
|
);
|
|
147
|
+
if (!Array.isArray(turns) || max <= 0) return others;
|
|
148
|
+
return [...others, ...turns.slice(-max).map(copyBufferTurn)];
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export function hasPinnedCaptureScope(turn: BufferTurn): boolean {
|
|
152
|
+
return turn.acceptedCapture === true ||
|
|
153
|
+
turn.writeNamespaceOverride !== undefined ||
|
|
154
|
+
turn.scopeProfileWritePlan !== undefined;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/** Stable identity string for a pinned scope-profile plan (#3251). */
|
|
158
|
+
export function scopeProfilePlanIdentity(
|
|
159
|
+
plan: BufferTurn["scopeProfileWritePlan"],
|
|
160
|
+
): string {
|
|
161
|
+
if (!plan) return "";
|
|
162
|
+
return `${plan.profileId}\u0000${plan.writeLayer}\u0000${plan.writeNamespace}`;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export interface ExtractionScopeGroup {
|
|
166
|
+
writeNamespaceOverride?: string;
|
|
167
|
+
principalOverride?: string;
|
|
168
|
+
scopeProfileWritePlan?: BufferTurn["scopeProfileWritePlan"];
|
|
169
|
+
codingContext?: BufferTurn["codingContext"];
|
|
170
|
+
turns: BufferTurn[];
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Partition extraction turns by their durable scope pins (#3251). Turns
|
|
175
|
+
* captured under different namespaces / principals / scope profiles /
|
|
176
|
+
* project bindings must never be extracted together — each group runs its
|
|
177
|
+
* own extraction under its own scope. Native (unpinned) turns form their own
|
|
178
|
+
* group and keep today's single-store routing.
|
|
179
|
+
*/
|
|
180
|
+
export function groupTurnsByExtractionScope(turns: BufferTurn[]): ExtractionScopeGroup[] {
|
|
181
|
+
const groups = new Map<string, ExtractionScopeGroup>();
|
|
182
|
+
for (const turn of turns) {
|
|
183
|
+
const key = [
|
|
184
|
+
turn.writeNamespaceOverride ?? "",
|
|
185
|
+
turn.principalOverride ?? "",
|
|
186
|
+
scopeProfilePlanIdentity(turn.scopeProfileWritePlan),
|
|
187
|
+
turn.codingContext?.projectId ?? "",
|
|
188
|
+
turn.codingContext?.rootPath ?? "",
|
|
189
|
+
turn.codingContext?.branch ?? "",
|
|
190
|
+
turn.codingContext?.defaultBranch ?? "",
|
|
191
|
+
].join("\u0000");
|
|
192
|
+
const group = groups.get(key);
|
|
193
|
+
if (group) {
|
|
194
|
+
group.turns.push(turn);
|
|
195
|
+
} else {
|
|
196
|
+
const created: ExtractionScopeGroup = { turns: [turn] };
|
|
197
|
+
if (turn.writeNamespaceOverride !== undefined) created.writeNamespaceOverride = turn.writeNamespaceOverride;
|
|
198
|
+
if (turn.principalOverride !== undefined) created.principalOverride = turn.principalOverride;
|
|
199
|
+
if (turn.scopeProfileWritePlan !== undefined) created.scopeProfileWritePlan = turn.scopeProfileWritePlan;
|
|
200
|
+
if (turn.codingContext !== undefined) created.codingContext = turn.codingContext;
|
|
201
|
+
groups.set(key, created);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
return [...groups.values()];
|
|
86
205
|
}
|
|
87
206
|
|
|
88
207
|
export function bufferTurnArraysEqual(
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BufferTurn — the durable extraction-buffer turn shape (#3251). Extracted to
|
|
3
|
+
* a sibling module per the size-ratchet rule (AGENTS rule 7); `types.ts`
|
|
4
|
+
* re-exports it so existing `import type { BufferTurn } from "./types.js"`
|
|
5
|
+
* callers are unchanged.
|
|
6
|
+
*/
|
|
7
|
+
import type { SourceConnectorProvenance } from "./types.js";
|
|
8
|
+
import type { AmbientCaptureProvenance, BufferTurnOwner } from "./buffer-turn-helpers.js";
|
|
9
|
+
|
|
10
|
+
export interface BufferTurn extends SourceConnectorProvenance, BufferTurnOwner, AmbientCaptureProvenance {
|
|
11
|
+
role: "user" | "assistant";
|
|
12
|
+
content: string;
|
|
13
|
+
timestamp: string;
|
|
14
|
+
sourceValidAt?: string;
|
|
15
|
+
sessionKey?: string;
|
|
16
|
+
logicalSessionKey?: string;
|
|
17
|
+
providerThreadId?: string | null;
|
|
18
|
+
turnFingerprint?: string;
|
|
19
|
+
persistProcessedFingerprint?: boolean;
|
|
20
|
+
extractionContextOnly?: boolean;
|
|
21
|
+
parts?: import("./message-parts/index.js").LcmMessagePartInput[];
|
|
22
|
+
rawContent?: unknown;
|
|
23
|
+
sourceFormat?: import("./message-parts/index.js").MessagePartSourceFormat;
|
|
24
|
+
importProvenance?: import("./bulk-import/types.js").ImportTurnProvenance;
|
|
25
|
+
/**
|
|
26
|
+
* Scope pins stamped by the access `observe` capture path (#3251) so a
|
|
27
|
+
* durably pending turn can be drained under EXACTLY the scope it was
|
|
28
|
+
* accepted under — never merged with the same raw session under a
|
|
29
|
+
* different namespace / owner / scope profile. Absent on native
|
|
30
|
+
* `processTurn` turns.
|
|
31
|
+
*/
|
|
32
|
+
writeNamespaceOverride?: string;
|
|
33
|
+
principalOverride?: string;
|
|
34
|
+
scopeProfileWritePlan?: import("./namespaces/scope-profiles.js").ResolvedScopeProfilePlan | null;
|
|
35
|
+
/**
|
|
36
|
+
* Intrinsic marker for an ACCEPTED durable capture (#3251): set by the
|
|
37
|
+
* buffered capture path on every accepted turn, independent of namespace
|
|
38
|
+
* presence, so single-store accepted captures are equally protected from
|
|
39
|
+
* cap-pressure eviction.
|
|
40
|
+
*/
|
|
41
|
+
acceptedCapture?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* ORIGINAL native coding context at capture time (#3251) — the identity
|
|
44
|
+
* input (projectId/branch/rootPath/defaultBranch) the scope resolver
|
|
45
|
+
* consumed, stored as-is so a drain can re-resolve CURRENT policy for the
|
|
46
|
+
* SAME project binding. Never a frozen authorization: current config is
|
|
47
|
+
* re-applied at the execution boundary.
|
|
48
|
+
*/
|
|
49
|
+
codingContext?: import("./types.js").CodingContext;
|
|
50
|
+
}
|