Skip to content

test(cli): the swizzle proof renders ChatVirtualizer with rows, and a target with a required prop and no sample fails by name - #12586

Merged
cixzhang merged 4 commits into
mainfrom
test/swizzle-proof-chatvirtualizer-sample
Nov 18, 2026
Merged

cixzhang merged 4 commits into
mainfrom
test/swizzle-proof-chatvirtualizer-sample

Conversation

@cixzhang

@cixzhang cixzhang commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

What

Every release-check now runs the full swizzle proof (release-swizzle-proof), and its first run failed on one target: lab__ChatVirtualizer [browser] Cannot read properties of undefined (reading 'length'). The cause is in the proof's harness, not the component: samples.mjs had no sample for it, and its doc gives no playground defaults, so the copy rendered with none of its required props (data, getRowKey, renderItem). The server render survives that; in Chromium the virtualizer reads data.length.

  • samples.mjs: a lab__ChatVirtualizer sample: three rows with getRowKey and renderItem, in a 320 px frame, so the browser step windows real rows.
  • The guard: a target whose doc names a required prop that neither a sample nor the doc's playground defaults give now fails by name: "swizzle target lab__X has no sample in samples.mjs, and its doc gives no default for its required prop(s) …: add a sample, or mark it in needsNoSample".
    • samples.test.mjs, a Node test that needs no build, checks the proof's own targets (Core's components as swizzle offers them, plus each integration package's documented components), each doc read through the proof's docOf. So a new component with required props fails on its own pull request.
    • The proof itself refuses such a target before rendering it (proof.mjs, missingSample).
    • Doc shapes covered: a component's own doc file, and a multi-component doc, read by the components entry named for the target. A component documented only inside another component's doc file (such as TabBarItem) is not found by the proof's docOf, so neither the proof nor this guard checks it.
  • needsNoSample: the 37 current targets that have a required prop with no sample and render without it are listed with the props they render without, so the guard starts green and fails only for a new gap. Samples for them can follow; each entry names what is missing.

Test-only. No component, workflow or record change.

Tests

  • Red-first: without the lab__ChatVirtualizer sample, samples.test.mjs fails naming it ("… required prop(s) data, getRowKey, renderItem …"); with it, 15 of 15 pass (samples.test.mjs and scope.test.mjs).
  • This pull request's swizzle legs (ci:run-swizzle) prove the new sample's eject, type-check, bundle and server render. They run without Chromium, so the next release-check is the one that proves the browser render. The proof's slices do not finish locally within their 10-minute limit on the loaded M5.
  • Prettier and eslint: clean.

Overlap checked: #9832 (adds samples for its new Lab media-player components to samples.mjs; its MediaPlayer doc requires label and it has no lab__MediaPlayer sample, so whichever of the two lands second needs that sample, or a needsNoSample mark, for samples.test.mjs to pass; #9832 can add it now)

Owning session: noopbot (a61f66c2), under CI & Release (ca77f950). Land path: the shipper, through merge-guard, on green, CodeBunny approval and Specs' exact-head /approve-spec.

… target with a required prop and no sample fails by name
@vercel

vercel Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 18, 2026 7:51am UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 18, 2026
@astracat-bot

astracat-bot Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 18, 2026, 7:49 AM UTC

@cixzhang cixzhang added release-critical Admitted to CI at once (AST-030 DEC-30). Counts only when a writer applies it. ci:run-swizzle Run the full swizzle proof on this PR; write access, next push (AST-110 DEC-3) labels Nov 18, 2026
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 8eef4d9

@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 9ac7cc7

Storybook · Sandbox · built from this PR's head

Package size: no published package changed; no new dependencies.

Not run on this PR: add ci:run-visual for Visual, ci:run-a11y for Accessibility, ci:run-rtl for RTL.


Generated by PR Enrichment workflow | View full report

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changes requested: the new sample and the guard both work, and three small fixes remain.

  • The Tests section says this pull request's swizzle legs prove the Chromium render, but the swizzle-proof job sets no SWIZZLE_PROOF_BROWSER and installs no Chromium (so slice.mjs runs with browser: false); please say that those legs prove the server render and only the next release check proves the browser render.
  • samples.test.mjs:30-41 copies docOf's doc lookup with its own Core filter and so skips core__Heading (its doc is packages/core/src/Text/Heading.doc.mjs), which the proof does check; please build the test's Core targets from listComponents and load each doc through docOf, so the test and the proof check the same targets.
  • The Overlap line says no open pull request changes packages/cli/test/swizzle-proof/, but #9832 adds samples to samples.mjs; please name it.

