@loucompanion/forge-bridge 0.1.4-dev.4677bbd22f17 → 0.1.4-dev.60e18c3cfec6
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.md +33 -0
- package/dist/bridge/bridge.base.d.ts +9 -0
- package/dist/bridge/bridge.service.d.ts +72 -1
- package/dist/bridge/bridge.service.js +308 -9
- package/dist/bridge/bridge.types.d.ts +16 -0
- package/dist/bridge/local-yield-flag.d.ts +6 -0
- package/dist/bridge/local-yield-flag.js +34 -0
- package/dist/bridge/runner-host-capabilities.d.ts +2 -0
- package/dist/bridge/runner-host-capabilities.js +4 -0
- package/dist/bridge/test-postgres-capability.d.ts +14 -0
- package/dist/bridge/test-postgres-capability.js +120 -0
- package/dist/cleanup/cleanup.service.d.ts +9 -0
- package/dist/cleanup/cleanup.service.js +72 -109
- package/dist/cleanup/cleanup.types.d.ts +4 -0
- package/dist/cleanup/forge-owned-paths.d.ts +9 -0
- package/dist/cleanup/forge-owned-paths.js +53 -0
- package/dist/cleanup/host-runtime-ledger.d.ts +5 -0
- package/dist/cleanup/host-runtime-ledger.js +109 -0
- package/dist/cleanup/managed-branch-sweep.d.ts +27 -0
- package/dist/cleanup/managed-branch-sweep.js +111 -0
- package/dist/cli/cli.help.js +18 -0
- package/dist/cli/cli.service.d.ts +16 -0
- package/dist/cli/cli.service.js +142 -16
- package/dist/cli/local-config.d.ts +4 -0
- package/dist/cli/local-config.js +26 -4
- package/dist/runtime/aspnet-runtime-prebuild.js +94 -6
- package/dist/runtime/host-load-admission.d.ts +60 -0
- package/dist/runtime/host-load-admission.js +99 -0
- package/dist/runtime/host-load-child-environment.d.ts +22 -0
- package/dist/runtime/host-load-child-environment.js +67 -0
- package/dist/runtime/host-load-forge-cgroups.d.ts +49 -0
- package/dist/runtime/host-load-forge-cgroups.js +140 -0
- package/dist/runtime/host-load-governor-config.d.ts +43 -0
- package/dist/runtime/host-load-governor-config.js +76 -0
- package/dist/runtime/host-load-governor.d.ts +174 -0
- package/dist/runtime/host-load-governor.js +541 -0
- package/dist/runtime/host-load-ledger-lock.d.ts +69 -0
- package/dist/runtime/host-load-ledger-lock.js +185 -0
- package/dist/runtime/host-load-runtime-settings.d.ts +25 -0
- package/dist/runtime/host-load-runtime-settings.js +78 -0
- package/dist/runtime/host-load-sampler.d.ts +43 -0
- package/dist/runtime/host-load-sampler.js +74 -6
- package/dist/runtime/host-load-step-class.d.ts +68 -0
- package/dist/runtime/host-load-step-class.js +106 -0
- package/dist/runtime/host-load-step-reaper.d.ts +27 -0
- package/dist/runtime/host-load-step-reaper.js +95 -0
- package/dist/runtime/host-load-step-run.d.ts +73 -0
- package/dist/runtime/host-load-step-run.js +102 -0
- package/dist/runtime/host-load-token-ledger.d.ts +174 -0
- package/dist/runtime/host-load-token-ledger.js +421 -0
- package/dist/runtime/host-pressure-stall.d.ts +21 -1
- package/dist/runtime/host-pressure-stall.js +48 -1
- package/dist/runtime/host-runtime-contract.d.ts +3 -0
- package/dist/runtime/host-runtime-contract.js +4 -1
- package/dist/runtime/host-runtime-lease.d.ts +74 -4
- package/dist/runtime/host-runtime-lease.js +279 -10
- package/dist/runtime/host-runtime-promotion.js +12 -0
- package/dist/runtime/host-runtime-requirements-check.d.ts +17 -0
- package/dist/runtime/host-runtime-requirements-check.js +29 -0
- package/dist/runtime/host-runtime-requirements.d.ts +36 -0
- package/dist/runtime/host-runtime-requirements.js +117 -0
- package/dist/runtime/playwright-host-runtime-adapter.d.ts +7 -0
- package/dist/runtime/playwright-host-runtime-adapter.js +13 -1
- package/dist/runtime/runner-settings.d.ts +100 -0
- package/dist/runtime/runner-settings.js +214 -0
- package/dist/sandbox/host-capacity-broker.d.ts +107 -0
- package/dist/sandbox/host-capacity-broker.js +315 -0
- package/dist/sandbox/runtime.d.ts +10 -1
- package/dist/sandbox/runtime.js +45 -2
- package/dist/sandbox/sandbox-cgroups.d.ts +14 -0
- package/dist/sandbox/sandbox-cgroups.js +42 -0
- package/dist/session/managed-attempt-tools.d.ts +2 -0
- package/dist/session/managed-attempt-tools.js +156 -37
- package/dist/session/managed-command-host-load.d.ts +45 -0
- package/dist/session/managed-command-host-load.js +82 -0
- package/dist/session/mcp-argument-coercion.d.ts +23 -0
- package/dist/session/mcp-argument-coercion.js +121 -0
- package/dist/session/phase-completion.artifacts.d.ts +7 -0
- package/dist/session/phase-completion.artifacts.js +94 -25
- package/dist/session/phase-completion.command-validation.d.ts +7 -0
- package/dist/session/phase-completion.command-validation.js +77 -0
- package/dist/session/phase-completion.d.ts +4 -0
- package/dist/session/phase-completion.helpers.js +13 -12
- package/dist/session/phase-completion.js +4 -0
- package/dist/session/phase-completion.prompts.js +6 -1
- package/dist/session/phase-completion.runtime.d.ts +5 -3
- package/dist/session/phase-completion.runtime.js +49 -19
- package/dist/session/phase-completion.schema-parts.d.ts +19 -0
- package/dist/session/phase-completion.schema-parts.js +188 -0
- package/dist/session/phase-completion.schemas.d.ts +3 -3
- package/dist/session/phase-completion.schemas.js +184 -209
- package/dist/session/phase-completion.validation.d.ts +2 -3
- package/dist/session/phase-completion.validation.js +46 -92
- package/dist/session/pre-publication-host-load.d.ts +27 -0
- package/dist/session/pre-publication-host-load.js +111 -0
- package/dist/session/pre-publication-process.d.ts +3 -0
- package/dist/session/pre-publication-process.js +23 -11
- package/dist/session/pre-publication-step-execution.d.ts +11 -0
- package/dist/session/pre-publication-step-execution.js +49 -0
- package/dist/session/pre-publication-validation.d.ts +9 -9
- package/dist/session/pre-publication-validation.js +21 -55
- package/dist/session/provider-cli/provider-cli.process.js +2 -2
- package/dist/session/provider-cli/provider-cli.prompts.js +5 -2
- package/dist/session/provider-cli/provider-cli.service.d.ts +6 -0
- package/dist/session/provider-cli/provider-cli.service.js +132 -14
- package/dist/session/provider-cli/provider-cli.types.d.ts +30 -0
- package/dist/session/sandbox-host-capacity-gate.d.ts +30 -0
- package/dist/session/sandbox-host-capacity-gate.js +229 -0
- package/dist/session/session.base.d.ts +9 -1
- package/dist/session/session.service.d.ts +9 -2
- package/dist/session/session.service.js +120 -5
- package/dist/session/session.types.d.ts +3 -0
- package/dist/session/session.types.js +3 -3
- package/dist/session/workspace-runtime-fingerprint.d.ts +32 -0
- package/dist/session/workspace-runtime-fingerprint.js +138 -0
- package/dist/shared/process/host-process-supervisor.d.ts +1 -0
- package/dist/shared/process/host-process-supervisor.js +1 -1
- package/dist/shared/process/process-tree.d.ts +52 -0
- package/dist/shared/process/process-tree.js +144 -0
- package/dist/shared/process/process.d.ts +67 -0
- package/dist/shared/process/process.js +213 -11
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/worktree/dependency-warmer.d.ts +25 -0
- package/dist/worktree/dependency-warmer.js +46 -10
- package/dist/worktree/worktree.service.d.ts +10 -1
- package/dist/worktree/worktree.service.js +42 -2
- package/dist/worktree/worktree.types.d.ts +7 -0
- package/package.json +1 -1
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { defaultHostLoadSampleIntervalMs } from "./host-load-sampler.js";
|
|
2
|
+
export const defaultHostLoadGovernorConfig = {
|
|
3
|
+
mode: "off",
|
|
4
|
+
cpuBudgetFraction: 0.8,
|
|
5
|
+
memoryReserveBytes: 1024 ** 3,
|
|
6
|
+
cpuPressureThreshold: 50,
|
|
7
|
+
backpressureSamples: 2,
|
|
8
|
+
memoryFullThreshold: 5,
|
|
9
|
+
maxWaitMs: 30 * 60_000,
|
|
10
|
+
fallbackSlots: 1,
|
|
11
|
+
antiStarvationMs: 2 * 60_000,
|
|
12
|
+
leaseMs: 2 * 60_000,
|
|
13
|
+
recheckIntervalMs: 1_000,
|
|
14
|
+
sampleStaleMs: 30_000,
|
|
15
|
+
sampleIntervalMs: defaultHostLoadSampleIntervalMs,
|
|
16
|
+
memoryRampMs: 60_000,
|
|
17
|
+
};
|
|
18
|
+
export function parseHostLoadGovernorMode(value) {
|
|
19
|
+
const normalized = value?.trim().toLowerCase() ?? "";
|
|
20
|
+
return normalized === "on" || normalized === "true" || normalized === "1" ? "on" : "off";
|
|
21
|
+
}
|
|
22
|
+
export function loadHostLoadGovernorConfig(environment = process.env) {
|
|
23
|
+
const defaults = defaultHostLoadGovernorConfig;
|
|
24
|
+
return {
|
|
25
|
+
mode: parseHostLoadGovernorMode(environment.FORGE_HOST_LOAD_GOVERNOR),
|
|
26
|
+
cpuBudgetFraction: bounded(environment.FORGE_HOST_LOAD_CPU_BUDGET_FRACTION, defaults.cpuBudgetFraction, 0.05, 1),
|
|
27
|
+
memoryReserveBytes: bounded(environment.FORGE_HOST_LOAD_MEMORY_RESERVE_BYTES, defaults.memoryReserveBytes, 0, 1024 ** 4),
|
|
28
|
+
cpuPressureThreshold: bounded(environment.FORGE_HOST_LOAD_CPU_PRESSURE_THRESHOLD, defaults.cpuPressureThreshold, 1, 100),
|
|
29
|
+
backpressureSamples: Math.round(bounded(environment.FORGE_HOST_LOAD_BACKPRESSURE_SAMPLES, defaults.backpressureSamples, 1, 60)),
|
|
30
|
+
memoryFullThreshold: bounded(environment.FORGE_HOST_LOAD_MEMORY_FULL_THRESHOLD, defaults.memoryFullThreshold, 0, 100),
|
|
31
|
+
maxWaitMs: bounded(environment.FORGE_HOST_LOAD_MAX_WAIT_MS, defaults.maxWaitMs, 1_000, 24 * 60 * 60_000),
|
|
32
|
+
fallbackSlots: Math.round(bounded(environment.FORGE_HOST_LOAD_FALLBACK_SLOTS, defaults.fallbackSlots, 1, 64)),
|
|
33
|
+
antiStarvationMs: defaults.antiStarvationMs,
|
|
34
|
+
leaseMs: defaults.leaseMs,
|
|
35
|
+
recheckIntervalMs: defaults.recheckIntervalMs,
|
|
36
|
+
sampleStaleMs: defaults.sampleStaleMs,
|
|
37
|
+
sampleIntervalMs: defaults.sampleIntervalMs,
|
|
38
|
+
memoryRampMs: defaults.memoryRampMs,
|
|
39
|
+
cpuBudgetCeilingFraction: lowestFraction(optionalCpuPercentFraction(environment.FORGE_HOST_CPU_BUDGET_PERCENT), optionalFraction(environment.FORGE_HOST_LOAD_CPU_BUDGET_FRACTION)),
|
|
40
|
+
maxHeavyStepsCeiling: optionalHeavySteps(environment.FORGE_HOST_MAX_HEAVY_STEPS),
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
/** Matches runner-settings' parse of FORGE_HOST_CPU_BUDGET_PERCENT (Number, 10-100); unparsable is unset. */
|
|
44
|
+
function optionalCpuPercentFraction(raw) {
|
|
45
|
+
if (raw === undefined || raw.trim() === "")
|
|
46
|
+
return null;
|
|
47
|
+
const value = Number(raw);
|
|
48
|
+
return Number.isFinite(value) ? Math.min(100, Math.max(10, value)) / 100 : null;
|
|
49
|
+
}
|
|
50
|
+
/** An explicitly set FORGE_HOST_LOAD_CPU_BUDGET_FRACTION is a ceiling too (runner-settings' cpuBudgetCeilings). */
|
|
51
|
+
function optionalFraction(raw) {
|
|
52
|
+
if (raw === undefined || raw.trim() === "")
|
|
53
|
+
return null;
|
|
54
|
+
const value = Number(raw);
|
|
55
|
+
return Number.isFinite(value) ? Math.min(1, Math.max(0.05, value)) : null;
|
|
56
|
+
}
|
|
57
|
+
function lowestFraction(a, b) {
|
|
58
|
+
if (a === null)
|
|
59
|
+
return b;
|
|
60
|
+
if (b === null)
|
|
61
|
+
return a;
|
|
62
|
+
return Math.min(a, b);
|
|
63
|
+
}
|
|
64
|
+
/** Matches runner-settings' parse of FORGE_HOST_MAX_HEAVY_STEPS (parseInt, 1-64); unparsable is unset. */
|
|
65
|
+
function optionalHeavySteps(raw) {
|
|
66
|
+
if (raw === undefined || raw.trim() === "")
|
|
67
|
+
return null;
|
|
68
|
+
const value = Number.parseInt(raw, 10);
|
|
69
|
+
return Number.isFinite(value) ? Math.min(64, Math.max(1, value)) : null;
|
|
70
|
+
}
|
|
71
|
+
function bounded(raw, fallback, minimum, maximum) {
|
|
72
|
+
if (raw === undefined || raw.trim() === "")
|
|
73
|
+
return fallback;
|
|
74
|
+
const value = Number(raw);
|
|
75
|
+
return Number.isFinite(value) ? Math.min(maximum, Math.max(minimum, value)) : fallback;
|
|
76
|
+
}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { ForgeFailureError } from "../session/session.types.js";
|
|
2
|
+
import { type HostLoadAdmissionDecision } from "./host-load-admission.js";
|
|
3
|
+
import { type HostLoadGovernorConfig } from "./host-load-governor-config.js";
|
|
4
|
+
import type { HostLoadGovernorSource } from "./host-load-sampler.js";
|
|
5
|
+
import type { HostLoadStepCost } from "./host-load-step-class.js";
|
|
6
|
+
import { type HostLoadStepProcess, type HostLoadStepTerminator } from "./host-load-step-reaper.js";
|
|
7
|
+
import { type HostLoadOwnerLiveness, type HostLoadToken, type HostLoadTokenOwner, type HostLoadTokenPriority } from "./host-load-token-ledger.js";
|
|
8
|
+
export interface HostLoadStepRequest {
|
|
9
|
+
readonly stepClass: string;
|
|
10
|
+
/** What the step is, for diagnostics (for example the validation check id). */
|
|
11
|
+
readonly label: string;
|
|
12
|
+
readonly cost: HostLoadStepCost;
|
|
13
|
+
readonly dispatchAttemptId: string | null;
|
|
14
|
+
readonly priority: HostLoadTokenPriority;
|
|
15
|
+
}
|
|
16
|
+
export interface HostLoadAcquireOptions {
|
|
17
|
+
readonly signal?: AbortSignal;
|
|
18
|
+
/** Called once, when the first admission decision says the step must wait. */
|
|
19
|
+
readonly onWaiting?: (decision: HostLoadAdmissionDecision) => void | Promise<void>;
|
|
20
|
+
}
|
|
21
|
+
export interface HostLoadAdmission {
|
|
22
|
+
readonly tokenId: string;
|
|
23
|
+
readonly fencingToken: number;
|
|
24
|
+
readonly stepClass: string;
|
|
25
|
+
/** Time spent queued; never counted as step execution time. */
|
|
26
|
+
readonly waitMs: number;
|
|
27
|
+
readonly decision: HostLoadAdmissionDecision;
|
|
28
|
+
/**
|
|
29
|
+
* Aborted when the reservation is lost while the step runs: with
|
|
30
|
+
* host_capacity_token_fenced when the token was fenced (this owner stalled
|
|
31
|
+
* past its lease and another process saw it), or with
|
|
32
|
+
* host_capacity_ledger_unavailable when it could not be renewed for a whole
|
|
33
|
+
* lease. The step must stop; the token keeps its cost until it is released.
|
|
34
|
+
*/
|
|
35
|
+
readonly fenced: AbortSignal;
|
|
36
|
+
/** Records the step's process tree, so a reclaim stops it before reusing its capacity. */
|
|
37
|
+
attachProcess(stepProcess: HostLoadStepProcess): Promise<void>;
|
|
38
|
+
/** Returns the token. Rejects with host_capacity_token_fenced if it was fenced or reclaimed. */
|
|
39
|
+
release(): Promise<void>;
|
|
40
|
+
/**
|
|
41
|
+
* Instead of release: the step ended but part of its process tree could not
|
|
42
|
+
* be proven gone. The token stays held, with its cost, and is returned only
|
|
43
|
+
* once `stillGone` (re-checked on every renewal) resolves true. Without a
|
|
44
|
+
* check, the token's recorded process tree is checked instead; with neither,
|
|
45
|
+
* the token is kept until attempt teardown has stopped the attempt's processes.
|
|
46
|
+
*/
|
|
47
|
+
retainUntilStopped(stillGone: (() => Promise<boolean>) | null, reason: Error): void;
|
|
48
|
+
}
|
|
49
|
+
/** The gate heavy steps call before launching. */
|
|
50
|
+
export interface HostLoadStepGate {
|
|
51
|
+
readonly enabled: boolean;
|
|
52
|
+
/** The longest a step may queue before host_capacity_timeout, when the gate knows it. */
|
|
53
|
+
readonly maxWaitMs?: number;
|
|
54
|
+
acquire(request: HostLoadStepRequest, options?: HostLoadAcquireOptions): Promise<HostLoadAdmission>;
|
|
55
|
+
}
|
|
56
|
+
export declare class HostCapacityTimeoutError extends ForgeFailureError {
|
|
57
|
+
readonly stepClass: string;
|
|
58
|
+
readonly label: string;
|
|
59
|
+
readonly waitMs: number;
|
|
60
|
+
readonly code = "host_capacity_timeout";
|
|
61
|
+
constructor(stepClass: string, label: string, waitMs: number, detail: string);
|
|
62
|
+
}
|
|
63
|
+
export interface HostLoadGovernorOptions {
|
|
64
|
+
readonly stateRoot: string;
|
|
65
|
+
readonly load: HostLoadGovernorSource;
|
|
66
|
+
readonly config?: HostLoadGovernorConfig;
|
|
67
|
+
readonly liveness?: HostLoadOwnerLiveness;
|
|
68
|
+
/** Owner recorded on tokens (tests model separate processes); defaults to this process. */
|
|
69
|
+
readonly owner?: HostLoadTokenOwner;
|
|
70
|
+
readonly now?: () => number;
|
|
71
|
+
/** Test seam for the ledger's process-tree reaper. */
|
|
72
|
+
readonly terminateStep?: HostLoadStepTerminator;
|
|
73
|
+
/** Test seam for the host suspend counter. */
|
|
74
|
+
readonly suspendedMs?: () => number;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Host-wide admission for heavy steps (decision 0013). Waiters queue
|
|
78
|
+
* foreground before background and FIFO within a class; a waiter that fits may
|
|
79
|
+
* overtake an unfit head until the head has waited past the anti-starvation
|
|
80
|
+
* window. Running steps are never preempted. Reserved cost comes from the
|
|
81
|
+
* shared token ledger, so other processes' steps count against the same budget.
|
|
82
|
+
*/
|
|
83
|
+
export declare class HostLoadGovernor implements HostLoadStepGate {
|
|
84
|
+
private readonly options;
|
|
85
|
+
readonly enabled: boolean;
|
|
86
|
+
private readonly config;
|
|
87
|
+
private readonly ledger;
|
|
88
|
+
private readonly waiters;
|
|
89
|
+
private readonly held;
|
|
90
|
+
private recheckTimer;
|
|
91
|
+
private renewTimer;
|
|
92
|
+
private draining;
|
|
93
|
+
private drainAgain;
|
|
94
|
+
/** Own cgroup anonymous memory with no heavy step running: the bridge's baseline. */
|
|
95
|
+
private idleOwnMemoryBytes;
|
|
96
|
+
/** The bridge's pushed settings (decision 0014), shared with every governor on this state root. */
|
|
97
|
+
private readonly runtimeSettings;
|
|
98
|
+
constructor(options: HostLoadGovernorOptions);
|
|
99
|
+
get maxWaitMs(): number;
|
|
100
|
+
acquire(request: HostLoadStepRequest, options?: HostLoadAcquireOptions): Promise<HostLoadAdmission>;
|
|
101
|
+
/** Reclaims tokens whose owner is gone or whose lease expired (bridge startup). */
|
|
102
|
+
reclaim(): Promise<readonly HostLoadToken[]>;
|
|
103
|
+
/** Returns dead owners' unrecorded tokens the caller proved stopped (see the ledger). */
|
|
104
|
+
releaseOrphaned(belongs: (token: HostLoadToken) => boolean): Promise<readonly HostLoadToken[]>;
|
|
105
|
+
/**
|
|
106
|
+
* Attempt teardown: cancels the attempt's queued steps and stops its running
|
|
107
|
+
* ones (their `fenced` signal aborts with dispatch_cancelled). A running step
|
|
108
|
+
* keeps its token, and its cost, until the step itself returns it once its
|
|
109
|
+
* processes are gone, so the capacity is never reused while it still runs.
|
|
110
|
+
*/
|
|
111
|
+
stopAttempt(dispatchAttemptId: string): void;
|
|
112
|
+
/**
|
|
113
|
+
* Cancels the attempt's queued steps and returns every token it holds at
|
|
114
|
+
* once. Only for callers that know the attempt's steps are no longer running;
|
|
115
|
+
* attempt teardown uses stopAttempt.
|
|
116
|
+
*/
|
|
117
|
+
releaseAttempt(dispatchAttemptId: string): Promise<void>;
|
|
118
|
+
private cancelAttemptWaiters;
|
|
119
|
+
/** Waiting and admitted steps of this process, for diagnostics. */
|
|
120
|
+
snapshot(): {
|
|
121
|
+
readonly waiting: number;
|
|
122
|
+
readonly held: readonly HostLoadToken[];
|
|
123
|
+
};
|
|
124
|
+
private drain;
|
|
125
|
+
private drainOnce;
|
|
126
|
+
private readSignals;
|
|
127
|
+
/**
|
|
128
|
+
* Consecutive pressured samples ending with the latest one, read from the
|
|
129
|
+
* sampler's history so samples taken while nothing waited still count. A gap
|
|
130
|
+
* in sampling (sampler stopped, host suspended) breaks the streak.
|
|
131
|
+
*/
|
|
132
|
+
private pressureStreak;
|
|
133
|
+
/**
|
|
134
|
+
* Memory the running steps already use, which MemAvailable already reflects,
|
|
135
|
+
* so the budget does not count it twice. Measured from the dedicated cgroup
|
|
136
|
+
* above its idle baseline; without one, a step admitted longer than the ramp
|
|
137
|
+
* window ago is assumed to hold its reservation. Never above the reservations.
|
|
138
|
+
*/
|
|
139
|
+
private runningStepsMemoryBytes;
|
|
140
|
+
private logicalCpus;
|
|
141
|
+
private settle;
|
|
142
|
+
/** Renewed tokens reset their lease clock; fenced ones stop their steps (they keep their cost until released). */
|
|
143
|
+
private applyHeldOutcome;
|
|
144
|
+
/** The step must stop: its reservation is no longer guaranteed. */
|
|
145
|
+
private lose;
|
|
146
|
+
/** Ledger failures reach every queued step instead of leaving it to time out. */
|
|
147
|
+
private failWaiters;
|
|
148
|
+
private attachProcess;
|
|
149
|
+
/**
|
|
150
|
+
* Returns a step's token. It stays held (and renewed) until the ledger takes
|
|
151
|
+
* it back, so a ledger outage cannot leave it to lapse into a fenced
|
|
152
|
+
* reservation; the renewal timer retries the release. A fenced token is
|
|
153
|
+
* removed too (its step is over) and the release reports the fence.
|
|
154
|
+
*/
|
|
155
|
+
private releaseHeld;
|
|
156
|
+
private forget;
|
|
157
|
+
private armRecheck;
|
|
158
|
+
private disarmRecheck;
|
|
159
|
+
private armRenewal;
|
|
160
|
+
private disarmRenewal;
|
|
161
|
+
/**
|
|
162
|
+
* The step ended but part of its process tree may still run: its token stays
|
|
163
|
+
* held and renewed, with its cost, and the step's own termination check is
|
|
164
|
+
* retried on every renewal tick until it proves the tree gone.
|
|
165
|
+
*/
|
|
166
|
+
private retainUntilStopped;
|
|
167
|
+
/**
|
|
168
|
+
* Attempt teardown stopped the attempt's processes (its process supervisor
|
|
169
|
+
* proved them gone): tokens kept for a tree nothing else can check are returned.
|
|
170
|
+
*/
|
|
171
|
+
releaseRetainedAfterTeardown(dispatchAttemptId: string): Promise<void>;
|
|
172
|
+
private checkRetained;
|
|
173
|
+
private renewHeld;
|
|
174
|
+
}
|