Install this certificate to trust {_esc(hostname)} on this
device. This is a one-time step per device — not per visit.
On another device? Open this same page there:
+On another device? Open this same page there:
{_esc(request_url)}
diff --git a/ledger/checks/mutation_harness.py b/ledger/checks/mutation_harness.py index 7cc08ac..1f3c33d 100644 --- a/ledger/checks/mutation_harness.py +++ b/ledger/checks/mutation_harness.py @@ -421,12 +421,22 @@ def _mo002_alias_becomes_a_bespoke_hue(w: World) -> None: w.replace(WEBTHEME, "--amber:var(--alarm);", "--amber:#D9A253;") -def _mo003_retired_palette_removed(w: World) -> None: - """FIXED: the specimen a calm pixel sweep would catch is tokenised.""" +def _mo003b_the_retired_palette_returns(w: World) -> None: + """The retired pre-blend-3 ground comes back to webpwa.py's offline body. + + DIRECTION NOTE, stated rather than hidden: OSV1-003's declared direction is + VIOLATION-MOVEMENT (it is still VIOLATION -- a calm L1 still paints + `--blocked`, which `_mo003_the_calm_page_stops_painting_blocked` is the + counterfactual for). This mutation pushes the OTHER way, and it is here on + purpose: the row's two palette specimens + CLOSED on 2026-09-05 (OSV1-005), so its probe stopped pinning them as + present and started guarding that they stay gone. A guard nobody has + watched fail is a guard that might assert nothing. + """ w.replace( WEBPWA, - "background:#0D0D0C;color:#F2EEE6;", - "background:var(--color-ground);color:var(--ink-primary);", + '\'\' +', + "'
' +", ) @@ -438,39 +448,31 @@ def _mo004_a_status_loses_its_word(w: World) -> None: w.replace(WEBBROWSE, '"open": "READY",', '"open": "",') -def _mo005_the_worst_literal_site_is_migrated(w: World) -> None: - """FIXED (partially): the retired-palette inline body is tokenised, so the - census drops from 66 to 65 and the named specimen leaves the bucket. +_LITERAL_INLINE_SITE = "\n_LEDGER_MUTATION = ''\n" +#: A page-local stylesheet, exactly the shape webtrust.py used to ship: its own +#: `:root` re-declaring role tokens as literal hexes. +_PAGE_LOCAL_SHEET = ( + '\n_LEDGER_MUTATION_CSS = ""\n' +) - BOTH halves of that one site must go: it carries a literal COLOUR pair AND - a literal `font:16px`/`padding:32px`. Replacing only the palette left the - site in the LITERAL bucket and the count unchanged at 66 -- the harness - caught that as a non-discriminating mutation, which is what it is for. - """ - w.replace( - WEBPWA, - "background:#0D0D0C;color:#F2EEE6;", - "background:var(--color-ground);color:var(--ink-primary);", - ) - w.replace(WEBPWA, "font:16px -apple-system,sans-serif;padding:32px;", "") +def _mo005_a_literal_inline_site_returns(w: World) -> None: + """REGRESSION: one inline `style=` attribute carries a literal colour again. -def _mo005b_the_page_local_palette_goes(w: World) -> None: - """FIXED (the OTHER half): webtrust.py's page-local `" + + __all__ = [ "CSS", "ICONS", + "TOKENS_CSS", "TRACK_W", + "TRUST_CSS", "age_band_class", "age_cell_html", "age_short", @@ -4346,4 +4612,5 @@ def state_html(kind: str, label: str) -> str: "state_html", "statusbar", "top_bar", + "trust_style_tag", ] diff --git a/src/amplifier_work_tracker/webtrust.py b/src/amplifier_work_tracker/webtrust.py index d63163d..1f4c9bd 100644 --- a/src/amplifier_work_tracker/webtrust.py +++ b/src/amplifier_work_tracker/webtrust.py @@ -63,6 +63,7 @@ from fastapi.responses import HTMLResponse, JSONResponse, RedirectResponse from starlette.responses import Response +from . import webtheme as T from . import webtls as WT # --------------------------------------------------------------------------- @@ -246,61 +247,29 @@ def _build_mobileconfig(ca_cert_path: Path) -> bytes: # --------------------------------------------------------------------------- -# Page rendering -- self-contained inline CSS (never imports `webtheme.CSS`; -# this is a separate tiny app, deliberately independent of the dashboard's -# own module graph). Colors are the same "J-editorial-dark" tokens as the -# dashboard (`webtheme.py`'s `:root`), copied here as plain values rather -# than shared, so this module has zero import-time dependency on webapp.py. +# Page rendering. This module ships NO stylesheet of its own. +# +# It used to: an inline stylesheet block right here re-declaring the whole +# role set (--ground / --raise / --ink / --mid / --quiet / --amber / --rule / +# --rule-hi) as its own literal near-black-and-warm-amber values -- the +# retired pre-blend-3 palette -- explicitly so it would not have to import +# `webtheme`. That independence bought one import edge and cost a second +# source of visual truth, which then drifted three palette generations behind +# the live `--color-ground:#05070f` without anyone noticing. operator-surface.v1 +# Core 4 forbids exactly that -- a stylesheet block outside the token module. +# +# The sheet now lives in `webtheme.TRUST_CSS`, composed from the SAME +# `TOKENS_CSS` the dashboard uses, and `webtheme.trust_style_tag()` emits the +# whole style element -- so there is no stylesheet, and no style tag, anywhere +# in this file. `webtheme` is a leaf module (stdlib only, no FastAPI, +# no `webapp`), so importing it costs this app nothing at import time. +# +# The page stays SELF-CONTAINED, which it must: the sheet is INLINED into the +# document, never fetched. A device reading this page has not installed the CA +# yet -- an external asset link would be a broken fetch at the worst possible +# moment. # --------------------------------------------------------------------------- -_CSS = """ -:root{ - --ground:#0D0D0C; --raise:#151513; --ink:#F2EEE6; --mid:#A6A199; - --quiet:#9C978F; --amber:#D9A253; --rule:#1F1F1D; --rule-hi:#333330; -} -*{box-sizing:border-box} -body{ - background:var(--ground); color:var(--ink); margin:0; padding:52px 24px 80px; - font-family:'Helvetica Neue',Arial,sans-serif; line-height:1.55; -} -main{max-width:640px;margin:0 auto} -h1{ - font-family:Georgia,'Bodoni Moda',serif; font-weight:500; font-size:32px; - margin:0 0 10px; color:var(--ink); -} -p{margin:0 0 14px} -p.subtle{color:var(--mid)} -p.lead{color:var(--ink); font-size:16px; margin:18px 0} -code{ - font-family:ui-monospace,'SFMono-Regular',Menlo,Consolas,monospace; - background:var(--raise); color:var(--amber); padding:2px 6px; border-radius:4px; - font-size:0.88em; word-break:break-all; -} -.btn{ - display:inline-block; background:var(--amber); color:var(--ground) !important; - font-weight:600; padding:12px 22px; border-radius:6px; text-decoration:none; - margin:6px 10px 6px 0; font-size:15px; -} -.btn.secondary{background:transparent; color:var(--amber) !important; border:1px solid var(--amber)} -.formsec{ - border:1px solid var(--rule-hi); border-radius:8px; padding:18px 20px; margin-top:20px; - background:var(--raise); -} -.formsec.highlight{border-color:var(--amber)} -.flegend{ - font-size:12px; text-transform:uppercase; letter-spacing:0.06em; color:var(--quiet); - display:block; margin-bottom:6px; -} -details{color:var(--mid); margin-top:16px} -details summary{cursor:pointer; color:var(--amber); margin-bottom:8px} -details .formsec{margin-top:10px} -.url-box{ - background:var(--raise); border:1px solid var(--rule); border-radius:6px; - padding:12px 16px; word-break:break-all; font-family:ui-monospace,Menlo,monospace; - font-size:14px; color:var(--ink); -} -""" - def _esc(value: object) -> str: return html.escape("" if value is None else str(value), quote=True) @@ -323,7 +292,7 @@ def _ca_install_section(*, os_hint: str) -> str:{primary_instr}
-+
Download CA certificate {mobileconfig_btn}
@@ -340,7 +309,7 @@ def _trust_page_html( ) -> str: https_url = f"https://{hostname}:{https_port}/" continue_btn = ( - f''
+ f'"
)
@@ -371,7 +340,7 @@ def _trust_page_html(
Install this certificate to trust On another device? Open this same page there: On another device? Open this same page there: {_esc(request_url)}{_esc(hostname)} on this
device. This is a one-time step per device — not per visit.Activity feed '
+ '
Activity feed '
"cross-project · reverse-chronological "
'
'
'