Skip to content

fix: reject misleading Control UI boot coverage captures - #189444

Merged
steipete merged 1 commit into
mainfrom
solid2/w-boot-coverage-validity
Oct 31, 2026
Merged

steipete merged 1 commit into
mainfrom
solid2/w-boot-coverage-validity

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes misleading Control UI boot coverage when --coverage runs with the benchmark's default CPU sampler or explicit CPU profiling.

User Impact

No production UI change. Benchmark users get an actionable rejection instead of evidence that can falsely classify required code as unexecuted. Run coverage with --coverage --untraced; capture CPU profiles separately. --thread-cpu-time remains supported.

Why This Change Was Made

The same built bundle returned function-only binary coverage with concurrent CPU sampling, including zero counts for English and icon initializers whose values the rendered UI required. An isolated coverage capture restored detailed block ranges and counted both initializers. The two CDP sessions share isolate-global V8 coverage state; the exact downgrade event was not logged. This change rejects the observed conflicting mode and documents the separation of coverage, CPU, and complete network accounting.

Evidence

Check Result
Same-bundle isolated native coverage 14,397 block-covered functions; 42,449 ranges; 14,597 ranges with count > 1
Required English / icon initializers Both block-covered, count 1
Covered raw JS 4,112,934 loaded / 1,886,467 executed / 2,226,467 unexecuted B
All completed JS fetches 4,566,944 raw B / 61 requests; 454,010 B / 17 fetch-only requests outside coverage
Independent range accounting Matches all 44 scripts; no crossing ranges or conflicting equal spans
Focused real-CLI regression 1/1 pass: default sampling plus coverage is rejected
Script typecheck pnpm tsgo:scripts passed
Format / whitespace Passed
Targeted local lint Interrupted unnecessary plugin declaration preparation; retained artifact ownership lock. Full lint deferred to PR CI; no lock was deleted or guard bypassed.
Independent review No actionable P0–P2 findings

Native reproduction used the production HTTP handler and synthetic chat fixture, the unchanged bundle at 82691373b8cc9899dc14e5e6682ad9659ec4e715, and the benchmark at 532bc8e06ae8ef5ddf97a14082ab07e2629b5c7e:

node --import ./scripts/tsx.mjs scripts/bench-control-ui-cold-load.ts   --gateway-http --bundle-dir <saved-base-bundle> --runs 1   --face chat --boot-route chat --first-load --cold-http-cache   --coverage --untraced --thread-cpu-time --fixture-now-ms 1793013547604   --network-latency-ms 0 --download-kbps 0 --latency-ms 0 --output <proof-directory>

This is a measurement correction, not a product byte or readiness improvement. Prior combined-sampler execution numbers are invalid and are not claimed as savings. Completed network counts remain valid. There is no UI build, runtime change, or visual change in this PR.

Simplification kept one real-CLI regression rather than spawning the same large benchmark three times. The initial 15-second child timeout failed on the loaded host; the focused final case passed in 16.18 seconds with a 45-second ceiling. Script LOC 3,865 → 3,872 (+7); documentation 871 → 878 (+7); tests 0 → 17 (+17). No new helper or production seam.

Cold-chat top 30 modules and functions by unexecuted raw bytes

These rankings replace the invalid combined-sampler table. Source-map intervals partition emitted UTF-8 bytes; the most specific V8 range wins. Function rows exclude nested functions. The two tables are alternate views and must not be summed. There are 1,741 mapped source paths and no duplicated paths across covered chunks. Unmapped generated bytes (included in totals): 353,604 loaded / 331,007 executed / 22,597 unexecuted B.

“Common follow-up” identifies an ordinary next interaction; “rare” means conditional/specialized, not measured user frequency. Data literals inherit their enclosing range status. These observations are not data-read coverage, compile cost, proof of dead code, or guaranteed split savings.

Top 30 source modules

