@osolmaz/pi-workflows 0.8.0 → 0.8.2

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 CHANGED
@@ -13,9 +13,8 @@ structured, validated output to route on. See the
13
13
  [design philosophy](docs/DESIGN_PHILOSOPHY.md) for the principles behind the
14
14
  engine and its public parts. Running steps can publish durable [workflow
15
15
  updates](docs/WORKFLOW_UPDATES.md), including progress counts and ETA data.
16
- Remote workers can publish the same tracks through the storage-neutral
17
- [durable job progress API](docs/JOB_PROGRESS.md). Agent instructions use compact
18
- [workflow step messages](docs/WORKFLOW_STEP_MESSAGES.md), and the built-in
16
+ Agent instructions use compact [workflow step
17
+ messages](docs/WORKFLOW_STEP_MESSAGES.md), and the built-in
19
18
  [monitor](docs/MONITOR.md) reports every check without starting an extra
20
19
  assistant turn.
21
20
 
@@ -201,6 +201,7 @@ const monitorWorkflow = defineWorkflow({
201
201
  ? `Previous progress: ${formatProgressReport(priorEstimate.tracks.map((track) => track.estimate))}`
202
202
  : "There is no previous measured progress.",
203
203
  "Use available tools to inspect the current source of truth. Observe only unless the task explicitly authorizes a mutation.",
204
+ "You are the regular Pi model running this check and the observation adapter. When useful measurable facts appear during the check, publish them with workflow action update. Include the latest tracks in the final submission. Do not require the monitored target to implement a Pi-specific progress API, file, store, schema, or command.",
204
205
  "Every accepted check must include a concise user-facing report. Add progress tracks only when the target provides measurable facts. Submit observed counts and target-provided finish times; do not invent rates or an ETA.",
205
206
  "Choose route continue or stop.",
206
207
  ].join("\n\n");
@@ -1 +1 @@
1
- {"version":3,"file":"monitor.workflow.js","sourceRoot":"","sources":["../../src/builtins/monitor.workflow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACnG,OAAO,EACL,gBAAgB,EAChB,oBAAoB,GAGrB,MAAM,0BAA0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EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE;KAC/B;CACF,CAAC,CAAC;AAEH,eAAe,eAAe,CAAC"}
package/docs/MONITOR.md CHANGED
@@ -19,13 +19,13 @@ The monitor checks a target, sends one status notification after every accepted
19
19
 
20
20
  | Field | Required | Type | Default | Meaning |
21
21
  | --------------------- | -------- | ------- | ------------------ | -------------------------------- |
22
- | `task` | Yes | string | None | Self-contained observation task. |
22
+ | `task` | Yes | string | None | Self-contained monitor task. |
23
23
  | `everyMinutes` | No | integer | `30` | Minutes between accepted checks. |
24
24
  | `stopWhen` | No | string | Explicit user stop | Condition that ends monitoring. |
25
25
  | `maxChecks` | No | integer | `1000` | Run safety limit. |
26
26
  | `checkTimeoutMinutes` | No | integer | Derived | Timeout for one agent check. |
27
27
 
28
- `task` is 1 to 8,000 characters after trimming. It should name the target, stable identifier, source of truth, durable outputs, and observation boundary. It must state any authorized mutations. Monitoring is read-only when the task does not authorize a mutation.
28
+ `task` is 1 to 8,000 characters after trimming. It should name the target, stable identifier, source of truth, durable outputs, authorized routine work, and safety boundary. It must state any authorized mutations. Monitoring is read-only when the task does not authorize a mutation.
29
29
 
30
30
  `everyMinutes` is from 1 through 1,440. The interval begins after a check report is durably queued. It does not delay the first check.
31
31
 
@@ -124,6 +124,14 @@ It tells the model that every accepted check must include a concise report. It t
124
124
 
125
125
  A check may use available tools to read current state. It must use the target's authoritative source instead of treating a prior report or workflow update as current truth.
126
126
 
127
+ ## Progress ownership boundary
128
+
129
+ The regular Pi model running the check is the observation adapter. It uses the target-specific tools authorized by the task, converts observed facts into `pi-workflows.progress.v1` tracks, and publishes them through the existing `workflow` tool. Pi Workflows validates, stores, estimates, and displays those tracks.
130
+
131
+ The monitored target stays independent of Pi Workflows. A monitor must not require a target Job or application to import Pi Workflows, emit a Pi schema, write a Pi progress file, expose a Pi endpoint, create a progress store, or add a progress reader command solely for monitoring. Provider-specific clients and credentials do not belong in Pi Workflows.
132
+
133
+ When a target does not expose a factual count, total, or source estimate, the check reports that ETA is unavailable. Better application telemetry is separate work. It should expose normal operational facts for all operators, not a Pi-specific reporting protocol.
134
+
127
135
  ## Progress publication
128
136
 
129
137
  `estimate` keeps the last eight usable intervals for each track in its normal node output. The output is durable and becomes the prior estimator state on the next loop visit.
@@ -242,11 +250,6 @@ One monitor can track several processes. Each uses a stable progress key. A miss
242
250
 
243
251
  The progress estimator treats each key independently. A phase, unit, total, or counter reset in one track does not reset another track.
244
252
 
245
- Remote Jobs can publish the same tracks in a strict
246
- [`pi-workflows.job-progress.v1` snapshot](JOB_PROGRESS.md). A monitor discovers
247
- the snapshot from immutable Job labels, validates its identity, and submits its
248
- tracks without copying log-derived guesses into progress fields.
249
-
250
253
  ## Interval and lifetime
251
254
 
252
255
  The normal workflow engine remains finite. The built-in monitor therefore retains the 1,000-check safety ceiling and must not claim to be mathematically unbounded.
@@ -257,11 +260,11 @@ The monitor skill must disclose a surfaced host limit and must never invent a sm
257
260
 
258
261
  ## Safety boundaries
259
262
 
260
- Monitoring authorizes observation and scheduled checks. It does not authorize retries, restarts, scaling, deployment, publication, cancellation of the target, or higher spending.
263
+ An observation-only request authorizes only observation and scheduled checks. When the user asks the monitor to keep an objective running or finish it, the monitor skill may record routine, bounded work in `task`, including retries, restarts, pinned task code, tests, configuration repairs, and temporary cleanup. The task must preserve the exact objective and state every mutation boundary.
261
264
 
262
265
  A progress object is data. It cannot contain a command or grant execution authority. Fixed probes belong in workflow-authored `action` or `shell` nodes.
263
266
 
264
- Paid compute, inference runtime, and other domain policies continue to apply to every check.
267
+ A monitoring request does not create spending approval or a default spending ceiling. Existing approvals can cover paid actions, and the monitor should continue without another prompt while each action stays within them. Paid compute, inference runtime, and other domain policies continue to apply to every check.
265
268
 
266
269
  ## Validation and acceptance
267
270
 
@@ -76,6 +76,14 @@ Updates do not:
76
76
 
77
77
  A node's final result remains the only value that completes the node and controls routing.
78
78
 
79
+ ## Model-mediated observation
80
+
81
+ For monitoring, the regular Pi model running the workflow step observes the external target and publishes progress with the existing `workflow` tool. This is the intended adapter boundary. Deterministic runtime code validates, persists, estimates, and renders the submitted data.
82
+
83
+ External Jobs and applications do not need a Pi Workflows dependency or reporting protocol. Provider-specific observation stays in the agent task and its authorized tools. If the target does not expose enough facts, the model publishes only what is known and leaves ETA unavailable.
84
+
85
+ Do not add a transport, endpoint, store, schema, or provider integration when the regular Pi model can observe the target and use `workflow update` or `submit`.
86
+
79
87
  ## Public types
80
88
 
81
89
  The workflow layer adds these public types:
package/docs/workflows.md CHANGED
@@ -349,8 +349,10 @@ The first check runs immediately. `everyMinutes` defaults to 30. Each accepted
349
349
  check must provide one concise report and choose `continue` or `stop`. The
350
350
  runtime queues that report as a workflow notification with `triggerTurn:
351
351
  false`, so it does not cause an assistant reply. A check can also provide
352
- independent progress tracks. Pi Workflows validates the counts and calculates
353
- rates, confidence, and ETA without a model.
352
+ independent progress tracks. The regular Pi model running the check observes
353
+ the target and submits those facts. Pi Workflows validates the counts and
354
+ calculates rates, confidence, and ETA deterministically. The target does not
355
+ need a Pi Workflows dependency or reporting protocol.
354
356
 
355
357
  Intervals must be whole minutes from 1 through 1,440. When `stopWhen` is
356
358
  omitted, the monitor stops only after an explicit user request. `maxChecks`
@@ -369,16 +371,6 @@ and resume later by running that wait again from the beginning.
369
371
  A monitor uses the session's single active workflow slot. It does not provide
370
372
  cron syntax, calendar scheduling, OS notifications, or a background service.
371
373
 
372
- ### Durable remote Job progress
373
-
374
- Remote workers can publish the same progress tracks through
375
- `@osolmaz/pi-workflows/job-progress`. The storage-neutral reporter writes a
376
- strict, versioned snapshot through an application-supplied callback. A monitor
377
- can read consecutive snapshots from an existing remote store and use the normal
378
- progress estimator without treating logs as durable state. See
379
- [JOB_PROGRESS.md](JOB_PROGRESS.md) for the API, snapshot schema, restart rules,
380
- and discovery labels.
381
-
382
374
  ## The step contract
383
375
 
384
376
  Every `agent` prompt ends with a step contract block naming the workflow, the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@osolmaz/pi-workflows",
3
- "version": "0.8.0",
3
+ "version": "0.8.2",
4
4
  "description": "Workflow and controller runtime with a live terminal viewer for the pi coding agent",
5
5
  "keywords": [
6
6
  "pi-package"
@@ -39,10 +39,6 @@
39
39
  "./controllers": {
40
40
  "types": "./dist/controllers/index.d.ts",
41
41
  "default": "./dist/controllers/index.js"
42
- },
43
- "./job-progress": {
44
- "types": "./dist/job-progress/index.d.ts",
45
- "default": "./dist/job-progress/index.js"
46
42
  }
47
43
  },
48
44
  "publishConfig": {
@@ -8,7 +8,7 @@ compatibility: Requires Pi Workflows and the built-in monitor workflow.
8
8
 
9
9
  Use the built-in Pi `monitor` workflow as an autopilot for the requested objective. Monitoring is not passive status polling. The agent must maintain nominal operation, repair recoverable failures, resume durable work, and continue until the complete objective is verified or a material blocker makes safe continuation impossible.
10
10
 
11
- A monitor request authorizes routine operational actions that are necessary to preserve and finish the stated objective, subject to the conversation and repository approval boundaries. These actions can include restarting or resuming the same non-paid Job or process, repairing an exact operational configuration or storage-path error, retrying transient infrastructure failures, restoring a verified checkpoint, and replacing a failed physical attempt with the same immutable execution contract. Paid launches, resumes, retries, or replacements require the explicit approval described below. Monitoring does not authorize changing the objective, method, model, data source, production selection, or other consequential contract.
11
+ A monitor request authorizes routine, bounded work needed to preserve and finish the stated objective, subject to the conversation and repository approval boundaries. Apply other skills as safety and operating instructions. Do not turn their normal checks into new approval requests when the monitored objective and an existing approval already cover the action. Monitoring does not authorize changing the objective, method, model, data source, production selection, or other consequential contract.
12
12
 
13
13
  ## Prepare and start without delay
14
14
 
@@ -26,7 +26,7 @@ Do not finish the initiating turn before the workflow start call. If a safe cont
26
26
 
27
27
  Derive the workflow input from the full conversation:
28
28
 
29
- - `task`: State the complete objective, the exact current target and stable identifiers, authoritative status sources, durable progress and final-output surfaces, approved recovery actions, immutable boundaries, cost and credential rules, and required validation or downstream operations.
29
+ - `task`: State the complete objective, the exact current target and stable identifiers, authoritative status sources, durable progress and final-output surfaces, routine actions authorized by the monitor request, other recorded approvals, immutable boundaries, cost and credential rules, and required validation or downstream operations.
30
30
  - `everyMinutes`: Use the user's interval when present. Use `30` when the user gives no interval. The built-in workflow accepts intervals from 1 minute through 24 hours.
31
31
  - `stopWhen`: Infer verified completion from the full conversation. Describe completion of the complete objective, not only the end of one physical process. Also name material blockers that require human intervention.
32
32
 
@@ -34,11 +34,24 @@ When the conversation gives no clear finish criterion, set `stopWhen` to `Stop o
34
34
 
35
35
  Do not invent a finite check count. Omit `maxChecks` unless the user explicitly requests one. The workflow host can apply its own safety upper bound. Disclose that bound if it appears.
36
36
 
37
+ ## Keep routine work moving
38
+
39
+ While the workflow is active, do routine, bounded work required by the exact objective without asking for another confirmation. This includes:
40
+
41
+ - downloading, building, and running code pinned by the monitored objective;
42
+ - building and running task containers from a pinned benchmark or repository revision;
43
+ - installing pinned dependencies in the planned isolated environment;
44
+ - running canaries, tests, retries, restarts, and temporary cleanup;
45
+ - repairing configuration or storage-path errors without changing the method; and
46
+ - continuing paid work that already has applicable approval.
47
+
48
+ Pinned third-party code is part of the objective when the task names its exact repository, revision, lock file, image digest, or benchmark release. Resolve mutable references to immutable revisions when the applicable safety rules require it. Do not ask once per image, package, or task. New unpinned code, unrelated code, or broader privileges remain outside the monitor's authority.
49
+
37
50
  ## Paid infrastructure authority
38
51
 
39
- A monitoring request does not grant spending approval or create a default spending ceiling. Before launching, resuming, retrying, or replacing paid work, load and follow the paid-compute, provider, Job-control, and runtime skills that apply. Present the required estimate and obtain explicit approval when those policies require it.
52
+ A monitoring request does not grant spending approval or create a default spending ceiling. Before launching, resuming, retrying, or replacing paid work, load and follow the paid-compute, provider, Job-control, and runtime skills that apply. Use any applicable approval already recorded in the conversation or repository instructions.
40
53
 
41
- After approval, preserve the exact method, hardware, concurrency, cumulative cost ceiling, and recovery assumptions in the monitor task. Continue only within that approved contract. Stop for a decision before new paid work when there is no applicable approval, when the ceiling would be exceeded, or when evidence invalidates an approved assumption.
54
+ When the paid action remains within the approved method, hardware, concurrency, cumulative cost ceiling, and recovery assumptions, continue without asking again. Stop for a decision before new paid work only when there is no applicable approval, the ceiling would be exceeded, or evidence invalidates an approved assumption.
42
55
 
43
56
  The monitor may use a credential only when the conversation or repository has already authorized that credential's source, destination, and purpose. It may reuse that authorization for retries and replacement attempts under the same objective. It must not discover unrelated credentials, broaden scopes, copy credentials to a new store, or print secret values.
44
57
 
@@ -80,9 +93,11 @@ The workflow sends each report as a Pi notification. Notifications do not start
80
93
 
81
94
  ## Publish progress when measurable
82
95
 
96
+ The regular Pi model that runs the check is the observation adapter. It reads the target through the tools and sources named in the task, maps observed facts to progress tracks, and publishes them through the existing `workflow` tool. There is no separate monitor model.
97
+
83
98
  Progress is optional. Do not invent it for work that has no factual count, total, rate, or source estimate.
84
99
 
85
- When the target exposes measurable progress, include one or more tracks in the check output. Use a stable key for each independent process or workstream. Use `overall` for a real aggregate only; do not add unrelated tracks together.
100
+ When the target exposes measurable progress, publish one or more tracks with `workflow` action `update` while the check is active when that gives the user useful current state. Include the latest tracks in the final check output, then call `submit` exactly once. Use a stable key for each independent process or workstream. Use `overall` for a real aggregate only; do not add unrelated tracks together.
86
101
 
87
102
  Each track uses `pi-workflows.progress.v1` and can include:
88
103
 
@@ -95,17 +110,9 @@ Submit observed facts. The workflow computes rates, confidence, remaining work,
95
110
 
96
111
  For several concurrent processes, publish one stable track per process. The Pi widget and viewers show them separately and keep each ETA independent.
97
112
 
98
- ### Read durable job snapshots
99
-
100
- A remote job can advertise a `pi-workflows.job-progress.v1` snapshot with these immutable labels:
101
-
102
- - `progress_schema=pi-workflows.job-progress.v1`
103
- - `progress_bucket=<existing-bucket>`
104
- - `progress_prefix=<path-before-job-id>`
105
-
106
- When these labels exist, form `<progress_prefix>/<physical-job-id>/progress.json`, read it from the named existing store with an already authorized credential, and validate it with the installed `@osolmaz/pi-workflows/job-progress` API. Reject a snapshot whose job ID, source revision, or work-contract identity does not match the observed Job. Do not follow a path or credential named inside unvalidated data.
113
+ Keep the monitored target independent of Pi Workflows. Do not require a target Job or application to import Pi Workflows, emit a Pi schema, write a Pi progress file, expose a Pi endpoint, create a progress store, or add a progress reader command solely for monitoring. Do not add provider-specific clients or credentials to Pi Workflows. Target-specific observation belongs in the check task and is performed by the regular Pi model with already authorized tools.
107
114
 
108
- Publish the snapshot tracks under stable keys. Preserve consecutive samples so the workflow can estimate ETA from measured progress. Treat a stale or missing snapshot as unavailable progress, not as proof that the Job stopped. Receipts, hashes, manifests, and final outputs remain the completion evidence.
115
+ Before proposing a new progress API, transport, schema, or persistence layer, prove that the model cannot observe the needed facts and publish them through the existing `workflow update` and `submit` path. If the target does not expose enough facts for ETA, report `ETA unavailable`. Application telemetry changes require separate scope and should expose normal operational facts rather than a Pi-specific protocol.
109
116
 
110
117
  ## Apply finish rules
111
118
 
@@ -249,6 +249,7 @@ const monitorWorkflow: WorkflowDefinition = defineWorkflow({
249
249
  ? `Previous progress: ${formatProgressReport(priorEstimate.tracks.map((track) => track.estimate))}`
250
250
  : "There is no previous measured progress.",
251
251
  "Use available tools to inspect the current source of truth. Observe only unless the task explicitly authorizes a mutation.",
252
+ "You are the regular Pi model running this check and the observation adapter. When useful measurable facts appear during the check, publish them with workflow action update. Include the latest tracks in the final submission. Do not require the monitored target to implement a Pi-specific progress API, file, store, schema, or command.",
252
253
  "Every accepted check must include a concise user-facing report. Add progress tracks only when the target provides measurable facts. Submit observed counts and target-provided finish times; do not invent rates or an ETA.",
253
254
  "Choose route continue or stop.",
254
255
  ].join("\n\n");
@@ -1,3 +0,0 @@
1
- export { createJobProgressReporter, estimateJobProgress, type JobProgressReporter, } from "./reporter.js";
2
- export { isTerminalJobProgressState, MAX_JOB_PROGRESS_BYTES, MAX_JOB_PROGRESS_TRACKS, validateJobProgressSnapshot, } from "./validation.js";
3
- export { JOB_PROGRESS_SCHEMA, type JobProgressCost, type JobProgressEstimate, type JobProgressIdentity, type JobProgressPublish, type JobProgressPublishResult, type JobProgressReporterOptions, type JobProgressSnapshot, type JobProgressState, type JobProgressTrack, type JobProgressUpdate, } from "./types.js";
@@ -1,4 +0,0 @@
1
- export { createJobProgressReporter, estimateJobProgress, } from "./reporter.js";
2
- export { isTerminalJobProgressState, MAX_JOB_PROGRESS_BYTES, MAX_JOB_PROGRESS_TRACKS, validateJobProgressSnapshot, } from "./validation.js";
3
- export { JOB_PROGRESS_SCHEMA, } from "./types.js";
4
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/job-progress/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,mBAAmB,GAEpB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,0BAA0B,EAC1B,sBAAsB,EACtB,uBAAuB,EACvB,2BAA2B,GAC5B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,mBAAmB,GAWpB,MAAM,YAAY,CAAC"}
@@ -1,8 +0,0 @@
1
- import { type JobProgressEstimate, type JobProgressPublishResult, type JobProgressReporterOptions, type JobProgressSnapshot, type JobProgressUpdate } from "./types.js";
2
- export type JobProgressReporter = {
3
- report(update: JobProgressUpdate): Promise<JobProgressPublishResult>;
4
- flush(): Promise<JobProgressPublishResult>;
5
- snapshot(): JobProgressSnapshot;
6
- };
7
- export declare function createJobProgressReporter(options: JobProgressReporterOptions): JobProgressReporter;
8
- export declare function estimateJobProgress(snapshots: JobProgressSnapshot[], now?: Date): JobProgressEstimate;
@@ -1,243 +0,0 @@
1
- import { estimateProgress, } from "../workflows/index.js";
2
- import { JOB_PROGRESS_SCHEMA, } from "./types.js";
3
- import { isTerminalJobProgressState, validateJobProgressSnapshot } from "./validation.js";
4
- const DEFAULT_MINIMUM_INTERVAL_MS = 30_000;
5
- const DEFAULT_PUBLISH_TIMEOUT_MS = 15_000;
6
- export function createJobProgressReporter(options) {
7
- const now = options.now ?? (() => new Date());
8
- const minimumIntervalMs = nonNegativeInteger(options.minimumIntervalMs ?? DEFAULT_MINIMUM_INTERVAL_MS, "minimumIntervalMs");
9
- const publishTimeoutMs = positiveInteger(options.publishTimeoutMs ?? DEFAULT_PUBLISH_TIMEOUT_MS, "publishTimeoutMs");
10
- let current = options.previousSnapshot === undefined
11
- ? validateJobProgressSnapshot({
12
- schema: JOB_PROGRESS_SCHEMA,
13
- application: options.application,
14
- component: options.component,
15
- jobId: options.jobId,
16
- sourceRevision: options.sourceRevision,
17
- contractHash: options.contractHash,
18
- sequence: 0,
19
- state: options.initialState ?? "running",
20
- phase: options.initialPhase ?? "starting",
21
- startedAt: options.startedAt,
22
- updatedAt: options.startedAt,
23
- ...(options.deadlineAt === undefined ? {} : { deadlineAt: options.deadlineAt }),
24
- tracks: options.initialTracks,
25
- })
26
- : validatePreviousSnapshot(options, options.previousSnapshot);
27
- const resumed = options.previousSnapshot !== undefined;
28
- let lastQueuedAtMs = resumed ? Date.parse(current.updatedAt) : Number.NEGATIVE_INFINITY;
29
- let lastQueuedSequence = -1;
30
- let lastPublishedSequence = resumed ? current.sequence : -1;
31
- let queuedOperation;
32
- let tail = Promise.resolve();
33
- const enqueue = (snapshot) => {
34
- if (lastQueuedSequence === snapshot.sequence && queuedOperation !== undefined) {
35
- return queuedOperation;
36
- }
37
- lastQueuedAtMs = Date.parse(snapshot.updatedAt);
38
- lastQueuedSequence = snapshot.sequence;
39
- const started = tail.then(() => startPublication(options.publish, cloneSnapshot(snapshot), publishTimeoutMs));
40
- const operation = started.then(async (publication) => {
41
- await publication.result;
42
- lastPublishedSequence = Math.max(lastPublishedSequence, snapshot.sequence);
43
- });
44
- queuedOperation = operation;
45
- tail = started.then((publication) => publication.settled).catch(() => undefined);
46
- void operation
47
- .finally(() => {
48
- if (lastQueuedSequence === snapshot.sequence) {
49
- lastQueuedSequence = -1;
50
- queuedOperation = undefined;
51
- }
52
- })
53
- .catch(() => undefined);
54
- return operation;
55
- };
56
- return {
57
- async report(update) {
58
- if (isTerminalJobProgressState(current.state)) {
59
- throw new Error("job progress cannot change after a terminal state");
60
- }
61
- if (current.sequence >= Number.MAX_SAFE_INTEGER) {
62
- throw new Error("job progress sequence is exhausted");
63
- }
64
- const timestamp = now().toISOString();
65
- const state = update.state ?? current.state;
66
- const phase = update.phase ?? current.phase;
67
- const finishedAt = isTerminalJobProgressState(state)
68
- ? (update.finishedAt ?? timestamp)
69
- : update.finishedAt;
70
- const tracks = isTerminalJobProgressState(state)
71
- ? terminalizeTracks(update.tracks ?? current.tracks, state)
72
- : (update.tracks ?? current.tracks);
73
- const next = validateJobProgressSnapshot({
74
- ...current,
75
- sequence: current.sequence + 1,
76
- state,
77
- phase,
78
- updatedAt: timestamp,
79
- tracks,
80
- ...(update.cost === undefined ? {} : { cost: update.cost }),
81
- ...(finishedAt === undefined ? {} : { finishedAt }),
82
- });
83
- assertMonotonicTracks(current, next);
84
- const publishNow = update.force === true ||
85
- phase !== current.phase ||
86
- isTerminalJobProgressState(state) ||
87
- Date.parse(timestamp) - lastQueuedAtMs >= minimumIntervalMs;
88
- current = next;
89
- if (!publishNow)
90
- return { snapshot: cloneSnapshot(next), published: false };
91
- await enqueue(next);
92
- return { snapshot: cloneSnapshot(next), published: true };
93
- },
94
- async flush() {
95
- const snapshot = current;
96
- if (lastPublishedSequence >= snapshot.sequence) {
97
- await tail;
98
- return { snapshot: cloneSnapshot(snapshot), published: false };
99
- }
100
- await enqueue(snapshot);
101
- return { snapshot: cloneSnapshot(snapshot), published: true };
102
- },
103
- snapshot() {
104
- return cloneSnapshot(current);
105
- },
106
- };
107
- }
108
- export function estimateJobProgress(snapshots, now = new Date()) {
109
- if (snapshots.length === 0)
110
- throw new Error("job progress estimation requires at least one snapshot");
111
- const validated = snapshots
112
- .map(validateJobProgressSnapshot)
113
- .sort((left, right) => left.sequence - right.sequence);
114
- const latest = validated.at(-1);
115
- for (const snapshot of validated)
116
- assertSameIdentity(latest, snapshot);
117
- for (let index = 1; index < validated.length; index += 1) {
118
- const previous = validated[index - 1];
119
- const current = validated[index];
120
- if (previous.sequence === current.sequence) {
121
- throw new Error(`job progress sequence ${current.sequence} is duplicated`);
122
- }
123
- if (Date.parse(previous.updatedAt) > Date.parse(current.updatedAt)) {
124
- throw new Error("job progress updatedAt must not decrease as sequence increases");
125
- }
126
- }
127
- const keys = latest.tracks.map((track) => track.key);
128
- const tracks = keys.map((key) => {
129
- const samples = validated.flatMap((snapshot) => {
130
- const track = snapshot.tracks.find((candidate) => candidate.key === key);
131
- return track === undefined ? [] : [{ at: snapshot.updatedAt, data: track.data }];
132
- });
133
- return { key, samples, estimate: estimateProgress(key, samples, now) };
134
- });
135
- return {
136
- snapshot: cloneSnapshot(latest),
137
- tracks,
138
- estimates: tracks.map((track) => track.estimate),
139
- };
140
- }
141
- function terminalizeTracks(tracks, state) {
142
- return tracks.map((track) => ({
143
- key: track.key,
144
- data: {
145
- ...track.data,
146
- status: track.data.status === "completed" ||
147
- track.data.status === "failed" ||
148
- track.data.status === "cancelled"
149
- ? track.data.status
150
- : state,
151
- },
152
- }));
153
- }
154
- function assertMonotonicTracks(previous, next) {
155
- if (previous.phase !== next.phase)
156
- return;
157
- for (const track of next.tracks) {
158
- const prior = previous.tracks.find((candidate) => candidate.key === track.key);
159
- if (prior === undefined || resetsTrack(prior, track))
160
- continue;
161
- if (prior.data.completed !== undefined &&
162
- track.data.completed !== undefined &&
163
- track.data.completed < prior.data.completed) {
164
- throw new Error(`job progress track ${track.key} completed value must not decrease`);
165
- }
166
- }
167
- }
168
- function resetsTrack(previous, next) {
169
- return (previous.data.phase !== next.data.phase ||
170
- previous.data.unit !== next.data.unit ||
171
- previous.data.total !== next.data.total);
172
- }
173
- function assertSameIdentity(expected, actual) {
174
- for (const field of [
175
- "application",
176
- "component",
177
- "jobId",
178
- "sourceRevision",
179
- "contractHash",
180
- "startedAt",
181
- ]) {
182
- if (expected[field] !== actual[field]) {
183
- throw new Error(`job progress sample ${field} does not match`);
184
- }
185
- }
186
- }
187
- function startPublication(publish, snapshot, timeoutMs) {
188
- const controller = new AbortController();
189
- let timeout;
190
- const write = publish(snapshot, controller.signal);
191
- const deadline = new Promise((_resolve, reject) => {
192
- timeout = setTimeout(() => {
193
- controller.abort();
194
- reject(new Error(`job progress publication timed out after ${timeoutMs} ms`));
195
- }, timeoutMs);
196
- });
197
- const result = Promise.race([write, deadline]).finally(() => {
198
- if (timeout !== undefined)
199
- clearTimeout(timeout);
200
- });
201
- return {
202
- result,
203
- settled: write.then(() => undefined, () => undefined),
204
- };
205
- }
206
- function validatePreviousSnapshot(identity, previous) {
207
- const validated = validateJobProgressSnapshot(previous);
208
- for (const field of [
209
- "application",
210
- "component",
211
- "jobId",
212
- "sourceRevision",
213
- "contractHash",
214
- "startedAt",
215
- ]) {
216
- if (identity[field] !== validated[field]) {
217
- throw new Error(`job progress previous snapshot ${field} does not match`);
218
- }
219
- }
220
- if (isTerminalJobProgressState(validated.state)) {
221
- throw new Error("job progress cannot resume from a terminal snapshot");
222
- }
223
- if (identity.deadlineAt !== validated.deadlineAt) {
224
- throw new Error("job progress previous snapshot deadlineAt does not match");
225
- }
226
- return validated;
227
- }
228
- function cloneSnapshot(snapshot) {
229
- return structuredClone(snapshot);
230
- }
231
- function nonNegativeInteger(value, field) {
232
- if (!Number.isSafeInteger(value) || value < 0) {
233
- throw new Error(`${field} must be a non-negative safe integer`);
234
- }
235
- return value;
236
- }
237
- function positiveInteger(value, field) {
238
- if (!Number.isSafeInteger(value) || value <= 0) {
239
- throw new Error(`${field} must be a positive safe integer`);
240
- }
241
- return value;
242
- }
243
- //# sourceMappingURL=reporter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"reporter.js","sourceRoot":"","sources":["../../src/job-progress/reporter.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,GAGjB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,mBAAmB,GAOpB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,0BAA0B,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAC;AAE1F,MAAM,2BAA2B,GAAG,MAAM,CAAC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