Skip to content

test: gate wire-catalogue coverage against the behavior event union - #3204

Closed
christianhg wants to merge 1 commit into
mainfrom
catalogue-coverage-gate
Closed

christianhg wants to merge 1 commit into
mainfrom
catalogue-coverage-gate

Conversation

@christianhg

Copy link
Copy Markdown
Member

The wire catalogue only protects scenarios someone captured, and both of this quarter's field failures were uncaptured scenarios rather than wrong fixtures. Nothing noticed such gaps: a new emitting behavior event could ship with the catalogue and everything built on it blind to the event's wire shapes.

This adds the noticing as one unit test. Coverage is derived, not declared: the test parses every fixture's actions for the events it exercises (send prose in either quote style, structured objects; non-send prose deliberately contributes nothing) and reads the event union from the const arrays that define it, so neither side can drift from reality. Four assertions: every event is covered or allowlisted with a written reason; no allowlisted event is secretly covered, so stale exclusions fail; every event a fixture references exists in the union, so typos fail; every fixture yields at least one event, so a parse miss fails loudly instead of silently voiding a fixture's coverage.

The initial allowlist doubles as the census: 14 events verified non-emitting against their operation paths (reasons state the load-bearing claim: no document patches), and 30 emitting events awaiting capture, which is the burn-down list for the follow-up increment, container scenarios first. From this commit on, adding an emitting event without a capture or a deliberate exclusion is a red build instead of a memory.

Every escape so far was an uncaptured scenario, never a wrong fixture,
and nothing noticed the gaps: a new emitting event could ship with the
catalogue, recognition, and the trace tables all blind to it. The gate
derives the covered set by parsing every fixture's `actions` (send
prose in either quote style, structured objects; non-send prose
contributes nothing), reads the event union from the exported const
arrays it is defined by, and asserts four things: every event is
covered or allowlisted with a reason, no allowlisted event is secretly
covered (stale exclusions fail), every fixture-referenced event exists
in the union, and every fixture yields at least one event (a parse
miss fails loudly instead of silently voiding coverage).

The initial allowlist is the census: 14 events verified non-emitting
against their operation paths, 30 emitting events awaiting capture,
container scenarios first among them.
@changeset-bot

changeset-bot Bot commented Sep 1, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 0ad5f37

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel

vercel Bot commented Sep 1, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
portable-text-editor-documentation Ready Ready Preview Sep 1, 2026 7:44am UTC
portable-text-example-basic Ready Ready Preview Sep 1, 2026 7:44am UTC
portable-text-playground Ready Ready Preview Sep 1, 2026 7:44am UTC

Request Review

@github-actions

github-actions Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Bundle Stats

✅ No significant changes.

All scenario measurements (7)

🗺️ @portabletext/editor / @portabletext/editor · @portabletext/editor / @portabletext/editor/behaviors · @portabletext/editor / @portabletext/editor/plugins · @portabletext/editor / @portabletext/editor/selectors · @portabletext/editor / @portabletext/editor/traversal · @portabletext/editor / @portabletext/editor/utils · @portabletext/markdown / @portabletext/markdown · Artifacts

Scenario Kind Bundle (raw / gzip) Gzip change Import time Import change
⚪ @portabletext/editor / @portabletext/editor export 1.09 MB / 253.7 KB None 73 ms +0 ms, +0.6%
⚪ @portabletext/editor / @portabletext/editor/behaviors export 4.0 KB / 1.4 KB None 2 ms -0 ms, -2.9%
⚪ @portabletext/editor / @portabletext/editor/plugins export 5.1 KB / 1.8 KB None 7 ms -0 ms, -3.4%
⚪ @portabletext/editor / @portabletext/editor/selectors export 93.7 KB / 21.3 KB None 8 ms -0 ms, -0.6%
⚪ @portabletext/editor / @portabletext/editor/traversal export 41.7 KB / 10.8 KB None 6 ms -0 ms, -1.4%
⚪ @portabletext/editor / @portabletext/editor/utils export 33.1 KB / 8.7 KB None 6 ms -0 ms, -5.2%
⚪ @portabletext/markdown / @portabletext/markdown export 272.2 KB / 79.6 KB None 43 ms +2 ms, +5.7%

Significant means at least 1.0 KB and 1% gzip, or at least 5 ms and 10% import time.

This branch was successfully deployed

3 active deployments
Preview – portable-text-editor-documentation — 0ad5f379 Deployed Sep 1, 2026 by vercel[bot]
Preview – portable-text-playground — 0ad5f379 Deployed Sep 1, 2026 by vercel[bot]
Preview – portable-text-example-basic — 0ad5f379 Deployed Sep 1, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant