@remnic/core 10.0.137 → 10.0.138

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.
Files changed (172) hide show
  1. package/dist/access-admin-ops-surface.js +38 -38
  2. package/dist/access-cli.js +38 -38
  3. package/dist/access-extraction-force-flush-preempt.js +38 -38
  4. package/dist/access-extraction-force-flush.js +38 -38
  5. package/dist/access-http-briefing.js +38 -38
  6. package/dist/access-http-query.js +38 -38
  7. package/dist/access-http.js +38 -38
  8. package/dist/access-identity-continuity-surface.js +38 -38
  9. package/dist/access-lcm-surface.js +38 -38
  10. package/dist/access-mcp.js +38 -38
  11. package/dist/access-observe-write-surface.js +38 -38
  12. package/dist/access-operations-batch.js +38 -38
  13. package/dist/access-operations.js +38 -38
  14. package/dist/access-recall-concurrency.js +38 -38
  15. package/dist/access-recall-diagnostics.js +2 -2
  16. package/dist/access-recall-response.js +38 -38
  17. package/dist/access-recall-surface.js +38 -38
  18. package/dist/access-service.js +38 -38
  19. package/dist/active-recall.js +3 -3
  20. package/dist/briefing.js +3 -3
  21. package/dist/buffer-turn.d.ts +11 -0
  22. package/dist/buffer-turn.d.ts.map +1 -1
  23. package/dist/causal-consolidation.js +4 -4
  24. package/dist/{chunk-SDRF2WLZ.js → chunk-2NJ74RQU.js} +2 -2
  25. package/dist/{chunk-K4EBUTPN.js → chunk-2VS3DAXE.js} +2 -2
  26. package/dist/{chunk-W4VZ52B3.js → chunk-5IGWEYNV.js} +3 -3
  27. package/dist/{chunk-2SZWPNG4.js → chunk-A33VT7GC.js} +2 -2
  28. package/dist/{chunk-YDAAGCM5.js → chunk-AV6R66KO.js} +2 -2
  29. package/dist/{chunk-4HXJFMPS.js → chunk-CFSCKCT5.js} +2 -1
  30. package/dist/chunk-CFSCKCT5.js.map +1 -0
  31. package/dist/{chunk-IM4XEI2C.js → chunk-CKG7T4AD.js} +2 -2
  32. package/dist/{chunk-SMMRDLLU.js → chunk-DI2QWY6J.js} +8 -8
  33. package/dist/{chunk-7WIZNDR5.js → chunk-HOSS72UP.js} +2 -2
  34. package/dist/{chunk-5K2UIHW4.js → chunk-I3UBDUHO.js} +2 -2
  35. package/dist/{chunk-2LZHXBJM.js → chunk-JEAMQL63.js} +3 -3
  36. package/dist/{chunk-H2N65TDE.js → chunk-JG6AHBJW.js} +2 -2
  37. package/dist/{chunk-3F6COEHZ.js → chunk-JVNGFQJN.js} +1 -1
  38. package/dist/chunk-JVNGFQJN.js.map +1 -0
  39. package/dist/{chunk-V4HY4PEF.js → chunk-JY327EH4.js} +2 -2
  40. package/dist/{chunk-D3CBHMMY.js → chunk-K4DBE5MH.js} +2 -2
  41. package/dist/{chunk-E3DXY24J.js → chunk-KCLHHANX.js} +2 -2
  42. package/dist/{chunk-LKJVCDVS.js → chunk-KCVPKFDG.js} +2 -2
  43. package/dist/{chunk-EFMAYZOB.js → chunk-L6CMR5OI.js} +2 -2
  44. package/dist/{chunk-B7ZHJGPX.js → chunk-LEH4FVBJ.js} +2 -2
  45. package/dist/chunk-LEO4MQ3S.js +140 -0
  46. package/dist/chunk-LEO4MQ3S.js.map +1 -0
  47. package/dist/{chunk-4VL2H5Q3.js → chunk-LL7WIK2Z.js} +2 -2
  48. package/dist/{chunk-FIP6HDPC.js → chunk-LT35JWKZ.js} +2 -2
  49. package/dist/{chunk-O6NONCRR.js → chunk-MP6V4CLP.js} +2 -2
  50. package/dist/{chunk-N7HF7C4N.js → chunk-MXE42X3I.js} +3 -3
  51. package/dist/{chunk-ET3RHBTM.js → chunk-N6JGLQV7.js} +2 -2
  52. package/dist/{chunk-FJUCMMNT.js → chunk-NB2BKYUS.js} +2 -2
  53. package/dist/{chunk-3KOHTVQO.js → chunk-NOZDET3Q.js} +3 -3
  54. package/dist/{chunk-H3IOEMTW.js → chunk-OI3UMEW3.js} +2 -2
  55. package/dist/{chunk-TDPBSVFW.js → chunk-OJJ73HLA.js} +2 -2
  56. package/dist/{chunk-QYUYM7XE.js → chunk-PKPW7MXT.js} +2 -2
  57. package/dist/{chunk-X4V5BBI2.js → chunk-PKV3NNM2.js} +2 -2
  58. package/dist/{chunk-KYY7NODE.js → chunk-PNT3SZRY.js} +7 -7
  59. package/dist/{chunk-4XPWHXEF.js → chunk-POB7N5UM.js} +2 -2
  60. package/dist/{chunk-WS2X4WHX.js → chunk-PQ5FYNY2.js} +2 -2
  61. package/dist/{chunk-P3TQ62XC.js → chunk-QZ5JZNXN.js} +165 -56
  62. package/dist/chunk-QZ5JZNXN.js.map +1 -0
  63. package/dist/{chunk-S57YMPLX.js → chunk-SRW4IKHM.js} +2 -2
  64. package/dist/{chunk-UBSN42MM.js → chunk-VF3EVRUN.js} +2 -2
  65. package/dist/{chunk-DGKSCOB4.js → chunk-VSZEV7HG.js} +2 -2
  66. package/dist/{chunk-DONY5FXC.js → chunk-YDOLJQ55.js} +3 -3
  67. package/dist/cli.js +38 -38
  68. package/dist/coding/export-okf-codegraph.js +2 -2
  69. package/dist/compounding/engine.js +4 -4
  70. package/dist/config.d.ts.map +1 -1
  71. package/dist/config.js +3 -3
  72. package/dist/connectors/codex-materialize-runner.js +3 -3
  73. package/dist/connectors/index.js +3 -3
  74. package/dist/convergence-refresh.js +5 -5
  75. package/dist/corpus-watermark.js +5 -5
  76. package/dist/entity-retrieval.js +3 -3
  77. package/dist/explicit-capture.js +38 -38
  78. package/dist/extraction-window-drain.d.ts +21 -0
  79. package/dist/extraction-window-drain.d.ts.map +1 -1
  80. package/dist/extraction-window-drain.js +5 -3
  81. package/dist/extraction.js +3 -3
  82. package/dist/harmonic-retrieval.js +3 -3
  83. package/dist/index.js +38 -38
  84. package/dist/location/index.js +4 -4
  85. package/dist/maintenance/memory-governance.js +3 -3
  86. package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +3 -3
  87. package/dist/maintenance/rebuild-memory-projection-runner.js +5 -5
  88. package/dist/maintenance/rebuild-memory-projection.js +4 -4
  89. package/dist/namespaces/migrate.js +4 -4
  90. package/dist/namespaces/storage.js +3 -3
  91. package/dist/operator-doctor-corpus.js +6 -6
  92. package/dist/operator-toolkit.js +10 -10
  93. package/dist/orchestration/backlog-scheduler.js +39 -39
  94. package/dist/orchestration/buffer-drain-runner.js +39 -39
  95. package/dist/orchestration/extraction-drain.d.ts +13 -0
  96. package/dist/orchestration/extraction-drain.d.ts.map +1 -1
  97. package/dist/orchestration/maintenance.js +11 -11
  98. package/dist/orchestrator.d.ts.map +1 -1
  99. package/dist/orchestrator.js +38 -38
  100. package/dist/recall-explain-renderer.js +3 -3
  101. package/dist/recall-navigate-access.js +2 -2
  102. package/dist/recall-navigate-disclosure.js +2 -2
  103. package/dist/recall-navigate.js +2 -2
  104. package/dist/recall-navigation.js +38 -38
  105. package/dist/recall-xray-cli.js +4 -4
  106. package/dist/recall-xray-renderer.js +3 -3
  107. package/dist/recall-xray.js +2 -2
  108. package/dist/resume-bundles.js +4 -4
  109. package/dist/semantic-consolidation.js +4 -4
  110. package/dist/semantic-rule-promotion.js +3 -3
  111. package/dist/semantic-rule-verifier.js +3 -3
  112. package/dist/source-agent-qualifier.js +3 -3
  113. package/dist/standup/build.js +3 -3
  114. package/dist/storage.js +2 -2
  115. package/dist/transfer/export-okf.js +3 -3
  116. package/dist/types.d.ts +5 -6
  117. package/dist/types.d.ts.map +1 -1
  118. package/dist/types.js +1 -1
  119. package/dist/verified-recall.js +3 -3
  120. package/dist/who-knows-cli.js +4 -4
  121. package/dist/who-knows.js +3 -3
  122. package/package.json +2 -2
  123. package/src/buffer-turn.ts +8 -0
  124. package/src/config.ts +2 -0
  125. package/src/extraction-window-drain.test.ts +66 -0
  126. package/src/extraction-window-drain.ts +113 -2
  127. package/src/orchestration/extraction-drain-parts.test.ts +260 -0
  128. package/src/orchestration/extraction-drain.ts +186 -23
  129. package/src/orchestrator-flush.test.ts +3 -0
  130. package/src/orchestrator.ts +1 -0
  131. package/src/part-failure-threshold.test.ts +91 -0
  132. package/src/types.ts +5 -6
  133. package/dist/chunk-3F6COEHZ.js.map +0 -1
  134. package/dist/chunk-4HXJFMPS.js.map +0 -1
  135. package/dist/chunk-LZIOY7ZU.js +0 -57
  136. package/dist/chunk-LZIOY7ZU.js.map +0 -1
  137. package/dist/chunk-P3TQ62XC.js.map +0 -1
  138. /package/dist/{chunk-SDRF2WLZ.js.map → chunk-2NJ74RQU.js.map} +0 -0
  139. /package/dist/{chunk-K4EBUTPN.js.map → chunk-2VS3DAXE.js.map} +0 -0
  140. /package/dist/{chunk-W4VZ52B3.js.map → chunk-5IGWEYNV.js.map} +0 -0
  141. /package/dist/{chunk-2SZWPNG4.js.map → chunk-A33VT7GC.js.map} +0 -0
  142. /package/dist/{chunk-YDAAGCM5.js.map → chunk-AV6R66KO.js.map} +0 -0
  143. /package/dist/{chunk-IM4XEI2C.js.map → chunk-CKG7T4AD.js.map} +0 -0
  144. /package/dist/{chunk-SMMRDLLU.js.map → chunk-DI2QWY6J.js.map} +0 -0
  145. /package/dist/{chunk-7WIZNDR5.js.map → chunk-HOSS72UP.js.map} +0 -0
  146. /package/dist/{chunk-5K2UIHW4.js.map → chunk-I3UBDUHO.js.map} +0 -0
  147. /package/dist/{chunk-2LZHXBJM.js.map → chunk-JEAMQL63.js.map} +0 -0
  148. /package/dist/{chunk-H2N65TDE.js.map → chunk-JG6AHBJW.js.map} +0 -0
  149. /package/dist/{chunk-V4HY4PEF.js.map → chunk-JY327EH4.js.map} +0 -0
  150. /package/dist/{chunk-D3CBHMMY.js.map → chunk-K4DBE5MH.js.map} +0 -0
  151. /package/dist/{chunk-E3DXY24J.js.map → chunk-KCLHHANX.js.map} +0 -0
  152. /package/dist/{chunk-LKJVCDVS.js.map → chunk-KCVPKFDG.js.map} +0 -0
  153. /package/dist/{chunk-EFMAYZOB.js.map → chunk-L6CMR5OI.js.map} +0 -0
  154. /package/dist/{chunk-B7ZHJGPX.js.map → chunk-LEH4FVBJ.js.map} +0 -0
  155. /package/dist/{chunk-4VL2H5Q3.js.map → chunk-LL7WIK2Z.js.map} +0 -0
  156. /package/dist/{chunk-FIP6HDPC.js.map → chunk-LT35JWKZ.js.map} +0 -0
  157. /package/dist/{chunk-O6NONCRR.js.map → chunk-MP6V4CLP.js.map} +0 -0
  158. /package/dist/{chunk-N7HF7C4N.js.map → chunk-MXE42X3I.js.map} +0 -0
  159. /package/dist/{chunk-ET3RHBTM.js.map → chunk-N6JGLQV7.js.map} +0 -0
  160. /package/dist/{chunk-FJUCMMNT.js.map → chunk-NB2BKYUS.js.map} +0 -0
  161. /package/dist/{chunk-3KOHTVQO.js.map → chunk-NOZDET3Q.js.map} +0 -0
  162. /package/dist/{chunk-H3IOEMTW.js.map → chunk-OI3UMEW3.js.map} +0 -0
  163. /package/dist/{chunk-TDPBSVFW.js.map → chunk-OJJ73HLA.js.map} +0 -0
  164. /package/dist/{chunk-QYUYM7XE.js.map → chunk-PKPW7MXT.js.map} +0 -0
  165. /package/dist/{chunk-X4V5BBI2.js.map → chunk-PKV3NNM2.js.map} +0 -0
  166. /package/dist/{chunk-KYY7NODE.js.map → chunk-PNT3SZRY.js.map} +0 -0
  167. /package/dist/{chunk-4XPWHXEF.js.map → chunk-POB7N5UM.js.map} +0 -0
  168. /package/dist/{chunk-WS2X4WHX.js.map → chunk-PQ5FYNY2.js.map} +0 -0
  169. /package/dist/{chunk-S57YMPLX.js.map → chunk-SRW4IKHM.js.map} +0 -0
  170. /package/dist/{chunk-UBSN42MM.js.map → chunk-VF3EVRUN.js.map} +0 -0
  171. /package/dist/{chunk-DGKSCOB4.js.map → chunk-VSZEV7HG.js.map} +0 -0
  172. /package/dist/{chunk-DONY5FXC.js.map → chunk-YDOLJQ55.js.map} +0 -0