With Chromium, the proof passes lab__ChatVirtualizer on this head and reproduces the release failure without the new sample, and all 35 needsNoSample entries match their docs' required props.

Claims and files checked

Review mode: same-head; reason: none

  • Claim: release checks run the full swizzle proof. Verified (release-swizzle-proof in ci.yml).
  • Claim: its first full run failed only on ChatVirtualizer's browser render, reading length. Verified (the release proof's slice 3 log; the other seven slices passed).
  • Claim: the cause is a missing sample, with no playground defaults in the doc. Verified (base samples.mjs; ChatVirtualizer.doc.mjs has no playground).
  • Claim: the server render survives, and Chromium reads data.length. Verified (with the sample removed, the proof fails at the browser step alone).
  • Claim: the new sample has three rows, getRowKey and renderItem in a 320 px frame. Verified (samples.mjs:283-297, matching ChatVirtualizer.tsx:134-143).
  • Claim: a missing sample fails by name with the quoted message. Verified (proof.mjs:887-896, samples.test.mjs:56-74).
  • Claim: the Node test checks every documented target. False: it skips core__Heading (second bullet above).
  • Claim: a new component with required props fails on its own pull request. Verified (the test reads files through node:fs, so scoped Node runs include it).
  • Claim: the proof refuses such a target before rendering it. Verified (proof.mjs:522-535; a proof run without sample or mark fails at sample).
  • Claim: 35 current targets are marked, each with the props it renders without. Verified (each note equals the doc's required props that have no default).
  • Claim: the guard starts green. Verified (it flags none of the proof's 170 targets).
  • Claim: the change is test-only, with no component, workflow or record change. Verified (three files under packages/cli/test/swizzle-proof/).
  • Claim: red-first, then 14 of 14 tests pass. Verified.
  • Claim: this pull request's swizzle legs prove the browser render. False (first bullet above); the next release check does prove it: verified.
  • Claim: the slices do not finish locally on the author's machine. Not checkable (the author's environment).
  • Claim: Prettier and ESLint are clean. Prettier verified; ESLint ignores these files.
  • Claim: no open pull request overlaps. False: #9832 (third bullet above).
  • File packages/cli/test/swizzle-proof/proof.mjs: clear.
  • File packages/cli/test/swizzle-proof/samples.mjs: clear.
  • File packages/cli/test/swizzle-proof/samples.test.mjs: second bullet above.

Automated review (maintainer link)

@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 36a0e9e

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changes requested: the three earlier points are fixed, and one gap in the new guard remains.

  • Miss: requiredWithoutDefault (proof.mjs:872-877) reads only a doc's top-level props, so a target documented in a multi-component doc (props on each components entry) is never checked, and core__MultiSelector (onChange) and lab__TabBar (value, onChange) already pass with required props and no sample; please read the components entry named for the target, give those two a sample or a mark, and say in the description which doc shapes the guard covers (a component documented inside another component's doc, such as TabBarItem, is still not found by docOf).

The new sample, the red-first test and the swizzle-legs wording are right, and the test now checks the same targets as the proof for every component with its own doc file.

Claims and files checked

Review mode: incremental; reason: none

  • changed rules (0): none
  • Claim: release checks now run the full swizzle proof. Verified (release-swizzle-proof in ci.yml).
  • Claim: its first run failed only on ChatVirtualizer's browser render, reading length. Verified (the release proof's log, read in the earlier review).
  • Claim: the cause is the harness, with no sample and no playground defaults for the required props. Verified (base samples.mjs; ChatVirtualizer.doc.mjs has no playground).
  • Claim: the server render survives, and Chromium reads data.length. Verified (a Chromium proof run on identical proof and samples files).
  • Claim: the new sample has three rows, getRowKey and renderItem in a 320 px frame. Verified (samples.mjs:283-297).
  • Claim: a target whose doc names a required prop with no sample or default fails by name. Partly false: true for single-component docs, not for multi-component docs (bullet above).
  • Claim: the Node test needs no build and checks the proof's own targets, each doc read through docOf. Verified for every target with its own doc file (Core from listComponents, as swizzle --list takes it).
  • Claim: a new component with required props fails on its own pull request. False for a component documented in a multi-component doc (bullet above).
  • Claim: the proof refuses such a target before rendering it. Verified (proof.mjs:522-535).
  • Claim: the 35 current targets with a required prop and no sample are marked with the props they render without. False: the 35 notes match their docs, but core__MultiSelector and lab__TabBar are missing (bullet above).
  • Claim: the guard starts green and fails only for a new gap. Starts green: verified; a new gap in a multi-component doc does not fail (bullet above).
  • Claim: test-only, with no component, workflow or record change. Verified.
  • Claim: red-first, then 14 of 14 tests pass. Verified.
  • Claim: the swizzle legs prove eject, type-check, bundle and server render without Chromium, and the next release check proves the browser render. Verified (ci.yml sets SWIZZLE_PROOF_BROWSER only in release-swizzle-proof).
  • Claim: the proof's slices do not finish locally on the author's machine. Not checkable (the author's environment).
  • Claim: Prettier and ESLint are clean. Prettier verified; ESLint ignores these files.
  • Claim: #9832 adds samples with other keys, none marked, and the two merge cleanly in either order. Verified (no shared keys; a three-way merge of samples.mjs has no conflict).
  • File packages/cli/test/swizzle-proof/proof.mjs: bullet above.
  • File packages/cli/test/swizzle-proof/samples.mjs: clear, apart from the two targets the bullet above adds.
  • File packages/cli/test/swizzle-proof/samples.test.mjs: clear.

Automated review (maintainer link)

@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec c0212f6

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changes requested: the guard now reads multi-component docs as asked last round, and two lines of the description are no longer true at this head.

  • The Overlap line says this pull request and #9832 merge cleanly in either order, but on their merged tree samples.test.mjs fails on lab__MediaPlayer, whose doc entry requires label and which #9832 gives no sample, so the line should say that the second to land needs that sample (and #9832 can add it now).
  • The Tests line says 14 of 14 pass, but the new multi-component test makes it 15 of 15.

Non-blocking: requiredWithoutDefault takes defaults from an entry's own playground (proof.mjs:877) while the render uses only the doc's top-level defaults, so one shared helper would keep the guard and the render in step; no target differs today.

Claims and files checked

Review mode: incremental; reason: none

  • changed rules (0): none
  • Claim: The release check's full proof failed on one target, the chat virtualizer, reading length of undefined in the browser: verified in part (the release check requires the release proof, and a Chromium run with the same sample and render steps reproduced the error without the sample; the release run itself was not read).
  • Claim: The cause is a missing sample with no playground defaults, leaving three required props unset: verified (ChatVirtualizer.doc.mjs marks data, getRowKey and renderItem required and has no playground; ChatVirtualizer.tsx:983 reads data.length).
  • Claim: The new sample renders three rows with a row key and a renderer in a 320 px frame: verified (samples.mjs:283-297).
  • Claim: A target with a required prop that no sample, default or mark gives fails by name, with the quoted message: verified (proof.mjs:899, red-first run).
  • Claim: The Node test needs no build and checks the proof's own targets through the proof's doc reader: verified (167 targets, run without a build).
  • Claim: A new component with required props fails on its own pull request: verified for a component's own doc and for a multi-component doc entry (merging #9832 fails on its player root).
  • Claim: The proof refuses such a target before rendering it: verified (proof.mjs:527-535).
  • Claim: A component documented only inside another component's doc is not checked: verified (TabBarItem lives in TabBar.doc.mjs; the doc reader finds no file for it).
  • Claim: 37 targets are marked, each with the props it renders without: verified (37 of 37 notes match the guard).
  • Claim: The guard starts green: verified (0 of 167 targets flagged).
  • Claim: Test-only, with no component, workflow or record change: verified.
  • Claim: Red-first, the test names the three missing props without the sample: verified.
  • Claim: With the sample, 14 of 14 tests pass: false (15 of 15 at this head).
  • Claim: This pull request's swizzle legs prove eject, type-check, bundle and server render without a browser: verified (the legs run without the browser flag, and a change to the proof's folder runs every target); they have not run at this head, which is a draft.
  • Claim: The proof's slices exceed their local time limit on the author's machine: not checkable here.
  • Claim: Prettier and ESLint are clean: verified (Prettier clean; ESLint ignores these files).
  • Claim: #9832 uses different keys and none is marked, so the two merge cleanly in either order: false (the text merges cleanly, but the merged tree fails the new test on the player root's required label).
  • Claim: Ownership and land path: process context, not checked against code.
  • File packages/cli/test/swizzle-proof/proof.mjs: non-blocking note (defaults source, line 877)
  • File packages/cli/test/swizzle-proof/samples.mjs: clear
  • File packages/cli/test/swizzle-proof/samples.test.mjs: clear

