feat(spec,platform-objects): add degraded to the job status vocabulary (#7072) - #7340
Conversation
…ary (#7072) Executes the 2026-08-08 maintainer ruling on #5548 — one additional outcome meaning "completed without accomplishing the work", and no enum family. This is the consumer-side half of the `JobRunOutcome` producer shape #6617 shipped on `contracts/job-service.ts`. Three declaration sites move together because the two platform-object selects are enforced by ObjectQL's record validator (`invalid_option`) while `DbJobAdapter.finishRun` swallows the rejection in a best-effort try/catch — a value legal in the spec enum but absent from the selects is a silently dropped write that strands the run row at `running`, not a type error. - packages/spec/src/system/job.zod.ts — JobExecutionStatus + TSDoc - packages/platform-objects/.../sys-job-run.object.ts — status select - packages/platform-objects/.../sys-job.object.ts — last_status select `degraded` is not a failure and never retries; its `reason` rides the existing `error` / `last_error` columns with `failure_count` flat, and the TSDoc records the cost of that (an "Error" column may carry a non-error note). Also regenerated: i18n bundles (en/zh-CN/ja-JP/es-ES, translated rather than left at the raw seed) and content/docs/references/system/job.mdx. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PiRUoQkTSBBmpyXBY3cVn2
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
📓 Docs Drift CheckThis PR changes 2 package(s): 106 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
⛔ 7 release-owned page(s) also reference the affected code. These are read-only:
|
Closes #7072
Mechanical execution of the 2026-08-08 maintainer ruling on #5548 — the consumer-side half of the job outcome channel whose producer half #6617 already shipped. Quoted verbatim from that ruling:
Nothing here reopens that decision, and no second key was added.
Premise re-measured on
origin/mainRe-verified at
3e8e669c0(the card measured2c7e62d5, triage2f3e793) before any edit — premise holds, unchanged:origin/maindegraded?packages/spec/src/system/job.zod.ts:178z.enum(['running','success','failed','timeout'])packages/platform-objects/src/audit/sys-job-run.object.ts:49Field.select(['running','success','failed','timeout'], …)packages/platform-objects/src/audit/sys-job.object.ts:73Field.select(['success','failed','timeout','running'], …)The six-item change set
job.zod.ts—'degraded'added toJobExecutionStatus, with TSDoc citing DbJobAdapter 把「handler 没抛错」记成 sys_job_run.status='success' —— 内部自行降级的 job(如 wait 唤醒打空)在作业审计面上仍显示成功 #5548's ruling and stating:degradedis not a failure and never retries;reasonrides the existingerror/last_errorcolumns withfailure_countflat; and the cost of that choice in place — a column labelled "Error" may carry a non-error note whenstatus === 'degraded'.job.test.ts— accept/reject pins and the round-trip list extended to five values, plus a new pin on the exact vocabulary and a degraded round-trip case.sys-job-run.object.ts—statusselect.sys-job.object.ts—last_statusselect.Why sites 1 and 3–4 could not be split
The two platform-object selects are enforced, not merely declared: ObjectQL's record validator (
validation/record-validator.ts:578) refuses an out-of-vocabularyselectvalue withinvalid_option, andDbJobAdapter.finishRunwraps its update in a best-efforttry/catchthat only logs. A commit where the spec enum permits a value the selects refuse is therefore a silently dropped write leaving the run rowrunningforever — not a type error. One card, per the filer's recommendation A and the services seat's endorsement.Correction to change-set item 6
Item 6 named
packages/spec/json-schema.manifest/system.jsonandpackages/spec/api-surface/system.json. Both were rebuilt and neither changes, by design: they index the export name only — literally"system/JobExecutionStatus"and"JobExecutionStatus (type)"— never the enum members. The artifact that does carry the value list,packages/spec/json-schema/, is gitignored (.gitignore:61, 0 tracked files).Item 6 is nonetheless not a no-op.
check:generatedproved one tracked generated artifact stale, and it is the one that carries the values —content/docs/references/system/job.mdx:Regenerated via
pnpm --filter @objectstack/spec gen:docs.content/docs/releases/was not touched.Reverse verification — direction predicted before running
Prediction recorded first: with site 1 alone reverted to
origin/mainand the new tests in place, thedegradedaccept pin, the five-value order pin and the degraded round-trip must go red, and nothing else may move.Measured — exactly that, no collateral:
Restored →
Tests 47 passed (47).Honest note on one pin's direction: the added reject assertions (
partial,skipped,Degraded) are green both before and after — they are refused by the four-value and five-value enums alike. They pin the ruling's closure ("do not open an enum family") against a future widening, and cannot go red on this change. They are coverage against drift, not evidence for this diff, and are labelled as such rather than presented as verification.Gates
Run on the rebased tree (branch is rebased onto
f3f855ac1):pnpm --filter @objectstack/spec buildcheck:generated✓ All 11 generated artifacts are up to datecheck:i18nOK (9 package(s) — all bundles in sync, no undeclared authoring keys)check:i18n-coverageOK (12 config(s), 660 baselined untranslated string(s), none new)check:nul-bytesOK (scanned 6593 text file(s) … no raw ASCII control bytes)@objectstack/spectestTest Files 359 passed (359) / Tests 9383 passed (9383)@objectstack/platform-objectstestTest Files 11 passed (11) / Tests 289 passed (289)typecheckTranslations — a judgement call worth a reviewer's eye
The bundle generator seeds a new key with its source text and says so: "new schema keys are added filled with the source text, and they still need translating." It produced
degraded: "degraded"in all three non-English locales, beside fully translated siblings. I translated them rather than ship the raw seed:降级縮退DegradadoThere is no prior in-repo translation of this term to follow, so these are my choice, not a precedent lookup — flagging explicitly for a native reviewer, especially ja-JP
縮退.Targeted in-flight check (metadata lane)
Run against all 20 open PRs by diffing each PR head against
origin/main:sys-job-run.object.ts,sys-job.object.ts,job.zod.ts,job.test.ts,job.mdx— zero open PRs touch any of them. No collision, no sequencing needed.main; this branch is rebased onto it and both i18n gates are green on the merged result.Scope
Six items, nothing else. Deliberately not here: the
DbJobAdapter/bumpJobwiring that maps a resolved outcome onto these values (that is #5548, which this unblocks), and objectui's Studio jobs view meeting a fifth value it has no label or colour for (separate repo, now fileable since the value exists).Nothing yet writes
degraded, so this is additive and inert until #5548 lands. Nodocs/adr/**orcontent/docs/releases/changes.Generated by Claude Code