@@ -36,7 +36,7 @@ import {
36
36
  import {
37
37
  exportOkfBundle,
38
38
  parseIncludeStatus
39
- } from "./chunk-FJUCMMNT.js";
39
+ } from "./chunk-NB2BKYUS.js";
40
40
  import {
41
41
  exportSqlite
42
42
  } from "./chunk-BV2TIZ4F.js";
@@ -71,7 +71,7 @@ import {
71
71
  import {
72
72
  buildStandup,
73
73
  parseStandupDate
74
- } from "./chunk-7WIZNDR5.js";
74
+ } from "./chunk-HOSS72UP.js";
75
75
  import {
76
76
  SupportPassportAccessSurface,
77
77
  createSupportPassportModelAdapter,
@@ -86,7 +86,7 @@ import {
86
86
  import {
87
87
  ActivityStore,
88
88
  MaintenanceScheduler
89
- } from "./chunk-KYY7NODE.js";
89
+ } from "./chunk-PNT3SZRY.js";
90
90
  import {
91
91
  runPeerProfileReasoner
92
92
  } from "./chunk-I74SUMNI.js";
@@ -110,7 +110,7 @@ import {
110
110
  } from "./chunk-EDR6CVWZ.js";
111
111
  import {
112
112
  rebuildMemoryLifecycleLedger
113
- } from "./chunk-X4V5BBI2.js";
113
+ } from "./chunk-PKV3NNM2.js";
114
114
  import {
115
115
  rebuildObservations
116
116
  } from "./chunk-WHCD4Z3D.js";
