@oyasmi/pipiclaw 0.9.5-beta.2 → 0.9.5-beta.3
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/README.en.md +9 -11
- package/README.md +9 -11
- package/dist/agent/channel-runner.d.ts +12 -24
- package/dist/agent/channel-runner.js +74 -30
- package/dist/agent/maintenance-context.d.ts +2 -0
- package/dist/agent/maintenance-context.js +15 -0
- package/dist/agent/prompt/sections.js +8 -6
- package/dist/agent/prompt/types.d.ts +1 -1
- package/dist/agent/runner-factory.js +1 -1
- package/dist/agent/session/command-extension.js +11 -0
- package/dist/agent/session/compaction-summary.js +6 -2
- package/dist/agent/session/execution-trace.d.ts +14 -0
- package/dist/agent/session/execution-trace.js +57 -0
- package/dist/agent/session/session-events.d.ts +2 -7
- package/dist/agent/session/session-events.js +35 -12
- package/dist/agent/session/session-host.d.ts +12 -22
- package/dist/agent/session/session-host.js +46 -65
- package/dist/agent/turn/task-digest.d.ts +1 -2
- package/dist/agent/turn/task-digest.js +33 -33
- package/dist/agent/turn/turn-context.d.ts +1 -1
- package/dist/agent/turn/turn-context.js +1 -1
- package/dist/agent/turn/turn-finish.d.ts +2 -2
- package/dist/agent/turn/turn-finish.js +3 -2
- package/dist/agent/turn/turn-pipeline.d.ts +4 -2
- package/dist/agent/turn/turn-pipeline.js +33 -5
- package/dist/agent/types.d.ts +64 -14
- package/dist/agent/types.js +3 -0
- package/dist/app/home.js +3 -4
- package/dist/channel/channel-event.d.ts +4 -12
- package/dist/channel/ingress.d.ts +1 -9
- package/dist/channel/store.d.ts +1 -1
- package/dist/commands/catalog.js +25 -19
- package/dist/commands/router.d.ts +5 -2
- package/dist/commands/router.js +9 -4
- package/dist/config/settings.d.ts +5 -12
- package/dist/config/settings.js +0 -7
- package/dist/config/tools.d.ts +2 -2
- package/dist/config/tools.js +2 -2
- package/dist/dingtalk/bot.d.ts +2 -0
- package/dist/dingtalk/bot.js +4 -0
- package/dist/dingtalk/cards.d.ts +7 -0
- package/dist/dingtalk/cards.js +32 -2
- package/dist/dingtalk/delivery.d.ts +5 -1
- package/dist/dingtalk/delivery.js +157 -142
- package/dist/dingtalk/progress.d.ts +55 -6
- package/dist/dingtalk/progress.js +195 -16
- package/dist/file-store.d.ts +4 -0
- package/dist/file-store.js +6 -1
- package/dist/jobs/completion-observer.d.ts +20 -0
- package/dist/jobs/completion-observer.js +107 -0
- package/dist/jobs/completion-signal.d.ts +9 -0
- package/dist/jobs/completion-signal.js +32 -0
- package/dist/jobs/completion-wake.d.ts +1 -1
- package/dist/jobs/completion-wake.js +2 -13
- package/dist/jobs/manager.d.ts +11 -29
- package/dist/jobs/manager.js +103 -176
- package/dist/jobs/probe.d.ts +3 -0
- package/dist/jobs/probe.js +42 -0
- package/dist/jobs/record.d.ts +3 -6
- package/dist/jobs/runtime.d.ts +28 -0
- package/dist/jobs/runtime.js +69 -0
- package/dist/memory/boundary-work.d.ts +2 -0
- package/dist/memory/boundary-work.js +79 -37
- package/dist/memory/commands.js +4 -1
- package/dist/memory/index-budget.js +18 -15
- package/dist/memory/journal.js +2 -1
- package/dist/memory/lifecycle.d.ts +4 -8
- package/dist/memory/lifecycle.js +21 -51
- package/dist/memory/reflect-job.d.ts +0 -6
- package/dist/memory/reflect-job.js +13 -34
- package/dist/memory/reflect.d.ts +4 -0
- package/dist/memory/reflect.js +32 -5
- package/dist/memory/review-log.d.ts +13 -0
- package/dist/memory/review-log.js +49 -0
- package/dist/memory/search.js +7 -4
- package/dist/memory/source-window.d.ts +18 -1
- package/dist/memory/source-window.js +59 -9
- package/dist/memory/store.d.ts +2 -0
- package/dist/memory/store.js +45 -13
- package/dist/playbooks/agent-delegation.md +10 -4
- package/dist/playbooks/background-jobs.md +4 -4
- package/dist/playbooks/event-scheduling.md +2 -2
- package/dist/playbooks/memory-and-learning.md +3 -3
- package/dist/playbooks/outbound-media.md +2 -2
- package/dist/playbooks/runtime-orientation.md +10 -6
- package/dist/playbooks/task-lead.md +54 -33
- package/dist/runtime/bootstrap.d.ts +11 -24
- package/dist/runtime/bootstrap.js +92 -59
- package/dist/runtime/channel-queue.d.ts +2 -0
- package/dist/runtime/channel-queue.js +5 -1
- package/dist/runtime/durable-dispatch.d.ts +7 -0
- package/dist/runtime/durable-dispatch.js +66 -7
- package/dist/runtime/ingress-busy.d.ts +1 -2
- package/dist/runtime/ingress-busy.js +2 -35
- package/dist/runtime/ingress-commands.d.ts +1 -1
- package/dist/runtime/ingress-commands.js +28 -20
- package/dist/runtime/ingress-deps.d.ts +4 -7
- package/dist/runtime/ingress.js +23 -13
- package/dist/runtime/shutdown.d.ts +1 -1
- package/dist/runtime/shutdown.js +2 -2
- package/dist/runtime/task-close.d.ts +4 -0
- package/dist/runtime/task-close.js +102 -0
- package/dist/runtime/task-control.d.ts +34 -0
- package/dist/runtime/task-control.js +225 -0
- package/dist/runtime/task-input.d.ts +13 -0
- package/dist/runtime/task-input.js +129 -0
- package/dist/runtime/task-lane-types.d.ts +123 -0
- package/dist/runtime/task-lane-types.js +14 -0
- package/dist/runtime/task-lane.d.ts +99 -0
- package/dist/runtime/task-lane.js +703 -0
- package/dist/runtime/task-pending.d.ts +8 -0
- package/dist/runtime/task-pending.js +40 -0
- package/dist/runtime/task-spawn.d.ts +4 -4
- package/dist/runtime/task-spawn.js +4 -4
- package/dist/runtime/task-step.d.ts +32 -0
- package/dist/runtime/task-step.js +276 -0
- package/dist/runtime/turn-run.d.ts +4 -16
- package/dist/runtime/turn-run.js +17 -155
- package/dist/runtime/wake-coalescing.d.ts +1 -3
- package/dist/runtime/wake-coalescing.js +2 -4
- package/dist/shared/format.d.ts +0 -6
- package/dist/shared/format.js +0 -17
- package/dist/shared/host-process.d.ts +2 -0
- package/dist/shared/host-process.js +16 -1
- package/dist/shared/jsonl-appender.d.ts +5 -0
- package/dist/shared/jsonl-appender.js +25 -2
- package/dist/skills/catalog.d.ts +9 -0
- package/dist/skills/catalog.js +34 -0
- package/dist/skills/commands.d.ts +3 -12
- package/dist/skills/commands.js +36 -22
- package/dist/skills/loader.d.ts +2 -31
- package/dist/skills/loader.js +101 -68
- package/dist/skills/roots.d.ts +12 -0
- package/dist/skills/roots.js +18 -0
- package/dist/skills/types.d.ts +24 -0
- package/dist/skills/types.js +1 -0
- package/dist/subagents/completion-wake.js +0 -10
- package/dist/subagents/discovery.d.ts +1 -1
- package/dist/subagents/discovery.js +10 -16
- package/dist/subagents/dispatch.js +8 -16
- package/dist/subagents/external/cursor-cli.d.ts +2 -0
- package/dist/subagents/external/cursor-cli.js +256 -0
- package/dist/subagents/external/harness.d.ts +5 -5
- package/dist/subagents/external/reconciliation.d.ts +7 -0
- package/dist/subagents/external/reconciliation.js +105 -0
- package/dist/subagents/external/recovery.d.ts +20 -0
- package/dist/subagents/external/recovery.js +71 -0
- package/dist/subagents/external/registry.js +2 -0
- package/dist/subagents/external/role-warnings.d.ts +17 -0
- package/dist/subagents/external/role-warnings.js +42 -0
- package/dist/subagents/external/run.js +18 -22
- package/dist/subagents/format.d.ts +1 -1
- package/dist/subagents/format.js +1 -1
- package/dist/subagents/grace.d.ts +2 -2
- package/dist/subagents/grace.js +3 -3
- package/dist/subagents/internal/run.js +7 -5
- package/dist/subagents/internal/worker.js +31 -2
- package/dist/subagents/result.js +2 -3
- package/dist/subagents/run-record.d.ts +4 -7
- package/dist/subagents/run-record.js +2 -2
- package/dist/subagents/runs.d.ts +33 -46
- package/dist/subagents/runs.js +126 -245
- package/dist/subagents/task-settlement.d.ts +3 -0
- package/dist/subagents/task-settlement.js +20 -0
- package/dist/subagents/types.d.ts +1 -2
- package/dist/subagents/workspace-summary.js +5 -1
- package/dist/tasks/archive.d.ts +11 -0
- package/dist/tasks/archive.js +141 -0
- package/dist/tasks/board.d.ts +5 -12
- package/dist/tasks/board.js +4 -30
- package/dist/tasks/bound-work.d.ts +12 -6
- package/dist/tasks/bound-work.js +37 -24
- package/dist/tasks/brief.d.ts +38 -14
- package/dist/tasks/brief.js +128 -70
- package/dist/tasks/budget.d.ts +3 -3
- package/dist/tasks/budget.js +9 -4
- package/dist/tasks/commands.d.ts +14 -9
- package/dist/tasks/commands.js +190 -121
- package/dist/tasks/completion.d.ts +12 -0
- package/dist/tasks/completion.js +35 -0
- package/dist/tasks/contract.d.ts +8 -17
- package/dist/tasks/contract.js +41 -43
- package/dist/tasks/control.d.ts +138 -0
- package/dist/tasks/control.js +1 -0
- package/dist/tasks/create.d.ts +1 -1
- package/dist/tasks/create.js +3 -3
- package/dist/tasks/delivery.d.ts +24 -0
- package/dist/tasks/delivery.js +221 -0
- package/dist/tasks/file-mutation.d.ts +5 -0
- package/dist/tasks/file-mutation.js +38 -0
- package/dist/tasks/frontmatter.d.ts +43 -28
- package/dist/tasks/frontmatter.js +83 -40
- package/dist/tasks/input-receipts.d.ts +7 -0
- package/dist/tasks/input-receipts.js +60 -0
- package/dist/tasks/loop-log.d.ts +147 -28
- package/dist/tasks/loop-log.js +239 -28
- package/dist/tasks/receipts.d.ts +19 -0
- package/dist/tasks/receipts.js +48 -0
- package/dist/tasks/state.d.ts +93 -0
- package/dist/tasks/state.js +156 -0
- package/dist/tasks/store.d.ts +81 -49
- package/dist/tasks/store.js +244 -147
- package/dist/tools/bash.d.ts +3 -5
- package/dist/tools/bash.js +8 -22
- package/dist/tools/contract/details.d.ts +6 -6
- package/dist/tools/contract/details.js +6 -6
- package/dist/tools/contract/execution-trace.d.ts +4 -0
- package/dist/tools/contract/execution-trace.js +23 -0
- package/dist/tools/contract/presentation.js +6 -2
- package/dist/tools/edit.d.ts +1 -0
- package/dist/tools/edit.js +45 -42
- package/dist/tools/index.d.ts +8 -12
- package/dist/tools/index.js +16 -6
- package/dist/tools/memory-manage.js +8 -1
- package/dist/tools/registry.d.ts +7 -11
- package/dist/tools/registry.js +52 -25
- package/dist/tools/skill.d.ts +2 -2
- package/dist/tools/skill.js +24 -10
- package/dist/tools/subagent-manage.js +7 -4
- package/dist/tools/subagent.d.ts +0 -2
- package/dist/tools/subagent.js +2 -7
- package/dist/tools/task-manage/control-tools.d.ts +4 -0
- package/dist/tools/task-manage/control-tools.js +65 -0
- package/dist/tools/task-manage/create.js +2 -1
- package/dist/tools/task-manage/factory.d.ts +12 -6
- package/dist/tools/task-manage/factory.js +72 -57
- package/dist/tools/task-manage/lifecycle.d.ts +7 -12
- package/dist/tools/task-manage/lifecycle.js +118 -66
- package/dist/tools/task-manage/log-view.js +8 -5
- package/dist/tools/task-manage/schema.d.ts +21 -26
- package/dist/tools/task-manage/schema.js +29 -35
- package/dist/tools/task-manage/shared.d.ts +8 -39
- package/dist/tools/task-manage/shared.js +19 -68
- package/dist/tools/task-manage/step-tools.d.ts +5 -0
- package/dist/tools/task-manage/step-tools.js +103 -0
- package/dist/tools/task-manage/types.d.ts +25 -18
- package/dist/tools/write-content.d.ts +1 -0
- package/dist/tools/write-content.js +6 -1
- package/dist/tools/write.d.ts +1 -0
- package/dist/tools/write.js +1 -0
- package/dist/usage/ledger.d.ts +4 -4
- package/dist/usage/render.js +2 -2
- package/dist/web/search-providers.js +0 -33
- package/dist/webapi/request-policy.js +1 -1
- package/examples/sub-agents/README.md +23 -16
- package/examples/sub-agents/agents/claude-high.md +1 -1
- package/examples/sub-agents/agents/claude-main.md +1 -1
- package/examples/sub-agents/agents/codex-flash.md +1 -1
- package/examples/sub-agents/agents/codex-high.md +1 -1
- package/examples/sub-agents/agents/codex-main.md +4 -4
- package/examples/sub-agents/agents/cursor-high.md +22 -0
- package/examples/sub-agents/agents/cursor-main.md +22 -0
- package/examples/sub-agents/agents/glm-flash.md +1 -1
- package/examples/sub-agents/agents/glm-high.md +2 -2
- package/examples/sub-agents/agents/scout.md +30 -0
- package/package.json +6 -6
- package/dist/runtime/task-driver.d.ts +0 -116
- package/dist/runtime/task-driver.js +0 -443
- package/dist/runtime/task-wake.d.ts +0 -48
- package/dist/runtime/task-wake.js +0 -32
- package/dist/shared/wake-claim.d.ts +0 -23
- package/dist/shared/wake-claim.js +0 -26
- package/dist/skills/validation.d.ts +0 -8
- package/dist/skills/validation.js +0 -91
- package/dist/skills/workspace.d.ts +0 -33
- package/dist/skills/workspace.js +0 -116
- package/dist/tasks/steer.d.ts +0 -8
- package/dist/tasks/steer.js +0 -81
- package/dist/tasks/ticket.d.ts +0 -71
- package/dist/tasks/ticket.js +0 -138
- package/dist/tools/task-manage/step-end.d.ts +0 -11
- package/dist/tools/task-manage/step-end.js +0 -117
package/dist/subagents/runs.d.ts
CHANGED
|
@@ -2,6 +2,18 @@ import type { WakeEvent } from "../channel/channel-event.js";
|
|
|
2
2
|
import type { ChannelStore } from "../channel/store.js";
|
|
3
3
|
import type { UsageLedger } from "../usage/ledger.js";
|
|
4
4
|
import { type RegisterRunInput, type RunNotifier, type RunRecord, type RunResolution, type RunStatus, type SettleInput } from "./run-record.js";
|
|
5
|
+
/**
|
|
6
|
+
* The run: one abstraction level for delegation, whether it executes as an in-process sub-agent
|
|
7
|
+
* or (from spec 040 phase 2 onward) a short-lived external CLI process. See
|
|
8
|
+
* `docs/archive/specs/040-async-delegation-and-external-agents/design.md`, D1.
|
|
9
|
+
*
|
|
10
|
+
* State machine vocabulary is borrowed from `jobs/manager.ts`'s `JobStatus` rather than inventing
|
|
11
|
+
* a second one. Only three facts are persisted as idempotent markers (D1/P5) because only three
|
|
12
|
+
* side effects cannot be safely replayed: settling (writes output, frees a lease), recording
|
|
13
|
+
* usage (a ledger write is a real charge), and enqueuing the completion wake (redelivery makes
|
|
14
|
+
* the parent agent re-process the same result). Everything else — duration, tool counts, verdict
|
|
15
|
+
* — is plain data that can be overwritten harmlessly.
|
|
16
|
+
*/
|
|
5
17
|
export interface RunManagerOptions {
|
|
6
18
|
/** Root of the per-desk record directories (`<stateDir>/<desk>/`). Omit to skip persistence. */
|
|
7
19
|
stateDir?: string;
|
|
@@ -11,10 +23,17 @@ export interface RunManagerOptions {
|
|
|
11
23
|
/** Best-effort out-of-band notice sink (see `RunNotice`). Never awaited by settlement or the
|
|
12
24
|
* progress tail — a slow or failing notifier must not delay either. */
|
|
13
25
|
notify?: RunNotifier;
|
|
26
|
+
/**
|
|
27
|
+
* A task-bound run settled or went quiet: its record is already in the task's log. The lane
|
|
28
|
+
* recomputes from it (spec 064, D19) — this replaces the completion wake a task-bound run used to
|
|
29
|
+
* send through the channel.
|
|
30
|
+
*/
|
|
31
|
+
onTaskInput?: (desk: string, taskId: string) => void;
|
|
14
32
|
ledger?: UsageLedger;
|
|
15
33
|
store?: ChannelStore;
|
|
16
34
|
/** Application-wide admission count, supplied by the owning runtime. */
|
|
17
35
|
runningCount?: () => number;
|
|
36
|
+
adoptedCheckIntervalMs?: number;
|
|
18
37
|
}
|
|
19
38
|
/**
|
|
20
39
|
* Per-desk manager for delegation runs — the single settlement/usage/wake authority for both
|
|
@@ -33,9 +52,8 @@ export declare class SubAgentRunManager {
|
|
|
33
52
|
/** External launch intents exist before a safe live child handle does. A cancel in that window
|
|
34
53
|
* is remembered here and consumed before spawn, rather than spawning a process nothing can cancel. */
|
|
35
54
|
private readonly externalLaunches;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
private readonly externalRecoveryTimers;
|
|
55
|
+
private readonly recovery;
|
|
56
|
+
private readonly recoveryQueue;
|
|
39
57
|
/** Live external runs' tail-the-artifact-file progress pollers (P1a). Never persisted or
|
|
40
58
|
* reconstructed on restore — an adopted run has no fresher information to poll for than
|
|
41
59
|
* restart reconciliation already reads once from the finished process's own output. */
|
|
@@ -50,7 +68,7 @@ export declare class SubAgentRunManager {
|
|
|
50
68
|
desk: string;
|
|
51
69
|
deskDir: string;
|
|
52
70
|
}, options: RunManagerOptions);
|
|
53
|
-
/** The completion wake's dispatch id
|
|
71
|
+
/** The completion wake's dispatch id (a chat-level run; a task-bound run never wakes a channel). */
|
|
54
72
|
private wakeDispatchId;
|
|
55
73
|
/** Release observation timers without cancelling dispatched work or its settlement. */
|
|
56
74
|
stop(): void;
|
|
@@ -70,6 +88,8 @@ export declare class SubAgentRunManager {
|
|
|
70
88
|
/** Start tailing a just-launched external run's artifact file for a human-readable step label
|
|
71
89
|
* (P1a). Best-effort only — see `progress-tail.ts` for the polling/pacing contract. */
|
|
72
90
|
private startExternalProgressTail;
|
|
91
|
+
/** Tell a task-bound run's task that the run has gone quiet: it is the leader's call what to do (spec 064, D16). */
|
|
92
|
+
private noteTaskStall;
|
|
73
93
|
/**
|
|
74
94
|
* A step label from an internal run that has outlived its sync grace window: nobody is watching
|
|
75
95
|
* the tool call any more, so without this the run would be silent until it settles. Paced by the
|
|
@@ -128,17 +148,16 @@ export declare class SubAgentRunManager {
|
|
|
128
148
|
updateLaunchMetadata(runId: string, info: {
|
|
129
149
|
pidStartedAt?: string;
|
|
130
150
|
cliVersion?: string;
|
|
151
|
+
}, launch?: {
|
|
152
|
+
pid: number;
|
|
153
|
+
processStartedAt: number;
|
|
131
154
|
}): Promise<void>;
|
|
132
|
-
/** Reserve a task wake exactly once. A replay of the same durable dispatch may resume an
|
|
133
|
-
* interrupted activation, while copied text or a different dispatch id can never claim it. */
|
|
134
|
-
beginWakeConsumption(runId: string, taskId: string, dispatchId: string): Promise<boolean>;
|
|
135
|
-
finishWakeConsumption(runId: string, dispatchId: string): Promise<void>;
|
|
136
155
|
/** Let a caller (subagent tool) register a way to abort this run's in-process worker. */
|
|
137
156
|
registerCancelHandle(runId: string, cancel: () => void): void;
|
|
138
157
|
/** Record why a still-running external run is about to be killed, before the signal is sent
|
|
139
158
|
* (P1-1) — see the `terminationReason` field doc. A no-op once the run is no longer running.
|
|
140
159
|
* Called by both the live in-process watcher (`external/run.ts`) and `sweep()` below. */
|
|
141
|
-
markTerminationReason(runId: string, reason: "timeout" | "cancelled"): Promise<void>;
|
|
160
|
+
markTerminationReason(runId: string, reason: "timeout" | "cancelled", required?: boolean): Promise<void>;
|
|
142
161
|
clearCancelHandle(runId: string): void;
|
|
143
162
|
/**
|
|
144
163
|
* Settle a run exactly once (D1/D7 order: settle → record usage/archive → enqueue wake).
|
|
@@ -149,12 +168,6 @@ export declare class SubAgentRunManager {
|
|
|
149
168
|
settle(runId: string, input: SettleInput, options: {
|
|
150
169
|
announce: boolean;
|
|
151
170
|
}): Promise<void>;
|
|
152
|
-
/**
|
|
153
|
-
* Credit one settled run to the task that owns it: cost onto its usage, outcome onto its log.
|
|
154
|
-
* Best-effort by design: a task whose file has since been archived or hand-deleted must not
|
|
155
|
-
* block the completion wake.
|
|
156
|
-
*/
|
|
157
|
-
private creditOwningTask;
|
|
158
171
|
/**
|
|
159
172
|
* Dispatch the completion wake. Durable-dispatch persists its own pending record before this
|
|
160
173
|
* call can be interrupted (`DurableDispatchService.dispatch`), and `dispatch()` is idempotent on
|
|
@@ -163,10 +176,8 @@ export declare class SubAgentRunManager {
|
|
|
163
176
|
*/
|
|
164
177
|
private announce;
|
|
165
178
|
/**
|
|
166
|
-
* Spec 058, D8: the run's channel left this desk, so the wake has no recipient. Settlement
|
|
167
|
-
*
|
|
168
|
-
* `work` ticket it would have redeemed is redeemed here via `redeemTicket`, so the suspended task
|
|
169
|
-
* resumes as soon as its delivery channel is bound again.
|
|
179
|
+
* Spec 058, D8: the run's channel left this desk, so the chat wake has no recipient. Settlement
|
|
180
|
+
* already happened; the wake is dropped (marker set, never replayed).
|
|
170
181
|
*/
|
|
171
182
|
private suppressWake;
|
|
172
183
|
/** Explicit cancel (`subagent_run op=cancel`, spec 040 D6). Does not wake — it is the model's own decision. */
|
|
@@ -180,37 +191,13 @@ export declare class SubAgentRunManager {
|
|
|
180
191
|
* without mutual exclusion.
|
|
181
192
|
*/
|
|
182
193
|
restore(): Promise<number>;
|
|
183
|
-
/**
|
|
184
|
-
|
|
185
|
-
* launch) means there is nothing to compare against — trust `isProcessAlive` alone rather
|
|
186
|
-
* than manufacture a false negative. */
|
|
187
|
-
private isSameProcess;
|
|
188
|
-
private processIdentity;
|
|
189
|
-
/**
|
|
190
|
-
* Restart reconciliation for an external run still marked `running` (D10.3), and the terminal
|
|
191
|
-
* judgement `sweep()` uses once an adopted run's process is confirmed gone. Unlike internal
|
|
192
|
-
* runs, a `detached` external process outlives the daemon, so the first move is a liveness
|
|
193
|
-
* probe, not an automatic `lost`:
|
|
194
|
-
*
|
|
195
|
-
* - no `pid` at all: the intent was persisted but spawn was never confirmed — cannot prove it
|
|
196
|
-
* ever started, so it is judged `lost` the same as an internal run (D1).
|
|
197
|
-
* - `pid` alive under the same identity: genuinely still running. Left alone.
|
|
198
|
-
* - `pid` gone (or reused by an unrelated process): the process finished, died, or was killed
|
|
199
|
-
* while the daemon was down. `finalizeExternalRun` (spec 042 D1) parses whatever the process
|
|
200
|
-
* actually wrote before applying `terminationReason` — the same sequence the live post-exit
|
|
201
|
-
* path uses, so a reconciled run never loses usage, output, session id, or its verify verdict
|
|
202
|
-
* just because the daemon happened to be down when the run finished.
|
|
203
|
-
*/
|
|
194
|
+
/** The lane retries task receipts before it decides a wait has no result. */
|
|
195
|
+
retryTaskSettlements(): Promise<void>;
|
|
204
196
|
private reconcileExternalRun;
|
|
205
|
-
/** Reconcile an adopted process once at restore and once at its persisted deadline. Probing
|
|
206
|
-
* liveness before assigning a timeout lets a process that finished just before the deadline be
|
|
207
|
-
* settled from its artifacts as a normal completion. */
|
|
208
197
|
private reconcileExternalRunAtDeadline;
|
|
209
|
-
private clearExternalRecoveryTimer;
|
|
210
|
-
private scheduleExternalRecovery;
|
|
211
198
|
/**
|
|
212
199
|
* Daily retention GC. A settled run and all runtime-managed artifacts are deleted together once
|
|
213
|
-
* they are at least
|
|
200
|
+
* they are at least 30 days old. Other files deliberately created by the delegated task are
|
|
214
201
|
* not recursively removed from the artifact directory.
|
|
215
202
|
*/
|
|
216
203
|
private collectGarbageIfExpired;
|