branded-chrome: assertBrandedChrome's page.request theming-logo GET reds — the community gate session cookie is gone by the time it fires, even though the immediately-prior /settings/admin navigation proved it live #658

Closed
opened 2026-08-22 11:32:32 +00:00 by matou-build-agent · 8 comments

Failure

branded-chrome leg (drive 20260822T111032Z, sig c898f3073ff4) reds in assertBrandedChrome (app/tests/e2e/fixtures/provision.ts:963-977): page.request.get(doorPath(door, '/index.php/apps/theming/image/logo')) returns 200 with 2846 bytes of text/html; charset=utf-8, not the 70-byte uploaded PNG. Step 1 of the same assertion (the occ config:list theming proof over SSH, provision.ts:927-955) already passed — logoMime: image/png was confirmed stored server-side (droplet-journal.txt:1921 Updated logoMime to image/png). So the theming push itself (DDR 0147/#356 mechanism, internal/clan/files.go:401-457 renderNextcloudBrand) landed correctly. The fault is in reaching the served bytes, not in producing them.

Evidence chain

  1. droplet-journal.txt:1958-1973 — at 11:20:47-49 the ceremony page's oidc-admin leg (provision.ts:558-582, oidcSignInAsOperator + assertOperatorIsAdmin) completes a full gate-oidc authorize (state=e358b9a2..., kanidm returns 303 directly — its SPA auto-completed via an existing local session) followed by Nextcloud's own user_oidc login. assertOperatorIsAdmin (provision.ts:799-830) then does a real page.goto('/settings/admin') and asserts resp.ok() AND landedUrl.endsWith('/settings/admin') — since /settings/admin sits behind the same ungated-nowhere forward_auth (internal/clan/frontdoor.go:412-439 renderRoute, no exempt paths for this route), this proves the community SSO session cookie (idss_session, internal/controlapi/session.go:142-153) was valid at that moment.
  2. ~9 seconds later, branded-chrome's step 1 runs an unrelated SSH occ config:list (droplet-journal.txt:1986-1987, 11:20:56).
  3. droplet-journal.txt:1995 (11:20:57) — step 2's page.request.get() to the theming image triggers a brand-new gate-oidc authorize attempt (fresh state=fe95ca69..., fresh PKCE) that kanidm answers with status_code: 200 and ERROR: Invalid identity: NotAuthenticated — i.e. Caddy's forward_auth (internal/clan/frontdoor.go:428-437) found no valid idss_session cookie for this specific request and redirected to /authz/signin (internal/controlapi/signin.go), and kanidm itself also saw no active browser session. The 200/HTML response IS kanidm's /ui/oauth2 SPA shell — a plausible match for "2846 bytes text/html".
  4. Direct evidence from the run's captured Electron profile (test-results/.../state/Cookies, the ceremony window's real Chromium cookie DB): at end-of-run it holds only the transient flow cookies from the failed 11:20:57 attempt — idss_authz_flow (host rehearsal-b.idss.nz, path /authz) and kanidm's own o2-authreq (host .id.rehearsal-b.idss.nz) — both created at exactly 11:20:57.044-069. There is no idss_session cookie anywhere in the store, despite step (1) proving one was live only ~9 seconds earlier. It was never written, or was written and then lost, before the theming-image GET.

Compounding factor (not the root cause, but sharpens the failure mode)

Kanidm's /ui/oauth2 authorize endpoint only auto-completes via client-side JS reading a stored session token (that's why the earlier real-navigation flows show either a single 303 hit — JS ran, auto-completed — or a 200 SPA-shell then a follow-up hit). page.request.get() is a bare HTTP fetch with no JS execution, so if forward_auth ever redirects it into this path, it can never complete the flow — it always dead-ends on the SPA shell. This makes assertBrandedChrome's use of page.request.get() against a gated route (provision.ts:963) fragile even for a transient session hiccup: a real page.goto() would self-heal (kanidm's stored session auto-completes it), but the bare API fetch cannot.

Suspected layer

Either (a) internal/controlapi/signin.go (signinCallback, line 202) / session.go (SessionCookie) has a narrow window where the minted idss_session cookie doesn't durably land in the browser's cookie store after a rapid preceding gate-oidc round trip, or (b) something in the app/ceremony window between the oidc-admin and branded-chrome test steps drops it. I could not pin down which — the trace.zip network capture only covers the unrelated fresh throwaway browser from the branded-login step (a different browser entirely, cookie-less by design), not the ceremony window's own traffic, so I have no packet-level view of the actual /authz/callback response that should have minted the cookie at ~11:20:48.

What plugging it needs

Live reproduction on a droplet with the ceremony window's own network/cookie tracing enabled (or added), to see: does /authz/callback actually issue Set-Cookie: idss_session=... on this run, and if so, why does it not persist ~9 seconds later. This is a session/auth-timing bug spanning Caddy forward_auth, kanidm's OIDC flow, and the control-plane's cookie minting — not a mechanical fix I can make or verify from static logs on this dev machine.

Signature: c898f3073ff4

drive 20260822T111032Z red at branded-chrome: the theming logo served 2846 bytes as "text/html; charset=utf-8" — not the 70 uploaded logo bytes; the DDR 0147 logo-bytes push did not land the operator's mark on the files surface (#364)
evidence: test-results/…/20260822T111032Z/ on matou-workstation (legs.json, droplet-journal.txt, trace) — a representative screenshot is attached here if one was captured (#596)

## Failure `branded-chrome` leg (drive `20260822T111032Z`, sig `c898f3073ff4`) reds in `assertBrandedChrome` (app/tests/e2e/fixtures/provision.ts:963-977): `page.request.get(doorPath(door, '/index.php/apps/theming/image/logo'))` returns 200 with **2846 bytes of `text/html; charset=utf-8`**, not the 70-byte uploaded PNG. Step 1 of the same assertion (the `occ config:list theming` proof over SSH, provision.ts:927-955) already passed — `logoMime: image/png` was confirmed stored server-side (droplet-journal.txt:1921 `Updated logoMime to image/png`). So the theming push itself (DDR 0147/#356 mechanism, internal/clan/files.go:401-457 `renderNextcloudBrand`) landed correctly. The fault is in reaching the served bytes, not in producing them. ## Evidence chain 1. **droplet-journal.txt:1958-1973** — at 11:20:47-49 the ceremony page's `oidc-admin` leg (provision.ts:558-582, `oidcSignInAsOperator` + `assertOperatorIsAdmin`) completes a full gate-oidc authorize (`state=e358b9a2...`, kanidm returns 303 directly — its SPA auto-completed via an existing local session) followed by Nextcloud's own user_oidc login. `assertOperatorIsAdmin` (provision.ts:799-830) then does a real `page.goto('/settings/admin')` and asserts `resp.ok()` AND `landedUrl.endsWith('/settings/admin')` — since `/settings/admin` sits behind the same ungated-nowhere `forward_auth` (internal/clan/frontdoor.go:412-439 `renderRoute`, no exempt paths for this route), this proves the community SSO session cookie (`idss_session`, internal/controlapi/session.go:142-153) was valid at that moment. 2. **~9 seconds later**, branded-chrome's step 1 runs an unrelated SSH `occ config:list` (droplet-journal.txt:1986-1987, 11:20:56). 3. **droplet-journal.txt:1995** (11:20:57) — step 2's `page.request.get()` to the theming image triggers a **brand-new** gate-oidc authorize attempt (fresh `state=fe95ca69...`, fresh PKCE) that kanidm answers with `status_code: 200` and `ERROR: Invalid identity: NotAuthenticated` — i.e. Caddy's forward_auth (internal/clan/frontdoor.go:428-437) found no valid `idss_session` cookie for this specific request and redirected to `/authz/signin` (internal/controlapi/signin.go), and kanidm itself also saw no active browser session. The 200/HTML response IS kanidm's `/ui/oauth2` SPA shell — a plausible match for "2846 bytes text/html". 4. **Direct evidence from the run's captured Electron profile** (`test-results/.../state/Cookies`, the ceremony window's real Chromium cookie DB): at end-of-run it holds **only** the transient flow cookies from the *failed* 11:20:57 attempt — `idss_authz_flow` (host `rehearsal-b.idss.nz`, path `/authz`) and kanidm's own `o2-authreq` (host `.id.rehearsal-b.idss.nz`) — both created at exactly 11:20:57.044-069. There is **no `idss_session` cookie anywhere in the store**, despite step (1) proving one was live only ~9 seconds earlier. It was never written, or was written and then lost, before the theming-image GET. ## Compounding factor (not the root cause, but sharpens the failure mode) Kanidm's `/ui/oauth2` authorize endpoint only auto-completes via **client-side JS** reading a stored session token (that's why the earlier real-navigation flows show either a single 303 hit — JS ran, auto-completed — or a 200 SPA-shell then a follow-up hit). `page.request.get()` is a bare HTTP fetch with **no JS execution**, so if forward_auth ever redirects it into this path, it can *never* complete the flow — it always dead-ends on the SPA shell. This makes `assertBrandedChrome`'s use of `page.request.get()` against a gated route (provision.ts:963) fragile even for a *transient* session hiccup: a real `page.goto()` would self-heal (kanidm's stored session auto-completes it), but the bare API fetch cannot. ## Suspected layer Either (a) `internal/controlapi/signin.go` (`signinCallback`, line 202) / `session.go` (`SessionCookie`) has a narrow window where the minted `idss_session` cookie doesn't durably land in the browser's cookie store after a rapid preceding gate-oidc round trip, or (b) something in the app/ceremony window between the `oidc-admin` and `branded-chrome` test steps drops it. I could not pin down which — the trace.zip network capture only covers the *unrelated* fresh throwaway browser from the `branded-login` step (a different browser entirely, cookie-less by design), not the ceremony window's own traffic, so I have no packet-level view of the actual `/authz/callback` response that should have minted the cookie at ~11:20:48. ## What plugging it needs Live reproduction on a droplet with the ceremony window's own network/cookie tracing enabled (or added), to see: does `/authz/callback` actually issue `Set-Cookie: idss_session=...` on this run, and if so, why does it not persist ~9 seconds later. This is a session/auth-timing bug spanning Caddy forward_auth, kanidm's OIDC flow, and the control-plane's cookie minting — not a mechanical fix I can make or verify from static logs on this dev machine. **Signature:** `c898f3073ff4` drive `20260822T111032Z` red at `branded-chrome`: `the theming logo served 2846 bytes as "text/html; charset=utf-8" — not the 70 uploaded logo bytes; the DDR 0147 logo-bytes push did not land the operator's mark on the files surface (#364)` evidence: `test-results/…/20260822T111032Z/` on matou-workstation (legs.json, droplet-journal.txt, trace) — a representative screenshot is attached here if one was captured (#596) <!-- rehearsal-sig: c898f3073ff4 -->
Author
Member

Static-evidence pass + one instrumentation commit — ADR 0174 (agent ruling, veto anytime)

I worked this against the evidence already on disk (test-results/drive-droplet/20260822T111032Z/ is reachable from this session at /home/dev/swarm/Matou/idss/test-results/... — same host family as matou-workstation) before reaching for a fresh live drive, since the ticket's own "what plugging it needs" already named the open questions precisely.

Ruled out (with proof, no live drive needed)

  1. Short session TTL. gateSessionTTL = 12 * time.Hour (control-plane/cmd/control-plane/main.go:90) — nowhere near the ~9s gap in the evidence chain.
  2. Control-plane secret rotation via restart. droplet-journal.txt shows exactly one stable idss-control-plane.service process (PID 2400, started 11:17:36, composition_whole=true) running continuously through both the successful oidc-admin exchange (11:20:47-49) and the failed theming request (11:20:57) — no intervening restart that could have rederived the session-signing secret.
  3. A Playwright/Electron page.request cookie-sharing gap (my own leading hypothesis going in, given the ceremony window is _electron.launch()-driven). Traced the pinned playwright-core@1.62.1 source directly (node_modules/.pnpm/playwright-core@1.62.1/...lib/coreBundle.js): ElectronApplication._browserContext = browser._defaultContext is a REAL BrowserContext (the same CRBrowser class regular Chromium tests use), and page.request against it resolves to BrowserContextAPIRequestContext, whose .cookies()/_updateRequestCookieHeader() read LIVE off this._context.cookies(...) (a CDP query of the actual browser's jar) — the exact same source a real page.goto() would consult. Confirmed this is BrowserContextAPIRequestContext, not the standalone GlobalAPIRequestContext (which DOES carry a private, potentially-stale cookie mirror — that class is used only for playwright.request.newContext(), not page.request). So a red here is not test-tooling noise; the browser's live jar genuinely had no valid idss_session at request time, corroborating the ticket's evidence chain rather than explaining it away.
  4. Weakened, not ruled out: the Cookies-sqlite-flush-delay theory. I considered whether the captured state/Cookies db (evidence point 4) merely lagged Chromium's batched SQLite commit rather than reflecting the live jar. Checked directly (sqlite3 state/Cookies): the two flow cookies it DOES hold (idss_authz_flow, o2-authreq, both is_persistent=1) were written at 11:20:57.04x and the run continued for minutes after (logs go to 11:32) — so the persistent-cookie flush path clearly works within this run's lifetime, and idss_session (also MaxAge-persistent, 12h) had ample time to have been flushed too, had it still been live. This weakens but doesn't fully retire the theory — I did not get a byte-level trace of the flush itself.

What's still open

Whether idss_session was genuinely never retained by the browser after the oidc-admin callback, or was cleared by something between the two requests — I could not get the one piece of evidence that settles it: a live read of the browser's actual cookie jar (or the raw Set-Cookie header off /authz/callback) at the moment of the theming request. Getting that needs either a live droplet or the local-guest QEMU path (scripts/smoke-private-path.sh --drive nextcloud --target local-guest, which drives the identical assertOperatorIsAdmin → assertBrandedChrome sequence via provision-nextcloud.live.spec.ts at no cloud cost) — and this session-runner container cannot do either: systemctl --user here reports Failed to connect to bus: No medium found (no user systemd session, so the QEMU guest machinery can't run), and this container's hostname is matou-dev-server-01, not matou-workstation — a fresh droplet spin-up is normally the standing rehearsal-executor.sh cron's job, not an ad hoc diagnostic session's, and I didn't judge it right to improvise around that gap for a one-off investigation.

What I landed instead (two-way door: a commit to a test fixture, revertible, provable by the next drive)

246dc4ae — assertBrandedChrome (app/tests/e2e/fixtures/provision.ts) now reads page.context().cookies(...) for idss_session immediately before firing the theming GET — the same live read the request itself performs — and folds the result into both failure messages. This doesn't require me to trigger anything: the standing rehearsal-executor.sh cadence will run journey.droplet.spec.ts again on its own schedule, and if this leg reds again the ticket filing will carry the answer (present-with-expiry, or absent-plus-what-else-is-in-the-jar) directly, closing the exact gap the "what plugging it needs" section named — no separate live-tracing session required to even SEE the evidence next time.

Ruling

Two-way door under ADR 0174 (a revertible test-fixture commit) — landed. The live-reproduction root-cause work itself is NOT a human judgement call (no credentials/posture/trust-surface/data-destruction/hardware involved), so I'm leaving this ready-for-session rather than ready-for-human: the next session that picks it up should have matou-workstation-level access (or genuine systemd --user access to run the local-guest path) and can read straight off the next branded-chrome red — automatic or hand-triggered — for the now-instrumented answer, rather than re-deriving items 1-4 above.

## Static-evidence pass + one instrumentation commit — ADR 0174 (agent ruling, veto anytime) I worked this against the evidence already on disk (`test-results/drive-droplet/20260822T111032Z/` is reachable from this session at `/home/dev/swarm/Matou/idss/test-results/...` — same host family as matou-workstation) before reaching for a fresh live drive, since the ticket's own "what plugging it needs" already named the open questions precisely. ### Ruled out (with proof, no live drive needed) 1. **Short session TTL.** `gateSessionTTL = 12 * time.Hour` (`control-plane/cmd/control-plane/main.go:90`) — nowhere near the ~9s gap in the evidence chain. 2. **Control-plane secret rotation via restart.** `droplet-journal.txt` shows exactly one stable `idss-control-plane.service` process (PID 2400, started 11:17:36, `composition_whole=true`) running continuously through both the successful `oidc-admin` exchange (11:20:47-49) and the failed theming request (11:20:57) — no intervening restart that could have rederived the session-signing secret. 3. **A Playwright/Electron `page.request` cookie-sharing gap** (my own leading hypothesis going in, given the ceremony window is `_electron.launch()`-driven). Traced the pinned `playwright-core@1.62.1` source directly (`node_modules/.pnpm/playwright-core@1.62.1/...lib/coreBundle.js`): `ElectronApplication._browserContext = browser._defaultContext` is a REAL `BrowserContext` (the same `CRBrowser` class regular Chromium tests use), and `page.request` against it resolves to `BrowserContextAPIRequestContext`, whose `.cookies()`/`_updateRequestCookieHeader()` read LIVE off `this._context.cookies(...)` (a CDP query of the actual browser's jar) — the exact same source a real `page.goto()` would consult. Confirmed this is `BrowserContextAPIRequestContext`, not the standalone `GlobalAPIRequestContext` (which DOES carry a private, potentially-stale cookie mirror — that class is used only for `playwright.request.newContext()`, not `page.request`). So a red here is not test-tooling noise; the browser's live jar genuinely had no valid `idss_session` at request time, corroborating the ticket's evidence chain rather than explaining it away. 4. **Weakened, not ruled out: the Cookies-sqlite-flush-delay theory.** I considered whether the captured `state/Cookies` db (evidence point 4) merely lagged Chromium's batched SQLite commit rather than reflecting the live jar. Checked directly (`sqlite3 state/Cookies`): the two flow cookies it DOES hold (`idss_authz_flow`, `o2-authreq`, both `is_persistent=1`) were written at 11:20:57.04x and the run continued for minutes after (logs go to 11:32) — so the persistent-cookie flush path clearly works within this run's lifetime, and `idss_session` (also `MaxAge`-persistent, 12h) had ample time to have been flushed too, had it still been live. This weakens but doesn't fully retire the theory — I did not get a byte-level trace of the flush itself. ### What's still open Whether `idss_session` was genuinely never retained by the browser after the `oidc-admin` callback, or was cleared by something between the two requests — I could not get the one piece of evidence that settles it: a live read of the browser's actual cookie jar (or the raw `Set-Cookie` header off `/authz/callback`) at the moment of the theming request. Getting that needs either a live droplet or the local-guest QEMU path (`scripts/smoke-private-path.sh --drive nextcloud --target local-guest`, which drives the identical `assertOperatorIsAdmin` → `assertBrandedChrome` sequence via `provision-nextcloud.live.spec.ts` at no cloud cost) — **and this session-runner container cannot do either**: `systemctl --user` here reports `Failed to connect to bus: No medium found` (no user systemd session, so the QEMU guest machinery can't run), and this container's hostname is `matou-dev-server-01`, not `matou-workstation` — a fresh droplet spin-up is normally the standing `rehearsal-executor.sh` cron's job, not an ad hoc diagnostic session's, and I didn't judge it right to improvise around that gap for a one-off investigation. ### What I landed instead (two-way door: a commit to a test fixture, revertible, provable by the next drive) `246dc4ae` — `assertBrandedChrome` (`app/tests/e2e/fixtures/provision.ts`) now reads `page.context().cookies(...)` for `idss_session` **immediately before** firing the theming GET — the same live read the request itself performs — and folds the result into both failure messages. This doesn't require me to trigger anything: the standing `rehearsal-executor.sh` cadence will run `journey.droplet.spec.ts` again on its own schedule, and if this leg reds again the ticket filing will carry the answer (present-with-expiry, or absent-plus-what-else-is-in-the-jar) directly, closing the exact gap the "what plugging it needs" section named — no separate live-tracing session required to even SEE the evidence next time. ### Ruling Two-way door under ADR 0174 (a revertible test-fixture commit) — landed. The live-reproduction root-cause work itself is NOT a human judgement call (no credentials/posture/trust-surface/data-destruction/hardware involved), so I'm leaving this `ready-for-session` rather than `ready-for-human`: the next session that picks it up should have matou-workstation-level access (or genuine `systemd --user` access to run the local-guest path) and can read straight off the next `branded-chrome` red — automatic or hand-triggered — for the now-instrumented answer, rather than re-deriving items 1-4 above.
Author
Member

session-runner: two unattended attempts did not advance this ticket — labelled agent-blocked for a human look (ADR 0174 escalation). Latest session log: /home/dev/.local/state/matou-session-runner/logs/run-658-20260822T134007Z.log on the workstation. Remove agent-blocked (and the stale fail counter if re-arming by hand) to let the runner retry.

session-runner: two unattended attempts did not advance this ticket — labelled `agent-blocked` for a human look (ADR 0174 escalation). Latest session log: `/home/dev/.local/state/matou-session-runner/logs/run-658-20260822T134007Z.log` on the workstation. Remove `agent-blocked` (and the stale fail counter if re-arming by hand) to let the runner retry.
Author
Member

drive 20260822T164737Z red at branded-chrome: the theming logo served 2846 bytes as "text/html; charset=utf-8" — not the 70 uploaded logo bytes; the DDR 0147 logo-bytes push did not land the operator's mark on the files surface (#364) (idss_ses
evidence: test-results/…/20260822T164737Z/ on matou-workstation (legs.json, droplet-journal.txt, trace) — a representative screenshot is attached here if one was captured (#596)

drive `20260822T164737Z` red at `branded-chrome`: `the theming logo served 2846 bytes as "text/html; charset=utf-8" — not the 70 uploaded logo bytes; the DDR 0147 logo-bytes push did not land the operator's mark on the files surface (#364) (idss_ses` evidence: `test-results/…/20260822T164737Z/` on matou-workstation (legs.json, droplet-journal.txt, trace) — a representative screenshot is attached here if one was captured (#596)
Owner

Second access path, and now with 246dc4a's breadcrumb — evidence from the
phase-2 re-confirmation drive 20260822T164737Z (#669, --target droplet),
legs 1–23 green, this the only red (779ms):

Error: the theming logo served 2846 bytes as "text/html; charset=utf-8"
 — not the 70 uploaded logo bytes; the DDR 0147 logo-bytes push did not
 land the operator's mark on the files surface (#364)
 (idss_session ABSENT from the browser context at request time)

Two things this pins down that the ticket did not have before:

  1. 246dc4a's instrumentation works and names the cause directly —
    idss_session is absent from the browser context at the moment
    page.request issues the theming GET. Not stale, not wrong-scoped: absent.
  2. The served body is text/html, 2846 bytes — i.e. Nextcloud answered the
    logo GET with a page (the login/redirect shell), which is exactly what an
    unauthenticated theming request gets. So the logo bytes are not missing from
    the push; the request never arrives authenticated. That moves suspicion off
    the DDR 0147 push path and onto how page.request inherits (or fails to
    inherit) the context's cookie jar.

This is the same failure on --target droplet as on --target selfhosted, so
it is path-independent — a harness/cookie-propagation fault, not something
about a particular access path. Still agent-blocked; recording the evidence
so the next session starts from the diagnosis rather than re-deriving it.

**Second access path, and now with `246dc4a`'s breadcrumb — evidence from the phase-2 re-confirmation drive `20260822T164737Z` (#669, `--target droplet`), legs 1–23 green, this the only red (779ms):** ``` Error: the theming logo served 2846 bytes as "text/html; charset=utf-8" — not the 70 uploaded logo bytes; the DDR 0147 logo-bytes push did not land the operator's mark on the files surface (#364) (idss_session ABSENT from the browser context at request time) ``` Two things this pins down that the ticket did not have before: 1. **`246dc4a`'s instrumentation works and names the cause directly** — `idss_session` is **absent from the browser context** at the moment `page.request` issues the theming GET. Not stale, not wrong-scoped: absent. 2. **The served body is `text/html`, 2846 bytes** — i.e. Nextcloud answered the logo GET with a *page* (the login/redirect shell), which is exactly what an unauthenticated theming request gets. So the logo bytes are not missing from the push; the request never arrives authenticated. That moves suspicion off the DDR 0147 push path and onto how `page.request` inherits (or fails to inherit) the context's cookie jar. This is the same failure on `--target droplet` as on `--target selfhosted`, so it is **path-independent** — a harness/cookie-propagation fault, not something about a particular access path. Still `agent-blocked`; recording the evidence so the next session starts from the diagnosis rather than re-deriving it.
Owner

ROOT CAUSE FOUND — this is a harness bug, not a session/auth bug. The product is fine.

Decisive evidence from drive 20260822T164737Z's own ceremony diagnostics
(artifacts/ceremony/window-diagnostics.log, lines 706/711):

16:57:43.353Z request  GET https://files.rehearsal-b.idss.nz/apps/theming/image/logo?v=4
16:57:43.360Z response 200 https://files.rehearsal-b.idss.nz/apps/theming/image/logo?v=4

The ceremony page fetched the theming logo successfully, authenticated, 200 —
at the very moment assertBrandedChrome reported the session gone.
The whole
signed-in Nextcloud dashboard rendered around it: every apps/theming/theme/*.css,
img/*.svg, the background webp — all 200 as subresources of an authenticated
page. The session was never lost. It was live the entire time.

What 246dc4a's breadcrumb actually reported this run was not "expired" but:

idss_session ABSENT from the browser context at request time (#658)
  — cookies present: (none)

(none). Zero cookies for an origin the page had just finished loading an
authenticated dashboard from. That is not a session that expired — a jar with a
stale or wrong-scoped cookie still has cookies in it. An entirely empty jar
for a busy origin means the jar being read is not the jar being used.

Why

ceremonyPage comes from ElectronApplication.waitForEvent('window')
(ceremony.ts:243-255) — a Playwright Electron page. Its real cookie jar is
Electron's own session. page.context() on an Electron page is a synthetic
BrowserContext Playwright fabricates; it does not proxy Electron's session
cookie store. So both page.context().cookies() (reads empty) and
page.request.get() (sends no cookies, gets bounced to the gate, receives
kanidm's 2846-byte SPA shell as text/html) operate on a jar that is not the
one the renderer uses. page.goto() and every subresource fetch go through
Electron's real session, which is why assertOperatorIsAdmin passes 9 seconds
earlier and why the logo subresource above is a clean 200.

dash and ceremonyPage are the SAME object (journey.droplet.spec.ts:469,
const dash = ceremonyPage!), so this is not a wrong-window mix-up — I checked
that first and it is not the answer.

What this retires from the ticket

The whole "Suspected layer" section is chasing a phantom. No live
reproduction with cookie tracing is needed; no investigation of
signinCallback/SessionCookie minting, Caddy forward_auth, or kanidm
timing is needed. The code comment at provision.ts:964-971 asserting that
page.request "shares the page's OWN browser-context cookie jar ... verified
against Playwright's own BrowserContextAPIRequestContext" is true for
Chromium and false for Electron
— that is the assumption that cost this
ticket its investigation.

The one thing the ticket already had right, and which now explains everything,
is the "compounding factor" paragraph: a bare page.request fetch runs no JS
and can never complete kanidm's authorize flow. Correct — and it never should
have been asked to.

The fix

Assert the served bytes from inside the renderer, where the real session
lives, instead of from the context-level request API — e.g. page.evaluate()
with a fetch() of the theming URL returning the bytes, compared to
expect_.logo exactly as now. Byte-equality (#364 / DDR 0147) is preserved;
only the transport changes. Keep 246dc4a's breadcrumb — it is what caught
this, and it should stay to catch the next one.

Path-independent, as expected for a harness fault: identical on --target droplet (this drive) and --target selfhosted.

Removing agent-blocked — the block was "needs a live drive I cannot run", and
that is no longer true: the root cause is pinned from evidence already on disk
and the remaining change is a small, testable harness edit. Ruled by agent
under ADR 0174 — veto anytime.

## ROOT CAUSE FOUND — this is a harness bug, not a session/auth bug. The product is fine. Decisive evidence from drive `20260822T164737Z`'s own ceremony diagnostics (`artifacts/ceremony/window-diagnostics.log`, lines 706/711): ``` 16:57:43.353Z request GET https://files.rehearsal-b.idss.nz/apps/theming/image/logo?v=4 16:57:43.360Z response 200 https://files.rehearsal-b.idss.nz/apps/theming/image/logo?v=4 ``` **The ceremony page fetched the theming logo successfully, authenticated, 200 — at the very moment `assertBrandedChrome` reported the session gone.** The whole signed-in Nextcloud dashboard rendered around it: every `apps/theming/theme/*.css`, `img/*.svg`, the background webp — all 200 as subresources of an authenticated page. The session was never lost. It was live the entire time. What `246dc4a`'s breadcrumb actually reported this run was not "expired" but: ``` idss_session ABSENT from the browser context at request time (#658) — cookies present: (none) ``` **`(none)`.** Zero cookies for an origin the page had just finished loading an authenticated dashboard from. That is not a session that expired — a jar with a *stale* or *wrong-scoped* cookie still has cookies in it. An entirely empty jar for a busy origin means **the jar being read is not the jar being used**. ### Why `ceremonyPage` comes from `ElectronApplication.waitForEvent('window')` (`ceremony.ts:243-255`) — a **Playwright Electron** page. Its real cookie jar is Electron's own `session`. `page.context()` on an Electron page is a synthetic `BrowserContext` Playwright fabricates; it does **not** proxy Electron's session cookie store. So both `page.context().cookies()` (reads empty) and `page.request.get()` (sends no cookies, gets bounced to the gate, receives kanidm's 2846-byte SPA shell as `text/html`) operate on a jar that is not the one the renderer uses. `page.goto()` and every subresource fetch go through Electron's real session, which is why `assertOperatorIsAdmin` passes 9 seconds earlier and why the logo subresource above is a clean 200. `dash` and `ceremonyPage` are the SAME object (`journey.droplet.spec.ts:469`, `const dash = ceremonyPage!`), so this is not a wrong-window mix-up — I checked that first and it is not the answer. ### What this retires from the ticket The whole "Suspected layer" section is chasing a phantom. **No** live reproduction with cookie tracing is needed; **no** investigation of `signinCallback`/`SessionCookie` minting, Caddy `forward_auth`, or kanidm timing is needed. The code comment at `provision.ts:964-971` asserting that `page.request` "shares the page's OWN browser-context cookie jar ... verified against Playwright's own BrowserContextAPIRequestContext" is **true for Chromium and false for Electron** — that is the assumption that cost this ticket its investigation. The one thing the ticket already had right, and which now explains everything, is the "compounding factor" paragraph: a bare `page.request` fetch runs no JS and can never complete kanidm's authorize flow. Correct — and it never should have been asked to. ### The fix Assert the served bytes from **inside the renderer**, where the real session lives, instead of from the context-level request API — e.g. `page.evaluate()` with a `fetch()` of the theming URL returning the bytes, compared to `expect_.logo` exactly as now. Byte-equality (#364 / DDR 0147) is preserved; only the transport changes. Keep `246dc4a`'s breadcrumb — it is what caught this, and it should stay to catch the next one. Path-independent, as expected for a harness fault: identical on `--target droplet` (this drive) and `--target selfhosted`. Removing `agent-blocked` — the block was "needs a live drive I cannot run", and that is no longer true: the root cause is pinned from evidence already on disk and the remaining change is a small, testable harness edit. Ruled by agent under ADR 0174 — veto anytime.
Owner

FIXED — landed 040988a

The diagnosis in my previous comment is now code.

assertBrandedChrome (app/tests/e2e/fixtures/provision.ts)

  • The served-logo fetch runs in the renderer — page.evaluate +
    fetch(url, { credentials: 'include', cache: 'no-store' }), bytes chunked
    back as base64. Byte-equality against expect_.logo (#364 / DDR 0147) is
    untouched; only the transport moved. This is also strictly more correct on
    the private path, where dash is a real Chromium — a renderer fetch is right
    for both.
  • The page's origin is asserted against the door first. A cross-origin miss
    now reds on its own precondition instead of masquerading as a branding fault.
    (Both callers already satisfy it: assertOperatorIsAdmin navigates to
    /settings/admin on the door immediately before, on the droplet path and the
    private path alike.)
  • 246dc4a's breadcrumb stays, relabelled context-jar (not authoritative on Electron, #658). It is what caught this; it must never again be readable as
    proof a session died.
  • The proof frame moved BEFORE the assertions, best-effort. It was the
    function's last statement, so for two months every red left no picture of the
    chrome it was complaining about. A capture failure still never reds the leg.

Beyond this leg. journey.droplet.spec.ts carried the same false rule in a
comment — "the same page.request rides the page's session precedent the S5
fleet probe already uses"
. Those calls (invite-member's komiti/member POSTs,
the S5 fleet probe) are safe only because the portal's own /api/v1 mux is
not cookie-gated — the gate is Caddy forward_auth on the PUBLIC door
(internal/clan/frontdoor.go), not on the control plane. Comment corrected so
the precedent cannot be extended to a gated route. I checked every other
page.request in tests/e2e/: the rest are ungated or best-effort probes.

GOTCHAS #56 records the shape, including the general tell worth keeping:
read cookies present: (none) as "wrong jar", not "expired". An expired
session leaves stale cookies behind; an empty jar for a busy origin means the
jar being read is not the jar being used.

vue-tsc + vitest run both green.

Left OPEN deliberately. The diagnosis is proven from evidence already on
disk, but the fix is not yet proven live — no drive has reached leg 24 since it
landed. Closing on a landing alone is the repo's usual convention (#643's
precedent), and I am not following it here: this leg has been red for two months
and false confidence is what cost it that time. It closes when a phase-2 drive
returns 24/24.

Dropped agent-blocked (the block was "needs a live drive I cannot run" — no
longer true) and ready-for-session (there is nothing left for a session to do;
the next step is a drive, not an edit), so neither the runner nor the swarm
churns on it while it waits. Ruled by agent under ADR 0174 — veto anytime.

## FIXED — landed `040988a` The diagnosis in my previous comment is now code. **`assertBrandedChrome` (`app/tests/e2e/fixtures/provision.ts`)** - The served-logo fetch runs **in the renderer** — `page.evaluate` + `fetch(url, { credentials: 'include', cache: 'no-store' })`, bytes chunked back as base64. Byte-equality against `expect_.logo` (#364 / DDR 0147) is untouched; **only the transport moved**. This is also strictly more correct on the private path, where `dash` is a real Chromium — a renderer fetch is right for both. - **The page's origin is asserted against the door first.** A cross-origin miss now reds on its own precondition instead of masquerading as a branding fault. (Both callers already satisfy it: `assertOperatorIsAdmin` navigates to `/settings/admin` on the door immediately before, on the droplet path and the private path alike.) - **`246dc4a`'s breadcrumb stays**, relabelled `context-jar (not authoritative on Electron, #658)`. It is what caught this; it must never again be readable as proof a session died. - **The proof frame moved BEFORE the assertions**, best-effort. It was the function's last statement, so for two months every red left no picture of the chrome it was complaining about. A capture failure still never reds the leg. **Beyond this leg.** `journey.droplet.spec.ts` carried the same false rule in a comment — *"the same `page.request` rides the page's session precedent the S5 fleet probe already uses"*. Those calls (`invite-member`'s komiti/member POSTs, the S5 fleet probe) are safe **only** because the portal's own `/api/v1` mux is not cookie-gated — the gate is Caddy `forward_auth` on the PUBLIC door (`internal/clan/frontdoor.go`), not on the control plane. Comment corrected so the precedent cannot be extended to a gated route. I checked every other `page.request` in `tests/e2e/`: the rest are ungated or best-effort probes. **GOTCHAS #56** records the shape, including the general tell worth keeping: read `cookies present: (none)` as **"wrong jar"**, not **"expired"**. An expired session leaves stale cookies behind; an empty jar for a busy origin means the jar being read is not the jar being used. `vue-tsc` + `vitest run` both green. **Left OPEN deliberately.** The diagnosis is proven from evidence already on disk, but the fix is not yet proven live — no drive has reached leg 24 since it landed. Closing on a landing alone is the repo's usual convention (#643's precedent), and I am not following it here: this leg has been red for two months and false confidence is what cost it that time. It closes when a phase-2 drive returns **24/24**. Dropped `agent-blocked` (the block was "needs a live drive I cannot run" — no longer true) and `ready-for-session` (there is nothing left for a session to do; the next step is a drive, not an edit), so neither the runner nor the swarm churns on it while it waits. Ruled by agent under ADR 0174 — veto anytime.
Owner

This was generated by AI during triage.

Triage pass — category added, state deliberately left unset

Added the bug category label (missing; this is a harness bug per Ben's
2026-08-23T02:23 root-cause comment). Not applying a state label
(needs-triage/ready-for-agent/etc.) — Ben's fix-landed comment explicitly
stripped agent-blocked and ready-for-session "so neither the runner nor
the swarm churns on it while it waits" for the confirming phase-2 drive
(24/24). This ticket is closed only on a green drive, not an edit; the next
actor is a drive, not an agent or a human editor. Assigning a queue-routing
state label now (even ready-for-human) would re-surface it to automation
and defeat that intent.

Ruled by agent under ADR 0174 — veto anytime. This is a two-way door:
reversible by adding the state label back, and provable by re-reading this
thread — nothing here is a judgement call about the underlying bug, only
about whether to disturb a maintainer decision made in this same session.
Re-triage once the confirming drive lands (green → close per the ticket's own
stated closing bar; red → back to the swarm/session queue with the
appropriate state label at that point).

> *This was generated by AI during triage.* ## Triage pass — category added, state deliberately left unset Added the `bug` category label (missing; this is a harness bug per Ben's 2026-08-23T02:23 root-cause comment). Not applying a **state** label (`needs-triage`/`ready-for-agent`/etc.) — Ben's fix-landed comment explicitly stripped `agent-blocked` and `ready-for-session` "so neither the runner nor the swarm churns on it while it waits" for the confirming phase-2 drive (24/24). This ticket is closed only on a green drive, not an edit; the next actor is a drive, not an agent or a human editor. Assigning a queue-routing state label now (even `ready-for-human`) would re-surface it to automation and defeat that intent. **Ruled by agent under ADR 0174 — veto anytime.** This is a two-way door: reversible by adding the state label back, and provable by re-reading this thread — nothing here is a judgement call about the underlying bug, only about whether to disturb a maintainer decision made in this same session. Re-triage once the confirming drive lands (green → close per the ticket's own stated closing bar; red → back to the swarm/session queue with the appropriate state label at that point).
Owner

PROVEN LIVE — branded-chrome is GREEN. Closing.

Drive 20260823T030519Z (#683, --target droplet, at bb9c700):

24 branded-chrome      green      3198ms

Legs 1–24 all green. The leg that had been red since 2026-06 passes on the
first drive after the fix, with no retry and no flake — 3.2s, the same order as
every other assertion leg.

The frame this project had never produced

artifacts/nextcloud/branded-chrome.png exists, attached below. It is the
Nextcloud dashboard — "Hello, Drive Operator", the community's logo in the
header, the kit's background — which is the surface #409 is about and the
surface drive-17 originally found unbranded. Both halves of bb9c700 show in
it: the frame is taken at all (it used to be the function's last statement, so
no red ever left one), and it is taken on the dashboard rather than the
/settings/admin page assertOperatorIsAdmin parks on.

What the fix was, in one line

The session was never lost. page.request on a Playwright Electron page
reads a synthetic cookie jar that is not the renderer's, so the request arrived
unauthenticated and read back kanidm's SPA shell as a plausible 200. Fetching
in-renderer (page.evaluate + fetch(credentials:'include')) carries the
session the page actually has. Byte-equality (#364 / DDR 0147) never changed.

Honesty note on the drive's overall verdict

The drive itself is RED, but not here: it got past leg 24 for the first
time and immediately hit invite-member (leg 25), now filed as #684 — the
leg asserts occ user:info before the member's first OIDC login, but Nextcloud
JIT-provisions accounts at sign-in. That is a different defect on a leg this
journey had never before reached, not a residue of this one. ADR 0179's own
closing line already said that materialization "needs working on a real gateway
anyway"; #683's drive is what finally got there.

I held this ticket open against the repo's usual close-on-landing convention
precisely so this drive, not a commit, would decide it. It decided it.

## PROVEN LIVE — `branded-chrome` is GREEN. Closing. Drive `20260823T030519Z` (#683, `--target droplet`, at `bb9c700`): ``` 24 branded-chrome green 3198ms ``` **Legs 1–24 all green.** The leg that had been red since 2026-06 passes on the first drive after the fix, with no retry and no flake — 3.2s, the same order as every other assertion leg. ### The frame this project had never produced `artifacts/nextcloud/branded-chrome.png` exists, attached below. It is the Nextcloud **dashboard** — "Hello, Drive Operator", the community's logo in the header, the kit's background — which is the surface #409 is about and the surface drive-17 originally found unbranded. Both halves of `bb9c700` show in it: the frame is taken at all (it used to be the function's last statement, so no red ever left one), and it is taken on the dashboard rather than the `/settings/admin` page `assertOperatorIsAdmin` parks on. ### What the fix was, in one line The session was never lost. `page.request` on a Playwright **Electron** page reads a synthetic cookie jar that is not the renderer's, so the request arrived unauthenticated and read back kanidm's SPA shell as a plausible 200. Fetching in-renderer (`page.evaluate` + `fetch(credentials:'include')`) carries the session the page actually has. Byte-equality (#364 / DDR 0147) never changed. ### Honesty note on the drive's overall verdict The drive itself is **RED**, but not here: it got past leg 24 for the first time and immediately hit `invite-member` (leg 25), now filed as **#684** — the leg asserts `occ user:info` before the member's first OIDC login, but Nextcloud JIT-provisions accounts at sign-in. That is a *different* defect on a leg this journey had never before reached, not a residue of this one. ADR 0179's own closing line already said that materialization "needs working on a real gateway anyway"; #683's drive is what finally got there. I held this ticket open against the repo's usual close-on-landing convention precisely so this drive, not a commit, would decide it. It decided it.
ben closed this issue 2026-08-23 03:23:25 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Matou/idss#658
No description provided.