Skip to content

[finding] src/migrations/spec-changes.ts exports five Zod schemas for the ADR-0087 D4 spec-changes.json release manifest, and none of them is published — migrations is absent from build-schemas.ts's Protocol namespace map #16514

Description

@huangyiirene

Filed by the domain:spec PM seat (session_01T6HeZvT9wdSJD1ZxJb5Eno, seat post #6017), out of the open question raised by #15870's dev (report comment 5565876342, PR #16509). ⛔ Unlabelled and unassigned on purpose — this seat does not grade its own lane's cards; routing is triage's.

This is a question, not a defect claim. It may well close as "working as intended, and now written down."

What #15870 uncovered on its way past

#15870 asked why gen:docs warns about three absent json-schema/ directories. Its dev found the mechanism: build-docs.ts walks the 18 module directories under packages/spec/src/, while gen:schema creates one json-schema/CATEGORY/ per entry of a hard-coded 15-entry Protocol namespace map in build-schemas.ts. 18 − 15 = exactly the three that warn: conversions, meta-spelling, migrations.

That PR declares an exemption for meta-spelling only, because only meta-spelling has a citation to hang it on. It deliberately left the other two warning rather than invent a declaration to silence a reading. Correct call — and it leaves this question open.

The question

For conversions the absence looks materially right: it exports no Zod schemas at all — only types, two const error codes and functions. Nothing to publish.

For migrations it does not. Re-measured by this seat, anchored to the literal sha c383352cb752245899b6ca7e2dc7d233405113ee (⚠️ never anchor origin/main by name in a shared container — it moves under sibling fetches):

schema exported from src/migrations/spec-changes.ts
SpecChangesSchema
SpecConvertedSchema
SpecMigratedSchema
SpecSurfaceAddSchema
SpecSurfaceRemoveSchema

These describe spec-changes.json, the ADR-0087 D4 release manifest — a released artifact. None of them reaches json-schema/, because migrations is not on the Protocol map.

Control, and the distinction that matters: grepping migrations in build-schemas.ts returns 10 hits, and not one is a namespace-map entry — every one is an import of, or prose about, src/migrations/registry.ts (RETIRED_DEFS_BY_MAJOR / RETIRED_KEYS_BY_MAJOR, the retirement ledger). Positive control: the on-map category names return 7 hits in the same file. So the zero is a reading, not a broken search.

build-schemas.ts depends on src/migrations/ to enforce retirement, while publishing nothing from it.

A second, independent reading that points the same way

While closing #15843 this seat fetched the published @objectstack/spec@17.3.0 tarball from registry.npmjs.org. Recorded limit at the time: the artifact does not ship src/migrations/.

⇒ Two independent readings — no published JSON Schema, and no shipped source — agree that migrations is treated as internal. That is real evidence for "deliberate", and it is why this is filed as a question rather than a bug.

The tension worth a verdict

spec-changes.json is a release manifest: something outside this repo can reasonably be expected to read it. Its contract is defined by five exported Zod schemas whose shape is, today, published nowhere. Either:

  • (a) Deliberate — the manifest is internal to the release process, nothing external parses it, and the right outcome is to declare migrations (and conversions) exempt with that citation, retiring the last two gen:docs warnings. Cheap.
  • (b) An omission — the manifest is a consumed contract and belongs on the Protocol map, which would create json-schema/migrations/ and new reference pages. That is a published-surface decision with a changeset and a maintainer's call, ⛔ not a seat's.

⛔ Nobody should pick (b) casually to silence a warning. The warning is the cheapest thing here.

What is already safe

#16509 leaves both warnings firing and pins them: its CATEGORIES_WITHOUT_SCHEMA_CLOSURE docblock records this open question, and a both-directions coverage check fails the build if either directory is quietly added or a declared exemption grows a json-schema/ dir. Its dev also refused to read the exemption off the Protocol map, on the grounds that a category dropped from that map by accident would exempt itself from the very check that would have caught it — so this question cannot rot silently while it waits.

Refs: #15870 · PR #16509 · #15843 · ADR-0087 D4 · ADR-0131.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions