Repository navigation
perf(ui): keep validation libraries out of chat boot - #175122
Conversation
Compile boot payload guards from canonical Gateway schemas, keep cold validation libraries lazy, and preserve snapshot parsing contracts. Tighten route budgets from paired production measurements; retain the existing startup ceiling.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs maintainer review before merge. What this changesThis PR replaces eager validation libraries with generated canonical checks, lightweight snapshot readers, and narrower imports. Example: A signed-in user opens Chat.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-approved performance improvement remains useful, and the reviewed diff reveals no actionable introduced defect. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe Control UI admits Gateway payloads and restores browser snapshots before rendering conversations; canonical schemas now generate standalone browser checks during development and build verification. flowchart TD
A[Canonical Gateway schemas] --> B[Validator generator]
B --> C[Standalone browser checks]
D[Gateway events] --> C
C --> E[Chat and New Session]
F[Persisted browser snapshots] --> G[Snapshot readers]
G --> E
Technical reviewBest possible solution: Retain canonical schema generation and the smaller boot graphs, then complete native landing admission for the inherited CI failures. Do we have a high-confidence way to reproduce the issue? This is a performance improvement supported by source import paths and reported paired production measurements; no target code was executed during this review. Is this the best way to solve the issue? Generating checks from canonical schemas and moving unchanged constants into dependency-free leaves addresses the import cost while preserving existing public exports and frame admission. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 8324bae8896e. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +5472, Tests +138, Docs +7, Config +2, Generated +342, Other +325. Total +6286 across 80 files. Added test files: 0. View PR surface stats
LabelsLabel changes: No label changes. Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (5 earlier review cycles)
Reviewed October 17, 2026, 3:38 AM ET / 07:38 UTC (Revision 6). |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e9092a9036
ℹ️ 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".
|
@clawsweeper re-review |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
* perf(ui): defer schema runtimes from chat boot Compile boot payload guards from canonical Gateway schemas, keep cold validation libraries lazy, and preserve snapshot parsing contracts. Tighten route budgets from paired production measurements; retain the existing startup ceiling. * chore(ui): distinguish generated validator output during lint * fix(ui): repair precompiled validator CI boundaries * fix(build): check protocol validators before UI publication
What Problem This Solves
Chat and New Session load general-purpose validation libraries and cold protocol schemas before they are usable. This change removes TypeBox builders/compiler and Zod from those boot graphs while preserving canonical Gateway schema ownership and the existing frame boundary.
User Impact
Chat downloads 62,396 fewer gzip bytes and two fewer JavaScript requests. New Session downloads 73,945 fewer bytes and two fewer requests. Rendering, frame admission, persisted snapshot semantics, and protocol limits are preserved.
Why This Change Was Made
Generate standalone, CSP-safe checks from the canonical schemas and split them by consumer. Move constants and narrow readers into dependency-free protocol leaves; replace accidental barrel imports. Replace Zod in three persisted snapshot readers and the ClawHub/display-position readers with equivalent narrow readers. Keep cold settings/plugin consumers lazy and retain TypeBox's existing grapheme algorithm for resume handoffs.
The shared UI build owner checks generated freshness before plugin preparation, cache reuse, Vite, or publication. A stale check rejects even a warm cached build while retaining previously published output. Public schema exports and the existing transport frame guards remain intact.
Evidence
Paired production builds on the same host/toolchain, with identical build identity settings. Base:
85cd5b0105ca05b31124490bbe46ff6bb407f656; head:c419080ad4da7a9e4ef4395e5c40b46accae329c.All 453 startup source blobs are byte-identical by SHA256. The remaining unmapped files are an identical bundler runtime and a 41-byte entry whose sole import hash changes. The small startup increase is generated chunk/preload references; the 339,000-byte startup cap is retained. Chat/New caps are lowered to 1,495,000/1,055,000 B, with under 1% byte headroom and two request slots.
The regenerated boot manifest contains no Zod and no TypeBox schema builders/compiler. No renderer, DOM, CSS, or visual state changed: TSX edits only change imports, and the skill text decoder is extracted unchanged, so screenshots would show no changed state.
Local proof on the final integrated candidate: UI typecheck and production Knip passed without new ignores; generated freshness, production build, and strict paired performance checks passed (zero violations/warnings); independent full-diff P0–P2 review passed both chunks with no actionable findings. Earlier focused proof, reused with unchanged owning inputs, passed all 18 UI builder tests, 22 canonical-schema parity cases, both ClawHub reader cases, the snapshot cases, all 19 wrapper/import-closure cases, script and UI-test typechecks, targeted lint, and formatting. Main integration preserves its bounded snapshot cache and replay-data stripping.
Full CI 39011275366 passed on prior head
35045e6697b1d6d2ae8be07dd27b576f66955f8d: 155 jobs passed and 19 skipped, including every UI unit and Control UI E2E shard, both real-Gateway shards, typechecks, native provisioning, andsecurity-fast.Main then refactored the board-document owner, causing a header import conflict. The reviewed repair preserves main's Solid imports and owner implementation plus this PR's dependency-free
GATEWAY_SERVER_CAPSimport. All four board-document tests, UI typecheck, production Knip, generated freshness, production build and strict paired performance check passed on the repaired source. Canonical schemas and generated validator bodies are unchanged. The native prior-success verifier refused the old run because its live nested PR head had advanced, despite its immutablehead_shaand successful conclusion matching the prior head. No merge was dispatched or guard changed. Current-head full CI 39013107927 completed with 150 jobs passed and 19 skipped, including all nine UI E2E shards, the other real-Gateway shard, typechecks, provisioning, andsecurity-fast. Its two root failures are independently proven pre-existing and are recorded for native admin admission; prior CI is not claimed as new-head success:checks-ui (1/3)link-reader-metadata.test.tscannot resolve the removed./link-reader-panel.tsimport5cd2cac82dca11ff2968c09296952070c169bf93; test, replacement panel, and hovercard objects are identical in main and the tested merge.checks-ui-e2e-real-gateway (2/2)provider.results.has(marker)times out at line 497The actual tested merge is
f82e2cc7c2e10fd479f80bd71ecbefec118eb29a, with ordered parents5cd2cac82dca11ff2968c09296952070c169bf93andc419080ad4da7a9e4ef4395e5c40b46accae329c. Its tree was independently reconstructed. Native evidence binds both failed jobs, the downstream CI gate, exact source objects, and the retained logs. No product, security, or review gate is waived.The preceding full run passed 154 jobs, including every UI unit shard, all nine Control UI E2E shards, all typechecks, one real-Gateway shard, and
security-fast. Its sole root failure was the intermittent automation-management provider-result timeout also captured by the same case/assertion on older scheduled main run39002992814; latest scheduled main had passed. Native inherited recovery stopped before dispatch when main's new performance budget conflicted, prompting this integration and fresh CI. The original CI typing, lint, wrapper-inventory, fixture, and build-freshness findings were fixed before the preceding run.Size and Simplification
The generated checks replace runtime schema interpretation; one shared snapshot reader replaces three Zod consumers. Handwritten growth is mainly the generator and shared parser. No new dependency or validation owner is introduced.
Solid checklist counts are unchanged: controller/effect/render-effect/untrack/listener/query/class-string/flush/owner-capture = 0/2/0/1/0/0/0/0/0.
Boot import audit
TypeBox entered through activity/narration/tool-stream payloads, approval projection, placement recovery, runtime restrictions, reactions, Talk voice events, sender identity, snapshot metadata/progress, schema constants, and
agent-core/harness/messages → llm-core's validation barrel. These paths now use canonical generated checks or dependency-free constants/readers; the harness imports the existingllm-core/typesentry. Shared chunk grouping no longer pulls in cold plugin install schemas.Zod entered through sidebar/roster/chat snapshot readers and ClawHub recommendation/display-position readers. Replacements preserve stripping, strict envelopes, defaults, safe/finite numbers, Unicode bounds, URL normalization, and identity constraints. Native config bridges remain lazy. Reading pinned skill text no longer imports its upload owner and schema barrel.