Skip to content

fix(welcome): the house derives its design-system URLs and types the prefix once - #138

Merged
rodrigoteamx merged 2 commits into
mainfrom
fix/the-house-derives-its-design-urls
Sep 11, 2026
Merged

rodrigoteamx merged 2 commits into
mainfrom
fix/the-house-derives-its-design-urls

Conversation

@rodrigoteamx

Copy link
Copy Markdown
Contributor

The page's <head> spelled /design/milpa-tokens.css, /design/milpa-fonts.css and /design/milpa-app-icon.svg, and the plugin spelled /design/ twice more in its route declarations. DesignTokens::urls() (live-web 0.27.0) takes a prefix and returns the whole set — including the fonts/ segment milpa-fonts.css asks for relatively.

🚨 This house is the evidence for why the typing mattered

/design/ was invented here in the same afternoon that /webauthn/, /admin/assets/ and /live/ already existed — by me, and I could not see the other three from where I was writing, because nothing this page imports mentions them. Four prefixes and nobody chose four.

A prefix per host is not the defect: it is a decision written where it is made (DesignTokens::iconLink() — each host serves these from its own asset route with its own cache policy), because a plugin whose pages work the moment it is installed cannot depend on another plugin's routes being mounted. HelloPlugin::designPrefix() now says it once, and the filenames come from the authority.

The route patterns stay local and should: one catch-all {file} here, five named routes in the passkey door, both right for their host. Only the prefix and the filenames moved.

Controls

testItLinksTheSystemThisHouseServes still asserts the three literal hrefs and passes untouched — the page's output did not move, its authority did. 170 tests (168 before), same 66 skips.

The new guard was probed with a regression in a form it was not written against — the prefix split from the filename by sprintf('%s/milpa-wordmark-light.svg', '/design'). Both halves fired. A guard is worth exactly one probe, and the probe has to differ from the thing the guard was written against.

Refs: greenhouse decisions/0308

…prefix once

The page's `<head>` spelled `/design/milpa-tokens.css`, `/design/milpa-fonts.css` and
`/design/milpa-app-icon.svg`, and the plugin spelled `/design/` twice more in its route
declarations. `DesignTokens::urls()` (live-web 0.27.0) takes a prefix and returns the whole set,
including the `fonts/` segment `milpa-fonts.css` asks for relatively — a host that flattens that
serves a stylesheet whose every `src` is a 404, which shows up as missing type rather than as an
error.

🚨 THIS HOUSE IS THE EVIDENCE FOR WHY THE TYPING MATTERED. `/design/` was invented here in the same
afternoon that `/webauthn/`, `/admin/assets/` and `/live/` already existed — by me, and I could not
see the other three from where I was writing, because nothing this page imports mentions them. Four
prefixes and nobody chose four. A prefix PER HOST is not the defect: it is a decision written where
it is made (`DesignTokens::iconLink()` — each host serves these from its own asset route with its own
cache policy), because a plugin whose pages work the moment it is installed cannot depend on another
plugin's routes being mounted. `HelloPlugin::designPrefix()` now says it once, and the filenames come
from the authority.

The route PATTERNS stay local and should: one catch-all `{file}` here, five named routes in the
passkey door, both right for their host. Only the prefix and the filenames moved.

Control: `testItLinksTheSystemThisHouseServes` still asserts the three literal hrefs and passes
untouched — the page's output did not move, its authority did. 170 tests (168 before), same 66 skips.

And the new guard was probed with a regression in a form it was NOT written against — the prefix
split from the filename by `sprintf('%s/milpa-wordmark-light.svg', '/design')`. Both halves fired. A
guard is worth exactly one probe, and the probe has to differ from the thing the guard was written
against.

Refs: greenhouse decisions/0308
CI went red here while this suite stayed green locally, and the red was not a defect of the branch:
`testRepairWithoutAPackageSaysHowItIsUsed` asserted `uso: coa repair` — `milpa/app-runtime`'s exact
copy, in the language it happened to be written in. That line was translated to English in
app-runtime v0.151.1, and this repo does not commit `composer.lock`, so CI resolves the newest
runtime while my local tree ran v0.151.0. A package behind the registry does not break the run; it
makes the suite lie — which is what `measure-lock-drift.php` exists to ask before trusting a green.

What the test actually cares about is that a bare `repair` REFUSES and names the argument it wanted.
The wording is app-runtime's to choose and to internationalize; asserting it here made this repo a
second owner of a string it does not write.

Verified both ways, since the local run and CI's are different runs: 170 tests / 367 assertions with
the lock's dependencies (66 skips, the opt-ins absent), and 170 / 625 with the six dev opt-ins CI adds
(2 skips) — the shape CI actually measures. Green in both.

Refs: greenhouse decisions/0308
@rodrigoteamx
rodrigoteamx merged commit aff0678 into main Sep 11, 2026
2 checks passed
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