# Source Loaded B Executed B Unexecuted B Class and interaction
1 node_modules/.pnpm/[email protected]/node_modules/markdown-it/dist/markdown-it.mjs 50,960 18,234 32,726 mixed — Markdown already renders at boot; unused parser rules serve later syntax and alternate options.
2 node_modules/.pnpm/[email protected]/node_modules/dompurify/dist/purify.es.mjs 29,046 16,653 12,393 mixed — Boot sanitization plus alternate tag/attribute paths; preserve the sanitization boundary.
3 node_modules/.pnpm/@[email protected]/node_modules/@tanstack/virtual-core/dist/esm/index.js 24,519 12,396 12,123 mixed — Transcript/sidebar geometry is active at boot; later scrolling, resize, smooth-scroll and alternate measurement paths share the Virtualizer owner.
4 ui/src/lib/protocol-validators.generated/approvals.js 12,148 1,927 10,221 rare — Conditional approval requests/replays, possibly arriving during a live run; keep validation at event admission.
5 ui/src/pages/chat/chat-pane-side-panels.ts 12,609 2,986 9,623 mixed — Restore sidebar layout plus files/subagents/companion panel interactions.
6 node_modules/.pnpm/[email protected]/node_modules/linkify-it/build/index.mjs 11,151 2,181 8,970 common follow-up — Automatic URL/email linkification in later Markdown; current parser shares the owner.
7 ui/src/pages/chat/components/chat-composer-view.tsx 15,273 6,358 8,915 mixed — Base composer plus conditional attachments, goals, menus and activity pills.
8 ui/src/pages/chat/chat-pane-sharing.ts 11,482 2,634 8,848 mixed — Sharing subscriptions plus live typing previews and session suggestions.
9 ui/src/app/app-shell-chrome.ts 11,812 3,063 8,749 mixed — Initial shell bindings plus palette, navigation, shortcut and lazy-panel actions.
10 node_modules/.pnpm/[email protected]/node_modules/ipaddr.js/lib/ipaddr.js 12,622 3,975 8,647 mixed — Media-output URL/IP checks use net-policy; uncommon IP forms share this parser.
11 ui/src/app/app-root.tsx 12,160 3,656 8,504 mixed — App mount/route presentation plus login, error, focus and panel branches.
12 ui/src/components/select-picker-view.tsx 11,917 3,664 8,253 common follow-up — Opening and navigating an agent/model/filter picker; closed trigger remains first-screen UI.
13 node_modules/.pnpm/@[email protected]_patch_hash=421b418083c0218bb54ceb3e12bd0eb74a84e86474ca26cc1f1114abbe58de48/node_modules/@solidjs/signals/dist/prod/store/store.js 17,768 9,601 8,167 mixed — Reactive store reads and writes at boot plus later drafts, snapshots, property changes and reconciliation; core dependency, not an optional feature.
14 ui/src/components/session-progress-card-solid.tsx 12,272 4,146 8,126 mixed — Visible task progress plus refresh/menu, composer, details and board presentations.
15 ui/src/pages/chat/chat-pane-history.ts 11,007 3,133 7,874 mixed — Initial history observation and hydration plus older-page scrolling, rewind, fork and branch switching.
16 ui/src/lib/protocol-validators.generated/activity.js 9,381 1,559 7,822 common follow-up — Live activity, narration, observer and reaction events after the initial snapshot.
17 ui/src/components/session-organizer.ts 8,342 540 7,802 common follow-up — Sidebar pinning, collapse, drag/drop and archive/category actions.
18 ui/src/pages/chat/chat-outbox-owner.ts 9,571 1,911 7,660 mixed — Restore pending outbox at boot, then enqueue/edit/retry/discard queued sends.
19 ui/src/pages/chat/chat-pane-lifecycle.ts 14,251 6,674 7,577 mixed — Mount/connect/session lifecycle is active at boot; reconnect, provider review, panel actions and cleanup are later branches.
20 ui/src/lib/sessions/github-publication-owner.ts 7,569 10 7,559 rare — Open GitHub publication controls, select publisher and publish/confirm.
21 ui/src/components/solid/menu.tsx 9,440 1,903 7,537 common follow-up — Open, navigate and select an action menu; shared overlay ownership remains required.
22 ui/src/pages/chat/chat-send-submit.ts 7,489 10 7,479 common follow-up — Submit a message, queue it or dispatch a slash command.
23 ui/src/api/gateway.ts 12,840 5,394 7,446 mixed — Gateway connection and requests are active at boot; reconnect, silence recovery, stop and scope-upgrade flows share the client.
24 ui/src/pages/chat/components/chat-message-images-solid.tsx 7,928 522 7,406 common follow-up — Receive/view image attachments, retry loading and open image actions.
25 ui/src/pages/chat/chat-view.tsx 14,037 6,647 7,390 mixed — First chat screen plus conditional running, approval, suggestion, footer and composer presentations.
26 ui/src/pages/chat/components/chat-session-workspace.ts 8,372 1,103 7,269 mixed — Workspace state/props support chat and restored panels; file open, reveal, refresh, managed artifact and diff actions are conditional.
27 packages/gateway-client/src/session-projection.ts 7,985 918 7,067 mixed — Initial transcript projection plus future streamed messages, run transitions and snapshot reconciliation; retained ordering/identity owner.
28 node_modules/.pnpm/[email protected]/node_modules/entities/dist/decode.js 7,588 535 7,053 common follow-up — Decode HTML/XML character references in later message content.
29 node_modules/.pnpm/@[email protected]_patch_hash=6d6b2e52e607edf3c9cfcc1a26f331d013537d051f43bbb4f3e_d913839875323d2bb83ec59562493c23/node_modules/@solidjs/web/dist/web.js 17,732 10,732 7,000 mixed — DOM rendering and event handling are active at boot; alternate reconciliation, hydration, head and server-function paths share the runtime.
30 ui/src/pages/chat/composer-dictation.ts 8,103 1,109 6,994 rare — Press/hold or click dictation; microphone, transcription, insertion and cancellation lifecycle.

Top-30 module totals: 407,374 loaded / 134,174 executed / 273,200 unexecuted raw B.
Classes: {'mixed': 19, 'rare': 3, 'common follow-up': 8}.

Top 30 exclusive functions

# Function / mapped location Loaded B Executed B Unexecuted B Class and interaction
1 handleSendChat · ui/src/pages/chat/chat-send-submit.ts:97:1 7,397 0 7,397 common follow-up — Submit a message, queue it, resume an edit or dispatch a slash command.
2 board snapshot check_0 · ui/src/lib/protocol-validators.generated/board.js:50:16 5,458 0 5,458 rare — Open/refresh a board or receive its snapshot; keep the board payload validator at admission.
3 createMessageImagePresentation · ui/src/pages/chat/components/chat-message-images-solid.tsx:60:1 5,283 0 5,283 common follow-up — Receive/display an image attachment, load its thumbnail, or use image actions; presentation owns resource cleanup.
4 canApplySessionListSnapshot · ui/src/lib/sessions/session-list-query.ts:37:1 4,039 0 4,039 common follow-up — Receive a session-changed event and determine whether the retained sidebar list can reconcile it without a full read.
5 buildChatItems · ui/src/pages/chat/chat-thread-build.ts:131:1 5,469 1,693 3,776 mixed — Initial transcript construction is active; later tool replies, ordered inputs and alternate history/grouping branches share this builder.
6 drainStoredChatOutbox · ui/src/pages/chat/chat-outbox-drain.ts:140:1 3,655 0 3,655 common follow-up — Drain queued sends after admission/connection permits, including resumed persisted outbox entries.
7 loadChatRoute · ui/src/pages/chat/route-loader.ts:253:1 4,427 775 3,652 mixed — Initial chat resolution is active; catalog-share routes, revalidation, missing/session-change and permission cases are other branches.
8 normalizeStoredQueueItem · ui/src/lib/chat/outbox-store-codec.ts:112:1 3,494 0 3,494 mixed — Restore a persisted queued item at boot or after reconnect; attachment and legacy normalization paths depend on stored data.
9 Menu.renderEntries · ui/src/components/solid/menu.tsx:428:26 3,358 0 3,358 common follow-up — Open and navigate a menu; render actions, content groups, selection and submenu entries.
10 WorkingStatus · ui/src/pages/chat/components/chat-working-indicator.tsx:48:1 3,260 0 3,260 mixed — Render an already-running session or the next active reply, including approval/subagent/continuation states.
11 coalesceTurn · ui/src/pages/chat/chat-tool-activity-coalesce.ts:218:1 3,203 59 3,144 mixed — Initial transcript coalescing is active; later tool/run references and ambiguous ownership exercise remaining merge paths.
12 PluginViewContent · ui/src/plugins/control-ui-view.solid.tsx:61:1 3,141 0 3,141 mixed — Render a configured plugin replacement/slot on the first screen or open an installed plugin view later.
13 PersonReferenceContent · ui/src/components/solid/person-reference.tsx:25:1 3,129 0 3,129 common follow-up — Render an explicitly selected person reference in a message, then hover/click for the profile card.
14 resolveTaskSuggestion · ui/src/pages/chat/chat-pane-task-suggestions.ts:321:3 3,079 0 3,079 common follow-up — Accept or dismiss a suggested task, possibly starting it locally or in a selected workspace.
15 createScanner · node_modules/.pnpm/[email protected]/node_modules/jsonc-parser/lib/esm/impl/scanner.js:10:1 2,991 0 2,991 common follow-up — Render JSON tool output or a JSON block with source offsets/ordered members; imported by markdown-json and tool-output.
16 ChatPermissionCard · ui/src/pages/chat/components/chat-permission-card.tsx:12:1 2,978 0 2,978 rare — Display a node capability permission request and grant/retry through the native device settings owner.
17 tokenizeHtmlFlow · node_modules/.pnpm/[email protected]/node_modules/micromark-core-commonmark/lib/html-flow.js:55:1 2,966 0 2,966 common follow-up — Parse a Markdown HTML block in later message content; preserve Markdown/sanitization semantics.
18 startRealtimeTalk · ui/src/pages/chat/chat-realtime.ts:148:29 2,959 0 2,959 rare — Start realtime voice conversation with the selected input device and voice settings.
19 openWorkspaceItem · ui/src/pages/chat/components/chat-session-workspace-preview.ts:26:1 2,929 0 2,929 common follow-up — Open a workspace file/artifact preview or pinned tab, including loading, cancellation and revalidation.
20 hydrateChatHistory · ui/src/pages/chat/chat-history-hydration.ts:73:1 5,572 2,668 2,904 mixed — Initial history hydration is active; reconnect, stale-result, run-projection and startup/history response branches vary by state.
21 readChatAttachmentFile · ui/src/pages/chat/components/chat-attachment-reads.ts:231:1 2,774 0 2,774 common follow-up — Attach/drop/paste a local file, prepare its payload and handle read cancellation/errors.
22 handleTranscriptContextMenu · ui/src/pages/chat/components/chat-thread-interactions.ts:478:1 2,761 0 2,761 common follow-up — Right-click a transcript bubble/group to show permitted message and selection actions.
23 resolveAssistantAttachmentAvailability · ui/src/pages/chat/components/chat-message-attachment-availability.ts:57:1 2,743 0 2,743 common follow-up — Display an assistant attachment and resolve its ticket/local availability, respecting media-read permission.
24 splitMediaOutput · src/media/parse-output.ts:355:1 3,060 360 2,700 mixed — Initial tool/output text parsing is active; later media URLs, audio directives, image extraction and ordered segments use remaining branches.
25 ComposerCard · ui/src/components/session-progress-card-solid.tsx:559:1 2,666 0 2,666 mixed — Render task progress within the composer or details area when a session has a progress card; expand its disclosure.
26 RunFrame · ui/src/pages/chat/components/chat-agent-run-frame.tsx:263:1 2,651 0 2,651 mixed — Render a historical or current agent-run frame with body, reply, recap and timing presentation.
27 ChatCommentPins render callback · ui/src/pages/chat/components/chat-comment-pins.tsx:36:4 2,632 0 2,632 rare — Show spatial pins for a conversation carrying comment attachments, then select/reposition those pins.
28 visit · node_modules/.pnpm/[email protected]/node_modules/jsonc-parser/lib/esm/impl/parser.js:346:1 2,610 0 2,610 common follow-up — Visit JSON tool output or a JSON code block to preserve ordered members and offsets.
29 reconcileChangedEvent · ui/src/lib/sessions/session-reconciliation.ts:399:5 2,609 0 2,609 common follow-up — Apply a live session-changed event to roster, permissions, publication, mutations and observer state.
30 switchChatModel · ui/src/pages/chat/chat-session.ts:345:1 2,548 0 2,548 common follow-up — Choose a different model/runtime and apply the session setting under the current selection claim.

Top-30 function totals: 105,841 loaded / 5,555 executed / 100,286 unexecuted raw B.
Classes: {'common follow-up': 16, 'rare': 4, 'mixed': 10}.

@clawsweeper

clawsweeper Bot commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@steipete
steipete marked this pull request as ready for review October 31, 2026 14:14
@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: XS labels Oct 31, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 31, 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-31T14:16:23.758996Z 92d0f55 Draft marked ready
ℹ️ 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.

@steipete
steipete enabled auto-merge (squash) October 31, 2026 14:21
@steipete
steipete merged commit bb2206e into main Oct 31, 2026
156 of 159 checks passed
@steipete
steipete deleted the solid2/w-boot-coverage-validity branch October 31, 2026 14:23
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash auto-merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scripts Repository scripts size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant