Repository navigation
feat(mobile): the shell tells a page which optional capabilities it has (OTA phase D, C8.1) - #22141
Conversation
…(OTA phase D, C8.1) `routeViewOf` handed the manifest's own route entries to the host as `pageRouteGrants`. The phone reads a manifest route loosely, so an entry arrives carrying whatever field the desktop that wrote it knew about, and `BridgePageRouteGrantsSchema` is `.strict()`: one unread key refuses the pairs, `createBridgeHost` refuses the route with them, and the page gets no `init` at all rather than losing one field. Fixed before any route carries an optional grant (ruling 37.4), so the manifest field the next commits add costs an installed shell nothing. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
Scratch measurements for C8.1 (which route closures reach the HTML preview, and what the preview render rig costs to bundle with a client provider). They belong outside the repository and were swept in by the previous commit's `git add -A`. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
… D, C8.1) Design B of design-ota-c8-1.md, ruling 37. `MobileWebBundleRouteSchema` grows `optionalGrants` under the required lane's own grammar, with the 16-name ceiling applied over the union of the two lists rather than to each. Serving a route still reads `grants` alone, so a capability a screen cannot work without stays required and takes the route native; a session's granted list is `[...grants, ...optionalGrants]` narrowed to what this shell implements, from one helper that both `grantsForRoute` and the `pageRouteGrants` publish read. The ruling's compatibility rationale is corrected in place. `z.looseObject` passes unknown members through rather than dropping them (measured, zod 4.4.3), so a shell older than the field still receives the key; what it lacks is a policy that reads one. What makes the lane safe against such a shell is therefore the previous commit's publish fix, not the reader. BRIDGE_PROTOCOL_VERSION stays 1. No new notify, verb or frame field. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
…ant (OTA phase D, C8.1) `externalNavigation` joins `MOBILE_WEB_SHELL_GRANTS` beside `screencastBinary` and `haptics`, declared in `cancelled-navigation-target.ts` because that is the module holding the rule which acts on it. A third token that is neither a verb nor a notify: the page posts nothing to make a cancelled top-frame navigation happen, so this list is the only thing that can tell a page whether a tap inside the sealed HTML-preview frame escapes at all. A constant and not a platform read (ruling 37.1): both engines dispatch the event, `ios/MobileWebShellView.swift:481` and Android's `MobileWebShellView.kt:382`, so an app build carries the behaviour on both or on neither. The policy census grows the half that was only pinned by the verb table: the implemented set is that table plus exactly three non-verb tokens, each read off the module that declares it. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
…TA phase D, C8.1) `resolveMobileWebPageRoutes` maps each declaration member by member, so a field the declaration grows reaches a phone only once the map names it: until now `optionalGrants` would have been dropped in silence and every route would have declared nothing optional. Omitted when the route declares none, because absent and empty are the same answer to a shell. The declaration suite grows the rule rather than a row: the map carries the lane through and writes no key without one, and the lane is held to the manifest's own grammar and to the ceiling over the union of the two lists. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
… open one (OTA phase D, C8.1) The session route declares `externalNavigation` on the optional lane, and the preview asks for it before it renders an artifact's links as links. Ruling 37.2's three readings are what "hide" means here, and removing `href` is what delivers all three at once: `a:any-link` stops matching, so the UA stylesheet stops underlining, the element leaves the tab order, and there is no dead anchor a tap does nothing on. The text the author wrote stays where it was, the artifact paints, and the Preview/Source toggle is untouched. Done with the browser's own parser rather than over the source text: an `href` inside a comment or a `<template>` is text to a browser, and a pass that rewrote either would be editing the artifact instead of its links. The frame also loses `allow-top-navigation-by-user-activation` on that path, so a link the pass somehow missed is refused by the browsing context as well. One route, measured rather than assumed: the design said two, and the file preview route's closure does not reach the HTML preview at all - it renders `MobileFilePreviewScreen`. The new closure census derives that list from the hook's callers. The render rig grows the case on both engines and the readings it needs, and `mobile-web-app-preview-frame-readings.mjs` is split out of it at the readings/arms boundary, because the two were over the 600-line cap together. Two engine findings are recorded in the rig: an `<a>` with no `href` still answers `tabIndex` 0 on both, so focusability is asked by focusing; and WebKit computes `cursor: auto` for a real link, so that reading is pinned where it discriminates and its blindness pinned where it does not. The hop-coverage census now reads the effective set, because that is what the running rule compares. Inert today: the session route is the only declarer and an opener into every other route. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
… can reach it (OTA phase D, C8.1) The mobile suite runs in a `node` environment whose resolver has no `.web` precedence, so `MobileHtmlPreview.web.tsx`'s import of the grant hook lands on the native sibling, which answers yes unconditionally. That is why the existing component suite still measured the granted frame without knowing a grant exists, and it means the hidden path had no coverage in the sharded `test` job, where the render rig is skipped for want of the bundler's dependencies. So the wiring gets its own file with the module replaced: that the component asks, and that both the frame's sandbox and the document it is handed follow the one answer. happy-dom rather than the suite default, because the inerting pass parses with the browser's own `DOMParser`. `String(node.type)` rather than a literal comparison: `node.type` is `ElementType`, which overlaps a real intrinsic tag and not the host strings these mocks render, so `=== 'Pressable'` is a no-overlap error under `tsconfig.test.json` and the tests-typecheck ratchet reds on it. Also replaces a `Reflect.get` the anti-slop gate refuses with an `in` check. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
…e modules Measured on both sides with `mobileWebAppRouteClosure(SESSION_ROUTE)` at base `841d06a969` with all five postinstall generators run first, and the two `local` lists diffed rather than the total inferred: 4,359 -> 4,362 modules, 1,017 -> 1,020 local. All three are local source modules and none is vendored: the page's read of `init.grants.native`, the pass that turns an artifact's links back into text without the grant, and the module declaring the token beside the rule that acts on it - reached both by that hook and by `page-route-policy.ts`. The `bridge-caps.ts` it imports was already in this closure, and the hook's native sibling is replaced rather than joined. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
…overrides `mobile-web-app-web-overrides.test.mjs` pins the allowlist against the `.web.*` files on disk, so a new web sibling reds it until the file says why the page needs one. Red before: `expected [ …(36) ] to deeply equal [ …(37) ]`, naming `src/components/use-html-preview-link-grant.web.ts`. The preview's own entry is corrected with it: its reason said `allow-top-navigation-by-user-activation` is granted, and that token is now conditional on the shell answering that it can open such a navigation. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
One conflict, and it is the session page closure pin: main repinned it to 4,360 for #21705's Antigravity option catalog while this branch repinned it to 4,362 for C8.1's three preview modules. Both provenance paragraphs are kept in merge order, main's first, and the pin is the merged head's own measurement rather than the sum - 4,363 modules and 1,021 local, with all five postinstall generators run first. The arithmetic agrees with that measurement this once, because the two additions are disjoint: main's one module is the option catalog and this branch's three are the preview's, so neither side counts the other's. Said explicitly because this file's history is a list of occasions when summing did not survive. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
…ading (round 1) CI's chromium arm timed out at the full 240 s on this case alone while the WebKit sibling passed in 1.5 s and it passed 26/26 locally. The cause is the third arm: it tapped the granted link and waited through `expectNavigation: 'main-frame'`, and `waitForRecordedNavigation` has no bound but the case's own timeout. Under CI load the click missed its 2 s actionability window, no navigation was ever recorded, and the arm sat in that wait until vitest gave up - `recorded []`, with the frame attached only at 38.9 s. Three arms sharing one budget is what made this the case to find it. The arm is dropped rather than its wait lengthened or retried. Every verdict left is a reading the frame itself publishes: the anchors its document holds, the style the engine computed for one, whether focus lands on it, and now whether the tap this arm made landed at all - `actError` is asserted null, so a click that never reached its target is no longer the same three zeros as a tap that did nothing. Nothing is lost. The tap's outcome on a granted shell is the next case, on these same counters from this same rig and with a budget of its own, which is the presence precondition this file already uses elsewhere for the same reason. The WebKit sibling's discriminating reads are untouched. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
There was a problem hiding this comment.
ℹ️ Minor suggestions — one inline note on the link pass and one nitpick in the body.
Reviewed changes
This is the initial pullfrog review of #22141 at c165fda, covering all 26 changed files and all 10 commits (including the merge of main b9643365ba).
- Optional lane on a manifest route —
MobileWebBundleRouteSchemagainsoptionalGrants, with one ceiling overgrants + optionalGrantsand the per-array caps kept; the desktop builder maps it explicitly and the phone's loose reader carries it. - One computation for a session's grants —
effectiveRouteGrantsmerges both lanes narrowed to what the shell implements;grantsForRouteandrouteViewOfread it while route serving still readsgrantsalone. - Publishing built pairs —
routeViewOfmaps each entry to{pathname, grants}so an unread desktop key cannot reach the strictBridgePageRouteGrantsSchemaand refuse the whole session. externalNavigation— a bare-token grant declared beside the cancelled-navigation rule, added toMOBILE_WEB_SHELL_GRANTS, and declared on the session route's optional lane only.- The preview's hide path — a web-only hook reads
init.grants.native; without the token the artifact is re-serialized with link affordances removed and the frame is sealed with an empty sandbox. - Censuses and the render rig — a closure-derived route census, updated hop-coverage and session-closure pins, and a Chromium/WebKit arm for the hidden versus granted frame.
I traced the same-version path end to end and it is sound: declaration → manifest → loose read → effectiveRouteGrants → init.grants.native → the hook. The mixed-version refusal for a pre-PR shell (forwarded entries vs. the strict pair schema) is real, but the PR already states it and pins the safety argument to mobileWebShellFlagCanBeOn(), so I have not re-raised it.
ℹ️ Nitpicks
mobile/src/components/html-preview-link-affordance.test.tsx:122-137— the "shows the source the author wrote, not the rewrite" assertion cannot fail:renderSourceis called with no arguments and this test's closure hardcodesARTIFACT, sosource[0].props.htmlis always the original regardless of what the component does. ThetoHaveLength(1)half does pin that Source mode rendersrenderSource(); thehtmlassertion adds no coverage.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (4)
Included review availability: Your plan provides up to 10 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughThe mobile web route manifest now supports optional grants. The session route declares Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to The optional navigation capability and inert-link behavior are ready to merge, with no remaining merge-blocking risk identified. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Description checkExplanation The description gives detailed technical context and verification results, but it does not follow several required template sections. It lacks explicit ELI5, Linked Issue with a Resolution Add the missing template sections. Include the linked issue using
✨ Finishing Touches📝 Generate docstrings
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: cde14df6-8589-449c-bbf5-b239da5c511a
📒 Files selected for processing (26)
config/scripts/build-mobile-web-app-bundle.mjsconfig/scripts/mobile-web-app-external-navigation-grant.test.mjsconfig/scripts/mobile-web-app-html-preview-render.test.mjsconfig/scripts/mobile-web-app-page-grant-call-sites.mjsconfig/scripts/mobile-web-app-page-grant-call-sites.test.mjsconfig/scripts/mobile-web-app-preview-artifact-fixture.mjsconfig/scripts/mobile-web-app-preview-frame-readings.mjsconfig/scripts/mobile-web-app-session-terminal-closure.test.mjsconfig/scripts/mobile-web-page-route-hop-coverage.test.mjsconfig/scripts/mobile-web-page-routes.mjsconfig/scripts/mobile-web-page-routes.test.mjsmobile/src/components/MobileHtmlPreview.web.tsxmobile/src/components/html-preview-inert-links.test.tsmobile/src/components/html-preview-inert-links.tsmobile/src/components/html-preview-link-affordance.test.tsxmobile/src/components/use-html-preview-link-grant.tsmobile/src/components/use-html-preview-link-grant.web.test.tsxmobile/src/components/use-html-preview-link-grant.web.tsmobile/src/mobile-web-shell/bridge-host-init.test.tsmobile/src/mobile-web-shell/cancelled-navigation-target.tsmobile/src/mobile-web-shell/page-route-policy.test.tsmobile/src/mobile-web-shell/page-route-policy.tsmobile/src/transport/mobile-web-bundle-reply-schemas.tsmobile/web-entry/web-overrides.jsonsrc/shared/mobile-web-bundle/manifest-contract.test.tssrc/shared/mobile-web-bundle/manifest-contract.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review.
There was a problem hiding this comment.
ℹ️ No new issues in the round-1 CI fix. The earlier inline note on same-document fragment links is still open, so this is not an approval.
Reviewed changes
Re-reviewed the one commit that landed since the prior pullfrog review at c165fda — a test-only fix to the HTML-preview render rig. No production surface.
- Dropped the render case's third arm — the hidden-link case had three arms sharing one 240 s budget; the third tapped the granted link and waited on
waitForRecordedNavigationviaexpectNavigation: 'main-frame', a wait bounded only by the case timeout. On CI's Chrome under load the click missed its 2 s actionability window, nothing was recorded, and the arm burned the whole budget. The arm is dropped rather than lengthened or retried, and the granted tap's outcome is still covered byhands a user's tap on a link to the top frame, exactly onceon the same counters. - Asserted the click landed —
expect(hidden.actError).toBeNull()now runs before the navigation counters, so a click that never reached its target can no longer read as a tap that did nothing. - Comments rewritten — the case's docstring and the engine-split comment now record why the case has two arms, that the dropped arm's coverage lives in the next case, and that the round-1 finding is the unbounded navigation wait.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
|
The 240 s timeout was fixed in a8811c5 (the tapping arm dropped; every remaining verdict is a reading the frame publishes). The four findings on the inert-link pass are being folded as round 2: the pass must not change the artifact's rendering (fragment links kept, declarative shadow roots covered, doctype preserved whole, leading newlines kept). |
…t the links (round 2) Round 2's ruling: the hidden-link path may change nothing about the artifact's rendering except that links are not links. A parse and a reserialise is not free of that by default, and all four findings reproduced on Chromium 147 and WebKit 26.4. A same-document fragment link is kept. It starts no navigation at all, so it goes on working inside the sealed frame whatever the shell can do, and taking it away would be degradation over a capability it never needed - an artifact's own table of contents is the case. Its `target` still goes, because a fragment aimed at another frame is a navigation rather than a scroll, and `href=""` is not a fragment: it resolves to the frame's own URL. Links inside `template.content` are reached, recursively. `<template shadowrootmode>` is a declarative shadow root the frame's parser attaches and renders, and `querySelectorAll` does not walk into template content, so those links arrived live inside a sandbox that refuses their navigation - the dead anchor ruling 37.2 forbids. Measured: `parseFromString` attaches no such root on either engine or in happy-dom, so the pass can reach them. The leading newline of a `pre`, `listing` or `textarea` is written back. A parser drops one after the start tag and the serialiser is specified to put it back; measured, neither engine's does, so a round trip lost a blank line from every such block. The doctype is carried whole, and the reason is corrected from the one the finding gave. It cannot move this frame between layout modes: a `srcdoc` document takes its mode from its embedder, and measured, a quirks doctype, the bare name and no doctype at all all read `CSS1Compat` inside the frame. What rewriting it does is change the document the author wrote for no reason, with `document.doctype` observable beside a Source tab showing the original. The render case pins `compatMode` as the blind reading it is and reads the frame's own doctype identifiers as the one that discriminates. Option B was not available: the frame has no `allow-scripts` and inherits `script-src 'self'`, so nothing runs inside it and there is no injection to carry the work. Also drops a vacuous half of the affordance test. `renderSource()` is called with no argument, so the markup a Source view shows is the caller's own closure and asserting it equals the fixture passed whatever the component did. What the component decides is whether the rewritten frame stays mounted underneath, and that is what is read now. `mobile-web-app-preview-arm-driver.mjs` is split out of the render rig at the boundary the readings module already names - the rig holds what each case claims, the driver how an arm is driven, the readings what it reports - since the three were over the 600-line cap together. No max-lines disable or bump. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
There was a problem hiding this comment.
Important
One must-address finding inline: the fragment-link carve-out assumes a same-document scroll that a srcdoc frame does not have, so the hidden path now leaves a link that navigates the preview away.
Reviewed changes
Re-reviewed the round-2 commit since the prior pullfrog review at a8811c5f94 — the link pass's rendering-lossless rework, the render-rig split, and the test replacement.
- Fragment links kept —
html-preview-inert-links.tskeepshrefon#-prefixed links and removes onlytarget, on the premise that a fragment is a same-document scroll. - Declarative shadow roots walked —
template.contentis traversed recursively, so links a browser would render from a shadow root are inerted. - Doctype serialized whole —
publicId/systemIdcarried through, with the quote character chosen for the content. - Leading newline restored — the newline a parser eats after
pre/listing/textareais written back before serialization. - Rig split — the arm driver moved to
mobile-web-app-preview-arm-driver.mjsand the readings tomobile-web-app-preview-frame-readings.mjs, with newcompatMode,doctypePublicId/doctypeSystemId,preTextandfragmentHrefreadings. - Vacuous affordance assertion replaced — the Source-view case now reads whether the frame is unmounted instead of asserting a hardcoded closure.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
…o it is inerted too (round 3)
pullfrog is right, reproduced on both engines before believing it. Round 2
kept `#`-prefixed hrefs on the theory that they are same-document scrolls. In
this frame they are not: the document's URL is `about:srcdoc` while its base
URL is inherited from the embedder, so `#section` resolves against the shell's
own URL and the destination differs from the document's by more than a
fragment - which makes activating it a frame navigation, and the shipped
`frame-src 'none'` refuses it.
Measured under the shipped policy, one tap, with something to scroll:
Chromium 147 scrollY 0, frame becomes chrome-error://chromewebdata/,
artifact gone, embedder reports frame-src <origin>/preview
WebKit 26.4 scrollY 0, frame stays about:srcdoc and intact, same report
So the destruction is Chromium-only but the absence of a scroll is not: there
was no working affordance to carve out for, and the carve-out left a live link
that destroys the preview - worse than the inert text it was meant to avoid.
Both sandbox values behave the same, so this is the base URL and the policy
rather than the sandbox.
The same tap does the same thing on the granted path, where this pass does not
run, so an artifact's internal links have never worked in the preview. That is
not this change's to fix; it is recorded in
`followup-html-preview-fragment-links.md`, and the render case reads the
granted arm's violation as its presence precondition so the behaviour is
pinned rather than merely known.
Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Re-reviewed the round-3 commit d16fb01ce7 since the prior pullfrog review at 761e7c766f — the fix that closes the round-2 must-address finding, plus its unit and render-rig coverage. Four files, all of it the fragment-link fix and the tests that pin it; no new production surface.
- Fragment links are inerted too —
htmlPreviewWithInertLinksdrops thehrefOfcarve-out and now stripshref(andxlink:href) from everya/area, withtargetstill removed; the text and the named target stay. - The premise is measured, not assumed — the render rig taps
#fraglinkin a tall artifact on both engines, pins the granted arm'sframe-srcviolation as the presence precondition, then reads the hidden arm's silence:fragmentHrefnull, noframe-src, artifact still mounted,scrollY0, no top-frame navigation and no popup. - Two new frame readings —
baseUriandscrollYinmobile-web-app-preview-frame-readings.mjs, which is what tells a fragment navigation apart from a same-document scroll. - Unit cases retargeted — the fragment carve-out cases become "a fragment link is inerted too", keeping the text/target assertions and extending the shadow-root case to the nested fragment link.
- Pre-existing granted-path bug scoped out — the same tap destroys the preview on the granted path, where the pass does not run; it is recorded as a follow-up rather than fixed here, and the granted arm's violation is what makes the hidden arm's absence a reading rather than a rig that cannot watch.
Both prior pullfrog threads on this PR are resolved, and the round-2 must-address finding is fixed by d16fb01ce7.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
C8.1 (#22141) gave the manifest route an `optionalGrants` lane and put `externalNavigation` on the session route. Three files conflicted, all of them prose this branch had already rewritten. Resolved by taking both intents. The route table keeps this branch's corrected three-verb dictation sentence -- main's side still carried the four-verb text #22072 made stale -- and gains C8.1's `externalNavigation` paragraph whole. The call-site census and its test keep this branch's counts and gain the new grant: `externalNavigation` has a census of its own, so the set this file does not repeat grows from five to six while the rows here still pin eight of the session route's thirteen required grants. The census follows the tables rather than the prose: `censusedElsewhere` counts the required and optional grants no row pins, which is the set that sentence is about, and the route table's census gains a row for C8.1's "the one optional grant in this list". Every spelled count is true on the merged table; the fence is untouched because C8.1 added modules and no route, so the tree still builds 15 routes into 67 scripts against the envelope's 71. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb

The shell tells a page which optional capabilities it has (OTA phase D, C8.1)
Design B of
design-ota-c8-1.md, adopted as ruling 37. A manifest route may now declareoptionalGrantsbesidegrants: the required lane still decides whether a route is served at all,and the optional lane joins only the list a session is granted. The page keeps its one question —
"is this name in
init.grants.native" — which is thescreencastBinaryprecedent, and that readstops being always-true.
externalNavigationis the lane's first user. The HTML preview renders an agent's artifact in asealed frame, and a tap on a link inside it becomes a top-frame navigation only the shell can cancel
and open. A shell built before that event drops the navigation in silence, so the page asks first
and renders the artifact's links as text when the answer is no: the document paints, the
Preview/Source toggle works, and nothing offers a tap that does nothing (ruling 37.2).
BRIDGE_PROTOCOL_VERSIONstays 1. No new notify, verb, frame field or enum member, and no typeassertion. Nothing under
mobile/rpc-foundation/is touched and no golden digest moved.Two findings that change what the ruling rests on
The compatibility rationale in the design and the ruling is false as written, and the conclusion
survives for a different reason. Both say the phone's loose route reader "drops the unknown
field". It does not:
z.looseObjectpasses unknown members through rather than stripping them(measured on zod 4.4.3, and pinned by a case). So a shell older than the field still receives the
key; what such a shell lacks is a policy that reads one, which is why it serves the route on its
required list and grants nothing extra. What does not survive is the publish: an entry carrying the
field reaches the strict pair schema, which refuses it and takes the whole
initwith it. Soruling 37.4's publish fix is the compatibility argument, not a tidy-up before it — and a shell
already shipped with the pass-through publish would take every page route native on a manifest
carrying the field, rather than granting nothing extra. No such shell exists, and the last section
says why.
The design says two preview routes declare the token; the measurement says one. Only
/h/[hostId]/session/[worktreeId]'s closure reaches the HTML preview, throughMobileSessionActiveContentandMobileSessionFileReader. The file preview route rendersMobileFilePreviewScreen, which has no HTML preview in its closure at all. The new closure censusderives that list from the hook's callers rather than restating it.
Per commit
b08ab16029routeViewOfbuilds thepageRouteGrantspairs it publishes instead of forwarding manifest entries. Red before:Unrecognized key: "optionalGrants"fromBridgePageRouteGrantsSchema, and end to end throughcreateBridgeHostthe route is refused outright —expected [ Array(1) ] to deeply equal []onrouteRefusals, with nothing posted.e153e5c6a2git add -Aswept into the commit above. No amend, per the lane rules.d12c619199optionalGrantsonMobileWebBundleRouteSchemaunder the required lane's grammar, with the 16-name ceiling over the union; the phone reads the field;effectiveRouteGrantsis the one place a session's list is computed, read by bothgrantsForRouteand the publish. Red before:expected [ { …(2) } ] to deeply equal [ { …(1) } ]— the union was not granted; and on the ceiling, two lanes of 8 and 9 names each passed a per-array cap that bounds 16.e9486a3821externalNavigationjoinsMOBILE_WEB_SHELL_GRANTS, declared incancelled-navigation-target.ts. A constant, not a platform read (ruling 37.1): both engines dispatch the event. Red before: the implemented-set census listed thirteen names and no third non-verb token.c60f9ac269resolveMobileWebPageRoutescarries the field through, and omits the key for a route with none. Red before: the map returned{ pathname, grants }and the optional lane never reached a phone.c6a6cf5b35expected 4 to be 0on the rendered document'sa[href]count, and the tapped link produced one top-frame navigation on a shell that could not open it.a203a30e1enoderesolver has no.webprecedence, so the component under test otherwise reaches the native hook and the hidden arm is unreachable — which also means the shardedtestjob had no coverage of it, the render rig being skipped there. Red before: the wiring had no test that ran without a browser.9c2a2659af841d06a969with all five generators run first and the twolocallists diffed. Red before:expected [ …(4362) ] to have a length of 4359.5ec3230bfe.web.*sibling, and corrects the preview's own allowlist reason, which claimedallow-top-navigation-by-user-activationis granted when the token is now conditional. Red before:expected [ …(36) ] to deeply equal [ …(37) ].c165fda3d9b9643365ba. One conflict, the session closure pin: main repinned it to 4,360 for #21705's Antigravity option catalog while this branch repinned it to 4,362. Both provenance paragraphs kept in merge order, main's first, and the pin is the merged head's own measurement — 4,363 / 1,021 local. Red before resolution: the conflict markers themselves.How "hide" is measured
Ruling 37.2 names three things, and all three follow from one property: whether the element is a
link at all. Removing
hrefis what delivers them —a:any-linkstops matching, so the UAstylesheet stops underlining, the element leaves the tab order, and there is nothing to activate.
Done with the browser's own parser rather than over the source text, because an
hrefinside acomment or a
<template>is text to a browser and a pass that rewrote either would be editing theartifact instead of its links. The frame also loses
allow-top-navigation-by-user-activationonthat path, so a link the pass missed is refused by the browsing context as well; neither fence is
the other's excuse.
Three readings, three places:
html-preview-inert-links.test.ts— which attribute went, and what survived (comment, template,image map, inline SVG, doctype).
html-preview-link-affordance.test.ts— that the component asks, and that both the sandbox andthe document follow the answer. Its own file because this suite's
noderesolver has no.webprecedence, so the component under test otherwise reaches the native hook and the hidden path is
unreachable.
mobile-web-app-html-preview-render.test.mjs— what Chromium and WebKit paint and do, with thegranted arm as each reading's presence precondition.
Two engine findings are recorded in the rig. An
<a>with nohrefstill answerstabIndex0 onboth engines, so focusability is asked by focusing rather than by reading the property. And WebKit
computes
cursor: autofor a real link — it resolves the link cursor at hit test — so that readingonly discriminates on Chromium; it is pinned where it does and its blindness pinned where it does
not, with the underline, the missing anchor and the tap carrying the case on WebKit.
mobile-web-app-preview-frame-readings.mjsis split out of the render rig at the readings/armsboundary: the two were over the 600-line cap together, and no
max-linesdisable or per-file bumpwas added.
Verification
Every gate run from the tree root on the reported head, exit code read off the command.
tsc --noEmitoxlintandoxfmt --checkErrorsline, exit 0config/scriptssuiteErrorsline, exit 0check-changed-code-quality.mjs 841d06a969check-react-doctor-changed.mjs 841d06a969oxfmt --check, changed files/Users/ororca-lanesin committed filesmax-linesdisables or bumps addedThe merge with main
Main
b9643365bais merged in, never rebased. It conflicts on exactly one line: both sides repinnedthe session page closure, main to 4,360 for #21705's Antigravity option catalog and this branch to
4,362 for the preview's three modules. Resolved by keeping both provenance paragraphs in merge
order, main's first, and re-measuring the constant on the merged head with all five postinstall
generators run first.
841d06a969b9643365baThe arithmetic agrees with the measurement this once, and only because the two additions are
disjoint: main's one module is the option catalog and this branch's three are the preview's, so
neither side counts the other's. Worth saying, because this file's history is a list of occasions
when summing did not survive.
Re-run on the merged head, sequentially, exit code off each command:
config/scriptssuiteErrorsline, exit 0Errorsline, exit 0The compatibility finding, as the lead resolved it
The addendum to ruling 37 records it: no released shell reaches the pass-through publish, because
the hybrid-shell flag cannot be on in a store build (
mobileWebShellFlagCanBeOnis false there), sono phone in the field runs it. The flip build carries
b08ab16029. The finding stands as the reasonthe publish fix is the compatibility argument rather than a tidy-up, and the risk it named is closed
by that flag rather than by the reader.
Lead gate on
c165fda3d9againstb9643365ba: tsc 0, ratchet 0, all lint gates 0 (25 changed files), changed-code quality passed, React Doctor 0;config/scripts252 files passed; mobile 811 files passed; no machine paths. Closure 4,363 reproduced by the lead and the three joining modules named by diffing against main's list.Round 1 (CI)
a8811c5f94: the Chromium case's third arm tapped the granted link under an unbounded navigation wait; under CI load the click missed its actionability window and the arm burned the case's 240 s (Error: Test timed out in 240000ms, recorded[]). The arm is dropped, not lengthened or retried: every verdict left is a reading the frame publishes (anchors, computed style, focusability), and the click'sactErroris asserted null so a tap that never landed no longer reads like a tap that did nothing. Render rig three times on both engines: 26 passed each. Lead gate ona8811c5f94againstb9643365ba: all gates 0;config/scripts252 files; mobile 811 files; no machine paths. The unboundedwaitForRecordedNavigationis filed as a rig follow-up.Round 2: the pass changes nothing an engine renders but the links
761e7c766f. Four review findings, one cause: the pass parses the artifact and serialises it again,and a round trip is not free of the artifact's rendering by default. All four reproduce on Chromium
147 and WebKit 26.4.
#idlinks work inside the sealed frame; stripping one takes an artifact's own table of contents away over a capability it never neededtargetstill removed, because a fragment aimed at another frame is a navigation rather than a scroll<template shadowrootmode>is attached and rendered by the frame's parser, andquerySelectorAlldoes not walk template content, so those links arrived live inside a sandbox that refuses them -- the dead anchor ruling 37.2 forbidstemplate.contentwalked recursivelypreleading newline droppedOption B was not available. The frame has no
allow-scriptsand inheritsscript-src 'self',so nothing runs inside it and there is no injection to carry the work. Running one would mean
unsealing the frame, which is the thing the design exists to avoid. So the boundary is A: keep the
DOM pass and make it rendering-lossless.
The doctype finding's stated consequence does not hold here, and the fix stays anyway. A
srcdocdocument takes its rendering mode from its embedder whatever its own doctype says: measuredon both engines, a quirks doctype, the bare name and no doctype at all all read
CSS1Compatinsidethe frame. So rewriting it cannot move this artifact between layout modes. What it does is rewrite
the document the author wrote for no reason, with
document.doctypeobservable beside a Source tabshowing the original. The render case pins
compatModeas the blind reading it is, and reads theframe's own doctype identifiers as the one that discriminates.
The vacuous half of
html-preview-link-affordance.test.tsxis replaced rather than patched.renderSource()is called with no argument, so the markup a Source view shows is the caller's ownclosure and asserting it equals the fixture passed whatever the component did. What the component
decides is whether the rewritten frame stays mounted underneath, and that is what is read now.
mobile-web-app-preview-arm-driver.mjsis split out of the render rig at the boundary the readingsmodule already names: the rig holds what each case claims, the driver how an arm is driven, the
readings what it reports. The three were over the 600-line cap together. No
max-linesdisable andno per-file bump.
Round-2 verification
config/scriptssuiteErrorsline, exit 0tsc, tests-typecheck ratchetcheck-changed-code-quality.mjs b9643365bacheck-react-doctor-changed.mjs b9643365bamax-lines, type assertions addedOne flake to record rather than hide: the first full
config/scriptsrun after this commit failedtwo files neither of which this branch touches --
ci-e2e-shard-selection.test.mjstimed out at60 s and
mobile-web-app-frame-budget-sweep.test.tsread0.006for a sweep expecting> 0.4.Both passed run alone and the whole suite passed on the immediate re-run, so it is intra-suite
contention on this machine rather than a break.
Lead gate on 761e7c7 against b964336 (gate-c8-1-761e7c766f.log): tsc 0, ratchet 0, changed-code quality 0, react-doctor 0, anti-slop 0, root-format 0 (14 files), max-lines 0, root-oxlint 0 (26 files), config/scripts 252 passed / 2 skipped, mobile 811 passed, machine-paths 0.
Round 3: a fragment link is a frame navigation, not a scroll
d16fb01ce7. Round 2 kept#-prefixed hrefs on the theory that they are same-document scrolls.Reproduced on both engines before believing it, and pullfrog is right: in this frame they are not.
The document's URL is
about:srcdocwhile its base URL is inherited from the embedder, so#sectionresolves against the shell's own URL. The destination differs from the document's by morethan a fragment, which makes activating it a frame navigation, and the shipped
frame-src 'none'refuses it.
One tap under the shipped policy, with a tall document so there was something to scroll:
scrollYafterchrome-error://chromewebdata/about:srcdocframe-src <origin>/previewframe-src <origin>/previewThe destruction is Chromium-only; the absence of a scroll is not. Both sandbox values behave the
same, so this is the base URL and the policy rather than the sandbox. So there was no working
affordance to carve out for, and the carve-out left a live link that destroys the preview — worse
than the inert text it was meant to avoid. Fragment links are inerted like every other.
Red, both engines, against the round-2 carve-out: the hidden arm's
expected [ 'img-src', 'font-src', …(2) ] to not include 'frame-src'. At the unit level,expected <a id="frag" href="#target"></a> to have a length of +0 but got 1.Pre-existing, recorded rather than fixed. The same tap does the same thing on the granted path,
where this pass does not run, so an artifact's internal links have never worked in the preview. The
render case reads the granted arm's violation as its presence precondition, so the behaviour is
pinned rather than merely known, and the decision a fix would need is written up in
followup-html-preview-fragment-links.md.Round-3 verification
config/scriptssuiteErrorsline, exit 0Errorsline, exit 0tsc, tests-typecheck ratchetcheck-changed-code-quality.mjs b9643365bacheck-react-doctor-changed.mjs b9643365ba, anti-slopmax-linesLead gate on d16fb01 against b964336 (gate-c8-1-d16fb01ce7.log): tsc 0, ratchet 0, changed-code quality 0, react-doctor 0, anti-slop 0, root-format 0 (14 files), max-lines 0, root-oxlint 0 (26 files), config/scripts 252 passed / 2 skipped, mobile 811 passed, machine-paths 0.