Skip to content

refactor(spec): rename ./system's ServiceStatus to KernelServiceStatus (#6604) - #7240

Merged
os-zhuang merged 1 commit into
mainfrom
claude/issue-6604-kernel-service-status
Aug 10, 2026
Merged

refactor(spec): rename ./system's ServiceStatus to KernelServiceStatus (#6604)#7240
os-zhuang merged 1 commit into
mainfrom
claude/issue-6604-kernel-service-status

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

Closes#6604

Executes the maintainer's 2026-08-08 ruling verbatim. Scope line, quoted:

Scope: rename the schema const (matching the sibling KernelServiceMapSchema naming), update the reference pages, add the type alias per the #4593 standing rule, delete the baseline row (system/ServiceStatus — no type export), run the gen chain. The ./api discovery health enum keeps its published ServiceStatus name — no breaking rename.

Premise re-measured on origin/main @ 3566e5520

All three legs of the issue's premise still held at dispatch time:

ClaimMeasured
./api declares a ServiceStatus enumapi/discovery.zod.ts:22 const + :33 type export — live
./system declares a different ServiceStatusSchemasystem/core-services.zod.ts:229, a features-bearing object — live
the baseline row is still presentdocs-import-surface.baseline.json:45 — live
the dual-source ratchet is a clean (empty) ratchetdual-source-exports.baseline.jsonentries: [] — empty

Changes

FileChange
packages/spec/src/system/core-services.zod.tsServiceStatusSchemaKernelServiceStatusSchema; new export type KernelServiceStatus = z.input< typeof KernelServiceStatusSchema >; docblock records why the prefix exists
packages/spec/scripts/lib/renamed-defs.tsnew RENAMED_DEFS entry system/ServiceStatussystem/KernelServiceStatus, 6 keys carried
packages/spec/src/type-alias-convention.pin.test.tsnew isomorphic pin Iso835; count 823 → 824 in the assertion and both prose statements; receipt paragraph
packages/spec/docs-import-surface.baseline.jsonsystem/ServiceStatus — no type export row deleted (shrink-only ratchet)
packages/spec/src/system/core-services.test.ts8 occurrences repointed
packages/spec/scripts/schema-index.test.tscomment only — see special inspection
generatedjson-schema.manifest/system.json, authorable-surface/system.json, api-surface/system.json, export-origins/system.json, content/docs/references/system/core-services.mdx, content/docs/references/index.mdx

The ./api enum is untouched, and dual-source-exports.baseline.json is unmodified and still empty — the collision is resolved at its source, not baselined.

Why RENAMED_DEFS and not the retirement kit

