@sema-agent/core 7.64.0 → 7.66.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (192) hide show
  1. package/CHANGELOG.md +571 -0
  2. package/dist/agents/delegation-registry-seat.d.ts +15 -0
  3. package/dist/agents/delegation-registry-seat.js +13 -0
  4. package/dist/agents/org-delivery-gate.d.ts +8 -1
  5. package/dist/agents/org-delivery-gate.js +9 -3
  6. package/dist/agents/peer-held-queue.js +1 -1
  7. package/dist/agents/peer-idle.js +1 -1
  8. package/dist/agents/peer-session-drain.d.ts +51 -12
  9. package/dist/agents/peer-session-drain.js +47 -34
  10. package/dist/agents/read-inbox-tool.d.ts +6 -2
  11. package/dist/agents/read-inbox-tool.js +18 -5
  12. package/dist/agents/subagent.d.ts +3 -1
  13. package/dist/agents/subagent.js +84 -77
  14. package/dist/brain/reasoning.d.ts +2 -0
  15. package/dist/brain/reasoning.js +1 -0
  16. package/dist/core/allow-entry.d.ts +9 -0
  17. package/dist/core/allow-entry.js +7 -1
  18. package/dist/core/ask-origin.d.ts +23 -3
  19. package/dist/core/ask-origin.js +11 -1
  20. package/dist/core/auto-promote.d.ts +3 -2
  21. package/dist/core/background-agent-store.d.ts +7 -0
  22. package/dist/core/checkpoint-store.d.ts +2 -3
  23. package/dist/core/context-settings.d.ts +1 -2
  24. package/dist/core/context-settings.js +1 -1
  25. package/dist/core/engine-attestation.d.ts +2 -2
  26. package/dist/core/engine-notice.d.ts +13 -1
  27. package/dist/core/engine-notice.js +3 -1
  28. package/dist/core/file-history-store.d.ts +2 -2
  29. package/dist/core/file-history-store.js +0 -4
  30. package/dist/core/gate-fold.js +3 -1
  31. package/dist/core/governance-codes.d.ts +6 -4
  32. package/dist/core/governance-codes.js +5 -3
  33. package/dist/core/human-input-projection.d.ts +9 -0
  34. package/dist/core/human-input-projection.js +13 -0
  35. package/dist/core/input-author.d.ts +66 -6
  36. package/dist/core/input-author.js +21 -3
  37. package/dist/core/leg-identity.d.ts +18 -2
  38. package/dist/core/leg-identity.js +5 -7
  39. package/dist/core/mailbox-store.d.ts +1 -1
  40. package/dist/core/memory-engine/consolidation.d.ts +30 -10
  41. package/dist/core/memory-engine/consolidation.js +41 -6
  42. package/dist/core/memory-engine/control-objects.d.ts +36 -3
  43. package/dist/core/memory-engine/control-objects.js +134 -12
  44. package/dist/core/memory-engine/control-plane-adoption.d.ts +13 -9
  45. package/dist/core/memory-engine/control-plane-adoption.js +58 -31
  46. package/dist/core/memory-engine/delegation-settlement.d.ts +75 -52
  47. package/dist/core/memory-engine/delegation-settlement.js +211 -228
  48. package/dist/core/memory-engine/dual-root.d.ts +3 -2
  49. package/dist/core/memory-engine/dual-root.js +5 -1
  50. package/dist/core/memory-engine/engine.d.ts +33 -16
  51. package/dist/core/memory-engine/engine.js +213 -177
  52. package/dist/core/memory-engine/file-backend.d.ts +21 -12
  53. package/dist/core/memory-engine/file-backend.js +58 -104
  54. package/dist/core/memory-engine/index.d.ts +2 -2
  55. package/dist/core/memory-engine/index.js +2 -2
  56. package/dist/core/memory-engine/layout.d.ts +184 -83
  57. package/dist/core/memory-engine/layout.js +267 -172
  58. package/dist/core/memory-engine/memory-age.d.ts +12 -0
  59. package/dist/core/memory-engine/memory-age.js +17 -0
  60. package/dist/core/memory-engine/memory-backend-contract.js +12 -11
  61. package/dist/core/memory-engine/memory-deployment.d.ts +4 -3
  62. package/dist/core/memory-engine/memory-deployment.js +6 -3
  63. package/dist/core/memory-engine/origin-clearance.d.ts +43 -15
  64. package/dist/core/memory-engine/origin-clearance.js +142 -58
  65. package/dist/core/memory-engine/tools.d.ts +2 -2
  66. package/dist/core/memory-engine/tools.js +7 -7
  67. package/dist/core/memory-engine/types.d.ts +16 -10
  68. package/dist/core/memory-vector.d.ts +6 -14
  69. package/dist/core/memory.d.ts +0 -462
  70. package/dist/core/memory.js +0 -333
  71. package/dist/core/model-receipt.d.ts +2 -1
  72. package/dist/core/model-receipt.js +5 -0
  73. package/dist/core/mods/dollar.d.ts +12 -0
  74. package/dist/core/mods/kernel/dispatch.d.ts +3 -1
  75. package/dist/core/mods/kernel/dispatch.js +5 -2
  76. package/dist/core/mods/kernel/events.d.ts +3 -1
  77. package/dist/core/mods/kernel/events.js +2 -2
  78. package/dist/core/mods/prompt-submit.d.ts +4 -0
  79. package/dist/core/mods/prompt-submit.js +24 -0
  80. package/dist/core/mods/stations.d.ts +23 -4
  81. package/dist/core/mods/stations.js +14 -7
  82. package/dist/core/permission-rule-consent.d.ts +49 -18
  83. package/dist/core/permission-rule-consent.js +59 -38
  84. package/dist/core/permission-rule-store.d.ts +24 -14
  85. package/dist/core/retention.d.ts +2 -7
  86. package/dist/core/retention.js +0 -1
  87. package/dist/core/retired-host-table-account.d.ts +19 -0
  88. package/dist/core/retired-host-table-account.js +28 -0
  89. package/dist/core/retired-tool-name-account.d.ts +60 -0
  90. package/dist/core/retired-tool-name-account.js +32 -0
  91. package/dist/core/roles.d.ts +3 -1
  92. package/dist/core/roles.js +5 -2
  93. package/dist/core/runner/classifier-ladder.d.ts +3 -1
  94. package/dist/core/runner/classifier-ladder.js +2 -2
  95. package/dist/core/runner/compact-session.js +2 -1
  96. package/dist/core/runner/contracts.d.ts +9 -9
  97. package/dist/core/runner/delegation-owner.d.ts +0 -8
  98. package/dist/core/runner/delegation-owner.js +1 -3
  99. package/dist/core/runner/gate-exit.js +9 -2
  100. package/dist/core/runner/memory-consolidation-driver.js +2 -2
  101. package/dist/core/runner/prepare-config-doors.js +1 -1
  102. package/dist/core/runner/prepare-delegation-surface.d.ts +1 -1
  103. package/dist/core/runner/prepare-delegation-surface.js +5 -3
  104. package/dist/core/runner/prepare-gate-stations.d.ts +8 -5
  105. package/dist/core/runner/prepare-gate-stations.js +13 -5
  106. package/dist/core/runner/prepare-inherited-gate.js +2 -0
  107. package/dist/core/runner/prepare-memory-engine-session.js +1 -1
  108. package/dist/core/runner/prepare-memory.js +35 -14
  109. package/dist/core/runner/prepare-policy-chain.js +12 -3
  110. package/dist/core/runner/prepare-project-context.js +2 -2
  111. package/dist/core/runner/prepare-task.d.ts +9 -1
  112. package/dist/core/runner/prepare-task.js +6 -5
  113. package/dist/core/runner/prepare-wiring-manifest.js +5 -4
  114. package/dist/core/runner/prompt-suggestions.js +1 -1
  115. package/dist/core/runner/run-identity-wiring.js +2 -2
  116. package/dist/core/runner/run-leg.js +3 -3
  117. package/dist/core/runner/run-notification-lane.d.ts +3 -0
  118. package/dist/core/runner/run-notification-lane.js +2 -2
  119. package/dist/core/runner/runtask.js +6 -3
  120. package/dist/core/runner/steer-admission.d.ts +11 -2
  121. package/dist/core/runner/stream-steer-verb.d.ts +5 -2
  122. package/dist/core/runner/stream-steer-verb.js +67 -14
  123. package/dist/core/runner/sub-agent-deny-lists.d.ts +8 -8
  124. package/dist/core/runner/sub-agent-deny-lists.js +22 -8
  125. package/dist/core/runner-deps.d.ts +4 -4
  126. package/dist/core/secret-env.d.ts +2 -2
  127. package/dist/core/secret-env.js +6 -20
  128. package/dist/core/session-store.d.ts +6 -6
  129. package/dist/core/session-store.js +3 -3
  130. package/dist/core/shell-run-candidates.js +3 -3
  131. package/dist/core/side-query.js +1 -1
  132. package/dist/core/skill-grant.d.ts +7 -0
  133. package/dist/core/skill-grant.js +14 -5
  134. package/dist/core/store-contracts/background-agent-store-contract.js +13 -0
  135. package/dist/core/task-event.d.ts +14 -0
  136. package/dist/core/task-notification.d.ts +35 -8
  137. package/dist/core/task-notification.js +31 -13
  138. package/dist/core/task-registry-agent.js +1 -0
  139. package/dist/core/task-registry-shared.d.ts +4 -0
  140. package/dist/core/tool-errors.d.ts +3 -3
  141. package/dist/core/tool-policy.js +2 -3
  142. package/dist/core/tool-spec.d.ts +20 -10
  143. package/dist/core/user-attachment.d.ts +5 -1
  144. package/dist/core/user-attachment.js +11 -5
  145. package/dist/core/write-protect.d.ts +16 -0
  146. package/dist/core/write-protect.js +10 -0
  147. package/dist/engine/harness/agent-harness.d.ts +19 -11
  148. package/dist/engine/harness/agent-harness.js +7 -4
  149. package/dist/engine/llm/types.d.ts +22 -10
  150. package/dist/engine/session/repo-utils.d.ts +14 -4
  151. package/dist/engine/session/repo-utils.js +5 -4
  152. package/dist/index.d.ts +10 -8
  153. package/dist/index.js +9 -7
  154. package/dist/prompts/default.d.ts +1 -2
  155. package/dist/scenarios/full-body.d.ts +1 -1
  156. package/dist/shell/lex.d.ts +50 -15
  157. package/dist/shell/lex.js +43 -9
  158. package/dist/stores/file/adoption/adopt.d.ts +1 -1
  159. package/dist/stores/file/index.d.ts +1 -15
  160. package/dist/stores/file/index.js +1 -15
  161. package/dist/stores/file/permission-rule-store.d.ts +12 -1
  162. package/dist/stores/file/permission-rule-store.js +31 -4
  163. package/dist/stores/file/session-store.js +1 -1
  164. package/dist/tools/fs/fs-bash.js +3 -3
  165. package/dist/tools/fs/removal-targets.d.ts +8 -2
  166. package/dist/tools/fs/removal-targets.js +31 -4
  167. package/dist/tools/fs/shell-read-argv.js +7 -1
  168. package/dist/tools/fs/shell-read-bindings.d.ts +21 -5
  169. package/dist/tools/fs/shell-read-bindings.js +130 -44
  170. package/dist/tools/fs/shell-read-plan.js +95 -29
  171. package/dist/tools/fs/shell-read-sourced.d.ts +25 -0
  172. package/dist/tools/fs/shell-read-sourced.js +119 -0
  173. package/dist/tools/fs/shell-read-word.d.ts +2 -2
  174. package/dist/tools/fs/shell-read-word.js +4 -5
  175. package/dist/tools/fs/shell-read-workdir.d.ts +19 -3
  176. package/dist/tools/fs/shell-read-workdir.js +60 -15
  177. package/dist/tools/fs/shell-reentry-text.d.ts +10 -2
  178. package/dist/tools/fs/shell-reentry-text.js +11 -4
  179. package/package.json +2 -2
  180. package/test/export-surface.snapshot.json +21 -79
  181. package/wire-changes/core-stores-sql@7.65.0.json +30 -0
  182. package/wire-changes/core-stores-sql@7.66.0.json +30 -0
  183. package/wire-changes/core@7.65.0.json +1650 -0
  184. package/wire-changes/core@7.66.0.json +1218 -0
  185. package/wire-changes/mods-kernel@7.65.0.json +30 -0
  186. package/wire-changes/mods-kernel@7.66.0.json +65 -0
  187. package/wire-changes/primitives@7.65.0.json +337 -0
  188. package/wire-changes/primitives@7.66.0.json +30 -0
  189. package/dist/core/memory-recall.d.ts +0 -208
  190. package/dist/core/memory-recall.js +0 -136
  191. package/dist/stores/file/memory-store.d.ts +0 -124
  192. package/dist/stores/file/memory-store.js +0 -353
