Skip to content

perf(ui): defer project picker search and folder browsing - #184746

Closed
steipete wants to merge 9 commits into
mainfrom
solid2/w-boot-project-picker
Closed

steipete wants to merge 9 commits into
mainfrom
solid2/w-boot-project-picker

Conversation

@steipete

@steipete steipete commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

The New Session project picker keeps its visible trigger, selected project/folder and accepted recents in the draft owner while loading search, navigation and registration state with the picker content. The corrected head prepares recents before opening and passes them through a required readonly prop; the lazy picker filters those recents. Folder-browser state is created only by explicit browser use.

Current pushed head is 2814b31feab9495b6d7d35c8d6870917f0497c82, tree edd86aa0e513d47600e16fc3d0e90a86bf8a0fd3. This is a small New Session step; the wider Chat goal remains open. The earlier 8,903 raw B / 2,407 gzip B New boot reduction and zero Chat raw-byte reduction belong to the historical a997 → 11a comparison and the separate 3e asset comparison below. They are not measurements of this correction.

Evidence

Current published head: 59a4bab7b8f31cbf08d98234759b81f095259568 (tree 727dd605dbb06519b90cc3517833eeebd1055f17), compared with merge base 1365f260beb1994f27ed78cc5b37c14ee2f4b337 on the same machine. The exact-head pnpm ui:build, strict pnpm ui:check-performance --json --base-dist <base>/dist/control-ui, and one pnpm deadcode:knip production scan passed. Strict inventory reports no violations or warnings. Startup JS is 270,995 B gzip / 840,177 B raw, with 5 JS requests and 1 CSS request. New Session boot saves 7,436 raw JS B / 2,308 gzip B; request counts and CSS are unchanged. Chat boot raw JS is unchanged, so this step claims no Chat raw-byte saving.

Fresh coverage, CPU, readiness, and first-open runtime proof for this exact base/head pair remain pending. The sections below retain earlier revisions and historical measurements; they do not establish current-head runtime acceptance or attribution of the earlier Daybreak failure.

Corrected head: source checks passed, runtime proof pending

The eight-file recents correction passed UI types and 41 focused tests: draft-place-browser.test.ts (34), project-chip.catalog.test.tsx (2), and project-chip.registration.browser.test.tsx (5). Its canonical independent P0–P2 review was scoped-clean with no findings. The committed patch and all eight source hashes match the reviewed manifest, and the normal commit hook passed. These are corrected-source checks, not new runtime measurements.

The first typecheck attempt stopped before analysis because the source checkout retained an artifact lock; it was left intact. Types then passed in the independent checkout with the exact correction source. Catalog and registration diagnostics were compared against original 3e: test names, messages and counts match. This is comparison with 3e, not scheduled-main attribution.

The correction restores recents derivation to DraftPlaceBrowser; selected state and the shared catalog keep one synchronous owner. Search, folder browsing, registration authority and request retirement stay with DraftProjectPicker. Its single PlaceBrowserState is allocated on first browser use; reset, disconnect and the eligibility getter do not allocate it. No new effect, async loader, cache, synchronized state or dependency was added. The correction alone is +66/−54 lines; its six production files total 1,476 → 1,480 physical lines and tests/support add eight net lines. The earlier whole-PR LOC table below is historical and has not been recounted for 2814.

Fresh corrected-head production build/strict inventory, production Knip, populated-catalog first-open/search/Escape/reopen proof on local and delayed HTTP profiles, and exact-head CI are pending. No first-open or boot acceptance is claimed for 2814. The current source artifacts are retained under boot-diet-picker-recents-review/ (checks.json, status.json, manifest.json, commit-receipt.json); the corrected first-open protocol is boot-diet-picker-corrected-proof-plan/.

Historical evidence — measured 11a and separately built 3e

All tables, rankings and media below retain their original revisions. In the retained evidence table, “current-head” refers to the historical 3e snapshot. None certifies the corrected 2814 runtime. The measured boot fixture was New Session with no project catalog capability; it did not prove populated-catalog interaction behavior.

Proof Result / scope
Strict performance inventory Base/head pass; startup +34 gzip B, within 64 B variance; no request growth.
Standalone Chromium coverage Four valid captures, one per build/profile; unused drops 5,847 B locally and 11,175 B at 100 ms RTT.
Timing 20 interleaved base/control/head triplets per profile; 120 retained samples total, zero lifecycle/core-contract episodes or warnings.
Local readiness Raw median worsens 10.881%; unchanged A/A worsens 6.025% median / 19.342% p95. No unconditional latency-win claim.
CPU / structure No attributable regression under the noisy-host rule; one long task throughout. RTT readiness holds.
Compile attribution Eight valid traces; mixed compile movement, no stable compile-win claim.
Source rankings Retained measured-head top 30 modules and functions; all 240 cell rows matched to the original same-side source hashes, zero pending review in that capture set.
Tail aggregation All module rows assigned once to disjoint source-path families; sums match every capture exactly.
First-open interaction / CI Pending before landing: populated catalog, first open/search/Escape/reopen on local and delayed HTTP profiles; current-head CI.
Screenshots Inspected synthetic New Session before/after attached below; visible layout is unchanged.
Source checks The retained prior-head source-validation report records passing UI types, 41 focused tests in three files, production Knip and canonical P0–P2 review. Current-head UI types, full Madge cycle check, canonical correction review, production Knip and strict build pass; first-open lexical review pending.

Historical 3e head and retained 11a proof

The historical 3e head is 3e06c2bc6f4521102242d8e7fcd42f0579462549 (tree 6f87ab9993050d7fc106a5a68eae0e2766f6995c), built cleanly as 2026.10.7-3e06c2bc6f45-2026-10-26T15-59-55.707Z. Its retained production build and strict performance check passed with no violations or warnings.

The saved boot coverage, timing and trace measurements remain the original comparison of base a9976dc79a029b68688ff3446ad20118704469fc and measured head 11a3822b9106df4a44444bc4743f0140bb7f1e96; they were not rerun on 3e06c2bc6f45. The complete receipt-based emitted JS/CSS comparison covers all 2,605 recorded paths, including root files, service workers, font/theme CSS and plugin assets: 2,595 are byte-identical by recorded SHA-256 and size, 10 differ, and none were added or removed. All 2,585 paths under assets/ are byte-identical (2,473 JS/MJS and 112 CSS). The 10 differences are 9 font stylesheets of unchanged size and sw.js (28 raw B smaller). The lead inspected all ten changed files: the font stylesheets differ only in exact build-ID query parameters, and the service worker executable is identical. Its generated offline data differs in the matching build-info object, URL/cache identities and verified integrity/CSP hashes. Normalizing exactly those metadata fields makes the data identical. This supported the prior 3e comparison without relabeling captured revisions. The subsequent recents correction changes source and is outside that equivalence comparison. Fresh offline-cache/update behavior was not rerun. Source maps, HTML and non-JS/CSS files are outside this comparison. The comparison reads saved receipt hashes; it does not independently rehash the emitted files.

The retained evidence shows a New Session boot reduction of 8,903 raw B / 2,407 gzip B and zero Chat raw-byte reduction. Local median readiness remains 10.881% slower in the measured run, with noisy A/A at +6.025% median / +19.342% p95; the claim is no attributable CPU/structural regression under the noisy-host rule, not an unconditional latency win. The 100 ms RTT profile holds. First-open proof and its lexical review are tracked separately. Historical 3e production Knip passed, and its font/service-worker inspection is complete.

Historical 3e strict inventory

Surface JS raw B JS gzip B JS requests CSS raw B CSS gzip B CSS requests
Startup 840,027 271,036 5 181,913 31,981 1
Chat 3,967,960 1,238,061 20 749,982 122,373 3
New Session 2,416,281 749,050 17 528,944 87,270 3

Historical whole-PR LOC at 3e

Physical-line counts cover the changed-path union against a9976dc79a029b68688ff3446ad20118704469fc; new files have zero before-lines and deleted files retain their before-lines. They count source text, not executable statements.

Scope Changed files Before After Delta
Production/config 9 2,181 2,256 +75
Tests 10 2,162 2,183 +21
Total 19 4,343 4,439 +96

The production growth separates picker interaction state and lifecycle from the closed-trigger owner. It is not claimed as a source-size reduction. These historical 3e counts replaced the earlier 17-file / +56-line counts; the earlier measurements retain their original identities.

Historical 3e source validation and simplification

The type-only/import-format correction passed UI typechecking, a complete Madge run with zero cycles, formatter, supported focused syntax lint, and a canonical P0–P2 review with no findings. Its final emitted application assets were unchanged; production Knip and the strict build passed at 3e. The retained pre-update source-validation report records passing pnpm tsgo:ui, pnpm deadcode:knip, and three focused test files: draft-place-browser.test.ts (34), project-chip.catalog.test.tsx (2), and project-chip.registration.browser.test.tsx (5). The latter two emitted existing strict-read diagnostics; those diagnostics were not reproduced on the base and are not claimed inherited. The canonical independent P0–P2 review completed with no findings.

The selected project and shared catalog retain one synchronous owner. The existing lazy content acquires one picker interaction owner; there is no new loading/promise abstraction or synchronized state copy. Source simplification found no further cut that preserves this boundary. The retained seven-file lexical census was: effects, render effects, untrack, direct listeners, DOM queries, flush, owner APIs, cleanup and manual imports all 0→0; memos 13→13; onSettled, optimistic state and actions each 1→1. This is a source census, not an AST guard run.

Historical exact builds

The retained “current candidate” row means 3e at the time of that comparison; no 2814 build is represented here.

Role Commit Tree Build ID
base a9976dc79a029b68688ff3446ad20118704469fc 8ccb979dd8cc322566db00b62076bbf6817940b5 2026.10.7-a9976dc79a02-2026-10-26T14-28-54.897Z
measured head 11a3822b9106df4a44444bc4743f0140bb7f1e96 261f9ca666551d3b80727f5bacebde222bfc8df8 2026.10.7-11a3822b9106-2026-10-26T14-30-38.661Z
current candidate 3e06c2bc6f4521102242d8e7fcd42f0579462549 6f87ab9993050d7fc106a5a68eae0e2766f6995c 2026.10.7-3e06c2bc6f45-2026-10-26T15-59-55.707Z

Historical strict build inventories

Surface Base JS raw / gzip / requests Head JS raw / gzip / requests CSS requests base → head
startup 840,027 / 271,002 / 5 840,027 / 271,036 / 5 1 → 1
chat 3,967,960 / 1,238,148 / 20 3,967,960 / 1,238,061 / 20 3 → 3
new 2,425,184 / 751,457 / 17 2,416,281 / 749,050 / 17 3 → 3

Standalone V8 coverage and HTTP ledger

Profile Role V8 loaded / executed / unused raw B HTTP raw / encoded B / JS requests Outside V8 raw / encoded B / requests
local base 2,539,683 / 1,195,010 / 1,344,673 2,556,114 / 705,303 / 33 16,431 / 6,903 / 9
local head 2,530,780 / 1,191,954 / 1,338,826 2,547,211 / 703,079 / 33 16,431 / 6,892 / 9
100ms / 10Mbps base 2,539,683 / 1,191,564 / 1,348,119 2,556,114 / 705,303 / 33 16,431 / 6,903 / 9
100ms / 10Mbps head 2,530,780 / 1,193,836 / 1,336,944 2,547,211 / 703,079 / 33 16,431 / 6,892 / 9

The V8 loaded-byte reduction is 8,903 B in each profile. Unused-byte reduction is 5,847 B (0.435%) locally and 11,175 B (0.829%) at 100 ms. These are New Session results, not the lane’s overall Chat target.

Final timing: 20 interleaved triplets per profile

Both initial and extension protocols passed identity and semantic validation. All120 timing samples are retained:20 base/control/head triplets per network profile. Each profile has zero lifecycle episodes, core-contract episodes, warnings, and pending/queued samples.

The CPU/structural evidence supports no attributable regression under the noisy-host rule. Local wall-clock readiness remains outside the raw median band, with the unchanged A/A control also outside band; it is disclosed below and is not a latency-win claim. Local script/thread p95 increases of0.257%/0.00145% are below the campaign small-p95-noise threshold. RTT readiness and CPU medians/p95 hold or improve. No further timing repeats are recommended.

Profile Metric Base med/p95 Control med/p95 Head med/p95 A/A Δ med/p95 Head/base Δ med/p95
local shellMs 508.700 / 1102.800 539.350 / 1316.100 564.000 / 1089.100 +6.025% / +19.342% +10.871% / -1.242%
local composerMs 508.700 / 1102.800 539.350 / 1316.100 564.050 / 1089.100 +6.025% / +19.342% +10.881% / -1.242%
local scriptCpuMs 393.630 / 414.162 384.442 / 425.880 388.293 / 415.225 -2.334% / +2.829% -1.356% / +0.257%
local taskCpuMs 723.931 / 747.003 711.048 / 760.197 711.563 / 745.417 -1.780% / +1.766% -1.708% / -0.212%
local threadCpuMs 735.004 / 757.714 722.235 / 771.973 722.226 / 757.725 -1.737% / +1.882% -1.738% / +0.001%
local longTaskCount 1.000 / 1.000 1.000 / 1.000 1.000 / 1.000 +0.000% / +0.000% +0.000% / +0.000%
local longTaskMs 87.000 / 92.000 86.500 / 91.000 86.000 / 92.000 -0.575% / -1.087% -1.149% / +0.000%
rtt shellMs 1019.600 / 1106.000 1023.150 / 1039.300 1019.000 / 1028.300 +0.348% / -6.031% -0.059% / -7.025%
rtt composerMs 1019.750 / 1106.000 1023.150 / 1039.300 1019.000 / 1028.300 +0.333% / -6.031% -0.074% / -7.025%
rtt scriptCpuMs 289.666 / 409.214 286.149 / 309.615 278.065 / 307.609 -1.214% / -24.339% -4.005% / -24.829%
rtt taskCpuMs 602.509 / 742.730 602.851 / 639.840 595.959 / 629.974 +0.057% / -13.853% -1.087% / -15.181%
rtt threadCpuMs 620.732 / 766.148 620.077 / 659.612 611.921 / 649.250 -0.106% / -13.905% -1.419% / -15.258%
rtt longTaskCount 1.000 / 1.000 1.000 / 1.000 1.000 / 1.000 +0.000% / +0.000% +0.000% / +0.000%
rtt longTaskMs 95.000 / 108.000 98.500 / 105.000 98.000 / 102.000 +3.684% / -2.778% +3.158% / -5.556%

Every adverse cell above5%

  • local: aa / shellMs / median: +6.025% (+30.650 ms).
  • local: aa / shellMs / p95: +19.342% (+213.300 ms).
  • local: aa / composerMs / median: +6.025% (+30.650 ms).
  • local: aa / composerMs / p95: +19.342% (+213.300 ms).
  • local: headVsBase / shellMs / median: +10.871% (+55.300 ms).
  • local: headVsBase / composerMs / median: +10.881% (+55.350 ms).
  • local: headVsPooledBases / shellMs / median: +8.201% (+42.750 ms).
  • local: headVsPooledBases / composerMs / median: +8.211% (+42.800 ms).
  • rtt: none above5%.

Local head/control script median is+1.002%, task+0.072%, thread−0.001%; all head/control CPU p95 improve. Local long-task duration p95 is+1.099% versus control (92 versus91ms) and unchanged versus base; count stays exactly1. RTT long-task duration median is+3.158% versus base (98 versus95ms), within band, and p95 improves5.556%.

Host-load ranges: local23.398–50.188; RTT23.640–52.674. Full reports retain all min/max values, A/A/head/base/control/pooled comparisons, pairwise deltas and artifact identities. Trace attribution and fresh same-side top30 are included below.

Compile and GC attribution

The original eight successful trace captures were assessed using the exact compiled canonical helper after the original source import failed on an unavailable workspace dependency. The compiled-helper adaptation preserves all original validations and arithmetic; source and compiled hashes were verified and independently reviewed. No trace was rerun. The report links both real timing protocols plus standalone coverage through the existing capture assessment.

Two base/head pairs per profile provide descriptive attribution, not a latency or compiler speedup distribution. CPU is unioned per renderer thread; background work remains counted. All compile events have thread CPU stamps. GC events missing stamps are excluded from CPU sums and listed below.

