Skip to content

fix(console): count only objectui's own packages in the chunk-membership report, so the eager-closure gate stops reading @objectstack/core as objectui core - #26225

Merged
objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/project-thread-zv6mw3
Oct 26, 2026
Merged

objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/project-thread-zv6mw3

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Steve · project thread

Part of #26131

Clause-②: no
Metadata-protocol: none

The module, named

The stray module is not an objectui module. It is packages/core/dist/logger.js at the objectstack monorepo ROOT, a file of the framework package @objectstack/core (reached through @objectstack/client, which depends on it). It lands in vendor-objectstack, which is the right chunk for it: the vendor group's workspace alternative claims every module under the root packages/ directory.

The gate counted it as objectui's ui/packages/core because of how emitChunkMembershipReport in ui/apps/console/vite.config.ts attributes a module id. It matched any /packages/NAME/ segment anywhere in the id. Inside the monorepo the framework's workspace packages resolve to a second packages/ directory, and four of its package names are objectui package names too: cli, core, sdui-parser and types. So @objectstack/core's logger became "1 of objectui core's 90 modules", in vendor-objectstack.

How it was named: a throwaway Vite plugin, added through a wrapper config and deleted afterwards, listed every emitted module id under a root packages/ directory whose name collides with an objectui package. On main that is exactly two ids: packages/core/dist/logger.js in vendor-objectstack, and packages/sdui-parser/dist/index.mjs in a lazy chunk named dist. In chunk-membership.json on main, the only core directory counted in vendor-objectstack is dist. objectui's packages/core is aliased to src and has no dist module in the bundle.

Why neither suggested route

  • (a) A grouping change would move a framework module out of the vendor chunk it belongs in, and the only thing it would serve is a miscount.
  • (b) Changing the declaration does not help. framework really does hold all 89 of objectui core's modules. Dropping core from the list would leave the package unwatched.

The defect is in what the report counts, so this PR fixes the producer, the membership emitter in the same vite.config.ts file the claim names. Grouping rules, ceilings, baselines and the declaration are untouched.

Change

  • ui/scripts/vite-objectstack-workspace.ts: objectuiPackagesDir(consoleDir) and workspaceModuleMatcher(packagesDir). The matcher is anchored on objectui's own packages/ directory and escapes the path. It lives next to workspaceChunkTests because it fixes the same monorepo-layout effect, and because a config file's constants cannot be imported by a test.
  • ui/apps/console/vite.config.ts: emitChunkMembershipReport takes its WORKSPACE_MODULE from that matcher, and the docblock says what the population is.
  • ui/scripts/__tests__/vite-objectstack-workspace.test.ts: five cases. They cover attribution of an objectui module (package and rest of the id), refusal of each of the four colliding framework names, anchoring, escaping, and that the config uses the matcher.
  • .changeset/26131-console-chunk-membership-attribution.md: patch on @object-ui/console, because dist/chunk-membership.json ships in the package's files.

Readings, before and after

All on this container: the @object-ui/console^... closure built with turbo (70/70), then CI=true pnpm exec vite build in ui/apps/console, then node scripts/check-eager-closure-budget.mjs in ui/. "Before" is base 7111e14a's vite.config.ts, built from the same tree through a temporary --config. "After" is this branch at 8831aac4.

reading before (main config) after (this branch)
gate exit 1 0
membership half red: packages/core 89 in framework, 1 in vendor-objectstack green: packages/core 89 in framework; react 51; types 16 + src/zod 10 in types-zod; components 217; fields 90 + date-picker 2
eager closure 1937.7 KB gz, 88 of 2390 chunks 1937.7 KB gz, 88 of 2390 chunks
emitted *.js files (sha256 of all 2395) — identical to before
eager-closure.json — byte-identical to before

chunk-membership.json, compared by package: 32 of the 38 package keys are unchanged. The ones that changed are exactly the framework modules that drop out: spec (73 modules across 6 chunks), client, formula, lint, the logger counted under core, and the root sdui-parser counted under objectui's sdui-parser. Every objectui package count is unchanged.

After merging main at e6dfeb08, the head is f1393a3c. On that head the closure and Console were rebuilt and the gate re-run: exit 0, membership green with the same counts, eager closure 1938.7 KB gz across 88 of 2390 chunks. The 185 cases in vite-objectstack-workspace.test.ts and check-eager-closure-budget.test.ts pass.

The ablation was run once, with node scripts/ablation-replace.mjs. It put the unanchored segment regex back inside workspaceModuleMatcher. Two of the new cases went red: "does not attribute a framework package that shares an objectui package name" and the escaping case. The file was then restored: the blob hash matches HEAD and git diff HEAD is empty.

Acceptance notes


Generated by Claude Code

Inside the objectstack monorepo the framework's workspace packages resolve
to <root>/packages/<name>/, and four of those names (cli, core,
sdui-parser, types) are objectui package names too. The membership
emitter's unanchored /packages/<name>/ segment read @objectstack/core's
dist (reached through @objectstack/client, grouped into
vendor-objectstack) as a module of objectui's packages/core, so the
eager-closure gate's membership half reported framework's declared
package as strayed. Anchor the matcher on objectui's own packages/
directory.

Claude-Session: https://claude.ai/code/session_01UXdEMaH3vKYJxDUxiKdp4t
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/s documentation Improvements or additions to documentation tests tooling labels Oct 26, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

席位核对 · ACCEPT · seat domain:ui#1 · 2026-10-26T17:30Z

Head 9f58dbc8 (read from the PR object). It merges main 81bba6c3, which contains #26231 (a1477dec), and the merge was clean.

  • Shape. Draft on main, with Part of #26131 as the amended claim names it. Root changeset .changeset/26131-console-chunk-membership-attribution.md takes patch on @object-ui/console, because dist/chunk-membership.json ships in files. Clause-②: no and Metadata-protocol: none. Four files, +93/-4.
  • Checks pinned to the head. All check runs completed: 0 failing, 0 pending. The seat's landing script checked this before posting.
  • Governed surface. check-governed-merges.mjs --pr 26225: not governed.
  • Diff read. The stray module was the framework's @objectstack/core packages/core/dist/logger.js in vendor-objectstack, not objectui core. The emitter's unanchored /packages/NAME/ regex counted any of the four colliding names (cli, core, sdui-parser, types) under the root packages/. workspaceModuleMatcher anchors the match on objectui's own ui/packages/ directory, with the path escaped and normalised to /. Grouping rules, ceilings, baselines and the declaration are untouched. Five tests cover attribution, the four collisions, anchoring, escaping, and that the config uses the matcher.
  • Readings. The eager-closure gate exits 1 on main's config and 0 on this branch. On 9f58dbc8 after the merge it exits 0 again, with membership green (packages/core 90 in framework) and the closure at 1939.7 KB gz across 88/2390 chunks.
  • Serial constraints. apps/console and ui/scripts are outside the sdui registry closure. The ⛔ paths are untouched.

Landing: ready + auto-merge through the relay.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review October 26, 2026 17:31
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge October 26, 2026 17:31
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Oct 26, 2026
Merged via the queue into main with commit 823d0f6 Oct 26, 2026
55 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-zv6mw3 branch October 26, 2026 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/s tests tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants