@hearsay-tools/squawk 0.18.0-dev.7804 → 0.18.0-dev.7812
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/dist/activity/read-model.js +1 -1
- package/dist/activity/read-model.js.map +1 -1
- package/dist/activity/requests.d.ts +3 -1
- package/dist/activity/requests.js +1 -1
- package/dist/activity/requests.js.map +1 -1
- package/dist/activity/tool-activity.d.ts +3 -2
- package/dist/activity/tool-activity.js +1 -1
- package/dist/activity/tool-activity.js.map +1 -1
- package/dist/built-in-run-slots.d.ts +4 -3
- package/dist/built-in-run-slots.js +7 -3
- package/dist/built-in-run-slots.js.map +1 -1
- package/dist/delegation/conversation-send.js +1 -1
- package/dist/delegation/conversation-send.js.map +1 -1
- package/dist/delegation/conversations.js +4 -4
- package/dist/delegation/conversations.js.map +1 -1
- package/dist/delegation/execution-identity.d.ts +7 -2
- package/dist/delegation/execution-identity.js +34 -3
- package/dist/delegation/execution-identity.js.map +1 -1
- package/dist/delegation/family-end.d.ts +3 -1
- package/dist/delegation/park-notice.d.ts +3 -1
- package/dist/delegation/park-notice.js +2 -2
- package/dist/delegation/park-notice.js.map +1 -1
- package/dist/delegation/private-record-file.js.map +1 -0
- package/dist/delegation/provision.js +1 -1
- package/dist/delegation/provision.js.map +1 -1
- package/dist/delegation/results.js +3 -3
- package/dist/delegation/results.js.map +1 -1
- package/dist/delegation/scratch-cleanup.js +5 -5
- package/dist/delegation/scratch-cleanup.js.map +1 -1
- package/dist/delegation/service.js +10 -9
- package/dist/delegation/service.js.map +1 -1
- package/dist/delegation/worker-cleanup.js +13 -12
- package/dist/delegation/worker-cleanup.js.map +1 -1
- package/dist/{runs → delegation}/worker-deletion-proof.d.ts +1 -1
- package/dist/delegation/worker-deletion-proof.js.map +1 -0
- package/dist/delegation/worker-executions.d.ts +70 -0
- package/dist/delegation/worker-executions.js +248 -0
- package/dist/delegation/worker-executions.js.map +1 -0
- package/dist/{runs → delegation}/worker-resource-holders.d.ts +1 -1
- package/dist/delegation/worker-resource-holders.js.map +1 -0
- package/dist/preview/agent-marker.js +1 -1
- package/dist/preview/agent-marker.js.map +1 -1
- package/dist/preview/host.d.ts +5 -1
- package/dist/preview/host.js +2 -2
- package/dist/preview/host.js.map +1 -1
- package/dist/preview/run-tools.js +1 -1
- package/dist/preview/run-tools.js.map +1 -1
- package/dist/runs/event-log.d.ts +79 -0
- package/dist/runs/event-log.js +188 -0
- package/dist/runs/event-log.js.map +1 -0
- package/dist/runs/owned-run-create.d.ts +3 -3
- package/dist/runs/owned-run-create.js +1 -2
- package/dist/runs/owned-run-create.js.map +1 -1
- package/dist/runs/ports.d.ts +68 -22
- package/dist/runs/retention.d.ts +3 -1
- package/dist/runs/retention.js +3 -3
- package/dist/runs/retention.js.map +1 -1
- package/dist/runs/run-redaction.d.ts +19 -0
- package/dist/runs/run-redaction.js +36 -0
- package/dist/runs/run-redaction.js.map +1 -0
- package/dist/runs/run-retention.d.ts +1 -1
- package/dist/runs/store.d.ts +14 -117
- package/dist/runs/store.js +56 -462
- package/dist/runs/store.js.map +1 -1
- package/dist/runs/transcript-facts-fold.d.ts +1 -1
- package/dist/runs/transcript-facts-fold.js +1 -1
- package/dist/runs/transcript-facts-fold.js.map +1 -1
- package/dist/runs/webhook.d.ts +3 -1
- package/dist/runs/webhook.js +3 -3
- package/dist/runs/webhook.js.map +1 -1
- package/dist/runs/worker-executions-registry.d.ts +31 -0
- package/dist/runs/worker-executions-registry.js +20 -0
- package/dist/runs/worker-executions-registry.js.map +1 -0
- package/dist/server/project-context.d.ts +3 -1
- package/dist/server/project-context.js.map +1 -1
- package/dist/server/provider-auth-runtime.js +2 -2
- package/dist/server/provider-auth-runtime.js.map +1 -1
- package/dist/server/run-relationships.d.ts +3 -1
- package/dist/server/run-relationships.js +1 -1
- package/dist/server/run-relationships.js.map +1 -1
- package/dist/server/server.js +2 -2
- package/dist/server/server.js.map +1 -1
- package/dist/workflows/run/attachment-writer.js +1 -1
- package/dist/workflows/run/attachment-writer.js.map +1 -1
- package/dist/workflows/run/auto-resume.js +4 -4
- package/dist/workflows/run/auto-resume.js.map +1 -1
- package/dist/workflows/run/completion-gate.js +1 -1
- package/dist/workflows/run/completion-gate.js.map +1 -1
- package/dist/workflows/run/continuation-session.js +10 -10
- package/dist/workflows/run/continuation-session.js.map +1 -1
- package/dist/workflows/run/cut-off-work.d.ts +8 -6
- package/dist/workflows/run/cut-off-work.js +2 -2
- package/dist/workflows/run/cut-off-work.js.map +1 -1
- package/dist/workflows/run/family-reconciler.js +3 -3
- package/dist/workflows/run/family-reconciler.js.map +1 -1
- package/dist/workflows/run/human-waits.js +4 -4
- package/dist/workflows/run/human-waits.js.map +1 -1
- package/dist/workflows/run/input-delivery.js +11 -11
- package/dist/workflows/run/input-delivery.js.map +1 -1
- package/dist/workflows/run/input-receipts.js +3 -3
- package/dist/workflows/run/input-receipts.js.map +1 -1
- package/dist/workflows/run/launch-context.js +1 -1
- package/dist/workflows/run/launch-context.js.map +1 -1
- package/dist/workflows/run/launch-read-resolver.d.ts +3 -1
- package/dist/workflows/run/launch-read-resolver.js +7 -7
- package/dist/workflows/run/launch-read-resolver.js.map +1 -1
- package/dist/workflows/run/memory-guard.js +2 -2
- package/dist/workflows/run/memory-guard.js.map +1 -1
- package/dist/workflows/run/queued-revival.js +5 -5
- package/dist/workflows/run/queued-revival.js.map +1 -1
- package/dist/workflows/run/run-cancel.js +5 -5
- package/dist/workflows/run/run-cancel.js.map +1 -1
- package/dist/workflows/run/run-finish.js +5 -5
- package/dist/workflows/run/run-finish.js.map +1 -1
- package/dist/workflows/run/run-recovery.js +6 -6
- package/dist/workflows/run/run-recovery.js.map +1 -1
- package/dist/workflows/run/run-settlement.js +12 -12
- package/dist/workflows/run/run-settlement.js.map +1 -1
- package/dist/workflows/run/run-skills.js +1 -1
- package/dist/workflows/run/run-skills.js.map +1 -1
- package/dist/workflows/run/session-events.js +4 -4
- package/dist/workflows/run/session-events.js.map +1 -1
- package/dist/workflows/run/step-loop.js +3 -3
- package/dist/workflows/run/step-loop.js.map +1 -1
- package/dist/workflows/run/step-session.js +2 -2
- package/dist/workflows/run/step-session.js.map +1 -1
- package/dist/workflows/run/subagent-waits.js +2 -2
- package/dist/workflows/run/subagent-waits.js.map +1 -1
- package/dist/workflows/run/turn-bookkeeping.js +2 -2
- package/dist/workflows/run/turn-bookkeeping.js.map +1 -1
- package/dist/workflows/run/turn-nudges.js +6 -6
- package/dist/workflows/run/turn-nudges.js.map +1 -1
- package/dist/workflows/run/turn-settler.d.ts +3 -1
- package/dist/workflows/run/turn-settler.js +10 -10
- package/dist/workflows/run/turn-settler.js.map +1 -1
- package/dist/workflows/run/usage-accounting.js +1 -1
- package/dist/workflows/run/usage-accounting.js.map +1 -1
- package/dist/workflows/run/wake-admission.js +2 -2
- package/dist/workflows/run/wake-admission.js.map +1 -1
- package/dist/workflows/run/worker-executions.js +6 -6
- package/dist/workflows/run/worker-executions.js.map +1 -1
- package/dist/workflows/run/worker-orphans.js +10 -10
- package/dist/workflows/run/worker-orphans.js.map +1 -1
- package/dist/workflows/run/worker-questions.js +14 -14
- package/dist/workflows/run/worker-questions.js.map +1 -1
- package/dist/workflows/run/workflow-position.d.ts +3 -1
- package/dist/workflows/run/worktree-autosave.js +1 -1
- package/dist/workflows/run/worktree-autosave.js.map +1 -1
- package/dist/workflows/run.js +2 -2
- package/dist/workflows/run.js.map +1 -1
- package/package.json +4 -4
- package/scripts/benchmark-stuck-destroys.ts +2 -2
- package/scripts/benchmark-worker-lifecycle.ts +3 -2
- package/dist/runs/private-record-file.js.map +0 -1
- package/dist/runs/worker-deletion-proof.js.map +0 -1
- package/dist/runs/worker-resource-holders.js.map +0 -1
- /package/dist/{runs → delegation}/private-record-file.d.ts +0 -0
- /package/dist/{runs → delegation}/private-record-file.js +0 -0
- /package/dist/{runs → delegation}/worker-deletion-proof.js +0 -0
- /package/dist/{runs → delegation}/worker-resource-holders.js +0 -0
package/dist/runs/ports.d.ts
CHANGED
|
@@ -9,8 +9,11 @@
|
|
|
9
9
|
* that implements it. A later slice may move a method between ports when its topic moves. The store stays the only writer of status and exit fields (ADR 0056).
|
|
10
10
|
*/
|
|
11
11
|
import type { WorkerCollectedResult } from '../contract/index.js';
|
|
12
|
-
import type { RunStore } from './store.ts';
|
|
12
|
+
import type { RunEvent, RunRecord, RunStore } from './store.ts';
|
|
13
13
|
import type { TranscriptFacts } from './transcript-facts.ts';
|
|
14
|
+
import type { WorkerExecution } from './worker-execution.ts';
|
|
15
|
+
import type { WorkerProcessRecord } from '../core/process-stat.ts';
|
|
16
|
+
import type { AgentRunSpec } from '../core/agent-runner.ts';
|
|
14
17
|
export type { RunLifecycleSource } from './lifecycle.ts';
|
|
15
18
|
/** One run's record, by id. Nearly every caller needs only this. */
|
|
16
19
|
export interface RunLookup {
|
|
@@ -70,13 +73,36 @@ export interface RunWrites {
|
|
|
70
73
|
commitDestroyRetry: RunStore['commitDestroyRetry'];
|
|
71
74
|
commitWorkerContinuation: RunStore['commitWorkerContinuation'];
|
|
72
75
|
}
|
|
73
|
-
/** One run's event log. */
|
|
76
|
+
/** One run's event log (`runs/event-log.ts`, `store.eventLog`). */
|
|
74
77
|
export interface RunEventLog {
|
|
75
|
-
appendEvent:
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
appendEvent(runId: string, event: {
|
|
79
|
+
type: string;
|
|
80
|
+
stepId?: string | undefined;
|
|
81
|
+
[key: string]: unknown;
|
|
82
|
+
}): RunEvent;
|
|
83
|
+
emitEphemeral(runId: string, event: {
|
|
84
|
+
type: string;
|
|
85
|
+
stepId?: string;
|
|
86
|
+
[key: string]: unknown;
|
|
87
|
+
}): RunEvent;
|
|
88
|
+
readEvents(runId: string): RunEvent[];
|
|
89
|
+
readEventsAsync(runId: string): Promise<RunEvent[]>;
|
|
90
|
+
hasProjection(runId: string, projectionId: string): boolean;
|
|
91
|
+
}
|
|
92
|
+
/** The reference markers an agent declares and the PR a run created (`runs/event-log.ts`, `store.eventLog`). */
|
|
93
|
+
export interface RunMarkerRefs {
|
|
94
|
+
applyMarkerRefs(runId: string, refs: {
|
|
95
|
+
pr?: number | undefined;
|
|
96
|
+
prs?: readonly number[] | undefined;
|
|
97
|
+
issue?: number | undefined;
|
|
98
|
+
}): RunRecord | undefined;
|
|
99
|
+
recordCreatedPr(runId: string, url: string): RunRecord | undefined;
|
|
100
|
+
}
|
|
101
|
+
/** The scrub of events and free text before they are written or sent (`runs/run-redaction.ts`, `store.redaction`). */
|
|
102
|
+
export interface RunRedaction {
|
|
103
|
+
redactText(text: string): string;
|
|
104
|
+
registerSessionSecret(value: string): void;
|
|
105
|
+
containsSessionSecret(value: string): boolean;
|
|
80
106
|
}
|
|
81
107
|
/** What the transcript says about a run. The type `TranscriptFacts` is the facts themselves. */
|
|
82
108
|
export interface TranscriptFactsPort {
|
|
@@ -96,21 +122,42 @@ export interface WorkerResults {
|
|
|
96
122
|
ignoreCleanup?: boolean;
|
|
97
123
|
}): WorkerCollectedResult;
|
|
98
124
|
}
|
|
99
|
-
/**
|
|
125
|
+
/** The processes of a worker's scope that a core caller stops (`workflows/run/worker-orphans.ts`). */
|
|
126
|
+
export interface WorkerScopeControl {
|
|
127
|
+
empty(workerId: string): boolean;
|
|
128
|
+
stopped(workerId: string): boolean;
|
|
129
|
+
kill(workerId: string): void;
|
|
130
|
+
}
|
|
131
|
+
/** A worker's execution, scope and processes (`delegation/worker-executions.ts`, `store.workerExecutions`). */
|
|
100
132
|
export interface WorkerExecutions {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
133
|
+
readWorkerExecution(id: string): WorkerExecution | undefined;
|
|
134
|
+
workerResourcesSafe(id: string, generation: string, resourceId: string): boolean;
|
|
135
|
+
workerResourceHolders(id: string, generation: string, resourceId: string, opts?: {
|
|
136
|
+
admittingQueued?: boolean;
|
|
137
|
+
}): 'safe' | number[];
|
|
138
|
+
retainWorkerScratchCleanup(id: string): void;
|
|
139
|
+
workerScratchResourcesSafe(id: string, generation: string, resourceId: string): boolean;
|
|
140
|
+
commitWorkerExecutionStart(id: string): string;
|
|
141
|
+
readWorkerProcesses(id: string, generation: string): WorkerProcessRecord | 'absent' | 'unknown';
|
|
142
|
+
spawnScope(id: string): AgentRunSpec['scope'];
|
|
143
|
+
appendWorkerProcess(id: string, generation: string, pid: number, pgid?: number): boolean;
|
|
144
|
+
commitWorkerExecutionComplete(id: string, generation: string, opts?: {
|
|
145
|
+
interrupted?: boolean;
|
|
146
|
+
}): boolean;
|
|
147
|
+
readonly scopes: WorkerScopeControl;
|
|
148
|
+
}
|
|
149
|
+
/** The worker records the store's own paths write, check and remove: owned-run creation, the
|
|
150
|
+
* archive checks and the delegated deletion. */
|
|
151
|
+
export interface WorkerExecutionRecords {
|
|
152
|
+
/** `identity` is checked against the worker identity schema before it is written. */
|
|
153
|
+
writeWorkerIdentity(id: string, identity: unknown): void;
|
|
154
|
+
writeWorkerExecution(id: string, proof: WorkerExecution, fresh?: boolean): void;
|
|
155
|
+
/** A deleted child's receipt replaces the private proof only after the deletion checkpoint. */
|
|
156
|
+
workerDeletionEvidence(id: string): boolean;
|
|
157
|
+
identityPath(id: string, write?: boolean): string;
|
|
158
|
+
executionPath(id: string, write?: boolean): string;
|
|
159
|
+
processesPath(id: string, write?: boolean): string;
|
|
160
|
+
scopePath(id: string, write?: boolean): string;
|
|
114
161
|
}
|
|
115
162
|
/** Whether a run may go, and its deletion (`runs/run-retention.ts`, `store.retention`). */
|
|
116
163
|
export interface RunRetention {
|
|
@@ -135,7 +182,6 @@ export interface RunAccess {
|
|
|
135
182
|
writeRefusal: RunStore['writeRefusal'];
|
|
136
183
|
readonly unavailable: RunStore['unavailable'];
|
|
137
184
|
sourceDataDir: RunStore['sourceDataDir'];
|
|
138
|
-
redactText: RunStore['redactText'];
|
|
139
185
|
isFallbackRun: RunStore['isFallbackRun'];
|
|
140
186
|
runOwnership: RunStore['runOwnership'];
|
|
141
187
|
}
|
package/dist/runs/retention.d.ts
CHANGED
|
@@ -25,7 +25,9 @@ export declare function isReclaimable(run: RunRecord, lookup?: (id: string) => R
|
|
|
25
25
|
*/
|
|
26
26
|
export declare function selectReclaimableWorktrees(runs: readonly RunRecord[], keep: number, lookup?: (id: string) => RunRecord | undefined, workersOf?: (parentId: string) => readonly RunRecord[]): string[];
|
|
27
27
|
/** The store members a real store has and a structural test store may lack: each use checks for it. */
|
|
28
|
-
type RealStoreMembers = Partial<RunAccess & RunFamilyReads & RunPins &
|
|
28
|
+
type RealStoreMembers = Partial<RunAccess & RunFamilyReads & RunPins & {
|
|
29
|
+
readonly workerExecutions: Partial<WorkerExecutions>;
|
|
30
|
+
}>;
|
|
29
31
|
/** The slice of the runs store the enforcer needs, and the worker results a reclaim preparation
|
|
30
32
|
* saves. Kept structural so the enforcer stays easy to test and never imports the concrete store. */
|
|
31
33
|
export interface RetentionStore {
|
package/dist/runs/retention.js
CHANGED
|
@@ -124,15 +124,15 @@ export async function rematerializeReclaimedWorktree(repoRoot, store, runId) {
|
|
|
124
124
|
* evidence or preview work. Structural test stores have no execution machinery and skip that part.
|
|
125
125
|
*/
|
|
126
126
|
export function cleanupSafety(repoRoot, store, run) {
|
|
127
|
-
const execution = store.readWorkerExecution?.(run.id);
|
|
127
|
+
const execution = store.workerExecutions?.readWorkerExecution?.(run.id);
|
|
128
128
|
return () => {
|
|
129
129
|
const refusal = deletionRefusal(run.id, 'worktree', store.sourceDataDir?.(run.id) ?? projectPaths(repoRoot).write);
|
|
130
130
|
if (refusal)
|
|
131
131
|
throw Error(refusal);
|
|
132
132
|
if (run.delegation?.role !== 'worker')
|
|
133
133
|
return;
|
|
134
|
-
if (typeof store.workerResourcesSafe === 'function' && (!execution ||
|
|
135
|
-
!store.workerResourcesSafe(run.id, execution.generation, run.delegation.workspace.resourceId)))
|
|
134
|
+
if (typeof store.workerExecutions?.workerResourcesSafe === 'function' && (!execution ||
|
|
135
|
+
!store.workerExecutions.workerResourcesSafe(run.id, execution.generation, run.delegation.workspace.resourceId)))
|
|
136
136
|
throw Error('Worker resources are not safe to reclaim');
|
|
137
137
|
};
|
|
138
138
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retention.js","sourceRoot":"","sources":["../../src/runs/retention.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC1E,6EAA6E;AAC7E,iFAAiF;AACjF,+EAA+E;AAC/E,iFAAiF;AACjF,iFAAiF;AACjF,4EAA4E;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAC3F,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAIzD;;2EAE2E;AAC3E,MAAM,QAAQ,GAA2B,IAAI,GAAG,CAAY,CAAC,MAAM,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC,CAAC;AAE7F;;kFAEkF;AAClF,SAAS,UAAU,CAAC,GAAc;IAChC,OAAO,GAAG,CAAC,UAAU,IAAI,GAAG,CAAC,SAAS,CAAC;AACzC,CAAC;AAED;4EAC4E;AAC5E,MAAM,UAAU,iBAAiB,CAAC,GAAc,EAAE,MAA6C;IAC7F,IAAI,GAAG,CAAC,UAAU,EAAE,IAAI,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IACpD,MAAM,MAAM,GAAG,MAAM,CAAC,GAAG,CAA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CAAC,QAAQ,EAAE,GAAG,CAAC,YAAY,CAAC,CAAC;QACzC,IAAI,UAAU,CAAC,GAAG,CAAC,YAAY,CAAC;YAAE,OAAO,IAAI,CAAC,CAAC,kCAAkC;QACjF,MAAM,KAAK,GAAG,GAAG,EAAE,CAAC;QACpB,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,mBAAmB,EAAE,KAAK,EAAE,CAAC,CAAC;QACxD,OAAO,KAAK,CAAC;IACf,CAAC;IAAC,MAAM,CAAC;QACP,2EAA2E;QAC3E,OAAO,IAAI,CAAC;IACd,CAAC;YAAS,CAAC;QACT,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC;QAC3C,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { RunRedaction as RunRedactionPort } from './ports.ts';
|
|
2
|
+
import type { RunEvent } from './store.ts';
|
|
3
|
+
export declare class RunRedaction implements RunRedactionPort {
|
|
4
|
+
/** Lazily-collected concrete secret values from the host env (#427). */
|
|
5
|
+
private secretValues;
|
|
6
|
+
/** Controller-issued tokens never persist, including when host-secret redaction is disabled. */
|
|
7
|
+
private readonly sessionSecrets;
|
|
8
|
+
registerSessionSecret(value: string): void;
|
|
9
|
+
containsSessionSecret(value: string): boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Scrub known credential values / token shapes from an event before it is
|
|
12
|
+
* persisted or fanned out. On by default; `CEZ_REDACT_SECRETS=0` opts out.
|
|
13
|
+
*/
|
|
14
|
+
redact<T extends RunEvent>(event: T): T;
|
|
15
|
+
/** Best-effort scrub of one free-text string bound for `runs.json`. Honors
|
|
16
|
+
* the `CEZ_REDACT_SECRETS=0` opt-out itself so every caller inherits it. */
|
|
17
|
+
redactText(text: string): string;
|
|
18
|
+
private hostSecrets;
|
|
19
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The redaction topic of the run store (hearsay-tools/squawk#4040): the scrub of events and free
|
|
3
|
+
* text before they reach disk or the live wire. `RunStore` keeps one of these as `store.redaction`.
|
|
4
|
+
*/
|
|
5
|
+
import { productEnv } from '../core/product-env.js';
|
|
6
|
+
import { collectSecretValues, redactDeep } from '../core/secret-redaction.js';
|
|
7
|
+
import { redactText } from './record-write-rules.js';
|
|
8
|
+
export class RunRedaction {
|
|
9
|
+
/** Lazily-collected concrete secret values from the host env (#427). */
|
|
10
|
+
secretValues = null;
|
|
11
|
+
/** Controller-issued tokens never persist, including when host-secret redaction is disabled. */
|
|
12
|
+
sessionSecrets = new Set();
|
|
13
|
+
registerSessionSecret(value) { this.sessionSecrets.add(value); }
|
|
14
|
+
containsSessionSecret(value) { return [...this.sessionSecrets].some(secret => value.includes(secret)); }
|
|
15
|
+
/**
|
|
16
|
+
* Scrub known credential values / token shapes from an event before it is
|
|
17
|
+
* persisted or fanned out. On by default; `CEZ_REDACT_SECRETS=0` opts out.
|
|
18
|
+
*/
|
|
19
|
+
redact(event) {
|
|
20
|
+
const safe = this.sessionSecrets.size ? redactDeep(event, [...this.sessionSecrets]) : event;
|
|
21
|
+
if (productEnv('REDACT_SECRETS') === '0')
|
|
22
|
+
return safe;
|
|
23
|
+
return redactDeep(safe, this.hostSecrets());
|
|
24
|
+
}
|
|
25
|
+
/** Best-effort scrub of one free-text string bound for `runs.json`. Honors
|
|
26
|
+
* the `CEZ_REDACT_SECRETS=0` opt-out itself so every caller inherits it. */
|
|
27
|
+
redactText(text) {
|
|
28
|
+
return redactText(text, [...this.sessionSecrets], () => this.hostSecrets());
|
|
29
|
+
}
|
|
30
|
+
hostSecrets() {
|
|
31
|
+
if (this.secretValues === null)
|
|
32
|
+
this.secretValues = collectSecretValues();
|
|
33
|
+
return this.secretValues;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=run-redaction.js.map
|
|
@@ -0,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AAC;IAEO,WAAW;QACjB,IAAI,IAAI,CAAC,YAAY,KAAK,IAAI;YAAE,IAAI,CAAC,YAAY,GAAG,mBAAmB,EAAE,CAAC;QAC1E,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;CACF"}
|
|
@@ -39,7 +39,7 @@ export interface RetentionState {
|
|
|
39
39
|
delegation: DelegationState;
|
|
40
40
|
}>): void;
|
|
41
41
|
applyArchived(run: RunRecord, archived: boolean): boolean;
|
|
42
|
-
/** The worker deletion checks
|
|
42
|
+
/** The worker deletion checks, in today's order (`store.workerExecutions`, hearsay-tools/squawk#4039). */
|
|
43
43
|
workerDeletionEvidence(id: string): boolean;
|
|
44
44
|
readonly workerResults: WorkerResults;
|
|
45
45
|
readWorkerExecution(id: string): WorkerExecution | undefined;
|
package/dist/runs/store.d.ts
CHANGED
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
import { type RunLifecycleSource } from './lifecycle.ts';
|
|
2
2
|
import { type PeerTaskPageOptions } from './run-summary-page.ts';
|
|
3
3
|
export { parseStoredSummary } from './run-summary-page.ts';
|
|
4
|
-
import {
|
|
4
|
+
import type { WorkerExecutionRecords, WorkerExecutions } from './ports.ts';
|
|
5
5
|
import { z } from 'zod';
|
|
6
|
-
import { type ScopeRecord, type SpawnScope } from '../worker-scope/scope.ts';
|
|
7
|
-
import { WorkerScopes } from '../worker-scope/worker-scopes.ts';
|
|
8
6
|
import { queuedMessageSchema } from '../contract/index.js';
|
|
9
7
|
import { type WaitRegistrationReceipt } from '../contract/index.js';
|
|
10
8
|
import type { ArchiveFinishedScope, ArchivedRunsResponse, ArchivePullRequestIdentity, ConversationState, AgentInput, InboxClaim, DelegationState, MergedPullRequest, RunSummary, Wait, WorkerDestroyRetry } from '../contract/index.js';
|
|
11
9
|
import { type AutomationNames } from '../contract/index.js';
|
|
12
10
|
import { RunTranscriptFacts } from './transcript-facts-topic.ts';
|
|
13
|
-
import { type WorkerExecutionIdentity } from '../delegation/execution-identity.ts';
|
|
14
|
-
import { type WorkerProcessRecord } from '../core/process-stat.ts';
|
|
15
11
|
import { workflowDefSchema } from '../workflows/types.ts';
|
|
16
12
|
import { type OutcomeDependencies, type OutcomeReceipt, type RunOutcome } from './outcome-commit.ts';
|
|
17
13
|
import { type ExitCall, type RunExitId, type RunPatch } from './run-exits.ts';
|
|
@@ -25,6 +21,8 @@ import { type RawExtras } from './raw-record.ts';
|
|
|
25
21
|
import { RunStoreOpenError } from './store-open-error.ts';
|
|
26
22
|
import { type SpawnCapacityRefusal } from './owned-run-create.ts';
|
|
27
23
|
import { WorkerResultsTopic } from './worker-results.ts';
|
|
24
|
+
import { RunEventLogTopic } from './event-log.ts';
|
|
25
|
+
import { RunRedaction } from './run-redaction.ts';
|
|
28
26
|
/** Per-store persistence adapter; the second argument is the normal fenced transaction. */
|
|
29
27
|
export type RunStorePersistence = (changes: RunDatabaseChanges, transaction: RunDatabase['transaction']) => RunDatabaseCommit;
|
|
30
28
|
export type RunStatus = 'queued' | 'running' | 'waiting' | 'review' | 'done' | 'failed' | 'cancelled';
|
|
@@ -3269,8 +3267,6 @@ export declare class RunStore {
|
|
|
3269
3267
|
readonly lifecycle: RunLifecycleSource;
|
|
3270
3268
|
/** The lifecycle events run exits write (B12). */
|
|
3271
3269
|
private readonly exitEvents;
|
|
3272
|
-
/** Every worker's process scope (ADR 0032): spawn sites, Continue and destroy reach it here. */
|
|
3273
|
-
readonly scopes: WorkerScopes;
|
|
3274
3270
|
/** Runs gone from memory whose rows the next save or commit deletes. */
|
|
3275
3271
|
private readonly deleted;
|
|
3276
3272
|
/** Deleted runs whose history files (events, handoff, images, artifacts) go once the delete of
|
|
@@ -3314,6 +3310,14 @@ export declare class RunStore {
|
|
|
3314
3310
|
readonly retention: RunRetentionTopic;
|
|
3315
3311
|
/** The saved snapshot of a worker's collected result (hearsay-tools/squawk#4038). */
|
|
3316
3312
|
readonly workerResults: WorkerResultsTopic;
|
|
3313
|
+
/** The event log and reference markers (hearsay-tools/squawk#4040). */
|
|
3314
|
+
readonly eventLog: RunEventLogTopic;
|
|
3315
|
+
/** The scrub of events and free text (hearsay-tools/squawk#4040). */
|
|
3316
|
+
readonly redaction: RunRedaction;
|
|
3317
|
+
private executions;
|
|
3318
|
+
/** A worker's execution, process, identity and scope records (hearsay-tools/squawk#4039), built on
|
|
3319
|
+
* first use by the factory this process registered; throws when none is registered. */
|
|
3320
|
+
get workerExecutions(): WorkerExecutions & WorkerExecutionRecords;
|
|
3317
3321
|
private readonly liveItems;
|
|
3318
3322
|
/** Capture both sources on the same synchronous sequence boundary before history IO. */
|
|
3319
3323
|
liveReadSnapshot(runId: string): {
|
|
@@ -3415,6 +3419,8 @@ export declare class RunStore {
|
|
|
3415
3419
|
adoptFallbackFamily(id: string): boolean;
|
|
3416
3420
|
private fallbackRefusal;
|
|
3417
3421
|
/** Run files are written only for a family this store may write, never a fallback family. */
|
|
3422
|
+
/** The error `appendEvent` throws for a run this store cannot write or does not know. */
|
|
3423
|
+
private missingRunError;
|
|
3418
3424
|
private writeDir;
|
|
3419
3425
|
/** Every run whose family another process owns (`foreignClaimedRunIds`). */
|
|
3420
3426
|
listForeignClaimedRunIds(): string[];
|
|
@@ -3749,7 +3755,7 @@ export declare class RunStore {
|
|
|
3749
3755
|
input: AgentInput;
|
|
3750
3756
|
}): void;
|
|
3751
3757
|
/** Create an owned worker run and its parent receipt; `createStoreOwnedRun` holds the checks. */
|
|
3752
|
-
createOwnedRun(input: Parameters<RunStore['createRun']>[0], parentId: string, requestId: string, worker: DelegationState, requestHash: string, spawnCapacityRefusal: SpawnCapacityRefusal, executionIdentity?:
|
|
3758
|
+
createOwnedRun(input: Parameters<RunStore['createRun']>[0], parentId: string, requestId: string, worker: DelegationState, requestHash: string, spawnCapacityRefusal: SpawnCapacityRefusal, executionIdentity?: unknown): RunRecord;
|
|
3753
3759
|
/**
|
|
3754
3760
|
* Durably replace or delete staged rows together with pending dirty rows. Persist before
|
|
3755
3761
|
* changing held objects or notifying subscribers. On failure retain all pending state; flush()
|
|
@@ -3873,120 +3879,11 @@ export declare class RunStore {
|
|
|
3873
3879
|
* (hearsay-tools/cezarion#1616); absent stamps both.
|
|
3874
3880
|
*/
|
|
3875
3881
|
markAllRead(automation?: boolean): number;
|
|
3876
|
-
appendEvent(runId: string, event: {
|
|
3877
|
-
type: string;
|
|
3878
|
-
stepId?: string | undefined;
|
|
3879
|
-
[key: string]: unknown;
|
|
3880
|
-
}): RunEvent;
|
|
3881
|
-
/**
|
|
3882
|
-
* Apply agent-declared reference markers (spec 2026-07-18-task-ref-markers).
|
|
3883
|
-
* Marker values are authoritative for the display tier: they overwrite the
|
|
3884
|
-
* regex/namer numbers unless the prompt identifies the originating issue, and a declared PR re-resolves the referenced URL
|
|
3885
|
-
* against the candidate working set — including down to `undefined` when no
|
|
3886
|
-
* candidate matches (a wrong chip is worse than no chip). The created tier
|
|
3887
|
-
* (`pullRequestUrl`) is deliberately untouched.
|
|
3888
|
-
*
|
|
3889
|
-
* One declaration is NOT a statement about the referenced tier: the number of the PR this run
|
|
3890
|
-
* itself created. See `referencedPrDeclaration` — the marker contract asks the agent to
|
|
3891
|
-
* re-declare after it opens a PR, and taking that literally cost the task the PR it was about.
|
|
3892
|
-
*/
|
|
3893
|
-
applyMarkerRefs(runId: string, refs: {
|
|
3894
|
-
pr?: number | undefined;
|
|
3895
|
-
prs?: readonly number[] | undefined;
|
|
3896
|
-
issue?: number | undefined;
|
|
3897
|
-
}): RunRecord | undefined;
|
|
3898
|
-
/** Authoritative creation keeps the first scalar for publishing, plus every created identity. */
|
|
3899
|
-
recordCreatedPr(runId: string, url: string): RunRecord | undefined;
|
|
3900
|
-
private accumulatePullRequests;
|
|
3901
|
-
/**
|
|
3902
|
-
* Fan an event out to live subscribers WITHOUT writing it to the NDJSON
|
|
3903
|
-
* file — the channel for coalesced `item.delta` flushes (protocol-v2
|
|
3904
|
-
* performance guardrail: raw deltas never hit disk; replay = the persisted
|
|
3905
|
-
* snapshots). Stamped with `seq`/`ts` like persisted lines so the live
|
|
3906
|
-
* wire keeps one ordering axis. Finite polling coalesces active item content
|
|
3907
|
-
* into bounded in-memory snapshots on that clock; disk replay still has gaps
|
|
3908
|
-
* (dedup compares with `>`).
|
|
3909
|
-
*/
|
|
3910
|
-
emitEphemeral(runId: string, event: {
|
|
3911
|
-
type: string;
|
|
3912
|
-
stepId?: string;
|
|
3913
|
-
[key: string]: unknown;
|
|
3914
|
-
}): RunEvent;
|
|
3915
|
-
/** Lazily-collected concrete secret values from the host env (#427). */
|
|
3916
|
-
private secretValues;
|
|
3917
|
-
/** Controller-issued tokens never persist, including when host-secret redaction is disabled. */
|
|
3918
|
-
private readonly sessionSecrets;
|
|
3919
|
-
registerSessionSecret(value: string): void;
|
|
3920
|
-
containsSessionSecret(value: string): boolean;
|
|
3921
|
-
/**
|
|
3922
|
-
* Scrub known credential values / token shapes from an event before it is
|
|
3923
|
-
* persisted or fanned out. On by default; `CEZ_REDACT_SECRETS=0` opts out.
|
|
3924
|
-
*/
|
|
3925
|
-
private redact;
|
|
3926
|
-
/** Best-effort scrub of one free-text string bound for `runs.json`. Honors
|
|
3927
|
-
* the `CEZ_REDACT_SECRETS=0` opt-out itself so every caller inherits it. */
|
|
3928
|
-
redactText(text: string): string;
|
|
3929
|
-
private hostSecrets;
|
|
3930
|
-
hasProjection(runId: string, projectionId: string): boolean;
|
|
3931
3882
|
/** Indexed family enumeration, including members not yet flushed to SQLite. */
|
|
3932
3883
|
listFamilyRunIds(rootId: string): string[];
|
|
3933
|
-
/** `readEvents` off the event loop (async read and async brotli), for collection paths. */
|
|
3934
|
-
readEventsAsync(runId: string): Promise<RunEvent[]>;
|
|
3935
|
-
readEvents(runId: string): RunEvent[];
|
|
3936
|
-
/** Private process-generation evidence; never part of run JSON or SSE. */
|
|
3937
|
-
private identityPath;
|
|
3938
|
-
readWorkerIdentity(id: string): WorkerExecutionIdentity | undefined;
|
|
3939
|
-
private writeWorkerIdentity;
|
|
3940
|
-
private executionPath;
|
|
3941
|
-
readWorkerExecution(id: string): WorkerExecution | undefined;
|
|
3942
|
-
private writeWorkerExecution;
|
|
3943
|
-
/** Complete execution is not permission to reuse/delete persistent resources (#738).
|
|
3944
|
-
* Synchronous, fresh and generation/resource fenced; callers hold admission off across awaits. */
|
|
3945
|
-
workerResourcesSafe(id: string, generation: string, resourceId: string): boolean;
|
|
3946
|
-
/** `workerResourcesSafe` with the refusal's live PIDs (empty when no PID explains it). */
|
|
3947
|
-
workerResourceHolders(id: string, generation: string, resourceId: string, opts?: {
|
|
3948
|
-
admittingQueued?: boolean;
|
|
3949
|
-
}): 'safe' | number[];
|
|
3950
|
-
/** Upgrade a legacy completed checkpoint while terminal task ownership is still known.
|
|
3951
|
-
* No holder scan here: settlement and scheduling must never wait on cleanup proof. */
|
|
3952
|
-
retainWorkerScratchCleanup(id: string): void;
|
|
3953
|
-
/** Cleanup can outlive its index row, but never its generation or terminal task intent. */
|
|
3954
|
-
workerScratchResourcesSafe(id: string, generation: string, resourceId: string): boolean;
|
|
3955
|
-
commitWorkerExecutionStart(id: string): string;
|
|
3956
|
-
/** Private process record (#469): which processes a generation spawned, never part of run JSON or SSE. */
|
|
3957
|
-
private processesPath;
|
|
3958
|
-
/** Tri-state: only ENOENT is `absent` (legacy, scan-only). A present record that is unreadable,
|
|
3959
|
-
* wrongly permissioned, malformed or of another generation is `unknown`: never finalized or reaped. */
|
|
3960
|
-
readWorkerProcesses(id: string, generation: string): WorkerProcessRecord | 'absent' | 'unknown';
|
|
3961
|
-
private writeWorkerProcesses;
|
|
3962
|
-
/** Private scope record: the cgroups and process groups the worker owns (ADR 0032). */
|
|
3963
|
-
private scopePath;
|
|
3964
|
-
/** Tri-state like the process record: only ENOENT is `absent`. */
|
|
3965
|
-
readWorkerScope(id: string): ScopeRecord | 'absent' | 'unknown';
|
|
3966
|
-
/** Durable before the caller acts on it. */
|
|
3967
|
-
writeWorkerScope(id: string, record: ScopeRecord): void;
|
|
3968
|
-
/** The scope a run's processes start in: a worker's own, none for any other run (ADR 0032). */
|
|
3969
|
-
spawnScope(id: string): SpawnScope | undefined;
|
|
3970
|
-
/** Bound to the current generation. Past the cap the record never drops an entry: the
|
|
3971
|
-
* working-directory scan is the remaining evidence. */
|
|
3972
|
-
appendWorkerProcess(id: string, generation: string, pid: number, pgid?: number): boolean;
|
|
3973
|
-
commitWorkerExecutionComplete(id: string, generation: string, opts?: {
|
|
3974
|
-
interrupted?: boolean;
|
|
3975
|
-
}): boolean;
|
|
3976
|
-
/** A deleted child's receipt replaces the private proof only after the deletion checkpoint. */
|
|
3977
|
-
private workerDeletionEvidence;
|
|
3978
|
-
private workerDeletionResult;
|
|
3979
3884
|
/** Write the pending rows out now (used on shutdown). */
|
|
3980
3885
|
flush(): void;
|
|
3981
3886
|
private seqs;
|
|
3982
|
-
private nextSeq;
|
|
3983
|
-
/** After a restart the in-memory counter is empty while the run's NDJSON file
|
|
3984
|
-
* keeps the history. Restarting from 1 would collide with the seqs a client
|
|
3985
|
-
* already replayed — its `seq > maxSeq` dedup then silently drops every
|
|
3986
|
-
* resumed event, even across a reload (the frozen-transcript symptom class
|
|
3987
|
-
* of #424). One file read on the first post-restart append per run. */
|
|
3988
|
-
private rehydrateSeq;
|
|
3989
|
-
private eventsPath;
|
|
3990
3887
|
/** Same location `handoffPath()` in handoff.ts produces — inlined to keep
|
|
3991
3888
|
* the store free of upward imports. */
|
|
3992
3889
|
private handoffPath;
|