You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 4, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Nov 4, 2026. It is now read-only.
finding(app-shell): the injected <base href>'s trailing slash is an unstated invariant of the console-mount resolver family #5678
Measured while folding AiChatPage's publicShareBase into the shared resolver (#4482, PR #5677). Observation-class: nothing reachable is broken today, and no fix is proposed here.
What
consoleRoot() in packages/app-shell/src/console/organizations/resolveHomeUrl.ts is the single mount source for resolveHomeUrl / resolveRootUrl / resolveConsoleUrl, and now also for the share-link base. It resolves relative paths against the <base href> verbatim:
Every one of those helpers therefore silently depends on the injected href ending in /. Given <base href="/_console"> (no trailing slash), new URL('home', 'https://host/_console') resolves to https://host/home — HTML base-URL semantics drop the last segment — so org switching, the /home landing, resolveConsoleUrl('apps/…') and the share base would all leave the console mount at once.
Nothing in the tree asserts or normalizes that trailing slash.
Why it is only an observation
The single injector is packages/cli/src/utils/console.ts, which writes `<base href="${CONSOLE_PATH}/">` — the slash is a literal in the template, so today the invariant holds by construction. objectui ships no <base> tag in any HTML of its own (checked across apps/** and packages/**), and the CLI's injection is idempotent: it bails if the build already shipped one, which is the seam where a differently-shaped href could arrive from a host.
Note also that a slashless href would already break the SPA's relative asset URLs (./assets/…), so such a deployment is broken before it reaches these helpers. That is the argument for leaving consoleRoot() alone rather than adding normalization — the resolver following browser semantics is arguably correct, and "correct" here is a judgement call, not an obvious repair.
Two smaller shapes in the same family, recorded for completeness:
At origin "null" (a file:// or sandboxed-iframe document) consoleRoot() throws. WorkspaceSwitcher and OrganizationsPage already reach it there, so this is pre-existing and consistent, not new.
What could be done, if triage decides it is worth anything
Cheapest option is a one-line normalization in consoleRoot() (append / when the resolved pathname lacks one), which would make the family robust to a host-injected href of either shape. That is a behaviour change to /home and org-switch navigation, which is why PR #5677 did not smuggle it in under a share-link card. The alternative is to leave the code alone and write the invariant down where the CLI injects it.
changed the title [-]finding(app-shell): the injected `<base href>`'s trailing slash is an unstated invariant of the console-mount resolver family[/-][+]finding(app-shell): the injected base-href tag's trailing slash is an unstated invariant of the console-mount resolver family[/+]on Aug 22, 2026
changed the title [-]finding(app-shell): the injected base-href tag's trailing slash is an unstated invariant of the console-mount resolver family[/-][+]finding(app-shell): the injected `<base href>`'s trailing slash is an unstated invariant of the console-mount resolver family[/+]on Aug 22, 2026
Concentration-round first-touch (triage seat): closed not planned (maintainer may veto by reopening — reopening is free, the card is the record).
Reason: nothing reachable is broken and the invariant holds by construction — the single injector (packages/cli/src/utils/console.ts) writes the trailing slash as a template literal, objectui ships no <base> of its own, and a slashless deployment is already broken upstream of these helpers (relative asset URLs fail first). The card itself is the durable write-down of the invariant, which was its own second option. Reopen triggers, recorded concretely: a second base-href injection seam appears (a host shipping its own <base> past the CLI's idempotence bail), or a reproduced mis-mount traced to this resolution — either converts this from observation to defect and it re-grades toward the one-line normalization with its navigation-behaviour test.
Activity
[-]finding(app-shell): the injected `<base href>`'s trailing slash is an unstated invariant of the console-mount resolver family[/-][+]finding(app-shell): the injected base-href tag's trailing slash is an unstated invariant of the console-mount resolver family[/+][-]finding(app-shell): the injected base-href tag's trailing slash is an unstated invariant of the console-mount resolver family[/-][+]finding(app-shell): the injected `<base href>`'s trailing slash is an unstated invariant of the console-mount resolver family[/+]huangyiirene commentedon Aug 22, 2026
Concentration-round first-touch (triage seat): closed
not planned(maintainer may veto by reopening — reopening is free, the card is the record).Reason: nothing reachable is broken and the invariant holds by construction — the single injector (
packages/cli/src/utils/console.ts) writes the trailing slash as a template literal, objectui ships no<base>of its own, and a slashless deployment is already broken upstream of these helpers (relative asset URLs fail first). The card itself is the durable write-down of the invariant, which was its own second option. Reopen triggers, recorded concretely: a second base-href injection seam appears (a host shipping its own<base>past the CLI's idempotence bail), or a reproduced mis-mount traced to this resolution — either converts this from observation to defect and it re-grades toward the one-line normalization with its navigation-behaviour test.Generated by Claude Code