docs(spec): state the view name grammar per body spelling in the view module header - #13262
Conversation
`ViewMetadataSchema` is a union over three persisted `view` body spellings and they do not share one `name` grammar: a standalone ViewItem record requires the dot (`ViewItemNameSchema` / `QUALIFIED_ITEM_NAME_PATTERN`), while a flattened runtime overlay and a `defineView` container each declare an ungrammared `z.string().optional()` and accept flat names. Nothing said so — the rule was reconstructible only by reading three schema factories, and the grammar is selected by a body shape the author never names explicitly. Adds a family-level JSDoc block as `ui/view.zod.ts`'s module description, plus a pointer comment at each of the three declaration sites, and regenerates the reference page and the two skill reference indexes. No schema change: every accept/reject decision is unchanged. Also retires the one in-tree record-shaped fixture a future author would copy into a rejection (`conversions/view-spelling-walk.test.ts`) by giving it a dotted name; the conversion chain does not read `name`, measured.
📓 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:
What this run could not see
Coarse fallback — 126 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 1ce0148cbf5fa60ce7f5a129d316e455f8e37b97 && git checkout 1ce0148cbf5fa60ce7f5a129d316e455f8e37b97
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 74049254d47bd0edd2a2fcd732dcc01c91504f10 081152617303cbb350603dfa344e4abde8082327 && git checkout -B drift-repro 74049254d47bd0edd2a2fcd732dcc01c91504f10 && git merge --no-ff 081152617303cbb350603dfa344e4abde8082327
node scripts/docs-audit/affected-docs.mjs --json 74049254d47bd0edd2a2fcd732dcc01c91504f10
|
Fixes #13134
Documentation only. Per the placement ruling on the card (comment 5461535963): the rule lands in
packages/spec/src/ui/view.zod.tsas family-level JSDoc, not indocs/adr/**and not incontent/docs/**alone. Zero schema-shape edits, zero accept/reject changes — all three body spellings were already internally consistent and the flat-named rows already parse.What the note says
ViewMetadataSchemais a union over three persistedviewbody spellings, and they do not share onenamegrammar. Re-measured against the built schema (packages/spec/dist), not read off source:nameis declared asconfigViewItemNameSchema—QUALIFIED_ITEM_NAME_PATTERN, dot REQUIREDinvalid_formatat["name"]config, no container slotz.string().optional()— no grammardefineViewcontainerlist/form/listViews/formViews)z.string().optional()onViewSchema— no grammarBoth failure directions the card names are readable from the note, and it states explicitly that the in-tree flat-named rows (
case_grid,cases, the container rowcrm_lead) are correct as written, not defects awaiting a dotted rewrite.One correction to the card's measured table
The card's third row says the container's
nameis "not in the declared shape". That is false againstorigin/main:ViewSchemadoes declarename, asz.string().optional()with the describe "Item name — supplied by the metadata door; for an object-scoped container it is the object name." So the container's row is the same mechanism as the overlay's — an ungrammared optional string — not an absent key. The card's conclusion is unaffected (flat container names are accepted, and the ADR-0017 §3.2 dual-read is why they are flat), but the note states the measured mechanism rather than the card's.Probe output, against
dist/ui/index.mjsafter a freshpnpm --filter @objectstack/spec build:Where it landed
packages/spec/src/ui/view.zod.ts— the block is the module's doc block, so it reaches the generated reference page through the module-description machinery (packages/spec/scripts/lib/file-description.ts: top-level, header zone, documenting no symbol).viewItemBaseShape()'sname,flattenedViewOverlayFields()'sname, andViewSchema'sname— so a source reader standing at any one of the three is told the other two exist. Each points at the header block rather than restating the rule, so there is one copy to drift.packages/spec/src/conversions/view-spelling-walk.test.ts— the fixture-hygiene half. The copy-on-write identity probe's record-shaped body now carries a dotted name (crm_lead.clean). Measured before changing it: the conversion chain never readsname— flat and dotted both return the same object reference, zero notices, output deep-equal to input — so the test proves exactly what it proved before.Side effect worth naming: the reference page's opening paragraph changes
ui/view.zod.tshad no module description, sofindModuleDocBlockselected the next qualifying block — the doc comment sitting above theHttpRequestre-export import. That is whycontent/docs/references/ui/view.mdxand both skill reference indexes opened with "HTTP Method Enum & HTTP Request Schema", which is the#5059defect class (an internal note published as a page's subject). Adding a real module description displaces it. TheHttpRequestnote is unchanged in the source, where it documents that re-export.skills/**is touched — governed surface, and the two readingsgen:skill-refsregenerates the pointer row's one-line description from the module doc block's first line, so two published indexes changed:skills/objectstack-data/references/_index.mdskills/objectstack-ui/references/_index.mdskills/**/SKILL.md(package total)skills/**/*.md(package total)One replaced line per file, generated, no net growth — and the replacement is a correction: the indexes previously described
ui/view.zod.tsas "HTTP Method Enum & HTTP Request Schema".skills/**is a governed surface (Prime Directive #14). This PR is DRAFT withneeds:contract-review, and beyond the contract-review chain its landing needs the governed path — a pinned maintainer approval, or the maintainer's own merge. ⛔ No seat marks it ready, queues it, or arms auto-merge.Verification
All runs on the final commit
08115261unless noted; heavy runs serialized throughscripts/pm/os-verify-lock.sh.pnpm --filter @objectstack/spec build && pnpm --filter @objectstack/spec check:generated→✓ All 14 generated artifacts are up to date.(exit 0, on08115261). The two artifacts it proved stale mid-work —check:skill-refsandcheck:docs— were regenerated withcheck:generated --fix, never hand-edited.pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2over the 7 view/conversion/file-description suites →Test Files 7 passed (7) · Tests 583 passed (583).pnpm --filter @objectstack/spec typecheck(=tsc --noEmit+check:scripts-typecheck+check:test-typecheck) → exit 0. The edited test file is covered:check:test-typecheck: OK — @objectstack/spec's test layer compiles under packages/spec/tsconfig.test.json.pnpm lint(eslint . --no-inline-config, repo-wide, not narrowed) → exit 0.node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack(59 matched). Run locally and green, each read from the gate's own verdict line:check:nul-bytes,check:doc-authoring,check:doc-anchors,check:docs-single-h1,check:role-word,check:quick-reference-counts,check:skill-compatibility,check:skill-frame-sync,check:agent-test-spelling,check:docs-audit-scope,check:docs-redirects,check:keyed-text-bounds,check:merge-driver,check:spec-parsed-alias,check:where-matcher,check:engine-double-contract,check:pm-governed-merges,check-doc-frontmatter,check-doc-route-spelling,check-docs-section-name,check-section-landing-index,check-comment-mask-adoption, and the changeset family (check:changeset-gate-self-tests,check:objectui-changeset,check:pm-half-states,check-adr-0087-registration,check-changeset-no-major,check-empty-changeset,release-rehearsal-clone --self-test).scripts/pm/check-half-states.mjsexits 3 —PREREQUISITE NOT MET — the token in the environment is not a valid GitHub credential. Its own text says nothing was swept, so this is no reading rather than a failure.Changeset:
patchfor@objectstack/spec(text face in publishedsrc/**/*.zod.ts). Non-breaking, so no ADR-0087 marker —check-adr-0087-registrationagrees:this PR adds no declared-breaking changeset.Session: https://claude.ai/code/session_01KX8wnyjStaZcuMyAMNsy3N
Generated by Claude Code