@@ -124,7 +124,7 @@ import {
124
124
  runLocationDay,
125
125
  runLocationStatus,
126
126
  runLocationSync
127
- } from "./chunk-N7HF7C4N.js";
127
+ } from "./chunk-MXE42X3I.js";
128
128
  import {
129
129
  archiveObservations
130
130
  } from "./chunk-7IGMKQWK.js";
@@ -140,7 +140,7 @@ import {
140
140
  import {
141
141
  CompoundingEngine,
142
142
  defaultTierMigrationCycleBudget
143
- } from "./chunk-2LZHXBJM.js";
143
+ } from "./chunk-JEAMQL63.js";
144
144
  import {
145
145
  SharedContextManager,
146
146
  UNATTRIBUTED_ACCESS_WRITE_ORIGIN
@@ -193,7 +193,7 @@ import {
193
193
  handleWhoKnowsHttpQuery,
194
194
  loadWhoKnowsEntities,
195
195
  validateWhoKnowsInput
196
- } from "./chunk-4XPWHXEF.js";
196
+ } from "./chunk-POB7N5UM.js";
197
197
  import {
198
198
  WriteQuarantineStore
199
199
  } from "./chunk-BANSBRNX.js";
@@ -219,7 +219,7 @@ import {
219
219
  import {
220
220
  compareVerifiedEpisodeResults,
221
221
  searchVerifiedEpisodes
222
- } from "./chunk-IM4XEI2C.js";
222
+ } from "./chunk-CKG7T4AD.js";
223
223
  import {
224
224
  extractTopics
225
225
  } from "./chunk-KVDUKH5E.js";
