Skip to content

chore(consumer-typecheck): retire check-public-types source-sync gate (SD-3213a)#3396

Merged
caio-pizzol merged 3 commits into
mainfrom
caio-pizzol/SD-3213a-retire-public-types-sync
May 19, 2026
Merged

chore(consumer-typecheck): retire check-public-types source-sync gate (SD-3213a)#3396
caio-pizzol merged 3 commits into
mainfrom
caio-pizzol/SD-3213a-retire-public-types-sync

Conversation

@caio-pizzol
Copy link
Copy Markdown
Contributor

Draft, stacked on #3392 (SD-3212 PR C root types flip). First sub-PR of the SD-3213 gate consolidation track.

Why now: after PR C flips root types to dist/superdoc/src/public/index.d.ts, the canonical root contract is packages/superdoc/src/public/index.ts — locked by the SD-3212 A0 snapshot, classified by A1, closure-gated by A1b, structure-verified by the facade verifier. The pre-flip source-sync gate (SD-2860, check-public-types.mjs) pointed at the legacy packages/superdoc/src/index.js JSDoc typedef block. Keeping that gate teaches contributors to update the wrong file.

Changes (5 files, +39 / -187):

  • Delete tests/consumer-typecheck/check-public-types.mjs (153 lines).
  • typecheck-matrix.mjs: remove the source-sync invocation block + --skip-public-types-check flag (no other use). Add comment explaining the new canonical source of truth.
  • tests/consumer-typecheck/package.json: remove check:types and check:types:write scripts.
  • src/all-public-types.ts: update header — file is now a STATIC FIXTURE, not generated. Manual import + assertion line per new root export. SD-2842 scenarios still exercise it for any-collapse detection.
  • deep-type-audit.README.md: update the gate inventory to list the current canonical gates (root snapshot, facade verifier, closure gate, deep audit) and note SD-2860's retirement.

What stays the same:

  • all-public-types.ts stays as a fixture; the SD-2842 "all public types are real" matrix scenarios still exercise it.
  • The consumer matrix's 57/57 scenarios all pass.
  • Root snapshot + closure gate + facade verifier are untouched and still cover the public surface.

Verified locally:

  • pnpm --filter superdoc build:es: green.
  • typecheck-matrix.mjs: 57/57 scenarios pass.
  • snapshot-superdoc-root-exports.mjs --check: matches.
  • check-root-classification-closure.mjs: 0 violations.

SD-3213 track:

  • A (this PR): retire source-sync gate.
  • ⏭ B: merge the 3 snapshot scripts into one config-driven snapshot gate.
  • ⏭ C: fold closure into facade verifier (one "public-contract verify" entry point).
  • ⏭ D: decide strict-vs-nightly for deep-type-audit + report-declaration-reachability.

Related:

caio-pizzol added a commit that referenced this pull request May 19, 2026
Two doc-only follow-ups in #3396 caught during review:

- CONTRIBUTING.md Pull Request Process section still pointed
  contributors at check-public-types.mjs / check:types:write / the
  @typedef block in packages/superdoc/src/index.js. Replaced with
  guidance for the post-SD-3175 canonical gates: facade verifier,
  root snapshot, closure gate, consumer matrix, and the
  all-public-types.ts fixture pattern.
- deep-type-audit.README.md said the root snapshot locks a
  '200-name root surface across four sources.' The four sources
  have different counts (200/200/41/41) and each has its own
  baseline. Rewrote to reflect that the inventories are locked
  independently with cross-source mismatches reported as evidence.
Base automatically changed from caio-pizzol/SD-3212-c-root-types-flip to main May 19, 2026 18:15
@caio-pizzol caio-pizzol marked this pull request as ready for review May 19, 2026 18:15
@caio-pizzol caio-pizzol requested a review from a team as a code owner May 19, 2026 18:15
… (SD-3213a)

After the SD-3212 PR C root types flip, the canonical root contract is
`packages/superdoc/src/public/index.ts` (locked by superdoc-root-exports.json,
classified by superdoc-root-classification.json, closure-gated by
check-root-classification-closure.mjs, structure-verified by
verify-public-facade-emit.cjs).

