@sema-agent/core 7.16.0 → 7.17.1
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 +209 -0
- package/dist/agents/builtin-agents.d.ts +3 -3
- package/dist/agents/cross-session-envelope.d.ts +0 -1
- package/dist/agents/cross-session-envelope.js +0 -1
- package/dist/agents/peer-notices.d.ts +0 -9
- package/dist/agents/peer-notices.js +0 -63
- package/dist/agents/subagent.js +7 -15
- package/dist/brain/request-params.d.ts +2 -2
- package/dist/config/defaults.d.ts +0 -7
- package/dist/config/defaults.js +0 -2
- package/dist/core/artifact-host.d.ts +218 -0
- package/dist/core/artifact-host.js +92 -0
- package/dist/core/ask-origin.d.ts +29 -3
- package/dist/core/ask-origin.js +17 -9
- package/dist/core/ask-question.d.ts +25 -0
- package/dist/core/ask-question.js +4 -0
- package/dist/core/ask-unresolvable-notice.d.ts +30 -21
- package/dist/core/ask-unresolvable-notice.js +16 -8
- package/dist/core/auto-compaction.d.ts +10 -10
- package/dist/core/auto-mode-arming.d.ts +2 -2
- package/dist/core/background-agent-store.d.ts +5 -5
- package/dist/core/background-shell.d.ts +1 -1
- package/dist/core/checkpoint-execution-record.d.ts +0 -3
- package/dist/core/checkpoint-execution-record.js +0 -4
- package/dist/core/checkpoint-store.d.ts +71 -99
- package/dist/core/checkpoint-store.js +9 -16
- package/dist/core/context-edit.d.ts +36 -104
- package/dist/core/context-edit.js +37 -60
- package/dist/core/effective-path-target.d.ts +68 -8
- package/dist/core/effective-path-target.js +42 -30
- package/dist/core/engine-notice.d.ts +46 -32
- package/dist/core/env-budget.d.ts +31 -0
- package/dist/core/env-budget.js +39 -0
- package/dist/core/exec-output-tail.d.ts +5 -5
- package/dist/core/file-history-store.js +3 -6
- package/dist/core/fs-write-gate-policy.d.ts +1 -1
- package/dist/core/fs-write-gate-policy.js +3 -3
- package/dist/core/gate-lanes.js +9 -15
- package/dist/core/governance-codes.d.ts +1 -1
- package/dist/core/governance-codes.js +2 -0
- package/dist/core/hands-band.d.ts +1 -1
- package/dist/core/hooks.d.ts +18 -17
- package/dist/core/lsp-session.d.ts +1 -1
- package/dist/core/lsp.d.ts +1 -1
- package/dist/core/lsp.js +5 -4
- package/dist/core/mcp.d.ts +5 -5
- package/dist/core/mcp.js +4 -48
- package/dist/core/memory-engine/engine.js +2 -1
- package/dist/core/memory-engine/layout.d.ts +18 -6
- package/dist/core/memory-engine/layout.js +40 -21
- package/dist/core/memory-recall.d.ts +0 -8
- package/dist/core/memory.d.ts +1 -1
- package/dist/core/oracle-isolation.js +2 -2
- package/dist/core/parent-spec-seat.d.ts +66 -0
- package/dist/core/parent-spec-seat.js +47 -0
- package/dist/core/permission-rule-model.d.ts +11 -6
- package/dist/core/permission-rule-model.js +53 -37
- package/dist/core/permission-rules.js +8 -3
- package/dist/core/physical-path.d.ts +37 -0
- package/dist/core/physical-path.js +30 -0
- package/dist/core/protocol-naming.d.ts +2 -2
- package/dist/core/remote-env.d.ts +1 -1
- package/dist/core/retired-keys.d.ts +19 -0
- package/dist/core/retired-keys.js +15 -0
- package/dist/core/runner/active-skill-scope.js +3 -3
- package/dist/core/runner/assemble-result.d.ts +15 -13
- package/dist/core/runner/assemble-result.js +5 -4
- package/dist/core/runner/compaction-call-options.d.ts +25 -89
- package/dist/core/runner/contracts.d.ts +11 -10
- package/dist/core/runner/gate-exit.js +15 -1
- package/dist/core/runner/halt-attribution.d.ts +35 -0
- package/dist/core/runner/halt-attribution.js +16 -0
- package/dist/core/runner/memory-consolidation.d.ts +0 -2
- package/dist/core/runner/memory-consolidation.js +0 -1
- package/dist/core/runner/prepare-artifact.d.ts +52 -0
- package/dist/core/runner/prepare-artifact.js +63 -0
- package/dist/core/runner/prepare-caps-and-workflow.d.ts +4 -2
- package/dist/core/runner/prepare-caps-and-workflow.js +2 -3
- package/dist/core/runner/prepare-config-doors.d.ts +3 -3
- package/dist/core/runner/prepare-config-doors.js +5 -2
- package/dist/core/runner/prepare-context-lane.d.ts +2 -2
- package/dist/core/runner/prepare-context-lane.js +2 -13
- package/dist/core/runner/prepare-file-history.d.ts +1 -1
- package/dist/core/runner/prepare-file-history.js +3 -52
- package/dist/core/runner/prepare-hands-readface.d.ts +4 -7
- package/dist/core/runner/prepare-hands-readface.js +3 -2
- package/dist/core/runner/prepare-inherited-gate.d.ts +5 -2
- package/dist/core/runner/prepare-inherited-gate.js +7 -8
- package/dist/core/runner/prepare-memory.d.ts +4 -6
- package/dist/core/runner/prepare-memory.js +4 -2
- package/dist/core/runner/prepare-policy-chain.d.ts +3 -3
- package/dist/core/runner/prepare-policy-chain.js +15 -30
- package/dist/core/runner/prepare-prompt-assembly.js +1 -1
- package/dist/core/runner/prepare-question-face.js +2 -1
- package/dist/core/runner/prepare-safety-scan.d.ts +1 -1
- package/dist/core/runner/prepare-suspend-saga.js +0 -2
- package/dist/core/runner/prepare-task.js +12 -11
- package/dist/core/runner/prepare-wiring-manifest.js +9 -7
- package/dist/core/runner/resume-admission.js +2 -1
- package/dist/core/runner/resume-internals-and-config.js +4 -0
- package/dist/core/runner/retired-runner-deps.d.ts +3 -0
- package/dist/core/runner/retired-runner-deps.js +7 -0
- package/dist/core/runner/run-harness-handlers.js +5 -3
- package/dist/core/runner/run-settle-and-teardown.d.ts +1 -1
- package/dist/core/runner/run-settle-and-teardown.js +3 -1
- package/dist/core/runner/session-file-state-replay.js +3 -3
- package/dist/core/runner/session-rule-policy.js +3 -4
- package/dist/core/runner/stream-halt-verbs.js +1 -1
- package/dist/core/runner/stream-steer-verb.js +1 -4
- package/dist/core/runner/workspace-path.js +3 -0
- package/dist/core/runner-deps.d.ts +30 -49
- package/dist/core/safe-notify.d.ts +1 -1
- package/dist/core/sensitive-path-policy.d.ts +1 -1
- package/dist/core/sensitive-path-policy.js +11 -12
- package/dist/core/session.d.ts +2 -2
- package/dist/core/skill-tool-specifier.d.ts +1 -1
- package/dist/core/skills-directory.d.ts +1 -1
- package/dist/core/skills-directory.js +4 -3
- package/dist/core/spec-contract.js +5 -4
- package/dist/core/store-contracts/checkpoint-store-contract.js +1 -1
- package/dist/core/strategy-store.d.ts +8 -11
- package/dist/core/task-event.d.ts +20 -17
- package/dist/core/task-limits.d.ts +1 -1
- package/dist/core/task-notification.d.ts +5 -5
- package/dist/core/task-registry-agent.d.ts +5 -5
- package/dist/core/task-registry-monitor.d.ts +2 -2
- package/dist/core/task-registry-shared.d.ts +32 -28
- package/dist/core/task-registry-shared.js +4 -13
- package/dist/core/task-registry.d.ts +8 -8
- package/dist/core/task-result.d.ts +37 -37
- package/dist/core/task-spec.d.ts +5 -5
- package/dist/core/task-stream.d.ts +16 -11
- package/dist/core/tool-catalog-entries.d.ts +1 -0
- package/dist/core/tool-catalog-entries.js +6 -1
- package/dist/core/tool-conformance.d.ts +0 -2
- package/dist/core/tool-conformance.js +1 -3
- package/dist/core/tool-errors.d.ts +5 -0
- package/dist/core/tool-errors.js +1 -0
- package/dist/core/tool-policy.d.ts +66 -22
- package/dist/core/tool-policy.js +31 -5
- package/dist/core/tool-result-budget.d.ts +1 -1
- package/dist/core/tool-result-store.d.ts +11 -11
- package/dist/core/tool-spec.d.ts +34 -38
- package/dist/core/tools.d.ts +2 -2
- package/dist/core/trace.d.ts +12 -15
- package/dist/core/untrusted-text.d.ts +1 -1
- package/dist/core/wiring-manifest.d.ts +4 -3
- package/dist/core/workflow-journal-store.d.ts +11 -11
- package/dist/engine/execution-env/node-execution-env.d.ts +3 -2
- package/dist/engine/execution-env/node-execution-env.js +8 -5
- package/dist/engine/harness/agent-harness.d.ts +47 -4
- package/dist/engine/harness/agent-harness.js +52 -9
- package/dist/engine/loop/agent-loop.js +15 -8
- package/dist/engine/loop/types.d.ts +5 -0
- package/dist/index.d.ts +20 -14
- package/dist/index.js +16 -10
- package/dist/internal/harness.d.ts +1 -0
- package/dist/orchestration/run-spec.d.ts +3 -0
- package/dist/orchestration/run-spec.js +3 -3
- package/dist/orchestration/run-workflow-tool.d.ts +12 -6
- package/dist/orchestration/run-workflow-tool.js +23 -5
- package/dist/orchestration/workflow-primitives.d.ts +4 -2
- package/dist/orchestration/workflow-primitives.js +1 -4
- package/dist/orchestration/workflow-script-store.js +9 -25
- package/dist/orchestration/workflow-types.d.ts +34 -4
- package/dist/orchestration/workflow-types.js +2 -0
- package/dist/orchestration/workflow.d.ts +39 -7
- package/dist/orchestration/workflow.js +237 -113
- package/dist/prompt-assembly/assemble.d.ts +2 -2
- package/dist/prompt-assembly/assemble.js +9 -9
- package/dist/prompt-assembly/composer.d.ts +6 -7
- package/dist/prompt-assembly/composer.js +10 -10
- package/dist/prompt-assembly/epoch.js +1 -1
- package/dist/prompt-assembly/event-registry.d.ts +0 -21
- package/dist/prompt-assembly/packs/sema-default.js +30 -30
- package/dist/prompt-assembly/types.d.ts +14 -14
- package/dist/prompts/coordinator.d.ts +0 -13
- package/dist/prompts/coordinator.js +0 -3
- package/dist/stores/cc/task-list-store.js +2 -10
- package/dist/stores/file/checkpoint-store.js +1 -5
- package/dist/stores/file/file-history-store.js +2 -2
- package/dist/stores/file/fs-atomic.d.ts +15 -18
- package/dist/stores/file/fs-atomic.js +4 -14
- package/dist/stores/file/mailbox-store.d.ts +7 -11
- package/dist/stores/file/mailbox-store.js +4 -11
- package/dist/stores/file/permission-rule-store.d.ts +4 -35
- package/dist/stores/file/permission-rule-store.js +4 -148
- package/dist/tools/artifact/artifact-text.d.ts +62 -0
- package/dist/tools/artifact/artifact-text.js +68 -0
- package/dist/tools/artifact/artifact-tool.d.ts +52 -0
- package/dist/tools/artifact/artifact-tool.js +351 -0
- package/dist/tools/artifact/local-stub.d.ts +26 -0
- package/dist/tools/artifact/local-stub.js +297 -0
- package/dist/tools/fs/bash-readonly-classifier.d.ts +90 -8
- package/dist/tools/fs/bash-readonly-classifier.js +294 -70
- package/dist/tools/fs/fs-bash.d.ts +14 -10
- package/dist/tools/fs/fs-bash.js +50 -33
- package/dist/tools/fs/fs-search-tools.js +5 -2
- package/dist/tools/fs/fs-shared.d.ts +2 -0
- package/dist/tools/fs/fs-shared.js +3 -11
- package/dist/tools/fs/index.d.ts +4 -0
- package/dist/tools/fs/index.js +4 -1
- package/dist/tools/fs/safety.d.ts +117 -1
- package/dist/tools/fs/safety.js +131 -31
- package/dist/tools/fs/search.js +8 -6
- package/package.json +2 -1
- package/test/export-surface.snapshot.json +119 -39
|
@@ -1,5 +1,15 @@
|
|
|
1
|
+
export const ASK_UNRESOLVABLE_CAUSES = ["approver_unavailable", "no_approver_wired", "mandate_unreconstructible"];
|
|
2
|
+
const ASK_UNRESOLVABLE_CAUSE_SET = new Set(ASK_UNRESOLVABLE_CAUSES);
|
|
3
|
+
export function isAskUnresolvableCause(v) {
|
|
4
|
+
return ASK_UNRESOLVABLE_CAUSE_SET.has(v);
|
|
5
|
+
}
|
|
6
|
+
const CAUSE_CLAUSE = {
|
|
7
|
+
approver_unavailable: "the approver reported that nobody is reachable for this ask",
|
|
8
|
+
no_approver_wired: "no approver (or question face) is wired for this run — the headless posture",
|
|
9
|
+
mandate_unreconstructible: "an inherited durable-approval mandate binds this ask and this leg has no park facility to honor it",
|
|
10
|
+
};
|
|
1
11
|
export function askUnresolvableNotice(facts) {
|
|
2
|
-
const { sessionId, toolName, toolCallId,
|
|
12
|
+
const { sessionId, toolName, toolCallId, cause, parkLaneExisted } = facts;
|
|
3
13
|
if (typeof sessionId !== "string" || sessionId.length === 0) {
|
|
4
14
|
throw new TypeError("delegation.ask_unresolvable: sessionId is required — a user-audience notice with no session routes nowhere");
|
|
5
15
|
}
|
|
@@ -9,17 +19,15 @@ export function askUnresolvableNotice(facts) {
|
|
|
9
19
|
if (typeof toolCallId !== "string" || toolCallId.length === 0) {
|
|
10
20
|
throw new TypeError("delegation.ask_unresolvable: toolCallId is required");
|
|
11
21
|
}
|
|
12
|
-
if (
|
|
13
|
-
throw new TypeError(`delegation.ask_unresolvable:
|
|
22
|
+
if (!isAskUnresolvableCause(cause)) {
|
|
23
|
+
throw new TypeError(`delegation.ask_unresolvable: cause ${JSON.stringify(cause)} is not one of ${ASK_UNRESOLVABLE_CAUSES.join("/")}`);
|
|
14
24
|
}
|
|
15
|
-
const park = parkLaneExisted
|
|
16
|
-
? "the durable approval park did not take it"
|
|
17
|
-
: "no durable approval park is armed for this run";
|
|
25
|
+
const park = parkLaneExisted ? "the durable approval park did not take it" : "no durable approval park is armed for this run";
|
|
18
26
|
return {
|
|
19
27
|
code: "delegation.ask_unresolvable",
|
|
20
|
-
message: `approval for "${toolName}" could not be resolved:
|
|
28
|
+
message: `approval for "${toolName}" could not be resolved: ${CAUSE_CLAUSE[cause]} and ${park} — ` +
|
|
21
29
|
`the call was denied fail-closed and did not run. To let such approvals wait for a person, run with a checkpoint store and a ` +
|
|
22
30
|
`durable approval opt-in (or a live approver reachable for delegated children).`,
|
|
23
|
-
detail: { sessionId, toolName, toolCallId,
|
|
31
|
+
detail: { sessionId, toolName, toolCallId, cause, parkLaneExisted: parkLaneExisted === true },
|
|
24
32
|
};
|
|
25
33
|
}
|
|
@@ -99,7 +99,7 @@ export interface CompactionForkContext {
|
|
|
99
99
|
modelId?: string;
|
|
100
100
|
}
|
|
101
101
|
export interface MaybeCompactOptions {
|
|
102
|
-
/**
|
|
102
|
+
/** Disclosure channel for CONTAINED host-callback failures in this scope (the RB-463
|
|
103
103
|
* isolation primitive's bounded first-failure per site). Absent ⇒ failures are counted only. */
|
|
104
104
|
onNotifyError?: (failure: import("./safe-notify.js").SafeNotifyFailure) => void;
|
|
105
105
|
/** The session to compact. Typed on the INTERFACE face (typecheck 车 2026-07-24): every member this
|
|
@@ -109,7 +109,7 @@ export interface MaybeCompactOptions {
|
|
|
109
109
|
* the compaction-boundary epoch restatement/advance must hash the SAME artifact identity as the
|
|
110
110
|
* prepare-time pin, or every compaction under a declaration-carrying run would flap the pin. */
|
|
111
111
|
epochDeclaredSections?: import("../prompt-assembly/epoch.js").EpochDeclaredSections;
|
|
112
|
-
/**
|
|
112
|
+
/** A compaction-boundary CENTER CANDIDATE ADOPTION, pre-assembled by the
|
|
113
113
|
* caller (prepare's seam): the descriptor advances with the candidate's declarations + provenance
|
|
114
114
|
* in the SAME CAS append as the new baseline, and `apply()` (the live prefix/fingerprint swap)
|
|
115
115
|
* runs ONLY after that append succeeded — a failed/blocked compaction must swap nothing. */
|
|
@@ -160,7 +160,7 @@ export interface MaybeCompactOptions {
|
|
|
160
160
|
* including the preCompact hook's additions, gets the same treatment). */
|
|
161
161
|
customInstructions?: string;
|
|
162
162
|
/**
|
|
163
|
-
*
|
|
163
|
+
* The user's / project's own INSTRUCTION-FILE content (the CLAUDE.md family this
|
|
164
164
|
* deployment loads into an ordinary session), for the INDEPENDENT summary form.
|
|
165
165
|
*
|
|
166
166
|
* Why it needs a seat at all: the summarization prompt carries CC's closing invitation to follow
|
|
@@ -300,7 +300,7 @@ export interface MaybeCompactOptions {
|
|
|
300
300
|
*/
|
|
301
301
|
instructionSourcePaths?: ReadonlyArray<string>;
|
|
302
302
|
/**
|
|
303
|
-
*
|
|
303
|
+
* `recentlyReadFiles` yields CANONICAL keys (resolveKey
|
|
304
304
|
* output — the same coordinate `ReadFileState` is keyed in), but `instructionSourcePaths` and the
|
|
305
305
|
* kept-tail scan inside `maybeCompact` (which reads raw tool-call arguments via
|
|
306
306
|
* `extractFileOpsFromMessage`) do NOT share that coordinate — a model-typed relative path and its
|
|
@@ -315,7 +315,7 @@ export interface MaybeCompactOptions {
|
|
|
315
315
|
*/
|
|
316
316
|
normalizePath?: (raw: string) => Promise<string>;
|
|
317
317
|
/**
|
|
318
|
-
*
|
|
318
|
+
* A kept-tail Read tool-CALL's mere presence does not prove the
|
|
319
319
|
* file's real content is visible there: its toolRESULT may be a dedup stub ("unchanged since you
|
|
320
320
|
* last read it…") whose ORIGINAL full transmission sits in the summarized prefix THIS compaction is
|
|
321
321
|
* about to cut away — preserving read-state for such a path would leave both the kept tail and the
|
|
@@ -328,14 +328,14 @@ export interface MaybeCompactOptions {
|
|
|
328
328
|
isDedupStubResult?: (resultText: string) => boolean;
|
|
329
329
|
};
|
|
330
330
|
/**
|
|
331
|
-
*
|
|
331
|
+
* Fires ONCE per LANDED compaction (after `appendCompaction` committed the new baseline), with the
|
|
332
332
|
* files that were attached WHOLE (untruncated) into the summary. The Runner wires this to the read-state
|
|
333
333
|
* invalidation (`applyCompactionToReadFileState`): the summary just replaced the history the read-dedup
|
|
334
334
|
* stubs point at, so stale entries must drop and the re-attached content re-registers. Kept OUTSIDE
|
|
335
335
|
* `workingFileAttachments` deliberately — the invalidation is owed even when attachments are disabled
|
|
336
336
|
* (an empty array then). Best-effort: a throwing callback must not fail the landed compaction.
|
|
337
337
|
*
|
|
338
|
-
*
|
|
338
|
+
* `preserveReadState`:
|
|
339
339
|
* canonical-coordinate paths (same shape as `normalizePath`'s output) whose read-state entry must
|
|
340
340
|
* survive the compaction's clear even though they are NOT in `attachedComplete` — every file
|
|
341
341
|
* `maybeCompact` deliberately skipped re-attaching, for EITHER exclusion reason (kept-tail-visible,
|
|
@@ -474,7 +474,7 @@ export interface MaybeCompactOptions {
|
|
|
474
474
|
keptChars: number;
|
|
475
475
|
}) => void;
|
|
476
476
|
/**
|
|
477
|
-
*
|
|
477
|
+
* The design/36 ToolSearch activation set LIVE at this pass (the
|
|
478
478
|
* runner threads `[...prepared.activeTools]` on all three lanes: boundary, PTL recovery, finish).
|
|
479
479
|
* Persisted into the landed compaction entry's details (`CompactionDetails.activeTools`) so the
|
|
480
480
|
* NEXT task boundary's re-derivation — whose transcript source (ToolSearch toolCall parts) this
|
|
@@ -510,7 +510,7 @@ export declare function maybeCompact(opts: MaybeCompactOptions): Promise<{
|
|
|
510
510
|
* (`enabled:false`) — the request can never be honored this run. Lets the caller resolve a manual
|
|
511
511
|
* /compact with the honest `"disabled"` outcome (and trace frame) instead of a structural noop. */
|
|
512
512
|
disabled?: boolean;
|
|
513
|
-
/**
|
|
513
|
+
/** Set (with `compacted:false`) when the pass PASSED the trigger gate
|
|
514
514
|
* (natural or forced) but found nothing to summarize — no valid cut point / empty history. Was
|
|
515
515
|
* previously indistinguishable from the quiet under-threshold return, so a forced pass with
|
|
516
516
|
* nothing to do looked identical to one that never wanted to run; the caller's outcome event
|
|
@@ -597,7 +597,7 @@ export declare function maybeCompact(opts: MaybeCompactOptions): Promise<{
|
|
|
597
597
|
modelId?: string;
|
|
598
598
|
};
|
|
599
599
|
/**
|
|
600
|
-
*
|
|
600
|
+
* The trigger inputs THIS pass used, reported on
|
|
601
601
|
* EVERY return path — including the ordinary "nothing to do" one. A consumer rendering "how full is the
|
|
602
602
|
* context" was otherwise forced to re-derive the numerator itself, and a re-derivation that drifts from
|
|
603
603
|
* the engine's own is the projection-antipattern this repo keeps paying for: the displayed percentage
|
|
@@ -29,7 +29,7 @@ export interface AutoModeArmingRecipe {
|
|
|
29
29
|
/** Classify round-trip cap, ms. */
|
|
30
30
|
timeoutMs?: number;
|
|
31
31
|
/**
|
|
32
|
-
*
|
|
32
|
+
* The classifier DENIAL-LIMIT bounds (`RunnerDeps.autoMode.denialLimit`, CC 2.1.250 `FO`/`AKe`):
|
|
33
33
|
* how many blocks the ancestor's classifier was allowed before a person had to look, and the window the
|
|
34
34
|
* fallback ask ran under. A KNOB triple, not prompt body — every member is orderable, so the fold takes
|
|
35
35
|
* the strictest of the two sides rather than refusing on a difference.
|
|
@@ -87,7 +87,7 @@ export interface AutoModeArmingFace {
|
|
|
87
87
|
crossSessionMessagesRule?: boolean;
|
|
88
88
|
}
|
|
89
89
|
/**
|
|
90
|
-
*
|
|
90
|
+
* The ONE tighten rule for the denial-limit bounds, shared by {@link foldAutoModeArming} and by
|
|
91
91
|
* the runner's rebuilt-tracker mint (a second computation of "the strictest of these two" is how the
|
|
92
92
|
* recipe's account and the tracker's actual bounds would come to disagree). Both sides' EFFECTIVE values
|
|
93
93
|
* are materialized first (an omitted bound is the default the tracker applies, never "unbounded" — the
|
|
@@ -104,18 +104,18 @@ export interface BackgroundAgentRecord {
|
|
|
104
104
|
parkClaimId?: string;
|
|
105
105
|
summary?: string;
|
|
106
106
|
finalOutput?: string;
|
|
107
|
-
/**
|
|
107
|
+
/** The FULL result (workflow.ts NH-1 shape via {@link BackgroundAgentTaskHandle.resultFull}),
|
|
108
108
|
* set only when it differs from `finalOutput` — the restart/durable-fallback poll path needs the same
|
|
109
109
|
* pairing the live handle carries, or a process restart loses the very recoverability this field exists
|
|
110
110
|
* to preserve. */
|
|
111
111
|
finalOutputFull?: string;
|
|
112
112
|
/** The child's failure text (registry `handle.error` mirror; the reap-stop sentinel never lands here).
|
|
113
|
-
*
|
|
113
|
+
* The stale-running reap flip ALSO writes its attribution here (`??`-guarded) —
|
|
114
114
|
* `error` is the field the durable serving face renders (`serveDurableAgentRow`), while `summary`
|
|
115
115
|
* has no reader on that face, so an attribution written only to `summary` was invisible: a host
|
|
116
116
|
* crash read as a bare `failed` + "(no result text)". */
|
|
117
117
|
error?: string;
|
|
118
|
-
/**
|
|
118
|
+
/** The classification triplet the in-memory handle carries under
|
|
119
119
|
* the SAME names (`errorCode`/`errorRetryable`/`errorKind`; see RB-386②/RB-405 G3 on
|
|
120
120
|
* {@link import("./task-registry-shared.js").BackgroundAgentTaskHandle}), written to this row at the
|
|
121
121
|
* same terminal write that lands `error` — so a cross-restart fallback read
|
|
@@ -146,7 +146,7 @@ export interface BackgroundAgentRecord {
|
|
|
146
146
|
rev: number;
|
|
147
147
|
}
|
|
148
148
|
/**
|
|
149
|
-
*
|
|
149
|
+
* The terminal payload a REVIVAL must erase from the row it is re-launching, as ONE list.
|
|
150
150
|
*
|
|
151
151
|
* A revived handle starts a fresh cycle on an existing row: status flips back to `running`, but every
|
|
152
152
|
* field describing how the PREVIOUS cycle ended is still sitting there. Left standing, each one
|
|
@@ -249,7 +249,7 @@ export declare function canAccessAgentRecord(record: Pick<BackgroundAgentRecord,
|
|
|
249
249
|
* terminal-looking row whose rev the flush has not yet bumped. In-process sweeps are gated on the
|
|
250
250
|
* live handle; cross-process revival (S3) must claim-CAS FIRST (see {@link BackgroundAgentRecord.writerId}).
|
|
251
251
|
*/
|
|
252
|
-
/**
|
|
252
|
+
/** The stale-running reap flip's attribution, written to BOTH `summary` (legacy
|
|
253
253
|
* slot, kept for any out-of-repo reader) and `error` (the field {@link canAccessAgentRecord}-gated
|
|
254
254
|
* durable serving actually renders). One exported constant so the two store implementations (in-memory
|
|
255
255
|
* here, file twin) can never drift apart (RB-74/RB-111 family). Wording carries CC 2.1.220's three
|
|
@@ -133,7 +133,7 @@ export interface BackgroundShellCapability {
|
|
|
133
133
|
*/
|
|
134
134
|
export declare function hasBackgroundShell(env: ExecutionEnv): env is ExecutionEnv & BackgroundShellCapability;
|
|
135
135
|
/**
|
|
136
|
-
*
|
|
136
|
+
* The ONE way core runs an env-level background sweep.
|
|
137
137
|
*
|
|
138
138
|
* ## Why a single entry point
|
|
139
139
|
* `disposeBackgroundShells` lives in the execution-env layer and cannot reach the task registry, so the
|
|
@@ -24,9 +24,6 @@ import type { GateOutcome } from "./gate-outcome.js";
|
|
|
24
24
|
*/
|
|
25
25
|
export declare const EXECUTION_OUTCOME_RECORD_WORDS: readonly ["recorded", "already_recorded", "not_resolved", "absent"];
|
|
26
26
|
export type ExecutionOutcomeRecordWord = (typeof EXECUTION_OUTCOME_RECORD_WORDS)[number];
|
|
27
|
-
/** Membership test for {@link ExecutionOutcomeRecordWord} — a deployment store answers across a process
|
|
28
|
-
* boundary, so the consumer validating its word must not hand-roll the set. */
|
|
29
|
-
export declare function isExecutionOutcomeRecordWord(v: unknown): v is ExecutionOutcomeRecordWord;
|
|
30
27
|
/**
|
|
31
28
|
* The one disposition table over {@link ExecutionOutcomeRecordWord}: does this answer mean the row now
|
|
32
29
|
* carries NO execution record — i.e. the leg's disposition of the decided action is not on file? The
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import {} from "./ask-origin.js";
|
|
2
2
|
export const EXECUTION_OUTCOME_RECORD_WORDS = ["recorded", "already_recorded", "not_resolved", "absent"];
|
|
3
|
-
const EXECUTION_OUTCOME_RECORD_WORD_SET = new Set(EXECUTION_OUTCOME_RECORD_WORDS);
|
|
4
|
-
export function isExecutionOutcomeRecordWord(v) {
|
|
5
|
-
return EXECUTION_OUTCOME_RECORD_WORD_SET.has(v);
|
|
6
|
-
}
|
|
7
3
|
export const EXECUTION_RECORD_LEAVES_ROW_UNRECORDED = {
|
|
8
4
|
recorded: false,
|
|
9
5
|
already_recorded: false,
|