Repository navigation
feat(diff-scope): template UI in .ts/.js counts as frontend; receipt records the static design pass (GST-1718) - #4112
Merged
Merged
Conversation
…records the static design pass (GST-1718) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
…1718) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Review-Finding: p1/specialist-batched#1 reader=specialist Review-Finding: p1/red-team#1 reader=red-team Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…frontend Review-Finding: v1/outside-voice#1 reader=outside-voice Review-Finding: v1/adversarial-native#1 reader=adversarial-native Review-Finding: v1/outside-voice#2 reader=outside-voice Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ed line Review-Finding: p2/red-team#2 reader=red-team Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
3 tasks done
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.
What changed
A CSS-only spacing edit inside a Lit
csstemplate: origin/main reads SCOPE_FRONTEND=false and /ship skips its design checks; this branch reads true.Before/after as text: A CSS-only spacing edit inside a Lit css template: origin/main reads SCOPE_FRONTEND=false and /ship skips its design checks; this branch reads true
gstack-diff-scopenow recognizes a screen written as a Lit or htm tagged template inside a .ts or .js file. Before, it counted only CSS, .tsx, views and similar paths as frontend. A PR that rendered its UI fromhtml`` templates in plain TypeScript readSCOPE_FRONTEND=false`, so /ship skipped its design-lite check and the design specialist without saying so. That is what happened on qm#3186, which shipped three visible spacing problems after a full /ship.html,cssorsvgtemplate (at the head, or at the merge base so a deleted screen counts; whitespace before the backtick is allowed) sets SCOPE_FRONTEND when a changed line sits inside one of those templates on its side of the diff (a CSS declaration or a${}binding counts), or carries markup: a tagged template, an element tag,class=orstyle=. Logic-only edits, comment lines and TypeScript generics (Promise<void>) don't count. It works for--headranges and for the working tree, untracked files included, and reads paths NUL-delimited so non-ASCII names work. It sets FRONTEND only, so these files keep SCOPE_BACKEND and the backend reviewers.lib/frontend-scope.tsstays path-only, so the design detector's scan targets don't change.gstack-ship-receipt writerecordsdesign: { mode: "static", reason: "no preview declared" }, taken from the same diff-scope run the review depth reads. The PR body's## Design Reviewline, /ship's preflight line and SKILL prose say the same thing: only the static check ran. The field is advisory. Nothing refuses on it, older receipts stay valid, and carry copies it. The schema and docs/ship-policy.md#ship-receipt document it.Why
Garry on qm#3186: "gstack design skill should prevent this tbh". The plan (GST-1718, /autoplan run autoplan-20261107044135, approved A1 by Garry 2026-11-07) found the silent skip as the root cause. Blind replays on qm#3186 then showed that neither design pass catches its three defects as described: the static design-lite check found 0 of 3, and a rendered /design-review flagged 2 of the 3 elements under other diagnoses. So this PR fixes the skip and the disclosure. The rendered /design-review pass, the spacing lens and any gate are phase 2, built with the first repo preview harness.
Behavior changes
scripts/resolvers/design.ts,design-checklist.ts), the design and performance specialists (lib/review-depth.ts:502,:505,scripts/resolvers/review-army.ts), /ship preflight'sSCOPE: frontend=line (lib/ship-preflight.ts:116), and /review's design checklist. Before, these were skipped on such diffs.designon frontend ranges (before: no field).Blast radius
The CREW rule-15 no-loss replay was preregistered at captain drive handoffs/GST-1718/no-loss-prereg.md before it ran. Old (origin/main 3742ee9) and new
gstack-diff-scoperan on the last 100 merged garrytan/gstack PRs and the last 100 merged yc-software/qm PRs, each merge commit against its parent. The first run used b93fb89's script (handoffs/GST-1718/no-loss/result.json). Review fixes then widened the arm, so the same corpus was replayed once more with the final script at 397436f (handoffs/GST-1718/no-loss-final/result.json). Final-head results:gstack itself sees no change in cost. qm UI PRs gain the static design-lite check and the design specialist. The arm costs one awk pass per template file: 0.61 s on a 20,000-line logic rename in a template file, against 0.13 s on origin/main's script.
Tests
test/diff-scope.test.ts: five new tests on synthetic Lit files at qm#3186's path shape (no qm source).--headand in the working tree.--headand in the working tree; a<placeholder>in a comment gives false.test/ship-receipt-depth.test.ts: a template-UI diff recordsdesign, and a backend diff records none.test/fixtures/golden/*-ship-SKILL.md: regenerated for the static design-review line.Approvals
Approved: yes (record r-87ba05784bdb). The full approval record stays private: this repository is public or its visibility is unknown.
Review-loop exception: one scoped fix-check after round 2, granted by GStack Minder (GSTA-36), approval a-f777ffd2c1b9 ("Grant: one scoped reader on 397436f. The two phase-2 skips are fine. It's the last round: a new blocker parks it.").
Summary
/ship stopped silently skipping design checks for UI written as Lit or htm templates in plain TypeScript, and now says which design pass ran. Review fixes made the detection count spacing and binding edits inside multiline templates, spaced template tags and non-ASCII file names, and kept it fast on large logic churn.
Test Coverage
Coverage: 64% value-weighted (91% including 4 weakly covered paths), from the Step 7 audit at b93fb89 (audit only, no generation allowance). Since then the review fixes added two tests to
test/diff-scope.test.ts(non-ASCII and comment placeholder; CSS-only and binding-only edits inside a multiline template, andhtml \`` with a space). Each fails on the script it replaced. Test value: 2 tests written, 1 rejected by the authoring gate, 0 existing tests extended, 4 paths weakly covered (weak = ★, gate-failing or unrated). Proposed, not written: a carry copiesdesignunchanged; a receipt withoutdesign` still validates.Tests ran: free 1625 (test files, carried from CI run 42346658093 at tree 7095e67eb795)
Pre-Landing Review
Pre-Landing Review: 15 issues — 5 auto-fixed, 2 asked (0 fixed, 2 skipped), 0 deferred, 8 noted
REVIEW_LOOP: passes=2 blocking_found=4 deferred=0 noted=8 fixed=5 scope=frozen unbound=1 ledgers_read=7 fix_checks=2 dispatches=8
Gate edits: none detected (GATE_SCAN tagged=0 at 397436f)
Outside review (openai/gpt-6.1-sol, host subagent, at ea6b18e): request changes, 3 findings. Two fixed in 03f5c3c (edits inside multiline templates; whitespace before the backtick). One skipped with the Captain's acceptance: feeding template files to the design detector stays phase 2.
Skipped with the Captain's acceptance (phase 2): the receipt's
designrecord names no file list (p1/red-team#2); the design detector stays path-only (v1/outside-voice#3).Round 2's blocking finding (a grep fork per changed line, 50.4 s at 40k changed lines against the 60 s scopeOfRange timeout) was fixed in 397436f and read clean by the granted fix-check.
Review notes
Below the blocking floor (advisory, informational, test-gap or wording items); recorded here and not fixed in this PR.
bin/gstack-diff-scope:391The comment-line filter also drops a markup line that starts with an inline comment tag (/html/<div ...>), so that rare style alone reads SCOPE_FRONTEND=false.bin/gstack-diff-scope:391git grep/diff output parsed without --no-color/--no-ext-diff; color.ui=always or diff.external corrupts it.bin/gstack-diff-scope:371every git failure in the arm reads as not frontend (no SCOPE_ERROR/warning).bin/gstack-diff-scope:387ls-files --others prints cwd-relative paths while _g runs at the root; from a subdirectory an untracked template file is missed.bin/gstack-ship-receipt:334design field set from review.frontend only; carry copies it unchanged instead of recomputing for the new head.bin/gstack-diff-scope:364tag regex matches type assertions, spaced comparisons and regex literals in template files (over-reports).test/diff-scope.test.ts:636new test's Value header lacks why_new=bin/gstack-diff-scope:378template arm parses git grep/diff output without --no-color/--no-ext-diff/--no-textconv; color.ui=always or diff.external turns the arm offExploratory QA
Functional surface: the
gstack-diff-scopeCLI on an owned fixture repo outside this checkout. Smoke at 397436f, 3 probes,gstack-qa-evidenceverdict pass: aclass=markup edit in the working tree reads FRONTEND=true and BACKEND=true; a committed CSS-only edit inside a multilinecsstemplate reads FRONTEND=true through--head; a logic-only commit reads FRONTEND=false. An earlier smoke at ea6b18e (non-ASCII--head) also passed and is superseded. No plan checks are bound to this branch.Design Review
No frontend files changed — design review skipped.
Eval Results
Prompt-related files changed (ship/SKILL.md.tmpl, ship/sections/pr-body.md.tmpl).
eval-selectpicked 120+ behavior probes and no quality judges, which is over this lane's $10 paid cap, so no paid evals ran here. CI's evals.yml PR route skipped its slices. Paid coverage runs in the merge train's screen.Scope Drift
Scope Check: CLEAN
Intent: A1, fix the silent design-check skip for template UI and disclose the static-only design pass.
Delivered: the diff-scope template arm, the receipt
designfield and the matching prose, with tests.Plan Completion
Plan completion audit: not run (no plan is bound to this branch and no docs/designs/ file matches). Fix: add "Plan: " to the PR body, or run /autoplan.
TODOS
No TODO items completed in this PR.
Documentation
Status: current. The docs already match GST-1718, so nothing needed editing.
Scope: commits 3742ee9..39d9b29 (7 commits, 20 files); no staged, unstaged or new files.
Documentation health:
designfield and explains it in its own paragraph.Coverage debt: template-UI frontend detection in
gstack-diff-scopehas reference coverage only (docs/ship-policy.md) and no how-to. The receiptdesignfield also has reference coverage only. No diagram drift.Test plan
bun run test(lane free): carried from CI run 42346658093 at tree 7095e67eb795, 1625 test files, 0 failures (CI_CARRY accepted, 36154 tests)bun test test/diff-scope.test.ts: 101 pass, 0 fail at 397436fbun test test/host-config.test.ts test/module-size-ratchet.test.ts: pass at ea6b18e (goldens regenerated)