Repository navigation
test(rtl): report verified-N/A receipt drift without changing coverage status - #13909
Conversation
…e status Co-authored-by: freddymeta <170298698+freddymeta@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
|
/approve-spec 4125900 |
PR Analysis Report🔎 Preview ·
|
| Before | After | Change | |
|---|---|---|---|
| Job-minutes per PR update | 211.8 | 211.8 | 0 |
| Runner pool, runner-minutes a day | 35,247 | 35,247 | 0 (0%) |
| Average concurrent jobs | 24.5 | 24.5 | 0 |
| Time to green (median → this run) | — | 25.5 min | — |
| Runs a day | 166 | 166 | 0 |
Not measured (the jobs that use these keep their recent minutes above): .github/scripts/rtl-scorecard-summary.mjs, .github/scripts/rtl-verified-na-receipts.test.mjs.
Assumptions: before is each job's average over the last 20 pull-request runs; after keeps that for unchanged jobs and uses this run's minutes for added or changed ones, weighted by how often each changed job ran in those runs; runs a day averages the seven whole days before today; time to green compares this run with the median of those runs that ran the same jobs.
Generated by PR Enrichment workflow | View full report
There was a problem hiding this comment.
Changes requested: one statement in the description does not match the code.
rtl:audit:verify-nais described (and documented in theverify-na-evidence.mjsheader) as always exiting 0, but line 26 parses the registry with a bareJSON.parse, so a registry with a syntax error, or a missing one, throws and exits 1; reword the claim (for example "drift never changes the exit code; an unreadable registry exits 1") or catch the read error and keep exit 0.
The drift report itself fits the RTL audit evidence architecture, leaves every coverage status and exit code unchanged, and reproduces the stated 27 of 27 drift on main. Two optional follow-ups: print the current sha256: beside each changed file so receipts can be refreshed from the tool's output, and note that the new test's registryError assertion cannot fail because buildComponentCoverage never sets that field.
Claims and files checked
Review mode: full; reason: no-earlier-review
- Claim: drift is reported without changing coverage status: verified (
rtl-audit.mjs:1440-1442,:1670-1683; test lines 139-167). - Claim: nothing new can fail a run: verified (
receiptDriftcatches per-receipt errors; both exit-code expressions unchanged; the completion check and the touched-components result ignore the new section). - Claim: the report and the job summary gain a drift table: verified (
rtl-audit.mjs:1450,:1780;rtl-scorecard-summary.mjs:192-209; test lines 200-222). - Claim: the receipt hasher refuses a path that leaves the repository: verified (
verified-na-receipts.mjs:23-42; test lines 49-55; parent, absolute and empty paths all refused). - Claim: drift sorts receipts into changed, missing and malformed and never throws on a bad receipt: verified (
verified-na-receipts.mjs:49-102; test lines 83-118; extra edge cases replayed). - Claim: the audit writes the section on the full and coverage-only paths with a log line: verified (
rtl-audit.mjs:1442-1458,:1683-1790). - Claim: the coverage builder, the registry error and the exit signal are untouched: verified (no diff lines there;
rtl-audit.mjs:1441,:1460,:1681,:1799). - Claim: the audit script keeps its existing formatting: reported.
- Claim: the scorecard prints the table only when something drifted: verified (test lines 200-222).
- Claim: the author tool lists drift for the whole registry without a Storybook build: verified (run on this head: 27 of 27 drifted, 55 without receipts).
- Claim: the author tool always exits 0: false (
verify-na-evidence.mjs:26; a malformed registry exits 1). - Claim: the README gains a receipts section: verified (
README.md:324-335). - Claim: the tests cover matching, changed, missing, malformed and escaping receipts, scope, the summary and a malformed receipt leaving coverage alone: verified (each case present; the registry-error assertion cannot fail).
- Claim: wiring drift into the build would fail main because every receipted declaration drifted: verified (independent hashes: 27 of 27).
- Claim: the Kbd receipts matched when recorded: verified (hashes at the recording commit equal the registry).
- Claim: the governing record covers report-only drift and keeps byte invalidation proposed: verified (system model, INV8, the stale-evidence row and Change coupling).
- Claim: owners signed off on report-only drift: reported.
- Claim: the scoped audit counts and identical coverage: reported (consistent with the registry: Kbd and SelectableCard carry receipts, VisuallyHidden has no entry).
- Claim: the completion check passes and reads no coverage status: verified by code (
rtl-report-completion.mjs:100-163); the run itself is reported. - Claim: the audit step stays soft and the summary goes to the job summary only: verified (
ci.yml:6400,:6468-6472). - Claim: 128 tests pass and the new files pass Prettier: reported (CI has not run at this head).
- Claim: the predecessor's discovery is limited to two packages: reported.
- Claim: no component, story or registry entry changes: verified (seven changed files, all tooling or docs).
- File
.github/scripts/rtl-scorecard-summary.mjs: clear. - File
.github/scripts/rtl-verified-na-receipts.test.mjs: non-blocking note (line 158 assertion cannot fail). - File
apps/storybook/rtl-audit/README.md: clear. - File
apps/storybook/rtl-audit/rtl-audit.mjs: clear. - File
apps/storybook/rtl-audit/verified-na-receipts.mjs: clear. - File
apps/storybook/rtl-audit/verify-na-evidence.mjs: blocking (false exit-0 claim, lines 7 and 26); non-blocking note (no current receipt printed). - File
package.json: clear.
Co-authored-by: freddymeta <170298698+freddymeta@users.noreply.github.com>
|
/approve-spec 3635e01 |
There was a problem hiding this comment.
Changes requested: one stated exit code of the new author command does not hold.
rtl:audit:verify-nais documented (file header and description) to exit 1 on an unreadable registry, but a registry that parses and is not an array, such as{}ornull, exits 0 and prints0 of 0 receipted declarations drifted; 0 carry no receipts.while the audit rejects the same file as a registry error (rtl-audit.mjs:1279), so read the registry through the audit's reader moved into an importable module, or at least exit 1 when the parsed value is not an array.
The earlier points are addressed: the header now states the real exit codes, the command prints each changed file's current receipt, and the assertion that could not fail is gone. The report-only drift itself fits the RTL audit evidence architecture and leaves every coverage status and exit code unchanged.
Claims and files checked
Review mode: incremental; reason: none
- Claim: drift is reported without changing coverage status: verified (
rtl-audit.mjs:1439-1442,:1668-1683; test lines 139-167; replayed). - Claim: nothing new can fail a run: verified (no registry shape can make
receiptDriftthrow; both exit expressions unchanged,rtl-audit.mjs:1459-1460,:1795-1801; the completion check and the join ignore the new key; the scorecard guards it atrtl-scorecard-summary.mjs:195). - Claim: the report and the job summary gain a drift table: verified (
rtl-audit.mjs:1450,:1780;rtl-scorecard-summary.mjs:192-209; test lines 212-235). - Claim: the author command prints the same drift for the whole registry without a Storybook build: verified (run on this head: 27 of 27 drifted, 55 without receipts).
- Claim: the receipt hasher refuses a path that leaves the repository: verified (
verified-na-receipts.mjs:23-42; test lines 49-55; parent, absolute, empty and nested-escape paths replayed; the repository has no symlinks). - Claim: drift sorts receipts into changed, missing and malformed and reports a bad receipt instead of throwing: verified (
verified-na-receipts.mjs:49-102; test lines 83-118). - Claim: the audit writes the section on the full and coverage-only paths with a log line: verified (
rtl-audit.mjs:1442-1458,:1683,:1780,:1790; the merged-shard path shares the full path). - Claim: the coverage builder, the registry error and the exit signal are untouched: verified (no diff lines there).
- Claim: the audit script keeps its existing formatting: reported (CI's format check covers only TypeScript and Markdown files).
- Claim: the scorecard prints the table only when something drifted: verified (test lines 212-235; replayed).
- Claim: the author command prints each changed file with its current receipt: verified (
verify-na-evidence.mjs:34-40; the printed Kbd receipts equal the files' hashes). - Claim: drift never changes the author command's exit code: verified (no drift path exits non-zero; 27 drifted declarations exit 0).
- Claim: an unreadable registry makes the author command exit 1: false (a registry that parses but is not an array exits 0;
verify-na-evidence.mjs:27). - Claim: the README gains a receipts section: verified (
README.md:324-335). - Claim: the tests cover matching, changed, missing, malformed and escaping receipts, scope, unreadable registry shapes, the summary and a malformed receipt leaving status verified N/A: verified (test lines 40-235; every case replayed).
- Claim: reclassifying drift as a gap is the record's proposed byte-bound closure and an owner decision: verified (INV8 and the stale-evidence row).
- Claim: wiring drift into the build would fail main because every receipted declaration drifted: verified (independent hashes and the command: 27 of 27).
- Claim: the predecessor's evidence-set discovery covers two packages only: reported.
- Claim: the governing record reports stale evidence and keeps byte invalidation proposed: verified (system model, INV8, the stale-evidence row and Change coupling).
- Claim: the spec and CI owners agreed to a report-only check: reported.
- Claim: main's registry has 27 of 27 receipted declarations drifted and 55 without receipts: verified (independent hashes; the registry is identical on main).
- Claim: the Kbd receipts matched when recorded: verified (hashes at the recording commit equal the registry).
- Claim: the scoped audit counts, identical coverage and the same exit code: reported (consistent: a scoped replay gives 2 of 2 drifted).
- Claim: the completion check passes on that report and reads completeness only: verified by code (
rtl-report-completion.mjs:58-163reads no coverage status); the run itself is reported. - Claim: the registry error comes only from the audit's registry reader, which the drift check never assigns: verified (repository search: only
rtl-audit.mjs:1441and:1681assign it). - Claim: the audit step stays soft and the summary goes to the job summary only: verified (
ci.yml:6401,:6470-6472; the Core join accepts exit 0 or 1 at:6625; workflows unchanged). - Claim: 128 tests pass and the new files pass Prettier: reported (CI has not run at this head; the replayed cases pass).
- Claim: no component, story or registry entry changes: verified (seven files, all tooling and docs).
- Claim: the change continues an earlier pull request and overlaps no other: reported.
- File
.github/scripts/rtl-scorecard-summary.mjs: clear. - File
.github/scripts/rtl-verified-na-receipts.test.mjs: clear. - File
apps/storybook/rtl-audit/README.md: clear. - File
apps/storybook/rtl-audit/rtl-audit.mjs: clear. - File
apps/storybook/rtl-audit/verified-na-receipts.mjs: clear. - File
apps/storybook/rtl-audit/verify-na-evidence.mjs: blocking (a non-array registry exits 0, lines 7-9 and 27). - File
package.json: clear.
Co-authored-by: freddymeta <170298698+freddymeta@users.noreply.github.com>
|
/approve-spec 5d9744f |
There was a problem hiding this comment.
Approved. CI has run on this head and passed, including the new receipt-drift tests and the full RTL audit, whose package reports carry the new drift section and no registry error.
One optional wording fix in the description: the per-package counts "(39, 7, 4, 2 and 1 without receipts)" follow "charts, lab, richtext and vega", which pairs charts with 7 and lab with 4; the audit reports show charts 4 and lab 7.
Claims and files checked
Review mode: same-head; reason: none
- Claim (title): drift is reported without changing coverage status: verified (
rtl-audit.mjs:1439-1442,:1668-1683; coverage is built before drift and never reads it; test line 157; no package report at this head has a registry error). - Claim: nothing new can fail a run: verified (both exit expressions unchanged,
rtl-audit.mjs:1459-1460,:1795-1801; the drift check has no unguarded throw; the scorecard guards the key atrtl-scorecard-summary.mjs:195). - Claim: the report and the job summary gain a drift table: verified (
rtl-audit.mjs:1450,:1780;rtl-scorecard-summary.mjs:192-209; the core summary at this head lists 27 rows). - Claim: the author command prints the same drift for the whole registry without a Storybook build: verified (run at this head: 27 of 27 drifted, 55 without receipts).
- Claim: the receipt hasher refuses a path that leaves the repository: verified (
verified-na-receipts.mjs:23-42; test lines 49-55; a probe with a parent path). - Claim: drift sorts receipts into changed, missing and malformed and reports a bad receipt instead of throwing: verified (
verified-na-receipts.mjs:49-102; test lines 83-118). - Claim: the audit writes the section on the full and coverage-only paths with a log line: verified (
rtl-audit.mjs:1442-1458,:1683,:1780,:1790; the core join's log prints the line). - Claim: the coverage builder, the registry error and the exit signal are untouched: verified (no diff lines there).
- Claim: the audit script keeps its existing formatting: reported.
- Claim: the scorecard prints the table when any declaration drifted: verified (test lines 212-235; the core summary at this head).
- Claim: the author command prints each changed file with its current receipt: verified (
verify-na-evidence.mjs:40-50; the Kbd run). - Claim: drift never changes the author command's exit code: verified (drifted, escaping and missing receipts exit 0).
- Claim: a registry that is missing or does not parse as a JSON array exits 1, the same rule as the audit's reader: verified (
verify-na-evidence.mjs:28-33againstrtl-audit.mjs:1276-1284; a missing file, a trailing comma,{},null, a string and a bare object each exit 1). - Claim:
{},nulland a trailing comma exit 1 and[]exits 0: verified (each run on this head's code). - Claim: the README gains a receipts section: verified (
README.md:324-335). - Claim: the tests cover matching, changed, missing, malformed and escaping receipts, scope, unreadable registry shapes, the summary and a malformed receipt keeping verified N/A: verified (all 9 cases pass in CI at this head).
- Claim: reclassifying drift as a coverage gap is the record's proposed byte-bound closure and an owner decision: verified (INV8, the stale-evidence row and Change coupling).
- Claim: wiring drift into the build would fail main because every receipted declaration drifted: verified at the base this branch starts from; main now has one matching declaration (27 of 28 drifted), which would still fail at once.
- Claim: the predecessor's evidence-set discovery covers two packages only: reported.
- Claim: the governing record reports stale evidence and keeps byte invalidation proposed: verified (system model, INV8, the stale-evidence row and Change coupling).
- Claim: the spec and CI owners agreed to a report-only check: reported.
- Claim: main's registry has 27 of 27 receipted declarations drifted and 55 without receipts: verified at the base (main now reads 27 of 28 and 54).
- Claim: the Kbd receipts matched when recorded: verified (hashes at the recording commit equal the registry).
- Claim: the scoped audit counts, identical coverage and the same exit code: reported.
- Claim: the full RTL audit at this head ran with every leg, shard-report check and the core join passing: verified (CI check runs and steps at this head).
- Claim: all 271 components report the same coverage status as main's latest full run except Section: reported (271 components in this head's reports; the only component change between this base and that run is Section's).
- Claim: the registry error is unset in every package report: verified (all five reports at this head).
- Claim: core has 27 of 27 receipted declarations drifted and the other packages none receipted, with their without-receipt counts: reported (the five counts match the reports, but their stated order swaps charts and lab).
- Claim: the completion check passes and reads completeness only: verified by code (
rtl-report-completion.mjsreads no coverage status and no drift); every shard-report check passes at this head. - Claim: the registry error comes only from the audit's registry reader, which the drift check never assigns: verified (repository search: only
rtl-audit.mjs:1441and:1681assign it). - Claim: the audit step stays soft and the summary goes to the job summary only: verified (
ci.yml:6401,:6472,:6642; workflows unchanged). - Claim: 128 tests pass and the new files pass Prettier: reported (the Node tests and Lint pass in CI at this head).
- Claim: no component, story or registry entry changes: verified (seven files, all tooling and docs).
- Claim: the change continues an earlier pull request and overlaps no other: reported.
- Claim: the land path starts as a draft: reported (the pull request has since left draft).
- File
.github/scripts/rtl-scorecard-summary.mjs: clear. - File
.github/scripts/rtl-verified-na-receipts.test.mjs: clear. - File
apps/storybook/rtl-audit/README.md: clear. - File
apps/storybook/rtl-audit/rtl-audit.mjs: clear. - File
apps/storybook/rtl-audit/verified-na-receipts.mjs: clear. - File
apps/storybook/rtl-audit/verify-na-evidence.mjs: clear. - File
package.json: clear.
|
(Posted by Cindy's agent.) Correction to the Evidence section: in the full RTL run, the declarations without receipts are core 39, charts 4, lab 7, richtext 2 and vega 1. The description pairs charts with 7 and lab with 4. |
Primary intent
RTL audit tooling, report-only: the RTL audit reports receipt drift in the verified-N/A registry. Receipt drift is a declaration whose recorded
evidencefiles changed, went missing, or carry a malformed receipt. The report shows it in its own informational section. No component's coverage status changes, and nothing new can fail a run.Continues #5885 by @freddymeta. Its evidence model (path to
sha256:receipts, compared with the checkout) is the basis; this PR takes the report-only part.User impact
pnpm rtl:audit:verify-naprints the same drift for the whole registry without a Storybook build.Change
apps/storybook/rtl-audit/verified-na-receipts.mjs(new):fileReceipthashes one repository file and refuses a path that leaves the repository.receiptDriftcompares each in-scope declaration's recorded receipts with the checkout and returnschanged,missingandmalformedlists. A bad receipt is reported, never thrown.apps/storybook/rtl-audit/rtl-audit.mjs: computesreceiptDriftfor the audited roster and writes it as a top-levelreceiptDriftsection besidecoverage, on both the full and the coverage-only path, plus anRCPT:log line.buildComponentCoverage,registryErrorand the exit-code signal are untouched..github/scripts/rtl-scorecard-summary.mjs: prints the drift table when any declaration drifted.apps/storybook/rtl-audit/verify-na-evidence.mjs(new) andpackage.json: thertl:audit:verify-naauthor tool. It prints each changed file with its current receipt, so receipts can be refreshed from its output. Drift never changes its exit code; a registry that is missing or doesn't parse as a JSON array exits 1, the same rule as the audit's reader. Verified:{},nulland a trailing comma exit 1;[]exits 0.apps/storybook/rtl-audit/README.md: a "Receipts and receipt drift" section..github/scripts/rtl-verified-na-receipts.test.mjs(new): covers matching, changed, missing, malformed and escaping receipts; scope filtering; unreadable registry shapes (skipped, never thrown); the summary section; and a malformed receipt leaving coverage statusverified-na.Not in this PR
architecture:rtl-audit-evidencelists as proposed. It's an owner decision.Authority
architecture:rtl-audit-evidence: the pipeline reports "behavior failures, stale evidence, and applicability state". Byte-bound invalidation stays proposed (the INV8 note, the stale-evidence row, Change coupling). Specs ruled report-only drift as consistency. CI&R gave a GO for report-only, with no Storybook build wiring.Evidence
Main's registry, through the author tool:
27 of 27 receipted declarations drifted; 55 carry no receipts.For example,core/KbdchangedKbd.stories.tsxandKbd.tsx, and its receipts matched when it was added (6d0940f), so the drift is real.Scoped audit with this change (
--packages core --filter core/kbd,core/selectablecard,core/visuallyhidden, against a built Storybook):COV : 0 measured / 2 verified N-A / 1 gap / 0 stale;RCPT: 2 of 2 receipted declarations drifted (informational).The
coverageobject is identical to main's run on the same scope. The exit code is the same as main's too (1, from VisuallyHidden's existing gap, which test(rtl): a verified-N/A reason closes VisuallyHidden's RTL coverage gap #13906 closes).Full RTL audit at this head (
ci:run-rtl, all ninepr-rtllegs green, every "Require completed RTL shard report" step and the core join passing). Compared with main's latest full run (9fa84db):core/Section. Main's run includes [Component Audit] Section: docs give the full padding order, and tests check paint, dividers and RTL edges #13892, which removed Section's verified-N/A entry and added measured RTL edge checks, and this head's base predates it;registryErroris unset in every package report;receiptDriftreads 27 of 27 receipted declarations drifted in core, and 0 receipted in charts, lab, richtext and vega. Without receipts: core 39, charts 4, lab 7, richtext 2, vega 1.Required paths:
rtl-report-completion.mjson that report:Completed RTL evidence for core.(exit 0). It reads completeness only, never coverage status.registryErrorcomes only fromreadVerifiedNa's JSON read inrtl-audit.mjs; the drift check runs after it, never assigns it, and doesn't throw on any registry shape (tested).pr-rtl's audit step stayscontinue-on-error, and the summary writes to the job summary only.Tests: the RTL coverage, receipts, summary, completion, CLI and shards suites pass (128). The new files and the summary script pass Prettier.
Overlap
Overlap checked: #5885 (this PR continues it and takes the report-only receipt check; #5885's registry entries follow in per-family batches, and #5885 closes when they cover it)
Scope
RTL audit tooling and its README. No component, story or registry entry changes.
Owner and land path