@@ -280,11 +280,11 @@ import {
280
280
  } from "./chunk-LJLGH2DE.js";
281
281
  import {
282
282
  promoteSemanticRuleFromMemory
283
- } from "./chunk-WS2X4WHX.js";
283
+ } from "./chunk-PQ5FYNY2.js";
284
284
  import {
285
285
  compareVerifiedSemanticRuleResults,
286
286
  searchVerifiedSemanticRules
287
- } from "./chunk-2SZWPNG4.js";
287
+ } from "./chunk-A33VT7GC.js";
288
288
  import {
289
289
  SessionObserverState
290
290
  } from "./chunk-ODZKV2F7.js";
@@ -307,7 +307,7 @@ import {
307
307
  buildResumeBundleFromState,
308
308
  getResumeBundleStatus,
309
309
  recordResumeBundle
310
- } from "./chunk-SDRF2WLZ.js";
310
+ } from "./chunk-2NJ74RQU.js";
311
311
  import {
312
312
  getWorkProductLedgerStatus,
313
313
  recordWorkProductLedgerEntry,
@@ -340,7 +340,7 @@ import {
340
340
  } from "./chunk-ZOKZIR5K.js";
341
341
  import {
342
342
  parseXrayCliOptions
343
- } from "./chunk-W4VZ52B3.js";
343
+ } from "./chunk-5IGWEYNV.js";
344
344
  import {
345
345
  findUnresolvedEntityRefs
346
346
  } from "./chunk-X7XN6YU4.js";
@@ -396,7 +396,7 @@ import {
396
396
  } from "./chunk-VYDGHJIN.js";
397
397
  import {
398
398
  planDisclosureStep
399
- } from "./chunk-4VL2H5Q3.js";
399
+ } from "./chunk-LL7WIK2Z.js";
400
400
  import {
401
401
  parseNavigateLinkType
402
402
  } from "./chunk-7O5EW7KX.js";
@@ -408,12 +408,12 @@ import {
408
408
  renderRecallExplain,
409
409
  renderXray,
410
410
  toRecallExplainJson
411
- } from "./chunk-5K2UIHW4.js";
411
+ } from "./chunk-I3UBDUHO.js";
412
412
  import {
413
413
  buildXraySnapshot,
414
414
  estimateRecallTokens,
415
415
  summarizeDisclosureTokens
416
- } from "./chunk-QYUYM7XE.js";
416
+ } from "./chunk-PKPW7MXT.js";
417
417
  import {
418
418
  reorderRecallResultsWithMmr
419
419
  } from "./chunk-IIK2PD3F.js";
