Skip to content

fix(harness): the UI evidence shot takes --width/--height/--token, and refuses a flag it does not implement - #1770

Merged
lilyshen0722 merged 3 commits into
mainfrom
kai/harness-width-flag
Sep 19, 2026
Merged

lilyshen0722 merged 3 commits into
mainfrom
kai/harness-width-flag

Conversation

@lilyshen0722

Copy link
Copy Markdown
Contributor

The instrument the UI hold depends on silently ignored the flag the hold asks for. This is the
harness that produces the before/after pair (390 and 1200) required for a frontend/ PR, so
its silent hole is a hole in the evidence gate, not a convenience defect.

The defect

scripts/ui-evidence-shot.mjs parsed --width into its arg map and never read it: the viewport
was hardcoded 1440×900. So

node scripts/ui-evidence-shot.mjs --route /v2/connectors --width 390 --out /tmp/x-390.png

wrote a 1440×900 capture under a -390 name. Measured on the PNG header, not on the name:

file pixels css
kai-1757-before-390.png 2880×1800 1440×900
kai-1757-before-1200.png 2880×1800 1440×900

Both "widths" were the same picture, and nothing in the output said so. A reviewer checking a
mobile pair would have been shown a desktop shot twice.

What changes

  • --width / --height (defaults 1440×900), validated (integer, 200–4000), used for the
    context viewport; every run now prints viewport <w>x<h>@2x, so a capture names its own
    shape instead of relying on its filename.
  • An unknown flag is refused with exit 2, listing what is accepted. --widht 390 used to be
    dropped in silence; that silence is what produced the table above.
  • --token <jwt> skips the login. POST /api/auth/login is rate-limited to 20 attempts per
    15 minutes
    , and a pair is captured run by run, so the fifth shot in a batch got 429 and the
    page dumped Failed to load chat room. Please try again. — indistinguishable from a broken
    revision. Hit for real while capturing these pairs; the run line now says auth token vs
    auth login.
  • docs/runbooks/local-ui-render-harness.md gains a flag table and the rule behind it: a pair
    that is byte-identical is not automatically a null result
    — check whether the element is
    display: none rather than absent, because innerText drops hidden text while textContent
    keeps it. That is exactly what the #1757 390 pair turned out to be (see below).

Why now — it was found producing evidence for the two held PRs

#1757 and #1758 sit under the UI hold and need this pair. Captured with the fixed script:

  • #1757 (/v2/connectors) @1200: an agent may use it · every write asks first →
    localdev may use it · every write asks first. @390 the pair is byte-identical
    (668afc05e85e both revisions) because frontend/src/v2/v2.css hides
    .v2-connector-row__detail for live rows under the phone breakpoint — a DOM probe at 390 still
    reads the changed string, so the fix is unpainted there, not absent.
  • #1758 (/pods/team/<podId>, the legacy ChatRoom) differs at both widths; the
    previously-empty bubble body gains [approval needed] … (807→863ch at 390, 819→875ch at 1200).

No frontend/, backend/ or cli/ change, so no version bump is involved.

TASK-050, TASK-056.

samxu01 pushed a commit that referenced this pull request Sep 19, 2026
…side (TASK-050)

The UI hold asks for a before/after pair at 390 and 1200. Wren's read named the one
view that can carry this fix on a phone: the row's `… may use it` line is hidden under
760px by v2.css (#1712), so the audience only paints in the Manage aside.

- before = main dbd5270, after = dbd5270 + this PR's head ede0647
- one backend at main, both frontends pointed at it, same seeded pod and grant
- harness: scripts/ui-evidence-shot.mjs on kai/harness-width-flag @ a730a1e (#1770).
  It now takes --width/--height and --click, refuses a flag it does not implement, and
  prints the viewport it used — so these files are 780x1800 and 2400x1800, not the
  2880x1800 that `--width 390` used to produce under a `-390` name.

Measured: aside @390 `agents allowed` an agent -> localdev; row @1200 same change; row
@390 unchanged, which is what the hide rule requires.
samxu01 pushed a commit that referenced this pull request Sep 19, 2026
…-056)

Wren's read of the pair is on the PR; this commits the files it read.

- before = main dbd5270, after = dbd5270 + this PR's head a740d5f
- surface: the legacy ChatRoom at /pods/team/6aace2b11df344bc6ccdf0ef, one seeded PG
  card message (`message_type='card'`, `[approval needed] …`), one backend at main
- harness as in #1770, so the 390 files are 780x1800 rather than an unlabelled 1440

Measured: the bubble under the author line gains the fallback body at both widths —
807->863ch at 390, 819->875ch at 1200.
samxu01 pushed a commit that referenced this pull request Sep 19, 2026
Rule 27 said the fix "made the sizes real" as though it were on `main`.
It is not: on `main` `scripts/ui-evidence-shot.mjs:87` still hardcodes a
1440x900 viewport and drops `--width` without a warning. Rule 27 (and the
same latent reading in rule 28) now name #1770 the way rule 26 names its PR.

Tip commit on the cleared head; docs-only, one file, no version slot.
lilyshen0722 added a commit that referenced this pull request Sep 19, 2026
Rule 27 said the fix "made the sizes real" as though it were on `main`.
It is not: on `main` `scripts/ui-evidence-shot.mjs:87` still hardcodes a
1440x900 viewport and drops `--width` without a warning. Rule 27 (and the
same latent reading in rule 28) now name #1770 the way rule 26 names its PR.

Tip commit on the cleared head; docs-only, one file, no version slot.
lilyshen0722 added a commit that referenced this pull request Sep 19, 2026
…strings, and merge verification (#1771)

* docs(review-checklist): rules 27-32 — evidence instruments, rendered strings, and merge verification

Six incident-derived rules, appended per the file's own numbering convention:

- 27: an evidence tool that accepts a parameter it does not implement makes
  its own evidence lie, and it lies in the filename (the harness --width hole,
  plus the woff2 403 that changed the typeface between revisions).
- 28: a byte-identical before/after pair is evidence about the surface, not a
  null result; rendering-aware innerText vs textContent separates hidden from
  absent, and byte-identity is not a property of two sessions.
- 29: one renderer, two meanings — classify a label helper's call sites by the
  data they receive; the ledger settles which string was a defect.
- 30: what a rendered value means is answered from the store, not the renderer;
  and fixture provenance travels with the artifact.
- 31: a flake fix is proven by making the defect reproducible; an assertion over
  a process-global resource must watch the subject's own identity.
- 32: verify a merge at the consumer — squash merge tree == carried head tree.

Docs-only; no version slot.

* docs(review-checklist): attribute the harness fix to #1770, not main

Rule 27 said the fix "made the sizes real" as though it were on `main`.
It is not: on `main` `scripts/ui-evidence-shot.mjs:87` still hardcodes a
1440x900 viewport and drops `--width` without a warning. Rule 27 (and the
same latent reading in rule 28) now name #1770 the way rule 26 names its PR.

Tip commit on the cleared head; docs-only, one file, no version slot.
lilyshen0722 added a commit that referenced this pull request Sep 19, 2026
…side (TASK-050)

The UI hold asks for a before/after pair at 390 and 1200. Wren's read named the one
view that can carry this fix on a phone: the row's `… may use it` line is hidden under
760px by v2.css (#1712), so the audience only paints in the Manage aside.

- before = main dbd5270, after = dbd5270 + this PR's head ede0647
- one backend at main, both frontends pointed at it, same seeded pod and grant
- harness: scripts/ui-evidence-shot.mjs on kai/harness-width-flag @ a730a1e (#1770).
  It now takes --width/--height and --click, refuses a flag it does not implement, and
  prints the viewport it used — so these files are 780x1800 and 2400x1800, not the
  2880x1800 that `--width 390` used to produce under a `-390` name.

Measured: aside @390 `agents allowed` an agent -> localdev; row @1200 same change; row
@390 unchanged, which is what the hide rule requires.
lilyshen0722 added a commit that referenced this pull request Sep 19, 2026
… agent" (TASK-050) (#1757)

* fix(v2): name a human in a grant audience instead of calling them "an agent"

A pod grant's audience is a snapshot of the room's members, so it can
name a human; `seats` holds agents only, and every id it could not find
was labelled "an agent". The stranger's Tools row read "an agent, an
agent, C4 smoke may use it" for two people.

Resolve the member's username before falling back to the generic label,
the same helper the grantor line already uses. The row named two options;
this is the first one, and the reason is on the row: enforcement needs an
agent identity, so naming the person is accurate under either reading of
what an audience means, and the audience-model question is left to the
pod rather than settled here.

Mutation-proven: dropping the fallback reds exactly the new case.
Frontend 108 suites / 884 tests, tsc clean. TASK-050.

* docs(evidence): the TASK-050 audience pair at 390 and 1200, row and aside (TASK-050)

The UI hold asks for a before/after pair at 390 and 1200. Wren's read named the one
view that can carry this fix on a phone: the row's `… may use it` line is hidden under
760px by v2.css (#1712), so the audience only paints in the Manage aside.

- before = main dbd5270, after = dbd5270 + this PR's head ede0647
- one backend at main, both frontends pointed at it, same seeded pod and grant
- harness: scripts/ui-evidence-shot.mjs on kai/harness-width-flag @ a730a1e (#1770).
  It now takes --width/--height and --click, refuses a flag it does not implement, and
  prints the viewport it used — so these files are 780x1800 and 2400x1800, not the
  2880x1800 that `--width 390` used to produce under a `-390` name.

Measured: aside @390 `agents allowed` an agent -> localdev; row @1200 same change; row
@390 unchanged, which is what the hide rule requires.
lilyshen0722 added a commit that referenced this pull request Sep 19, 2026
…-056)

Wren's read of the pair is on the PR; this commits the files it read.

- before = main dbd5270, after = dbd5270 + this PR's head a740d5f
- surface: the legacy ChatRoom at /pods/team/6aace2b11df344bc6ccdf0ef, one seeded PG
  card message (`message_type='card'`, `[approval needed] …`), one backend at main
- harness as in #1770, so the 390 files are 780x1800 rather than an unlabelled 1440

Measured: the bubble under the author line gains the fallback body at both widths —
807->863ch at 390, 819->875ch at 1200.
lilyshen0722 added a commit that referenced this pull request Sep 19, 2026
…roval card's fallback text was dropped (TASK-056) (#1758)

* fix(chat): render the plain-text fallback for a non-text message type

The approval card posts `message_type: 'card'` and this bubble returned a
body only for `text` (or `image`), so a member reading the room here saw
the author and a timestamp over nothing. `content` is written as the
plain-text fallback for exactly these legacy surfaces — the card
component is v2-only — so render it. TASK-056.

* docs(evidence): the TASK-056 card-fallback pair at 390 and 1200 (TASK-056)

Wren's read of the pair is on the PR; this commits the files it read.

- before = main dbd5270, after = dbd5270 + this PR's head a740d5f
- surface: the legacy ChatRoom at /pods/team/6aace2b11df344bc6ccdf0ef, one seeded PG
  card message (`message_type='card'`, `[approval needed] …`), one backend at main
- harness as in #1770, so the 390 files are 780x1800 rather than an unlabelled 1440

Measured: the bubble under the author line gains the fallback body at both widths —
807->863ch at 390, 819->875ch at 1200.
@lilyshen0722
lilyshen0722 merged commit 2ae3e00 into main Sep 19, 2026
13 checks passed
samxu01 pushed a commit that referenced this pull request Sep 19, 2026
… no flag, and prefers UI_TOKEN over --token

Two follow-ups Vera read out of the harness after #1770 (70101, corrected in
70102):

- `--width 390 400` passed: the `400` belonged to no flag and the parser skipped
  it with `continue`, so the capture ran with 390 and never said so. A value that
  belongs to no flag is now refused with exit 2 and named, in the same message
  that already lists the known flags. Argument parsing moved to
  `scripts/lib/ui-evidence-args.js` — it imports nothing, so the argument contract
  has a witness that needs no browser, and Playwright is now imported after
  validation (a usage error no longer requires a browser to be installed).

- `--token <jwt>` puts the seat's JWT in the process table and in shell history.
  `UI_TOKEN` carries the same value through a channel that shows in neither, so
  both the runbook and the script's usage block now lead with the environment
  form and keep `--token` as the explicit fallback.

Docs: the table's "an unknown flag is refused" row now covers stray values as
well — the sentence was accurate as written (it said *flag*), which is why the
gap was in the tool rather than in the claim.
lilyshen0722 added a commit that referenced this pull request Sep 19, 2026
… no flag, and prefers UI_TOKEN over --token (#1775)

Two follow-ups Vera read out of the harness after #1770 (70101, corrected in
70102):

- `--width 390 400` passed: the `400` belonged to no flag and the parser skipped
  it with `continue`, so the capture ran with 390 and never said so. A value that
  belongs to no flag is now refused with exit 2 and named, in the same message
  that already lists the known flags. Argument parsing moved to
  `scripts/lib/ui-evidence-args.js` — it imports nothing, so the argument contract
  has a witness that needs no browser, and Playwright is now imported after
  validation (a usage error no longer requires a browser to be installed).

- `--token <jwt>` puts the seat's JWT in the process table and in shell history.
  `UI_TOKEN` carries the same value through a channel that shows in neither, so
  both the runbook and the script's usage block now lead with the environment
  form and keep `--token` as the explicit fallback.

Docs: the table's "an unknown flag is refused" row now covers stray values as
well — the sentence was accurate as written (it said *flag*), which is why the
gap was in the tool rather than in the claim.
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