Profile Pair Role Main compile CPU ms Background compile CPU ms Pre-composer main/background compile CPU ms Main/background GC CPU ms GC missing stamps Mapped/unmapped frames
0 ms 1 base 2.718 33.340 2.528 / 30.849 8.528 / 61.620 72 4976 / 236
0 ms 1 head 2.614 32.573 2.421 / 30.320 9.089 / 61.170 58 4981 / 181
0 ms 2 base 2.652 33.730 2.472 / 31.178 10.614 / 63.316 52 4842 / 232
0 ms 2 head 2.698 33.489 2.519 / 31.099 9.644 / 64.093 68 4994 / 250
100 ms 1 base 2.690 58.685 2.492 / 55.419 8.244 / 73.965 96 4426 / 199
100 ms 1 head 2.791 60.982 2.574 / 57.808 11.557 / 72.648 90 4750 / 201
100 ms 2 base 2.781 62.793 2.562 / 59.423 8.204 / 73.587 81 4853 / 177
100 ms 2 head 2.604 51.847 2.393 / 48.792 7.470 / 71.621 84 4610 / 199

All8 traces record one long task. Main compiler CPU moves in both directions; no stable compiler win is claimed. Canonical compilation totals are retained verbatim in the JSON. Sampled CPU time is elapsed/descheduled sample-associated time, not thread CPU. Full-window untraced threadTicks metrics remain the timing-acceptance evidence.

Retained original failure: trace capture succeeded; the original assessor then failed ERR_MODULE_NOT_FOUND for @openclaw/normalization-core from the old source checkout. Repair package: boot-diet-a997-picker-trace-assessment-compiled-v1; new result: trace-fixture-extended20/trace-cpu-compiled.json.

Scope, rejected setup and tool recovery

The fixture advertises no project catalog capability, so the owner reaches its empty ready catalog without projects.list. A separate attempted core-profile cohort failed setup on unhandled projects.list, completed zero samples, and is retained as failed setup. It is not relabeled as this fixture cohort. These synthetic boot samples do not prove real Gateway/provider latency, populated catalogs, remote search, or first-open picker latency.

Initial timing had noisy local A/A (+12% median / +47% p95) and adverse CPU tails, so a linked extension was run. All initial and extension samples are retained; no exclusions. The final local head/base median readiness remains outside the raw band and is explicitly disclosed. Local CPU head/control medians are +1.002% script, +0.072% task, −0.001% thread; CPU p95 values improve. The accepted conclusion is CPU/structural no attributable regression under noisy-host rules, not unconditional wall-time equivalence.

Coverage's reported executed bytes mean V8-covered byte ranges; they are not instruction counts or parse/compile CPU. Unused coverage does not establish that every byte can be removed, nor that every loaded literal is semantically accessed. HTTP encoded bytes are transport encoding, not the strict inventory's gzip measure. The 16,431 raw B in HTTP resources outside V8 coverage are reported separately and are not called definitely unexecuted or compiled. Coverage readiness is instrumented and excluded from timing acceptance. The coverage horizon excludes an idle-prewarm contract.

The original trace assessor failed after all eight captures succeeded because its old source checkout could not resolve @openclaw/normalization-core. A reviewed adapter imported the exact compiled canonical helper and extracted the same pure clip helper without running the full benchmark; no traces were repeated, no frozen worktree was modified or installed. Source/compiled hashes and original failure remain in boot-diet-a997-picker-trace-assessment-compiled-v1.

The ranking-command generator initially expected a nonexistent result.bundleSource; a reviewed one-line repair used the canonical top-level summary.bundleDir. Existing extraction was reused, then all four rankers completed successfully. Original outputs remain immutable. Full manifests, hashes and per-cell approval are in the evidence artifacts.

Reading the tail

The local-base top30 modules account for 218,015 of 1,344,673 unused raw B (16.213%). The largest disjoint unused families are other UI components (226,891 B), shell/app (182,207 B), Chat (149,761 B), New Session (145,657 B), other UI libraries (110,271 B), and session libraries (97,065 B). These are directions for restructuring, not projected savings. No duplicate mapped source modules across loaded chunks were found in these captures; unmapped generated/runtime bytes remain a separate bucket. This New-route map must not be relabeled as Chat coverage.

Retained artifact index

Artifacts are retained locally under boot-diet-a997-picker-new-fixture-proof/ and boot-diet-a997-picker-new-rankings/; publishing/upload links are owned by the PR lane. Full hashes are recorded in artifact-manifest.json.

Evidence Relative artifact SHA-256 prefix
Coverage protocol boot-diet-a997-picker-new-fixture-proof/coverage-fixture/protocol.json 50a439609e0698b8
Initial timing protocol boot-diet-a997-picker-new-fixture-proof/timing-fixture/protocol.json ffa060ef65340b32
Extension timing protocol boot-diet-a997-picker-new-fixture-proof/timing-fixture-extension/protocol.json de90b7558f2c5a78
Trace protocol boot-diet-a997-picker-new-fixture-proof/trace-fixture-extended20/protocol.json ba4988766e825d8b
Trace CPU assessment boot-diet-a997-picker-new-fixture-proof/trace-fixture-extended20/trace-cpu-compiled.json 3c5f5d257b2e91bf
Same-side ranking review boot-diet-a997-picker-new-rankings/same-side-review-receipt.json c5d4dc54163790c6
Disjoint family totals boot-diet-a997-picker-new-rankings/disjoint-family-totals.json 3aec677e6ce882eb
Top 30 module/function rankings and reviewed interaction boundaries

Retained measured-head top 30 unused modules and functions

These retained rankings belong to the a9976dc79a02 / 11a3822b9106 synthetic New Session fixture, not Chat. All four cells share the same top-30 identities. Values below are unused UTF-8 raw bytes, in base-local order. Functions exclusively own bytes after nested-function attribution; do not add function totals to module totals. Generated initializer/JSX closures retain explicit labels. Qualitative frequency comes from source/caller review, not telemetry.

Every one of the 240 displayed cell rows is approved against that cell’s emitted source SHA-256 and exact function declaration where applicable. Seed “known on either side” is insufficient; this assembly verifies the same side. Original seed/rankings are immutable.

Modules

# Source Local base Local head RTT base RTT head Follow-up frequency and trigger
1 ui/src/pages/new-session/draft-submission-flow.ts 9,545 9,545 9,545 9,545 Common: Editing the New composer and submitting its first turn use setMessage, submitBlock, captureSubmission, sessions.createResult and the accepted-turn handoff. The idle /new capture does not exercise this normal first interaction. Reconnect resumption, rejected prompts, background creation, incognito, native-terminal starts and remote placement are conditional branches.
2 ui/src/pages/new-session/draft-place-state.ts 8,950 9,043 8,950 9,043 Common: New-session setup adopts the selected agent, workspace and saved place defaults and supplies the create request. Choosing another folder or agent is an ordinary New follow-up. Project/worktree detail, remote/cloud/device placement, required worker policy and native-terminal host selection are conditional on selected capabilities and actions.
3 ui/src/app/app-shell-chrome.ts 8,775 8,775 8,775 8,775 Common follow-up / lifecycle: Common: Shell listeners, navigation, menus, drag and resize; initial chrome is already active.
4 ui/src/app/app-root.tsx 8,563 8,563 8,563 8,563 Common and rare branches: Common: connection lifecycle and navigation. Rare: login, confirmation and exceptional route branches when their state becomes active.
5 @solidjs/signals/dist/prod/store/store.js 8,150 8,150 8,289 8,111 Common follow-up / lifecycle: Common: Reactive store updates and additional value shapes; shared framework runtime is already used.
6 packages/gateway-client/src/session-projection.ts 7,898 7,898 7,898 7,898 Common follow-up / lifecycle: Common: Initial and later session/message projection, live deltas, final state and reconnect reconciliation.
7 ui/src/api/gateway.ts 7,830 7,830 7,830 7,830 Common follow-up / lifecycle: The active connection already uses this owner. Subsequent RPCs, reconnect and transport faults use additional branches.
8 ui/src/lib/protocol-validators.generated/activity.js 7,822 7,822 7,822 7,822 Common follow-up / lifecycle: Common: Chat/tool activity, restored activity, sidebar narration, observer digests and reactions; not only another page.
9 ui/src/components/session-organizer.ts 7,808 7,808 7,808 7,808 Common follow-up / lifecycle: Common: Sidebar drag/drop and menu actions; operation bodies already have a separate runtime.
10 ui/src/pages/chat/history-merge.ts 7,723 7,723 7,723 7,723 Common: Entering the created chat, sending a normal follow-up and receiving persisted messages use the pane projection and pending-input receipt merge. Snapshot restoration, steering, run reset/compaction and retained pairing QR media add conditional reconciliation branches.
11 ui/src/pages/new-session/draft-gateway-state.ts 7,547 7,547 7,547 7,547 Common: The New draft binds Gateway identity, connection state, recovery scope and preferences and refreshes its visible metadata. Most remaining code serves conditional reconnect/authority changes, required or offered cloud placement, missing catalog routes and explicit retry/adopt-profile actions.
12 ui/src/components/select-picker-view.tsx 7,535 7,535 7,535 7,535 Common follow-up / lifecycle: Common: Select control labels initially; opening/searching/typeahead/grouped options and submenu/sheet variants on interaction.
13 ui/src/pages/chat/components/chat-composer-controls.tsx 7,532 7,532 7,532 7,532 Common: Composer typing changes send availability and a normal send uses the primary action. A running turn exposes Stop and may expose queue/steer actions. Microphone selection, dictation, realtime voice/camera and mobile-only arrangements are conditional on capability, platform and user action.
14 ui/src/lib/sessions/session-reconciliation.ts 7,373 7,373 7,373 7,373 Common: Normal session creation, live run/message events and later session reads reconcile the visible roster and its consumers. Archive/delete, permission changes, GitHub publication, thinking claims and ancestor/managed-list updates exercise additional event-specific branches.
15 @solidjs/web/dist/web.js 7,212 7,212 7,212 6,940 Common and rare branches: Common: subsequent Solid DOM updates, events and overlays. Rare/specialized: hydration, head-resource and response helpers; unused framework bytes are a mixture.
16 @openclaw/uirouter/dist/index.js 7,034 7,034 7,034 7,034 Common follow-up / lifecycle: Common route navigation, preload and revalidation; also cancellation/error/redirect and stop paths. Initial route loading already uses this owner. Unused branches are conditional navigation lifecycle, not a wholly dormant router.
17 ui/src/pages/chat/composer-dictation.ts 6,993 6,993 6,993 6,993 Rare / feature-specific: Optional microphone hold/tap interaction. The owner is constructed at composer mount; recording, pointer cancellation, transcript commit and recovery branches run after dictation. Keep synchronous gesture/audio admission; the recording session is already dynamically imported.
18 ui/src/lib/chat/outbox-store.ts 6,759 6,759 6,759 6,759 Common: Normal send admission and retained-message display compute the account/Gateway/session scope and delivery key here; queue persistence reads and writes the same store. Large remaining branches concern stored queued input, legacy migration, conflict recovery, incognito retirement, quota limits and cross-tab storage changes.
19 @solidjs/signals/dist/prod/store/optimistic.js 6,734 6,734 6,734 6,734 Common and rare branches: Common where an optimistic store mutation occurs. The initializer also installs shared hooks; unused mutation branches do not make the whole framework module optional.
20 ui/src/components/sidebar-menus.tsx 6,704 6,704 6,704 6,704 Conditional: Opening or hovering agent, session/group, catalog, filter, sort, identity or rail menus runs the menu bodies and focus/position logic. The owner and its renderRoute navigation helper also participate in normal sidebar setup; ordinary typing/sending does not require opening these menus.
21 ui/src/pages/new-session/draft-persistence.ts 6,584 6,584 6,584 6,584 Common: Editing a normal New draft schedules a durable write; route activation attempts restoration; successful submission retires the captured draft and teardown flushes pending edits. Existing saved drafts, concurrent revisions, incognito transitions, attachments and handoff recovery add state-dependent branches.
22 ui/src/components/lobster-pet-owner.ts 6,487 6,691 6,487 6,465 Optional: The decorative pet responds to enabled visits/residency, scheduled arrivals, offline/busy/idle changes and pet pointer/menu interactions. Ordinary conversation input does not require the pet. Enabled settings can nevertheless start its state updates and visit timers before any pet interaction.
23 ui/src/pages/chat/session-snapshot-store.ts 6,471 6,471 6,471 6,471 Common: Normal chat/sidebar state can be saved for subsequent navigation or reload, and hide/disconnect flushes active stores. Reading an existing saved transcript/sidebar, prewarming, stale-scope invalidation and eviction are conditional on retained state and navigation; an empty /new session does not exercise most transcript I/O.
24 ui/src/lib/chat/composer-draft-store.runtime.ts 6,419 6,419 6,419 6,419 Common: Normal non-incognito New/chat editing persists and retires drafts through this durable store, and route entry checks for a saved draft. Legacy recovery selection, cross-tab revision conflicts, attachment size fallback, expiration and batch retirement are conditional branches.
25 ui/src/components/solid/session-presentation.tsx 6,393 6,372 6,375 6,209 Common: Visible sidebar/session rows use leading identity, title-adjacent status and run/unread updates as normal messages change sessions. Attention/question/error badges, child/team counts, owner/participant stacks, channel avatars and repository/placement badges depend on row facts and may appear immediately for restored or populated lists.
26 ui/src/lib/sessions/session-list-query.ts 6,261 6,261 6,261 6,261 Common: Initial and later roster reads, session events and refreshed list publication use query identity, refresh coalescing and snapshot-admission checks. Owner-count/filter/sort variants, pagination, concurrent read/event overlap and non-primary lists select additional branches.
27 ui/src/lib/sessions/session-row-reconcile.ts 6,253 6,253 6,447 6,253 Common: Normal session reads and live run/message events normalize and reconcile rows, preserve valid presentation metadata and reject older/out-of-scope facts. Delete/archive, ancestor certificates, explicit clears, ownership changes and selected-global-agent edge cases are event/state-conditional.
28 ui/src/app/app-shell-view.tsx 6,250 6,250 6,250 6,250 Common: Every normal page remains inside ApplicationShell; navigation, the router outlet, Gateway status and shell projection update during later interactions. Mobile/native chrome, drawer/resize, terminal/docks, approvals, device pairing, memory import, settings and workspace plugin overrides are conditional branches, some legitimately present on the first screen.
29 ui/src/app/question-prompt.ts 6,224 6,224 6,224 6,224 Conditional: A pending/requested asynchronous question activates prompt storage, expiry, answers, cancellation and resolution recovery. Eligible connection owners may bind and call question.list even with no current prompt, so that bootstrap work is common once the capability is enabled; ordinary text follow-up without a question does not run the answer/resolve bodies.
30 ui/src/lib/chat/chat-metadata-store.ts 6,186 6,186 6,186 6,186 Common: Entering or continuing a presented chat binds command metadata and model-catalog publication and shares requests across consumers. Revalidation after invalidation, startup metadata fallback, queued competing demand, database-startup retries and scope release run only under the corresponding lifecycle condition; opening model/library features can also trigger refresh.

Candidate boundaries (design notes, no savings claim)

  1. draft-submission-flow.ts: Keep synchronous draft ownership, submit availability, captured input and accepted-turn handoff together. Placement/terminal/recovery bodies have explicit triggers, but the whole owner is not optional and its unused-byte total cannot be described as rare-action bytes.
  2. draft-place-state.ts: Preserve the initial selected place and create-parameter state with the draft owner. Repository browsing and worktree/cloud/device actions can be evaluated at their concrete selection boundary; do not classify the entire place owner as an unused optional picker.
  3. app-shell-chrome.ts: Keep shell navigation and synchronous pointer/keyboard admission; defer individual menu or auxiliary drag/resize implementation after the event owner captures intent.
  4. app-root.tsx: Keep root/context/connection and active route. Login, confirmations and optional route content retain their state-based lazy boundaries.
  5. store.js: Framework store semantics already serve first-screen projections; remove unused imports/build exports at the package boundary rather than deferring active store behavior.
  6. session-projection.ts: Keep live/history projection and reconciliation at the synchronous owner. Separate unused event/protocol families at decode entry points rather than delaying publication.
  7. gateway.ts: Keep connection/RPC authority and ordered events synchronous. A missing export is not a deferred transport body.
  8. activity.js: Decode the arriving activity variant before owner publication; split protocol families only where imports currently pull variants no active consumer needs.
  9. session-organizer.ts: Keep synchronous drag/drop target and command admission; operation bodies already load through the organizer runtime after intent is captured.
  10. history-merge.ts: Keep the per-pane projection and submission/receipt custody at the message boundary. Conditional media or recovery handling can be isolated only while preserving one transcript owner; deferring the entire module would defer ordinary send and incoming-message display.
  11. draft-gateway-state.ts: Retain live Gateway identity and preference binding before accepting a draft action. Cloud catalog discovery and catalog-route recovery have explicit capability/state triggers; their presence in this common owner does not make every unexecuted branch normal first-send work.
  12. select-picker-view.tsx: Keep trigger labeling, keyboard intent and selection owner. Options/virtualized content can mount when open after parallel preload; a saved/open control is conditional first-screen work.
  13. chat-composer-controls.tsx: Keep the visible primary action and its current send/stop state available with the composer. Voice/device-menu/camera rendering has separate capability/action gates; the already-lazy microphone menu is not evidence that the whole controls module is optional.
  14. session-reconciliation.ts: Keep one authoritative row/event reconciliation owner for the common session flow. Operation-specific projections may have narrower activation, but removing or deferring the whole module would stale the roster after ordinary messages.
  15. web.js: Retain the shared render/insert/event runtime needed by the first screen. Optional framework exports must be eliminated by an upstream tree-shakeable entry or a supported narrower runtime; do not defer the entire module or treat all 7,000 unused mapped bytes as one removable feature.
  16. index.js: Keep initial route resolution/admission and parallel preload; additional route content stays behind navigation, with cancellation/error ownership retained.
  17. composer-dictation.ts: Keep synchronous trusted gesture/audio admission; the recording session already loads dynamically. Any further split must retain cancellation and release before the import resolves.
  18. outbox-store.ts: Keep scope/admission helpers usable before sending and preserve the queue store owner. Legacy migration and recovery are state-conditional candidates for a narrower boundary, but a module-wide rare-action label would incorrectly include normal send identity work.
  19. optimistic.js: Keep framework hooks intact. Gate consuming optional panels/actions at their feature boundary; an upstream narrower runtime entry would need separate correctness proof, not an application-level delayed hook install.
  20. sidebar-menus.tsx: Keep mounted navigation links and stable menu triggers/ownership in the sidebar. Menu presentation is already lazy behind an open action; further separation should target action-specific menu work without moving or duplicating the common route-link and focus owner.
  21. draft-persistence.ts: Keep draft custody, mutation generation and accepted-submission retirement with the New composer. Durable I/O is already obtained through a lazy store import; restored/conflicting-state bodies may be separated only without allowing a late read/write to replace or resurrect current input.
  22. lobster-pet-owner.ts: The pet feature boundary owns its scheduling, geometry, traffic and interactions together. It can be absent when that feature is disabled, but do not infer that loaded-but-idle pet bytes never execute later in an enabled session.
  23. session-snapshot-store.ts: Keep current snapshot ownership and teardown flush semantics. Cached restoration/prefetch and serialization are distinct state-triggered work, but the owner serves ordinary continuing use and is not solely an optional recovery panel.
  24. composer-draft-store.runtime.ts: Keep the durable draft compare-and-set/retirement contract at the storage owner. Its runtime is already lazy from composer persistence; recovery enumeration and bulk operations have narrower state/action triggers than the ordinary read/write entry points.
  25. session-presentation.tsx: Keep visible row identity and current status presentation with the row. Richer state-specific badges can have narrower rendering boundaries, but must remain available on the first frame that contains those facts; unused bytes in an empty list do not establish rare UI.
  26. session-list-query.ts: Keep query identity and membership validation with session-list ownership. Specialized list modes may be isolated by callers, but common live events need these guards to choose between local snapshot application and a fresh list read.
  27. session-row-reconcile.ts: Keep shared row identity, stale-event handling and metadata preservation at the row reconciliation boundary. Event-specific shapes can be split only if all callers continue using the same admission rules; whole-module deferral would affect ordinary live roster updates.
  28. app-shell-view.tsx: Retain the shell, route outlet and active navigation/status presentation. Existing lazy/requested-component boundaries separate terminal, approvals and other panels; unused branch bodies do not justify postponing the entire application shell.
  29. question-prompt.ts: Keep question event subscription, current-client ownership and expiry valid whenever questions can arrive or be restored. The answer/secret-submission/resolve body belongs to the question interaction boundary; do not defer recovery merely until a user opens an already-pending prompt.
  30. chat-metadata-store.ts: Keep one scope-keyed metadata publication/request owner and the separate model-catalog owner. Demand or startup can choose which reads are needed, but whole-module deferral would affect ordinary chat initialization and refreshed command/model availability.

fixture-0-base-draft: top 30 modules cover 218,015 unused B (16.213% of 1,344,673 unused B).
fixture-0-head-draft: top 30 modules cover 218,291 unused B (16.305% of 1,338,826 unused B).
fixture-100-base-draft: top 30 modules cover 218,330 unused B (16.195% of 1,348,119 unused B).
fixture-100-head-draft: top 30 modules cover 217,591 unused B (16.275% of 1,336,944 unused B).

Functions

