@sema-agent/core 7.68.2 → 7.68.4
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 +41 -0
- package/dist/agents/repair-loop.js +1 -1
- package/dist/agents/verify.js +1 -1
- package/dist/core/engine-notice.d.ts +5 -0
- package/dist/core/governance-codes.d.ts +3 -1
- package/dist/core/governance-codes.js +3 -0
- package/dist/core/mods/message-display.d.ts +3 -0
- package/dist/core/mods/message-display.js +2 -2
- package/dist/core/process-identity.d.ts +14 -2
- package/dist/core/process-identity.js +5 -3
- package/dist/core/runner/caller-stop-gate.d.ts +3 -3
- package/dist/core/runner/contracts.d.ts +2 -2
- package/dist/core/runner/end-of-run.d.ts +29 -0
- package/dist/core/runner/end-of-run.js +22 -0
- package/dist/core/runner/prepare-task.d.ts +4 -1
- package/dist/core/runner/prepare-task.js +3 -3
- package/dist/core/runner/run-notification-lane.d.ts +2 -0
- package/dist/core/runner/run-notification-lane.js +2 -2
- package/dist/core/runner/runtask.js +7 -2
- package/dist/core/task-spec-members.d.ts +30 -18
- package/dist/core/task-spec-members.js +11 -8
- package/dist/core/task-spec.d.ts +2 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/orchestration/goal.js +3 -1
- package/dist/stores/file/data-root-declaration.d.ts +32 -0
- package/dist/stores/file/data-root-declaration.js +19 -0
- package/dist/stores/file/fs-atomic.d.ts +22 -2
- package/dist/stores/file/fs-atomic.js +63 -10
- package/dist/stores/file/index.d.ts +1 -0
- package/dist/stores/file/index.js +1 -0
- package/dist/stores/file/permission-rule-adopt.js +3 -3
- package/dist/stores/file/permission-rule-store.js +2 -2
- package/package.json +3 -2
- package/test/export-surface.snapshot.json +5 -1
- package/wire-changes/core-stores-sql@7.68.3.json +39 -0
- package/wire-changes/core-stores-sql@7.68.4.json +39 -0
- package/wire-changes/core@7.68.3.json +125 -0
- package/wire-changes/core@7.68.4.json +187 -0
- package/wire-changes/mods-kernel@7.68.3.json +39 -0
- package/wire-changes/mods-kernel@7.68.4.json +39 -0
- package/wire-changes/primitives@7.68.3.json +39 -0
- package/wire-changes/primitives@7.68.4.json +39 -0
- package/wire-changes/wiki-gate@7.68.3.json +39 -0
- package/wire-changes/wiki-gate@7.68.4.json +39 -0
|
@@ -20,17 +20,21 @@
|
|
|
20
20
|
* object): it compares objects, it does not take a value.
|
|
21
21
|
*/
|
|
22
22
|
import type { TaskSpec } from "./task-spec.js";
|
|
23
|
-
/** The
|
|
24
|
-
*
|
|
25
|
-
*
|
|
23
|
+
/** The two non-placeholder values of the member table's column — the member lives and dies with `sessionId`, so a run that is
|
|
24
|
+
* handed a new session of its own carries neither kind:
|
|
25
|
+
* - {@link SESSION}: the session's address and the run's demand on it (the session to continue, the requirement that it exists);
|
|
26
|
+
* - {@link ENTRY}: an operation a run performs on ENTERING that session — branch it at an entry, converge its files to a history
|
|
27
|
+
* boundary (and how), open on what is parked for it. The leg that enters performs it once; a later leg in the session an earlier
|
|
28
|
+
* leg of the same call entered carries none of them. */
|
|
26
29
|
declare const SESSION: "session";
|
|
30
|
+
declare const ENTRY: "entry";
|
|
27
31
|
/** Every {@link TaskSpec} member, by name — the type's own key set, fenced both ways (a member added to `TaskSpec` and not
|
|
28
32
|
* listed here, or a name here that `TaskSpec` does not declare, is a compile error). The value is a column: `0` for an
|
|
29
|
-
* ordinary member, {@link SESSION} for one that is bound to the spec's session. */
|
|
33
|
+
* ordinary member, {@link SESSION} or {@link ENTRY} for one that is bound to the spec's session. */
|
|
30
34
|
declare const SPEC_MEMBER_TABLE: {
|
|
31
35
|
taskId: 0;
|
|
32
36
|
objective: 0;
|
|
33
|
-
wake: "
|
|
37
|
+
wake: "entry";
|
|
34
38
|
principal: 0;
|
|
35
39
|
isolationScope: 0;
|
|
36
40
|
actor: 0;
|
|
@@ -46,8 +50,8 @@ declare const SPEC_MEMBER_TABLE: {
|
|
|
46
50
|
requireExistingSession: "session";
|
|
47
51
|
oneShot: 0;
|
|
48
52
|
clientContext: 0;
|
|
49
|
-
resumeAt: "
|
|
50
|
-
resumeAtMode: "
|
|
53
|
+
resumeAt: "entry";
|
|
54
|
+
resumeAtMode: "entry";
|
|
51
55
|
model: 0;
|
|
52
56
|
modelRole: 0;
|
|
53
57
|
roles: 0;
|
|
@@ -66,10 +70,10 @@ declare const SPEC_MEMBER_TABLE: {
|
|
|
66
70
|
fileHistory: 0;
|
|
67
71
|
projectMemory: 0;
|
|
68
72
|
instructionFamily: 0;
|
|
69
|
-
restoreFiles: "
|
|
70
|
-
acceptPartialRestore: "
|
|
71
|
-
unplacedHistoryRecordedUnder: "
|
|
72
|
-
rewindFilesTo: "
|
|
73
|
+
restoreFiles: "entry";
|
|
74
|
+
acceptPartialRestore: "entry";
|
|
75
|
+
unplacedHistoryRecordedUnder: "entry";
|
|
76
|
+
rewindFilesTo: "entry";
|
|
73
77
|
tools: 0;
|
|
74
78
|
allowTools: 0;
|
|
75
79
|
excludeTools: 0;
|
|
@@ -141,14 +145,16 @@ declare const SPEC_MEMBER_TABLE: {
|
|
|
141
145
|
};
|
|
142
146
|
/** Every {@link TaskSpec} member, by name. */
|
|
143
147
|
export declare const TASK_SPEC_MEMBERS: readonly string[];
|
|
144
|
-
/** The members the table marks as bound to the spec's session — a name here is a member that means something only
|
|
145
|
-
* `sessionId` (`requireExistingSession` without one is refused, `resumeAt` / `resumeAtMode` branch the session it names,
|
|
148
|
+
/** The members the table marks as bound to the spec's session (either kind) — a name here is a member that means something only
|
|
149
|
+
* beside `sessionId` (`requireExistingSession` without one is refused, `resumeAt` / `resumeAtMode` branch the session it names,
|
|
146
150
|
* `restoreFiles` needs the `resumeAt` it restores to, `rewindFilesTo` / `acceptPartialRestore` / `unplacedHistoryRecordedUnder` address its file-history boundaries). */
|
|
147
151
|
export type SessionBoundSpecMember = {
|
|
148
|
-
[K in keyof typeof SPEC_MEMBER_TABLE]: (typeof SPEC_MEMBER_TABLE)[K] extends typeof SESSION ? K : never;
|
|
152
|
+
[K in keyof typeof SPEC_MEMBER_TABLE]: (typeof SPEC_MEMBER_TABLE)[K] extends typeof SESSION | typeof ENTRY ? K : never;
|
|
149
153
|
}[keyof typeof SPEC_MEMBER_TABLE];
|
|
150
154
|
/** The session-bound members, in table order. */
|
|
151
155
|
export declare const SESSION_BOUND_SPEC_MEMBERS: readonly SessionBoundSpecMember[];
|
|
156
|
+
/** The session-bound members of the {@link ENTRY} kind — the operations a run performs on entering its session — in table order. */
|
|
157
|
+
export declare const SESSION_ENTRY_SPEC_MEMBERS: readonly SessionBoundSpecMember[];
|
|
152
158
|
/**
|
|
153
159
|
* The spec for a run that gets a session of its own: the caller's spec without every session-bound member, by the table (never
|
|
154
160
|
* by a name written at the call site), so a member added to the column is dropped here too. A shallow copy — every other member
|
|
@@ -156,11 +162,17 @@ export declare const SESSION_BOUND_SPEC_MEMBERS: readonly SessionBoundSpecMember
|
|
|
156
162
|
*/
|
|
157
163
|
export declare function withoutSessionBinding(spec: TaskSpec): Omit<TaskSpec, SessionBoundSpecMember>;
|
|
158
164
|
/**
|
|
159
|
-
* The spec of a leg
|
|
160
|
-
*
|
|
161
|
-
*
|
|
165
|
+
* The spec of a leg a composition opens on an objective of its own, from the caller's spec. A leg opens on exactly one input (the
|
|
166
|
+
* door refuses `wake` beside an objective), and the objective is this one's.
|
|
167
|
+
* - Without `continues`: the leg that ENTERS the caller's session (a resumed repair loop's first attempt) — every member of the column
|
|
168
|
+
* stays but `wake`.
|
|
169
|
+
* - With `continues`: a LATER leg, in the session an earlier leg of the same call entered (a fix leg, a later repair attempt, a later
|
|
170
|
+
* goal iteration) — the leg runs in `continues`, and every {@link ENTRY} member is dropped, by the table: the earlier leg performed
|
|
171
|
+
* those on entering, and carried into a later leg each would be performed again (a rewind written back over the earlier legs' files,
|
|
172
|
+
* a branch that drops their turns). The {@link SESSION} members other than the address stay as the caller wrote them.
|
|
173
|
+
* A member added to the column is read here as its kind says. A shallow copy, as {@link withoutSessionBinding}.
|
|
162
174
|
*/
|
|
163
|
-
export declare function withOpeningObjective(spec: Omit<TaskSpec, "objective">, objective: string): TaskSpec;
|
|
175
|
+
export declare function withOpeningObjective(spec: Omit<TaskSpec, "objective">, objective: string, continues?: string): TaskSpec;
|
|
164
176
|
/** What one read of a caller's spec answered: the snapshot every reader reads, the caller's own object (for the roster's identity
|
|
165
177
|
* check only), and the refusal the read met (thrown at prepare's door), if any. */
|
|
166
178
|
export interface CallerSpecRead<S extends Partial<TaskSpec> = TaskSpec> {
|
|
@@ -2,12 +2,13 @@ import { RETIRED_TASK_SPEC_KEYS, retiredKeyOf, retiredKeyRefusal } from "./retir
|
|
|
2
2
|
import { thrownText } from "./thrown-value.js";
|
|
3
3
|
import { strayMembersOf } from "./own-property-receipt.js";
|
|
4
4
|
const SESSION = "session";
|
|
5
|
+
const ENTRY = "entry";
|
|
5
6
|
const SPEC_MEMBER_TABLE = {
|
|
6
|
-
taskId: 0, objective: 0, wake:
|
|
7
|
-
images: 0, userAttachments: 0, sessionId: SESSION, projectId: 0, workspace: 0, requireExistingSession: SESSION, oneShot: 0, clientContext: 0, resumeAt:
|
|
8
|
-
resumeAtMode:
|
|
7
|
+
taskId: 0, objective: 0, wake: ENTRY, principal: 0, isolationScope: 0, actor: 0, runOrigin: 0, interactionPosture: 0, approvalReach: 0, interactiveQuestionFallback: 0,
|
|
8
|
+
images: 0, userAttachments: 0, sessionId: SESSION, projectId: 0, workspace: 0, requireExistingSession: SESSION, oneShot: 0, clientContext: 0, resumeAt: ENTRY,
|
|
9
|
+
resumeAtMode: ENTRY, model: 0, modelRole: 0, roles: 0, compactionModel: 0, advisorModel: 0, thinking: 0, systemPrompt: 0,
|
|
9
10
|
promptRole: 0, promptForm: 0, promptBinding: 0, promptLocale: 0, appendSystemPrompt: 0, outputStyle: 0, memory: 0, suggestNextPrompts: 0, fileHistory: 0,
|
|
10
|
-
projectMemory: 0, instructionFamily: 0, restoreFiles:
|
|
11
|
+
projectMemory: 0, instructionFamily: 0, restoreFiles: ENTRY, acceptPartialRestore: ENTRY, unplacedHistoryRecordedUnder: ENTRY, rewindFilesTo: ENTRY, tools: 0, allowTools: 0, excludeTools: 0, excludeAllTools: 0,
|
|
11
12
|
deferTools: 0, toolMaterializeStrategy: 0, alwaysLoadTools: 0, restoreGatedTools: 0, deferSelfResolve: 0, promptLean: 0, agents: 0, toolPolicy: 0,
|
|
12
13
|
basePolicyForResumeEdit: 0, onAsk: 0, onQuestion: 0, lspManager: 0, lspDiagnostics: 0, mods: 0, peerPresence: 0, durableApproval: 0,
|
|
13
14
|
resourceSuspend: 0, preemptSignal: 0, resilience: 0, finalVerification: 0, maxSuspends: 0, checkpointStore: 0, handsReadOnly: 0, memoryPersistenceCapable: 0,
|
|
@@ -19,16 +20,18 @@ const SPEC_MEMBER_TABLE = {
|
|
|
19
20
|
language: 0,
|
|
20
21
|
};
|
|
21
22
|
export const TASK_SPEC_MEMBERS = Object.keys(SPEC_MEMBER_TABLE);
|
|
22
|
-
export const SESSION_BOUND_SPEC_MEMBERS = TASK_SPEC_MEMBERS.filter((name) => Reflect.get(SPEC_MEMBER_TABLE, name)
|
|
23
|
+
export const SESSION_BOUND_SPEC_MEMBERS = TASK_SPEC_MEMBERS.filter((name) => Reflect.get(SPEC_MEMBER_TABLE, name) !== 0);
|
|
24
|
+
export const SESSION_ENTRY_SPEC_MEMBERS = SESSION_BOUND_SPEC_MEMBERS.filter((name) => Reflect.get(SPEC_MEMBER_TABLE, name) === ENTRY);
|
|
23
25
|
export function withoutSessionBinding(spec) {
|
|
24
26
|
const own = { ...spec };
|
|
25
27
|
for (const name of SESSION_BOUND_SPEC_MEMBERS)
|
|
26
28
|
Reflect.deleteProperty(own, name);
|
|
27
29
|
return own;
|
|
28
30
|
}
|
|
29
|
-
export function withOpeningObjective(spec, objective) {
|
|
30
|
-
const own = { ...spec, objective };
|
|
31
|
-
|
|
31
|
+
export function withOpeningObjective(spec, objective, continues) {
|
|
32
|
+
const own = { ...spec, objective, ...(continues !== undefined ? { sessionId: continues } : {}) };
|
|
33
|
+
for (const name of continues !== undefined ? SESSION_ENTRY_SPEC_MEMBERS : ["wake"])
|
|
34
|
+
Reflect.deleteProperty(own, name);
|
|
32
35
|
return own;
|
|
33
36
|
}
|
|
34
37
|
const MEMBERS = new Set(TASK_SPEC_MEMBERS);
|
package/dist/core/task-spec.d.ts
CHANGED
|
@@ -1795,6 +1795,8 @@ export interface TaskSpec {
|
|
|
1795
1795
|
* External cancellation. When it aborts, the task aborts (the brain request is cancelled and any
|
|
1796
1796
|
* pending tool-policy gate releases). Pass a parent tool's `ToolExecuteContext.signal` here so a
|
|
1797
1797
|
* nested `runTask` stops the instant the parent does instead of running to its own `limits.maxWalltimeMs`.
|
|
1798
|
+
* The run holds nothing on it once it has ended: the host need not abort it after the run, and may keep one
|
|
1799
|
+
* signal for many runs.
|
|
1798
1800
|
*/
|
|
1799
1801
|
signal?: AbortSignal;
|
|
1800
1802
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -186,7 +186,7 @@ export type { FileHistoryStore, FileHistoryResult, FileHistoryTrackResult, FileH
|
|
|
186
186
|
export type { InMemoryFileHistoryStoreOptions } from "./core/file-history-store.js";
|
|
187
187
|
export { DEFAULT_FILE_HISTORY_BOUNDARY_KEEP, resolveFileHistoryRetention, fileHistoryBoundariesToKeep } from "./core/file-history-retention.js";
|
|
188
188
|
export type { FileHistoryRetentionPolicy } from "./core/file-history-retention.js";
|
|
189
|
-
export { FileStorageBackend, FileSessionRepo, FileCheckpointStore, CHECKPOINT_LEDGER_EVENT_KINDS, readCheckpointLedger, FileToolResultStore, FileSessionPolicyStore, FileFileHistoryStore, FileWorkflowJournalStore, MAX_JOURNAL_RESULT_BYTES, oversizeJournalResult, resolveDataRoot, sanitizeScope, sanitizePathComponent, atomicWriteFile, writeThenLink, ensureDir, readJsonlRecords, AppendLog, FileStoreLockError, type FileStoreLockErrorCode, processFingerprint, isProcessLive, type ProcessFingerprint, type FileStorageBackendOptions, type FileStorageCorruptReadInfo, type FileFileHistoryStoreOptions, type FileSessionRepoOptions, type FileCheckpointStoreOptions, type CheckpointLedgerEventKind, type CheckpointLedgerReading, type ReadCheckpointLedgerOptions, } from "./stores/file/index.js";
|
|
189
|
+
export { FileStorageBackend, FileSessionRepo, FileCheckpointStore, CHECKPOINT_LEDGER_EVENT_KINDS, readCheckpointLedger, FileToolResultStore, FileSessionPolicyStore, FileFileHistoryStore, FileWorkflowJournalStore, MAX_JOURNAL_RESULT_BYTES, oversizeJournalResult, resolveDataRoot, sanitizeScope, sanitizePathComponent, atomicWriteFile, writeThenLink, ensureDir, readJsonlRecords, AppendLog, FileStoreLockError, type FileStoreLockErrorCode, processFingerprint, isProcessLive, type ProcessFingerprint, declareDataRoot, type DataRootDeclaration, type FileStorageBackendOptions, type FileStorageCorruptReadInfo, type FileFileHistoryStoreOptions, type FileSessionRepoOptions, type FileCheckpointStoreOptions, type CheckpointLedgerEventKind, type CheckpointLedgerReading, type ReadCheckpointLedgerOptions, } from "./stores/file/index.js";
|
|
190
190
|
export { CacheBreakDetector, type CacheBreakFinding, type ToolFingerprintInput } from "./core/cache-break-detector.js";
|
|
191
191
|
export { maybeCompact, type MaybeCompactOptions, type CompactionPassStart, type CompactionWindowSafetyInfo, type CompactionRestoreAsk } from "./core/auto-compaction.js";
|
|
192
192
|
export type { MintedAttachmentFrame } from "./core/user-attachment.js";
|
package/dist/index.js
CHANGED
|
@@ -147,7 +147,7 @@ export { describeTrackKey as fileHistoryDescribeTrackKey, fileHistoryExportDiges
|
|
|
147
147
|
export { resolveTrackedFile as fileHistoryResolveTrackedFile, placeProvenDifferent as fileHistoryPlaceProvenDifferent, trackKeyForEdit as fileHistoryTrackKeyForEdit, trackKeyForAnnul as fileHistoryTrackKeyForAnnul, fileHistoryEntryTravels, fileHistoryParentIdentTravels } from "./core/file-history-store.js";
|
|
148
148
|
export { fileHistoryBlobExchangeOf } from "./core/file-history-store.js";
|
|
149
149
|
export { DEFAULT_FILE_HISTORY_BOUNDARY_KEEP, resolveFileHistoryRetention, fileHistoryBoundariesToKeep } from "./core/file-history-retention.js";
|
|
150
|
-
export { FileStorageBackend, FileSessionRepo, FileCheckpointStore, CHECKPOINT_LEDGER_EVENT_KINDS, readCheckpointLedger, FileToolResultStore, FileSessionPolicyStore, FileFileHistoryStore, FileWorkflowJournalStore, MAX_JOURNAL_RESULT_BYTES, oversizeJournalResult, resolveDataRoot, sanitizeScope, sanitizePathComponent, atomicWriteFile, writeThenLink, ensureDir, readJsonlRecords, AppendLog, FileStoreLockError, processFingerprint, isProcessLive, } from "./stores/file/index.js";
|
|
150
|
+
export { FileStorageBackend, FileSessionRepo, FileCheckpointStore, CHECKPOINT_LEDGER_EVENT_KINDS, readCheckpointLedger, FileToolResultStore, FileSessionPolicyStore, FileFileHistoryStore, FileWorkflowJournalStore, MAX_JOURNAL_RESULT_BYTES, oversizeJournalResult, resolveDataRoot, sanitizeScope, sanitizePathComponent, atomicWriteFile, writeThenLink, ensureDir, readJsonlRecords, AppendLog, FileStoreLockError, processFingerprint, isProcessLive, declareDataRoot, } from "./stores/file/index.js";
|
|
151
151
|
export { CacheBreakDetector } from "./core/cache-break-detector.js";
|
|
152
152
|
export { maybeCompact } from "./core/auto-compaction.js";
|
|
153
153
|
export { brainToRuntime } from "./core/runtime.js";
|
|
@@ -3,6 +3,7 @@ import { Type } from "typebox";
|
|
|
3
3
|
import { delimitUntrusted } from "../core/untrusted-text.js";
|
|
4
4
|
import { recipeContinuationLeg } from "../core/input-author.js";
|
|
5
5
|
import { legTaskIdOf } from "../core/leg-identity.js";
|
|
6
|
+
import { withOpeningObjective } from "../core/task-spec-members.js";
|
|
6
7
|
import { isDurablePause, pauseFamily } from "../agents/suspend-guard.js";
|
|
7
8
|
import { OUTPUT_TOOL_NAME, mountRuleFace, toolFace } from "../core/tool-catalog-entries.js";
|
|
8
9
|
export const DECLARE_DONE_TOOL_NAME = "DeclareDone";
|
|
@@ -143,7 +144,8 @@ export async function runGoal(runner, spec, internals) {
|
|
|
143
144
|
? spec.taskSpec.tools
|
|
144
145
|
: [...(spec.taskSpec.tools ?? []), createDeclareDoneTool(doneRef)];
|
|
145
146
|
const roundInternals = { ...internals, goalMode: true };
|
|
146
|
-
const
|
|
147
|
+
const leg = { ...spec.taskSpec, tools, signal: goalSignal };
|
|
148
|
+
const result = await runner.runTask(lastResult === undefined ? { ...leg, sessionId, objective } : withOpeningObjective(leg, objective, lastResult.sessionId), iteration === 1 ? roundInternals : recipeContinuationLeg(roundInternals));
|
|
147
149
|
lastResult = result;
|
|
148
150
|
cumulativeTokens += (result.stats.tokens ?? 0) + (result.stats.nested?.tokens ?? 0);
|
|
149
151
|
spentCostMicroUsd += (result.stats.costMicroUsd ?? 0) + (result.stats.nested?.costMicroUsd ?? 0);
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a host states about a file data root — facts about the DEPLOYMENT the engine cannot observe from inside one process.
|
|
3
|
+
*
|
|
4
|
+
* `singleProcessTable: true` states: every process that opens this data root runs in this one process table — no other
|
|
5
|
+
* container and no other host mounts it (a self-launched, single-user process over a local disk). The directory locks under
|
|
6
|
+
* the root then read a lock record that names no pid namespace (one written by an engine before the namespace was recorded)
|
|
7
|
+
* as written in this table, and judge it by its pid and start times like any lock written here. Without the declaration such
|
|
8
|
+
* a record is not comparable on a host that names its pid namespace (Linux), because a restarted container keeps its host
|
|
9
|
+
* name while its pids live in another table, and it is refused until removed by hand.
|
|
10
|
+
*
|
|
11
|
+
* It is NOT true — and must not be declared — where two containers, pods or hosts can have the root mounted at once: several
|
|
12
|
+
* replicas over one volume, or a rolling upgrade during which two generations of a pod both run.
|
|
13
|
+
*/
|
|
14
|
+
export interface DataRootDeclaration {
|
|
15
|
+
/** Every process that opens the data root runs in this one process table. Only the literal `true`. */
|
|
16
|
+
readonly singleProcessTable: true;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Declare a fact about a file data root ({@link DataRootDeclaration}). Call it before the first store over the root is
|
|
20
|
+
* opened; a lock judged before the call was judged without it. Declaring a root twice is declaring it once, and the
|
|
21
|
+
* declaration lasts for the process.
|
|
22
|
+
*
|
|
23
|
+
* The root is resolved exactly as `FileStorageBackend` resolves its own ({@link resolveDataRoot}: NFC-normalized, created
|
|
24
|
+
* if absent, then its physical path), so the declaration names the directory the stores open — and every directory lock at
|
|
25
|
+
* or under it, whichever store or door takes it, reads the declaration.
|
|
26
|
+
*
|
|
27
|
+
* Refused `config.invalid_argument`: a root that is not a non-empty string, a declaration that is not a plain record, a member
|
|
28
|
+
* the declaration does not take, and a `singleProcessTable` that is anything but the literal `true` (`"true"`, `1`, `false`
|
|
29
|
+
* included — a deployment for which the fact does not hold makes no declaration; a member only a prototype supplies is no
|
|
30
|
+
* member). A refused call declares nothing.
|
|
31
|
+
*/
|
|
32
|
+
export declare function declareDataRoot(root: string, declaration: DataRootDeclaration): void;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { holdSingleProcessTableRoot, resolveDataRoot } from "./fs-atomic.js";
|
|
2
|
+
import { optionKeys, receiptRefusal, receiveMembers } from "../../core/own-property-receipt.js";
|
|
3
|
+
import { describeRejectedValue } from "../../core/tool-search-setting.js";
|
|
4
|
+
const DATA_ROOT_DECLARATION_KEYS = optionKeys()({ singleProcessTable: 0 });
|
|
5
|
+
export function declareDataRoot(root, declaration) {
|
|
6
|
+
if (typeof root !== "string" || root === "") {
|
|
7
|
+
throw receiptRefusal(`declareDataRoot: the data root must be a non-empty path (got ${describeRejectedValue(root)})`);
|
|
8
|
+
}
|
|
9
|
+
if (typeof declaration !== "object" || declaration === null) {
|
|
10
|
+
throw receiptRefusal(`declareDataRoot: the declaration must be a record, { singleProcessTable: true } (got ${describeRejectedValue(declaration)})`);
|
|
11
|
+
}
|
|
12
|
+
const read = receiveMembers(declaration, { subject: "declareDataRoot declaration", unit: "member", moment: "at declareDataRoot" }, DATA_ROOT_DECLARATION_KEYS);
|
|
13
|
+
const value = Object.hasOwn(read, "singleProcessTable") ? read.singleProcessTable : undefined;
|
|
14
|
+
if (value !== true) {
|
|
15
|
+
throw receiptRefusal(`declareDataRoot: singleProcessTable must be the literal true (got ${describeRejectedValue(value)}) — it states that every process ` +
|
|
16
|
+
`opening this data root runs in this one process table; where that does not hold, declare nothing`);
|
|
17
|
+
}
|
|
18
|
+
holdSingleProcessTableRoot(resolveDataRoot(root));
|
|
19
|
+
}
|
|
@@ -246,6 +246,12 @@ export declare class FileStoreLockError extends Error {
|
|
|
246
246
|
* remedy is a person's: remove {@link lockPath} if no process uses the directory.
|
|
247
247
|
*/
|
|
248
248
|
readonly ownerUncheckable?: ProcessUncheckable | undefined;
|
|
249
|
+
/**
|
|
250
|
+
* Present when the lock record is of a version this engine does not read: only its pid was read, so what
|
|
251
|
+
* {@link ownerUncheckable} says is what this engine could read of it — a namespace it shows as missing was
|
|
252
|
+
* not READ, not shown to be unwritten.
|
|
253
|
+
*/
|
|
254
|
+
readonly ownerFingerprintUnread?: true | undefined;
|
|
249
255
|
readonly name = "FileStoreLockError";
|
|
250
256
|
constructor(code: FileStoreLockErrorCode, message: string,
|
|
251
257
|
/** The lock file whose acquisition was refused. */
|
|
@@ -259,15 +265,29 @@ export declare class FileStoreLockError extends Error {
|
|
|
259
265
|
* nothing proves it is, so the refusal is the same `store.dir_in_use` with the cause attached, and the
|
|
260
266
|
* remedy is a person's: remove {@link lockPath} if no process uses the directory.
|
|
261
267
|
*/
|
|
262
|
-
ownerUncheckable?: ProcessUncheckable | undefined
|
|
268
|
+
ownerUncheckable?: ProcessUncheckable | undefined,
|
|
269
|
+
/**
|
|
270
|
+
* Present when the lock record is of a version this engine does not read: only its pid was read, so what
|
|
271
|
+
* {@link ownerUncheckable} says is what this engine could read of it — a namespace it shows as missing was
|
|
272
|
+
* not READ, not shown to be unwritten.
|
|
273
|
+
*/
|
|
274
|
+
ownerFingerprintUnread?: true | undefined);
|
|
263
275
|
}
|
|
276
|
+
/** A store's own words for a lock refusal: the same refusal — its code and everything it says about the owner —
|
|
277
|
+
* said again in `message`, against `lockPath`. */
|
|
278
|
+
export declare function rewordedLockRefusal(err: FileStoreLockError, message: string, lockPath: string): FileStoreLockError;
|
|
264
279
|
/** The clause every refusal of an uncheckable lock owner says, whichever store words the rest — `undefined`
|
|
265
|
-
* for a refusal whose owner was proven running (or that names no owner).
|
|
280
|
+
* for a refusal whose owner was proven running (or that names no owner). A record that names no pid namespace
|
|
281
|
+
* is refused only where the host has not declared the data root's one process table, so its clause also names
|
|
282
|
+
* that declaration, beside the person's remedy — when the declaration would supply what is missing. */
|
|
266
283
|
export declare function uncheckableOwnerClause(err: {
|
|
267
284
|
readonly lockPath: string;
|
|
268
285
|
readonly ownerPid?: number;
|
|
269
286
|
readonly ownerUncheckable?: ProcessUncheckable;
|
|
287
|
+
readonly ownerFingerprintUnread?: true;
|
|
270
288
|
}): string | undefined;
|
|
289
|
+
/** Hold a declared root (its physical path). The door that judges the declaration and resolves the root is `declareDataRoot`. */
|
|
290
|
+
export declare function holdSingleProcessTableRoot(physicalRoot: string): void;
|
|
271
291
|
/**
|
|
272
292
|
* The coarse boot guard (§2.4): an `O_EXCL` owner file (`root/LOCK` for the whole data dir; one per store
|
|
273
293
|
* ledger directory via {@link acquireStoreDirLock}) that forbids two processes sharing it. A second
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { appendFileSync, closeSync, existsSync, fstatSync, ftruncateSync, linkSync, mkdirSync, openSync, readFileSync, readSync, renameSync, statSync, truncateSync, unlinkSync, writeFileSync, writeSync, fsyncSync, } from "node:fs";
|
|
2
2
|
import { constants as bufferConstants } from "node:buffer";
|
|
3
3
|
import { homedir } from "node:os";
|
|
4
|
-
import { basename, dirname, join, resolve as resolvePath } from "node:path";
|
|
4
|
+
import { basename, dirname, join, resolve as resolvePath, sep } from "node:path";
|
|
5
5
|
import { createHash } from "node:crypto";
|
|
6
6
|
import { openExclusiveTemp, PRIVATE_FILE_MODE } from "../../core/exclusive-temp.js";
|
|
7
7
|
import { physicalPathOf, physicalPathOfExisting } from "../../core/physical-path.js";
|
|
@@ -433,20 +433,61 @@ export class FileStoreLockError extends Error {
|
|
|
433
433
|
lockPath;
|
|
434
434
|
ownerPid;
|
|
435
435
|
ownerUncheckable;
|
|
436
|
+
ownerFingerprintUnread;
|
|
436
437
|
name = "FileStoreLockError";
|
|
437
|
-
constructor(code, message, lockPath, ownerPid, ownerUncheckable) {
|
|
438
|
+
constructor(code, message, lockPath, ownerPid, ownerUncheckable, ownerFingerprintUnread) {
|
|
438
439
|
super(message);
|
|
439
440
|
this.code = code;
|
|
440
441
|
this.lockPath = lockPath;
|
|
441
442
|
this.ownerPid = ownerPid;
|
|
442
443
|
this.ownerUncheckable = ownerUncheckable;
|
|
444
|
+
this.ownerFingerprintUnread = ownerFingerprintUnread;
|
|
443
445
|
}
|
|
444
446
|
}
|
|
447
|
+
export function rewordedLockRefusal(err, message, lockPath) {
|
|
448
|
+
return new FileStoreLockError(err.code, message, lockPath, err.ownerPid, err.ownerUncheckable, err.ownerFingerprintUnread);
|
|
449
|
+
}
|
|
450
|
+
function declarationSupplies(why, fingerprintUnread) {
|
|
451
|
+
return why === "pid_namespace_unrecorded" && fingerprintUnread !== true;
|
|
452
|
+
}
|
|
445
453
|
export function uncheckableOwnerClause(err) {
|
|
446
454
|
if (err.ownerUncheckable === undefined)
|
|
447
455
|
return undefined;
|
|
448
456
|
return (`its owner${err.ownerPid !== undefined ? ` (pid ${err.ownerPid})` : ""} cannot be checked from here — ` +
|
|
449
|
-
`${uncheckableProcessText(err.ownerUncheckable)} — so it may still be running; if no process uses it, remove ${err.lockPath}`
|
|
457
|
+
`${uncheckableProcessText(err.ownerUncheckable)} — so it may still be running; if no process uses it, remove ${err.lockPath}` +
|
|
458
|
+
(declarationSupplies(err.ownerUncheckable, err.ownerFingerprintUnread)
|
|
459
|
+
? `, or, if every process that opens this data root runs in this one process table (no other container or host mounts it), ` +
|
|
460
|
+
`declare that with declareDataRoot(<data root>, { singleProcessTable: true }) and such a lock is judged by its pid`
|
|
461
|
+
: ""));
|
|
462
|
+
}
|
|
463
|
+
const singleProcessTableRoots = new Set();
|
|
464
|
+
export function holdSingleProcessTableRoot(physicalRoot) {
|
|
465
|
+
singleProcessTableRoots.add(physicalRoot);
|
|
466
|
+
}
|
|
467
|
+
function singleProcessTableRootOf(lockPath) {
|
|
468
|
+
if (singleProcessTableRoots.size === 0)
|
|
469
|
+
return undefined;
|
|
470
|
+
let dir;
|
|
471
|
+
try {
|
|
472
|
+
dir = physicalPathOf(dirnameOf(lockPath));
|
|
473
|
+
}
|
|
474
|
+
catch {
|
|
475
|
+
return undefined;
|
|
476
|
+
}
|
|
477
|
+
for (const root of singleProcessTableRoots) {
|
|
478
|
+
if (dir === root || dir.startsWith(root.endsWith(sep) ? root : `${root}${sep}`))
|
|
479
|
+
return root;
|
|
480
|
+
}
|
|
481
|
+
return undefined;
|
|
482
|
+
}
|
|
483
|
+
function announceReclaimOnDeclaration(lockPath, pid, root) {
|
|
484
|
+
deliverEngineNotice(undefined, {
|
|
485
|
+
code: "store.lock_reclaimed_on_declaration",
|
|
486
|
+
message: `[sema] file store: removed the lock ${lockPath} left by pid ${pid} — its record names no pid namespace, and it was judged in ` +
|
|
487
|
+
`this process table because the host declared that every process opening the data root ${root} runs in it ` +
|
|
488
|
+
`(declareDataRoot, singleProcessTable); the process it names is gone from this table.`,
|
|
489
|
+
detail: { path: lockPath, pid, root },
|
|
490
|
+
});
|
|
450
491
|
}
|
|
451
492
|
const MAX_RECLAIM_DEPTH = 8;
|
|
452
493
|
const MAX_ACQUIRE_ATTEMPTS = 4;
|
|
@@ -467,7 +508,7 @@ function parseLockRecord(raw) {
|
|
|
467
508
|
if (/^[1-9][0-9]*$/.test(raw)) {
|
|
468
509
|
const barePid = Number.parseInt(raw, 10);
|
|
469
510
|
return Number.isSafeInteger(barePid) && barePid > 0
|
|
470
|
-
? { pid: barePid, startedAtMs: null, startedSinceBootMs: null, host: null, pidNs: null }
|
|
511
|
+
? { pid: barePid, startedAtMs: null, startedSinceBootMs: null, host: null, pidNs: null, fingerprintUnread: false }
|
|
471
512
|
: null;
|
|
472
513
|
}
|
|
473
514
|
if (!raw.startsWith("{"))
|
|
@@ -492,6 +533,7 @@ function parseLockRecord(raw) {
|
|
|
492
533
|
startedSinceBootMs: measure(rec.startedSinceBootMs),
|
|
493
534
|
host: known && typeof rec.host === "string" && rec.host !== "" ? rec.host : null,
|
|
494
535
|
pidNs: known && typeof rec.pidNs === "string" && rec.pidNs !== "" ? rec.pidNs : null,
|
|
536
|
+
fingerprintUnread: !known,
|
|
495
537
|
};
|
|
496
538
|
}
|
|
497
539
|
function readLockRecord(lockPath) {
|
|
@@ -510,7 +552,8 @@ function sameOwner(a, b) {
|
|
|
510
552
|
a.startedAtMs === b.startedAtMs &&
|
|
511
553
|
a.startedSinceBootMs === b.startedSinceBootMs &&
|
|
512
554
|
a.host === b.host &&
|
|
513
|
-
a.pidNs === b.pidNs
|
|
555
|
+
a.pidNs === b.pidNs &&
|
|
556
|
+
a.fingerprintUnread === b.fingerprintUnread);
|
|
514
557
|
}
|
|
515
558
|
export class BootLock {
|
|
516
559
|
lockPath;
|
|
@@ -544,13 +587,19 @@ export class BootLock {
|
|
|
544
587
|
this.pruneOwnAbandoned();
|
|
545
588
|
return;
|
|
546
589
|
}
|
|
547
|
-
|
|
590
|
+
let verdict = processCensus().verdict(owner);
|
|
591
|
+
const declaredRoot = verdict.state === "uncheckable" && declarationSupplies(verdict.why, owner.fingerprintUnread)
|
|
592
|
+
? singleProcessTableRootOf(this.lockPath)
|
|
593
|
+
: undefined;
|
|
594
|
+
if (declaredRoot !== undefined)
|
|
595
|
+
verdict = processCensus({ singleProcessTable: true }).verdict(owner);
|
|
548
596
|
if (verdict.state === "running") {
|
|
549
597
|
throw new FileStoreLockError("store.dir_in_use", `file store: another instance (pid ${owner.pid}) owns this data dir (${dirnameOf(this.lockPath)})`, this.lockPath, owner.pid);
|
|
550
598
|
}
|
|
551
599
|
if (verdict.state === "uncheckable") {
|
|
552
|
-
const
|
|
553
|
-
|
|
600
|
+
const unread = owner.fingerprintUnread ? true : undefined;
|
|
601
|
+
const clause = uncheckableOwnerClause({ lockPath: this.lockPath, ownerPid: owner.pid, ownerUncheckable: verdict.why, ownerFingerprintUnread: unread });
|
|
602
|
+
throw new FileStoreLockError("store.dir_in_use", `file store: the lock on this data dir (${dirnameOf(this.lockPath)}): ${clause}`, this.lockPath, owner.pid, verdict.why, unread);
|
|
554
603
|
}
|
|
555
604
|
if (depth >= MAX_RECLAIM_DEPTH) {
|
|
556
605
|
throw new FileStoreLockError("store.lock_unreadable", `file store: lock file at ${this.lockPath} is buried under ${depth} nested stale reclaim gates ` +
|
|
@@ -573,11 +622,15 @@ export class BootLock {
|
|
|
573
622
|
try {
|
|
574
623
|
const under = this.inspectLock();
|
|
575
624
|
if (under.state === "owner" && sameOwner(under, owner)) {
|
|
625
|
+
let removed = false;
|
|
576
626
|
try {
|
|
577
627
|
unlinkSync(this.lockPath);
|
|
628
|
+
removed = true;
|
|
578
629
|
}
|
|
579
630
|
catch {
|
|
580
631
|
}
|
|
632
|
+
if (removed && declaredRoot !== undefined)
|
|
633
|
+
announceReclaimOnDeclaration(this.lockPath, owner.pid, declaredRoot);
|
|
581
634
|
}
|
|
582
635
|
else if (under.state !== "absent") {
|
|
583
636
|
continue;
|
|
@@ -724,7 +777,7 @@ export function acquireStoreDirLock(dir, opts) {
|
|
|
724
777
|
const single = `This backend is SINGLE-WRITER per directory: a second process replays a private view (both sides can ` +
|
|
725
778
|
`win a once-only decision) and its next compaction erases the records it never loaded.`;
|
|
726
779
|
const unchecked = uncheckableOwnerClause(err);
|
|
727
|
-
throw
|
|
780
|
+
throw rewordedLockRefusal(err, unchecked !== undefined
|
|
728
781
|
?
|
|
729
782
|
`file store: the ${opts.label} directory (${dir}) is locked and ${unchecked}. ${single}`
|
|
730
783
|
: err.code === "store.lock_unreadable"
|
|
@@ -737,7 +790,7 @@ export function acquireStoreDirLock(dir, opts) {
|
|
|
737
790
|
`process finishes and owns the directory, or it dies and the next start reclaims it.`
|
|
738
791
|
: `file store: another OS process${who} is using the ${opts.label} directory (${dir}). ${single} Stop the ` +
|
|
739
792
|
`other process, point this one at a different data root, or use the pg/tidb backend for real ` +
|
|
740
|
-
`multi-process concurrency.`, err.code === "store.lock_unreadable" || unchecked !== undefined ? err.lockPath : lockPath
|
|
793
|
+
`multi-process concurrency.`, err.code === "store.lock_unreadable" || unchecked !== undefined ? err.lockPath : lockPath);
|
|
741
794
|
}
|
|
742
795
|
throw err;
|
|
743
796
|
}
|
|
@@ -27,6 +27,7 @@ export { resolveDataRoot, sanitizeScope, sanitizePathComponent } from "./fs-atom
|
|
|
27
27
|
export { FileStoreLockError, type FileStoreLockErrorCode } from "./fs-atomic.js";
|
|
28
28
|
export { atomicWriteFile, writeThenLink, ensureDir, readJsonlRecords, AppendLog } from "./fs-atomic.js";
|
|
29
29
|
export { processFingerprint, isProcessLive, type ProcessFingerprint } from "./fs-atomic.js";
|
|
30
|
+
export { declareDataRoot, type DataRootDeclaration } from "./data-root-declaration.js";
|
|
30
31
|
export { AdoptionError, assertAdoptionBootGate, readRootAdoptionFile, writeRootAdoptionFile, ROOT_ADOPTION_FILE, type AdoptionErrorCode, type AdoptionReport, type AdoptionReceipt, type AdoptionLegReport, type AffectedDeploymentConfig, type RootAdoptionFile, } from "./adoption/marker.js";
|
|
31
32
|
export { adoptLocalDataRoot, ackAdoptionConfig, witnessAdoptionConfig, listAdoptionQuarantine, readAdoptionStatus, type AdoptionStatus, type AdoptLocalDataRootOptions, type AdoptLocalDataRootResult, type AdoptionCarriageLeg, type AdoptionCarriageLegContext, type AdoptionConfigWitnessReceipt, } from "./adoption/adopt.js";
|
|
32
33
|
/**
|
|
@@ -35,6 +35,7 @@ export { resolveDataRoot, sanitizeScope, sanitizePathComponent } from "./fs-atom
|
|
|
35
35
|
export { FileStoreLockError } from "./fs-atomic.js";
|
|
36
36
|
export { atomicWriteFile, writeThenLink, ensureDir, readJsonlRecords, AppendLog } from "./fs-atomic.js";
|
|
37
37
|
export { processFingerprint, isProcessLive } from "./fs-atomic.js";
|
|
38
|
+
export { declareDataRoot } from "./data-root-declaration.js";
|
|
38
39
|
export { AdoptionError, assertAdoptionBootGate, readRootAdoptionFile, writeRootAdoptionFile, ROOT_ADOPTION_FILE, } from "./adoption/marker.js";
|
|
39
40
|
export { adoptLocalDataRoot, ackAdoptionConfig, witnessAdoptionConfig, listAdoptionQuarantine, readAdoptionStatus, } from "./adoption/adopt.js";
|
|
40
41
|
const FILE_STORAGE_BACKEND_OPTION_KEYS = optionKeys()({ root: 0, evict: 0, checkpoint: 0, retention: 0, fileHistory: 0, sessionPolicy: 0, onCorruptRead: 0, sessions: 0, admit: 0 });
|
|
@@ -7,7 +7,7 @@ import { createPermissionRuleStoreProvider } from "../../core/permission-rule-pr
|
|
|
7
7
|
import { syncPermissionRules } from "../../core/permission-rule-sync.js";
|
|
8
8
|
import { thrownText } from "../../core/thrown-value.js";
|
|
9
9
|
import { optionKeys, receiveMembers } from "../../core/own-property-receipt.js";
|
|
10
|
-
import { FileStoreLockError, uncheckableOwnerClause } from "./fs-atomic.js";
|
|
10
|
+
import { FileStoreLockError, rewordedLockRefusal, uncheckableOwnerClause } from "./fs-atomic.js";
|
|
11
11
|
import { FileDurableRulePartitionProvider, LOCAL_OWNER_FILE, principalRuleFileName, readRuleAdoptionFile, writeRuleAdoptionFile, } from "./permission-rule-store.js";
|
|
12
12
|
const ADOPT_OPTION_KEYS = optionKeys()({ dir: 0, from: 0, toPrincipal: 0, transport: 0, now: 0, onError: 0 });
|
|
13
13
|
export async function adoptFilePermissionRuleStore(opts) {
|
|
@@ -48,9 +48,9 @@ export async function adoptFilePermissionRuleStore(opts) {
|
|
|
48
48
|
if (!(err instanceof FileStoreLockError))
|
|
49
49
|
throw err;
|
|
50
50
|
const unchecked = uncheckableOwnerClause(err);
|
|
51
|
-
throw
|
|
51
|
+
throw rewordedLockRefusal(err, unchecked !== undefined
|
|
52
52
|
? `the permission-rule writer lock ${err.lockPath} refuses the adoption (${err.code}): ${unchecked}, then run the adoption again`
|
|
53
|
-
: `the permission-rule writer lock ${err.lockPath} refuses the adoption (${err.code}${err.ownerPid !== undefined ? `, held by pid ${err.ownerPid}` : ""}) — stop the live writer, then run the adoption again`, err.lockPath
|
|
53
|
+
: `the permission-rule writer lock ${err.lockPath} refuses the adoption (${err.code}${err.ownerPid !== undefined ? `, held by pid ${err.ownerPid}` : ""}) — stop the live writer, then run the adoption again`, err.lockPath);
|
|
54
54
|
}
|
|
55
55
|
if (lockProbe === undefined)
|
|
56
56
|
throw new Error("the target store refused a write face");
|
|
@@ -9,7 +9,7 @@ import { PERMISSION_RULES_DAMAGED_BUCKET_CODE, PERMISSION_RULES_LATER_GRAMMAR_CO
|
|
|
9
9
|
import { sameOrgPolicyContent } from "../../core/permission-rule-org.js";
|
|
10
10
|
import { SESSION_RULES_GRAMMAR, readRuleGrammarStamp } from "../../core/session-policy-store.js";
|
|
11
11
|
import { canonicalize, textContentHashOf } from "../../core/canonical-json.js";
|
|
12
|
-
import { BootLock, FileStoreLockError, uncheckableOwnerClause } from "./fs-atomic.js";
|
|
12
|
+
import { BootLock, FileStoreLockError, rewordedLockRefusal, uncheckableOwnerClause } from "./fs-atomic.js";
|
|
13
13
|
import { assertAdoptionBootGate } from "./adoption/marker.js";
|
|
14
14
|
import { CONFIG_RECEIPT_MODE, optionKeys, receiptRefusal, receiveMembers, receiveOptions } from "../../core/own-property-receipt.js";
|
|
15
15
|
import { describeFault, receive } from "../../core/mods/kernel/receive.js";
|
|
@@ -219,7 +219,7 @@ function writerLockRefusal(err, onError) {
|
|
|
219
219
|
sentence = `the permission-rule store's writer lock refused (${String(unhandled)})`;
|
|
220
220
|
}
|
|
221
221
|
}
|
|
222
|
-
return
|
|
222
|
+
return rewordedLockRefusal(err, refusalText(onError, sentence, `${err.lockPath}: ${err.message}`), err.lockPath);
|
|
223
223
|
}
|
|
224
224
|
function retireOnlyRefusal(rest) {
|
|
225
225
|
return receiptRefusal(`a listed permission-rule bucket's handle only retires rows (a tighten-delete, and the nextDot its tombstone takes) — ${rest}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sema-agent/core",
|
|
3
|
-
"version": "7.68.
|
|
3
|
+
"version": "7.68.4",
|
|
4
4
|
"description": "Stateless, task-oriented AI agent core",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "BUSL-1.1",
|
|
@@ -107,6 +107,7 @@
|
|
|
107
107
|
"gate:prompt-docs": "node scripts/gen-prompt-docs.mjs --check",
|
|
108
108
|
"gen:prompt-docs": "node scripts/gen-prompt-docs.mjs",
|
|
109
109
|
"gate:backlog-ledger": "node scripts/verify-backlog-ledger.mjs",
|
|
110
|
+
"gate:clearance": "node scripts/verify-clearance.mjs --gate --window",
|
|
110
111
|
"gate:changelog-coverage": "node scripts/verify-changelog-coverage.mjs",
|
|
111
112
|
"gate:changelog-released-blocks": "node scripts/verify-changelog-released-blocks.mjs",
|
|
112
113
|
"gate:changelog-breaking": "node scripts/verify-changelog-breaking.mjs",
|
|
@@ -132,7 +133,7 @@
|
|
|
132
133
|
"dependencies": {
|
|
133
134
|
"@modelcontextprotocol/client": "2.4.0",
|
|
134
135
|
"@modelcontextprotocol/core": "2.4.0",
|
|
135
|
-
"@sema-agent/primitives": "7.68.
|
|
136
|
+
"@sema-agent/primitives": "7.68.4",
|
|
136
137
|
"typebox": "1.1.39",
|
|
137
138
|
"undici": "7.30.2"
|
|
138
139
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_comment": "design/87 L3 — frozen public export surface of src/index.ts (name -> kind). DO NOT edit by hand to silence a red test. A removed/changed entry = a BREAKING change: name every removed entry in the CHANGELOG's BREAKING lines (what was removed / who is hurt / what to read instead) and update this fixture in the SAME commit. Regenerate via REGEN in test/export-surface.test.ts.",
|
|
3
3
|
"_tierComment": "#435 v1 — machine-readable layering of the public surface: stable = demonstrated by README.md / src/examples; internal = an `Internal`-marked name or a runner/engine deep-subtree declaration (the model seam src/engine/llm is excluded — it is the BYOM contract, not an engine internal); advanced = a supported export the front door does not walk you through. THIS IS AN INITIAL HEURISTIC, derived mechanically and expected to be refined ticket by ticket: no human reviewed these 1700+ entries one by one, and nothing here claims otherwise. Known bias: a short or English-word export name (ok, err, Result, Usage) can match ordinary prose in README.md and land `stable` on a coincidence. Every export MUST carry a tier — a new export with no row fails the gate in export-surface.test.ts.",
|
|
4
|
-
"count":
|
|
4
|
+
"count": 3368,
|
|
5
5
|
"exports": {
|
|
6
6
|
"A2ATaskState": "type",
|
|
7
7
|
"A2ATaskStateReversal": "type",
|
|
@@ -545,6 +545,7 @@
|
|
|
545
545
|
"DamagedRowVerdict": "interface",
|
|
546
546
|
"DamagedTaskListItem": "interface",
|
|
547
547
|
"DamagedWorkflowRunSummary": "interface",
|
|
548
|
+
"DataRootDeclaration": "interface",
|
|
548
549
|
"DecidedVia": "type",
|
|
549
550
|
"DecisionReason": "type",
|
|
550
551
|
"DeclarationFault": "interface",
|
|
@@ -2596,6 +2597,7 @@
|
|
|
2596
2597
|
"decideAutoPromote": "function",
|
|
2597
2598
|
"decisionText": "function",
|
|
2598
2599
|
"declareClassAnswers": "function",
|
|
2600
|
+
"declareDataRoot": "function",
|
|
2599
2601
|
"declareWithheldEnv": "function",
|
|
2600
2602
|
"declaredOffSpelling": "function",
|
|
2601
2603
|
"declaredPathTargetOf": "function",
|
|
@@ -3913,6 +3915,7 @@
|
|
|
3913
3915
|
"DamagedRowVerdict": "advanced",
|
|
3914
3916
|
"DamagedTaskListItem": "advanced",
|
|
3915
3917
|
"DamagedWorkflowRunSummary": "advanced",
|
|
3918
|
+
"DataRootDeclaration": "advanced",
|
|
3916
3919
|
"DecidedVia": "advanced",
|
|
3917
3920
|
"DecisionReason": "advanced",
|
|
3918
3921
|
"DeclarationFault": "advanced",
|
|
@@ -5964,6 +5967,7 @@
|
|
|
5964
5967
|
"decideAutoPromote": "advanced",
|
|
5965
5968
|
"decisionText": "advanced",
|
|
5966
5969
|
"declareClassAnswers": "advanced",
|
|
5970
|
+
"declareDataRoot": "advanced",
|
|
5967
5971
|
"declareWithheldEnv": "advanced",
|
|
5968
5972
|
"declaredOffSpelling": "advanced",
|
|
5969
5973
|
"declaredPathTargetOf": "advanced",
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"repo": "core",
|
|
3
|
+
"package": "@sema-agent/core-stores-sql",
|
|
4
|
+
"version": "7.68.3",
|
|
5
|
+
"from": "55c147112bd479cd3898e00829c387d78fdb21f7",
|
|
6
|
+
"to": "v7.68.3",
|
|
7
|
+
"added": [],
|
|
8
|
+
"removed": [],
|
|
9
|
+
"changed": [],
|
|
10
|
+
"subpaths": [],
|
|
11
|
+
"subpathsUnread": [
|
|
12
|
+
"from",
|
|
13
|
+
"to"
|
|
14
|
+
],
|
|
15
|
+
"narrowed": [],
|
|
16
|
+
"faces": {
|
|
17
|
+
"open": [],
|
|
18
|
+
"source": null
|
|
19
|
+
},
|
|
20
|
+
"closedSetMembers": [],
|
|
21
|
+
"closedSetsUnreadable": [],
|
|
22
|
+
"typeKeys": [],
|
|
23
|
+
"typeKeysUnreadableArms": [],
|
|
24
|
+
"typeKeysFlattenedCount": 3,
|
|
25
|
+
"signatures": [],
|
|
26
|
+
"versionLiterals": [],
|
|
27
|
+
"declarationMoves": [],
|
|
28
|
+
"mintMoves": [],
|
|
29
|
+
"criteriaObserves": [],
|
|
30
|
+
"consumersHint": {
|
|
31
|
+
"cli": [],
|
|
32
|
+
"server": [],
|
|
33
|
+
"sdk": [],
|
|
34
|
+
"note": "scanned cli@a51393fd server@027f7b3e4 sdk@6e55f1b — a name listed is MENTIONED there today, which is evidence of consumption, not proof of it"
|
|
35
|
+
},
|
|
36
|
+
"breakingCount": 0,
|
|
37
|
+
"breakingItems": [],
|
|
38
|
+
"toResolvedAt": "d04d328eb407a57a9cc6656453ab8d0422254265"
|
|
39
|
+
}
|