Skip to content

fix(mobile): declare externalLink on the two page routes that reach the protocol wall (OTA phase C follow-up) - #22113

Merged
Jinwoo-H merged 3 commits into
mainfrom
ota-fu-external-link-grants
Sep 22, 2026
Merged

Jinwoo-H merged 3 commits into
mainfrom
ota-fu-external-link-grants

Conversation

@Jinwoo-H

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

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​42 $\color{#cf222e}{\Huge{\mathbf{−}}}$​32 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​10
Prod 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​14 $\color{#cf222e}{\Huge{\mathbf{−}}}$​15 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1

Summary

Two page routes reached the external-link wall without declaring the grant.

app/h/_layout.tsx wraps every /h route in HostProtocolGate, whose ProtocolBlockScreen opens its Update Orca link through openExternalLink. /h/[hostId] and agent-history did not declare externalLink, so that tap posted a notify the shell refuses, with nothing on screen to say why. The grant call-site census recorded the gap as an exact allowance (KNOWN_UNDECLARED, from C7.7) rather than enforcing it.

Removing the allowance reds the census, naming each route; declaring the grant greens it. The census measures one call site in each closure, src/components/ProtocolBlockScreen.tsx.

Repinned by measurement: the route-list pin, and the handed-off hop census, which goes 23 rows to 19. The four rows that leave are these two routes into the file explorer and its preview: all four routes now declare the same four grants, so a tapped file stays in the document instead of costing a native frame and a second bridge session. A new case asserts that coverage, so the four absences are load-bearing rather than indistinguishable from an unregistered route.

No wire change, no golden movement, no closure pin moved (the census finds no new module).

Pre-existing prose left alone, filed: the session entry's comment says "Fourteen grants" where the list holds 13 and "the four audio verbs" where there are three (since #22072).

Commits

sha change red before
99809972ad test: drop the KNOWN_UNDECLARED allowance from the grant call-site census 1 failed / 19 passed, naming both routes
e1b5abb32a fix: declare externalLink on /h/[hostId] and agent-history; route-list and hop pins repinned by measurement
f1de85f822 merge of origin/main (15472cd4c6), no conflicts

Gates

Lane gates all exit 0 on f1de85f822 (config/scripts 249 passed; mobile 804 files / 8,965 passed). Lead gate at base 15472cd4c6 below.

Lead gate on f1de85f822 against 15472cd4c6: all lint gates 0; config/scripts 249 files passed; mobile 804 files passed; no machine paths.

…reaches

The grant call-site census carried an exact allowance for the two routes
that reach the shared protocol wall's `openExternalLink` without
declaring `externalLink`. Removing it makes the census enforce the
declaration instead of recording the gap; it now names both routes.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
Both routes render the shared layout's `HostProtocolGate`, whose
`ProtocolBlockScreen` opens its Update Orca link through
`openExternalLink`, and neither declared the grant: the tap posted a
notify the shell refuses, with nothing on screen. The census measures one
call site in each closure, `src/components/ProtocolBlockScreen.tsx`.

Repinned by measurement, with the manifest change named: the route-list
pin, and the handed-off hop census, which goes 23 rows to 19. The four
rows that leave are these two routes into the explorer and its preview —
all four now declare the same four grants, so a tapped file stays in the
document instead of costing a native frame and a second bridge session. A
new case asserts that coverage, so the four absences are load-bearing.

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

coderabbitai Bot commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

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 configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 1d9db6ee-ec67-48b3-ae9e-907edeb12959

📥 Commits

Reviewing files that changed from the base of the PR and between 15472cd and f1de85f.

📒 Files selected for processing (5)
  • config/scripts/mobile-web-app-handoff-grants-render.test.mjs
  • config/scripts/mobile-web-app-page-grant-call-sites.test.mjs
  • config/scripts/mobile-web-page-route-hop-coverage.test.mjs
  • config/scripts/mobile-web-page-routes.mjs
  • config/scripts/mobile-web-page-routes.test.mjs

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


📝 Walkthrough

Walkthrough

The host and agent-history mobile routes now declare externalLink. Manifest and route-grant tests expect the new grant. Call-site tests no longer allow undeclared externalLink exceptions. Hop-coverage tests remove explorer and preview handoffs and verify that both opener routes cover their grants.

Priority: ⬇️ Low

Severity of issue fixed: Low

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the technical change, rationale, tests, commits, and gate results, but it omits most required template sections, including ELI5, What Changed, Why, Linked Issue with a Fixes r… Rewrite the description using the repository template. Add all required headings and content. Include the linked issue in the required format, provide visual proof or state N/A with a reason, document manual and automated testing, complete …
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 5 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the primary change: declaring the externalLink grant on two mobile page routes. It is specific and related to the changeset.
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.
Full details: Description check

Explanation

The description explains the technical change, rationale, tests, commits, and gate results, but it omits most required template sections, including ELI5, What Changed, Why, Linked Issue with a Fixes reference, Visual Proof or N/A, Testing checkboxes, AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklist.

Resolution

Rewrite the description using the repository template. Add all required headings and content. Include the linked issue in the required format, provide visual proof or state N/A with a reason, document manual and automated testing, complete the review and compatibility sections, and check or explain each checklist item.

  • 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.

@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

  • externalLink granted on the two wall-reaching routes. /h/[hostId] and /h/[hostId]/agent-history/[worktreeId] in config/scripts/mobile-web-page-routes.mjs now declare externalLink, so HostProtocolGate's ProtocolBlockScreen Update Orca tap reaches openExternalLink instead of posting a notify the shell refuses with nothing on screen. externalLink already exists in MOBILE_WEB_SHELL_GRANTS (page-route-policy.ts:20), so negotiation is unaffected.
  • The allowance is gone. mobile-web-app-page-grant-call-sites.test.mjs drops KNOWN_UNDECLARED and asserts [] for every grant row, so any future undeclared call site reds. I confirmed this can fail — striking the grant re-adds <route> needs externalLink.
  • Hop census repinned by measurement. HANDED_OFF goes 23→19, removing the four /h/[hostId] and agent-history hops into the explorer and its preview, now that all four routes declare the same four grants. A new case asserts that coverage so the absences stay load-bearing.
  • Pins resynced. EXPECTED_PAGE_ROUTES and the handoff render fixture's PAGE_ROUTE_GRANTS carry the new grant.

I ran pnpm test config/scripts/mobile-web-page-route-hop-coverage.test.mjs config/scripts/mobile-web-page-routes.test.mjs (pass); the call-site census and render tests describe.skip locally without mobile/node_modules and run in CI's mobile_web_app job.

ℹ️ The layout has a second externalLink opener the census cannot see

The comments rewritten here now describe the protocol wall as the route's opener. That is what the census measures, but the shared sidebar's New Workspace source field is also an externalLink consumer on every /h route — host-screen-overlays.tsx passes openExternalUrl={openExternalLink} as a prop down to SmartWorkspaceSourceField.tsx:82, which calls it. moduleReachesGrantRow only counts a direct openExternalLink(...) call, so this site goes unreported. Both openers are now covered by the same grant, so nothing is broken; the note is only that the "single opener" phrasing is less complete than the comment it replaced.

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

@Jinwoo-H
Jinwoo-H merged commit e1c8df4 into main Sep 22, 2026
31 checks passed
@Jinwoo-H
Jinwoo-H deleted the ota-fu-external-link-grants branch September 22, 2026 00:20
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