Skip to content

feat(scripts): add public-contract tier metadata report (SD-3256 Phase 2)#3447

Merged
caio-pizzol merged 1 commit into
mainfrom
caio-pizzol/SD-3256-phase2-tier-metadata
May 22, 2026
Merged

feat(scripts): add public-contract tier metadata report (SD-3256 Phase 2)#3447
caio-pizzol merged 1 commit into
mainfrom
caio-pizzol/SD-3256-phase2-tier-metadata

Conversation

@caio-pizzol
Copy link
Copy Markdown
Contributor

Design-light Phase 2 of the SD-3256 umbrella. Adds tier metadata for every package.json#exports subpath on type-surface.config.cjs, plus a read-only report command. No new enforcement. No export changes. No behavior change. The classification is open for team review before Phase 3 (./super-editor curation) and Phase 4 (ratchet) build on it.

Tiers (12 / 12 subpaths classified):

  • supported (4): ., ./types, ./ui, ./ui/react — route through src/public/**
  • legacy (6): ./converter, ./docx-zipper, ./file-zipper, ./headless-toolbar, ./headless-toolbar/react, ./headless-toolbar/vue — route through src/public/legacy/**
  • legacy-raw (1): ./super-editor — resolves directly to dist/superdoc/src/super-editor.d.ts, NOT through src/public/legacy/**. Phase 3 target.
  • asset (1): ./style.css
  • deprecated (0)

New command:

pnpm report:public-contract

Prints the tier breakdown plus a cross-check that every package.json#exports subpath has a publicContract entry and vice versa. The cross-check warns but does not fail CI in this phase (read-only by design); Phase 4 will gate.

The classification is derived directly from where each subpath's types resolve today, so it documents reality rather than proposing changes. The one outlier (./super-editor as legacy-raw) is explicitly flagged for Phase 3 with a note.

Verified: pnpm report:public-contract → 12/12, cross-check OK; pnpm check:public-contract → PASS (3 stages, 199s); pnpm run type-check clean; pnpm run build:superdoc clean.

…e 2)

Adds a `publicContract` section to the canonical
`type-surface.config.cjs`. Every `package.json#exports` subpath now
has a declared tier:

- supported (4): root, ./types, ./ui, ./ui/react — route through src/public/**
- legacy (6): ./converter, ./docx-zipper, ./file-zipper, ./headless-toolbar,
  ./headless-toolbar/react, ./headless-toolbar/vue — route through src/public/legacy/**
- legacy-raw (1): ./super-editor — resolves directly to
  dist/superdoc/src/super-editor.d.ts, NOT through src/public/legacy/**.
  SD-3256 Phase 3 will curate this through src/public/legacy/super-editor.ts
  after team alignment on which exports stay public.
- asset (1): ./style.css — no types
- deprecated (0)

This phase is design-light: it adds metadata + a read-only report
script. NO new enforcement, NO behavior change, NO export changes.
The classification is open for team review before Phase 3 / Phase 4
build on it.

New command:

  pnpm report:public-contract

Prints the tier breakdown plus a cross-check that every
`package.json#exports` subpath has a `publicContract` entry and vice
versa. The cross-check warns but does not fail CI in this phase
(read-only by design); Phase 4 will gate.

Source-of-truth notes in the config explain each tier's intended
policy (supported = strict gate, legacy = no-growth, legacy-raw =
Phase 3 target). Phase 4's ratchet will read these tiers to apply
per-tier enforcement rules.

Verified: pnpm report:public-contract → 12 / 12 entries, cross-check
OK. pnpm check:public-contract → PASS (3 stages, 199s). pnpm run
type-check clean. pnpm run build:superdoc clean.
@caio-pizzol caio-pizzol requested a review from a team as a code owner May 22, 2026 14:27
@linear-code
Copy link
Copy Markdown

linear-code Bot commented May 22, 2026

SD-3256

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: 72c82aedee

ℹ️ 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".

...publicContract.asset,
...publicContract.deprecated,
];
const contractSubpaths = new Set(allContractEntries.map((e) => e.subpath));
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Detect duplicate subpath assignments across tiers

The report collapses publicContract entries into a Set, so a subpath listed in multiple tiers is silently deduplicated and the script can still print OK even though the classification is contradictory. This weakens the Phase 2 review signal because one export can appear in two tiers without being flagged; consider validating allContractEntries.length === contractSubpaths.size (and reporting duplicates) before declaring the cross-check clean.

Useful? React with 👍 / 👎.

@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 a0a5aea into main May 22, 2026
74 checks passed
@caio-pizzol caio-pizzol deleted the caio-pizzol/SD-3256-phase2-tier-metadata branch May 22, 2026 15:27
@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented May 22, 2026

🎉 This PR is included in superdoc-cli v0.12.0

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented May 22, 2026

🎉 This PR is included in superdoc-sdk v1.11.0

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented May 22, 2026

🎉 This PR is included in @superdoc-dev/mcp v0.7.0

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented May 22, 2026

🎉 This PR is included in superdoc v1.35.0

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented May 22, 2026

🎉 This PR is included in @superdoc-dev/react v1.6.0

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented May 22, 2026

🎉 This PR is included in vscode-ext v2.7.0

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