Skip to content

Commit cab60ae

Browse files
Jack Qclaude
andauthored
docs(spec): JobHandler docblock states degraded consumption is wired (#10266) (#10434)
The `JobHandler` TSDoc's "not yet wired" paragraph was inverted twice over by #7072's landing: consuming a resolved `{ outcome: 'degraded' }` is no longer discarded, and "safe because unread" no longer holds. Re-measured against current main: - cron-job-adapter.ts and interval-job-adapter.ts map a resolved `degraded` outcome onto `execution.status = 'degraded'` / `execution.error`. - db-job-adapter.ts settles the run as `degraded`, writes the reason to `error` / `last_error`, and leaves `failure_count` flat. - sys_job_run.status and sys_job.last_status both carry `degraded` in their ObjectQL-enforced select vocabularies (#7072), pinned to stay in step with JobExecutionStatus. Rewrote the paragraph to state the wired behaviour, aligned in wording with JobExecutionStatus's already-correct TSDoc in system/job.zod.ts rather than inventing a third phrasing. The #5548/#6617 framing above stays untouched. Prose only — no signature or type change (Clause-②: no). No changeset: JSDoc/TSDoc block-comment change, not a Zod `.describe()` call that feeds generated reference docs — same precedent as #10168, not #10173. Claude-Session: https://claude.ai/code/session_016gcKVsiywU9CcS96S5t9qD Co-authored-by: Claude <noreply@anthropic.com>
1 parent 99f1f91 commit cab60ae

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

packages/spec/src/contracts/job-service.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,16 @@ export interface JobRunOutcome {
106106
*
107107
* The reporting channel is deliberately opt-in on **both** ends. Consuming it
108108
* — mapping `degraded` onto a `sys_job_run.status` distinct from `success` —
109-
* is #5548's half and is **not yet wired**: the shipped adapters currently
110-
* discard the resolved value, which is precisely why doing so is safe.
109+
* is #5548's half, and it is wired: all three shipped adapters
110+
* (`cron-job-adapter.ts`, `interval-job-adapter.ts`, `db-job-adapter.ts`) map
111+
* a resolved `{ outcome: 'degraded' }` onto a run status distinct from
112+
* `success`, the `reason` lands in `error` / `last_error`, and
113+
* `failure_count` stays flat — never a retry, never an alert. Both
114+
* `sys_job_run.status` and `sys_job.last_status` carry `degraded` in their
115+
* ObjectQL-enforced select vocabularies (#7072), which must stay in step with
116+
* {@link JobExecutionStatus} in `system/job.zod.ts` — see that type's TSDoc
117+
* for the full mapping and the cost of routing `reason` through an "Error"
118+
* column.
111119
*/
112120
export type JobHandler = (context: { jobId: string; data?: unknown }) => Promise<void | JobRunOutcome>;
113121

0 commit comments

Comments
 (0)