Automated review (maintainer link)

*/
export function requiredWithoutDefault(doc, name) {
const entry = doc?.components?.find(c => c?.name === name) ?? doc;
const defaults = (entry?.playground ?? doc?.playground)?.defaults ?? {};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Non-blocking: this takes defaults from the entry's own playground, but the render entry gets playgroundDefaults (line 861), which reads only doc.playground. A multi-component entry that sets its own default for a required prop would pass here and still render without it. No target differs today: core__MobileNav and core__Stack have entry playgrounds but no required props. Reading the defaults through one helper that both use keeps the guard and the render in step.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved pending CI: CI has not run on this head yet because the pull request is a draft, and it runs once the pull request is marked ready for review.

The overlap and test-count lines flagged last round now match the code: on the merge with #9832 the new test fails only on the media player root's label, as the description says, and 15 of 15 tests pass.

Non-blocking: requiredWithoutDefault takes defaults from an entry's own playground (proof.mjs:877) while the render uses only the doc's top-level defaults (proof.mjs:861-864), so one shared helper would keep the guard and the render in step; no target differs today.

Claims and files checked

Review mode: same-head; reason: none

  • changed rules (0): none
  • Claim: The release check now runs the full proof, and its first run failed on the chat virtualizer in the browser, reading length of undefined: verified in part (the release gate requires the release proof, and the virtualizer reads data.length at ChatVirtualizer.tsx:983; the release run itself was not read).
  • Claim: The cause is a missing sample with no playground defaults, leaving three required props unset: verified (ChatVirtualizer.doc.mjs marks data, getRowKey and renderItem required and has no playground).
  • Claim: The new sample renders three rows with a row key and a renderer in a 320 px frame: verified (samples.mjs:283-297).
  • Claim: A target with a required prop that no sample or default gives fails by name, with the quoted message: verified (proof.mjs:899, red-first run).
  • Claim: The Node test needs no build and checks the proof's own targets through the proof's doc reader: verified (samples.test.mjs:18-19; 167 targets, run without a build).
  • Claim: A new component with required props fails on its own pull request: verified (merging #9832 fails on its player root).
  • Claim: The proof refuses such a target before rendering it: verified (proof.mjs:527-535).
  • Claim: A component's own doc and a multi-component doc entry are covered, and a component documented only inside another component's doc is not: verified (TabBarItem has no doc file of its own).
  • Claim: 37 targets are marked with the props they render without, so the guard starts green: verified (37 of 37 marks match the guard; 0 of 167 targets flagged).
  • Claim: Test-only, with no component, workflow or record change: verified.
  • Claim: Red-first, the test names the three missing props without the sample: verified.
  • Claim: With the sample, 15 of 15 tests pass: verified.
  • Claim: The pull request's swizzle legs prove eject, type-check, bundle and server render without a browser, so the next release check proves the browser render: verified from the workflow (the pull-request legs set no browser flag; the release legs install Chromium and set it); they have not run at this head.
  • Claim: The proof's slices exceed their local time limit on the author's machine: not checkable here.
  • Claim: Prettier and ESLint are clean: verified (Prettier clean; ESLint ignores these files).
  • Claim: #9832 has no sample for its player root, whose doc requires label, so whichever of the two lands second needs that sample or a mark: verified (the merged tree fails only on that target's label).
  • Claim: Ownership and land path: process context, not checked against code.
  • File packages/cli/test/swizzle-proof/proof.mjs: non-blocking note (defaults source, line 877)
  • File packages/cli/test/swizzle-proof/samples.mjs: clear
  • File packages/cli/test/swizzle-proof/samples.test.mjs: clear

Automated review (maintainer link)

@cixzhang
cixzhang marked this pull request as ready for review November 18, 2026 05:41
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 9ac7cc7

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved pending CI: this push deferred the heavy suites (build, test and docsite-test), and they run before merge.

The update only merges main; the pull request's own changes are the ones approved last round, and on this head the new samples test still passes 15 of 15 with no target flagged.

Non-blocking, as before: requiredWithoutDefault takes defaults from an entry's own playground (proof.mjs:877) while the render uses only the doc's top-level defaults (proof.mjs:861-864), so one shared helper would keep the guard and the render in step; no target differs today.

Claims and files checked

Review mode: carry-forward; reason: none

  • Claim: Every release check now runs the full proof, and its first run failed on the chat virtualizer in the browser, reading length of undefined: verified in part (the release legs install Chromium and render every copy, .github/workflows/ci.yml:2030-2036, and the virtualizer reads data.length at ChatVirtualizer.tsx:983; the release run itself was not read).
  • Claim: The cause is a missing sample with no playground defaults, leaving three required props unset: verified (without the sample the guard names data, getRowKey and renderItem).
  • Claim: The new sample renders three rows with a row key and a renderer in a 320 px frame: verified (samples.mjs:283-297).
  • Claim: A target with a required prop that no sample or default gives fails by name, with the quoted message: verified (proof.mjs:899, red-first run on this head).
  • Claim: The Node test needs no build and checks the proof's own targets through the proof's doc reader: verified (samples.test.mjs:18-44; 167 targets, run without a build).
  • Claim: A new component with required props fails on its own pull request: verified (the merge with #9832 fails on its player root).
  • Claim: The proof refuses such a target before rendering it: verified (proof.mjs:527-535).
  • Claim: A component's own doc and a multi-component doc entry are covered, and a component documented only inside another component's doc is not: verified (proof.mjs:840-858, :876).
  • Claim: 37 targets are marked with the props they render without, so the guard starts green: verified (every mark matches the guard; 0 of 167 targets flagged).
  • Claim: Test-only, with no component, workflow or record change: verified (three files under packages/cli/test/, which the package does not publish).
  • Claim: Red-first, the test names the three missing props without the sample, and with it 15 of 15 pass: verified on this head.
  • Claim: The pull request's swizzle legs prove eject, type-check, bundle and server render without a browser, so the next release check proves the browser render: verified from the workflow (the pull-request legs set no browser flag, ci.yml:1968-1977; the release legs set it); they are deferred on this head.
  • Claim: The proof's slices exceed their local time limit on the author's machine: not checkable here.
  • Claim: Prettier and ESLint are clean: verified (Prettier clean; ESLint ignores these files).
  • Claim: #9832 has no sample for its player root, whose doc requires label, so whichever of the two lands second needs that sample or a mark: verified (carried: that pull request and this patch are unchanged, and the merged main changes no Lab doc).
  • Claim: Ownership and land path: process context, not checked against code.
  • File packages/cli/test/swizzle-proof/proof.mjs: non-blocking note (defaults source, line 877)
  • File packages/cli/test/swizzle-proof/samples.mjs: clear
  • File packages/cli/test/swizzle-proof/samples.test.mjs: clear

Automated review (maintainer link)

@cixzhang
cixzhang merged commit 20e4d48 into main Nov 18, 2026
138 of 141 checks passed
@cixzhang cixzhang removed the release-critical Admitted to CI at once (AST-030 DEC-30). Counts only when a writer applies it. label Nov 18, 2026
@github-actions
github-actions Bot deleted the test/swizzle-proof-chatvirtualizer-sample branch November 19, 2026 06:05

This branch was successfully deployed

1 active deployment
Preview — 9ac7cc7e Deployed Nov 18, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:run-swizzle Run the full swizzle proof on this PR; write access, next push (AST-110 DEC-3) CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant