Skip to content

docs(scripts): catalog public-interface validation + name aliases#3469

Merged
caio-pizzol merged 3 commits into
mainfrom
caio-pizzol/SD-typecheck-docs-catalog
May 23, 2026
Merged

docs(scripts): catalog public-interface validation + name aliases#3469
caio-pizzol merged 3 commits into
mainfrom
caio-pizzol/SD-typecheck-docs-catalog

Conversation

@caio-pizzol
Copy link
Copy Markdown
Contributor

Documentation-first cleanup of the type-checking system. No behavior change. Existing scripts keep working under their existing names.

Why this PR

The repo has 8+ scripts that gate the public TypeScript surface, plus parallel Document API gates, plus consumer-typecheck infrastructure. Today, "are public interfaces safe?" doesn't have a single documented answer. Command names (check:public-contract, docapi:sync, report:public-contract, type-check) grew organically over different tickets and don't follow a consistent verb convention. This PR introduces vocabulary first; later PRs will fold separate CI steps into the umbrella and tighten the gates.

Additions

  • packages/superdoc/scripts/README.md: the canonical reference. Covers the TL;DR command, vocabulary (SuperDoc package vs Document API), command catalog, per-script gates (what each one guards / what would fail if it stopped running), consumer-typecheck infrastructure, document-api scripts, dataflow diagram, and CI-vs-local split.

  • Six aliased commands in root package.json following the convention check:* = non-mutating, generate:* = mutates, report:* = read-only:

    New (canonical) Legacy (still works)
    check:types type-check
    check:public:superdoc check:public-contract
    check:public:docapi docapi:check
    check:public (umbrella) (no equivalent before)
    generate:docapi docapi:sync
    report:public:superdoc report:public-contract
  • Rewritten Commands section in AGENTS.md (CLAUDE.md symlinks to it) pointing at pnpm check:public as the canonical pre-merge command and explaining the naming convention.

What's deferred

Per the agreed migration plan ("don't hard-rename everything in one PR"):

  • CI workflows still use the legacy names; switching them is the next PR.
  • release-superdoc.yml still duplicates the consumer-typecheck matrix, deep-type audit, package-shape, snapshot, and closure steps. Folding those into check:public:superdoc is also tracked separately (the README documents this gap explicitly).
  • check:public:docapi still requires generate:docapi to run first if generated files are missing. Making the check self-contained (in-memory generate + compare) is deferred.
  • The verify-public-facade-emit.cjs hand-maintained expectedNames allowlist (426 symbols across 10 facades) is documented but not consolidated.
  • check-jsdoc.cjs's 6-file ratchet is documented as historical; reframing it as a public-reachability ratchet is deferred.

Verified

  • pnpm run check:typestsc -b tsconfig.references.json runs cleanly (alias resolves correctly)
  • pnpm run report:public:superdoc → prints the tier report (alias of report:public-contract)
  • pnpm run check:public:docapi → fails with the same missing/stale generated-file error as docapi:check (expected — same passthrough behavior)
  • Verified packages/document-api/generated/ is gitignored (root .gitignore), so the generate:docapi docs correctly say "gitignored" and don't tell contributors to commit untracked artifacts.

…and names

Documentation-first cleanup of the type-checking system. No behavior
change. Existing scripts keep working under their existing names.

Adds:

- packages/superdoc/scripts/README.md: one place to learn the system.
  Covers the TL;DR command, vocabulary (SuperDoc package vs Document
  API), command catalog, per-script gates, consumer-typecheck
  infrastructure, document-api scripts, dataflow diagram, and the
  CI-vs-local split.
- Six aliased commands in root package.json, following the convention
  check:* = non-mutating, generate:* = mutates, report:* = read-only:
    check:types               -> pnpm run type-check
    check:public:superdoc     -> pnpm run check:public-contract
    check:public:docapi       -> pnpm run docapi:check
    check:public              -> check:public:superdoc && check:public:docapi
    generate:docapi           -> pnpm run docapi:sync
    report:public:superdoc    -> pnpm run report:public-contract
- Rewritten Commands section in AGENTS.md (CLAUDE.md symlinks to it)
  pointing at pnpm check:public as the canonical pre-merge command
  and explaining the naming convention.

The legacy names stay verbatim per the agreed migration plan: add new
names first, switch CI in a later PR, mark old names as legacy after
that. No new behavior, no removed behavior, no new gates.

Verified:
- pnpm run check:types passes (alias of type-check)
- pnpm run report:public:superdoc prints the tier report
- pnpm run check:public:docapi fails with the same stale-generated-
  file error as docapi:check (expected, same passthrough)
Review-feedback corrections to the prior docs commit:

- "Am I safe to ship a PR?" -> "Are public interfaces safe?" in the
  scripts README TL;DR. The original framing implied check:public
  validates full product correctness; it only validates the public
  type/interface surface. Tests and build are separate concerns.
- Add a sentence under the TL;DR clarifying check:public is "the
  public type/interface preflight" and is not a replacement for
  test or build.
- Fix the generate:docapi wording in both the scripts README and
  AGENTS.md. Previous text said the command "writes
  packages/document-api/generated/**; commit the changes." Verified
  that path is gitignored via the root .gitignore (line
  "packages/document-api/generated/"), so there is nothing to
  commit. New wording: "Writes to packages/document-api/generated/
  (gitignored). Run before check:public:docapi if it fails on
  missing files."
- Tighten the generate:all wording in the scripts README to
  distinguish gitignored vs tracked generator targets (e.g.
  apps/docs/document-api/reference/ stays committed per the
  .gitignore comment).

No alias or behavior change.
@caio-pizzol caio-pizzol requested a review from a team as a code owner May 23, 2026 16:54
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 23, 2026

Agent docs audit

All changed agent-doc files are clean (in-file checks) as of cb949d7b7858.

Checked: AGENTS.md

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@caio-pizzol caio-pizzol merged commit 003f175 into main May 23, 2026
72 of 73 checks passed
@caio-pizzol caio-pizzol deleted the caio-pizzol/SD-typecheck-docs-catalog branch May 23, 2026 22:19
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