@@ -25,18 +25,26 @@ export type ErasedBinding = {
25
25
  * - `projection` — the entry's files under its scope home (bound path + every census copy);
26
26
  * - `shadow` — the control plane's committed copy;
27
27
  * - `indexLine` — MEMORY.md pointer lines (name + description) naming a deleted projection path;
28
- * - `quarantineCopy` — quarantine files whose frontmatter id is the erased id;
28
+ * - `quarantineCopy` — the governance store's `quarantine` objects whose frontmatter id is the erased id (an object the
29
+ * lane could not read to tell is counted as remaining and named by `unreadable`);
30
+ * - `clearanceCustody` — the governance store's `clearance-custody` objects (and inline texts) of the clearances of an
31
+ * erased entry (#3463): the cleared entry's text a clearance kept, taken with the entry (the clearance's row stays,
32
+ * `custodyErased`);
29
33
  * - `planArchive` / `planWorkbook` — the consolidation plane's mint archive and plan workbook;
30
34
  * - `evidenceBinding` — evidence-chain rows that still spell the entry's slug;
31
35
  * - `backendDerived` — anything a backend derives privately (vectors, summaries).
32
36
  */
33
- export declare const ERASURE_CARRIER_CLASSES: readonly ["projection", "shadow", "indexLine", "quarantineCopy", "planArchive", "planWorkbook", "evidenceBinding", "backendDerived"];
37
+ export declare const ERASURE_CARRIER_CLASSES: readonly ["projection", "shadow", "indexLine", "quarantineCopy", "clearanceCustody", "planArchive", "planWorkbook", "evidenceBinding", "backendDerived"];
34
38
  export type ErasureCarrierClass = (typeof ERASURE_CARRIER_CLASSES)[number];
35
39
  /** One carrier class's answer: what this call removed and what is known to remain, or `unverified`
36
- * when the answering lane cannot read that class (which never reads as clean). */
40
+ * when the answering lane cannot read that class (which never reads as clean). `unreadable`, when a
41
+ * class answers it, is how many of `remaining` are carriers the lane could not read to tell whether
42
+ * they hold an erased entry — counted as remaining, never as clean (the `quarantineCopy` class answers
43
+ * it on both lanes). */
37
44
  export type ErasureCarrierAnswer = {
38
45
  removed: number;
39
46
  remaining: number;
47
+ unreadable?: number;
40
48
  } | {
41
49
  unverified: true;
42
50
  };
@@ -156,8 +164,10 @@ export interface MemoryErasureAttestation {
156
164
  * delete rows, and move / migration-bind rows) — the append-only chain keeps them, so they keep
157
165
  * the request `partial` and a replay cannot clear them. */
158
166
  carriers: Record<ErasureCarrierClass, ErasureCarrierAnswer>;
159
- /** Quarantine files no id could be read from (fragments / non-entry shapes) — the honest bound of
160
- * the quarantine read; a store-level count that does not decide `status`. */
167
+ /** Quarantine objects read whose bytes name no entry id (fragments / non-entry shapes) — the honest
168
+ * bound of the quarantine read; a store-level count that does not decide `status`. An object that
169
+ * could not be read at all is not counted here: it is `carriers.quarantineCopy.remaining`
170
+ * (named by its `unreadable`). */
161
171
  quarantineUnattributed: ErasureCountAnswer;
162
172
  /** Committed entries outside the selection whose consolidation lineage names an erased id (they
163
173
  * may restate it) — counted, not erased; their closure is the caller's to compute. */
@@ -587,7 +597,7 @@ export declare class FileMemoryEngineBackend implements MemoryBackend {
587
597
  * read-back verification). Idempotent on an existing marker. Throws when the marker cannot be
588
598
  * proven on disk — the caller (the heal) must then ABORT with the chain untouched: truncating
589
599
  * first would reopen the exact window this marker closes ("chain reads complete, no marker"
590
- * after an out-of-band tear). */
600
+ * after an out-of-band tear). `fragmentName` is the `quarantine` object the torn fragment was kept as. */
591
601
  private mintChainDegradedMarker;
592
602
  /** backlog #270 — make a just-created control-plane directory ENTRY power-loss durable: open the
593
603
  * control-plane root and fsync it. Fail-closed on failure: the one caller (the marker mint) must
@@ -1097,12 +1107,6 @@ export declare class FileMemoryEngineBackend implements MemoryBackend {
1097
1107
  private journalSweepRow;
1098
1108
  /** Write the journal's sweep-record row ({@link journalSweepRow}; idempotent — a union). */
1099
1109
  private recordJournalSweep;
1100
- /** Delete every quarantine file whose frontmatter id is in `ids` (a quarantined copy is a copy of the
1101
- * entry). Runs under the erasure's lock after its commit; a file that cannot be removed stays
1102
- * counted as `remaining` and a replay retries it. Files no id can be read from are counted, not
1103
- * touched. An unreadable quarantine directory refuses the attestation (the deletions themselves
1104
- * are committed; a replay converges). */
1105
- private eraseQuarantineCopiesLocked;
1106
1110
  /** Does the control-plane directory `name` hold any entry? ENOENT ⇒ no; any other read failure ⇒
1107
1111
  * yes (an unreadable directory may hold anything). */
1108
1112
  private controlDirHoldsAnything;
