Repository navigation
test(app-shell,console): inherit the real surface in @object-ui/auth vi.mock factories - #8054
Merged
Merged
Conversation
…vi.mock factories objectui#6892 slice 3. All 102 frozen factories on `@object-ui/auth` -- the largest block on the worklist by a factor of three -- now obtain the real module and spread it before their overrides, and the specifier joins `COVERED_SPECIFIERS` in `scripts/check-vi-mock-inherit.mjs` in the same commit, which is the gate's documented widening precondition. STEP 0 first, because inheriting RUNS whatever the barrel does at module scope, in every converted file at once. `packages/auth/src`'s 22-module static import graph was walked and every top-level statement classified before a single conversion: 8 module-scope initialisers, all pure in-memory allocation (two `Set`s of literal strings, an `Object.values` and a `Set` over it, `createContext(null)` plus its `displayName`, an empty listener `Set`, one alias), and zero registrations, timers, globals, `fetch` or side-effect-only imports. Inert -- strictly more so than the two barrels slice 2 absorbed, which each made 8 module-scope `ComponentRegistry.register` calls. Counts re-derived on this tree through the guard's exported `scan()` with `covered` set to all 22 workspace specifiers, never by widening the constant: `@object-ui/auth` 135 judged / 102 frozen -> 0, all-specifier population 311 -> 209 frozen, judged unchanged at 640, with every other row byte-identical between the two runs -- zero sites moving the other way. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FhBNJcLRZLe8M87VcUgpKr
…re measured on The 311 -> 209 pair is the sweep's own before/after on `06761b351`. Merging `origin/main` mid-slice then took the population to 211 over 643 judged, none of it this change: two new frozen sites on `@object-ui/plugin-form` and `@object-ui/plugin-grid` plus one new inheriting `@object-ui/react` site landed from other PRs during verification. Recording which number belongs to which tree keeps the header from reading stale, and gives the growth warning a second observed instance -- this time inside a single slice. 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 on Generated by Claude Code |
baozhoutao
marked this pull request as ready for review
September 6, 2026 13:33
baozhoutao
pushed a commit
that referenced
this pull request
Sep 6, 2026
…notice Keeps this branch on the current main (#8054 landed while this was in flight). Disjoint by file: that change is app-shell/console vi.mock factories plus scripts/check-vi-mock-inherit.mjs; this branch touches only scripts/check-skill-examples.mjs and its pin test. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FhBNJcLRZLe8M87VcUgpKr
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 — slice 3 of the per-specifier
vi.mocksweep worklist:@object-ui/auth, the largest block on it by a factor of three.All 102 frozen factories on
@object-ui/authnow obtain the real module and spread it before their overrides, and the specifier joinsCOVERED_SPECIFIERSinscripts/check-vi-mock-inherit.mjsin the same PR — the gate's documented widening precondition.STEP 0 — what does inheriting actually RUN?
Converting a freeze to inheritance loads the real barrel in every converted file, so a barrel with module-scope side effects has those effects restored in ~100 files at once. That is a measurement to take before converting, not a risk to discover mid-sweep, and slice 2 paid for the warning: both barrels it swept made 8 module-scope
ComponentRegistry.registercalls each.packages/auth/src's barrel is 112 lines of re-exports — but "re-exports only by grep" is not the measurement. The whole static import graph was walked fromindex.tsand every top-level statement classified. 22 modules, and exactly 8 module-scope initialisers, all pure in-memory allocation:useWorkspaceAdminStatus.ts:11ADMIN_ROLES— aSetof six literal stringsinvitation-status.ts:66AUTH_INVITATION_STATUSES—Object.valuesof a literalinvitation-status.ts:70STATUS_LOOKUP— aSetover that arrayAuthContext.ts:195AuthCtx—createContext(null)AuthContext.ts:196AuthCtx.displayName = 'AuthContext'auth-gate-events.ts:29listeners— an emptySetActiveOrganizationStorage.ts:90LEGACY_ACTIVE_ORG_KEY— an alias of another constantActiveOrganizationStorage.ts:109DEVICE_SCOPED_KEYS— aSetof three literalsAnd zero of the things that would have stopped this slice: no registrations, no timers, no globals, no
fetch, no storage access at module scope, and no side-effect-only imports. Two column-anchored greps back the AST walk, both returning no match (grepexit 1): module-scope touches ofwindow/document/globalThis/localStorage/sessionStorage/setTimeout/setInterval/fetch/navigator, and module-scopeIDENT.register(/.init(/.configure(/.addEventListener(calls. The fivelocalStorage/window.locationhits in the package are all indented inside function bodies.⇒ Inert, and strictly more so than what slice 2 absorbed. Proceeding, with one independent confirmation: 33 of the 135 judged
@object-ui/authsites already inherited the real barrel before this PR (27 in app-shell, 6 in console) and are green onmain. The real barrel demonstrably loads in both packages' test environments today; this PR takes that from 33 files to 135.⛔ That verdict does not generalise to the next barrel. Take the measurement.
STEP 1 — the derived table
Re-derived with the fixed classifier through the guard's exported
scan()withcoveredset to all 22 workspace specifiers the tree names. ⛔ The constant in the tree was never widened-and-reverted, so there was no window in which a mutated constant could have been committed. Nothing was inherited from the card's table.@object-ui/authAll-specifier population on the sweep's own base
06761b3: 311 → 209 frozen, judged unchanged at 640, and every other one of the 21 rows byte-identical between the two runs — zero sites moving the other way.The PM's grep upper bound (135 files: 116 app-shell + 19 console) over-counted, as expected: the actual frozen set is 102 sites, 89 under
packages/app-shelland 13 underapps/console.STEP 2 — the conversion
Three shapes, all converted to obtain-and-spread with the spread first:
() =>becomesasync (importOriginal) =>and a spread ofawait importOriginal()(generic argument RECORD-OF-STRING-TO-UNKNOWN) becomes the first property.() => { ...; return { ... } }). The head becomesasync (importOriginal) =>and the spread becomes the first property of thereturnobject, leaving the pre-return locals (a stablegetAuthConfigidentity, a sharedauthFetchdouble) exactly where they were and doing exactly what they did.Verification is per file and does not trust the conversion script's exit code: all 102 files parse clean, the spread is confirmed first in all 102, and the gate's own per-file verdict plus both packages' full suites are the actual evidence.
No site was a deliberate freeze. Nothing in the 102 was written to prove a module is not loaded, so nothing was left converted-blindly or reported as an exception. ⛔ No exemption table, ⛔ no per-site opt-out.
No file died during collection. The failure class this worklist exists for did not fire once: app-shell reports the same 632 files / 6077 tests as before the sweep, console the same 89 / 981.
Residuals — none
packages/auth/src/__tests__/auth-spec-parity.test.ts(held by draft PR chore(deps): resolve @objectstack/spec at 17.3.0 in the lockfile #7685) is not a site — it carries no@object-ui/authfactory, so the exclusion cost nothing.packages/app-shell/src/views/**files named for Burn down the 21 known network escapes: serve each probe from a double and emptyKNOWN_ESCAPESin the network-escape guard #7307 batch 5 carry no@object-ui/authfactory either, and that branch was read over git: it is still an empty branch at8d40c18, 0 commits ahead ofmain.⇒ auth reads 0 frozen on this tree with nothing held back, so the
COVERED_SPECIFIERSline ships in full.Ablation — six legs, three shapes, from the committed tree
One site per converted shape, two legs each. Mutate by reversing the conversion on that one factory; restore with
git checkout HEAD -- ABSOLUTE_PATHunder a trap on EXIT INT TERM.RecordApprovalsPanel.test.tsx:305879cb084,git diff HEADempty, gate exit 0FavoritesProvider.test.tsx:15041e7c1b9,git diff HEADempty, gate exit 0AppHeader.singleMembershipOrg.test.tsx:131300b827c7,git diff HEADempty, gate exit 0The third site is the load-bearing one: that file holds three inheriting factories on different specifiers, and the mutation removed exactly one — proof the reversal was surgical rather than a broad delete. Restore is proven by
git hash-objectequalling the HEAD blob and an emptygit diff HEAD, never by agit checkoutexit code. No dist preflight is needed: the rootvitest.config.mtsaliases@object-ui/authtopackages/auth/src, and the gate is a source-text scanner.Gates — pinned to head
8d7235c19pnpm check:vi-mock-inheritvitest scripts/__tests__/check-vi-mock-inherit.test.tsvitest packages/app-shell/vitest apps/console/pnpm check:vi-mock-specifierspnpm type-check:scriptspnpm check:control-bytesgrep -naPself-scan of all 104 changed paths, no matchnode scripts/check-changeset-presence.mjspnpm changeset:checkmajor)node scripts/check-lint-coverage.mjsnode scripts/check-governed-queue-guard.mjs --test(104 paths)type-check--listFilesnames 89 of 89 edited files in a 4421-file programtype-checklint--format json, 0 errors; intersecting every lint message against the diff's added line numbers gives 0 messages on any line this PR addsbyo-backend-console/console-startertype-checkBoth suites were measured at
71250f56b, the sweep commit.origin/mainthen moved 5 commits and was merged (never rebased); the 102 converted files are byte-identical between that head and8d7235c19, so the suite reading transfers — everything else in the merge is main's own already-landed work. Every gate in the table above was re-run at8d7235c19.Live E2E (informational)is red on every branch today for an upstream reason (#7990) — not this change.One finding worth carrying to slice 4
The merge is a second observed instance of slice 2's growth warning, this time inside a single slice: in the ~40 minutes between deriving the table and opening this PR, other PRs landed two new frozen sites (
@object-ui/plugin-form,@object-ui/plugin-grid) and one new inheriting@object-ui/reactsite. The population reads 211 over 643 judged on the merged head — none of it auth, which stays at 0. Re-derive per slice, on the merge base, every time. The header records which number belongs to which tree.Next by yield:
@object-ui/collaboration(33/33) and@object-ui/plugin-form(31/32).@object-ui/app-shell(24) still reads #6580 first.Generated by Claude Code