Uh oh!
There was an error while loading. Please reload this page.
refactor(desktop): enforce a metadata-free renderer startup boundary - #2176
Conversation
d197de3 to
2fcb7e0CompareAstro-Han
commented
Aug 5, 2026
Thanks for this — I verified the headline claims by rebuilding both trees: the startup JS drops ~32% (1,974KB → 1,339KB on my fresh build), the metadata-name markers go from 266 matches to 0 across all 27 startup chunks, Merge blocker — the branch conflicts with P2 — the claimed contract test for the startup boundary doesn't exist. The PR body says "A contract test keeps it aligned with the first four recommended providers at test time", but P2 — the snapshot payload has no runtime contract pin. The renderer consumes P3 (optional): the The design and the refactor itself are sound — happy to approve once rebased and the boundary test lands (or is explicitly deferred). |
cd30b8c to
59be1c6CompareKeep full model metadata behind the main-process and lazy-settings boundaries, and project only first-screen data through onboarding snapshots. Refs apache#2063 Relates to apache#2084
Lock sessions when user messages are appended and migrate legacy unlocked sessions once, keeping read paths pure.
59be1c6 to
30c68c9CompareAstro-Han
commented
Aug 6, 2026
Thanks for the follow-up — both P2s are closed with verified enforcement, and I confirmed by mutation rather than inference:
Five optional notes, none blocking:
Merging now — the boundary finally has teeth. |
Uh oh!
There was an error while loading. Please reload this page.
Summary
onboarding:getSnapshotto project only first-screen model choices, thinking levels, provider labels, and session send outcomesCloses#2063
Relates to #2084
Measured result
The artifact and isolated parse cost improved materially. End-to-end cold start and Chromium script duration were unchanged within run-to-run noise, so this PR does not claim a user-visible wall-clock startup improvement.
Architecture boundary
The main process remains the metadata authority. The renderer startup path consumes a lightweight projection; full catalog data remains available only to main-process code and lazy-loaded Settings paths. Explicit core subpaths make that boundary independent of barrel reachability, with
sideEffects: falseand tree-shaking as a second defense.FIRST_RUN_PROVIDER_TYPESis intentionally a metadata-free product constant. A contract test keeps it aligned with the first four recommended providers at test time rather than reintroducing a runtime registry dependency.Review follow-up
Verification
npm --workspace @maka/desktop run typecheck— passednpm --workspace @maka/desktop test— 1,751 passednpm --workspace @maka/storage test— passednpm --workspace @maka/desktop run build:renderer— passed, including third-party notice verificationgit diff --check— passed