Repository navigation
docs(spec): correct ManifestSchema.version's prerelease @example to a value its regex accepts - #17741
Conversation
…to a value its regex accepts The key's TSDoc documented `@example "2.1.0-beta.1"`, which the regex two lines below (`/^\d+\.\d+\.\d+$/`) refuses — an author copying it verbatim got a `ZodError` from `ManifestSchema.parse`. Corrected to `"2.1.0"`. The refusal was already the settled reading: the regex, the prose `(major.minor.patch)` and `manifest.test.ts`'s `invalidVersions` pin on `'1.0.0-beta'` all agree. Only the `@example` dissented, so the comment was the artifact in error. The regex, the `.describe()` string and the pinned test are untouched; no accept set moves. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MkQhmuuJAVDjmeWNixwDDH
📓 Docs Drift CheckThis PR changes 1 package(s): 3 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 1 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 136 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 4f4ddbcde0b8d6cbab2fc79f5a41b4e9de7195ef && git checkout 4f4ddbcde0b8d6cbab2fc79f5a41b4e9de7195ef
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 9bd4344e4b1f91a52e9835313650243745c29a67 dfcb15921189ee953e8faafffa5c01c863007615 && git checkout -B drift-repro 9bd4344e4b1f91a52e9835313650243745c29a67 && git merge --no-ff dfcb15921189ee953e8faafffa5c01c863007615
node scripts/docs-audit/affected-docs.mjs --json 9bd4344e4b1f91a52e9835313650243745c29a67
|
Fixes #17461
What changed
One TSDoc line on
ManifestSchema.version(packages/spec/src/kernel/manifest.zod.ts):The key documented two examples and its own regex accepted only one. Reproduced on this branch's base, no build needed:
An author copying the second documented example verbatim got a
ZodErrorout ofManifestSchema.parse. The corrected value is accepted:re.test('2.1.0')istrue.Why the comment was the artifact in error, not the regex
Three artifacts agreed on the refusal before this change and still agree afterwards:
version: z.string().regex(...)following semantic versioning (major.minor.patch)manifest.test.tsinvalidVersionspins'1.0.0-beta'Only the
@exampleline dissented, so it is an editing residue in the TSDoc. Widening the regex to admit prerelease or build metadata is deliberately NOT done here — it would contradict a test that pins the refusal on purpose and would enlarge a published schema's accepted set.PluginSchema.version(#17070) accepts a different grammar today; the two keys are deliberately different and are not reconciled here.Verification
Commands and their own verdict lines, all at
dfcb1592:pnpm --filter @objectstack/spec build—VERDICT command-exit 0(underscripts/pm/os-verify-lock.sh)pnpm --filter @objectstack/spec typecheck && pnpm --filter @objectstack/spec test—VERDICT command-exit 0;Test Files 473 passed (473),Tests 13435 passed (13435)pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2 src/kernel/manifest.test.ts—EXIT=0,Test Files 1 passed (1),Tests 41 passed (41)— the pinnedinvalidVersionscase still passes, unchangedpnpm --filter @objectstack/spec check:generated—✓ All 15 generated artifacts are up to date, includingcheck:docs. The@exampleline is not extracted intocontent/docs/references/**: measured at 0 occurrences there, with the neighbouring.describe()stringPackage version (semantic versioning)at 12 in the same tree as the lit control.pnpm exec eslint . --no-inline-config --format json— exit 0 over 6636 files, 0 errors, 0 warnings. Repo-wide, not narrowed.node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack): 76 derived, 73 run green, 3 NOT MEASURED. The three exited 3 —PREREQUISITE NOT MET, each refusing because a whole-repopnpm buildis absent for packages this diff does not touch:check:doc-formula-expressions,check:dual-build-cjs-loads,check:lean-entry-closure. Declared to CI, which builds everything. Reconciled with--ran.Published reach
@objectstack/specshipssrc/**/*.zod.tsin itsfiles[], so the edited line is itself published, and the TSDoc is also emitted into the built declarations. Measured onpackages/spec/distafter the build: corrected@example "2.1.0"at 16 occurrences, old@example "2.1.0-beta.1"at 0, with the untouched neighbour@example "1.0.0"at 16 as the lit control. Hence a changeset (patch,@objectstack/spec) rather thanskip-changeset.Generated by Claude Code