@@ -1197,6 +1201,11 @@ export declare class FileMemoryEngineBackend implements MemoryBackend {
1197
1201
  * held by every caller, so the exclusive create cannot race in-process; a cross-process EEXIST
1198
1202
  * loser adopts the winner's identity. Corrupt/unreadable identity is fail-closed. */
1199
1203
  private storeIdentityLocked;
1204
+ /** The pollution objects as the export's roster reads them: this store's own (`this.governance` is the File store over
1205
+ * `controlPlaneRoot`), through its damage-visible view ({@link standingControlObjectsOf}, the erasure's count reads the
1206
+ * same view) — a marker slot that stands as no object (a directory, a dangling link) is on the roster as its
1207
+ * fail-closed record, never dropped from a bundle (the reading adoption and the strays reader take). */
1208
+ private pollutionRosterObjects;
1200
1209
  /** One consistency fingerprint over the three ENGINE governance faces (challenge ledger, lineage
1201
1210
  * ledger, pollution markers) — raw bytes, journal included. The two strict sidecars' JOURNAL
1202
1211
  * reads are wrapped FAIL-CLOSED here (§4-6): the shared strict reader folds a journal read
@@ -1,4 +1,4 @@
1
- import { fstatSync, linkSync, lstatSync, mkdirSync, readdirSync, readFileSync, renameSync, rmSync, statSync, openSync, fsyncSync, closeSync } from "node:fs";
1
+ import { fstatSync, lstatSync, mkdirSync, readdirSync, readFileSync, renameSync, rmSync, statSync, openSync, fsyncSync, closeSync } from "node:fs";
2
2
  import { createHash, randomUUID } from "node:crypto";
3
3
  import { dirname, join, relative } from "node:path";
4
4
  import { canonicalJsonStringify } from "../canonical-json.js";
@@ -7,18 +7,20 @@ import { MAX_MEMORY_BYTES } from "../memory.js";
7
7
  import { inlineUntrusted } from "../untrusted-text.js";
8
8
  import { ambiguousOriginRepresentation, committedDistilledOf, committedOriginOf, computeEntryRev, distilledEquals, entryFromFile, isValidEntryId, originEquals, parseEntryFile, serializeEntryFile } from "./frontmatter.js";
9
9
  import { convertV1SidecarKeys } from "./delegation-settlement.js";
10
+ import { eraseOriginClearanceCustody } from "./origin-clearance.js";
10
11
  import { layerObservationLookup, observedDivergenceNotice } from "./layer-observations.js";
11
12
  import { DEFAULT_MAX_ENTRY_DEPTH, MEMORY_INDEX_FILENAME, carriesEntry, scanEntryFiles } from "./entry-scan.js";
12
- import { ControlPlaneCorruptError, CURSORS_FILE, QUARANTINE_DIR, STRICT_CONTROL_PLANE_LEDGERS, fileGovernanceDocOf, IMPORT_RECEIPTS_DIR, SESSION_POLLUTION_DIR, appendChallengeEvents, atomicWriteFileSync, quarantineAndTombstone, captureAndClearLineageForEntries, adoptRootScopeLayout, anchorStoreRoot, effectiveControlRootOf, ensureDirExists, LEDGER_FILE, sayAnnounceFailure, enqueueMemoryAnnouncement, importLatchTxnId, importLineageCommitted, importSessionPollution, isContainedIn, lockedStrictUpdate, readStrictSidecar, permissionRemedyOf, withPermissionRemedy, lineageContributionsOfSession, listSessionPollution, readChallengeEvents, readLineageRecord, registerScope, registeredScopes, releaseImportLatch, layoutNeedsAdoption, scopeDirFor, scopeDirName, scopeRegistryShape, stageImportLatch, landsOutsideStore, storeActRefusal, storeRootMovedRefusal, writeAllSync, STORE_JOURNAL_FILE, ERASURE_SWEEP_RECORD_FILE, ERASURE_SWEEP_RECORD_WHAT, coerceErasureSweepRecord, erasureSweepOwedAt, erasureSweepRecordPathOf, STORE_TXN_LOCK_DIR, TXN_LOCK_STALE_MS, acquireStoreTxnLock, assertStoreTxnLockOwnership, renewStoreTxnLock, tryStoreTxnLock, } from "./layout.js";
13
+ import { ControlPlaneCorruptError, CURSORS_FILE, STRICT_CONTROL_PLANE_LEDGERS, fileGovernanceDocOf, importReceiptName, appendChallengeEvents, atomicWriteFileSync, clearContainedPath, eraseQuarantineCopies, quarantineCaptureName, captureAndClearLineageForEntries, adoptRootScopeLayout, anchorStoreRoot, effectiveControlRootOf, ensureDirExists, LEDGER_FILE, sayAnnounceFailure, enqueueMemoryAnnouncement, importLatchTxnId, importLineageCommitted, importSessionPollution, isContainedIn, lockedStrictUpdate, readStrictSidecar, permissionRemedyOf, withPermissionRemedy, lineageContributionsOfSession, listSessionPollution, readChallengeEvents, readLineageRecord, registerScope, registeredScopes, releaseImportLatch, layoutNeedsAdoption, scopeDirFor, scopeDirName, scopeRegistryShape, stageImportLatch, landsOutsideStore, storeActRefusal, storeRootMovedRefusal, writeAllSync, STORE_JOURNAL_FILE, ERASURE_SWEEP_RECORD_FILE, ERASURE_SWEEP_RECORD_WHAT, coerceErasureSweepRecord, erasureSweepOwedAt, erasureSweepRecordPathOf, STORE_TXN_LOCK_DIR, TXN_LOCK_STALE_MS, acquireStoreTxnLock, assertStoreTxnLockOwnership, renewStoreTxnLock, tryStoreTxnLock, } from "./layout.js";
13
14
  import { screenInboundEntries } from "./data-plane.js";
14
- import { CONSOLIDATION_DRIVER_PLANS_DIR, CONSOLIDATION_PLANS_DIR, fileGovernanceStore } from "./consolidation.js";
15
+ import { CONSOLIDATION_DRIVER_PLANS_DIR, CONSOLIDATION_PLANS_DIR, fileGovernanceStore, standingControlObjectsOf } from "./consolidation.js";
16
+ import { captureIntoFileQuarantine, fileControlObjectFaultCode, getFileControlObject, probeControlPlaneLinks, putFileControlObjectOnce, standingFileControlObjectNames } from "./control-objects.js";
15
17
  import { canonicalExpectedScopes, expectedScopesInvalid, firstOutsideExpectedScopes } from "./export-bundle.js";
16
18
  import { scanMemoryFileName, scanMemoryWrite } from "./scan.js";
17
19
  import { admittingLandings, cutPerLanding, LandingsNeedAdmission, requireLandingsAdmitted } from "./landing-admission.js";
18
20
  import { thrownText } from "../thrown-value.js";
19
21
  import { optionKeys, receiveOptions } from "../own-property-receipt.js";
20
22
  export { DEFAULT_MAX_ENTRY_DEPTH, MEMORY_INDEX_FILENAME, scanEntryFiles } from "./entry-scan.js";
21
- export const ERASURE_CARRIER_CLASSES = Object.freeze(["projection", "shadow", "indexLine", "quarantineCopy", "planArchive", "planWorkbook", "evidenceBinding", "backendDerived"]);
23
+ export const ERASURE_CARRIER_CLASSES = Object.freeze(["projection", "shadow", "indexLine", "quarantineCopy", "clearanceCustody", "planArchive", "planWorkbook", "evidenceBinding", "backendDerived"]);
22
24
  export function erasureStatusOf(att) {
23
25
  if (att.conflicts.length > 0)
24
26
  return "partial";
@@ -624,6 +626,7 @@ export class FileMemoryEngineBackend {
624
626
  this.assertRootAnchored();
625
627
  ensureDirExists(dir);
626
628
  ensureDirExists(this.controlPlaneRoot);
629
+ probeControlPlaneLinks(this.controlPlaneRoot);
627
630
  this.recoverJournal({ unlocked: true });
628
631
  try {
629
632
  this.loadLedger();
@@ -913,7 +916,7 @@ export class FileMemoryEngineBackend {
913
916
  chainDegradedMarkerPresent() {
914
917
  return readControlFileOrAbsent(join(this.controlPlaneRoot, CHAIN_DEGRADED_FILE), "evidence-chain degradation marker") !== undefined;
915
918
  }
916
- mintChainDegradedMarker(fragmentPath) {
919
+ mintChainDegradedMarker(fragmentName) {
917
920
  const path = join(this.controlPlaneRoot, CHAIN_DEGRADED_FILE);
918
921
  let fd;
919
922
  try {
@@ -927,7 +930,7 @@ export class FileMemoryEngineBackend {
927
930
  throw new ControlPlaneCorruptError(`evidence-chain degradation marker could not be created at ${path} (${err.code ?? "io error"}) — heal aborted, the chain is unchanged (fail-closed)`);
928
931
  }
929
932
  try {
930
- writeAllSync(fd, `${JSON.stringify({ at: this.now(), ...(fragmentPath !== undefined ? { fragment: fragmentPath } : {}) }, null, 2)}\n`);
933
+ writeAllSync(fd, `${JSON.stringify({ at: this.now(), ...(fragmentName !== undefined ? { fragment: fragmentName } : {}) }, null, 2)}\n`);
931
934
  fsyncSync(fd);
932
935
  }
933
936
  finally {
@@ -993,17 +996,23 @@ export class FileMemoryEngineBackend {
993
996
  const outOfBand = !journalHasPendingEvidence;
994
997
  if (fenceToken !== undefined)
995
998
  this.assertTxnLockOwnership(fenceToken);
996
- let fragmentPath;
999
+ let fragmentName;
997
1000
  try {
998
- ensureDirExists(join(this.controlPlaneRoot, QUARANTINE_DIR));
999
- fragmentPath = join(this.controlPlaneRoot, QUARANTINE_DIR, `transfers-torn-tail-${this.now()}.fragment`);
1000
- atomicWriteFileSync(fragmentPath, line);
1001
+ const base = `transfers-torn-tail-${this.now()}.fragment`;
1002
+ const bytes = new TextEncoder().encode(line);
1003
+ for (let attempt = 0; fragmentName === undefined && attempt <= 10; attempt++) {
1004
+ const name = quarantineCaptureName(base, attempt);
1005
+ if (putFileControlObjectOnce(this.controlPlaneRoot, "quarantine", name, bytes) === "created")
1006
+ fragmentName = name;
1007
+ }
1001
1008
  }
1002
1009
  catch {
1003
- throw new ControlPlaneCorruptError(`transfer evidence log has a torn tail that could not be quarantined: ${path}`);
1010
+ fragmentName = undefined;
1004
1011
  }
1012
+ if (fragmentName === undefined)
1013
+ throw new ControlPlaneCorruptError(`transfer evidence log has a torn tail that could not be quarantined: ${path}`);
1005
1014
  if (outOfBand)
1006
- this.mintChainDegradedMarker(fragmentPath);
1015
+ this.mintChainDegradedMarker(fragmentName);
1007
1016
  this.chainHealProbe?.();
1008
1017
  if (fenceToken !== undefined)
1009
1018
  this.assertTxnLockOwnership(fenceToken);
@@ -1449,7 +1458,7 @@ export class FileMemoryEngineBackend {
1449
1458
  }
1450
1459
  containInboundReject(finding, absPath, text, entryId, committed) {
1451
1460
  this.inboundFindings.push(finding);
1452
- const q = quarantineAndTombstone(absPath, text, join(this.controlPlaneRoot, QUARANTINE_DIR), this.now);
1461
+ const q = clearContainedPath(absPath, text, captureIntoFileQuarantine(this.controlPlaneRoot, absPath, text, this.now));
1453
1462
  const shadowText = committed !== undefined ? this.readCommittedShadow(entryId) : undefined;
1454
1463
  let restoredShadow = false;
1455
1464
  if (shadowText !== undefined) {
@@ -2550,38 +2559,6 @@ export class FileMemoryEngineBackend {
2550
2559
  if (row !== undefined)
2551
2560
  recordErasureSweep(this.controlPlaneRoot, row.req, row.paths);
2552
2561
  }
2553
- eraseQuarantineCopiesLocked(ids) {
2554
- const qDir = join(this.controlPlaneRoot, QUARANTINE_DIR);
2555
- let names = [];
2556
- try {
2557
- names = readdirSync(qDir);
2558
- }
2559
- catch (err) {
2560
- if (err.code !== "ENOENT") {
2561
- throw new ControlPlaneCorruptError(`erasure residual enumeration failed: the quarantine dir could not be read (${err.code ?? "io error"}) at ${qDir} — the attestation must not silently claim an empty residual set; retry after the filesystem fault clears (the deletions themselves are committed and a replay converges)`);
2562
- }
2563
- }
2564
- const out = { removed: 0, remaining: 0, unattributed: 0 };
2565
- for (const name of names.sort()) {
2566
- const path = join(qDir, name);
2567
- const text = readSafe(path);
2568
- const qid = text === undefined ? undefined : parseEntryFile(text).id;
2569
- if (qid === undefined) {
2570
- out.unattributed++;
2571
- continue;
2572
- }
2573
- if (!ids.has(qid))
2574
- continue;
2575
- try {
2576
- rmSync(path, { force: true });
2577
- out.removed++;
2578
- }
2579
- catch {
2580
- out.remaining++;
2581
- }
2582
- }
2583
- return out;
2584
- }
2585
2562
  controlDirHoldsAnything(name) {
2586
2563
  try {
2587
2564
  return readdirSync(join(this.controlPlaneRoot, name)).length > 0;
@@ -2830,7 +2807,9 @@ export class FileMemoryEngineBackend {
2830
2807
  e.sessions = [...new Set([...e.sessions, ...lateSessions])].sort();
2831
2808
  }
2832
2809
  const resolvedSet = new Set(resolvedIds);
2833
- const quarantine = this.eraseQuarantineCopiesLocked(resolvedSet);
2810
+ const quarantine = await eraseQuarantineCopies(standingControlObjectsOf(this.governance), resolvedSet);
2811
+ const conflicted = new Set(conflicts.map((c) => c.id));
2812
+ const clearanceCustody = await eraseOriginClearanceCustody(this.governance, new Set(resolvedIds.filter((id) => !conflicted.has(id))), this.now());
2834
2813
  const att = {
2835
2814
  v: 2,
2836
2815
  requestId,
@@ -2850,7 +2829,8 @@ export class FileMemoryEngineBackend {
2850
2829
  projection: { removed: erased.reduce((n, e) => n + e.projectionsRemoved, 0), remaining: 0 },
2851
2830
  shadow: { removed: ops.filter((op) => op.kind === "shadow-delete").length, remaining: 0 },
2852
2831
  indexLine: readErasureSweep(this.controlPlaneRoot, this.directoryRoot, requestId).length > 0 ? { unverified: true } : { removed: 0, remaining: 0 },
2853
- quarantineCopy: { removed: quarantine.removed, remaining: quarantine.remaining },
2832
+ quarantineCopy: { removed: quarantine.removed, remaining: quarantine.remaining, unreadable: quarantine.unreadable },
2833
+ clearanceCustody: { removed: clearanceCustody.removed, remaining: clearanceCustody.remaining },
2854
2834
  planArchive: this.controlDirHoldsAnything(CONSOLIDATION_DRIVER_PLANS_DIR) ? { unverified: true } : { removed: 0, remaining: 0 },
2855
2835
  planWorkbook: this.controlDirHoldsAnything(CONSOLIDATION_PLANS_DIR) ? { unverified: true } : { removed: 0, remaining: 0 },
2856
2836
  evidenceBinding: { removed: 0, remaining: chain.filter((r) => typeof r.parsed.id === "string" && resolvedSet.has(r.parsed.id) && (spellsSlug(r.parsed.from) || spellsSlug(r.parsed.to))).length },
@@ -3139,6 +3119,9 @@ export class FileMemoryEngineBackend {
3139
3119
  }
3140
3120
  return storeId;
3141
3121
  }
3122
+ pollutionRosterObjects() {
3123
+ return standingControlObjectsOf(this.governance);
3124
+ }
3142
3125
  exportGovernanceFingerprint() {
3143
3126
  const h = createHash("sha256");
3144
3127
  const feed = (label, text) => {
@@ -3155,23 +3138,14 @@ export class FileMemoryEngineBackend {
3155
3138
  }
3156
3139
  feed(`${file}.journal`, journalRaw ?? "<absent>");
3157
3140
  }
3158
- const dir = join(this.controlPlaneRoot, SESSION_POLLUTION_DIR);
3159
- let names = [];
3160
- try {
3161
- names = readdirSync(dir).sort();
3162
- }
3163
- catch (err) {
3164
- if (err.code !== "ENOENT") {
3165
- throw new ControlPlaneCorruptError(`session pollution markers could not be enumerated for export (${err.code ?? "io error"}) at ${dir} — fail-closed`, { cause: err });
3166
- }
3167
- }
3168
- for (const name of names) {
3141
+ for (const name of standingFileControlObjectNames(this.controlPlaneRoot, "pollution")) {
3169
3142
  let text;
3170
3143
  try {
3171
- text = readFileSync(join(dir, name), "utf8");
3144
+ const bytes = getFileControlObject(this.controlPlaneRoot, "pollution", name);
3145
+ text = bytes === undefined ? "<absent>" : new TextDecoder().decode(bytes);
3172
3146
  }
3173
3147
  catch (err) {
3174
- text = `<unreadable:${err.code ?? "io error"}>`;
3148
+ text = `<unreadable:${fileControlObjectFaultCode(err) ?? "io error"}>`;
3175
3149
  }
3176
3150
  feed(`pollution/${name}`, text);
3177
3151
  }
@@ -3281,20 +3255,24 @@ export class FileMemoryEngineBackend {
3281
3255
  return { custody, unsliceable };
3282
3256
  }
3283
3257
  enumerateQuarantineFor(ids) {
3284
- const qDir = join(this.controlPlaneRoot, QUARANTINE_DIR);
3285
- let names = [];
3258
+ let names;
3286
3259
  try {
3287
- names = readdirSync(qDir);
3260
+ names = standingFileControlObjectNames(this.controlPlaneRoot, "quarantine");
3288
3261
  }
3289
3262
  catch (err) {
3290
- if (err.code !== "ENOENT") {
3291
- throw new ControlPlaneCorruptError(`export residual enumeration failed: the quarantine dir could not be read (${err.code ?? "io error"}) at ${qDir} — a bundle must not silently claim an empty residual set`);
3292
- }
3263
+ throw new ControlPlaneCorruptError(`export residual enumeration failed: the quarantine objects could not be listed (${fileControlObjectFaultCode(err) ?? "io error"}) — a bundle must not silently claim an empty residual set`, { cause: err });
3293
3264
  }
3294
3265
  const quarantined = [];
3295
3266
  let quarantineOpaque = 0;
3296
- for (const name of names.sort()) {
3297
- const text = readSafe(join(qDir, name));
3267
+ for (const name of names) {
3268
+ let text;
3269
+ try {
3270
+ const bytes = getFileControlObject(this.controlPlaneRoot, "quarantine", name);
3271
+ text = bytes === undefined ? undefined : new TextDecoder().decode(bytes);
3272
+ }
3273
+ catch {
3274
+ text = undefined;
3275
+ }
3298
3276
  if (text === undefined) {
3299
3277
  quarantineOpaque++;
3300
3278
  continue;
@@ -3328,7 +3306,7 @@ export class FileMemoryEngineBackend {
3328
3306
  const before = this.exportGovernanceFingerprint();
3329
3307
  const lineageRec = await readLineageRecord(this.governance);
3330
3308
  const challenges = await readChallengeEvents(this.governance);
3331
- const polluted = listSessionPollution(this.controlPlaneRoot);
3309
+ const polluted = await listSessionPollution(this.pollutionRosterObjects());
3332
3310
  const chainRows = this.readExportChainRowsPure();
3333
3311
  await this.exportFaceProbe?.(round);
3334
3312
  const after = this.exportGovernanceFingerprint();
@@ -3502,11 +3480,11 @@ export class FileMemoryEngineBackend {
3502
3480
  this.recoverJournal({ token: lock.token });
3503
3481
  this.adoptLayoutLocked(lock.token);
3504
3482
  this.migrateLockedIfNeeded(lock.token);
3505
- const ctl = this.controlPlaneRoot;
3506
3483
  const txnId = importLatchTxnId(bundleHash);
3507
- const receiptPath = join(ctl, IMPORT_RECEIPTS_DIR, `${bundleHash}.json`);
3508
- const receiptRaw = readControlFileOrAbsent(receiptPath, "bundle import completion receipt");
3509
- if (receiptRaw !== undefined) {
3484
+ const receiptName = importReceiptName(bundleHash);
3485
+ const receiptBytes = await this.governance.getObject("import-receipt", receiptName);
3486
+ if (receiptBytes !== undefined) {
3487
+ const receiptRaw = new TextDecoder().decode(receiptBytes);
3510
3488
  let report;
3511
3489
  try {
3512
3490
  const parsed = JSON.parse(receiptRaw);
@@ -3542,9 +3520,9 @@ export class FileMemoryEngineBackend {
3542
3520
  report = rep;
3543
3521
  }
3544
3522
  catch {
3545
- throw new ControlPlaneCorruptError(`bundle import completion receipt is unreadable/malformed at ${receiptPath} — it cannot prove completion and cannot be re-minted; repair or remove it deliberately (fail-closed)`);
3523
+ throw new ControlPlaneCorruptError(`bundle import completion receipt ${receiptName} is unreadable/malformed — it cannot prove completion and cannot be re-minted; repair or remove it deliberately (fail-closed)`);
3546
3524
  }
3547
- await releaseImportLatch(this.governance, ctl, txnId);
3525
+ await releaseImportLatch(this.governance, txnId);
3548
3526
  return report;
3549
3527
  }
3550
3528
  const digest = this.deletedIdsDigestLocked();
@@ -3668,39 +3646,15 @@ export class FileMemoryEngineBackend {
3668
3646
  reason: `challenged: the contributing session was marked polluted`,
3669
3647
  challengedRev: c.lastRev,
3670
3648
  })));
3671
- const outcome = importSessionPollution(ctl, p.sessionId, { at: p.at, reason: p.reason, ...(p.cause !== undefined ? { cause: p.cause } : {}) });
3649
+ const outcome = await importSessionPollution(this.governance, p.sessionId, { at: p.at, reason: p.reason, ...(p.cause !== undefined ? { cause: p.cause } : {}) });
3672
3650
  if (outcome === "divergent")
3673
3651
  report.pollutionDivergence.push({ sessionId: p.sessionId, kept: "destination" });
3674
3652
  }
3675
- ensureDirExists(join(ctl, IMPORT_RECEIPTS_DIR));
3676
- if (readControlFileOrAbsent(receiptPath, "bundle import completion receipt") !== undefined) {
3677
- throw new ControlPlaneCorruptError(`bundle import completion receipt appeared mid-import at ${receiptPath} — refusing to overwrite it (fail-closed)`);
3678
- }
3679
- const staged = join(ctl, IMPORT_RECEIPTS_DIR, `.stage-${bundleHash}-${randomUUID().slice(0, 8)}`);
3680
- const fd = openSync(staged, "wx", 0o600);
3681
- try {
3682
- writeAllSync(fd, `${JSON.stringify({ v: 1, bundleHash, at: this.now(), report }, null, 2)}\n`);
3683
- fsyncSync(fd);
3684
- }
3685
- finally {
3686
- closeSync(fd);
3687
- }
3688
- try {
3689
- linkSync(staged, receiptPath);
3690
- rmSync(staged, { force: true });
3691
- }
3692
- catch (err) {
3693
- try {
3694
- rmSync(staged, { force: true });
3695
- }
3696
- catch {
3697
- }
3698
- if (err.code === "EEXIST") {
3699
- throw new ControlPlaneCorruptError(`bundle import completion receipt appeared mid-import at ${receiptPath} — refusing to overwrite it (fail-closed)`);
3700
- }
3701
- throw err;
3653
+ const published = await this.governance.putObject("import-receipt", receiptName, new TextEncoder().encode(`${JSON.stringify({ v: 1, bundleHash, at: this.now(), report }, null, 2)}\n`));
3654
+ if (published === "existed") {
3655
+ throw new ControlPlaneCorruptError(`bundle import completion receipt ${receiptName} appeared mid-import — refusing to overwrite it (fail-closed)`);
3702
3656
  }
3703
- await releaseImportLatch(this.governance, ctl, txnId);
3657
+ await releaseImportLatch(this.governance, txnId);
3704
3658
  return report;
3705
3659
  }
3706
3660
  catch (err) {
@@ -4,13 +4,13 @@ export { MEMORY_EXPOSURE_BANNER, MEMORY_EXPOSURE_HANDLE_TAG, MEMORY_PROVENANCE_R
4
4
  export { scanMemoryWrite, scanMemoryFileName, scanRemediation, MEMORY_FILENAME_SEGMENT_RE } from "./scan.js";
5
5
  export { FileMemoryEngineBackend, readMemoryLedgerForm, scanEntryFiles, MEMORY_INDEX_FILENAME, DEFAULT_MAX_ENTRY_DEPTH, type ScannedEntryFile, type TransferEvidence, type CommittedBinding, type CommittedEntrySnapshot, type CommittedScopeSnapshots, type EntryCustodyReport, erasureSelectHash, type EraseMemoryEntriesInput, type ErasureCarrierAnswer, type ErasureCarrierClass, type ErasureCountAnswer, type ErasureSelect, type ErasedBinding, type MemoryErasureAttestation, type MemoryExportSnapshot, } from "./file-backend.js";
6
6
  export { computeBundleSectionHashes, computeMemoryBundleHash, memoryBundleInvalid, type MemoryExportBundle, type MemoryImportReport, type MemoryBundleImportPlan, type BundleChallengeRow, type BundleLineageRow, type BundlePollutedSession, } from "./export-bundle.js";
7
- export { ControlPlaneCorruptError, deriveControlPlaneDir, deriveRepoControlPlaneDir, deriveRepoKey, deriveRepoMemoryDir, deriveProjectMemoryDir, deriveProjectControlDir, recordProjectIdHint, lookupProjectIdHint, PROJECT_ID_HINTS_FILE, resolveMemoryEngineRoot, scopeDirFor, scopeDirName, scopeRegistryShape, layoutNeedsAdoption, adoptRootScopeLayout, v1MemoryPathKeyResolver, unresolvedProjectionDebts, scanFuseKey, type AdoptRootScopeLayoutOptions, type ScopeRegistryShape, enqueueMemoryAnnouncement, drainMemoryAnnouncements, peekMemoryAnnouncements, bumpScanFuse, scanFuseCount, clearScanFuse, ANNOUNCEMENTS_FILE, MEMORY_ANNOUNCEMENTS_MAX, SCAN_FUSE_FILE, SCAN_FUSE_THRESHOLD, LINEAGE_FILE, CHALLENGES_FILE, CHALLENGED_HISTORY_FILE, CHALLENGE_LEDGER_MAX_EVENTS, rebuildStrictControlPlaneLedger, type ControlPlaneRebuildReceipt, type StrictControlPlaneLedger, type ChallengeAppendResult, type ChallengeAssignment, type ChallengeEvent, type ChallengedHistoryRow, type LineagePendingTxn, type LineagePromotion, SESSION_CAPTURE_OPTOUT_DIR, markSessionCaptureOptOut, readSessionCaptureOptOut, listSessionCaptureOptOut, fileSessionCaptureRecordStore, type SessionCaptureOptOutRecord, type SessionCaptureOptOutMarkOutcome, type SessionCaptureRecordStore, } from "./layout.js";
7
+ export { ControlPlaneCorruptError, deriveControlPlaneDir, deriveRepoControlPlaneDir, deriveRepoKey, deriveRepoMemoryDir, deriveProjectMemoryDir, deriveProjectControlDir, recordProjectIdHint, lookupProjectIdHint, PROJECT_ID_HINTS_FILE, resolveMemoryEngineRoot, scopeDirFor, scopeDirName, scopeRegistryShape, layoutNeedsAdoption, adoptRootScopeLayout, v1MemoryPathKeyResolver, unresolvedProjectionDebts, scanFuseKey, type AdoptRootScopeLayoutOptions, type ScopeRegistryShape, enqueueMemoryAnnouncement, drainMemoryAnnouncements, peekMemoryAnnouncements, bumpScanFuse, scanFuseCount, clearScanFuse, ANNOUNCEMENTS_FILE, MEMORY_ANNOUNCEMENTS_MAX, SCAN_FUSE_FILE, SCAN_FUSE_THRESHOLD, LINEAGE_FILE, CHALLENGES_FILE, CHALLENGED_HISTORY_FILE, CHALLENGE_LEDGER_MAX_EVENTS, rebuildStrictControlPlaneLedger, type ControlPlaneRebuildReceipt, type StrictControlPlaneLedger, type ChallengeAppendResult, type ChallengeAssignment, type ChallengeEvent, type ChallengedHistoryRow, type LineagePendingTxn, type LineagePromotion, SESSION_CAPTURE_OPTOUT_DIR, type SessionCaptureOptOutRecord, type SessionCaptureOptOutMarkOutcome, type SessionCaptureRecordStore, } from "./layout.js";
8
8
  export { readV2HeaderHints, isInstructionEntry, type V2HeaderHints } from "./header-hints.js";
9
9
  export { parseEntryFile, serializeEntryFile, computeEntryRev, entryFromFile, committedOriginOf, originEquals, ambiguousOriginRepresentation, type ParsedEntryFile } from "./frontmatter.js";
10
10
  export { consolidationExposedFrontmatter } from "./frontmatter.js";
11
11
  export { committedDistilledOf, distilledEquals } from "./frontmatter.js";
12
12
  export { deriveShadowedSet } from "./shadowing.js";
13
- export { CONSOLIDATION_DEFAULTS, ConsolidationRefusedError, MEMORY_SEARCH_SUPERSEDED_TAG, consolidationTypeEligible, deriveSupersededSet, memorySupersededNote, supersessionFuseCeiling, DELETION_FUSE_FLOOR, fileGovernanceStore, memoryGovernanceDurability, type MemoryGovernanceDurability, type ConsolidationGateRead, type ConsolidationGateRow, type ConsolidationIntent, type ConsolidationIntentCredentialRow, type ConsolidationLeaseSeat, type ConsolidationProductProposal, type ConsolidationProposal, type ConsolidationWriteGate, type MemoryConsolidationOptions, CONSOLIDATION_RUN_STOP_REASONS, type ConsolidationRunStopReason, } from "./consolidation.js";
13
+ export { CONSOLIDATION_DEFAULTS, ConsolidationRefusedError, MEMORY_SEARCH_SUPERSEDED_TAG, consolidationTypeEligible, deriveSupersededSet, memorySupersededNote, supersessionFuseCeiling, DELETION_FUSE_FLOOR, fileGovernanceStore, fileSessionCaptureRecordStore, memoryGovernanceDurability, type MemoryGovernanceDurability, type ConsolidationGateRead, type ConsolidationGateRow, type ConsolidationIntent, type ConsolidationIntentCredentialRow, type ConsolidationLeaseSeat, type ConsolidationProductProposal, type ConsolidationProposal, type ConsolidationWriteGate, type MemoryConsolidationOptions, CONSOLIDATION_RUN_STOP_REASONS, type ConsolidationRunStopReason, } from "./consolidation.js";
14
14
  export { DISTILLER_DEFAULT_MAX_INPUTS_PER_PRODUCT, LLM_DISTILLER_CONTRACT, LLM_DISTILLER_CONTRACT_DL2, LLM_DISTILLER_CONTRACT_DL3, LLM_DISTILLER_CONTRACTS, MEMORY_DISTILLER_CONTRACT_V1, contractGroupingDiff, driveConsolidationToFixpoint, isAliasModelId, llmPlanDistiller, mintExposurePartitionedPlan, mintLlmConsolidationPlan, MEMORY_DISTILLER_PURITY_CONTRACT_V1, detectCleanArmVerbatimLeak, type CleanArmLeakFinding, type CleanArmLeakVerdict, type MemoryDistillerPurityContract, openAiCompatChatSeat, parseJsonAnswer, planParseRepairs, sanitizeLlmGroups, scheduleUnderFuse, type ConsolidationDistillFn, type ConsolidationDriveCycleRow, type ConsolidationDriveEngine, type ConsolidationDriveResult, type ConsolidationFoldState, type DistillerCandidate, type DistillerChatAnswer, type DistillerChatFn, type DistillerChatRequest, type FuseSchedule, type LlmConsolidationPlan, type LlmConsolidationPlanArm, type LlmConsolidationPlanProduct, type LlmDistillerContract, type MintLlmConsolidationPlanResult, type PlanParseRepairs, type SanitizedLlmGroups, } from "./distiller.js";
15
15
  export { CONSOLIDATION_WRITE_REFUSED_CODE, runMemoryConsolidationDriver, type ConsolidationDriverEngine, type ConsolidationDriverRunRow, type ConsolidationRunReceipt, type ConsolidationWriteJudge, type ConsolidationWriteTarget, type RunMemoryConsolidationOptions, } from "./consolidation-driver.js";
16
16
  export type { OriginClearanceRow, OriginClearanceEvent, OriginClearanceShadow } from "./origin-clearance.js";
@@ -4,13 +4,13 @@ export { MEMORY_EXPOSURE_BANNER, MEMORY_EXPOSURE_HANDLE_TAG, MEMORY_PROVENANCE_R
4
4
  export { scanMemoryWrite, scanMemoryFileName, scanRemediation, MEMORY_FILENAME_SEGMENT_RE } from "./scan.js";
5
5
  export { FileMemoryEngineBackend, readMemoryLedgerForm, scanEntryFiles, MEMORY_INDEX_FILENAME, DEFAULT_MAX_ENTRY_DEPTH, erasureSelectHash, } from "./file-backend.js";
6
6
  export { computeBundleSectionHashes, computeMemoryBundleHash, memoryBundleInvalid, } from "./export-bundle.js";
7
- export { ControlPlaneCorruptError, deriveControlPlaneDir, deriveRepoControlPlaneDir, deriveRepoKey, deriveRepoMemoryDir, deriveProjectMemoryDir, deriveProjectControlDir, recordProjectIdHint, lookupProjectIdHint, PROJECT_ID_HINTS_FILE, resolveMemoryEngineRoot, scopeDirFor, scopeDirName, scopeRegistryShape, layoutNeedsAdoption, adoptRootScopeLayout, v1MemoryPathKeyResolver, unresolvedProjectionDebts, scanFuseKey, enqueueMemoryAnnouncement, drainMemoryAnnouncements, peekMemoryAnnouncements, bumpScanFuse, scanFuseCount, clearScanFuse, ANNOUNCEMENTS_FILE, MEMORY_ANNOUNCEMENTS_MAX, SCAN_FUSE_FILE, SCAN_FUSE_THRESHOLD, LINEAGE_FILE, CHALLENGES_FILE, CHALLENGED_HISTORY_FILE, CHALLENGE_LEDGER_MAX_EVENTS, rebuildStrictControlPlaneLedger, SESSION_CAPTURE_OPTOUT_DIR, markSessionCaptureOptOut, readSessionCaptureOptOut, listSessionCaptureOptOut, fileSessionCaptureRecordStore, } from "./layout.js";
7
+ export { ControlPlaneCorruptError, deriveControlPlaneDir, deriveRepoControlPlaneDir, deriveRepoKey, deriveRepoMemoryDir, deriveProjectMemoryDir, deriveProjectControlDir, recordProjectIdHint, lookupProjectIdHint, PROJECT_ID_HINTS_FILE, resolveMemoryEngineRoot, scopeDirFor, scopeDirName, scopeRegistryShape, layoutNeedsAdoption, adoptRootScopeLayout, v1MemoryPathKeyResolver, unresolvedProjectionDebts, scanFuseKey, enqueueMemoryAnnouncement, drainMemoryAnnouncements, peekMemoryAnnouncements, bumpScanFuse, scanFuseCount, clearScanFuse, ANNOUNCEMENTS_FILE, MEMORY_ANNOUNCEMENTS_MAX, SCAN_FUSE_FILE, SCAN_FUSE_THRESHOLD, LINEAGE_FILE, CHALLENGES_FILE, CHALLENGED_HISTORY_FILE, CHALLENGE_LEDGER_MAX_EVENTS, rebuildStrictControlPlaneLedger, SESSION_CAPTURE_OPTOUT_DIR, } from "./layout.js";
8
8
  export { readV2HeaderHints, isInstructionEntry } from "./header-hints.js";
9
9
  export { parseEntryFile, serializeEntryFile, computeEntryRev, entryFromFile, committedOriginOf, originEquals, ambiguousOriginRepresentation } from "./frontmatter.js";
10
10
  export { consolidationExposedFrontmatter } from "./frontmatter.js";
11
11
  export { committedDistilledOf, distilledEquals } from "./frontmatter.js";
12
12
  export { deriveShadowedSet } from "./shadowing.js";
13
- export { CONSOLIDATION_DEFAULTS, ConsolidationRefusedError, MEMORY_SEARCH_SUPERSEDED_TAG, consolidationTypeEligible, deriveSupersededSet, memorySupersededNote, supersessionFuseCeiling, DELETION_FUSE_FLOOR, fileGovernanceStore, memoryGovernanceDurability, CONSOLIDATION_RUN_STOP_REASONS, } from "./consolidation.js";
13
+ export { CONSOLIDATION_DEFAULTS, ConsolidationRefusedError, MEMORY_SEARCH_SUPERSEDED_TAG, consolidationTypeEligible, deriveSupersededSet, memorySupersededNote, supersessionFuseCeiling, DELETION_FUSE_FLOOR, fileGovernanceStore, fileSessionCaptureRecordStore, memoryGovernanceDurability, CONSOLIDATION_RUN_STOP_REASONS, } from "./consolidation.js";
14
14
  export { DISTILLER_DEFAULT_MAX_INPUTS_PER_PRODUCT, LLM_DISTILLER_CONTRACT, LLM_DISTILLER_CONTRACT_DL2, LLM_DISTILLER_CONTRACT_DL3, LLM_DISTILLER_CONTRACTS, MEMORY_DISTILLER_CONTRACT_V1, contractGroupingDiff, driveConsolidationToFixpoint, isAliasModelId, llmPlanDistiller, mintExposurePartitionedPlan, mintLlmConsolidationPlan, MEMORY_DISTILLER_PURITY_CONTRACT_V1, detectCleanArmVerbatimLeak, openAiCompatChatSeat, parseJsonAnswer, planParseRepairs, sanitizeLlmGroups, scheduleUnderFuse, } from "./distiller.js";
15
15
  export { CONSOLIDATION_WRITE_REFUSED_CODE, runMemoryConsolidationDriver, } from "./consolidation-driver.js";
16
16
  export { MEMORY_CONTROL_OBJECT_KINDS, MEMORY_GOVERNANCE_DOC_NAMES, MEMORY_ORIGIN_CAUSES, writableRootOf } from "./types.js";