Skip to content

build(mobile): split the Route A page into per-route chunks (OTA phase C, C1.5) - #21475

Merged
Jinwoo-H merged 16 commits into
mainfrom
ota-c1-5-split
Sep 18, 2026
Merged

Jinwoo-H merged 16 commits into
mainfrom
ota-c1-5-split

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​683 $\color{#cf222e}{\Huge{\mathbf{−}}}$​145 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​538
Prod 4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​428 $\color{#cf222e}{\Huge{\mathbf{−}}}$​57 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​371

What this is

OTA phase C, step C1.5: the Route A page bundle (build:mobile-web:app, C0.7) is cut into per-route chunks. The shipped bundle is unchanged: build:mobile-web and packaging still build Phase A's bootstrap; this only changes the CI-proven app bundle that C1 flips build:release to. Released phones unchanged; no RPC operation, no recorder file.

Why

C0.7 measured one 8.16 MB script at 78% of the shell's 10 MiB per-asset cap, and found esbuild splitting inert against static imports. The first migrated domain (C1, the worktree list) needs about a quarter of that closure, and every later route would grow the one script toward the cap. Splitting holds the parse-before-first-paint cost flat as routes migrate.

How

  • The route manifest emits { default: lazy(() => import(module)) } per key, so the RequireContext expo-router reads stays synchronous (it walks keys() to build the tree before rendering) and only the screen behind each key is deferred. RootProviders wraps children in one Suspense.
  • format: 'esm', splitting: true; the document's script tag becomes type="module". esbuild's [hash] chunk name is only a placeholder: it hashes input paths relative to mobile/, so a symlinked node_modules or a deeper checkout renames chunks. The builder renames every output to the sha256 of its final bytes, leaves first, rewriting each importer's /assets/<name> specifier before hashing it, so the bundle is a function of bytes only. A test builds one route tree from two depths and compares chunk names and buildId.
  • Routes are refused at build time if they export unstable_settings or ErrorBoundary in any form (esbuild metafile parse per route, star re-exports fail closed), since a lazy module cannot answer expo-router's synchronous reads. script-src 'self' already covers same-origin dynamic import; CSP unchanged. The C1 probe proved import() resolves through the scheme handler on both platforms.
  • The render check waited on the entry's mount signal, which now lands while the route chunk is still fetching; it waits on the route's own text instead, and a client-side navigation test asserts the tasks route's own chunk arrives.

Sizes (bytes)

before after
entry script 8 158 331 2 332
loaded before any route (entry + static reach) 8 158 331 931 320
first paint of /h/<id> 8 158 331 ~2.3 MB (26 chunks)
total bundle 8 206 426 8 225 276
chunks / manifest assets 1 / 44 53 / 96

The 14 route chunks total 1.75 MB (session 1.30 MB, tasks 286 KB, worktree list under 1 KB); 36 shared chunks hold the rest. Content-hash names add 21 KB over esbuild's short names.

Bounds in the verifier

  • MOBILE_WEB_APP_BUNDLE_MAX_ENTRY_BYTES = 3 MiB: the entry plus everything it reaches by static import. Proven red by mutation: splitting: false fails at 8.2 MB; every route static fails at 8.16 MB. This is not a per-route opt-out: 5 of 14 routes (session 7.16 MiB, tasks 5.91, source-control 5.78, review 5.77, files/preview 5.21) cannot be static. The hatch exists only for layout nodes, where expo-router reads unstable_settings, and the one layout measures 2.22 MiB static.
  • mobileWebAppBundleMaxChunks(routeCount) = 4 × routes + 16 (72 at 14 routes, 53 measured): esbuild emits a chunk per distinct importer set, about three per route at the top, so the ceiling follows the route count instead of failing C2 on an arbitrary number.
  • mobileWebAppBundleMaxAssets(routeCount, imageCount) = chunk ceiling + images + the document, so the chunk ceiling always trips first. The verifier fails when that derived ceiling passes what the phone accepts, read from MOBILE_WEB_BUNDLE_MAX_ASSETS in the shared manifest contract (bundled by esbuild since the module's imports carry no extension), so the number appears nowhere in the scripts; green at 49 routes, red at 50.
  • The 9 MiB total budget and the 10 MiB per-asset cap are unchanged.

buildId reproducible across shallow and deep checkouts with symlinked and real node_modules.

Verification

Mobile tsc 0; oxlint 0; anti-slop 0; oxfmt clean; changed-code gate 0 new findings; builder, route-manifest, render, verifier, overrides, Phase A builder and parity tests pass; the render check paints Host not found through the lazy path and the navigation test fetches the tasks chunk in headless Chromium.

Reviews

Round 1 (SHIP AFTER FIXES): the export guard regexed source and missed aliased, class and re-exported forms (proved end to end: boundary dropped, page blank, CI green) → esbuild metafile parse, run in the build; the "one route static" claim was false for 5/14 routes → comment corrected; MAX_CHUNKS 64 had ~3 routes of headroom → derived formula; a Suspense that never fires (expo-router wraps every screen; a test reads its useScreens.js so the premise cannot rot) → deleted; client-side navigation untested → pinned. Round 2 (SHIP AFTER FIXES): buildId was path-dependent through esbuild's chunk hashing (fresh checkout, same shape → same id; one directory deeper → different id; C0.7's base identical at both) → content-hash rename with a two-depth test; the asset ceiling overtook the chunk ceiling from 18 routes → derived; the guard lacked the builder's .js JSX loader → shared table; the navigation test asserted any new script → the route's own chunk. Round 3 (targeted at the rename): correct on three tree shapes, both ordering mutations caught; the derived asset ceiling had lost its pin under the shell's hard limit → guard against the contract constant; direct tests for the two throws; one-line builder failure. CodeRabbit's error-boundary finding (a rejected lazy import has no boundary) is real and routed to C1.1, where the entry mounts on init and can report over the bridge.

…e C, C1.5)

The page bundled as one 8.16 MB script because every route was a static
import. The route manifest now defers each screen behind `import()`, the
build is esm with splitting on, and the document loads the entry as a
module. What the browser parses before the first route can paint drops
from 8.16 MB to 908 KiB; the whole page still weighs the same.

Two budgets hold it: the chunk count, which catches a split running away,
and the bytes the entry reaches by static import, which catches it
collapsing back. The second is the one that matters, and it is measured
from esbuild's metafile because only that says which import is static.

The RequireContext stays synchronous, since expo-router reads keys() to
build the route tree before anything renders. A lazy module cannot answer
`unstable_settings` or `ErrorBoundary`, which expo-router reads off the
namespace, so a test holds that no route in the subtree exports either.

The render check now waits for the route's own text: the entry's mount
signal lands while the route chunk is still being fetched.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
@coderabbitai

coderabbitai Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: e3fb595b-2387-4079-a792-41aacced3dcc

📥 Commits

Reviewing files that changed from the base of the PR and between 1e7045c and 9c01300.

📒 Files selected for processing (5)
  • config/scripts/build-mobile-web-app-bundle.test.mjs
  • config/scripts/mobile-web-app-render.test.mjs
  • config/scripts/mobile-web-app-route-manifest.mjs
  • config/scripts/verify-mobile-web-app-bundle.mjs
  • mobile/web-entry/index.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • config/scripts/mobile-web-app-route-manifest.mjs

Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review.


📝 Walkthrough

Walkthrough

The mobile web route manifest now resolves synchronous route exports with esbuild and rejects unresolved star re-exports. The web entry adds a Suspense boundary for deferred route chunks. Browser tests wait for mounted and painted content and verify client-side chunk loading. The build emits a named ESM entry, hashed chunks, metafile data, and module HTML. Bundle results and verification now include static-entry bytes and route-scaled chunk limits.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 9c013

No concrete merge-blocking risk remains in the reviewed split-bundle changes.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 16 functions across 6 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning The description gives detailed context, rationale, implementation details, sizes, bounds, testing, and review history. However, it omits several required template sections or equivalent content, inclu… Add the missing required sections. Include a valid issue reference after "Fixes #", provide before-and-after visual proof or state "N/A" with a reason, add the Testing checklist and platform coverage, complete the Agent skill upstream bound…
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly describes the primary change: splitting the Route A mobile web page bundle into per-route chunks.
Full details: Description check

Explanation

The description gives detailed context, rationale, implementation details, sizes, bounds, testing, and review history. However, it omits several required template sections or equivalent content, including ELI5, Linked Issue with an issue reference, Visual Proof or an explicit N/A statement, Testing with the required checklist, Agent skill upstream boundary, Notes, and the final Checklist.

Resolution

Add the missing required sections. Include a valid issue reference after "Fixes #", provide before-and-after visual proof or state "N/A" with a reason, add the Testing checklist and platform coverage, complete the Agent skill upstream boundary section, address the Notes items, and complete the final Checklist.

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai 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.

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 28102ffb-7081-4c6a-9e60-f271a742472c

📥 Commits

Reviewing files that changed from the base of the PR and between 381a3da and 1e7045c.

📒 Files selected for processing (6)
  • config/scripts/build-mobile-web-app-bundle.mjs
  • config/scripts/build-mobile-web-app-bundle.test.mjs
  • config/scripts/mobile-web-app-render.test.mjs
  • config/scripts/mobile-web-app-route-manifest.mjs
  • config/scripts/verify-mobile-web-app-bundle.mjs
  • mobile/web-entry/index.tsx

Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.

Comment thread mobile/web-entry/index.tsx Resolved

@pullfrog pullfrog 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.

ℹ️ Minor suggestions only. The split itself is sound — I read the whole diff and checked the load-bearing claims against expo-router 55.0.18 and esbuild directly.

Reviewed changes

  • Per-route lazy chunks — renderMobileWebAppRouteManifest emits { default: lazy(() => import(module)) } per key; esbuild runs format: 'esm' + splitting: true with content-hashed chunkNames and a pinned entry name, and the document's script tag becomes type="module".
  • Entry-closure budget — new entryStaticClosure walks static imports from the entry; MAX_ENTRY_BYTES (3 MiB), MAX_CHUNKS (64) and MAX_ASSETS (128) bound the split, and the verifier reads both new numbers off the fresh build.
  • Suspense and render-check timing — RootProviders wraps children in Suspense, and the render check now waits on the route's own text instead of the entry mount signal.
  • Lazy-export guard — routeModuleNamedExports pins that no mounted route exports unstable_settings/ErrorBoundary.

ℹ️ The guard protecting the lazy manifest is not run by the builder

bundleMobileWebApp never calls routeModuleNamedExports; only build-mobile-web-app-bundle.test.mjs does. So pnpm build:mobile-web:app on a checkout where a route has grown unstable_settings would still emit a bundle that silently drops it, and only the CI test job would catch it. There is also no implemented way to make one route static, despite the PR body saying a route "can opt back to a static import" — every key is hardcoded to lazy in the generator.

Technical details
# Guard runs in tests only, with no static-import escape hatch

## Affected sites
- `config/scripts/build-mobile-web-app-bundle.mjs:201` — `bundleMobileWebApp` builds the manifest and calls esbuild without checking `routeModuleNamedExports`.
- `config/scripts/mobile-web-app-route-manifest.mjs:92` — `renderMobileWebAppRouteManifest` hardcodes `lazy(() => import(module))` for every key, so there is no per-route static option.
- `config/scripts/build-mobile-web-app-bundle.test.mjs:134` — the only caller of the guard.

## Required outcome
- A route that grows a synchronous expo-router export fails `build:mobile-web:app` itself, not only the test run; and the path to "make this route static" is either implemented or documented.

## Open questions for the human
- Is editing `renderMobileWebAppRouteManifest` by hand the intended remediation, or should the manifest generator accept a per-route static list?

ℹ️ Nitpicks

  • config/scripts/verify-mobile-web-app-bundle.mjs:17 cites MOBILE_WEB_SHELL_MAX_ASSETS (an Android-only constant). The cross-platform ceiling is MOBILE_WEB_BUNDLE_MAX_ASSETS = 256 in src/shared/mobile-web-bundle/manifest-contract.ts, which the mobile reply schema and the native shell both enforce.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

…egex

`export { x as ErrorBoundary }`, `export class ErrorBoundary` and a re-export all
reach the namespace without matching the declaration pattern the guard was
matching, so the lazy manifest dropped the boundary and the page painted blank.
A star re-export is now reported rather than read as clean.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
Measured: statically importing one route already breaks the 3 MiB bound for 5 of
the 14. The hatch only works for a layout node, which is the only place
expo-router reads a synchronous export from.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
64 was three routes of headroom over the 53 chunks 14 routes measure, so C2's
routes would have failed on a number measured before they existed. Four per
route plus 16 tracks the measured slope; the entry-bytes bound stays the real
budget.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
expo-router wraps every screen in its own, so this one never fires; all nine
render checks stay green without it.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
…e's chunk

Goes red with splitting off: the tasks screen paints out of the entry and no new
script is fetched.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
…path hash

esbuild's [hash] is over the metafile's input keys, which are paths relative to
absWorkingDir, so a checkout at another depth or with node_modules as a symlink
named a byte-identical chunk differently and shipped a different buildId for one
commit. Outputs are now renamed leaves-first to the sha256 of their final bytes.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
The guard ran only in a test while the docstring said it failed the build. It
now runs in bundleMobileWebApp and names the route and the export.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb

@pullfrog pullfrog 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.

ℹ️ No critical issues. The delta since the last review is clean — the guard rewrite reads names off esbuild's own parse and fails closed on export *, and I verified the metafile exports field and the star-export output shape directly against the pinned esbuild 0.25.12. Two documentation-accuracy notes below.

Reviewed changes

  • Guard reads the namespace, not source text — routeModuleNamedExports is replaced by routeModuleSynchronousExports, which parses each route with esbuild (bundle: false, metafile: true) so aliased, class, and re-exported names are all caught, and an unresolved export * is returned separately so the guard fails closed.
  • Chunk ceiling derived from the route count — MOBILE_WEB_APP_BUNDLE_MAX_CHUNKS = 64 becomes mobileWebAppBundleMaxChunks(routeCount) = 4 * routeCount + 16, and the verifier reads first.routeKeys.length off the fresh build.
  • Entry Suspense removed — RootProviders now renders <RpcClientProvider>{children}</RpcClientProvider>, relying on expo-router's per-screen boundary, pinned by a test against useScreens.js.
  • Render check refactor and navigation test — openPage/waitForRoute split out; a new test navigates via history.pushState + popstate and asserts a chunk is fetched and the tasks screen paints.

ℹ️ The PR description still describes the pre-refactor mechanism

Three claims in the PR body no longer match the branch head: it says RootProviders wraps children in one Suspense (removed in 2ee360a), names routeModuleNamedExports (renamed to routeModuleSynchronousExports in 27fdedcf), and lists MOBILE_WEB_APP_BUNDLE_MAX_CHUNKS = 64 as a verifier bound (replaced by mobileWebAppBundleMaxChunks in b399bb8). The "How" and "Bounds in the verifier" sections are the map a reviewer reads first, so refreshing them keeps the description from contradicting the code.

Technical details
# PR description is stale relative to the branch

## Affected sites
- PR body "How" — "`RootProviders` wraps children in one `Suspense`" (no longer true; `mobile/web-entry/index.tsx:19` has no boundary).
- PR body "How" — "`routeModuleNamedExports` in the manifest generator pins that" (renamed to `routeModuleSynchronousExports`).
- PR body "Bounds in the verifier" — "`MOBILE_WEB_APP_BUNDLE_MAX_CHUNKS = 64`" (replaced by `mobileWebAppBundleMaxChunks(routeCount)` in `config/scripts/verify-mobile-web-app-bundle.mjs:40`).

## Required outcome
- The description's mechanism and bounds sections match the branch head.

ℹ️ Nitpicks

  • mobile/web-entry/route-manifest.ts:5 still says the generated body replaces Metro's require.context with "the static imports esbuild needs"; the manifest now emits lazy import() entries, so "static" is no longer accurate.

Pullfrog  | Fix it ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

…e images

A flat 128 stopped agreeing with the chunk ceiling at 18 routes, where the asset
count would have failed first and named the count instead of the split. Chunks
plus images plus the document keeps the chunk ceiling the one that trips.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
The builder's test file passed 600 lines. The route manifest, the synthesized
RequireContext and the web entry are their own subject and move together.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
Without .js as jsx the guard reported a React Native .js route carrying JSX as
"JSX syntax extension is not enabled" instead of reading its exports.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
"some new script arrived" passed on any fetch. The builder now names the chunk
each route lands in, read off the metafile, and the check asserts that exact
path arrived and was not already loaded.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
esbuild writes metafile input keys after resolving symlinks, so every scratch
route tree under /var on macOS reached no output and failed the build.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
@Jinwoo-H

Copy link
Copy Markdown
Contributor Author

Round 2 fixed on bbce21ebf0 (7 commits): the builder renames every output to the sha256 of its final bytes, leaves first, rewriting importers' specifiers before hashing them (9dfe8fb7f5, two-depth test red on the old head); the export guard runs in the build and throws with route and export (f4a2ef7362); the asset ceiling is derived from the chunk ceiling + images + document (a54da95f6e); the guard shares the builder's loader table (04691eb647); the navigation test asserts the tasks route's own chunk (0570eb5e25); route-manifest tests split into their own file under the max-lines ceiling (b570a5e726); realpath fix for metafile keys under macOS /var (bbce21ebf0). Lead reproduced from a tree with a symlinked mobile/node_modules: buildId d469f32b…, identical to the lane's real-directory tree, where 9c01300d7b gave 0b80180e… vs c2683739…. 67 tests across the four mobile-web suites, mobile tsc 0, changed-code gate clean.

…'s map

The derived ceiling had no upper bound, and the native shells return null for a
manifest over their own 256 rather than truncating it. At 42 images the formula
crosses that at 50 routes, inside what Phase C adds, so the build would stay
green while the phone got nothing. The number is read from the contract through
esbuild, not restated here.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
Both throws only ran through a whole bundle before, where neither can be
provoked. A cycle and a route no output claims are now asserted directly; each
test goes red when its throw is removed.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
The route-export guard fails this script by design, and a raw stack put the
route and the export name under twelve frames of node internals. Mirrors the
verifier's exit; the message is printed as thrown because every throw on this
path already names its source.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
@Jinwoo-H

Copy link
Copy Markdown
Contributor Author

Round 3 fixed on 6ae587890d: the verifier fails when the derived asset ceiling passes MOBILE_WEB_BUNDLE_MAX_ASSETS from the shared manifest contract (8f81c730ca, green at 49 routes, red at 50; inflating the chunk formula makes a real run print 619 over 256); direct tests for the output-cycle and no-output throws (e15ef3282c); one-line builder exit (6ae587890d). Lead reproduced: build + verifier OK at d469f32b…, 70 tests across the four suites, mobile tsc 0, changed-code gate, oxlint clean.

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes

Delta since the prior pullfrog review at 9c01300 (7 commits, head bbce21e):

  • Content-hash output renaming — renameOutputsByContent renames every emitted output to the sha256 of its final bytes, leaves first, rewriting each importer's /assets/<child> specifier before hashing it, so buildId is a function of the bytes rather than of the checkout path. An output cycle throws.
  • Route-to-chunk lookup — routeChunkNames reads each route's owning output from the esbuild metafile inputs and realpathSyncs the route path before matching, covering scratch trees reached through a symlink.
  • Build-time export guard — assertRoutesCarryNoSynchronousExports now runs inside bundleMobileWebApp, so a route that grows unstable_settings/ErrorBoundary (aliased, class, re-exported, or via export *) fails build:mobile-web:app rather than only a test.
  • Shared route-source loaders — ROUTE_SOURCE_LOADERS is spread into both the guard's parse and the builder's loader table, with a parity test.
  • Derived asset ceiling — mobileWebAppBundleMaxAssets(routeCount, imageCount) replaces the flat 128, so the chunk ceiling always trips first and names the split rather than the count.
  • Test coverage — route-manifest tests split into their own file; the navigation test asserts the tasks route's own chunk arrives; a two-depth test pins path-independent naming.

I checked renameOutputsByContent directly against the pinned esbuild 0.25.12 on a split graph with a shared chunk: every output is named by the sha256 of its post-rewrite bytes and no stale /assets/<old> reference survives. The guard's build-time wiring and the path-independent buildId close the two substantive concerns from the earlier reviews.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes

Delta since the previous review at bbce21e (3 commits, head 6ae5878):

  • Asset ceiling bounded by the shell's own map — readMobileWebBundleMaxAssets evaluates MOBILE_WEB_BUNDLE_MAX_ASSETS from the shared manifest contract (esbuild-bundles the .ts, imports its data URL), and assertAssetCeilingFitsShell fails the verifier when 4r + 16 + images + 1 would exceed it. Since build:mobile-web:app is builder + verifier, this is a real build failure, not a comment.
  • Hard-stop coverage — direct tests for the two throws in the content-addressed naming: an output cycle and a route the metafile maps to no output.
  • One-line builder failure — the direct-invocation path catches, prints error.message, and exits 1 instead of surfacing a stack for the by-design route guards.

build-mobile-web-app-bundle.test.mjs passes locally (13 non-bundling tests, 25 bundling skipped without mobile deps), including the new ceiling boundary (49 routes → 255, 50 → 259 over 256) and both hard stops; oxlint is clean. The round-3 guard closes a gap the earlier rounds did not cover.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@Jinwoo-H
Jinwoo-H merged commit 209d2d8 into main Sep 18, 2026
30 checks passed
@Jinwoo-H
Jinwoo-H deleted the ota-c1-5-split branch September 18, 2026 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant