Repository navigation
docs(runbooks): local UI render harness, and the capture script it uses - #1739
Merged
Merged
Conversation
samxu01
pushed a commit
that referenced
this pull request
Sep 18, 2026
…g it Vera, on #1739: `.env` is not tracked, only `.env.example` is. That is right, and it made the first command in the runbook fail on a fresh clone while the prose pointed the reader at a file that does not exist ("the repo .env", "already in .env"). - new step 0: `[ -f .env ] || cp .env.example .env`, plus the grep that shows the values it needs to carry. `-f` rather than a bare `cp` because this machine already had a `.env` and a plain copy would have clobbered a developer's local secrets; - `.env.example` is named as the file those values actually live in; - `LOCAL_DEV_LOGIN_ENABLED=1` corrected to `=true` (the value in `.env.example`), with the reader cited (`localDevLoginService.ts:44`); - the base-worktree block says out loud that it sources the same local `.env`, since the worktree does not contain one; - gotchas row and See-also updated. Verified by running it, not by reading: copy `.env.example` to a temp `.env`, source it, `PG_USER=commonly PG_PASSWORD=password PG_DATABASE=commonly LOCAL_DEV_LOGIN_ENABLED=true [email protected] FRONTEND_URL=http://localhost:3000`. All seven bash blocks pass `bash -n`. Also tightened the Node bullet to what was actually measured (the 34/369 unit suites that die under the v26 on PATH) and noted that the capture script is not one of them — it resolves playwright from the root node_modules and launches chromium under v26.
A change whose acceptance is visual has no tier today: jsdom has no layout engine, so a card that still shows the field it should redact and a flex bug that clips a row both pass every render test. PR #1731 needed before/after evidence for exactly that and the recipe lived in one seat's shell history. The runbook records the path that cost real time to rederive, all of it measured on this machine rather than read off the code: - the backend's CORS allow-list IS FRONTEND_URL, so every frontend port you serve must be in it or the app looks broken (CORS + net::ERR_FAILED rather than a layout bug); - REACT_APP_API_URL is baked in via an explicit vite `define` — no env var at runtime will move it — and it must be set because the localhost fallback is :5000, which AirPlay owns on some machines; - the repo `.env` is the source of truth for the PG user the container was initialised with; the compose defaults authenticate as a role that does not own the DB and the API answers `degraded` rather than failing; - a before/after pair needs the base revision in a worktree, and that worktree needs `server.fs.allow` covering BOTH the worktree root (realpath — /tmp is /private/tmp) and the checkout the symlinked node_modules point at, or every webfont 403s and the two screenshots differ for the wrong reason; - which viewer you capture as is the test: the integration's creator sees the routing state in both revisions, a member who is not the creator sees the fix. scripts/ui-evidence-shot.mjs writes a full-page PNG and a body.innerText dump, and prints non-2xx responses and console errors. The text dump is the evidence — a text-only agent cannot read the PNG — and the worked example is a one-line diff plus a three-field payload table. Docs plus one script; no product code.
…g it Vera, on #1739: `.env` is not tracked, only `.env.example` is. That is right, and it made the first command in the runbook fail on a fresh clone while the prose pointed the reader at a file that does not exist ("the repo .env", "already in .env"). - new step 0: `[ -f .env ] || cp .env.example .env`, plus the grep that shows the values it needs to carry. `-f` rather than a bare `cp` because this machine already had a `.env` and a plain copy would have clobbered a developer's local secrets; - `.env.example` is named as the file those values actually live in; - `LOCAL_DEV_LOGIN_ENABLED=1` corrected to `=true` (the value in `.env.example`), with the reader cited (`localDevLoginService.ts:44`); - the base-worktree block says out loud that it sources the same local `.env`, since the worktree does not contain one; - gotchas row and See-also updated. Verified by running it, not by reading: copy `.env.example` to a temp `.env`, source it, `PG_USER=commonly PG_PASSWORD=password PG_DATABASE=commonly LOCAL_DEV_LOGIN_ENABLED=true [email protected] FRONTEND_URL=http://localhost:3000`. All seven bash blocks pass `bash -n`. Also tightened the Node bullet to what was actually measured (the 34/369 unit suites that die under the v26 on PATH) and noted that the capture script is not one of them — it resolves playwright from the root node_modules and launches chromium under v26.
samxu01
force-pushed
the
kai/task042-ui-render-harness
branch
from
September 18, 2026 10:15
867c5db to
1dfa927
Compare
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.
A runbook and a small capture script for the one thing a change can need that nothing in the repo can produce today: before/after evidence from a real browser.
Why this exists
jsdom has no layout engine. A card that still renders the field it is supposed to redact, a flex row that clips, an off-canvas panel that never opens — all pass every render test, and the only way to know is to render the page. PR #1731 needed exactly that evidence, and the recipe for producing it lived in one seat's shell history: the next seat rederived every step of it and spent about an hour on ports, CORS, database credentials and worktree paths that had nothing to do with the change under review.
What it contains
docs/runbooks/local-ui-render-harness.md— the stack (which port, which env var, why), the capture step, the before/after pair recipe, a worked example, a symptom→cause table, and teardown.scripts/ui-evidence-shot.mjs— one command: log in through the API, inject the JWT intolocalStorage.tokenbefore first paint (where the shell reads it), render a route, write a full-page PNG and abody.innerTextdump, and print every non-2xx response and console error. Playwright comes from the rootnode_modules; no new dependency.Measured, not read off the code
Every gotcha in the runbook was hit on this machine while writing it:
FRONTEND_URL(backend/server.ts:98). Serving the frontend on an origin that is not in that list producesAccess to XMLHttpRequest … blocked by CORS policy+Network Error+net::ERR_FAILED— which reads as a broken app, not a missing allow-list entry. Measured with:5173(the repo's own e2e default port).REACT_APP_API_URLis compiled in via an explicitdefine(frontend/vite.config.ts), so it must be set when vite starts; the served-from-localhost fallback is:5000, which AirPlay Receiver occupies on some machines. Port 5000 was free here, port 5050 was used anyway so the recipe is correct either way..envis the source of truth for the database user the container was initialised with. Passing the compose defaults (postgres/postgres) authenticates as a role that does not own the database: the API answers,/api/healthreportsdegraded, and message paths fail quietly. Measured:password authentication failed for user "postgres".server.fs.allowcovering both the worktree root (as a realpath —/tmpis/private/tmp, and vite reports the resolved path) and the checkout the symlinkednode_modulespoint at. With only one, either every webfont 403s (screenshots differ for a reason unrelated to the change) orindex.htmlitself is refused.SKILLS_CATALOG_PATHis pointed elsewhere; with it pointed at/tmp,git statusstays clean after a full run.The worked example is a run of this harness
Base
5d067f45versus headcda51208, same route, same seeded connector, viewer = pod member not the creator:and the same viewer's
GET /api/integrations/<podId>:config.chatIdconfig.linkedUserIdconfig.linked5d067f45-10012345678906aace2…ae43cda51208trueBoth artifacts are in the repo's PR #1731 record; this runbook is how the next person reproduces them in one sitting.
Scope and what this is not
CLAUDE.md's standing call is that the Playwright CI layout tier gets built when a second person is shipping UI regularly; this is the manual habit that holds the line until then, and the runbook says so.docs/demo-verification.md.scripts/is outside both packages the version guard covers (cli/src,commonly-mcp/src), so no version bump is implied.Follow-up I did not do unilaterally
CLAUDE.md's knowledge-discipline rule asks for a pointer from the slim anchor to a new deep doc. I left that out of this PR: the runbook category line already exists, and a pointer line is the doc owner's edit, not mine. Say the word and I will add one.