The pre-flip source-sync gate (SD-2860, check-public-types.mjs) pointed at
the legacy `packages/superdoc/src/index.js` JSDoc typedef block as the
source of truth for the public-type assertion list. That source is no
longer canonical after the flip; keeping the sync check would teach
contributors to update the wrong file.

Changes:
- Remove tests/consumer-typecheck/check-public-types.mjs.
- Remove the check-public-types invocation from typecheck-matrix.mjs
  (along with the --skip-public-types-check flag, which had no other use).
- Remove check:types and check:types:write from tests/consumer-typecheck/package.json.
- Update all-public-types.ts header: it is now a STATIC FIXTURE,
  not a generated artifact. New root exports get a manual import + assertion
  line. SD-2842 scenarios still exercise the file to catch any-collapses.
- Update deep-type-audit.README.md gate inventory to list the current
  canonical gates (root snapshot, facade verifier, closure gate, deep
  audit) instead of the retired source-sync gate.

Verified locally:
- pnpm --filter superdoc build:es: green.
- typecheck-matrix.mjs: 57/57 pass.
- snapshot-superdoc-root-exports.mjs --check: matches.
- check-root-classification-closure.mjs: 0 violations.

This is PR A of the SD-3213 gate consolidation track. Stacked on
SD-3212 PR C (#3392); merge after PR C.
Two doc-only follow-ups in #3396 caught during review:

- CONTRIBUTING.md Pull Request Process section still pointed
  contributors at check-public-types.mjs / check:types:write / the
  @typedef block in packages/superdoc/src/index.js. Replaced with
  guidance for the post-SD-3175 canonical gates: facade verifier,
  root snapshot, closure gate, consumer matrix, and the
  all-public-types.ts fixture pattern.
- deep-type-audit.README.md said the root snapshot locks a
  '200-name root surface across four sources.' The four sources
  have different counts (200/200/41/41) and each has its own
  baseline. Rewrote to reflect that the inventories are locked
  independently with cross-source mismatches reported as evidence.
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3a7f7365a0

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread tests/consumer-typecheck/typecheck-matrix.mjs Outdated
@caio-pizzol caio-pizzol force-pushed the caio-pizzol/SD-3213a-retire-public-types-sync branch from 3a7f736 to 53da339 Compare May 19, 2026 18:19
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

…(SD-3213a)

Codex review on #3396 caught a real coverage gap from retiring the
SD-2860 source-sync gate: a future PR could add a type-only root export
to src/public/index.ts and the snapshots, pass all gates, and never add
an AssertNotAny<NewType> assertion to src/all-public-types.ts. The
SD-2842 any-collapse scenarios only fire on names IN the fixture.

Adds check-all-public-types-fixture.mjs:
- Expected set = classification rows where inDts && !inEsm && !inCjs
  (= 159 type-only root exports today, irrespective of bucket; legacy-root
  and internal-candidate type-only symbols stay covered because they
  remain reachable from the published root).
- Actual set = AssertNotAny<X> assertions parsed from
  src/all-public-types.ts.
- Fails on missing OR extra; message names each diff symbol and shows
  the fix.

Wired into typecheck-matrix.mjs before the matrix run, taking the slot
the retired check-public-types.mjs used to occupy. Drift-tested both
directions (one missing, one extra) — both fail clearly.

Doc updates:
- CONTRIBUTING.md adds the new gate to the public-API checklist.
- src/all-public-types.ts header explains the new gate and what
  triggers it.

Net change in coverage: SAME as pre-SD-3213a (159 type-only root
exports each get an any-collapse assertion). The difference is the
source of truth for 'what should be covered': it is now the
classification artifact, not packages/superdoc/src/index.js's typedef
block.
@caio-pizzol caio-pizzol merged commit a20ef2f into main May 19, 2026
15 checks passed
@caio-pizzol caio-pizzol deleted the caio-pizzol/SD-3213a-retire-public-types-sync branch May 19, 2026 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants