Skip to content

feat(spec): make BaseValidationRuleShape and FilterCondition nameable from the root entry - #12327

Merged
os-litant merged 2 commits into
mainfrom
claude/issue-11709-root-entry-nameability-delta
Aug 25, 2026
Merged

feat(spec): make BaseValidationRuleShape and FilterCondition nameable from the root entry#12327
os-litant merged 2 commits into
mainfrom
claude/issue-11709-root-entry-nameability-delta

Conversation

@os-litant

Copy link
Copy Markdown
Collaborator

Fixes#11709

What

The root entry of @objectstack/spec had two more structurally-mentioned but unnameable types beyond the three #11350 repaired: a minimal one-file consumer programexport default defineStack({ objects: [] }) with no @objectstack/spec/data import anywhere in its program — still failed declaration emit with exactly two TS2883 diagnostics (BaseValidationRuleShape via the object.zod-* dist chunk, FilterCondition via filter.zod-*).

Per the maintainer decision on #11709 (2026-08-25, option A′ — same invariant as #11350: a type that appears structurally in an entry's public declarations must be nameable from that same entry), the root entry now re-exports both types from their declaring /data modules:

Scope fence, as ruled: only these two names. The follow-up gate holding the invariant closed for every entry is #11986#11986 is not addressed here and remains open. The post-fix minimal-program probe came back with zero diagnostics, so no sixth/seventh unnameable name was observed.

Measurements (pin harness, packages/spec/scripts/root-entry-type-nameability.pin.test.ts)

  • Pre-fix (dist built from the branch point, 8cdd696): ablating the context.ts fixture (mutation and restore both anchor-verified on disk) turned the pin red — vitest exit 1 with exactly the two TS2883 above, matching the card's repro criterion.
  • Post-fix (dist rebuilt at HEAD, both names verified present in dist/index.d.ts before the run): the same minimal one-file program is clean (vitest exit 0, zero TS diagnostics), and the unmutated harness passes 2/2 (consumer green + canary still red on the declaration-emit axis).

Verification (union re-run after the final commit, at 764d7bf4 — the run itself echoed UNION_HEAD=764d7bf4)

  • pnpm --filter @objectstack/spec build → exit 0; check:generated → "✓ All 14 generated artifacts are up to date."
  • pnpm --filter @objectstack/spec test → "Test Files 428 passed (428) / Tests 11401 passed (11401)"; typecheck → exit 0 (includes check:scripts-typecheck + check:test-typecheck, which cover the pin harness file)
  • Dispatch-gate derivation re-run against the actual diff (node scripts/pm/dispatch-gates.mjs, no paths passed); the dispatch-named families plus the derived additions (changeset-gate-self-tests, objectui-changeset, page-declaration-shape, governed-queue-guard, and the test-file convention family: query-options-erasure, type-check-coverage, type-check-debt, engine-double-contract, where-matcher) all ran locally and green, with three declared exceptions that are environment shapes, not findings (details + evidence in the os-dev report on @objectstack/spec root entry: two MORE structurally-mentioned types are unnameable through the CHUNKED build (BaseValidationRuleShape, FilterCondition) — a minimal defineStack consumer still hits TS2883 #11709): dev-prereqs (fresh worktree, 65 sibling dists unbuilt — spec's own dist is built and content-hash fresh; CI builds first), governed-queue-guard (reads GITHUB_EVENT_PATH only; unrunnable outside CI by construction), type-check-debt --re-measure (refuses loudly on an unbuilt workspace closure = NOT MEASURED; narrowing evidence: the only test-file change in this diff is docblock-comment-only — 0 non-*-prefixed changed lines — and spec's own typecheck covering that file is green).
  • check:nul-bytes (merged tree) → "check-nul-bytes: OK (scanned 6824 text file(s) -- 6824 tracked, 0 untracked-not-ignored; skipped 7 binary; no raw ASCII control bytes)."

Root-entry consumer packages (client/runtime etc.) are covered by the CI Type Check family per the dispatch's verification plan.


Generated by Claude Code

… from the root entry
The minimal one-file consumer program (un-annotated export default
defineStack(...) with no /data subpath import) still failed declaration
emit with exactly two TS2883 diagnostics naming these two types through
hash-named internal dist chunks. Same invariant and fix shape as the
prior root-entry nameability fix: re-export both types from their
declaring /data modules. Regenerates api-surface/root.json and
export-origins/root.json (+2 each); extends the pin harness's
program-scoping note to record the ruling.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NDGG54XF5gbTLdQzCtnaVV
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

⚠️3 changed file(s) yielded no anchor (packages/spec/api-surface/root.json, packages/spec/export-origins/root.json, packages/spec/src/index.ts), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files. Nothing else in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 1 changed package(s)).

What this run could not see
  • 3 changed file(s) yielded no anchor (packages/spec/api-surface/root.json, packages/spec/export-origins/root.json, packages/spec/src/index.ts) — pages documenting those are invisible to this run
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.

Coarse fallback — 126 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json c71978ff96e4f32c07830d1323efe65f34391c73packageMentionDocs.

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

Labels

documentationImprovements or additions to documentationsize/steststooling

Projects

None yet

2 participants

@os-litant@claude