@@ -454,12 +454,12 @@ import {
454
454
  runOperatorRepair,
455
455
  runOperatorSetup,
456
456
  summarizeNamespaceMaintenanceHealth
457
- } from "./chunk-SMMRDLLU.js";
457
+ } from "./chunk-DI2QWY6J.js";
458
458
  import {
459
459
  NamespaceCatalog,
460
460
  isNamespaceKind,
461
461
  planNamespaceMaintenance
462
- } from "./chunk-DGKSCOB4.js";
462
+ } from "./chunk-VSZEV7HG.js";
463
463
  import {
464
464
  analyzeSessionIntegrity,
465
465
  applySessionRepair,
@@ -558,7 +558,7 @@ import {
558
558
  import {
559
559
  readProjectedHarmonicGraph,
560
560
  searchHarmonicRetrieval
561
- } from "./chunk-E3DXY24J.js";
561
+ } from "./chunk-KCLHHANX.js";
562
562
  import {
563
563
  removeNodeEdgesForRewrite,
564
564
  rollbackNodeEdgeRewrite
@@ -596,8 +596,9 @@ import {
596
596
  chunkExtractionWindow,
597
597
  classifyDrainResult,
598
598
  extractionWindowBudgetChars,
599
- mergeDrainResults
600
- } from "./chunk-LZIOY7ZU.js";
599
+ mergeDrainResults,
600
+ splitOversizedTurns
601
+ } from "./chunk-LEO4MQ3S.js";
601
602
  import {
602
603
  recordJudgeTrainingPair
603
604
  } from "./chunk-PWFCHOB3.js";
@@ -656,7 +657,7 @@ import {
656
657
  buildEntityRecallSection,
657
658
  entityRecentTranscriptLookbackHours,
658
659
  readRecentEntityTranscriptEntries
659
- } from "./chunk-H3IOEMTW.js";
660
+ } from "./chunk-OI3UMEW3.js";
660
661
  import {
661
662
  boundRecallContextComposition,
662
663
  composeMissingMemoryContext,
@@ -702,12 +703,12 @@ import {
702
703
  } from "./chunk-RF2SMMPP.js";
703
704
  import {
704
705
  refreshConvergedNamespaces
705
- } from "./chunk-H2N65TDE.js";
706
+ } from "./chunk-JG6AHBJW.js";
706
707
  import {
707
708
  rebuildMemoryProjection,
708
709
  repairMemoryProjection,
709
710
  verifyMemoryProjection
710
- } from "./chunk-3KOHTVQO.js";
711
+ } from "./chunk-NOZDET3Q.js";
711
712
  import {
712
713
  buildProposedActions,
713
714
  buildQualityScore,
@@ -716,7 +717,7 @@ import {
716
717
  readMemoryGovernanceRunArtifact,
717
718
  restoreMemoryGovernanceRun,
718
719
  runMemoryGovernance
719
- } from "./chunk-UBSN42MM.js";
720
+ } from "./chunk-VF3EVRUN.js";
720
721
  import {
721
722
  collectNativeKnowledgeChunks,
722
723
  formatNativeKnowledgeSection,
@@ -725,15 +726,15 @@ import {
725
726
  import {
726
727
  CorpusWatermarkCache,
727
728
  computeServiceCorpusCensus
728
- } from "./chunk-S57YMPLX.js";
729
+ } from "./chunk-SRW4IKHM.js";
729
730
  import {
730
731
  listNamespaces,
731
732
  runNamespaceMigration,
732
733
  verifyNamespaces
733
- } from "./chunk-TDPBSVFW.js";
734
+ } from "./chunk-OJJ73HLA.js";
734
735
  import {
735
736
  NamespaceStorageRouter
736
- } from "./chunk-O6NONCRR.js";
737
+ } from "./chunk-MP6V4CLP.js";
737
738
  import {
738
739
  CrossNamespaceBudget,
739
740
  toBudgetWarning
@@ -782,7 +783,7 @@ import {
782
783
  materializeAfterSemanticConsolidation,
783
784
  parseConsolidationResponse,
784
785
  parseOperatorAwareConsolidationResponse
785
- } from "./chunk-V4HY4PEF.js";
786
+ } from "./chunk-JY327EH4.js";
786
787
  import {
787
788
  resolveNamespaceChildRoot
788
789
  } from "./chunk-3UXOZBHV.js";
@@ -858,7 +859,7 @@ import {
858
859
  parseBriefingFocus,
859
860
  parseBriefingWindow,
860
861
  validateBriefingFormat
861
- } from "./chunk-D3CBHMMY.js";
862
+ } from "./chunk-K4DBE5MH.js";
862
863
  import {
863
864
  ReplayAdmissionRefusedError,
864
865
  StorageTargetRequiredError
@@ -913,7 +914,7 @@ import {
913
914
  validateCorrectionAction,
914
915
  validateCorrectionRequest,
915
916
  validateRedactionPattern
916
- } from "./chunk-4HXJFMPS.js";
917
+ } from "./chunk-CFSCKCT5.js";
917
918
  import {
918
919
  compileCorrectionRule,
919
920
  correctionsFilePath,
@@ -1026,7 +1027,7 @@ import {
1026
1027
  reconstructFusionInputs,
1027
1028
  selfDeps,
1028
1029
  serializeFusionDay
1029
- } from "./chunk-B7ZHJGPX.js";
1030
+ } from "./chunk-LEH4FVBJ.js";
1030
1031
  import {
1031
1032
  buildRetiredFactTombstoneInputs
1032
1033
  } from "./chunk-QGVCFVX6.js";
@@ -1349,7 +1350,7 @@ import {
1349
1350
  RECALL_WHY_MCP_TOOLS,
1350
1351
  handleRecallWhyHttpQuery,
1351
1352
  handleRecallXrayHttpQuery
1352
- } from "./chunk-K4EBUTPN.js";
1353
+ } from "./chunk-2VS3DAXE.js";
1353
1354
  import {
1354
1355
  runContradictionScan
1355
1356
  } from "./chunk-SX4BR26Y.js";
@@ -1363,7 +1364,7 @@ import {
1363
1364
  RECALL_DISCLOSURE_LEVELS,
1364
1365
  confidenceTier,
1365
1366
  isRecallDisclosure
1366
- } from "./chunk-3F6COEHZ.js";
1367
+ } from "./chunk-JVNGFQJN.js";
1367
1368
  import {
1368
1369
  extractJsonCandidates
1369
1370
  } from "./chunk-YBA52OKG.js";