# Source / function Local base Local head RTT base RTT head Follow-up frequency and trigger
1 ui/src/pages/new-session/draft-submission-flow.ts :: submit 5,405 5,405 5,405 5,405 First Send or background Send invokes submit; startup resumption can re-enter it. Remote project creation, placement, worktree, attachment and terminal branches depend on the selected target.
2 ui/src/lib/session-pull-requests.ts :: sessionPullRequestsForGateway 5,163 5,163 5,163 5,163 Session/PR viewers and sidebar receipt indicators create this Gateway-scoped store; subscribe, refresh, reconnect and watch-list branches run when PR metadata is actually watched. Blank New Session has no watched conversation.
3 ui/src/pages/chat/components/chat-composer-controls.tsx :: renderChatPrimaryActionsSolid 5,098 5,098 5,098 5,098 Chat composer mounts send/queue/abort controls after navigating from New Session to a conversation. Voice, video, microphone picker and alternate follow-up controls are conditional branches.
4 ui/src/lib/sessions/session-placement-startup.ts :: startSessionPlacementInitialTurn 4,076 4,077 4,076 4,077 A first message routed to a worker uses placement-submit, which invokes placement startup; reconciliation, retry, cancellation and reclaim branches need a pending or interrupted placement.
5 ui/src/lib/sessions/session-list-query.ts :: canApplySessionListSnapshot 4,037 4,037 4,037 4,037 Common follow-up / lifecycle: Common: Live roster reconciliation; query filters, ancestry and clocks select unused branches before substituting snapshots for reads.
6 ui/src/lib/chat/outbox-store-codec.ts :: normalizeStoredQueueItem 3,494 3,494 3,494 3,494 Rare / feature-specific: Restore a saved outgoing message from durable storage after restart/reconnect; empty storage skips normalization.
7 ui/src/pages/new-session/submit-gates.ts :: resolveNewSessionSubmitBlock 3,367 3,367 3,367 3,367 Draft readiness and first-send admission call this gate resolver. Restoring preferences, model setup, attachments, disconnected access, terminal target and uncertain placement activate distinct reasons.
8 ui/src/components/modal-dialog.tsx :: createModalPolicy 3,263 3,263 3,263 3,263 Common follow-up / lifecycle: Common: Dialog mount/open/dismiss and return-focus lifecycle.
9 ui/src/plugins/control-ui-view.solid.tsx :: PluginViewContent 3,131 3,131 3,131 3,131 Rare / feature-specific: Activate an installed plugin page/panel/widget or transcript/composer replacement; a configured replacement can already be on the first screen.
10 micromark-core-commonmark/lib/html-flow.js :: tokenizeHtmlFlow 2,950 2,950 2,950 2,950 Inactive in this scanner: Inactive grammar in this captured UI: the bundled Markdown code-region scanner explicitly disables htmlFlow/htmlText. No ordinary follow-up uses those constructs through that scanner.
11 packages/gateway-protocol/src/server-capabilities.ts :: GATEWAY_SERVER_CAPS 2,884 2,884 2,884 2,884 This row is the emitted initializer wrapper for GATEWAY_SERVER_CAPS, not a handwritten function. It initializes stable capability-name data for capability-dependent consumers such as board/chat-board and custodian setup.
12 ui/src/pages/chat/components/chat-attachment-reads.ts :: readChatAttachmentFile 2,772 2,772 2,772 2,772 Common follow-up / lifecycle: Common optional attachment select/paste/drop. Entry immediately reserves/adopts/cancels read slots and exposes compression intent; FileReader/media transformation and payload preparation run in the lazy read runtime.
13 ui/src/components/session-lineage.ts :: load 2,622 2,622 2,622 2,622 Selecting a conversation loads its lineage. New Session has no active authoritative conversation; retries, descriptor lookup and reconciliation are conditional on current session/Gateway state.
14 ui/src/lib/sessions/session-reconciliation.ts :: reconcileChangedEvent 2,608 2,608 2,608 2,608 Common follow-up / lifecycle: Common live follow-up: sessions.changed events after boot, including current conversation updates. Keeps generation, mutation and deletion reconciliation in the canonical session owner; not an optional settings feature.
15 micromark/lib/create-tokenizer.js :: createTokenizer 2,498 2,498 2,498 2,498 Common follow-up / lifecycle: Parse code-bearing Markdown for canonical cleanup/directives, either in saved history or the next reply; plain fixture text misses these lexical branches.
16 ui/src/app/server-prefs-profile-runtime.ts :: writeProfileAppearancePrefs 2,481 2,481 2,481 2,481 Rare / feature-specific: Explicitly change theme, font, accent, background or another appearance/navigation preference; initial preference reads do not execute this mutation.
17 micromark-core-commonmark/lib/html-text.js :: tokenizeHtmlText 2,441 2,441 2,441 2,441 Inactive in this scanner: Inactive grammar in this captured UI: the bundled Markdown code-region scanner explicitly disables htmlFlow/htmlText. No ordinary follow-up uses those constructs through that scanner.
18 ui/src/components/lobster-pet-scene-view.tsx :: Sprite 2,429 2,429 2,429 2,429 The enabled lobster visitor renders Sprite only when the pet owner publishes a scene. Twins, hats, shiny/anniversary styling and travel effects depend on scene state; this fixture has no sprite at boot.
19 ui/src/lib/sessions/session-row-reconcile.ts :: reconcileParsedSessionChangedRow 2,370 2,370 2,370 2,370 Common follow-up / lifecycle: Common authoritative live/session-describe/list reconciliation. Retains event scope, ancestor revision, deletion, omitted-field and owner-change semantics; a reference/full-row path depends on incoming events and can also run during initial reads. Not an interaction-only function.
20 ui/src/components/session-data-catalog.ts :: loadMoreSessionCatalog 2,366 2,366 2,366 2,366 Common follow-up / lifecycle: Common catalog pagination plus conditional background discovery of pages hidden by filters. May run during startup for catalog state requiring hidden-page discovery; not exclusively a Load more click.
21 packages/markdown-core/src/reasoning-tag-syntax.ts :: reduceReasoningText 2,322 2,322 2,322 2,322 Batch and streaming reasoning-tag consumers invoke the reducer for message text. Private/visible tags, unclosed recovery and code-span handling depend on message content; an empty New Session does not parse such text.
22 micromark-extension-gfm-table/lib/syntax.js :: tokenizeTable 2,319 2,319 2,319 2,319 GFM table parsing invokes this tokenizer when text is tested as a table head/body. Table-specific states need table-shaped content, absent from the empty New Session fixture.
23 ui/src/pages/new-session/draft-preference-state.ts :: preparePreferenceWrite 2,276 2,276 2,276 2,276 Changing draft preferences persists the selected agent/workspace options. Submitted worktree preference cleanup also uses this preparation path; profile writes, conflicts and reconnect checks are conditional.
24 ui/src/components/command-palette-input.tsx :: CommandPaletteInput 2,267 2,267 2,267 2,267 Opening the command palette mounts this textarea in the immediate loading view and the loaded palette. Layout, composition, scroll and selection branches run during palette use, absent during closed boot.
25 ui/src/components/textarea-token-anchor.ts :: bindTextarea 2,233 2,233 2,233 2,233 The emoji completion owner calls bindTextarea when opening its token-anchored overlay. Mirror layout, scrolling, viewport resize and cleanup run while that overlay is open.
26 ui/src/pages/new-session/connect-machine-dialog-view.tsx :: get children 2,207 2,207 2,207 2,207 The emitted JSX closure under Show runs when an administrator selects Connect machine, starting setup. It renders generated commands, expiry, refresh and device-management actions.
27 ui/src/app/app-shell-gateway.ts :: handleGatewayEvent 2,197 2,197 2,197 2,197 Gateway events enter this handler throughout the session. Sessions/config/preferences/model changes and UI commands activate their own branches; empty boot does not trigger every event.
28 ui/src/pages/chat/components/chat-composer-slash-menu.tsx :: SlashMenu 2,150 2,150 2,150 2,150 Typing slash command text opens the command/argument menu. Grouping, selection and argument branches depend on matching commands; its option views are already lazy.
29 src/auto-reply/reply/directive-handling.parse.ts :: parseInlineSessionDirectives 2,143 2,143 2,143 2,143 Browser command admission calls isModelIndependentDirectiveCommand, which invokes this parser for recognized directive commands. Ordinary draft typing/empty New Session does not parse directives.
30 ui/src/app/native-gateway-auth.ts :: createNativeGatewayConnectAuth 2,138 2,138 2,138 2,138 Native-embedded startup uses this adapter for native challenge signing; ordinary web startup does not. Message-port handshake, signing, cancellation and timeout branches require the native bridge.

Candidate boundaries (design notes, no savings claim)

  1. draft-submission-flow.ts :: submit: Keep synchronous admission and draft custody ready; split transport/placement preparation only after capturing the immutable submitted input and cancellation authority.
  2. session-pull-requests.ts :: sessionPullRequestsForGateway: Lazy-load PR metadata presentation/store together at first consumer; preserve one store per Gateway and event/reconnect ownership.
  3. chat-composer-controls.tsx :: renderChatPrimaryActionsSolid: Keep the basic send control synchronous; isolate optional voice/microphone controls behind their visible branch.
  4. session-placement-startup.ts :: startSessionPlacementInitialTurn: Defer placement implementation at the explicit placement submission boundary, retaining request identity and cancellation ownership across import.
  5. session-list-query.ts :: canApplySessionListSnapshot: Called from live event reconciliation before choosing to skip a list read. Split at event-family decoding, not after returning an unchecked decision.
  6. outbox-store-codec.ts :: normalizeStoredQueueItem: Load codec at stored-record read boundary before exposing a restored row; do not publish unchecked stored data.
  7. submit-gates.ts :: resolveNewSessionSubmitBlock: Keep current admission rules at the owner; isolate optional target-specific rules only if their synchronous gate contract remains intact.
  8. modal-dialog.tsx :: createModalPolicy: Retain native surface/focus/open-close policy. Defer optional dialog body content at its open-state component boundary.
  9. control-ui-view.solid.tsx :: PluginViewContent: Load at installed plugin surface demand, including configured first-screen replacements; retain permission/host ownership.
  10. html-flow.js :: tokenizeHtmlFlow: Remove disabled constructs through a narrower parser grammar build; preserve the CommonMark/GFM code-ownership contract.
  11. server-capabilities.ts :: GATEWAY_SERVER_CAPS: Treat as feature-catalog reachability, not dead function logic. Move feature consumers before considering catalog partitioning.
  12. chat-attachment-reads.ts :: readChatAttachmentFile: Keep read-slot and byte reservation before awaiting; actual read/transform runtime is lazy.
  13. session-lineage.ts :: load: Load with the active conversation data owner; retain its current-session and Gateway checks and retry lifecycle.
  14. session-reconciliation.ts :: reconcileChangedEvent: Keep ordered sessions.changed reconciliation, generation and mutation/delete admission at the owner before publishing facts.
  15. create-tokenizer.js :: createTokenizer: Keep canonical code ownership parsing when code-like syntax is displayed; reduce the grammar build rather than falsely classifying tokenizer as rare.
  16. server-prefs-profile-runtime.ts :: writeProfileAppearancePrefs: Profile preference mutation boundary after explicit change; retain optimistic/pending write ownership and current profile checks.
  17. html-text.js :: tokenizeHtmlText: Remove disabled constructs through a narrower parser grammar build; preserve the CommonMark/GFM code-ownership contract.
  18. lobster-pet-scene-view.tsx :: Sprite: Defer scene rendering with the optional pet scene; avoid reintroducing idle pet code into critical New/Chat chunks.
  19. session-row-reconcile.ts :: reconcileParsedSessionChangedRow: Keep event scope/ancestor/deletion/omission reconciliation before authoritative row publication.
  20. session-data-catalog.ts :: loadMoreSessionCatalog: Use actual catalog pagination/discovery demand; initial filters may require hidden-page discovery, so not click-only.
  21. reasoning-tag-syntax.ts :: reduceReasoningText: Keep privacy-preserving parsing with the first content renderer; any parser split must preserve code-span and private-tag semantics.
  22. syntax.js :: tokenizeTable: A syntax-specific parser boundary is possible only with a compatible parser contract; do not postpone rendering required first-screen history.
  23. draft-preference-state.ts :: preparePreferenceWrite: Keep the preference owner authoritative; optional remote write implementation can load after a captured, scoped write, preserving queue and conflict behavior.
  24. command-palette-input.tsx :: CommandPaletteInput: Defer the palette view at open while keeping the current immediate-input/focus handoff contract; do not add a serial wait before typing.
  25. textarea-token-anchor.ts :: bindTextarea: Keep with emoji/completion overlay loading; preserve native anchor tree scope, focus return and disposal.
  26. connect-machine-dialog-view.tsx :: get children: Lazy-load the complete connect-machine dialog at the open/setup interaction, retaining permission checks in the owner.
  27. app-shell-gateway.ts :: handleGatewayEvent: Keep event routing live; defer optional command handlers with captured event identity and revalidated active target before effects.
  28. chat-composer-slash-menu.tsx :: SlashMenu: Keep immediate menu/focus feedback and existing lazy option boundaries; defer further feature code only with the same handoff.
  29. directive-handling.parse.ts :: parseInlineSessionDirectives: Defer command-specific work at slash-command admission only after preserving canonical directive ordering and synchronous send/queue admission.
  30. native-gateway-auth.ts :: createNativeGatewayConnectAuth: Load only in the native authentication startup path; keep app-held credential authority and challenge validation intact.