The first build failed the way the ruling did not anticipate: the manifest ratchet saw json-schema/system/ServiceStatus.json disappear and demanded a deliberate manifest deletion plus a RETIRED_DEFS_BY_MAJOR entry. That is the wrong claim here — nothing was retired. packages/spec/scripts/lib/renamed-defs.ts is the channel built for exactly this case (#4684, ADR-0112 D9a), and its docblock rejects the retirement route in as many words: a tombstone would have "no live def to hang on" and would "pollute the ADR-0087 registries with a migration consumers must not run".

Routed through the rename table, all 6 authorable keys carry and the ratchets go green on their own terms:

- "system/ServiceStatus:enabled" + "system/KernelServiceStatus:enabled"
- "system/ServiceStatus:features" + "system/KernelServiceStatus:features"
- "system/ServiceStatus:name" + "system/KernelServiceStatus:name"
- "system/ServiceStatus:provider" + "system/KernelServiceStatus:provider"
- "system/ServiceStatus:status" + "system/KernelServiceStatus:status"
- "system/ServiceStatus:version" + "system/KernelServiceStatus:version"

api/ServiceStatus is deliberately absent from the table — it is still emitted, so the table would (correctly) reject it as a copy rather than a rename.

Gates

Build ran before every dist-derived regen (stale-dist trap #7122). Dual-snapshot rule applied in full: this is one export removed and two added, so api-surface/ and export-origins/ were both regenerated after the real build.

GateResult
pnpm --filter @objectstack/spec buildpass
check:generatedAll 11 generated artifacts are up to date.
check:docsimport examples resolve against api-surface/ (62 accepted gap(s) in the baseline) — was 63
check:dual-source-exports4801 names across 16 entry points — 170 re-exported, 0 accepted dual-source (baseline)
check:api-surfacepublic API surface + factory signatures unchanged
check:export-origins4971 exports across 16 entry points resolve exactly as recorded
check:authorable-surface1587 schemas, 1277 default(s) unchanged
check:spec-parsed-alias1509 bare z.input aliases, 824 pinned isomorphic, 685 paired with an XParsed. OK
pnpm --filter @objectstack/spec test360 passed (360) / 9397 passed (9397)
pnpm --filter @objectstack/spec typecheckpass (tsc + scripts + test layer)
check:empty-changeset / check:adr-0087-registration / check:changeset-no-majorpass
check:nul-bytes6619 text file(s) ... no raw ASCII control bytes
eslint on the 5 touched TS filesclean

Reverse verification — directions predicted before running

Both probes were predicted first, then run; both landed as predicted.

Prediction 1 — restore the deleted baseline row ⇒ RED as a STALE entry (not as a gap: the def key system/ServiceStatus is now emitted by nothing). Confirmed:

✗ 1 stale import-surface baseline entry — the gap is gone, delete the line(s):
• system/ServiceStatus — no type export

Prediction 2 — remove KernelServiceStatus from the export surface ⇒ RED as a NEW gap, under the NEW name. Confirmed:

✗ 1 reference page import example(s) name an export that '@objectstack/spec' no longer has:
• system/KernelServiceStatus — no type export

Together these pin that the baseline-row deletion is load-bearing in both directions: the row cannot stay, and it cannot be replaced by its renamed twin. Probes were taken out with a file copy and git checkout, never git stash.

The alias's isomorphism is proven rather than asserted: Iso835 is an Assert< Eq< z.input, z.infer > > compiled by tsc under tsconfig.test.json, so it is a compile error the day the schema gains a .default().

Consumers repointed

Grepped all three repos (objectstack, objectui, cloud) for the old const:

  • packages/spec/src/system/core-services.test.ts — 8 occurrences, repointed.
  • content/docs/references/system/core-services.mdx + references/index.mdx — regenerated, not hand-edited.
  • objectui: none. cloud: none. No runtime consumer existed in any repo — consistent with the issue's "no user-visible failure today".

Special inspection

  1. Two synthetic fixtures still spell ServiceStatusSchema on purpose.packages/spec/scripts/schema-index.test.ts (2) and scripts/def-key-collisions.test.ts (2) pass the name as string literals into pure functions; they import nothing. What they pin is that cross-category same-name resolution is correct whenever it occurs — a rename retires the specimen, not the property. Rewiring them to whatever names collide on main today would make the coverage evaporate at the next tidy-up. Only the stale claim was fixed: schema-index.test.ts said "The live specimen on main", which this PR falsifies, so the comment now records that ServiceStatus 在 ./api 与 ./system 各有一个不同声明,#4593 的别名补齐卡在这个名字上 #6604 retired it. def-key-collisions.test.ts claims no liveness and is untouched.

  2. Changeset class — the one place I did not follow a written instruction, flagged for your call.renamed-defs.ts's docblock says an entry there "rides with a major changeset spelling FROM → TO", and the closest precedent (spec 双源清账 C17:ActionLocationSchema(./studio ≠ ./ui)—— studio 侧 D9(a) 改名,1 条 #4737studio/ActionLocation) is major. I shipped minor instead, because the dispatch specified non-major and because check-changeset-no-major's own docblock states the current convention: "During the launch window we ship breaking changes as minor". No gate enforces either class — I checked; the prose is convention-only, and check-changeset-no-major is stood down anyway while .changeset/pre.json is in "mode": "pre". The changeset still spells FROM → TO as the docblock requires. If you prefer major, it is a one-word edit, but note it would then trip check-adr-0087-registration, which would need an adr-0087: not-required disposition — and per renamed-defs.ts a pure rename genuinely has no metadata migration to register.

  3. RETIRED_DEFS_BY_MAJOR deliberately untouched — an entry there would falsely claim the metadata contract shrank. It did not: every key carries.


Generated by Claude Code

…6604)
`ServiceStatus` was published by two entry points for two disjoint concepts:
`./api`'s discovery health enum and `./system`'s kernel service state object.
Per the maintainer's 2026-08-08 Option-B ruling the kernel side takes the
domain-specific name, matching its `KernelServiceMapSchema` sibling, and `./api`
keeps its published name untouched.
This is what finally lets `./system` declare the `KernelServiceStatus` type
alias #4593's backfill had to skip: declaring `ServiceStatus` on both entry
points would have minted the #4411 dual-source trap that
`dual-source-exports.baseline.json` stays empty to prevent.
Routed through `RENAMED_DEFS` rather than the retirement kit — all 6 authorable
keys carry, so nothing left the author-facing contract.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PiRUoQkTSBBmpyXBY3cVn2
@vercel

vercelBot commented Aug 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
ProjectDeploymentActionsUpdated (UTC)
objectstackIgnoredIgnoredAug 10, 2026 3:31am

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/spec.

106 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:

  • content/docs/ai/agents.mdx(via @objectstack/spec)
  • content/docs/ai/skills-reference.mdx(via @objectstack/spec)
  • content/docs/ai/skills.mdx(via @objectstack/spec)
  • content/docs/api/client-sdk.mdx(via @objectstack/spec)
  • content/docs/api/environment-routing.mdx(via @objectstack/spec)
  • content/docs/api/error-catalog.mdx(via @objectstack/spec)
  • content/docs/api/error-handling-client.mdx(via @objectstack/spec)
  • content/docs/api/error-handling-server.mdx(via @objectstack/spec)
  • content/docs/api/index.mdx(via @objectstack/spec)
  • content/docs/automation/approvals.mdx(via @objectstack/spec)
  • content/docs/automation/connectors.mdx(via @objectstack/spec)
  • content/docs/automation/flows.mdx(via @objectstack/spec)
  • content/docs/automation/hook-bodies.mdx(via packages/spec)
  • content/docs/automation/hooks.mdx(via @objectstack/spec)
  • content/docs/automation/index.mdx(via @objectstack/spec)
  • content/docs/automation/webhooks.mdx(via @objectstack/spec)
  • content/docs/automation/workflows.mdx(via @objectstack/spec)
  • content/docs/concepts/architecture.mdx(via @objectstack/spec)
  • content/docs/concepts/design-principles.mdx(via packages/spec)
  • content/docs/concepts/index.mdx(via @objectstack/spec)
  • content/docs/concepts/metadata-driven.mdx(via @objectstack/spec)
  • content/docs/concepts/metadata-lifecycle.mdx(via packages/spec)
  • content/docs/concepts/north-star.mdx(via @objectstack/spec)
  • content/docs/data-modeling/analytics.mdx(via @objectstack/spec)
  • content/docs/data-modeling/drivers.mdx(via @objectstack/spec)
  • content/docs/data-modeling/external-datasources.mdx(via @objectstack/spec)
  • content/docs/data-modeling/field-types.mdx(via @objectstack/spec)
  • content/docs/data-modeling/fields.mdx(via @objectstack/spec)
  • content/docs/data-modeling/formulas.mdx(via @objectstack/spec)
  • content/docs/data-modeling/index.mdx(via @objectstack/spec)
  • content/docs/data-modeling/objects.mdx(via @objectstack/spec)
  • content/docs/data-modeling/queries.mdx(via @objectstack/spec)
  • content/docs/data-modeling/schema-design.mdx(via @objectstack/spec)
  • content/docs/data-modeling/seed-data.mdx(via @objectstack/spec)
  • content/docs/data-modeling/validation-rules.mdx(via @objectstack/spec)
  • content/docs/data-modeling/validation.mdx(via @objectstack/spec)
  • content/docs/deployment/cli.mdx(via @objectstack/spec)
  • content/docs/deployment/tenancy-modes.mdx(via @objectstack/spec)
  • content/docs/deployment/troubleshooting.mdx(via @objectstack/spec)
  • content/docs/deployment/validating-metadata.mdx(via @objectstack/spec)
  • content/docs/getting-started/build-with-claude-code.mdx(via @objectstack/spec)
  • content/docs/getting-started/common-patterns.mdx(via @objectstack/spec)
  • content/docs/getting-started/examples.mdx(via @objectstack/spec)
  • content/docs/getting-started/quick-reference.mdx(via @objectstack/spec)
  • content/docs/getting-started/quick-start.mdx(via @objectstack/spec)
  • content/docs/getting-started/your-first-project.mdx(via @objectstack/spec)
  • content/docs/kernel/cluster.mdx(via @objectstack/spec)
  • content/docs/kernel/contracts/auth-service.mdx(via packages/spec)
  • content/docs/kernel/contracts/cache-service.mdx(via packages/spec)
  • content/docs/kernel/contracts/data-engine.mdx(via @objectstack/spec)
  • content/docs/kernel/contracts/index.mdx(via @objectstack/spec)
  • content/docs/kernel/contracts/metadata-service.mdx(via packages/spec)
  • content/docs/kernel/contracts/storage-service.mdx(via @objectstack/spec)
  • content/docs/kernel/index.mdx(via packages/spec)
  • content/docs/kernel/runtime-services/data-service.mdx(via @objectstack/spec)
  • content/docs/kernel/runtime-services/email-service.mdx(via packages/spec)
  • content/docs/kernel/runtime-services/examples.mdx(via @objectstack/spec)
  • content/docs/kernel/runtime-services/index.mdx(via packages/spec)
  • content/docs/kernel/runtime-services/queue-service.mdx(via packages/spec)
  • content/docs/kernel/runtime-services/sharing-service.mdx(via @objectstack/spec)
  • content/docs/kernel/runtime-services/sms-service.mdx(via packages/spec)
  • content/docs/kernel/runtime-services/storage-service.mdx(via @objectstack/spec)
  • content/docs/kernel/services-checklist.mdx(via @objectstack/spec)
  • content/docs/kernel/services.mdx(via @objectstack/spec)
  • content/docs/permissions/authorization.mdx(via @objectstack/spec)
  • content/docs/permissions/permission-sets.mdx(via @objectstack/spec)
  • content/docs/permissions/permissions-matrix.mdx(via @objectstack/spec)
  • content/docs/permissions/positions.mdx(via @objectstack/spec)
  • content/docs/permissions/rls.mdx(via @objectstack/spec)
  • content/docs/permissions/sharing-rules.mdx(via @objectstack/spec)
  • content/docs/permissions/system-context.mdx(via packages/spec)
  • content/docs/plugins/adding-a-metadata-type.mdx(via @objectstack/spec)
  • content/docs/plugins/development.mdx(via @objectstack/spec)
  • content/docs/plugins/index.mdx(via @objectstack/spec)
  • content/docs/plugins/packages.mdx(via @objectstack/spec)
  • content/docs/protocol/backward-compatibility.mdx(via @objectstack/spec)
  • content/docs/protocol/diagram.mdx(via packages/spec)
  • content/docs/protocol/kernel/config-resolution.mdx(via @objectstack/spec)
  • content/docs/protocol/kernel/http-protocol.mdx(via @objectstack/spec)
  • content/docs/protocol/kernel/i18n-standard.mdx(via @objectstack/spec)
  • content/docs/protocol/kernel/index.mdx(via @objectstack/spec)
  • content/docs/protocol/kernel/lifecycle.mdx(via @objectstack/spec)
  • content/docs/protocol/kernel/plugin-spec.mdx(via @objectstack/spec)
  • content/docs/protocol/knowledge.mdx(via @objectstack/spec)
  • content/docs/protocol/objectql/index.mdx(via @objectstack/spec)
  • content/docs/protocol/objectql/query-syntax.mdx(via @objectstack/spec)
  • content/docs/protocol/objectql/schema.mdx(via @objectstack/spec)
  • content/docs/protocol/objectql/security.mdx(via packages/spec)
  • content/docs/protocol/objectql/state-machine.mdx(via @objectstack/spec)
  • content/docs/protocol/objectui/actions.mdx(via @objectstack/spec)
  • content/docs/protocol/objectui/concept.mdx(via @objectstack/spec)
  • content/docs/protocol/objectui/index.mdx(via @objectstack/spec)
  • content/docs/protocol/objectui/layout-dsl.mdx(via @objectstack/spec)
  • content/docs/protocol/objectui/record-alert.mdx(via @objectstack/spec)
  • content/docs/protocol/objectui/widget-contract.mdx(via @objectstack/spec)
  • content/docs/ui/actions.mdx(via @objectstack/spec)
  • content/docs/ui/apps.mdx(via @objectstack/spec)
  • content/docs/ui/create-vs-edit-form.mdx(via @objectstack/spec)
  • content/docs/ui/dashboards.mdx(via @objectstack/spec)
  • content/docs/ui/field-grouping-and-order.mdx(via @objectstack/spec)
  • content/docs/ui/forms.mdx(via @objectstack/spec)
  • content/docs/ui/index.mdx(via @objectstack/spec)
  • content/docs/ui/public-data-collection.mdx(via @objectstack/spec)
  • content/docs/ui/setup-app.mdx(via @objectstack/spec)
  • content/docs/ui/translations.mdx(via @objectstack/spec)
  • content/docs/ui/views.mdx(via @objectstack/spec)

7 release-owned page(s) also reference the affected code. These are read-only:

  • content/docs/releases/implementation-status.mdx(via @objectstack/spec)
  • content/docs/releases/index.mdx(via @objectstack/spec)
  • content/docs/releases/v12.mdx(via @objectstack/spec)
  • content/docs/releases/v13.mdx(via @objectstack/spec)
  • content/docs/releases/v16.mdx(via @objectstack/spec)
  • content/docs/releases/v17.mdx(via @objectstack/spec)
  • content/docs/releases/v9.mdx(via @objectstack/spec)

content/docs/releases/ is RELEASE-OWNED (AGENTS.md "Documentation Guardrails"): release
notes are written centrally at release time, and a code PR that edits them is the exact PR
that guardrail exists to stop. They are still audited — read-only. If one of them is actually
wrong, file an issue or open a dedicated docs-only PR; do not edit it here.

Advisory only. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs origin/main → pass the list as args.docs.

@github-actionsgithub-actionsBot added documentation Improvements or additions to documentation protocol:system tests tooling labels Aug 10, 2026
@os-zhuang
os-zhuang marked this pull request as ready for review August 10, 2026 03:51
@os-zhuang
os-zhuang added this pull request to the merge queueAug 10, 2026
Merged via the queue into main with commit d127ff0Aug 10, 2026
27 checks passed
@os-zhuang
os-zhuang deleted the claude/issue-6604-kernel-service-status branch August 10, 2026 04:16
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentationImprovements or additions to documentationprotocol:systemsize/mteststooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ServiceStatus 在 ./api 与 ./system 各有一个不同声明,#4593 的别名补齐卡在这个名字上

2 participants

@os-zhuang@claude