@@ -20693,7 +20694,10 @@ function markDuplicateTurns(turns, collapsed, start = 0, end = turns.length) {
20693
20694
  // src/orchestration/extraction-drain.ts
20694
20695
  function chunkFingerprint(chunk) {
20695
20696
  const hash = createHash9("sha256");
20696
- for (const turn of chunk) hash.update(`${turn.role}\0${turn.timestamp}\0${turn.content}`);
20697
+ for (const turn of chunk) {
20698
+ const part = turn.extractionPartOf ? `#${turn.extractionPartOf.part}/${turn.extractionPartOf.of}` : "";
20699
+ hash.update(`${turn.role}\0${turn.timestamp}\0${turn.content}${part}`);
20700
+ }
20697
20701
  return hash.digest("hex");
20698
20702
  }
20699
20703
  var ExtractionDrain = class {
@@ -20723,13 +20727,24 @@ var ExtractionDrain = class {
20723
20727
  }
20724
20728
  return total;
20725
20729
  }
20730
+ /** Failure counts are keyed by buffer key AND chunk fingerprint: with one
20731
+ * slot per key, a sibling chunk's success (count reset to 0) would delete
20732
+ * a failing part's count and it would never reach the drop threshold. */
20726
20733
  failureCount(bufferKey, chunk) {
20727
- const entry = this.failures.get(bufferKey);
20728
- return entry && entry.fingerprint === chunkFingerprint(chunk) ? entry.count : 0;
20734
+ return this.failures.get(this.failureSlot(bufferKey, chunk)) ?? 0;
20729
20735
  }
20730
20736
  setFailureCount(bufferKey, chunk, count) {
20731
- if (count <= 0) this.failures.delete(bufferKey);
20732
- else this.failures.set(bufferKey, { fingerprint: chunkFingerprint(chunk), count });
20737
+ const slot = this.failureSlot(bufferKey, chunk);
20738
+ if (count <= 0) this.failures.delete(slot);
20739
+ else this.failures.set(slot, count);
20740
+ }
20741
+ failureSlot(bufferKey, chunk) {
20742
+ return `${bufferKey}\0${chunkFingerprint(chunk)}`;
20743
+ }
20744
+ clearBufferFailures(bufferKey) {
20745
+ for (const slot of this.failures.keys()) {
20746
+ if (slot.startsWith(`${bufferKey}\0`)) this.failures.delete(slot);
20747
+ }
20733
20748
  }
20734
20749
  /**
20735
20750
  * Run `runExtraction` over the trigger-drain window. When the window outgrows
@@ -20754,9 +20769,21 @@ var ExtractionDrain = class {
20754
20769
  */
20755
20770
  async run(turns, runOptions, preemptable = false, preemptHandle) {
20756
20771
  const budgetChars = this.deps.extractionWindowBudgetChars?.() ?? Number.POSITIVE_INFINITY;
20757
- const collapsed = collapseExactDuplicateTurns(turns);
20772
+ const partBudget = Math.min(budgetChars, this.deps.config.extractionMaxTurnChars);
20773
+ const hasOversized = Number.isFinite(partBudget) && partBudget > 0 && this.chunkable(runOptions, turns, budgetChars) && turns.some((turn) => turn.content.length > partBudget);
20774
+ const collapsed = hasOversized ? {
20775
+ representatives: turns,
20776
+ representativePositions: turns.map((_, index) => index),
20777
+ duplicateFlags: turns.map(() => false),
20778
+ duplicateCount: 0
20779
+ } : collapseExactDuplicateTurns(turns);
20758
20780
  const window = collapsed.duplicateCount > 0 ? markDuplicateTurns(turns, collapsed) : turns;
20759
- const plan = this.chunkPlan(turns, runOptions, budgetChars, collapsed);
20781
+ const plan = this.chunkPlan(turns, runOptions, budgetChars, collapsed, partBudget);
20782
+ if (plan.clampedParts > 0) {
20783
+ log.warn(
20784
+ `buffer[${runOptions.bufferKey}]: clamped ${plan.clampedParts} oversized turns at the part limit; the unemitted tail content stays buffered for the next drain`
20785
+ );
20786
+ }
20760
20787
  if (plan.singleRun) {
20761
20788
  if (collapsed.duplicateCount === 0) return await this.deps.runExtraction(turns, runOptions);
20762
20789
  if (this.windowBelowThreshold(turns, runOptions)) return await this.deps.runExtraction(turns, runOptions);
@@ -20770,19 +20797,33 @@ var ExtractionDrain = class {
20770
20797
  return await this.deps.runExtraction(turns, runOptions);
20771
20798
  }
20772
20799
  const options = collapsed.duplicateCount > 0 ? { ...runOptions, skipCharThreshold: true, skipUserTurnThreshold: true } : runOptions;
20773
- return await this.runChunked(plan.chunks, options, preemptable, preemptHandle);
20800
+ return await this.runChunked(plan.chunks, options, preemptable, preemptHandle, plan.partParents, plan.clampedParents);
20774
20801
  }
20775
20802
  /** Chunking plan for one trigger-drain window. Accepted-capture groups
20776
20803
  * keep their pinned head; a window with duplicates is planned on its
20777
20804
  * representatives and each chunk is then expanded back to its contiguous
20778
20805
  * original span with the duplicates marked. */
20779
- chunkPlan(turns, runOptions, budgetChars, collapsed) {
20806
+ chunkPlan(turns, runOptions, budgetChars, collapsed, partBudget = Number.POSITIVE_INFINITY) {
20780
20807
  const deduped = collapsed !== void 0 && collapsed.duplicateCount > 0;
20781
- const planning = deduped ? collapsed.representatives : turns;
20808
+ const split = deduped || !this.chunkable(runOptions, turns, budgetChars) ? {
20809
+ turns: [...turns],
20810
+ partParents: /* @__PURE__ */ new Map(),
20811
+ clampedParents: /* @__PURE__ */ new Set(),
20812
+ clamped: false
20813
+ } : splitOversizedTurns(turns, partBudget);
20814
+ const planning = deduped ? collapsed.representatives : split.turns;
20782
20815
  const repChunks = this.chunkable(runOptions, turns, budgetChars) ? this.deps.measureRenderedTurns !== void 0 ? this.chunkByRenderedSize(planning, budgetChars) : chunkExtractionWindow(planning, budgetChars) : [];
20783
20816
  const resumed = repChunks.length > 0 && this.qualified.get(runOptions.bufferKey) === chunkFingerprint(repChunks[0].slice(0, 1));
20784
20817
  const chunks = deduped ? this.expandedChunks(turns, collapsed, repChunks) : repChunks;
20785
- return { singleRun: chunks.length <= 1 && !resumed, chunks, resumed };
20818
+ const partParents = split.partParents.size > 0 ? split.partParents : void 0;
20819
+ return {
20820
+ singleRun: chunks.length <= 1 && !resumed && partParents === void 0,
20821
+ chunks,
20822
+ resumed,
20823
+ partParents,
20824
+ clampedParts: split.clampedParents.size,
20825
+ clampedParents: split.clampedParents.size > 0 ? split.clampedParents : void 0
20826
+ };
20786
20827
  }
20787
20828
  /** Each representative chunk expands to a PARTITION slice of the original window:
20788
20829
  * chunk k spans [start_k, start_k+1) where start_0 = 0 and start_k+1 is chunk
@@ -20822,7 +20863,7 @@ var ExtractionDrain = class {
20822
20863
  }
20823
20864
  /** The window qualified as a whole; its chunks must not be re-judged one by
20824
20865
  * one (an assistant-only or short chunk would be cleared unextracted). */
20825
- async runChunked(chunks, runOptions, preemptable, preemptHandle) {
20866
+ async runChunked(chunks, runOptions, preemptable, preemptHandle, partParents, clampedParents) {
20826
20867
  const baseOptions = { ...runOptions, skipCharThreshold: true, skipUserTurnThreshold: true };
20827
20868
  const bufferKey = runOptions.bufferKey;
20828
20869
  const byIdentity = runOptions.clearMatchingTurns === true;
@@ -20844,11 +20885,21 @@ var ExtractionDrain = class {
20844
20885
  result = await this.deps.runExtraction(chunk, chunkOptions);
20845
20886
  } catch (err) {
20846
20887
  this.rethrowChunkAbort(err, preempt, runOptions.abortSignal?.aborted === true);
20847
- aggregate = await this.settleThrownChunk(bufferKey, chunk, failures, dropAfter, err, byIdentity, aggregate);
20888
+ aggregate = await this.settleThrownChunk(
20889
+ bufferKey,
20890
+ chunk,
20891
+ failures,
20892
+ dropAfter,
20893
+ err,
20894
+ byIdentity,
20895
+ aggregate,
20896
+ partParents
20897
+ );
20848
20898
  continue;
20849
20899
  }
20850
20900
  const settled = this.settleVerdict(bufferKey, chunk, result, aggregate);
20851
20901
  if (settled.action === "continue") {
20902
+ await this.clearFinishedPartParents(bufferKey, chunk, partParents, clampedParents);
20852
20903
  aggregate = settled.result;
20853
20904
  continue;
20854
20905
  }
@@ -20860,7 +20911,8 @@ var ExtractionDrain = class {
20860
20911
  dropAfter,
20861
20912
  result: settled.result,
20862
20913
  byIdentity,
20863
- aggregate: settled.aggregate
20914
+ aggregate: settled.aggregate,
20915
+ partParents
20864
20916
  });
20865
20917
  if (failed.action === "continue") {
20866
20918
  aggregate = failed.result;
@@ -20869,6 +20921,7 @@ var ExtractionDrain = class {
20869
20921
  return failed.result;
20870
20922
  }
20871
20923
  this.qualified.delete(bufferKey);
20924
+ this.clearBufferFailures(bufferKey);
20872
20925
  return aggregate ?? { status: "skipped", persistedCount: 0, durableOutputCount: 0 };
20873
20926
  }
20874
20927
  /** retention replaces theirs (retained turns do not pile up across chunks) */
@@ -20902,7 +20955,7 @@ var ExtractionDrain = class {
20902
20955
  * threshold (or on a no-drop drain) rethrow so the window is retained;
20903
20956
  * at the threshold a chunk that keeps throwing is dropped like one that
20904
20957
  * keeps failing, so later chunks are not stuck behind it. */
20905
- async settleThrownChunk(bufferKey, chunk, failures, dropAfter, cause, byIdentity, aggregate) {
20958
+ async settleThrownChunk(bufferKey, chunk, failures, dropAfter, cause, byIdentity, aggregate, partParents) {
20906
20959
  failures += 1;
20907
20960
  if (failures < dropAfter || !this.dropFailedChunks) {
20908
20961
  this.setFailureCount(bufferKey, chunk, failures);
@@ -20914,7 +20967,7 @@ var ExtractionDrain = class {
20914
20967
  persistedCount: 0,
20915
20968
  durableOutputCount: 0
20916
20969
  };
20917
- if (!await this.dropFailedChunk(bufferKey, chunk, dropAfter, thrown, byIdentity)) {
20970
+ if (!await this.dropFailedChunk(bufferKey, chunk, dropAfter, thrown, byIdentity, partParents)) {
20918
20971
  this.setFailureCount(bufferKey, chunk, failures);
20919
20972
  throw cause;
20920
20973
  }
@@ -20940,7 +20993,14 @@ var ExtractionDrain = class {
20940
20993
  async settleFailedChunk(args) {
20941
20994
  const failures = args.failures + 1;
20942
20995
  if (failures >= args.dropAfter && this.dropFailedChunks) {
20943
- if (!await this.dropFailedChunk(args.bufferKey, args.chunk, args.dropAfter, args.result, args.byIdentity)) {
20996
+ if (!await this.dropFailedChunk(
20997
+ args.bufferKey,
20998
+ args.chunk,
20999
+ args.dropAfter,
21000
+ args.result,
21001
+ args.byIdentity,
21002
+ args.partParents
21003
+ )) {
20944
21004
  this.setFailureCount(args.bufferKey, args.chunk, failures);
20945
21005
  return { action: "return", result: mergeDrainResults(args.aggregate, args.result) };
20946
21006
  }
@@ -20967,13 +21027,16 @@ var ExtractionDrain = class {
20967
21027
  }
20968
21028
  /** Side-file copy first (content survives a failed drop), then remove the failing chunk from the buffer. Never throws:
20969
21029
  * the drop must not fail the extraction task that already settled its result. */
20970
- async dropFailedChunk(bufferKey, chunk, dropAfter, result, byIdentity) {
21030
+ async dropFailedChunk(bufferKey, chunk, dropAfter, result, byIdentity, partParents) {
20971
21031
  const reason = `dropped after ${dropAfter} repeated extraction failures (last result: status=${result.status} reason=${result.reason ?? "n/a"})`;
20972
- const copyPath = await this.saveRecoveryCopy(bufferKey, reason, chunk);
21032
+ const dropTurns = partParents === void 0 ? chunk : this.dropSetForParts(chunk, partParents);
21033
+ const copyPath = await this.saveRecoveryCopy(bufferKey, reason, dropTurns);
20973
21034
  if (copyPath === null) return false;
20974
- log.warn(`buffer[${bufferKey}]: dropping ${chunk.length} turns \u2014 ${reason}; copy saved to ${copyPath}`);
21035
+ log.warn(`buffer[${bufferKey}]: dropping ${dropTurns.length} turns \u2014 ${reason}; copy saved to ${copyPath}`);
20975
21036
  try {
20976
- const dropped = await this.deps.buffer.dropExtractionChunk(bufferKey, chunk, { allowNonPrefix: byIdentity });
21037
+ const dropped = await this.deps.buffer.dropExtractionChunk(bufferKey, dropTurns, {
21038
+ allowNonPrefix: byIdentity || partParents !== void 0
21039
+ });
20977
21040
  if (dropped > 0) {
20978
21041
  log.warn(`buffer[${bufferKey}]: removed ${dropped} buffered turns \u2014 ${reason}`);
20979
21042
  return true;
@@ -20999,6 +21062,51 @@ var ExtractionDrain = class {
20999
21062
  return null;
21000
21063
  }
21001
21064
  }
21065
+ /** The buffered identities a part-carrying chunk actually removes on drop:
21066
+ * real turns themselves plus each part copy's parent, once per parent. */
21067
+ dropSetForParts(chunk, partParents) {
21068
+ const seen = /* @__PURE__ */ new Set();
21069
+ const dropTurns = [];
21070
+ for (const turn of chunk) {
21071
+ const target = partParents.get(turn) ?? turn;
21072
+ if (seen.has(target)) continue;
21073
+ seen.add(target);
21074
+ dropTurns.push(target);
21075
+ }
21076
+ return dropTurns;
21077
+ }
21078
+ /** A part's slice never equals its parent's buffered content, so no drain
21079
+ * clears a parent implicitly. When the LAST part of a parent drains, the
21080
+ * whole turn has been extracted and the parent is removed by identity —
21081
+ * non-prefix, since earlier chunks may leave it mid-buffer. */
21082
+ async clearFinishedPartParents(bufferKey, chunk, partParents, clampedParents) {
21083
+ if (partParents === void 0) return;
21084
+ for (const turn of chunk) {
21085
+ const marker = turn.extractionPartOf;
21086
+ if (marker === void 0 || marker.part !== marker.of) continue;
21087
+ const parent = partParents.get(turn);
21088
+ if (parent === void 0) continue;
21089
+ if (clampedParents?.has(parent) === true) {
21090
+ const copyPath = await this.saveRecoveryCopy(
21091
+ bufferKey,
21092
+ "clamped at the per-turn part limit; unemitted tail preserved",
21093
+ [parent]
21094
+ );
21095
+ if (copyPath === null) continue;
21096
+ log.warn(`buffer[${bufferKey}]: clamped turn removed after part extraction; copy saved to ${copyPath}`);
21097
+ }
21098
+ try {
21099
+ const dropped = await this.deps.buffer.dropExtractionChunk(bufferKey, [parent], { allowNonPrefix: true });
21100
+ if (dropped === 0) {
21101
+ log.warn(`buffer[${bufferKey}]: extracted turn's parts drained but its parent no longer matches the buffer`);
21102
+ }
21103
+ } catch (err) {
21104
+ log.warn(
21105
+ `buffer[${bufferKey}]: failed to clear an extracted turn's parent (it stays buffered for retry): ${describeError(err)}`
21106
+ );
21107
+ }
21108
+ }
21109
+ }
21002
21110
  };
21003
21111
 
21004
21112
  // src/orchestration/buffer-drain-gate.ts
@@ -29642,7 +29750,8 @@ ${doc.content}` : doc.content
29642
29750
  registry: this.modelRegistry,
29643
29751
  localExtractionActive: this.config.modelSource !== "gateway" && resolveLocalLlmCapabilities(this.config).localLlm,
29644
29752
  model: this.config.localLlmModel,
29645
- maxContext: this.config.localLlmMaxContext
29753
+ maxContext: this.config.localLlmMaxContext,
29754
+ callMaxChars: this.config.extractionCallMaxChars
29646
29755
  });
29647
29756
  }
29648
29757
  normalizeExtractionFingerprintTurns(turns) {
@@ -67374,4 +67483,4 @@ export {
67374
67483
  EngramAccessService,
67375
67484
  AccessAdminOpsSurface
67376
67485
  };
67377
- //# sourceMappingURL=chunk-P3TQ62XC.js.map
67486
+ //# sourceMappingURL=chunk-QZ5JZNXN.js.map