fixture-0-base-draft: top 30 functions cover 87,707 unused B (6.523% of 1,344,673 unused B).
fixture-0-head-draft: top 30 functions cover 87,708 unused B (6.551% of 1,338,826 unused B).
fixture-100-base-draft: top 30 functions cover 87,707 unused B (6.506% of 1,348,119 unused B).
fixture-100-head-draft: top 30 functions cover 87,708 unused B (6.560% of 1,336,944 unused B).

Complete disjoint family totals

Disjoint family totals: all loaded modules

Every mapped source belongs to exactly one source-path family. The unmapped bucket is separate; family totals reconcile exactly to V8 coverage. These are loaded/executed/unused bytes, not projected removable bytes.

fixture-0-base-draft

Family Loaded raw B Executed raw B Unused raw B Sources
UI other components 473,296 246,405 226,891 176
UI shell/app 312,656 130,449 182,207 157
UI Chat 192,236 42,475 149,761 96
UI New Session 237,423 91,766 145,657 85
UI other libraries 173,405 63,134 110,271 136
UI session libraries 137,409 40,344 97,065 58
Solid runtime 111,052 51,297 59,755 37
UI chat libraries 69,443 15,088 54,355 37
UI other 85,915 35,668 50,247 29
Third-party Markdown pipeline 50,482 2,537 47,945 51
Other shared core 66,390 26,509 39,881 83
Other shared packages 47,064 12,550 34,514 41
UI Solid primitives 55,642 21,875 33,767 32
Gateway client package 37,021 9,363 27,658 19
UI other pages 26,659 4,819 21,840 50
Third-party other 31,172 15,746 15,426 6
Core auto-reply 27,261 14,147 13,114 19
Unmapped emitted bytes 258,794 246,126 12,668 1
Gateway protocol package 25,102 12,573 12,529 24
Markdown core package 5,682 291 5,391 6
UI localization 115,579 111,848 3,731 17
Total 2,539,683 1,195,010 1,344,673

fixture-0-head-draft

Family Loaded raw B Executed raw B Unused raw B Sources
UI other components 473,296 246,200 227,096 176
UI shell/app 312,656 130,360 182,296 157
UI Chat 192,236 42,475 149,761 96
UI New Session 228,701 89,275 139,426 82
UI other libraries 173,405 63,016 110,389 136
UI session libraries 137,410 40,344 97,066 58
Solid runtime 111,052 51,297 59,755 37
UI chat libraries 69,443 15,088 54,355 37
UI other 85,915 35,668 50,247 29
Third-party Markdown pipeline 50,482 2,537 47,945 51
Other shared core 66,390 26,509 39,881 83
Other shared packages 47,064 12,558 34,506 41
UI Solid primitives 55,642 21,896 33,746 32
Gateway client package 37,021 9,363 27,658 19
UI other pages 26,659 4,819 21,840 50
Third-party other 31,172 15,746 15,426 6
Core auto-reply 27,261 14,147 13,114 19
Unmapped emitted bytes 258,612 245,944 12,668 1
Gateway protocol package 25,102 12,573 12,529 24
Markdown core package 5,682 291 5,391 6
UI localization 115,579 111,848 3,731 17
Total 2,530,780 1,191,954 1,338,826

fixture-100-base-draft

Family Loaded raw B Executed raw B Unused raw B Sources
UI other components 473,296 245,581 227,715 176
UI shell/app 312,656 130,223 182,433 157
UI Chat 192,236 42,274 149,962 96
UI New Session 237,423 91,788 145,635 85
UI other libraries 173,405 62,931 110,474 136
UI session libraries 137,409 38,607 98,802 58
Solid runtime 111,052 51,028 60,024 37
UI chat libraries 69,443 15,095 54,348 37
UI other 85,915 35,680 50,235 29
Third-party Markdown pipeline 50,482 2,537 47,945 51
Other shared core 66,390 26,467 39,923 83
Other shared packages 47,064 12,523 34,541 41
UI Solid primitives 55,642 21,919 33,723 32
Gateway client package 37,021 9,363 27,658 19
UI other pages 26,659 4,819 21,840 50
Third-party other 31,172 15,744 15,428 6
Core auto-reply 27,261 14,147 13,114 19
Unmapped emitted bytes 258,794 246,126 12,668 1
Gateway protocol package 25,102 12,573 12,529 24
Markdown core package 5,682 291 5,391 6
UI localization 115,579 111,848 3,731 17
Total 2,539,683 1,191,564 1,348,119

fixture-100-head-draft

Family Loaded raw B Executed raw B Unused raw B Sources
UI other components 473,296 247,260 226,036 176
UI shell/app 312,656 130,449 182,207 157
UI Chat 192,236 42,475 149,761 96
UI New Session 228,701 89,275 139,426 82
UI other libraries 173,405 63,228 110,177 136
UI session libraries 137,410 40,410 97,000 58
Solid runtime 111,052 51,557 59,495 37
UI chat libraries 69,443 15,088 54,355 37
UI other 85,915 35,668 50,247 29
Third-party Markdown pipeline 50,482 2,537 47,945 51
Other shared core 66,390 26,509 39,881 83
Other shared packages 47,064 12,558 34,506 41
UI Solid primitives 55,642 22,078 33,564 32
Gateway client package 37,021 9,363 27,658 19
UI other pages 26,659 4,819 21,840 50
Third-party other 31,172 15,748 15,424 6
Core auto-reply 27,261 14,147 13,114 19
Unmapped emitted bytes 258,612 245,955 12,657 1
Gateway protocol package 25,102 12,573 12,529 24
Markdown core package 5,682 291 5,391 6
UI localization 115,579 111,848 3,731 17
Total 2,530,780 1,193,836 1,336,944

Historical screenshots

Before (a997, synthetic New Session):

New Session before

After (11a, same synthetic fixture):

New Session after

Keep the shared catalog and selected project in the draft owner. Construct
folder browsing, remote search, and recents state with the existing lazy
picker content so closed Chat and New Session triggers keep a small owner.

Preserve registration retirement, search cancellation, permissions, and focus.
Update directly coupled callers and test the moved recents rendering boundary.

Validation: frozen install, UI typecheck, 41 tests across three focused files,
and a complete canonical P0-P2 source review passed. Strict-read diagnostic
excerpts are retained in local proof; unchanged source is not a base runtime
reproduction. Bundle and timing evidence remains pending before publication.
@steipete steipete added the ci:full Keep ordinary native-locale CI selection on the next PR run. label Oct 26, 2026
@clawsweeper

clawsweeper Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-27T00:46:27.753897Z 12f6211 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 26, 2026
@clawsweeper

clawsweeper Bot commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR loads project search, recent folders, and folder browsing with the project picker instead of the initial New Session page.

