fix(welcome): the house derives its design-system URLs and types the prefix once - #138
Merged
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The page's
<head>spelled/design/milpa-tokens.css,/design/milpa-fonts.cssand/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 thefonts/segmentmilpa-fonts.cssasks 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
testItLinksTheSystemThisHouseServesstill 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