Repository navigation
Conversation
…ort a touched shared hook or util A change to a module under packages/core/src/hooks/ or packages/core/src/utils/ touches no component folder, so the contract job ran nothing for it. The touched step now lists such changed modules (contract_shared), and the runner walks their importers through the same value-import graph, nearest first, inside the same one-minute share; what does not fit is named as not run. AST-030 FR12 says so, with a verification row.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report🔎 Preview ·
|
|
/approve-spec 01934eb |
There was a problem hiding this comment.
Requesting changes: the new seed walk selects and reports the right specs, and the FR12 update carries its spec approval at this head, but four small fixes remain:
- Duplicated shared-module rule:
sharedModulesin.github/scripts/touched-components.mjs(lines 63-71) copies the runner'sSHARED_MODULEandisRenderedSourcerule, so export onesharedModules(files)froma11y-pr-contracts.mjs, use it in itsmain(), import it intouched-components.mjs(other scripts already import that module), and delete the copy. - False claim: every other pull request runs exactly as before: a pull request that changes a hook or util beside a component or a changed spec now adds the importers' specs to the same one-minute share, where a rendering folder's spec can move to not run (reproduced locally), so reword the CI impact line to say that.
- False claim about the via field:
renderingFoldersalso marksvia: 'shared'when both walks reach a folder and the shared walk is nearer (a11y-pr-contracts.mjslines 629-631), so describe it as nearer through the shared walk, with a tie stayingcomponent. - Shared-importer test never reaches the one-minute share: the 400 s file in that test is rejected by the 6-minute plan before the share check (test lines 702-725), so give it about 50 s and assert the 1-minute share reason that the new verification row says these cases catch.
The two changed test files pass locally (131 tests), and 12 of their cases fail against the base scripts. Optional: DEC-22 in the same record still says shared modules keep their scope, and an appended amendment would keep it consistent with FR12.
Claims and files checked
Review mode: full; reason: no-earlier-review
- Claim: the contract job also runs the specs of components that import a changed Core hook or util. Verified by the new walk and its tests.
- Claim: before, a hook-only or util-only change touched no component folder, so the job skipped. Reported; consistent with the base scope logic and the base skip condition.
- Claim: importers' scoped and release-only specs run nearest first in the same one-minute share. Verified by code; the share case for importers is untested (finding).
- Claim: the walk is seeded from touched folders, the import graph already crosses shared files, and the budget is unchanged. Verified; no limit changes in the diff.
- Claim: specs that do not fit are named as not run, with the label that runs them. Verified by the planner reason and its test.
- Claim: the FR12 clause and one verification row change, with the specification owner's approval. Verified; the exact-head spec approval is posted.
- Claim: the touched step lists shared modules and never a test, story, doc, spec or declaration. Verified by its tests.
- Claim: the workflow runs the job when that list is non-empty and passes it to the runner. Verified; all nine gated steps carry the new condition.
- Claim: the via field is shared only when a folder is reached only that way. False (finding).
- Claim: the spec reason, the budget message and the summary line name shared imports. Verified.
- Claim: 10 new or updated cases fail against the base's two scripts. Reported; consistent, since 12 fail locally when the base workflow file is used too.
- Claim: 131 of 131 cases pass. Verified locally.
- Claim: a component change still lists the folders that render it, now marked as a component. Verified by test.
- Claim: the listed regression cases prove each behavior. Partly unverified: the one-minute share case is not exercised (finding).
- Claim: every suite that reads the workflow or the two scripts passes. Reported; locally 69 of 79 such files pass, and the other 10 need a git working tree.
- Claim: the knowledge check is aligned. Verified locally.
- Claim: the spec routing lookup lists no other governing claim. Reported.
- Claim: scope checklist and writing rubric results. Verified; no internal context found, and the new runner flag is stated openly.
- Claim: overlap with other open pull requests, with the new helper kept private. Reported; the helper is module-private.
- Claim: the job now runs for a hook-only or util-only pull request and adds about 1.5 minutes of setup plus at most one minute of specs. The run is verified; the timings are reported.
- Claim: every other pull request runs exactly as before. False (finding).
- File
.github/scripts/a11y-pr-contracts.mjs: clear; it owns the rule the touched step copies. - File
.github/scripts/a11y-pr-contracts.test.mjs: finding (share test). - File
.github/scripts/touched-components.mjs: finding (duplicated rule). - File
.github/scripts/touched-components.test.mjs: clear. - File
.github/workflows/ci.yml: clear; no permission or required-check change. - File
docs/specs/AST-030/spec.md: note (DEC-22 wording; the new row overstates share coverage).
touched-components imports sharedModules from a11y-pr-contracts.mjs instead of keeping a copy, and the runner's main() uses the same function. The shared importer's test now reaches the one-minute share (50 s) and checks that reason.
There was a problem hiding this comment.
Requesting changes: the new seed walk picks and reports the right specs, and the FR12 update carries its spec approval at this head, but six fixes remain:
- Unamended FR13 contradicts the change: FR13 in
docs/specs/AST-030/spec.md(lines 339-342) still says the contract job "neither widens to shared modules", and DEC-22 still says shared modules keep their scope, so add the importers of a touched Core hook or util to FR13's list, drop "shared modules" from that clause, and append a one-line amendment under DEC-22. - Duplicated shared-module rule:
sharedModulesin.github/scripts/touched-components.mjs(lines 63-71) copies the runner'sSHARED_MODULEandisRenderedSourcerule, so export onesharedModules(files)froma11y-pr-contracts.mjs, use it in itsmain(), import it intouched-components.mjs(other scripts already import that module), and delete the copy. - False claim: every other pull request runs exactly as before: a hook or util change beside a component, beside a changed spec, or beside any other path such as a changeset now runs differently (the importers join the one-minute share, or the job runs where it used to skip), so reword it to "a pull request that changes no Core hook or util source runs exactly as before".
- False claim about the via field:
renderingFoldersalso marksvia: 'shared'when both walks reach a folder and the shared walk is nearer (a11y-pr-contracts.mjslines 629-631), so describe it as nearer through the shared walk, with a tie stayingcomponent. - False claim: declarations are never shared modules: both rules exclude only
.d.ts, so a changed.d.mtsor.d.ctsdeclaration underhooks/orutils/is listed and starts the job (reproduced locally), so exclude\.d\.[cm]?ts$in the one shared rule and add that case to thesharedModulestest. - Shared-importer test never reaches the one-minute share: the 400 s file in that test is rejected by the 6-minute plan before the share check (test lines 702-725), so give it about 50 s and assert the 1-minute share reason that the new verification row says these cases catch.
The two changed test files pass locally (131 tests).
Claims and files checked
Review mode: same-head; reason: none
- Claim: the contract job also runs the specs of components that import a changed Core hook or util. Verified by the new walk and its tests, run locally.
- Claim: before, a hook-only or util-only change touched no component folder, so the job skipped. Reported; consistent with the base skip condition and seed rule.
- Claim: importers' scoped and release-only specs run nearest first in the same one-minute share. Verified by code and a local probe; the cited test does not reach the share (finding).
- Claim: the walk is seeded from touched folders and the import graph already crosses shared files. Verified by code.
- Claim: the fix uses the same graph and the same one-minute share, and nothing about the budget changes. Verified; no budget constant changes.
- Claim: specs that do not fit are named as not run, with the label that runs them. Verified by the planner reason and its test.
- Claim: one FR12 sentence and one verification row change, as the specification owner ruled. Verified; the exact-head spec approval is posted.
- Claim: the one-minute share and every other limit are unchanged. Verified.
- Claim: the touched step lists shared modules, never a test, story, doc, spec or declaration. False for
.d.mtsand.d.ctsdeclarations (finding). - Claim: the workflow runs the job when that list is not empty and passes it to the runner. Verified by reading: the skip step and all eight gated steps carry it, and the workflow contract test checks five of them and the new env value.
- Claim: the via field is shared only when a folder is reached only that way. False (finding).
- Claim: the spec reason, the budget message and the summary line name shared modules. Verified.
- Claim: 10 new or updated cases fail against the base scripts. Reported; consistent with an earlier local run at this head, where 12 fail when the base workflow file is used too.
- Claim: 131 of 131 cases pass. Verified locally.
- Claim: a component change still lists exactly the folders that render it, now marked as a component. Verified by test.
- Claim: the listed regression cases prove each behavior. Partly unverified: the one-minute share case is not exercised (finding).
- Claim: every suite that reads the workflow or the two scripts passes. Reported; CI's test job has not run at this head.
- Claim: the knowledge check is aligned. Verified locally.
- Claim: no record governs the changed lines beyond the FR12 clause. False: FR13 and DEC-22 also state what the contract job runs (finding).
- Claim: one defect, no tag-alongs, no hidden public API, no internal context. Verified; the new runner flag is stated openly.
- Claim: writing rubric results for the record edit. Verified; the added words and row state behavior.
- Claim: overlap with other open pull requests, with the new helper kept private. Reported; the helper is module-private.
- Claim: the job now runs for a hook-only or util-only pull request, adding about 1.5 minutes of setup and at most one minute of specs within its limits. The run is verified; the timings are reported.
- Claim: every other pull request runs exactly as before. False (finding).
- Claim: it merges at the end of a batch. Reported.
- File
.github/scripts/a11y-pr-contracts.mjs: finding (via claim; it owns the rule the touched step copies). - File
.github/scripts/a11y-pr-contracts.test.mjs: finding (share test). - File
.github/scripts/touched-components.mjs: finding (duplicated rule; declarations). - File
.github/scripts/touched-components.test.mjs: finding (no declaration case beyond.d.ts). - File
.github/workflows/ci.yml: clear; no permission, trigger or required-check change. - File
docs/specs/AST-030/spec.md: finding (FR13 and DEC-22 left contradicting FR12; the new row overstates share coverage).
| left and for at most one minute of it, it runs the `scoped` and | ||
| `release-only` spec files of the component folders that render a touched | ||
| component through their source value imports, nearest first. It runs no unchanged `audit` or `always` spec. `.a11y.browser.spec.ts` files run in Chromium in CI; their WebKit project runs locally and in the weekly WebKit run, which reports their failures without failing (DEC-24). The weekly WebKit run also runs the hover specs that `playwright.config.ts`'s `firefox` project lists, in Firefox, which orders pointer and mouse events differently: it reports their failures without failing, and counts the failures `.github/firefox-known-failures.json` lists apart from new ones. A pull request that changes the code or accessibility specs of the components those specs cover (DropdownMenu, HoverCard, InfoTip, NavMenu, Tooltip), the shared hover and dismiss code, or the Firefox spec list, its known failures or its report also runs them in Firefox, on a standard runner, once its heavy suites run (FR20). That leg is report-only: it fails no check and no join reads it, and its report marks each failure the list does not name as new. For a shared primitive named in `.github/a11y-shared-primitives.json`, FR12's touched-component rule also runs a dependent-audits leg on every pull-request CI run that runs the heavy suites (FR20) and includes a change to it: at most three legs, or four on a first run when a fourth runs every owed audit, each at most 10 minutes, covering the audits of components that use it. The list starts with Button and IconButton. Layer joins when a Layer change breaks release-check or a dependent audit at release; other additions are a CI & Release and chief-of-staff call. A change to a component's source also runs that component's own audit specs in the same leg, on each such run that includes the change, within the same three legs of ten minutes, or four when a fourth leg of ten minutes runs every owed audit. Audits beyond that budget are listed by name as not yet run, with the main-only dispatch below that runs the owed audits at that head; a later run at the same head, which may use more legs, also runs them. merge-guard merges only on a run at the exact head that ran every owed audit. When GitHub cannot list a pull request's changed files, every audit is owed and no run at that head is complete, so merge-guard does not merge it; the pull request must be split. A main-only dispatch may run every owed audit at a pull request's exact head, as untrusted code under the same limits as the pull request's own run; merge-guard accepts its record for that head as it accepts the pull request run's. With contracts requested, the same dispatch also runs, at that head, the scoped accessibility contract specs a labelled pull-request run selects; merge-guard accepts its result as that head's opt-in accessibility evidence only when every selected spec ran and passed. The contract job runs in parallel with the unit-test jobs and | ||
| component or import a touched shared hook or util (a module under |
There was a problem hiding this comment.
FR13 in this record (lines 339-342) still says the contract job runs the folders "that render a touched component (FR12, DEC-23); neither widens to shared modules or to a full suite", and DEC-22 (line 1351) says "Shared modules keep their scope". With this FR12 change the record contradicts itself. Add the importers of a touched Core hook or util to FR13's list, drop "shared modules" from that clause, and append a one-line amendment under DEC-22.
There was a problem hiding this comment.
Requesting changes: the shared-module rule now lives in one place and the share test reaches the one-minute share, and the FR12 update carries its spec approval at this head, but three fixes remain:
- Unamended FR13 contradicts the change: FR13 in
docs/specs/AST-030/spec.md(lines 339-342) still says the contract job "neither widens to shared modules", and DEC-22 (line 1351) still says shared modules keep their scope, so add the importers of a touched Core hook or util to FR13's list, drop "shared modules" from that clause, and append a one-line amendment under DEC-22. - False claim: declarations are never shared modules:
sharedModuleskeeps.d.mtsand.d.ctsfiles becauseNOT_RENDEREDin.github/scripts/a11y-pr-contracts.mjs(lines 410-411) excludes only.d.ts(reproduced locally), so exclude\.d\.[cm]?ts$and add that case to thesharedModulestest. - False claim: a pull request that changes no Core hook or util runs exactly as before: when CI cannot decide a pull request's scope (for example, GitHub cannot list its changed files), the job counts every file as changed (
ci.ymllines 7223-7229), so every hook and util seeds the walk throughcontract_shared(touched-components.mjsline 628), and the sentence needs that exception (the wording suggested earlier missed this case).
The two changed test files pass locally (130 tests).
Claims and files checked
Review mode: incremental; reason: none
- Title: the contract job also runs the specs of components that import a touched shared hook or util. Verified by the new walk and its tests, run locally.
- Claim: a shared hook or util change can change how its users' components behave for keyboard and screen-reader users. Context; consistent with the change.
- Claim: before, such a change touched no component folder, so the job found nothing to run and skipped. Reported; consistent with the base skip condition and seed rule.
- Claim: after, the importers' scoped and release-only specs run, nearest first, inside the same one-minute share. Verified by code, tests and a local probe.
- Claim: the walk is seeded from touched component folders, and the import graph already follows shared files. Verified by code.
- Claim: the fix uses the same graph and the same share, and nothing about the budget changes. Verified; no budget constant changes.
- Claim: what does not fit is named as not run, with the label that runs it. Verified by the planner reason and its test.
- Claim: one FR12 line and one verification row change, as the spec owner ruled. Verified; spec approval is recorded at this head.
- Claim: the one-minute share and every other limit are unchanged. Verified.
- Claim: the runner exports the shared-module rule, never a test, story, doc, spec or declaration. False for
.d.mtsand.d.ctsdeclarations (finding). - Claim: the touched step imports that rule for its new output and the runner flag uses the same function, so the rule lives in one place. Verified.
- Claim: the workflow runs the job when that list is not empty and passes it to the runner. Verified by reading; the workflow test checks five of the eight gated steps and the new env value.
- Claim: a folder is marked shared when the shared walk is nearer or alone, and a tie stays component. Verified by code and a local probe.
- Claim: the spec reason, the budget message and the summary line name the shared case. Verified.
- Claim: the FR12 line and one verification row are the record changes. Verified.
- Claim: 9 new or updated cases fail against main's scripts. Reported.
- Claim: 130 of 130 cases pass in the two test files. Verified locally.
- Claim: a component change still lists exactly the folders that render it, now marked as component. Verified by test.
- Claim: the listed regression cases, including the 50-second spec that overflows the share. Verified; each case exists and passes locally.
- Claim: every suite that reads the workflow or the two scripts passes (56 files, 1,270 tests). Reported; CI's test job has not run at this head, and locally 69 of 79 related files pass, the other 10 needing a git checkout.
- Claim: the knowledge check is aligned. Verified locally.
- Claim: no record governs the changed lines beyond FR12. False: FR13 and DEC-22 also state what the contract job runs (finding).
- Claim: one defect, no tag-alongs, no hidden public API, no internal context. Verified; the new runner flag is stated openly.
- Claim: writing rubric results for the record edit. Verified; the added words and row state behavior.
- Claim: overlap with other open pull requests, with the new helper kept private. Verified that the helper is not exported; the other pull requests' state is reported.
- Claim: hook-only or util-only pull requests now run the job, adding about 1.5 minutes of setup and at most one minute of specs within its limits. The run and limits are verified; the timings are reported.
- Claim: a hook or util change beside a component or a changed spec runs as before, except that importers join the same share. Verified by a local probe.
- Claim: a pull request that changes no Core hook or util runs exactly as before. False when CI cannot decide the scope (finding).
- Claim: it merges at the end of a batch. Reported.
- File
.github/scripts/a11y-pr-contracts.mjs: finding (declarations). - File
.github/scripts/a11y-pr-contracts.test.mjs: clear. - File
.github/scripts/touched-components.mjs: finding (undecided scope bound). - File
.github/scripts/touched-components.test.mjs: finding (no declaration case beyond.d.ts). - File
.github/workflows/ci.yml: clear; no permission, trigger or required-check change. - File
docs/specs/AST-030/spec.md: finding (FR13 and DEC-22 left contradicting FR12).
| */ | ||
| export function sharedModules(files) { | ||
| return files.filter( | ||
| file => SHARED_MODULE.test(file) && isRenderedSource(file), |
There was a problem hiding this comment.
This goes through isRenderedSource, whose NOT_RENDERED (lines 410-411) excludes only .d.ts. A .d.mts or .d.cts declaration under hooks/ or utils/ is therefore listed and starts the contract job (reproduced locally), although the comment above and the description say declarations are never listed. Exclude \.d\.[cm]?ts$ and add a .d.mts path to the sharedModules test.
| // budget (spec:AST-030 FR12). | ||
| contract_owners: scope.touched.join(','), | ||
| contract_folders: scope.folders.join(','), | ||
| contract_shared: sharedModules(files).join(','), |
There was a problem hiding this comment.
When CI cannot decide the scope (GitHub cannot list the changed files, say), files here is every tracked file (ci.yml lines 7223-7229 and 7254), so contract_shared names every hook and util and the job runs their importers even for a pull request that changes none. That fails closed, which is fine, but the description's "A pull request that changes no Core hook or util runs exactly as before" needs that exception.
User impact
A pull request that changes a shared hook or util in Core (
packages/core/src/hooks/orpackages/core/src/utils/) can change how every component that uses it behaves for keyboard and screen-reader users. The contract job ran none of those components' accessibility specs: such a change touches no component folder, so the job found nothing to run and skipped. After this change, the job runs thescopedandrelease-onlyaccessibility specs of the components that import the changed hook or util, nearest first, inside the same one-minute share it already gives to components that render a touched component.Problem and solution fit
The fix seeds the same walk from the changed hooks and utils, through the same source value-import graph, and spends the same one-minute share; nothing about the budget changes. What does not fit is named in the job summary as not run, with the label that runs it.
Expected behavior and authority
spec:AST-030FR12 (current) states the contract job's default check. This pull request corrects one line of it, as the specification owner ruled: after "that render a touched component" it adds "or import a touched shared hook or util (a module underpackages/core/src/hooks/orpackages/core/src/utils/)", and adds one verification row. The one-minute share and every other limit are unchanged.Smallest restoration
a11y-pr-contracts.mjsexportssharedModules(the changed source under the two folders, never a test, story, doc, spec or declaration);touched-components.mjsimports it for its newcontract_sharedoutput, and the runner's--shared-modulesuses the same function, so the rule lives in one place.ci.yml's contract job runs when that list is not empty and passes it to the runner (--shared-modules).a11y-pr-contracts.mjs:renderingFoldersalso walks from those files. A folder is markedvia: 'shared'when the shared walk reaches it nearer than the component walk, or only that walk reaches it; a tie stayscomponent. The spec reason, the budget message and the summary line name the shared case.docs/specs/AST-030/spec.md: the FR12 line and one verification row.Evidence
main's two scripts, 9 of the new and updated cases fail: a hook-only and a util-only change plan no importer, the touched step has nosharedModulesand nocontract_sharedoutput, and the reasons and summary lines do not name shared modules.via: 'component'(the existing fix(Spinner): route standalone loading through the shared announcement channel #7910-shaped case, unchanged except for that field).a11y-pr-contracts.test.mjsshared-module cases (a hook-only change plans its importer; a util-only change does the same and a test that imports it is not a component; a hook nothing imports plans none; a folder reached both ways counts once; a shared importer's spec is named by why it runs and stays inside the one-minute share) (its spec at 50 s overflows the one-minute share and is named with that reason);touched-components.test.mjssharedModulesandcontract_sharedcases.Scope
Components: CI accessibility contract job (touched-components, a11y-pr-contracts, ci.yml) and AST-030 FR12
Testing
pnpm exec vitest run --project node .github/scripts/a11y-pr-contracts.test.mjs .github/scripts/touched-components.test.mjs: 130 passedci.yml,a11y-pr-contracts.mjsortouched-components.mjspasses: 56 files, 1,270 tests.pnpm check:knowledge: "Knowledge templates and records are aligned."pnpm specs:for --diff origin/main: lists the global records every path routes; no record governs the changed lines beyond AST-030 FR12, which this pull request updates.Writing rubric results
R1 narration: the added FR12 words state what the job runs; no proposal or history.
R2 research: none in the record.
R3 evidence: the new verification row names the tests and the states they cover, not a pull request.
R4 rejected alternatives: none added.
R5 change references: none added.
R6 open questions: none touched.
R7 project status: none; the row states behavior.
Overlap
Overlap checked: #14146, #14223, #14208, #14114, #14249, #14228, #13963, #13023, #13769, #13762, #13571, #12985, #12359 (#14146 is a draft with the same idea for the opt-in labelled accessibility run (
pr-a11y): complementary, since this changes the default contract job, but both edita11y-pr-contracts.mjs, so whichever lands second takes a main merge; this keeps its new helper private and namedseededFoldersso it does not clash with #14146's exportedreachedFolders. The others edit other parts ofa11y-pr-contracts.mjs,touched-components.mjs,ci.ymlor AST-030.)CI impact
CI impact: the contract job (
pr-component-a11y-contracts, standard GitHub-hosted runner) now also runs for a pull request that changes only a Core hook or util, where it skipped before; on such a pull request it adds the job's setup (about 1.5 minutes) and at most one minute of importer specs, within its existing eight-minute stop and fifteen-minute limit, beside the unit tests, so time to green does not grow. A pull request that changes a hook or util beside a component or a changed spec runs as before, except that the importers' specs join the rendering folders' specs in the same one-minute share, so a rendering folder's spec can move to "not run" when the share fills. A pull request that changes no Core hook or util runs exactly as before. This edits.github/workflows/ci.ymland two scripts every pull request's CI reads, so it merges at the end of a batch.