test(console,app-shell,scripts): three 1-site specifiers join COVERED_SPECIFIERS (objectui#6892 slice 1) - #8020
Merged
Conversation
…site specifiers The three specifiers objectui#6892's triage named as the flow-proving start carried exactly one frozen `vi.mock` factory each. Each factory now obtains the real module and spreads it before its own overrides, and the three specifiers join `COVERED_SPECIFIERS` in the same commit -- the widening precondition the gate's own header states. Re-derived with the FIXED classifier (objectui#7889) on a tree carrying the `@object-ui/i18n` flip (objectui#7920), never from the worklist's stale table: each of the three read 1 judged / 0 inheriting / 1 frozen before, 1 / 1 / 0 after, with the all-specifier population moving 318 -> 315 frozen and no site moving the other way. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FhBNJcLRZLe8M87VcUgpKr
Contributor
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
Contributor
|
Standing-down note — Generated by Claude Code |
This was referenced Sep 6, 2026
baozhoutao
marked this pull request as ready for review
September 6, 2026 10:51
This was referenced Sep 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #6892
The first slice of the
vi.mockinheritance worklist: the three specifiers the card's triage named as the flow-proving start, because each carried exactly one frozen factory. Each factory now obtains the real module and spreads it before its own overrides, and the three specifiers joinCOVERED_SPECIFIERSin the same PR — the widening precondition the gate's own header states, and the one #6849's ruling forbids splitting.Verified at
de7470dc8.Re-derived per-specifier table — ⛔ not the card's
The card's table (
9ce20233f) is stale twice over: it predates the recogniser repair in #7889 (the old classifier over-reportedfrozen) and the@object-ui/i18nflip in #7920. Both are onmain. Everything below was measured on this branch with the fixed classifier.The gate's CLI cannot produce this table on an unmodified tree —
--listjudges only the covered set and reports the rest as out of scope, and the script takes no flag or env override. Butscan()is exported and accepts acoveredoption, so the table is derived without touching the tree at all: pass 1 collects every workspace specifier anyvi.mockcall site names, pass 2 judges them all.This slice's three, before and after:
@object-ui/plugin-markdown@object-ui/data-objectstack@object-ui/plugin-reportThe whole population, over the 22 workspace specifiers any call site in the tree names:
Zero sites moved the other way —
inheritsrises by exactly 3 asfrozenfalls by exactly 3, and the per-specifier rows for the other 19 specifiers are byte-identical between the two runs.@object-ui/*specifier avi.mockcall site actually names — which includes the subpath@object-ui/components/ui/sonner— rather than over the package list. The remaining table is in this PR's report on #6892 so the next slice can be scoped from it without re-deriving; the largest is@object-ui/authat 102 frozen (the card said 92), and@object-ui/app-shellat 23 still reads #6580 first.The conversion, per file
All three take the spelling already used by their neighbours in the same file (
docs-portal.test.tsx's own@object-ui/i18nfactory is line-for-line this shape), with the spread inserted as the first property so each test's own stubs still shadow the real export exactly as before.apps/console/src/pages/docs-portal.test.tsx:52@object-ui/plugin-markdownMarkdownRenderer,extractTocpackages/app-shell/src/chrome/ConditionalAuthWrapper.previewRetired-6654.test.tsx:72@object-ui/data-objectstackgetSharedDiscoverypackages/app-shell/src/views/ReportView.dataSourceObjectKey.test.tsx:60@object-ui/plugin-reportReportRendererNone of the three is a deliberate freeze. Each was read for the "prove the module is NOT loaded" shape the gate's header carves out, and each is an ordinary stub-the-renderer / stub-the-helper factory that says so in its own comment where it says anything at all.
Behaviour preservation
Spreading the real module means each mock now returns exports it previously omitted, so this was checked rather than assumed, on PR #6847's criteria:
import * as ns fromany of the three specifiers returns no hits repo-wide, so there is no namespace object for anObject.keysorintest to read.toBeUndefined/toBeNullin the three files was read: they are aboutAuthProvider's props (facts.previewMode) and about query params, never about an export.src/, notdist/. The rootvitest.config.mtsaliases all three specifiers to their packagesrc/, soimportOriginal()reads source and no build stands between the edit and the run.Reverse verification — two legs, three times
Committed first, then mutated: the restore leg points at
HEAD, andHEADcarries the implementation. Each leg proves itself on disk — the mutation by counting the deleted spread marker and the injected frozen form, the restore bygit hash-objectequal to the HEAD blob and an emptygit diff HEAD. Restore runs from atrap ... EXIT INT TERMwith absolute paths built fromgit rev-parse --show-toplevel.Leg A — re-freeze one factory, keep the flip. The gate goes RED, exit 1, naming that site and no other:
(three separate runs, one per specifier — each red names exactly its own site)
Leg B — restore. Blobs
2cc7d34f1,7e12f8d8f,6995e8c75, each equal to HEAD's,git diff HEADempty, gate exit 0 each time.This is what makes the three new
COVERED_SPECIFIERSlines load-bearing rather than decorative: without them Leg A would stay green, because an unlisted specifier is never judged.The guard's own pin needed no edit
Expected to redden and did not, so it is recorded rather than assumed. Every membership assertion in
scripts/__tests__/check-vi-mock-inherit.test.tsis derived from the constant rather than spelling it —COVERED_SPECIFIERS.length > 0, a loop resolving each member to a realpackages/NAME/package.json, andconst named = COVERED_SPECIFIERS.join(', ')for the verdict line. All three new members live underpackages/, so all 69 cases pass unchanged.That derivation has a flip side this PR inherits rather than creates, and it is filed separately as #8018, not addressed here: the only membership pin that resists removal names
@object-ui/i18nalone, so dropping@object-ui/react(134 sites) or any of these three from the list leaves every gate green over a population nobody looks at.Gates
All run at
de7470dc8, exit codes captured by redirect-then-capture.pnpm check:vi-mock-inherit229 call site(s) on @object-ui/react, @object-ui/i18n, @object-ui/plugin-markdown, @object-ui/data-objectstack, @object-ui/plugin-report judged (229 inherit, 0 auto-mocked)vitest run scripts/__tests__/check-vi-mock-inherit.test.tsTest Files 1 passed,Tests 69 passedvitest runthe three converted filesTest Files 3 passed (3),Tests 17 passed (17)vitest run packages/app-shell/Test Files 632 passed (632),Tests 6077 passed | 1 skipped (6078)vitest run apps/console/Test Files 89 passed (89),Tests 981 passed (981)pnpm check:vi-mock-specifiersOK (4354 tracked source file(s) ... 868 relative specifier(s) resolved)pnpm type-check:scriptstsc -p tsconfig.scripts.jsonpnpm check:control-bytesOK (scanned 6444 tracked text file(s); skipped 85 binary)grep -naPcontrol-byte self-scan of all 5 changed pathsnode scripts/check-changeset-presence.mjs3 source file(s) of 2 released package(s) changed ... Every one of them has an EMPTY frontmatternode scripts/check-governed-queue-guard.mjs --test(all 5 paths)NOT GOVERNED — 4 path(s) checked against 5 governed surface(s); none matchedtype-check(4 affected packages)--listFilesnames each edited test file — app-shell'stsconfig.test.jsonprogram 4421 files, console's 3510lint(eslint ., full, not narrowed)--format json. The changed gate script and changeset lint clean tooThe changeset declares an empty frontmatter: the three edited files are test files under released packages'
src/, and nothing published changes.Live E2E (informational)is red on every branch today for an upstream reason (#7990 / objectstack#16186) and is not this PR's.Scope of "affected" was derived rather than guessed:
TURBO_SCM_BASE=eeda78a780 turbo ls --affectednames four packages —app-shellandconsole(whose test files changed) plusexample-byo-backend-consoleandexample-console-starter, which are pulled in by the dependency graph alone. The examples carry no test script, and a.test.tsxedit inside another package cannot reach them; theirtype-checkis green here. Also green and unmentioned above because they are cheap siblings of the changeset gate:check-changeset-fixed,check-changeset-no-major,check-changeset-overwrite,check-lint-coverage(46/46 packages linted, 0 with outstanding errors).Generated by Claude Code