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:
Garry Tanandcapy-ai[bot] authored and GitHub committed 2026-11-29 08:47:35 +00:00
1 parent 0b7af8acfd
commit b2e9522b2f
17 files changed
+603 -36

No files matched your search

+20 -2
View File
@@ -10,6 +10,7 @@
* --account <text> --target <text> --by <model> [--needs-lookup <text>] [--notice <text>] [--json]
* gstack-first-use predict --run <dir> --score <1-10> --why <text> --by <model> [--json]
* gstack-first-use links --run <dir> --account <owner-equivalent account> --device-class ios|android|web [--json]
* gstack-first-use layout --run <dir> [--json]
* gstack-first-use check --run <dir> --platform … --commit … (--testflight … | --deploy …) [--json]
* gstack-first-use message --run <dir> --platform … --commit … (--testflight … | --deploy …)
* gstack-first-use score --run <dir> --score <1-10> --words "<owner's exact words>" --by <who relayed them> [--json]
@@ -29,7 +30,9 @@ import * as fs from 'node:fs';
import * as path from 'node:path';
import { EXIT, exitTableHelp } from '../lib/headless-artifacts';
import { buildLabel, checkLinks, decide, ownerScore, predict, readManifest, recordResult, recordRoot, startRun, type BuildId, type FirstUseError } from '../lib/first-use';
import { runLayout } from '../lib/first-use-layout';
import { renderBrief, renderPlayMessage } from '../lib/first-use-message';
import { APP_CODE_FIX, appCodeAnchor, type AppCode } from '../lib/design-lint/render-app';
import { resultLine } from '../lib/result-codes';
const HELP = `gstack-first-use — a cold first-use check: the owner's exact try-it steps, run on the real target before the owner is asked (docs/first-use-check.md)
@@ -43,6 +46,8 @@ const HELP = `gstack-first-use — a cold first-use check: the owner's exact try
--target <text> --by <model> [--needs-lookup <text>] [--notice <text>]
predict --run <dir> --score <1-10> --why <text> --by <model>
links --run <dir> --account <text> --device-class ios|android|web|macos|server check every play link now, as the owner-equivalent audience
layout --run <dir> measure the play spec's crowded screens (full_house) with no model:
exit 0 clean, 1 cut-off or overlapping text, 4 a state was not measured, 3 nothing to measure
check --run <dir> --platform … --commit … (--testflight … | --deploy …) FIRST_USE: pass, or refused
message --run <dir> --platform … --commit … (--testflight … | --deploy …) the try-it message, only after a pass
score --run <dir> --score <1-10> --words "<owner's exact words>" --by <who relayed them>
@@ -75,13 +80,14 @@ function cmdStart(a: string[], json: boolean): number {
if ('error' in root) return refuse('start', root.error);
let play: unknown;
try { play = JSON.parse(fs.readFileSync(flag(a, '--play')!, 'utf8')); } catch { return refuse('start', { code: 'FIRST_USE_PLAY_SPEC_INCOMPLETE', detail: `${flag(a, '--play')} is not a readable JSON play spec` }); }
const r = startRun({ root: root.root, app: flag(a, '--app')!, planPath: flag(a, '--plan')!, build: buildArgs(a), phoneBuild: flag(a, '--phone-build'), play, holding: { build: flag(a, '--holding'), defects: flag(a, '--holding-defects') }, builder: flag(a, '--builder')!, checker: flag(a, '--checker')! });
const r = startRun({ root: root.root, app: flag(a, '--app')!, planPath: flag(a, '--plan')!, build: buildArgs(a), phoneBuild: flag(a, '--phone-build'), play, playDir: path.dirname(path.resolve(flag(a, '--play')!)), holding: { build: flag(a, '--holding'), defects: flag(a, '--holding-defects') }, builder: flag(a, '--builder')!, checker: flag(a, '--checker')! });
if ('error' in r) return refuse('start', r.error);
const m = r.manifest;
if (json) { say(JSON.stringify({ run: r.dir, steps: m.steps.length, actions: m.actions.length, quotes: m.quotes.length, rows_sha256: m.source.rows_sha256, try_sha256: m.try_sha256, target: m.play.target, build: m.build })); return EXIT.ok; }
say(`FIRST_USE_RUN: ${r.dir}`);
say(`FIRST_USE_FROZEN: ${m.steps.length} steps (${m.actions.length} day-one actions) quotes=${m.quotes.length} rows=${m.source.rows_sha256.slice(0, 12)} try=${m.try_sha256.slice(0, 12)} target=${m.play.target.kind}:${m.play.target.name} build=${buildLabel(m.build)} checker=${m.checker.model}`);
m.steps.forEach(x => say(` ${x.n}. ${x.text}${x.writes === 'none' ? '' : ` (writes: ${x.writes})`}`));
if (m.full_house) say(`NEXT: gstack-first-use layout --run "${r.dir}" (measures the crowded screens: ${m.full_house.limits})`);
say(`NEXT: gstack-first-use brief --run "${r.dir}" (give it to one fresh agent on ${m.checker.model}, never a ${m.builder.family} model)`);
return EXIT.ok;
}
@@ -108,7 +114,7 @@ async function main(argv: string[]): Promise<number> {
const json = a.includes('--json');
if (cmd === 'root') { const r = recordRoot(); if ('error' in r) return refuse('root', r.error); say(`FIRST_USE_ROOT: ${r.root}`); return EXIT.ok; }
if (cmd === 'start') return cmdStart(a, json);
if (!['brief', 'record', 'predict', 'links', 'check', 'message', 'score', 'show'].includes(cmd)) { process.stderr.write(`gstack-first-use: unknown command ${cmd}\n${HELP}\n`); return EXIT.usage; }
if (!['brief', 'record', 'predict', 'links', 'layout', 'check', 'message', 'score', 'show'].includes(cmd)) { process.stderr.write(`gstack-first-use: unknown command ${cmd}\n${HELP}\n`); return EXIT.usage; }
const dir = runDir(cmd, a);
if (typeof dir === 'number') return dir;
if (cmd === 'show') return cmdShow(dir, json);
@@ -139,6 +145,18 @@ async function main(argv: string[]): Promise<number> {
say(json ? JSON.stringify({ score: r.owner.score, at: r.owner.at }) : `FIRST_USE_OWNER_SCORE: ${r.owner.score} recorded in the private record`);
return EXIT.ok;
}
if (cmd === 'layout') {
const r = await runLayout(dir);
if ('error' in r) { const code = refuse(cmd, r.error); return r.nothing ? 3 : code; }
const x = r.receipt;
if (json) say(JSON.stringify(x));
else {
say(`FIRST_USE_LAYOUT: ${x.verdict} code=${x.code} open=${x.open} waived=${x.waived} viewports=${x.viewports.join(',')} within=${x.within} receipt=${r.file}`);
for (const f of x.findings) say(`LAYOUT_FINDING: ${f.rule} ${f.evidence}${f.waiver ? ` (waived: ${f.waiver})` : ''}`);
for (const s of x.incomplete) say(`LAYOUT_INCOMPLETE: state=${s.state} viewport=${s.viewport} code=${s.code} ${s.detail} | fix: ${APP_CODE_FIX[s.code as AppCode] ?? 'rerun'} (${appCodeAnchor(s.code as AppCode)})`);
}
return x.verdict === 'clean' ? EXIT.ok : x.verdict === 'open' ? EXIT.fail : 4;
}
if (cmd === 'links') {
const r = await checkLinks(dir, { account: flag(a, '--account'), device_class: flag(a, '--device-class') as BuildId['platform'] });
if ('error' in r) return refuse(cmd, r.error);