mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-30 03:44:38 +01:00
First-use check catches cut-off and overlapping text on crowded web screens (GST-4152) (#4893)
A web build's first-use check now measures its most crowded screens (most players, longest names, widest numbers) in a real browser and refuses to send the try-it message while text there is cut off or painted over other text. Why: a party game passed a friendly three-player check, then shipped names cut short and a badge on top of the score once eight people joined. Reader action: a web play spec now needs a `full_house` fixture, or `"none: "`. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> Review-Finding: p1/specialist-batched#1 reader=testing Review-Finding: p1/red-team#1 reader=red-team Review-Finding: p1/red-team#2 reader=red-team Review-Finding: p2/outside-voice#1 reader=outside-voice Review-Finding: p2/outside-voice#2 reader=outside-voice Review-Finding: p2/outside-voice#3 reader=outside-voice Review-Finding: p2/outside-voice#5 reader=outside-voice Review-Finding: p2/adversarial-native#1 reader=adversarial-native Review-Finding: p2/adversarial-native#2 reader=adversarial-native Review-Finding: p2/adversarial-native#4 reader=adversarial-native
This commit is contained in:
1 parent
0b7af8acfd
commit
b2e9522b2f
17 files changed
+603
-36
No files matched your search
+16
-5
@@ -314,7 +314,7 @@ threw on a page, ask: the page is not a pass until the lint has read it).
|
||||
|
||||
```
|
||||
gstack-design-lint --scope app (--url <url> ... | --state-file <states.json>) --within <selector>
|
||||
[--viewport WxH ...] [--wait-for <selector>] [--waivers <file>] [--json] [--verbose]
|
||||
[--viewport WxH ...] [--wait-for <selector>] [--waivers <file>] [--full-house] [--json] [--verbose]
|
||||
```
|
||||
|
||||
The page and component profiles grade a whole page against hallmark's gates.
|
||||
@@ -322,8 +322,8 @@ The app profile measures one section of an app screen while it is being
|
||||
built, for the spacing defects qm#3186 shipped (two-line rows crowding the next
|
||||
row, help copy flush under a list, a status note at full weight inside a row)
|
||||
and small hit areas. It is render-only (no static tier, and paths are a usage
|
||||
error), reports only its five rules, and the page and component profiles never
|
||||
report them. Its scheduler (`lib/design-lint/render-app.ts`) and probes
|
||||
error), reports only its five rules (seven with `--full-house`), and the page
|
||||
and component profiles never report them. Its scheduler (`lib/design-lint/render-app.ts`) and probes
|
||||
(`lib/design-lint/render-probe-app.ts`, installed on
|
||||
`window.__gstackLintApp`) are separate from the page tier's, which is
|
||||
unchanged.
|
||||
@@ -352,8 +352,17 @@ unchanged.
|
||||
replaces them. Width 320 to 3840, height 480 to 2400, `^\d{3,4}x\d{3,4}$`;
|
||||
anything else exits 3. One page load per state, one measurement per
|
||||
viewport.
|
||||
- `--within`, `--viewport`, `--wait-for`, `--waivers` and `--state-file`
|
||||
without `--scope app` exit 3 (`APP_ONLY: <flag> only with --scope app`).
|
||||
- **`--full-house`** adds `text-clipped` and `text-overlap`, for a screen
|
||||
filled to its limits: the most players, the longest names, the widest
|
||||
numbers. Point the URLs at a state that seeds those limits (a fixture route
|
||||
such as `?fixture=full-house`), because an empty screen hides both bugs. It
|
||||
needs `--wait-for` naming a selector that matches only once the crowded state
|
||||
has rendered (the last item, say), since a crowded screen may hold no list;
|
||||
without one it exits 3 (`FULL_HOUSE_NEEDS_WAIT`). It measures horizontal
|
||||
cuts only: text cut off vertically, lines hidden by `line-clamp` and a
|
||||
number that wraps onto a second line are not reported.
|
||||
- `--within`, `--viewport`, `--wait-for`, `--waivers`, `--state-file` and
|
||||
`--full-house` without `--scope app` exit 3 (`APP_ONLY: <flag> only with --scope app`).
|
||||
`--verbose` is accepted under every scope; under `--scope app` it prints a
|
||||
failed probe's stack.
|
||||
|
||||
@@ -370,6 +379,8 @@ finding a waiver did not answer makes the section open.
|
||||
| `note-in-row-weight` | ask | in a list of rows, a note with no icon and no surface of its own, OKLCH lightness within 0.15 of the name's and size 0.9 or more of it; or, at 1200px and wider, a note of three lines or more | mute the note, or give it an icon or a callout |
|
||||
| `small-hit-area` | ask | at 480px and narrower, a control inside a list row under 32px in either dimension (an input's label counts toward its box; a link inside a run of text is exempt) | a 32px target that keeps the glyph its size |
|
||||
| `section-overflow` | ask | an element inside the section whose right edge passes the viewport (outside any scroller), or a non-scrolling element whose content is wider than its box | wrap or shrink it, or give it a scroller |
|
||||
| `text-clipped` | ask | `--full-house` only: an element that hides its horizontal overflow (`overflow-x` hidden or clip, ellipsis included) holds text wider than its box by more than 1px; boxes under 4px and visually hidden text (`clip` or `clip-path`, the screen-reader-only pattern) are skipped, and only the innermost of nested clippers reports. The evidence says how much of the text shows | let the text wrap, shrink it to fit, or give the box room for the longest value |
|
||||
| `text-overlap` | ask | `--full-house` only: two text runs from different elements (an absolutely or fixed positioned child counts against its parent's own text), whose line boxes (glyph rows trimmed to the line height and cut to any clipping ancestor) overlap by more than 2px in both directions. The pair is skipped only when an opaque surface on one side, at least four times the other run's area and painted above it (positioned, or on its own layer, and topmost at the overlap), hides that run's whole line (a dialog over the page), sits in a fixed overlay (a toast or callout floating over the page), or is a sticky bar. A badge with its own background over part of a score, and text spilling into the next row's background, still report. Up to 50 findings per rule and screen, so waivers can't hide an unwaived one | put the badge or label in the flow beside the text, or reserve space for it |
|
||||
|
||||
How it reads the page, with no test hooks (no `data-testid`, no attribute at
|
||||
all): a **list** is two or more adjacent siblings of one tag and class list,
|
||||
|
||||
+14
-5
@@ -54,9 +54,13 @@ Run these from the thread that owns the build (on Capy, a Captain or the agent b
|
||||
|
||||
Platforms are `ios`, `android`, `web`, `macos` (a Mac app or helper) and `server` (software on the owner's box); give `--deploy <version>` for anything not on TestFlight. An ios or android check also needs `--phone-build <id>`: the 26-character id of Capy's mobile build (`tools.mobile.build`) of the same commit. The cloud phone installs only that kind of build, never a TestFlight or store number, so `start` refuses a phone build without it. gstack can't check that this build is the same code TestFlight ships. The builder names it, and the brief records which one the checker installed. `--holding none --holding-defects none` marks a first build. `start` freezes the owner's quotes, the play spec's numbered steps followed by the five day-one actions, and the try-it text into a write-once `manifest.json`, with a hash over the rows and the text of every quote, and prints `FIRST_USE_RUN: <dir>`. It refuses a plan whose table or quotes are missing or malformed, a play spec that misses a part, and a checker from the builder's model family.
|
||||
|
||||
2. **Hand the checker its brief.** `gstack-first-use brief --run <dir>` prints everything the checker gets: the target and its rules, the exact try-it message, and each step with what it writes and the commands to record it. Give it to one fresh agent on the `--checker` model and nothing else about the build: no plan, no code, no notes. On Capy, start a subagent with that model on `machine: "fresh"`. For a phone build it attaches a cloud phone (`tools.capy.phone`), installs the `--phone-build` build on it and points it at the target; for a Mac build on the owner's own Mac it drives Aside over Tailscale; for a server build it works over the box's shell. It runs its own gstack install check first.
|
||||
2. **Measure the crowded screens (web builds).** `gstack-first-use layout --run <dir>` opens each state in the play spec's `full_house` state file and runs gstack-design-lint's app profile under `--full-house`, with no model: it reports text that is cut off (`text-clipped`) or painted on top of other text (`text-overlap`) inside `within`, at each viewport (1440x900 and 375x812 unless the play spec names others). It prints `FIRST_USE_LAYOUT: <clean|open|incomplete> …`, one `LAYOUT_FINDING:` per finding and one `LAYOUT_INCOMPLETE:` per state it couldn't measure, with the fix, and writes a write-once receipt under `layout/` bound to the build and to the state and waiver files as `start` froze them. Exit 0 clean, 1 open, 4 incomplete, 3 when the run has no crowded screens to measure. Only those two rules decide the receipt; the app profile's spacing rules are left to the builder's own lint runs. Fix the screen and rerun `layout`; the newest receipt counts.
|
||||
|
||||
3. **The checker records each step and predicts the score.**
|
||||
A checker playing with three friends never sees eight players with long names and a big negative score, so the builder declares the app's limits and seeds them. Give the app a fixture route (for example `?fixture=full-house`) that fills the screen to those limits: the most players, the longest names, a mix of wide and narrow numbers (one widest number alone can wrap and hide an overlap), and every badge that can show at once. The state file is the app profile's (`{"version":1,"states":[{"name":"eight players","url":"http://127.0.0.1:3000/?fixture=full-house"}]}`, [design-lint](design-lint.md#app-profile---scope-app)), and `wait_for` is a selector that matches only once the last item has rendered.
|
||||
|
||||
3. **Hand the checker its brief.** `gstack-first-use brief --run <dir>` prints everything the checker gets: the target and its rules, the exact try-it message, and each step with what it writes and the commands to record it. Give it to one fresh agent on the `--checker` model and nothing else about the build: no plan, no code, no notes. On Capy, start a subagent with that model on `machine: "fresh"`. For a phone build it attaches a cloud phone (`tools.capy.phone`), installs the `--phone-build` build on it and points it at the target; for a Mac build on the owner's own Mac it drives Aside over Tailscale; for a server build it works over the box's shell. It runs its own gstack install check first.
|
||||
|
||||
4. **The checker records each step and predicts the score.**
|
||||
|
||||
```bash
|
||||
gstack-first-use record --run <dir> --step 3 --verdict useful --line "three plants show with their names" \
|
||||
@@ -67,11 +71,11 @@ Run these from the thread that owns the build (on Capy, a Captain or the agent b
|
||||
|
||||
A verdict is `useful` (does what he asked, well), `thin` (works but does little), `wrong` (does something other than what he asked) or `broken` (fails). `--needs-lookup <what>` marks a step that asks the owner for something an agent could look up or do; `--notice <text>` marks a system notice or prompt the message doesn't warn about. Evidence is a screenshot, short video or terminal capture (PNG, JPEG, GIF, WebP, HEIC, MP4, MOV, WebM, TXT or LOG, up to 100 MB), copied into the run with its hash. Only the checker's family may record, and `--account` and `--target` must match the play spec exactly. The checker's text is kept to one plain line. Replaying a step adds a new result; the newest one counts.
|
||||
|
||||
4. **Check the links right before sending.** `gstack-first-use links --run <dir> --account "<the play spec's account>" --device-class ios` opens every link and writes a dated receipt bound to that audience. A link passes on a 2xx or 3xx answer; a 401 or 403 passes only when the play spec marks it `"login_gated": true`.
|
||||
5. **Check the links right before sending.** `gstack-first-use links --run <dir> --account "<the play spec's account>" --device-class ios` opens every link and writes a dated receipt bound to that audience. A link passes on a 2xx or 3xx answer; a 401 or 403 passes only when the play spec marks it `"login_gated": true`.
|
||||
|
||||
5. **Print the message.** `gstack-first-use message --run <dir> --platform ios --commit <sha> --testflight 17` prints the try-it message only when every check below passes, and refuses otherwise, printing nothing on stdout. It opens with the owner's quotes and what this version does with each, then the ten play parts with the numbered steps, then "What you'll notice" (every thin step and notice), "The build on your device now" (its known defects, or that this is his first build) and one verdict line per step. Send it as it is. For a "v1 is ready" report, run `gstack-first-use check` with the same flags and paste its `FIRST_USE: pass …` line.
|
||||
6. **Print the message.** `gstack-first-use message --run <dir> --platform ios --commit <sha> --testflight 17` prints the try-it message only when every check below passes, and refuses otherwise, printing nothing on stdout. It opens with the owner's quotes and what this version does with each, then the ten play parts with the numbered steps, then "What you'll notice" (every thin step and notice), "The build on your device now" (its known defects, or that this is his first build) and one verdict line per step. Send it as it is. For a "v1 is ready" report, run `gstack-first-use check` with the same flags and paste its `FIRST_USE: pass …` line.
|
||||
|
||||
6. **Save the owner's reaction.** When the owner replies, `gstack-first-use score --run <dir> --score 4 --words "4, Talk is slow" --by "<who relayed it>"`. `gstack-first-use show --run <dir>` prints each step's verdict, the predicted score, the owner's score and words, and the gap between them.
|
||||
7. **Save the owner's reaction.** When the owner replies, `gstack-first-use score --run <dir> --score 4 --words "4, Talk is slow" --by "<who relayed it>"`. `gstack-first-use show --run <dir>` prints each step's verdict, the predicted score, the owner's score and words, and the gap between them.
|
||||
|
||||
## What the gate refuses
|
||||
|
||||
@@ -84,6 +88,7 @@ Run these from the thread that owns the build (on Capy, a Captain or the agent b
|
||||
- No day-one action is `thin` (`step_<n>_thin`): each one comes from his words. A thin play step passes and is named in the message.
|
||||
- Every link has a live receipt from the last 15 minutes (`link_unchecked`, `link_down`, `link_stale`).
|
||||
- The checker predicted a score (`no_predicted_score`).
|
||||
- When the play spec names crowded screens, the newest layout receipt for this build and these frozen files exists (`full_house_unchecked`), measured every state at every viewport (`full_house_incomplete`) and found no cut-off or overlapping text a waiver didn't answer (`full_house_open`). The try-it message then says the limits were checked, and lists each waived cut under "What you'll notice".
|
||||
|
||||
The message never shows the predicted score, so it can't anchor the owner's own.
|
||||
|
||||
@@ -104,6 +109,7 @@ Every ask to play or try a build carries full play instructions in the same mess
|
||||
| 8. How to report back | `report` | the message adds "a score from 1 to 10 and one line" |
|
||||
| 9. Known quirks | `quirks` | "none" is fine; empty isn't |
|
||||
| 10. Reply word | `reply_word` | one word |
|
||||
| Crowded screens | `full_house` | required on a `web` build, optional elsewhere. Either `"none: <reason>"` (a single static page, say) or `{ "states", "within", "wait_for", "limits", "viewports"?, "waivers"? }`: `states` and `waivers` are file paths relative to the play spec, in the app profile's formats; `limits` says the limits in words ("8 players, 12-character names, scores to -$99,999"). `start` reads, checks and hashes both files, and refuses a missing or malformed one |
|
||||
|
||||
On the owner's real setup the checker only reads: the brief forbids sending anything as the owner, writing to his setup except an approved write, and raising a prompt on his machine while he is using it. It also tells the checker that what it reads goes to its model provider.
|
||||
|
||||
@@ -122,3 +128,6 @@ With a handful of builds, this is a case series, not an eval. For each first ver
|
||||
- It doesn't prove the target is real: the checker declares it, as it declares the account, and the record names it.
|
||||
- It doesn't dispatch the checker by itself; the thread that owns the build starts it with the brief.
|
||||
- It doesn't check the wording of other messages sent to the owner.
|
||||
- The crowded-screen check measures only horizontal cuts and overlapping text on web pages. It doesn't catch text cut off vertically, a `line-clamp` that hides lines, a number that wraps onto a second line, a screen the fixture doesn't seed, or native iOS, Android and Mac screens.
|
||||
- The crowded-screen measurement trusts the fixture URL: it doesn't check that the server there runs the build being sent (the record lists the origins it opened). It measures only text that paints on screen, so text marked `aria-hidden` still counts when it is visible. It waits for `wait_for` once before measuring each viewport rather than at each one, and compares at most 2000 line boxes per screen.
|
||||
- It doesn't push a build through rough play (idling past a timer, a wrong answer, a dropped player). A pilot of that check caught the bug it was aimed at in 1 of 3 tries, so it was left out.
|
||||
@@ -2379,7 +2379,7 @@ whose Plan line differs from the PR body's current line.
|
||||
<a id="first-use-play-spec-incomplete"></a>
|
||||
### `gstack-first-use start: ... (FIRST_USE_PLAY_SPEC_INCOMPLETE)`
|
||||
|
||||
**Meaning.** The play spec JSON misses one of the ten parts every ask to play or try a build carries (links, device and setup with its `target`, what it is, how to start with its numbered `steps`, controls, how long, what we want to learn, how to report back, known quirks, reply word), or a step writes on the owner's real setup with no `approved_write` naming his approval. The line names each missing part and field. Exit 3. **Fix.** Fill them in ([first-use-check.md](first-use-check.md#play-spec)); "none" is a fine value for known quirks and for a step's writes. Run a step that writes on a realistic copy, or get the owner's lettered approval for that write first.
|
||||
**Meaning.** The play spec JSON misses one of the ten parts every ask to play or try a build carries (links, device and setup with its `target`, what it is, how to start with its numbered `steps`, controls, how long, what we want to learn, how to report back, known quirks, reply word), or a step writes on the owner's real setup with no `approved_write` naming his approval, or a web build's `full_house` is missing, malformed, or names a state or waiver file that can't be read or parsed (paths are relative to the play spec). The line names each missing part and field. Exit 3. **Fix.** Fill them in ([first-use-check.md](first-use-check.md#play-spec)); "none" is a fine value for known quirks and for a step's writes. Run a step that writes on a realistic copy, or get the owner's lettered approval for that write first.
|
||||
|
||||
<a id="first-use-same-family"></a>
|
||||
### `gstack-first-use start|record|predict: ... (FIRST_USE_SAME_FAMILY)`
|
||||
@@ -2399,7 +2399,7 @@ whose Plan line differs from the PR body's current line.
|
||||
<a id="first-use-refused"></a>
|
||||
### `gstack-first-use check|message: ... (FIRST_USE_REFUSED)`
|
||||
|
||||
**Meaning.** The build has not cleared its first-use check, so `message` prints no try-it message and `check` prints no `FIRST_USE: pass` line. The detail lists every reason: `build_mismatch`, `source_changed` (the day-one rows or the owner's quotes changed), `source_missing`, `try_text_changed`, `step_<n>_not_played`, `step_<n>_broken`, `step_<n>_wrong`, `step_<n>_needs_lookup` (the step asks the owner for something an agent could look up or do), `step_<n>_thin` (only for a day-one action, which comes from the owner's words), `step_<n>_evidence_stale`, `link_unchecked`, `link_down`, `link_stale` (over 15 minutes old), `no_predicted_score`, `record_unreadable`. Exit 3. **Fix.** Fix the build or the step and replay it, rerun `links` right before sending, or start a new run for a new build, changed day-one rows or changed quotes.
|
||||
**Meaning.** The build has not cleared its first-use check, so `message` prints no try-it message and `check` prints no `FIRST_USE: pass` line. The detail lists every reason: `build_mismatch`, `source_changed` (the day-one rows or the owner's quotes changed), `source_missing`, `try_text_changed`, `step_<n>_not_played`, `step_<n>_broken`, `step_<n>_wrong`, `step_<n>_needs_lookup` (the step asks the owner for something an agent could look up or do), `step_<n>_thin` (only for a day-one action, which comes from the owner's words), `step_<n>_evidence_stale`, `link_unchecked`, `link_down`, `link_stale` (over 15 minutes old), `no_predicted_score`, `record_unreadable`, and for a play spec with crowded screens `full_house_unchecked` (no layout receipt for this build and these frozen state and waiver files), `full_house_open` (cut-off or overlapping text at the declared limits) and `full_house_incomplete` (a state or viewport wasn't measured; the reason names its app-profile code). Exit 3. **Fix.** Fix the build or the step and replay it, rerun `links` right before sending, run `gstack-first-use layout --run <dir>` after fixing a crowded screen, or start a new run for a new build, changed day-one rows or changed quotes.
|
||||
|
||||
## /gstack-ship token budget and fresh-context handoffs (gstack-ship-budget)
|
||||
|
||||
|
||||
Reference in new issue
Block a user