Example: Open New Session without opening the project picker.

  • Before: The reported strict fixture loads 2,425,184 raw bytes of JavaScript.
  • After: The same fixture loads 2,416,281 raw bytes, deferring 8,903 bytes until needed.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) A useful extraction with credible boot evidence, an introduced architecture-check failure, and incomplete interaction coverage.
Proof confidence 🦪 silver shellfish (2/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Product

Kind: Performance · Worth it: Yes · Fix scope: Complete
User problem: New Session downloads and initializes project-picker interaction code before the user opens the picker.
Reason: The maintainer-authored direction reduces measured New Session boot bytes through an existing lazy boundary without adding configuration or duplicating authoritative selection state.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep this PR open: the maintainer-directed performance change is useful, but its new circular type dependency blocks the architecture check.

Priority: P2
Reviewed head: 11a3822b9106df4a44444bc4743f0140bb7f1e96

Before merge

  • Break the circular type dependency between the draft owners (P2) - DraftPlaceBrowser now imports DraftProjectPicker here, while draft-project-picker.ts imports DraftPlaceBrowser and its callback/snapshot types. The repository’s check-madge-import-cycles scanner includes type-only static imports, so this creates a circular component and fails the architecture gate even though JavaScript emission erases these imports. The exact-head check annotation confirms madge-import-cycles failed. Define the picker’s narrow dependency contracts without importing its parent implementation, preserving lazy construction.

Findings

  • [P2] Break the circular type dependency between the draft owners — ui/src/pages/new-session/draft-place-browser.ts:9

Tests

  • Missing end-to-end proof: The supplied proof does not exercise populated-catalog first open, search, folder browsing, Escape, and reopen through the built UI on local and delayed HTTP profiles.
Agent review details

How this fits together

The Control UI project picker consumes the shared Gateway project catalog and draft selection, then presents search results, recent locations, and folder navigation through existing Gateway RPCs.

flowchart TD
  A[New Session page] --> B[Draft selection and catalog]
  A --> C[Project picker trigger]
  C --> D[Lazy picker content]
  D --> E[DraftProjectPicker]
  E --> B
  E --> F[Gateway project and filesystem RPCs]
Loading

Technical review

Best possible solution:

Keep the lazy extraction and canonical selection/catalog owners, while defining narrow picker dependencies that remove its import back to DraftPlaceBrowser.

Do we have a high-confidence way to reproduce the issue?

The circular dependency is directly visible in the introduced imports and the checker’s inclusion of type imports, corroborated by the exact-head failure annotation; no target code was executed.

Is this the best way to solve the issue?

Moving interaction state behind the existing lazy picker is coherent and preserves one selection/catalog owner; the reverse type dependency is unnecessary and can be repaired without changing runtime behavior.

Full review comments:

  • [P2] Break the circular type dependency between the draft owners — ui/src/pages/new-session/draft-place-browser.ts:9
    DraftPlaceBrowser now imports DraftProjectPicker here, while draft-project-picker.ts imports DraftPlaceBrowser and its callback/snapshot types. The repository’s check-madge-import-cycles scanner includes type-only static imports, so this creates a circular component and fails the architecture gate even though JavaScript emission erases these imports. The exact-head check annotation confirms madge-import-cycles failed. Define the picker’s narrow dependency contracts without importing its parent implementation, preserving lazy construction.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.94

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 2d9586cfd09b.

Provenance checked

  • Draft selection, catalog, and interaction ownership keeps the original intent (6b0be02: The draft-owner split separated responsibilities and stale-request lifecycles; the extraction retains synchronous selection and shared catalog ownership.)
  • Lazy project-picker presentation keeps the original intent (87a94c4: Load closed picker bodies on first open while preserving trigger behavior, focus, retained content, and import recovery.)
  • Accepted project rows during catalog refresh keeps the original intent (8039050: Keep accepted rows and responsive filtering during shared refresh while retaining request admission and invalidation in the plain catalog owner.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

Acceptance criteria:

  • pnpm check:madge-import-cycles
  • pnpm tsgo:ui
  • pnpm --dir ui exec vitest run src/pages/new-session/draft-place-browser.test.ts src/pages/new-session/draft-place-browser.remote-search.test.ts src/pages/new-session/project-chip.catalog.test.tsx src/pages/new-session/project-chip.registration.browser.test.tsx
  • git diff --check

What I checked:

  • Pinned extraction: The introduced diff moves interaction state into DraftProjectPicker, removes its former implementation from DraftPlaceBrowser, and constructs it through the existing lazy content boundary. (ui/src/pages/new-session/draft-place-browser.ts:53, 11a3822b9106)
  • Introduced circular dependency: DraftPlaceBrowser imports DraftProjectPicker, while DraftProjectPicker imports DraftPlaceBrowser and its callback/snapshot types. The architecture checker collects static import declarations without excluding type imports. (scripts/check-madge-import-cycles.ts:26, 11a3822b9106)
  • Architecture failure corroboration: The exact-head architecture check reports “madge-import-cycles failed (exit 1)”. Detailed Actions logs were unavailable because their storage host is blocked; lint failure causation remains unverified and is not assigned to the author. (11a3822b9106)
  • Supplied behavior evidence: The PR body explicitly limits its boot measurements to a fixture without project catalog capability and marks populated first-open interactions pending. Both attached screenshots were inspected and show the closed picker with unchanged layout. The supplied body identity is SHA-256 8fe231210cc23adefc26ac65c84e736eda669f307dcfeaeae669bba076e3ea47. (11a3822b9106)
  • Existing lazy-boundary intent: perf(ui): defer New Session picker bodies and obsolete preload code #180852 established lazy picker bodies while retaining trigger labels, selection, focus, and content across closes; this PR extends that boundary to interaction state. (ui/src/pages/new-session/project-chip.tsx:9, 87a94c4b4236)
  • Current-main context: Fetched main retains the original eager interaction owner and existing picker content; its inspected chunking change concerns CI panels rather than this extraction. (ui/src/pages/new-session/draft-place-browser.ts, 2d9586cfd09b)

Likely related people:

  • Peter Steinberger: Raw commit 6b0be02 adds ui/src/pages/new-session/draft-place-browser.ts:44 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 6b0be0215fb8; files: ui/src/pages/new-session/draft-place-browser.ts)
  • Vincent Koc: Raw commit 3ffdc1b adds ui/config/control-ui-chunking.ts:40 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 3ffdc1bfccd4; files: ui/config/control-ui-chunking.ts)

PR surface

Source +61, Tests -5. Total +56 across 17 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 7 429 368 +61
Tests 10 114 119 -5
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 17 543 487 +56

Review metrics

Metric Value Why it matters
Production versus test changes Production/config +429/-368; tests +114/-119 The net production growth supports the lazy owner boundary, while the old interaction implementation is removed and recents coverage moves to the rendered picker.

Labels

Label changes:

  • add P2: A bounded Control UI startup improvement with a concrete architecture-gate repair; no urgent user-facing regression is established.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: A bounded Control UI startup improvement with a concrete architecture-gate repair; no urgent user-facing regression is established.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 26, 2026, 11:34 AM ET / 15:34 UTC.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2814b31fea

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread ui/config/control-ui-chunking.ts Outdated
Comment on lines +151 to +153
case "ui/src/pages/new-session/recent-places.ts":
// The first open loads the picker and its interaction owner together.
return "project-picker-runtime";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep the eager recents helper out of the picker runtime chunk

On a cold /new load, draft-place-browser.ts still statically imports recentPlaces and NewSessionPlaceControls still calls resolveProjectRecents while the picker is closed. Assigning that helper to the same priority-20 chunk as project-picker-content.tsx therefore makes the route load the picker renderer, search owner, and folder-browser implementation before the first interaction. This defeats the intended lazy boundary and eagerly loads renderer dependencies that previously stayed behind ProjectChip's dynamic import. Keep recent-places.ts outside this chunk, or move its production caller behind the interaction boundary too. The repository's build-chunking guidance explicitly accounts for static dependencies when determining boot reachability.

AGENTS.md reference: ui/AGENTS.md:L78-L78

Useful? React with 👍 / 👎.

@steipete

Copy link
Copy Markdown
Contributor Author

Superseded by #186004, which contains the current reviewed head, complete cold-boot coverage rankings, timing evidence, and inspected screenshots. This older head is retired; its CI is not evidence for the replacement.

@steipete steipete closed this Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui ci:full Keep ordinary native-locale CI selection on the next PR run. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: XL status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant