@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.
- package/CHANGELOG.md +571 -0
- package/dist/agents/delegation-registry-seat.d.ts +15 -0
- package/dist/agents/delegation-registry-seat.js +13 -0
- package/dist/agents/org-delivery-gate.d.ts +8 -1
- package/dist/agents/org-delivery-gate.js +9 -3
- package/dist/agents/peer-held-queue.js +1 -1
- package/dist/agents/peer-idle.js +1 -1
- package/dist/agents/peer-session-drain.d.ts +51 -12
- package/dist/agents/peer-session-drain.js +47 -34
- package/dist/agents/read-inbox-tool.d.ts +6 -2
- package/dist/agents/read-inbox-tool.js +18 -5
- package/dist/agents/subagent.d.ts +3 -1
- package/dist/agents/subagent.js +84 -77
- package/dist/brain/reasoning.d.ts +2 -0
- package/dist/brain/reasoning.js +1 -0
- package/dist/core/allow-entry.d.ts +9 -0
- package/dist/core/allow-entry.js +7 -1
- package/dist/core/ask-origin.d.ts +23 -3
- package/dist/core/ask-origin.js +11 -1
- package/dist/core/auto-promote.d.ts +3 -2
- package/dist/core/background-agent-store.d.ts +7 -0
- package/dist/core/checkpoint-store.d.ts +2 -3
- package/dist/core/context-settings.d.ts +1 -2
- package/dist/core/context-settings.js +1 -1
- package/dist/core/engine-attestation.d.ts +2 -2
- package/dist/core/engine-notice.d.ts +13 -1
- package/dist/core/engine-notice.js +3 -1
- package/dist/core/file-history-store.d.ts +2 -2
- package/dist/core/file-history-store.js +0 -4
- package/dist/core/gate-fold.js +3 -1
- package/dist/core/governance-codes.d.ts +6 -4
- package/dist/core/governance-codes.js +5 -3
- package/dist/core/human-input-projection.d.ts +9 -0
- package/dist/core/human-input-projection.js +13 -0
- package/dist/core/input-author.d.ts +66 -6
- package/dist/core/input-author.js +21 -3
- package/dist/core/leg-identity.d.ts +18 -2
- package/dist/core/leg-identity.js +5 -7
- package/dist/core/mailbox-store.d.ts +1 -1
- package/dist/core/memory-engine/consolidation.d.ts +30 -10
- package/dist/core/memory-engine/consolidation.js +41 -6
- package/dist/core/memory-engine/control-objects.d.ts +36 -3
- package/dist/core/memory-engine/control-objects.js +134 -12
- package/dist/core/memory-engine/control-plane-adoption.d.ts +13 -9
- package/dist/core/memory-engine/control-plane-adoption.js +58 -31
- package/dist/core/memory-engine/delegation-settlement.d.ts +75 -52
- package/dist/core/memory-engine/delegation-settlement.js +211 -228
- package/dist/core/memory-engine/dual-root.d.ts +3 -2
- package/dist/core/memory-engine/dual-root.js +5 -1
- package/dist/core/memory-engine/engine.d.ts +33 -16
- package/dist/core/memory-engine/engine.js +213 -177
- package/dist/core/memory-engine/file-backend.d.ts +21 -12
- package/dist/core/memory-engine/file-backend.js +58 -104
- package/dist/core/memory-engine/index.d.ts +2 -2
- package/dist/core/memory-engine/index.js +2 -2
- package/dist/core/memory-engine/layout.d.ts +184 -83
- package/dist/core/memory-engine/layout.js +267 -172
- package/dist/core/memory-engine/memory-age.d.ts +12 -0
- package/dist/core/memory-engine/memory-age.js +17 -0
- package/dist/core/memory-engine/memory-backend-contract.js +12 -11
- package/dist/core/memory-engine/memory-deployment.d.ts +4 -3
- package/dist/core/memory-engine/memory-deployment.js +6 -3
- package/dist/core/memory-engine/origin-clearance.d.ts +43 -15
- package/dist/core/memory-engine/origin-clearance.js +142 -58
- package/dist/core/memory-engine/tools.d.ts +2 -2
- package/dist/core/memory-engine/tools.js +7 -7
- package/dist/core/memory-engine/types.d.ts +16 -10
- package/dist/core/memory-vector.d.ts +6 -14
- package/dist/core/memory.d.ts +0 -462
- package/dist/core/memory.js +0 -333
- package/dist/core/model-receipt.d.ts +2 -1
- package/dist/core/model-receipt.js +5 -0
- package/dist/core/mods/dollar.d.ts +12 -0
- package/dist/core/mods/kernel/dispatch.d.ts +3 -1
- package/dist/core/mods/kernel/dispatch.js +5 -2
- package/dist/core/mods/kernel/events.d.ts +3 -1
- package/dist/core/mods/kernel/events.js +2 -2
- package/dist/core/mods/prompt-submit.d.ts +4 -0
- package/dist/core/mods/prompt-submit.js +24 -0
- package/dist/core/mods/stations.d.ts +23 -4
- package/dist/core/mods/stations.js +14 -7
- package/dist/core/permission-rule-consent.d.ts +49 -18
- package/dist/core/permission-rule-consent.js +59 -38
- package/dist/core/permission-rule-store.d.ts +24 -14
- package/dist/core/retention.d.ts +2 -7
- package/dist/core/retention.js +0 -1
- package/dist/core/retired-host-table-account.d.ts +19 -0
- package/dist/core/retired-host-table-account.js +28 -0
- package/dist/core/retired-tool-name-account.d.ts +60 -0
- package/dist/core/retired-tool-name-account.js +32 -0
- package/dist/core/roles.d.ts +3 -1
- package/dist/core/roles.js +5 -2
- package/dist/core/runner/classifier-ladder.d.ts +3 -1
- package/dist/core/runner/classifier-ladder.js +2 -2
- package/dist/core/runner/compact-session.js +2 -1
- package/dist/core/runner/contracts.d.ts +9 -9
- package/dist/core/runner/delegation-owner.d.ts +0 -8
- package/dist/core/runner/delegation-owner.js +1 -3
- package/dist/core/runner/gate-exit.js +9 -2
- package/dist/core/runner/memory-consolidation-driver.js +2 -2
- package/dist/core/runner/prepare-config-doors.js +1 -1
- package/dist/core/runner/prepare-delegation-surface.d.ts +1 -1
- package/dist/core/runner/prepare-delegation-surface.js +5 -3
- package/dist/core/runner/prepare-gate-stations.d.ts +8 -5
- package/dist/core/runner/prepare-gate-stations.js +13 -5
- package/dist/core/runner/prepare-inherited-gate.js +2 -0
- package/dist/core/runner/prepare-memory-engine-session.js +1 -1
- package/dist/core/runner/prepare-memory.js +35 -14
- package/dist/core/runner/prepare-policy-chain.js +12 -3
- package/dist/core/runner/prepare-project-context.js +2 -2
- package/dist/core/runner/prepare-task.d.ts +9 -1
- package/dist/core/runner/prepare-task.js +6 -5
- package/dist/core/runner/prepare-wiring-manifest.js +5 -4
- package/dist/core/runner/prompt-suggestions.js +1 -1
- package/dist/core/runner/run-identity-wiring.js +2 -2
- package/dist/core/runner/run-leg.js +3 -3
- package/dist/core/runner/run-notification-lane.d.ts +3 -0
- package/dist/core/runner/run-notification-lane.js +2 -2
- package/dist/core/runner/runtask.js +6 -3
- package/dist/core/runner/steer-admission.d.ts +11 -2
- package/dist/core/runner/stream-steer-verb.d.ts +5 -2
- package/dist/core/runner/stream-steer-verb.js +67 -14
- package/dist/core/runner/sub-agent-deny-lists.d.ts +8 -8
- package/dist/core/runner/sub-agent-deny-lists.js +22 -8
- package/dist/core/runner-deps.d.ts +4 -4
- package/dist/core/secret-env.d.ts +2 -2
- package/dist/core/secret-env.js +6 -20
- package/dist/core/session-store.d.ts +6 -6
- package/dist/core/session-store.js +3 -3
- package/dist/core/shell-run-candidates.js +3 -3
- package/dist/core/side-query.js +1 -1
- package/dist/core/skill-grant.d.ts +7 -0
- package/dist/core/skill-grant.js +14 -5
- package/dist/core/store-contracts/background-agent-store-contract.js +13 -0
- package/dist/core/task-event.d.ts +14 -0
- package/dist/core/task-notification.d.ts +35 -8
- package/dist/core/task-notification.js +31 -13
- package/dist/core/task-registry-agent.js +1 -0
- package/dist/core/task-registry-shared.d.ts +4 -0
- package/dist/core/tool-errors.d.ts +3 -3
- package/dist/core/tool-policy.js +2 -3
- package/dist/core/tool-spec.d.ts +20 -10
- package/dist/core/user-attachment.d.ts +5 -1
- package/dist/core/user-attachment.js +11 -5
- package/dist/core/write-protect.d.ts +16 -0
- package/dist/core/write-protect.js +10 -0
- package/dist/engine/harness/agent-harness.d.ts +19 -11
- package/dist/engine/harness/agent-harness.js +7 -4
- package/dist/engine/llm/types.d.ts +22 -10
- package/dist/engine/session/repo-utils.d.ts +14 -4
- package/dist/engine/session/repo-utils.js +5 -4
- package/dist/index.d.ts +10 -8
- package/dist/index.js +9 -7
- package/dist/prompts/default.d.ts +1 -2
- package/dist/scenarios/full-body.d.ts +1 -1
- package/dist/shell/lex.d.ts +50 -15
- package/dist/shell/lex.js +43 -9
- package/dist/stores/file/adoption/adopt.d.ts +1 -1
- package/dist/stores/file/index.d.ts +1 -15
- package/dist/stores/file/index.js +1 -15
- package/dist/stores/file/permission-rule-store.d.ts +12 -1
- package/dist/stores/file/permission-rule-store.js +31 -4
- package/dist/stores/file/session-store.js +1 -1
- package/dist/tools/fs/fs-bash.js +3 -3
- package/dist/tools/fs/removal-targets.d.ts +8 -2
- package/dist/tools/fs/removal-targets.js +31 -4
- package/dist/tools/fs/shell-read-argv.js +7 -1
- package/dist/tools/fs/shell-read-bindings.d.ts +21 -5
- package/dist/tools/fs/shell-read-bindings.js +130 -44
- package/dist/tools/fs/shell-read-plan.js +95 -29
- package/dist/tools/fs/shell-read-sourced.d.ts +25 -0
- package/dist/tools/fs/shell-read-sourced.js +119 -0
- package/dist/tools/fs/shell-read-word.d.ts +2 -2
- package/dist/tools/fs/shell-read-word.js +4 -5
- package/dist/tools/fs/shell-read-workdir.d.ts +19 -3
- package/dist/tools/fs/shell-read-workdir.js +60 -15
- package/dist/tools/fs/shell-reentry-text.d.ts +10 -2
- package/dist/tools/fs/shell-reentry-text.js +11 -4
- package/package.json +2 -2
- package/test/export-surface.snapshot.json +21 -79
- package/wire-changes/core-stores-sql@7.65.0.json +30 -0
- package/wire-changes/core-stores-sql@7.66.0.json +30 -0
- package/wire-changes/core@7.65.0.json +1650 -0
- package/wire-changes/core@7.66.0.json +1218 -0
- package/wire-changes/mods-kernel@7.65.0.json +30 -0
- package/wire-changes/mods-kernel@7.66.0.json +65 -0
- package/wire-changes/primitives@7.65.0.json +337 -0
- package/wire-changes/primitives@7.66.0.json +30 -0
- package/dist/core/memory-recall.d.ts +0 -208
- package/dist/core/memory-recall.js +0 -136
- package/dist/stores/file/memory-store.d.ts +0 -124
- package/dist/stores/file/memory-store.js +0 -353
|
@@ -278,14 +278,22 @@ export declare function adoptRootScopeLayout(rootPath: string, controlDir: strin
|
|
|
278
278
|
export declare const canonicalize: typeof physicalPathOfExisting;
|
|
279
279
|
/** True iff `child` (canonicalized) is `root` or inside it. */
|
|
280
280
|
export declare function isContainedIn(root: string, child: string): boolean;
|
|
281
|
-
/** The codes the store's physical form refuses an act with — the whole family, one closed set: {@link TARGET_OUTSIDE_STORE}
|
|
282
|
-
* {@link SCOPE_HOME_NOT_DIRECTORY}. Each is a plain `Error` carrying `code` and a
|
|
283
|
-
|
|
281
|
+
/** The codes the store's physical form refuses an act with — the whole family, one closed set: {@link TARGET_OUTSIDE_STORE},
|
|
282
|
+
* {@link SCOPE_HOME_NOT_DIRECTORY}, {@link CONTROL_PLANE_LINKS_UNSUPPORTED} and {@link CONTROL_PLANE_STRAYS}. Each is a plain `Error` carrying `code` and a
|
|
283
|
+
* `detail` ({@link StoreFormRefusalDetail}). */
|
|
284
|
+
export declare const STORE_FORM_REFUSAL_CODES: readonly ["memory.target_outside_store", "memory.scope_home_not_directory", "memory.control_plane_links_unsupported", "memory.control_plane_strays"];
|
|
284
285
|
export type StoreFormRefusalCode = (typeof STORE_FORM_REFUSAL_CODES)[number];
|
|
285
286
|
/** The code an act on a store path is refused with when it would land outside the store ({@link landsOutsideStore}). */
|
|
286
287
|
export declare const TARGET_OUTSIDE_STORE = "memory.target_outside_store";
|
|
287
288
|
/** The code a scope home that is not a real directory is refused with ({@link assertHomePhysicalForm}). */
|
|
288
289
|
export declare const SCOPE_HOME_NOT_DIRECTORY = "memory.scope_home_not_directory";
|
|
290
|
+
/** The code a File governance store's open is refused with when its control plane's file system cannot make a hard link
|
|
291
|
+
* (`probeControlPlaneLinks`, `control-objects.ts`; #3512). */
|
|
292
|
+
export declare const CONTROL_PLANE_LINKS_UNSUPPORTED = "memory.control_plane_links_unsupported";
|
|
293
|
+
/** The code an engine's construction is refused with when its backend carries a governance store that is not the File
|
|
294
|
+
* store over the engine's own control plane, and that control plane still holds carrier records (`controlPlaneStraysRefusal`;
|
|
295
|
+
* #3484, C-R1119 HB-5): records nobody reads would launder what they recorded, so they are adopted first. */
|
|
296
|
+
export declare const CONTROL_PLANE_STRAYS = "memory.control_plane_strays";
|
|
289
297
|
/** What a scope home can be besides a real directory (an `lstat` verdict). */
|
|
290
298
|
export declare const SCOPE_HOME_FORMS: readonly ["symlink", "file", "other"];
|
|
291
299
|
export type ScopeHomeForm = (typeof SCOPE_HOME_FORMS)[number];
|
|
@@ -296,7 +304,8 @@ declare const SCOPE_HOME_FORM_PHRASE: {
|
|
|
296
304
|
readonly other: "a special file";
|
|
297
305
|
};
|
|
298
306
|
export type HomeFormPhraseCoversEveryForm = AssertAllKeysHandled<Exclude<ScopeHomeForm, keyof typeof SCOPE_HOME_FORM_PHRASE>>;
|
|
299
|
-
/** What a store-form refusal carries beside its sentence. Host paths live here and never in the sentence
|
|
307
|
+
/** What a store-form refusal carries beside its sentence. Host paths live here and never in the sentence (on
|
|
308
|
+
* {@link CONTROL_PLANE_LINKS_UNSUPPORTED}, `path` is the control plane);
|
|
300
309
|
* `form` is present on {@link SCOPE_HOME_NOT_DIRECTORY} only; `controlDir`, `recorded` and `now` are present
|
|
301
310
|
* together on a moved store root only ({@link storeRootMovedRefusal}): the control plane whose root anchor
|
|
302
311
|
* refused (the `controlDir` to hand {@link reanchorMemoryStoreRoot}), the physical root the anchor records,
|
|
@@ -336,6 +345,17 @@ export declare function storeRootAbsentRefusal(path: string, anchor: {
|
|
|
336
345
|
}): StoreFormRefusal;
|
|
337
346
|
/** Seat 3 — a scope home that is not a real directory. */
|
|
338
347
|
export declare function scopeHomeRefusal(form: ScopeHomeForm, path: string): StoreFormRefusal;
|
|
348
|
+
/** Seat 4 — the control plane at `path` is on a file system that refused a hard link (`fault`: the error code `link`
|
|
349
|
+
* answered, when it named one). The store publishes every control object with `link`, so it is not opened there. */
|
|
350
|
+
export declare function controlPlaneLinksRefusal(path: string, fault: string | undefined): StoreFormRefusal;
|
|
351
|
+
/** Seat 5 — an engine whose backend carries a governance store of its own over a control plane (`path`) that still holds
|
|
352
|
+
* that carrier's records from before (`strays`: the documents, and the count of entries per object kind): the engine
|
|
353
|
+
* reads its records through the carrier, so these would be read by nobody — a pollution marker, a hold, a capture
|
|
354
|
+
* opt-out nobody reads launders what it recorded. Not opened; the remedy is the explicit adoption. */
|
|
355
|
+
export declare function controlPlaneStraysRefusal(path: string, strays: {
|
|
356
|
+
readonly docs: readonly string[];
|
|
357
|
+
readonly objects: Readonly<Record<string, number>>;
|
|
358
|
+
}): StoreFormRefusal;
|
|
339
359
|
/** Where an act at `p` lands: the physical path of its normalized spelling (the spelling a child path
|
|
340
360
|
* joined under it carries), a MISSING tail rejoined under the deepest existing directory (what the act
|
|
341
361
|
* creates) — a dangling link on that tail followed to where it points (what the act would create through
|
|
@@ -501,10 +521,10 @@ export declare function withPermissionRemedy<T>(err: T, memoryDir: string): T;
|
|
|
501
521
|
* (engine harvest, engine derived-index rung, backend inbound gate): they write the same directory,
|
|
502
522
|
* so its name and its permissions must not depend on which of them ran first. */
|
|
503
523
|
export declare const QUARANTINE_DIR = "quarantine";
|
|
504
|
-
/** REF-A9 — what {@link
|
|
524
|
+
/** REF-A9 — what {@link clearContainedPath} reports back; both hosts escalate `detail` into
|
|
505
525
|
* their report channel (harvest `quarantineFailures` / inbound `quarantine_failed` findings). */
|
|
506
526
|
export interface QuarantineOutcome {
|
|
507
|
-
/** The captured copy
|
|
527
|
+
/** The captured copy: its name among the governance store's `quarantine` objects. Absent ⇔ the capture itself failed. */
|
|
508
528
|
dest?: string;
|
|
509
529
|
/** True ⇔ the model-visible file no longer holds the suspect content (deleted, or tombstoned). */
|
|
510
530
|
removed: boolean;
|
|
@@ -512,27 +532,12 @@ export interface QuarantineOutcome {
|
|
|
512
532
|
* may overwrite (see {@link restoreContainedBaseline}). ABSENT ⇔ the path was freed. Present ⇔ either
|
|
513
533
|
* this engine's own tombstone (the clear-in-place rung) or the suspect bytes themselves (neither rung
|
|
514
534
|
* worked) — in both cases replacing it takes nobody else's work, and in neither case may anything the
|
|
515
|
-
* restore did not put there be destroyed.
|
|
535
|
+
* restore did not put there be destroyed. A path found rewritten after it was read reports the bytes that
|
|
536
|
+
* were read: the newer bytes there are not them, so a following restore keeps its hands off. */
|
|
516
537
|
leftOnPlane?: string;
|
|
517
538
|
/** Set on ANY deviation from the clean capture+delete path — never a silent best-effort downgrade. */
|
|
518
539
|
detail?: string;
|
|
519
540
|
}
|
|
520
|
-
/**
|
|
521
|
-
* B2/L4 + C-F9 (S2-0) — capture a gate-rejected file into control-plane quarantine FROM THE
|
|
522
|
-
* ALREADY-READ `content` (never re-reading `path`: the disk bytes may have been swapped since the
|
|
523
|
-
* gate scanned them — TOCTOU), then remove the suspect from the model-visible plane: delete, and if
|
|
524
|
-
* that fails overwrite in place with {@link DELETED_TOMBSTONE}.
|
|
525
|
-
*
|
|
526
|
-
* REF-A9: ONE implementation for the engine's harvest rung and the backend's inbound-gate rung.
|
|
527
|
-
* They were line-for-line twins carrying the same historical fix ("mirrors the engine-side fix",
|
|
528
|
-
* opus review 1.257.2) and had already drifted twice — the backend minted its quarantine filename
|
|
529
|
-
* off `Date.now()` instead of its own injected clock, and the two created the SHARED quarantine dir
|
|
530
|
-
* with different permissions (whoever ran first decided how readable the captured secrets were).
|
|
531
|
-
*
|
|
532
|
-
* NOT to be reused for the derived-index rung (`MemoryEngine.gateDerivedIndex`): that one CLEARS the
|
|
533
|
-
* file (the index is derived and is rebuilt from entry frontmatter), which is the opposite of a
|
|
534
|
-
* tombstone — folding them would launder that distinction away.
|
|
535
|
-
*/
|
|
536
541
|
/**
|
|
537
542
|
* Write `content` to `path`, refusing to follow a symlink at the FINAL component (`O_NOFOLLOW`).
|
|
538
543
|
*
|
|
@@ -616,7 +621,7 @@ export declare function dropStagingSecondNames(seat: string, opened: {
|
|
|
616
621
|
readonly ino: number;
|
|
617
622
|
}): number;
|
|
618
623
|
/**
|
|
619
|
-
* The ONE way a committed baseline goes back after {@link
|
|
624
|
+
* The ONE way a committed baseline goes back after {@link clearContainedPath} emptied its seat —
|
|
620
625
|
* the inverse half of that function, beside it so the removal word and its readers stay in one module.
|
|
621
626
|
* Both containment arms (the capture-residue sweep and the polluted-harvest record loop) call it, and
|
|
622
627
|
* the rule is ONE sentence: THE RESTORE MAY ONLY OVERWRITE WHAT THE CONTAINMENT ITSELF LEFT AT THE PATH.
|
|
@@ -633,10 +638,90 @@ export declare function dropStagingSecondNames(seat: string, opened: {
|
|
|
633
638
|
* which took them off the plane as surely as the removal would have.
|
|
634
639
|
*/
|
|
635
640
|
export declare function restoreContainedBaseline(path: string, committed: string, leftOnPlane: string | undefined): "written" | "kept" | "failed";
|
|
636
|
-
|
|
641
|
+
/** What keeping one suspect file's copy came to: the name its copy is kept under among the governance store's
|
|
642
|
+
* `quarantine` objects, or why no copy could be kept. */
|
|
643
|
+
export type QuarantineCapture = {
|
|
644
|
+
readonly name: string;
|
|
645
|
+
} | {
|
|
646
|
+
readonly failed: string;
|
|
647
|
+
};
|
|
648
|
+
/** The governance store's quarantine objects, as a capture writes them. */
|
|
649
|
+
export type QuarantineObjects = Pick<import("./types.js").MemoryGovernanceObjects, "putObject" | "getObject">;
|
|
650
|
+
/** Write `(kind, name)` once for a writer whose record is the FIRST one under that name (a capture name, a pollution
|
|
651
|
+
* slot, an imported record): `"created"` ⇔ this call wrote `bytes`; `"existed"` ⇔ an object stands under the name and
|
|
652
|
+
* reads back — the same bytes (the put answered so), or other bytes the put refused to overwrite: the record that
|
|
653
|
+
* stands is the first one, and the writer moves on (the next capture name; the standing record's reading). A refusal
|
|
654
|
+
* no readable object explains (a store that fails, an entry that is no object, a name the store refuses) is the put's
|
|
655
|
+
* own and is thrown. The File store's synchronous paths take its twin, `putFileControlObjectOnce` (`control-objects.ts`). */
|
|
656
|
+
export declare function putControlObjectOnce(objects: Pick<import("./types.js").MemoryGovernanceObjects, "putObject" | "getObject">, kind: import("./types.js").MemoryControlObjectKind, name: string, bytes: Uint8Array): Promise<"created" | "existed">;
|
|
657
|
+
/** The name the copy of the suspect file at `path` is tried under on `attempt` (0…10). codex batch-2 review F2: the
|
|
658
|
+
* key is timestamp+basename, and two rejected files can legally share BOTH (same basename under different parents,
|
|
659
|
+
* one clock tick — or a test's frozen injected clock), so a capture is written ONCE (a standing name is never
|
|
660
|
+
* replaced) and suffixed on collision; bounded — after the numbered tries, one last name keyed by pid+counter (unique
|
|
661
|
+
* within this process) either lands or the capture fails. A `\` (legal in a POSIX file name, never in an object name)
|
|
662
|
+
* is spelled `%5C`. */
|
|
663
|
+
export declare function quarantineCaptureName(base: string, attempt: number): string;
|
|
664
|
+
/** The base of every capture name for the suspect file at `path`: `<now>-<basename>` ({@link quarantineCaptureName}). */
|
|
665
|
+
export declare function quarantineCaptureBase(path: string, now: () => number): string;
|
|
666
|
+
/** Keep the copy of the suspect file at `path` (its already-read `content`) as a `quarantine` object of the
|
|
667
|
+
* governance store, under the first of its capture names ({@link quarantineCaptureName}) that does not stand yet. */
|
|
668
|
+
export declare function captureIntoQuarantine(objects: QuarantineObjects, path: string, content: string, now: () => number): Promise<QuarantineCapture>;
|
|
669
|
+
/** The governance store's quarantine objects, as an erasure finds and removes them. A reader that must see damage hands
|
|
670
|
+
* in the store's damage-visible view (`standingControlObjectsOf`, `consolidation.ts`): for the File store its listing
|
|
671
|
+
* names every entry standing in the kind's directory; any other store's listing is its own (KL-3466-c). */
|
|
672
|
+
export type QuarantineErasureObjects = Pick<import("./types.js").MemoryGovernanceObjects, "listObjects" | "getObject" | "deleteObject">;
|
|
673
|
+
/** What one erasure did to the quarantine objects. `removed` — the copies of an erased entry this call deleted;
|
|
674
|
+
* `remaining` — the copies it could not delete AND the objects it could not read to tell (an object that stands unread
|
|
675
|
+
* is never read as none of the request's: fail-closed, it keeps the request partial); `unreadable` — how many of
|
|
676
|
+
* `remaining` are those unread objects; `unattributed` — the objects read whose bytes name no entry id (a fragment, an
|
|
677
|
+
* index copy), counted and left. */
|
|
678
|
+
export interface QuarantineErasure {
|
|
679
|
+
removed: number;
|
|
680
|
+
remaining: number;
|
|
681
|
+
unreadable: number;
|
|
682
|
+
unattributed: number;
|
|
683
|
+
}
|
|
684
|
+
/**
|
|
685
|
+
* Delete every `quarantine` object whose bytes are a copy of an erased entry — the frontmatter `id` they carry is in `ids`
|
|
686
|
+
* — through the store's object verbs: one law for every carrier, the File store's directory and a database store alike.
|
|
687
|
+
* Only the `quarantine` kind is read and only a name its listing gave is deleted; a pollution marker, an import receipt
|
|
688
|
+
* or a hold's capture is never touched, whatever its bytes say. An object the store answers as gone between the listing
|
|
689
|
+
* and the read or the delete is not counted. A listing that fails (or answers anything but a list of names) throws
|
|
690
|
+
* `ControlPlaneCorruptError` — an enumeration that fails is never an empty kind; the lane that called decides what its
|
|
691
|
+
* attestation says about that (the File face refuses and a replay converges; the degraded lane answers `unverified`).
|
|
692
|
+
*/
|
|
693
|
+
export declare function eraseQuarantineCopies(objects: QuarantineErasureObjects, ids: ReadonlySet<string>): Promise<QuarantineErasure>;
|
|
694
|
+
/**
|
|
695
|
+
* Take the suspect file at `path` off the model-visible plane once its copy is kept (`capture`): unlink it, else
|
|
696
|
+
* clear it to a tombstone in place. `content` is the bytes the caller read and captured; a path that now reads back
|
|
697
|
+
* DIFFERENT bytes is left alone — they were written after the capture was read, so they are not the suspect copy,
|
|
698
|
+
* and removing them would destroy bytes no copy holds (a read that cannot run removes as before: only a successful
|
|
699
|
+
* read of other bytes stops the removal).
|
|
700
|
+
*
|
|
701
|
+
* ONE implementation for the engine's harvest rungs and the backend's inbound gate (REF-A9: two line-for-line twins
|
|
702
|
+
* had drifted twice). The derived-index rung clears its file instead of tombstoning it — the index is rebuilt from
|
|
703
|
+
* entry frontmatter — so it does not come through here.
|
|
704
|
+
*/
|
|
705
|
+
export declare function clearContainedPath(path: string, content: string, capture: QuarantineCapture): QuarantineOutcome;
|
|
706
|
+
/** Keep the copies of a derived file (its already-read `text`) before a containment overwrites it — the index's
|
|
707
|
+
* clear and its restore, which take whatever stands (the index is derived: its prose has no entry a later judgment
|
|
708
|
+
* could hang on, so the containment wins over the copy, as a capture that fails never stopped it). The copy is a
|
|
709
|
+
* store write (`keep`, which awaits), so the file is read again after it (`reread`: the caller's act-gated read that
|
|
710
|
+
* never follows a link, so a path re-pointed in that window is refused, not copied) and bytes rewritten in that
|
|
711
|
+
* window are kept too — at most three copies; a file still moving after that has its last version uncopied, and
|
|
712
|
+
* says so. `landed` ⇔ every version that stood was copied; `failed` says why each that was not. */
|
|
713
|
+
export declare function keepCopiesBeforeOverwrite(text: string, keep: (bytes: string) => Promise<true | string>, reread: () => string | undefined): Promise<{
|
|
714
|
+
landed: boolean;
|
|
715
|
+
failed: string[];
|
|
716
|
+
}>;
|
|
637
717
|
/** The name prefix of {@link atomicWriteFileSync}'s temporary file, created beside its target and renamed onto it.
|
|
638
718
|
* One spelling for the writer and for {@link STORE_OPEN_ARTIFACTS}. */
|
|
639
719
|
export declare const ATOMIC_WRITE_TMP_PREFIX = ".tmp-";
|
|
720
|
+
/** The name prefix of the two files a File governance store's open makes at its control plane's top level to try one
|
|
721
|
+
* hard link, and removes before the open answers (`probeControlPlaneLinks`, `control-objects.ts`; #3512). One
|
|
722
|
+
* spelling for the probe and for {@link STORE_OPEN_ARTIFACTS}: a probe cut short between its two steps leaves an
|
|
723
|
+
* inert file, never a record. */
|
|
724
|
+
export declare const LINK_PROBE_PREFIX = ".link-probe-";
|
|
640
725
|
/** The infix of a stolen lock's tombstone, `<lock directory><infix><unique>`: both mkdir mutexes (the sidecar lock
|
|
641
726
|
* and the store's transaction lock) rename a crashed holder's lock to it before removing it. One spelling for both
|
|
642
727
|
* steals and for {@link STORE_OPEN_ARTIFACTS}. */
|
|
@@ -644,7 +729,8 @@ export declare const LOCK_TOMB_INFIX = ".stale-";
|
|
|
644
729
|
/**
|
|
645
730
|
* The named artifacts of a File store's mount — the files an OPEN or a READ of the store may leave there, by place
|
|
646
731
|
* and exact name (or fixed prefix); the list the contract `memory.deployment.store_set` names. Opening anchors the
|
|
647
|
-
* root (the anchor, written through a temporary file under its lock)
|
|
732
|
+
* root (the anchor, written through a temporary file under its lock) and tries one hard link between two dot-files at
|
|
733
|
+
* the control plane's top level, removed before the open answers (#3512); a read registers the scope it reads (the
|
|
648
734
|
* registry and its commit journal, under the registry's lock); a refused request or a recovery takes the store's
|
|
649
735
|
* transaction lock; a lock found stale is stolen through a tombstone; a registration of two labels that differ only
|
|
650
736
|
* in letter case probes the volume with a dot-file at the memory directory's top level — on any volume, folding or not,
|
|
@@ -655,7 +741,7 @@ export declare const LOCK_TOMB_INFIX = ".stale-";
|
|
|
655
741
|
* Nothing is matched at another depth or by another pattern: a record's name may begin with these spellings (a
|
|
656
742
|
* capture opt-out record is named after its session id, and `.tmp-x` is a session id), so a pattern below the top
|
|
657
743
|
* level would hide it. The anchor, the registry and its journal are artifacts as an open or a read leaves them, whole
|
|
658
|
-
* ({@link
|
|
744
|
+
* ({@link namedArtifactFault}). The list is a promise a host's assertions read: a change to it carries its reason with it.
|
|
659
745
|
*/
|
|
660
746
|
export declare const STORE_OPEN_ARTIFACTS: Readonly<{
|
|
661
747
|
files: readonly string[];
|
|
@@ -674,10 +760,18 @@ export declare function isStoreOpenArtifact(where: "control" | "memory", rel: re
|
|
|
674
760
|
* be read — any failure but absence; a link that leads nowhere, at it or above it, is no absence — counts as holding
|
|
675
761
|
* one: a store may be there, and opening it says what is; so does a named artifact that stands but cannot be read as
|
|
676
762
|
* what it is (the root anchor, the scope registry or its journal that is a link, not a regular file, unreadable, not
|
|
677
|
-
* JSON or out of shape — an open or a read leaves them whole; see {@link
|
|
763
|
+
* JSON or out of shape — an open or a read leaves them whole; see {@link namedArtifactFault}). Read from the disk at each call. This answers "does a store live on this mount"; whether a root must stay guarded
|
|
678
764
|
* by its anchor is {@link controlPlaneHoldsStore}'s question.
|
|
679
765
|
*/
|
|
680
766
|
export declare function storeHoldsRecord(memoryDir: string, controlDir: string): boolean;
|
|
767
|
+
/**
|
|
768
|
+
* The first fault among a File store's named artifacts ({@link STORE_OPEN_ARTIFACTS}`.files`), or `undefined`: the one answer
|
|
769
|
+
* {@link storeHoldsRecord} counts a mount as holding a store by and an open of that mount refuses by. A mount in a deployment's
|
|
770
|
+
* store set because its anchor, registry or journal cannot be read is opened as one fault — the same for the anchor (which the
|
|
771
|
+
* store's constructor already refuses) and for the registry (which only a first read refuses): one reading of "damaged", one
|
|
772
|
+
* loudness.
|
|
773
|
+
*/
|
|
774
|
+
export declare function storeOpenArtifactFault(memoryDir: string, controlDir: string): ControlPlaneCorruptError | undefined;
|
|
681
775
|
/** S2-B — the File governance store's file for the `announcements` document (the queued memory-change
|
|
682
776
|
* announcements, drained at session-first inject): one file, one bounded queue PER SCOPE inside it (see
|
|
683
777
|
* {@link enqueueMemoryAnnouncement}). */
|
|
@@ -830,6 +924,8 @@ export declare function scanFuseCount(controlDir: string, key: string): number;
|
|
|
830
924
|
export declare function sessionRecordBindsIncarnation(recorded: string | undefined, asking: string | undefined): boolean;
|
|
831
925
|
/** The incarnation this layer ACTS on: an unusable token is the unnamed occupant, never a throw. */
|
|
832
926
|
export declare function usableSessionIncarnation(raw: string | undefined): string | undefined;
|
|
927
|
+
/** The control objects one session record kind is kept through (`pollution`, `capture`). */
|
|
928
|
+
type SessionRecordObjects = Pick<import("./types.js").MemoryGovernanceObjects, "putObject" | "getObject" | "listObjects">;
|
|
833
929
|
/** How a per-session record read names the identity reading; absent ⇒ every record binds. */
|
|
834
930
|
export interface SessionIdentityRead {
|
|
835
931
|
incarnation?: string;
|
|
@@ -850,11 +946,14 @@ export interface SessionPollutionRecord {
|
|
|
850
946
|
* absent (no resolver wired, or written before the axis) ⇒ it binds every occupant. */
|
|
851
947
|
incarnation?: string;
|
|
852
948
|
}
|
|
949
|
+
/** The part of a governance store the session pollution markers are kept through: its control objects of kind
|
|
950
|
+
* `pollution`, one per record slot ({@link sessionRecordName}). */
|
|
951
|
+
export type SessionPollutionObjects = Pick<import("./types.js").MemoryGovernanceObjects, "putObject" | "getObject" | "listObjects">;
|
|
853
952
|
/**
|
|
854
|
-
* Mark `sessionId` polluted (idempotent; the FIRST record wins —
|
|
953
|
+
* Mark `sessionId` polluted (idempotent; the FIRST record wins — the object is written once, never replaced).
|
|
855
954
|
*
|
|
856
955
|
* The outcome distinguishes the two ways a durable marker can exist after the call, because the
|
|
857
|
-
*
|
|
956
|
+
* write-once create is the only ATOMIC answer to "who made this transition" available anywhere in the
|
|
858
957
|
* stack (#324a, adversarial-review round 5): a check-then-act pre-read lets two concurrent markers
|
|
859
958
|
* of one session both believe they were first, and a once-per-session disclosure keyed on that would
|
|
860
959
|
* announce twice. `"created"` ⇔ THIS call minted the marker; `"existed"` ⇔ it was already there (a
|
|
@@ -863,32 +962,32 @@ export interface SessionPollutionRecord {
|
|
|
863
962
|
* stays polluted for this process either way).
|
|
864
963
|
*/
|
|
865
964
|
export type SessionPollutionMarkOutcome = "created" | "existed" | "unpersisted";
|
|
866
|
-
export declare function markSessionPolluted(
|
|
965
|
+
export declare function markSessionPolluted(objects: SessionPollutionObjects, sessionId: string, reason: string, now: () => number, cause?: import("./types.js").MemoryOriginCause, incarnation?: string): Promise<SessionPollutionMarkOutcome>;
|
|
867
966
|
/** Read the durable pollution record for `sessionId` (undefined = no marker).
|
|
868
967
|
* A marker that EXISTS still reads as polluted whether or not its bytes can be read or parsed
|
|
869
|
-
* (fail-closed: neither corruption nor an unreadable
|
|
870
|
-
* record stands in. Only ABSENCE is clean
|
|
871
|
-
* clean
|
|
872
|
-
export declare function readSessionPollution(
|
|
968
|
+
* (fail-closed: neither corruption nor an unreadable object may launder the state) — a synthesized
|
|
969
|
+
* record stands in. Only ABSENCE is clean: a store that cannot answer whether a slot stands reads as
|
|
970
|
+
* polluted, never as clean (the store's law — a fault is never an absence). */
|
|
971
|
+
export declare function readSessionPollution(objects: SessionPollutionObjects, sessionId: string, identity?: SessionIdentityRead): Promise<SessionPollutionRecord | undefined>;
|
|
873
972
|
/**
|
|
874
973
|
* design/178 v2-c §3-3 — enumerate EVERY durable pollution marker (the export snapshot's pollution
|
|
875
974
|
* face; `readSessionPollution` stays the per-session read). Same fail-closed record posture as the
|
|
876
|
-
* per-session read: a marker
|
|
877
|
-
* record, never a silent omission (corruption must not launder the state out of an export).
|
|
878
|
-
*
|
|
879
|
-
*
|
|
975
|
+
* per-session read: a marker that stands but cannot be read or parsed answers a synthesized
|
|
976
|
+
* record, never a silent omission (corruption must not launder the state out of an export). A kind
|
|
977
|
+
* with no objects is the genuine empty state; an enumeration failure THROWS (the store's law) — a
|
|
978
|
+
* listing that silently dropped markers would export a package that launders pollution.
|
|
880
979
|
*/
|
|
881
|
-
export declare function listSessionPollution(
|
|
980
|
+
export declare function listSessionPollution(objects: SessionPollutionObjects): Promise<Record<string, SessionPollutionRecord>>;
|
|
882
981
|
/**
|
|
883
982
|
* design/178 v2-c §5.3 — the STRICT durable pollution import. Deliberately NOT
|
|
884
983
|
* `markSessionPolluted`: that leg is best-effort-with-disclosure and mints its own `at`, so a
|
|
885
984
|
* bundle's source record (the governance fact being carried) could neither land verbatim nor prove
|
|
886
|
-
* durability. This leg writes the SOURCE record verbatim (
|
|
887
|
-
* record back and COMPARES — equal = converged no-op, different = the
|
|
888
|
-
* record stands and the divergence is REPORTED (`"divergent"`), never
|
|
889
|
-
* write failure THROWS (the import aborts with its latch standing — §1-2⑤).
|
|
985
|
+
* durability. This leg writes the SOURCE record verbatim (written once); when the slot already stands
|
|
986
|
+
* it reads the standing record back and COMPARES — equal = converged no-op, different = the
|
|
987
|
+
* destination's first-mark-wins record stands and the divergence is REPORTED (`"divergent"`), never
|
|
988
|
+
* silently absorbed. A write failure THROWS (the import aborts with its latch standing — §1-2⑤).
|
|
890
989
|
*/
|
|
891
|
-
export declare function importSessionPollution(
|
|
990
|
+
export declare function importSessionPollution(objects: SessionPollutionObjects, sessionId: string, record: SessionPollutionRecord): Promise<"written" | "already" | "divergent">;
|
|
892
991
|
/** Directory (under the control plane) holding one record file per capture-opted-out session. */
|
|
893
992
|
export declare const SESSION_CAPTURE_OPTOUT_DIR = "session-capture-optout";
|
|
894
993
|
/** The durable capture opt-out record. `reason` is host/engine-authored (the declaring channel),
|
|
@@ -900,39 +999,44 @@ export interface SessionCaptureOptOutRecord {
|
|
|
900
999
|
* ADDITIVE: absent ⇒ binds every occupant, which is also where a carrier that drops it lands. */
|
|
901
1000
|
incarnation?: string;
|
|
902
1001
|
}
|
|
903
|
-
/** Outcome vocabulary shared with the pollution marker (same
|
|
1002
|
+
/** Outcome vocabulary shared with the pollution marker (the same one-way form, written once): `"created"` ⇔ THIS
|
|
904
1003
|
* call minted the record; `"existed"` ⇔ already recorded (a resumed session / an idempotent
|
|
905
1004
|
* re-declaration); `"unpersisted"` ⇔ the record could not be written — the CALLER must refuse to
|
|
906
1005
|
* run (design/383 §2.8: an opt-out that only holds in-process is broken by the first resume, so
|
|
907
1006
|
* "could not persist" is a named refusal, never a silent in-process-only degrade — the deliberate
|
|
908
1007
|
* divergence from the pollution marker's best-effort arm). */
|
|
909
1008
|
export type SessionCaptureOptOutMarkOutcome = "created" | "existed" | "unpersisted";
|
|
910
|
-
/**
|
|
911
|
-
*
|
|
912
|
-
*
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
*
|
|
917
|
-
*
|
|
918
|
-
*
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
1009
|
+
/** The part of a governance store the capture opt-out records are kept through: its control objects of kind `capture`,
|
|
1010
|
+
* one per record slot ({@link sessionRecordName}). A reader that must tell a record that stands unreadable from a store
|
|
1011
|
+
* that cannot answer hands in the store's damage-visible view (`standingControlObjectsOf`, `consolidation.ts`): its
|
|
1012
|
+
* listing names every entry standing where a record belongs. */
|
|
1013
|
+
export type SessionCaptureObjects = SessionRecordObjects;
|
|
1014
|
+
/** Mark `sessionId` capture-opted-out (idempotent; the FIRST record wins — the object is written once, never replaced).
|
|
1015
|
+
* Incarnation law: first-record-wins is per IDENTITY — a new occupant whose declaration meets a stranger's standing
|
|
1016
|
+
* record mints its own slot instead of answering `"existed"` ({@link sessionRecordName}). Never throws: a record that
|
|
1017
|
+
* cannot be written, or a slot that stands as no readable object, answers `"unpersisted"` (the caller refuses to run). */
|
|
1018
|
+
export declare function markSessionCaptureObjects(objects: SessionCaptureObjects, sessionId: string, record: SessionCaptureOptOutRecord): Promise<SessionCaptureOptOutMarkOutcome>;
|
|
1019
|
+
/** Read the durable capture opt-out record for `sessionId` (undefined = capture is on). Fail-closed exactly like the
|
|
1020
|
+
* pollution read: a record that STANDS but cannot be read or parsed answers opted-out (a synthesized record stands in).
|
|
1021
|
+
* Only ABSENCE reads as "capture on". A store that cannot establish whether a record exists THROWS — the engine's
|
|
1022
|
+
* `sessionCaptureOptOutOrFault` catch turns it into the INDETERMINATE fault axis (the same fail-closed suppression,
|
|
1023
|
+
* honestly attributed: an outage is never reported as a user request). `objects` is the damage-visible view. */
|
|
1024
|
+
export declare function readSessionCaptureObjects(objects: SessionCaptureObjects, sessionId: string, identity?: SessionIdentityRead): Promise<SessionCaptureOptOutRecord | undefined>;
|
|
922
1025
|
/**
|
|
923
|
-
* Enumerate EVERY durable capture opt-out record (the consolidation eligibility arm's roster read —
|
|
924
|
-
*
|
|
925
|
-
*
|
|
926
|
-
*
|
|
927
|
-
* dropped records would let the distiller amplify content its author asked to withhold.
|
|
1026
|
+
* Enumerate EVERY durable capture opt-out record (the consolidation eligibility arm's roster read — design/383 §2.4).
|
|
1027
|
+
* Same fail-closed posture as {@link listSessionPollution}: a record that stands but cannot be read answers synthesized
|
|
1028
|
+
* (never silently omitted); a kind with no objects is the genuine empty state; an enumeration failure THROWS — a listing
|
|
1029
|
+
* that silently dropped records would let the distiller amplify content its author asked to withhold.
|
|
928
1030
|
*/
|
|
929
|
-
export declare function
|
|
1031
|
+
export declare function listSessionCaptureObjects(objects: SessionCaptureObjects): Promise<Record<string, SessionCaptureOptOutRecord>>;
|
|
930
1032
|
/**
|
|
931
1033
|
* design/383 §2.1b — the control-plane carrier a HOST may substitute for the capture opt-out
|
|
932
1034
|
* record's read/write/list (server F1: on a stateless multi-replica deployment the file form is
|
|
933
1035
|
* invisible to the resume replica — "record not found" would break exactly toward capture). The
|
|
934
|
-
* core default is the
|
|
935
|
-
*
|
|
1036
|
+
* core default (#3484) is the `capture` objects of the governance store the engine keeps its documents
|
|
1037
|
+
* in (`governanceCaptureRecordStore`, `consolidation.ts`): the File store's directory — byte-identical
|
|
1038
|
+
* names and bytes — or the store the backend carries, the same for every replica that opens it.
|
|
1039
|
+
* CONTRACT (each leg mirrors the objects' law above):
|
|
936
1040
|
* - `mark` is create-only/first-record-wins and must answer `"unpersisted"` (never throw) when the
|
|
937
1041
|
* carrier cannot durably land the record;
|
|
938
1042
|
* - `read` is fail-closed: a record that exists but cannot be decoded answers a synthesized
|
|
@@ -942,20 +1046,12 @@ export declare function listSessionCaptureOptOut(controlDir: string): Record<str
|
|
|
942
1046
|
* record ("a user request that never happened") and must not answer `undefined` ("no record"
|
|
943
1047
|
* breaks exactly toward capture);
|
|
944
1048
|
* - `list` throws on an enumeration failure (an unreadable roster is not an empty one).
|
|
945
|
-
* REGISTERED COMPANION (named, not silently absent): the session-POLLUTION marker has the same
|
|
946
|
-
* cloud-form invisibility (server F1 names both). It is NOT routed through this seat in this
|
|
947
|
-
* slice because the delegation-settlement lane's consumers are contractually PURE-DATA
|
|
948
|
-
* (`controlDir` + `sessionId` coordinates that outlive any live object — see the settlement handle
|
|
949
|
-
* doc in prepare-task.ts), and a live store object cannot ride that lane; its migration needs its
|
|
950
|
-
* own seam design and is registered here rather than half-built.
|
|
951
|
-
*
|
|
952
1049
|
* DUAL FORM (#511 件2, additive): each leg may answer `T` OR `Promise<T>` — a SQL/remote carrier is
|
|
953
1050
|
* async by nature and could not implement the sync-only trio at all. Every core consumption point
|
|
954
1051
|
* awaits (or `.then`-chains where a sync public seat must stay sync-transparent), so a sync store's
|
|
955
1052
|
* behavior is unchanged and an async store's Promise legs keep the exact same contract per leg:
|
|
956
1053
|
* a rejected `mark` promise is held to the `"unpersisted"` refusal arm, a rejected `read` promise
|
|
957
1054
|
* is the INDETERMINATE fault axis, a rejected `list` promise propagates as the enumeration failure.
|
|
958
|
-
* The File trio below keeps its synchronous signatures byte-identical.
|
|
959
1055
|
*/
|
|
960
1056
|
export interface SessionCaptureRecordStore {
|
|
961
1057
|
mark(sessionId: string, record: SessionCaptureOptOutRecord): SessionCaptureOptOutMarkOutcome | Promise<SessionCaptureOptOutMarkOutcome>;
|
|
@@ -965,9 +1061,6 @@ export interface SessionCaptureRecordStore {
|
|
|
965
1061
|
read(sessionId: string, identity?: SessionIdentityRead): SessionCaptureOptOutRecord | undefined | Promise<SessionCaptureOptOutRecord | undefined>;
|
|
966
1062
|
list(): Record<string, SessionCaptureOptOutRecord> | Promise<Record<string, SessionCaptureOptOutRecord>>;
|
|
967
1063
|
}
|
|
968
|
-
/** The core-default {@link SessionCaptureRecordStore}: the file trio over `controlDir` (single-
|
|
969
|
-
* process / single-host deployments keep today's carrier byte-identical). */
|
|
970
|
-
export declare function fileSessionCaptureRecordStore(controlDir: string): SessionCaptureRecordStore;
|
|
971
1064
|
/** The retrieved-account sidecar (control plane): entry id → { count, lastAt }. */
|
|
972
1065
|
export declare const USAGE_RETRIEVED_FILE = "usage-retrieved.json";
|
|
973
1066
|
/** Bound on tracked ids — over the cap, the entries with the OLDEST `lastAt` are evicted first
|
|
@@ -1018,6 +1111,11 @@ export declare function lockedStrictUpdate<S, T>(controlDir: string, fileName: s
|
|
|
1018
1111
|
next?: S;
|
|
1019
1112
|
result: T;
|
|
1020
1113
|
}): T;
|
|
1114
|
+
/** Remove a fail-closed sidecar under its lock (a journal rolls forward first) when `removable` answers `true` for its
|
|
1115
|
+
* committed value — the delete half of handing a document over to another store (#3484: the control-plane adoption
|
|
1116
|
+
* removes the replica's copy once the carrier holds the same value). Answers `"removed"`, `"absent"` (nothing stood)
|
|
1117
|
+
* or `"kept"` (`removable` refused the value). Same lock and ownership fence as {@link lockedStrictUpdate}. */
|
|
1118
|
+
export declare function lockedStrictRemove(controlDir: string, fileName: string, what: string, removable: (committed: unknown) => boolean): "removed" | "absent" | "kept";
|
|
1021
1119
|
/** Lock-less strict READ (journal-aware): a parseable journal wins (committed next state); an
|
|
1022
1120
|
* unparseable journal, or an unreadable/unparseable file, is corrupt. Exported module-level for
|
|
1023
1121
|
* the strict-account family's siblings (see {@link lockedStrictUpdate}). */
|
|
@@ -1124,6 +1222,9 @@ export declare const IMPORT_RECEIPTS_DIR = "import-receipts";
|
|
|
1124
1222
|
/** The lineage txn id of a bundle import's synthetic latch (ONE latch per bundle — a re-import of
|
|
1125
1223
|
* the same bundle re-stages the same txn id, which is what makes the latch idempotent). */
|
|
1126
1224
|
export declare function importLatchTxnId(bundleHash: string): string;
|
|
1225
|
+
/** The name a bundle's completion receipt is kept under: the store's control object of kind `import-receipt`
|
|
1226
|
+
* `<bundleHash>.json`. */
|
|
1227
|
+
export declare function importReceiptName(bundleHash: string): string;
|
|
1127
1228
|
/**
|
|
1128
1229
|
* design/178 v2-c §1-1 — stage the bundle import's SYNTHETIC LATCH: one pending lineage txn
|
|
1129
1230
|
* (txnId = {@link importLatchTxnId}) whose rows name every bundle entry id, every row and the txn
|
|
@@ -1139,13 +1240,13 @@ export declare function stageImportLatch(docs: MemoryGovernanceDocs, bundleHash:
|
|
|
1139
1240
|
}>, now: () => number): Promise<string>;
|
|
1140
1241
|
/**
|
|
1141
1242
|
* design/178 v2-c §1-2⑥ — the ONE latch release channel. Hard precondition: the durable completion
|
|
1142
|
-
* receipt for the bundle is IN PLACE (`import-
|
|
1143
|
-
* governance legs all landed) — absent receipt ⇒ loud refusal, the latch stands, and
|
|
1144
|
-
* re-running the same bundle import.
|
|
1145
|
-
*
|
|
1146
|
-
* a NON-latch txn under the id is refused (this is never a generic discard).
|
|
1243
|
+
* receipt for the bundle is IN PLACE (the store's `import-receipt` object `<bundleHash>.json`, minted
|
|
1244
|
+
* after the governance legs all landed) — absent receipt ⇒ loud refusal, the latch stands, and
|
|
1245
|
+
* convergence is re-running the same bundle import. A receipt the store cannot answer for is refused
|
|
1246
|
+
* like a missing one, never read as absent (fail-closed). Idempotent: an already-released (absent)
|
|
1247
|
+
* txn is a no-op; a NON-latch txn under the id is refused (this is never a generic discard).
|
|
1147
1248
|
*/
|
|
1148
|
-
export declare function releaseImportLatch(
|
|
1249
|
+
export declare function releaseImportLatch(store: MemoryGovernanceDocs & Pick<import("./types.js").MemoryGovernanceObjects, "getObject">, txnId: string): Promise<void>;
|
|
1149
1250
|
/** The DIRTY-LATCH set: every entry id named by ANY pending row (credentialed or not). While an id
|
|
1150
1251
|
* is latched, its model-visible read faces (index mechanical rows / memory_search / memory_get)
|
|
1151
1252
|
* refuse — "the account is not settled, the content does not go on the table". Throws on a
|