Skip to content

v1.84.0.0 feat: impeccable interop: detector pre-pass in four design skills, DOM-mode scans, open DESIGN.md format, one typed slop catalog - #2832

Merged
garrytan merged 35 commits into
mainfrom
tehran-v1
Sep 9, 2026
Merged

garrytan merged 35 commits into
mainfrom
tehran-v1

Conversation

@garrytan

@garrytan garrytan commented Sep 8, 2026 •

Copy link
Copy Markdown
Owner

Summary

gstack's design skills gain a deterministic pre-pass from impeccable's engine when the user has installed it, speak its rule ids in gstack's own voice, write and read the open DESIGN.md format, and keep one typed catalog for the AI-slop vocabulary. Plan: docs/designs/IMPECCABLE_INTEROP.md (CEO + eng reviewed, one PR by user decision). 28 substantive commits, bisected.

Detector (bin/gstack-design-detect.ts, lib/design-detect-contract.ts)

  • probe | scan | rules; design_detector: auto|off config key. The probe reads files only; READY requires an engine whose real file is named impeccable under HOME (cache, env override, PATH, or the skill's sibling engine); anything inside the repository or cwd (project directories, strictly below HOME) is never executed. URLs refused; minimal engine environment (project PATH entries removed); per-batch timeout, whole-scan budget, 50 MB stdout cap, 5,000-finding cap, every field sanitized, sentinel forgery neutralized, DETECT_TOP fenced as untrusted, JSON names its untrusted fields; exit 3 = gstack bug.
  • --changed <base>: NUL-safe git-derived frontend targets through the same allow-list; committed symlinks skipped; unknown, empty, or option-like bases refused with exit 1.
  • DOM dumps under ~/.gstack/projects/<slug>/designs/**/dom/ (and any designs/ directory) scan with --no-inline-ignores; gstack-authored artifacts and repo files keep theirs.

Consent-gated engine install (gstack-design-detect.ts install, design_detector_install_prompted)

  • When the probe finds no engine and the user has never answered, the design skills ask one AskUserQuestion, once, in interactive sessions only (spawned/headless never install or ask; Conductor gets the prose brief): install now, not now, never ask again, or turn the detector off. A yes downloads engine 0.1.3 for this platform from impeccable's own GitHub release, verifies it against the checksum pinned in lib/design-detect-contract.ts (all five platforms), writes an egress receipt before the fetch (fail-closed, registered in the wiring test's polarity table), caps and streams the download, writes only after the hash matches, and installs the one file under ~/.impeccable/bin/<version>/: no skill, no hook, no launcher, no npx. Verified end to end against the real release (16 MB, hash matches the fixture engine, binary runs). The NOT_CACHED hint no longer repeats once the user has declined, and its npx wording is corrected. License note: MIT and Apache-2.0 are compatible; prompting is not a license event; gstack still redistributes nothing.

Skill wiring (scripts/resolvers/design.ts, design-checklist.ts, review-army.ts, templates)

  • /design-review Phase 0: source mode on a branch (base detected via gh, never assumed), DOM mode on any URL through one shared dump script (lib/dom-dump.js, an arrow function the page runs; Aside pg.evaluate or $B js, both spliced through closed-quote segments so a page URL never sits in a double-quoted bash string); dumps are hygiene-stripped, size-capped, redaction-checked at the dump cap, chmod 600, per run, deleted after Phase 9 unless --keep-dom; design-baseline.json schema 2 with per-page rule counts and an engine changed caveat; Detector: N → M; /impeccable <cmd> handoffs.
  • /review and /ship design pass start with the scan (tier buckets, detector+checklist dedupe); /design-html bounded slop gate; PR body Detector: line.
  • review/design-checklist.md is generated from the catalog (Claude host, --out-dir aware, dry-run STALE/FRESH).

Catalog and doctrine (lib/design-catalog.ts)

  • 86 typed entries (57 slop, 29 quality, 61 matching impeccable ids, 11 legacy lines byte-identical to the old AI_SLOP_BLACKLIST), mockupNever (10) feeding the design binary's prompt, HANDOFF_COMMANDS, fonts lists. Persuade/Operate/Read/Experience modes with aliases, craft-floor reflexes, calibration, font procedure with a role-scoped overused list, color strategies, landing rules aligned (one authored motion moment, no halo/spotlight/stripe/grid gradients), Codex design-voice prompts aligned.

Open DESIGN.md format (lib/design-md.ts, bin/gstack-design-md.ts, design/src/memory.ts)

  • check | convert | tokens | mark; format marker inside the front matter (YAML comment) or an HTML comment on legacy files; convert backs up and refuses ambiguous or duplicate-heading input; text-level editors change one section or one line and preserve every other byte, the BOM, and the majority line ending; symlinked DESIGN.md edited through the link; unclosed fences refused; ~~~ fences honored; YAML emitter quotes control chars, #, and YAML 1.2 numerics. /design-consultation writes the spec and asks once about conversion; PRODUCT.md prefills; gstack's own DESIGN.md converted.

Attribution and docs: NOTICE.md, licenses/Apache-2.0.txt, changed-file headers; README, ARCHITECTURE, PROJECT_STRUCTURE, skills.md, CONTRIBUTING, TESTING_INTERNALS, CLAUDE.md; TODOS.md carries 7 reasoned deferrals from the reviews.

Test Coverage

Step 7 coverage audit before the fix rounds: 74% of new code paths covered, 24 gaps; tests were generated for every gap and every review-cycle fix landed with its own test. Static count: 194 new test() declarations across 11 files (gstack-design-detect 61, design-md 48, design-catalog 23, impeccable-fixtures 16, design-checklist-sync 9, design-detect-contract 8, gen-skill-docs +19, gstack-config-defaults +4, brief 3, frontend-scope 2, dom-dump-hygiene 1).

lib/design-detect-contract.ts ── contract + neutralizeSentinels ── test/design-detect-contract.test.ts (8)
bin/gstack-design-detect.ts ─── probe/scan/rules, trust rules ──── test/gstack-design-detect.test.ts (61)
lib/design-catalog.ts ────────── invariants, partitions ─────────── test/design-catalog.test.ts (23)
lib/design-md.ts + bin ───────── parse/convert/splice/mark ──────── test/design-md.test.ts (48)
lib/dom-dump-script.ts ───────── hygiene in a real Chromium ──────── test/dom-dump-hygiene.test.ts (CI / opt-in)
scripts/resolvers/* ──────────── rendered prose + bash pins ──────── test/gen-skill-docs.test.ts, design-checklist-sync.test.ts
E2E ──────────────────────────── detector shim (source + DOM), slop gate, review design lite, consultation core/existing

Pre-Landing Review

Three cycles (checklist + security, testing, maintainability, design, performance/simplification specialists), a Red Team pass, and the Claude adversarial subagent. Every CRITICAL was reproduced before the fix and is pinned by a test: repository-local engine execution (any READY candidate is now HOME-rooted, named impeccable, checked by realpath); --changed allow-list bypass via committed symlinks; VERSION-file and sentinel forgery; a swallowed failing git diff; the DOM dump running as an IIFE in Aside's repl sandbox; the double-quoted Aside block that put a page URL under $(...) expansion; mark/extraction rewriting legacy files (now text-level splices, CRLF and BOM preserved); the redaction gate's 1 MiB default deleting every 1 to 10 MiB dump; the HOME-as-cwd fallback that defeated the project rule; prototype-member rule ids; symlinked DESIGN.md replaced; audit directories walked with page-controlled inline ignores; print/alternate stylesheets scanned as page CSS.

Kept as-is with reasons: --format raw (fixture capture path), the hand-rolled argv loop (keeps the unknown-flag warning), the ~13 KB generated checklist (conditional read). Deferred to TODOS.md: scan cache, $D check rubric, taste-profile interplay, CEO Section 11 bullets, the bin/*.ts .env audit, design-review Phases 7-11 carve, Kiro bin/ linking.

Residual property worth knowing: every Aside script in the tree is a single-quoted bash string, so a ' inside a pasted URL ends it; the DOM dump prose tells the agent to percent-encode ' and never paste an unread URL. Tree-wide, not new here.

Codex passes: no coverage. codex exec and codex review both failed to start in this environment (the CLI's sandbox needs bwrap, absent here); reported as missing coverage, not a clean bill.

Design Review

Frontend files in the diff are test fixtures with planted anti-patterns. Design Review (lite) on the doctrine changes ran through the review army's design specialist across the cycles (contradictions found and fixed: motion counts, overused-display scope, Rule 4 wording, blacklist header, slop-gate blessings, DESIGN.md rows, variant dials). Detector: not installed (probe printed IMPECCABLE_NOT_AVAILABLE on this machine; the real engine lives in a scratch directory used only to capture fixtures).

Eval Results

Full diff-selected run (bun run test:evals via gstack-detach, $22.78): 92 PASS, 3 FAIL, of which /design-consultation core ×2 was this branch (the open DESIGN.md template's Overview no longer contains the literal "aesthetic"; the section-synonym check now knows "Creative North Star" / "Key characteristics"; the LLM judge had passed both attempts) and /ship review dashboard via attribution was a zero-turn harness timeout that passed on its immediate retry. Re-runs on the fixed tree: test/skill-e2e-design.test.ts + test/skill-e2e-review.test.ts with EVALS_ALL=1, 12/12 PASS ($10.54); after the adversarial fixes, detector shim (source + DOM), slop gate, review design lite, consultation core, 5/5 PASS (~$5.38). Gate tier: design-review-detector-shim (source and DOM); periodic: design-html-slop-gate.

Plan Completion

Plan docs/designs/IMPECCABLE_INTEROP.md (promoted from the CEO plan), 13 planned commits plus 7b, all landed. Step 8 audit: 47 line items, every one DONE or consciously CHANGED (the 12 CHANGED items are recorded in the plan doc's superseded notes, e.g. the hook never skips a scan, the dump is an arrow function called in the page, the engine version is never a filesystem path); the two items first marked UNVERIFIABLE were verified afterwards (bun run test:windows passes; the real engine loads design-system-* rules against gstack's converted DESIGN.md). The design-review eager ceiling landed at 31,319 tokens (+2.87K against the review's 2.5K target after every planned lever; the next lever is filed in TODOS.md).

Verification Results

Skipped: no running server for the plan's verification section (NO_SERVER); the detector shim E2E cases cover the runtime path with the fake engine.

TODOS

No TODO items completed in this PR. Seven reasoned deferrals filed under "impeccable interop deferrals" in TODOS.md (from the CEO, eng, and code reviews).

Documentation

  • CLAUDE.md: quick map names lib/design-catalog.ts, bin/gstack-design-detect.ts, bin/gstack-design-md.ts; SKILL.md workflow now states that bun run gen:skill-docs also writes review/design-checklist.md (from lib/design-catalog.ts) and lib/dom-dump.js (from lib/dom-dump-script.ts), edit the source never the generated file (test/design-checklist-sync.test.ts).
  • CONTRIBUTING.md: lib/design-catalog.ts in the tree; generated-files and rebuild bullets cover the catalog and the two generated artifacts; new tier-1 bullet for the seven design suites plus test/dom-dump-hygiene.test.ts (CI or GSTACK_DOM_DUMP_HYGIENE=1).
  • ARCHITECTURE.md: template-system section notes the generator's two non-skill-doc outputs.
  • docs/PROJECT_STRUCTURE.md: resolvers/design-checklist, impeccable fixtures + fake-impeccable.ts shim, review/design-checklist.md marked GENERATED, docs/designs/IMPECCABLE_INTEROP.md named (now discoverable from CLAUDE.md).
  • docs/skills.md: /design-consultation writes the open DESIGN.md format (front-matter tokens, one-time conversion with backup, PRODUCT.md prefill); /design-html Slop gate paragraph; /review Design pass paragraph.
  • docs/TESTING_INTERNALS.md: dom-dump-hygiene on the browse-binary leg, opt-in outside CI.
  • Verified against code: 86 catalog entries (57 slop / 29 quality), 61 engine rules, 10 mockup-never names, ceiling 31,319. Already current on-branch: README, NOTICE.md, licenses/, TODOS.md deferrals, agents digest v1.82.0.0, CHANGELOG.

Documentation Debt

  • bin/gstack-design-detect.ts and bin/gstack-design-md.ts have reference coverage (file headers, CHANGELOG, PROJECT_STRUCTURE) but no how-to page; design_detector documented in gstack-config help plus README/skills.md one-liners. /document-generate candidate.

CI fixes on this branch

  • Free tests: the DOM hygiene test drove a private browse daemon that never came up under the six-shard runner and starved two unrelated files; it now drives Playwright Chromium directly (no daemon, no health window) and self-skips without the bundle.
  • Windows free tests: the checklist render pins compare paths with forward slashes.
  • Quality gate: the redaction test's planted PEM block is assembled at runtime so the diff scan never sees a key-shaped line.

Test plan

  • Free suite (bun run test, recorded with gstack-evidence): 9,212 tests ran, 9,209 pass. The 3 failures are browse/test/handoff.test.ts (needs a display; this Linux box has no X server); browse/ is byte-identical to main on this branch, so they cannot originate here.
  • Paid E2E: 92/95 on the full run with both branch-caused failures fixed and re-proven; 12/12 and 5/5 on the reruns against the final tree.
  • bun run test:windows passes (Step 8 audit).
  • gstack-design-detect.ts install run for real against github.com/pbakaus/impeccable engine-v0.1.3 into a scratch home: pinned hash matched, receipt + outcome in the ledger, the installed binary runs; a wrong --sha256 wrote nothing.
  • Fixtures captured from a real impeccable install (engine 0.1.3, 61 rules) in a scratch directory outside the repo; the design-system-* rules fire against gstack's converted DESIGN.md.
  • Not run here: Codex adversarial and structured review (sandbox launcher missing); test/dom-dump-hygiene.test.ts in a quiet Chromium (the browse daemon repeatedly missed its health window under eval load; it runs in CI).

🤖 Generated with Claude Code


Open workspace in Conductor

garrytan and others added 29 commits September 8, 2026 15:22
…tures

Real captures from a human-initiated `npx impeccable install` in a scratch
directory (engine 0.1.3, linux-x64), never a runtime download:

- test/fixtures/impeccable-antipatterns.json: upstream
  crates/live/assets/antipatterns.json at 87d8f6d6 (the state engine-v0.1.3
  shipped), 61 rules, source commit recorded in `_source`.
- test/fixtures/impeccable-detect-sample.json: `detect --json` over gstack's
  planted-slop fixture (source mode), paths normalized.
- test/fixtures/review-eval-design-slop.dom.html + impeccable-detect-dom-sample.json:
  the same page served locally, dumped through the browse engine with the
  shared DOM-dump script, then scanned. Pins the load-bearing assumption
  that the static engine reads inline <style> in a .html file: the DOM scan
  yields the same id set as the source scan.
- lib/dom-dump-script.ts: the one dump script both browser engines evaluate
  (IIFE, no single quotes). Folds CSSOM rgb() back to author hex so palette
  rules still fire, and removes inlined <link> nodes so the engine does not
  warn about an unresolvable stylesheet. Both verified against the engine.
- test/fixtures/impeccable-detect-help.txt + impeccable-captures.meta.json:
  the flags, exit codes, finding fields, and re-capture protocol.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
lib/design-catalog.ts is the single source of truth for gstack's design
anti-pattern vocabulary: the 11 legacy blacklist lines (verbatim, flagged
`legacyBlacklist`), every one of impeccable's 61 registry ids with gstack
prose, tier, impact, confidence, grep heuristic, and /impeccable handoff,
plus the gstack-only tells the LLM pass judges (hero metrics, identical
cards, glassmorphism, missing states, unthemed browser surfaces, ...).

`impeccableId` is set only when the id exists in the registry fixture, and
`renderCatalog({style:'ids'})` brackets an id only then, so rendered prose
never shows an id the detector cannot emit. Role-scoped font lists
(OVERUSED_FONTS_DISPLAY, BANNED_FONTS, FONTS_BODY_UI_OK, FONTS_MONO_OK,
FONTS_VERIFIED_FREE) live beside the entries.

scripts/resolvers/constants.ts now derives AI_SLOP_BLACKLIST from the
catalog. Generated output is byte-identical (bun run gen:skill-docs is a
zero diff). Pure module: no I/O, no scripts/ imports, loading prints
nothing, so bin/ can import it at runtime on every host.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
review/design-checklist.md was hand-written and its own header admitted it
drifted from DESIGN_METHODOLOGY category 9. It is now rendered by
scripts/resolvers/design-checklist.ts from lib/design-catalog.ts: category 1
lists every grep-detectable slop entry plus the legacy blacklist lines,
sorted HIGH/MEDIUM/LOW, each with its heuristic and, where the detector knows
the rule, its bracketed id (27 items, up from 6). The font blacklist renders
from BANNED_FONTS. Categories 2-5, Instructions, Classification, Output
Format, and Suppressions keep their prose. Title and slop heading are
unchanged (test/skill-e2e-review.test.ts and hosts/opencode.ts key on them).

gen-skill-docs writes the file for the Claude host only (a Claude-side
runtime asset; other hosts copy or inline the render), honors --out-dir, and
reports STALE/FRESH under --dry-run like sections do.
test/design-checklist-sync.test.ts pins committed == generated, the
host/out-dir scoping, and the dry-run freshness line.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
…ctrine

DESIGN_HARD_RULES: the classifier names four visitor modes (Persuade,
Operate, Read, Experience, plus Hybrid per section) and keeps the
MARKETING/LANDING PAGE and APP UI aliases; Read and Experience get three
rules each; a "Reflexes no detector catches" block (browser surfaces, one
authored motion moment, depth has an offset, tinted secondary text, space
above headings, light-or-dark from the use scene) and the three-looks
calibration follow the universal rules. The slop section renders the 11
legacy lines plus the detector rule ids and judgment tells from the catalog;
in design-review, which also renders DESIGN_METHODOLOGY, it becomes a
one-line pointer so the catalog is paid for once. Header counts are
computed, not hardcoded.

DESIGN_METHODOLOGY: category 9 renders the catalog in three registers
(legacy lines verbatim, detector rules that need judgment with bracketed
ids, gstack-only judgment tells as prose, polish-level ids on one line);
categories 5 and 7 carry the browser-surface and one-motion-moment reflexes;
the typography overused-face item points at [overused-font] with the
role-scoped exception. The consultation Codex prompt's anti-slop line reads
from the catalog.

Budget: design-review eager 25.6K -> 27.0K (ceiling 27,984), plan-design-review
unchanged at 17.4K; no carve-guard or context-budget re-baseline needed; ship
goldens unchanged (ship never renders the hard rules).

Derived from pbakaus/impeccable reference/craft-floor.md + new-work.md
(Apache-2.0), rewritten. See NOTICE.md (commit 12).

Co-Authored-By: Claude Fable 5.1 <[email protected]>
… color strategies

The proposal section stops handing out a font menu. "Choosing faces: a
procedure, not a menu" names the subject's world, shortlists per role,
strikes the overused list for that role, verifies availability in-session,
and states the loading strategy. {{OVERUSED_FONTS}} renders the role-scoped
lists from lib/design-catalog.ts: overused as display (the detector's
overused-font set plus the training-data defaults), fine as body/UI on an
Operate or Read surface, mono for data and code, banned in any role, and a
short verified-free list with its verification date. Color approaches become
Restrained / Committed / Full palette / Drenched. The anti-convergence
directive drops light-vs-dark as a dial (it comes from the use scene) and the
three-looks calibration sits under Your Design Knowledge. The slop list is
{{DESIGN_SLOP_BULLETS}}: prose from the catalog, no rule ids, polish-level
tells omitted.

design-html's "Never include (AI slop blacklist)" list keeps its literal
(carve guard) and each line now carries a trailing <!-- id --> naming a
catalog entry, pinned by test/design-catalog.test.ts so the last surviving
duplicate is derived-by-test. Both resolvers are registered and listed in
ARCHITECTURE.md. No carve-guard or budget re-baseline needed.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
bin/gstack-design-detect.ts finds and runs an impeccable engine the user
installed; it never installs, downloads, or executes anything that could
download. `probe` reads only: config (design_detector off → DISABLED),
IMPECCABLE_BIN (absolute, realpath outside the repo and cwd), a PATH walk
(absolute entries outside the repo; a #! shim counts as launcher-present,
never READY), the ~/.impeccable/bin/<newest semver>/ cache, and the engine
installed beside a skill launcher (scripts/bin/<os>-<arch>/impeccable, the
layout a real install produced). It reports IMPECCABLE_SKILL, host-aware
IMPECCABLE_HOOK (+ HOOK_OTHER), the ignore lists from .impeccable/config*.json,
IMPECCABLE_ENGINE_UNTESTED for versions outside the fixture set, and a hint
only when a launcher exists without its engine. `scan` re-probes, refuses
URLs and anything outside the repo root or the design-report allow-list
(realpath, so symlinks cannot escape), derives `--changed <base>` targets
NUL-safely through git and lib/frontend-scope.ts, batches 100 absolute paths
per engine call with stdin ignored, a SIGKILL timeout, a 50 MB stdout cap, and
sanitized length-capped fields, then prints one normalized JSON document
(--format gstack) or the engine's bytes (--format raw); DETECT_TOP (fenced as
untrusted content), DETECT_SUMMARY, and DETECT_EXIT go to stderr; exit code
passes through with 1 over 2 over 0; exit 3 is a gstack bug. `rules` prints
the mapped set. Every run appends a content-free line to the local analytics
file.

lib/design-detect-contract.ts owns every sentinel string, the limits, and the
normalized-finding shape (pure module); test/design-detect-contract.test.ts
asserts every sentinel-shaped token the agent can read exists there.
lib/frontend-scope.ts mirrors gstack-diff-scope's frontend arm, pinned by a
parity test that runs the bash script. bin/gstack-config gains
design_detector (auto | off, default auto, invalid values rejected with the
file unchanged). test/fixtures/fake-impeccable.ts is the env-driven engine
stand-in; test/gstack-design-detect.test.ts covers READY/NOT_CACHED/
NOT_AVAILABLE/DISABLED, env trust (.env never loaded, in-repo IMPECCABLE_BIN
ignored), newest-semver cache, hook and ignore detection, refusals, exit
passthrough, raw byte-identity, normalization, the display cap, timeout,
parse errors, diagnostics, --changed, and analytics. The egress scanner test
records the wrapper as a documented non-sink.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
…ew-lite, review army, design-html

The user-installed impeccable engine becomes a deterministic pre-pass in four
skills, through one resolver with three renders: {{DESIGN_DETECTOR}} (the probe
block and how to read every sentinel), {{DESIGN_DETECTOR:phase0}} (design-
review's mechanical scan), {{DESIGN_DETECTOR:gate}} (design-html's bounded slop
gate). Every rendered invocation is `bun --no-env-file run <bin>/gstack-design-
detect.ts ... --host <host>` and every scan ends with the DETECT_EXIT_CODE echo
so exit 2 (findings) never aborts a block.

design-review: probe in Setup; Phase 0 picks DOM mode (URL target) or source
mode (diff-aware, no URL) once; source mode scans the changed frontend files in
Setup, DOM mode never reads source (Rule 4). Phase 3 gains a DOM-dump step per
page: both browser engines load the shared script from lib/dom-dump.js (Aside
splices it into a double-quoted repl script; the fallback engine copies it into
a temp dir for `$B eval --out --raw`), the dump is size-capped, run through
gstack-redact (a HIGH finding skips the page), and persisted under
$REPORT_DIR/dom/$RUN_ID/; one scan runs after the last page, labeled "static
scan of the rendered DOM; cross-origin CSS not resolved". REPORT_DIR honors
GSTACK_HOME so the wrapper's allow-list and the report dir agree; RUN_ID is set
once in Setup. design-baseline.json is schemaVersion 2 with runId, targetSet,
base, and a detector block (mode, engine, byRule, byPage), written temp+rename
with a per-run copy; Regression Output diffs ids only when mode and target set
match, caveats an engine change, and calls live-page count deltas advisory.
Phase 7 hands deferred detector findings to the `handoff=` command the scan
printed; Phase 9 recomputes the same way and deletes the dumps unless
--keep-dom; Phase 10 reports `Detector: N → M`.

ship review-lite gains step 0 (probe, `scan --changed <base>`, tier buckets,
detector + checklist dedupe, advisory and ignored never count) and a
`detector` count in its log payload; the PR body gets a Detector line (rule
ids and counts only). The Review Army Design specialist runs the mechanical
pass at the top of review/design-checklist.md, which now carries it. design-
html probes after DESIGN_SETUP and runs the one-pass gate before screenshots.

lib/dom-dump.js is generated by gen-skill-docs from lib/dom-dump-script.ts
(Claude host, --out-dir aware, dry-run freshness) and pinned byte-equal, so the
prose never carries the script. The contract gains DETECT_JSON, DOM_DUMP_OK,
and the self-describing set; its test now checks both directions.

Budget: design-review eager 25.6K → 28.5K. The plan's target was +2.5K; after
the levers it named (ids-only detector rules, no inline script, trimmed prose)
it lands at +2.87K, and the remainder is doctrine and detector wiring, so the
ceiling moves to the captured 31,319 for design-review only (the full capture
would also have loosened 21 ceilings this branch never touched; those stay).
design-html skeleton re-baselined to 54,000 (measured 53,592). Codex and
Factory ship goldens refreshed (review-lite step 0 and the PR-body line render
inline there).

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Ten catalog ids carry `mockupNever` (kicker-above-heading, icon-tile-stack,
gradient-text, ai-color-palette, cream-palette, nested-cards, dark-glow,
pulsing-dot, identical-cards, hero-metrics) and lib/design-catalog.ts exports
their deduped plain-English names as MOCKUP_NEVER_NAMES. briefToPrompt() in
the design binary appends "Never: <names>." before its fixed tail, so `$D
generate | variants | evolve` stop reaching for purple gradients, icon tiles,
and cream defaults before the comparison board opens. The binary still
bundles (`bun build --compile design/src/cli.ts`); ./setup rebuilds it.

design-html's Never-include list now covers every mockupNever id (kicker /
icon tile, hero metric rows, gradient text, cream palette, nested and
identical cards, glow and pulsing dots), each line tagged with its catalog
ids; test/design-catalog.test.ts pins the exact ten flags, the deduped names,
and that the template list is a superset. New design/test/brief.test.ts pins
the prompt shape.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
lib/design-md.ts implements the open DESIGN.md format (google-labs-code/
design.md, Apache-2.0): YAML front matter with the five token groups (colors,
typography, rounded, spacing, components) and eight canonical `##` sections
in spec order (Overview, Colors, Typography, Layout, Elevation & Depth,
Shapes, Components, Do's and Don'ts), aliases mapped, extras preserved after
them in their original order. parseDesignMd never throws (unparsable front
matter → `unknown` with a reason); renderDesignMd re-emits the preserved front
matter bytes and only `convert` writes fresh YAML through a small block-style
emitter (Bun.YAML.stringify is flow style); upsertSection splices the body
only; tokensFlat resolves `{path}` references to primitives and reports group,
self, dangling, and cyclic refs as DESIGN_MD_TOKEN_REF_INVALID. convertLegacy
turns gstack's pre-spec DESIGN.md into the open format: Product Context and
Aesthetic Direction fold into Overview, Typography roles become
display/body/label/mono tokens (mono carries fontFeature: tnum), Color hexes
become colors (mode-qualified labels keep their qualifier; strategy lines are
not colors), the Spacing scale and Layout radii become spacing and rounded,
Motion / Grain Texture / Decisions Log survive as extras. The format marker
lives inside the file: a YAML comment on line 2 of a spec file, an HTML
comment on line 1 of a legacy file.

bin/gstack-design-md.ts: `check` (DESIGN_MD_FORMAT + marker), `convert
[--write]` (backup to DESIGN.md.legacy.bak, temp+rename, refuses ambiguous
input with DESIGN_MD_CONVERT_REFUSED), `tokens` (flat JSON), `mark
<spec|legacy-keep>`. Exit 3 + DESIGN_MD_INTERNAL_ERROR is a gstack bug.

design/src/memory.ts: updateDesignMd upserts "Extracted Design Language"
through the lib (front matter bytes untouched, canonical order kept, section
replaced on rerun) and creates a spec skeleton with tokens from the extraction
when no file exists; readDesignConstraints leads with the flat tokens and the
Overview for spec files. The design binary still bundles.

test/design-md.test.ts pins all of it against gstack's own DESIGN.md.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
… choice

gstack's design skills now write DESIGN.md in the open DESIGN.md format and
read tokens from it. {{DESIGN_MD_CHECK}} renders the format check through
bin/gstack-design-md.ts: design-consultation's Phase 0 settles the format once
(spec → update tokens in the front matter; legacy without a marker → one
AskUserQuestion: convert with a .legacy.bak, keep the legacy file, or start
fresh; the answer is written into the file as the format marker so no skill
asks again; a marker already present is obeyed silently; unknown → prose;
missing → Phase 6 writes one). Phase 6's template is the spec form: YAML front
matter with name, description, and exactly the five token groups (colors,
typography.display/body/label/mono with fontFeature: tnum on mono, rounded,
spacing, components with {path} references), then Overview (Creative North
Star, product context, mode per surface, references, key characteristics),
Colors (opening with the Restrained / Committed / Full palette / Drenched
strategy), Typography, Layout, Elevation & Depth, Shapes, Components, Do's and
Don'ts, plus gstack's Motion and Decisions Log as extras; the template ends
with a check that the file parses as `spec`.

design-review runs the `:calibrate` form in Setup: a spec file's flat tokens
are the calibration source (a value present in the tokens is never a finding),
the marker is respected, and conversion is never offered there; its DESIGN.md
export writes the spec form. design-html's token extraction writes the spec
form and respects an existing choice. review/design-checklist.md category 5 and
ship's review-lite step 1 name `gstack-design-md tokens` as the calibration
source; plan-design-review Pass 5 cites tokens by path when front matter
exists.

The contract owns the bin's DESIGN_MD_MARKER / REASON / WRITTEN / BACKUP
lines; the contract test's pending list closes. Carve guard: design-
consultation skeleton 66,500 → 67,500 (measured 67,014; +1,508 B against the
1.5 KB cap). Codex and Factory ship goldens refreshed (review-lite step 1).

Co-Authored-By: Claude Fable 5.1 <[email protected]>
design-consultation's context gathering and design-shotgun's auto-gather read
PRODUCT.md (impeccable's product-context file) when it exists: it counts as
the user's prior answers, gets confirmed in one line, and is never re-asked.
Neither skill opens `.claude/skills/impeccable/**`; PRODUCT.md and DESIGN.md
are the shared surface, and impeccable's prose never loads inside a gstack
skill.

Handoffs: ship's review-lite ends each NEEDS INPUT detector row with the
`handoff=` command the scan printed (`/impeccable <cmd>`) when the probe
reported IMPECCABLE_SKILL: present, recommending the command and never
opening its files; design-review's Phase 7 does the same for deferred
findings, and `design_detector: off` silences handoff lines with the rest.
Codex and Factory ship goldens refreshed.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
`gstack-design-md convert --write` on the repo's DESIGN.md: tokens in YAML
front matter (typography.display/body/label/mono, colors with their light/dark
qualifiers, spacing scale, rounded scale), Overview from Product Context and
Aesthetic Direction, Colors / Typography / Layout as canonical sections, Motion,
Grain Texture, and Decisions Log preserved as extras, format marker on line 2.
Hand-checked; `check` reports spec with no token-reference errors. A Decisions
Log row records the conversion and that DM Sans stays the body face: it is on
the overused-as-display list, and body/UI use on an Operate surface is the
allowed exception under the role-scoped rule.

The pre-conversion file lives on as test/fixtures/design-md-legacy.md, which
test/design-md.test.ts now uses for its legacy cases; the converted root file
is asserted to be spec.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
NOTICE.md names what gstack derived from impeccable (rule ids and names in
the catalog and the registry fixture; the visitor modes, craft-floor
reflexes, and calibration in the design resolvers; the font procedure in the
consultation template) and from Google's DESIGN.md specification (the format
lib/design-md.ts implements), states that gstack does not distribute or audit
the impeccable engine, and points at licenses/Apache-2.0.txt (verbatim).

README: the design-consultation, design-review, and design-html rows say what
changes when impeccable or the open DESIGN.md format is in play, and a "Works
with impeccable" paragraph explains the pre-pass, the shared ids, PRODUCT.md
and DESIGN.md as the shared surface, the handoffs, the no-nag posture without
impeccable, and the off switch. docs/skills.md gets the detector paragraph
under /design-review. docs/PROJECT_STRUCTURE.md lists the new lib and bin
files, NOTICE.md, and licenses/. docs/designs/IMPECCABLE_INTEROP.md promotes
the CEO plan (its ~/.gstack copy is flipped to PROMOTED) with a "what
shipped" summary. TODOS.md files the seven deferrals from the reviews: the
design-review Phases 7-11 carve (the budget lever, with the +2.87K vs 2.5K
landing recorded), the Bun .env audit across bin/*.ts, the Kiro bin/lib gap,
the $D check slop rubric, taste-profile interplay, the CEO Section 11
bullets, and the scan cache.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Touchfiles: the catalog, contract, detector bin, checklist resolver, review-
army resolver, and DESIGN.md lib join the dep lists of review-design-lite,
design-review-fix, the design-consultation cases, and plan-design-review-no-
ui-scope, so editing any of them re-selects the tests that read their output.
Three new E2E keys: design-review-detector-shim (gate; source mode on a
feature-branch diff), design-review-detector-shim-dom (gate; DOM mode: the
slop fixture served on loopback, dumped through the browse binary with
lib/dom-dump.js, persisted under a GSTACK_HOME-scoped REPORT_DIR, scanned once;
self-skips when browse/dist/browse is absent), and design-html-slop-gate
(periodic; one fix pass, at most two scans, remaining findings accepted with
reason). Every case reaches the engine through test/fixtures/fake-impeccable.ts
via IMPECCABLE_BIN from outside the temp repo, reads extracted skill sections
(never a whole SKILL.md) with the installed bin path rewritten to this
checkout, and asserts the probe ran, the right scan verb ran, `npx impeccable`
never did, and the output carries FINDING rows tagged [ai-color-palette] and
[low-contrast]. review-design-lite gets the fake engine and an eighth tally
signal for a detector row; its 4-hit threshold is unchanged.

test/gstack-design-detect.test.ts evaluates design-review's REPORT_DIR
expression with GSTACK_HOME set and proves a dump under it is accepted by the
wrapper's allow-list. The sample fixtures were real captures from commit 1
(engine 0.1.3), so there is nothing hand-written left to swap.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
…ow-list --changed targets; sanitize engine text

Pre-landing review findings (security + checklist), all reproduced before the fix:

- A checked-out branch could commit `.claude/skills/impeccable/scripts/bin/<os>-<arch>/impeccable`
  and the probe would report READY and `scan` would run it, with the agent's full
  environment. Launchers and sibling engines under the repo or cwd now count as
  "skill present" only (IMPECCABLE_NOT_CACHED: repository-local install, and the
  hint never names a repository-local launcher to run); only HOME-rooted installs,
  IMPECCABLE_BIN, the cache, and PATH entries outside the repo qualify, all by
  realpath. The engine now sees a minimal environment (PATH, HOME, TMPDIR, locale,
  IMPECCABLE_*), never the agent's tokens.
- `scan --changed <base>` pushed git-derived paths without the allow-list, so a
  committed symlink with a frontend extension handed a file outside the repo to
  the engine. Derived targets now go through the same allow-list as explicit ones
  and symlinks named by git are refused outright.
- A repo-controlled `scripts/VERSION` with embedded newlines forged probe lines;
  the version is trusted only when it is semver, and every printed version is
  sanitized. Engine text containing the untrusted-content fence or a
  `SENTINEL:` prefix is neutralized with a zero-width space
  (neutralizeSentinels in the contract), so page text cannot close the envelope
  or forge a probe line.
- A failing `git diff <base>...HEAD` (unknown or unfetched base) was swallowed
  and read as "no frontend changes"; it is now DETECT_REFUSED with exit 1.
- The scan allow-list root follows `${GSTACK_HOME:-$HOME/.gstack}` like the
  templates and gstack-slug (config.yaml keeps gstack-config's STATE_ROOT
  precedence); a quoted or commented design_detector value reads correctly.

Smaller: raw engine chunks are kept only in --format raw; diagnostics are
capped (200 kept, 20 echoed); the engine identity hash reads size + 4 MB, not
the whole binary; PROBE_STEP and ENGINE_STDERR are contract sentinels; the
--verbose gate covers every probe step; analytics use one sentinel vocabulary;
bare limits live in DETECT_LIMITS. The fake engine's knobs are IMPECCABLE_FAKE_*
(so they pass the minimal env) and a shared test helper installs it. New tests
cover each item above plus clean runs, `{}` parse errors, missing paths, and the
50 MB stdout cap.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
…; refuse a contradictory mark

renderDesignMd re-sorted canonical section names into spec order on every
render, so `gstack-design-md mark legacy-keep` (the "leave it alone" answer)
and the design binary's mockup extraction reordered a legacy DESIGN.md
(Typography and Layout jumped to the top) and normalized its whitespace, while
the bin promised "body bytes untouched". `mark` now splices only the marker
line (insertMarker) and `updateDesignMd` splices only its own section
(spliceSection); every other byte of an existing file is preserved, and spec
order applies only to files that open with front matter. `mark` refuses a
choice that contradicts the file's format (spec on a non-spec file,
legacy-keep on a spec file) with DESIGN_MD_CONVERT_REFUSED, exit 2, file
unchanged. convertLegacy keeps intro prose under the title instead of
rebuilding the preamble from the title alone. detectFormat returns a
machine-readable `code` beside the prose reason (the bin no longer branches on
reason text); the marker regexes derive from FORMAT_MARKER_PREFIX and
FORMAT_CHOICES; the hop limit and legacy identity headings are named
constants; slug is exported and reused; both writers use lib/fs-atomic.ts.
Tests pin byte identity for mark and updateDesignMd on the legacy fixture,
the refusal paths, and the preserved preamble.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
…rine with the catalog

The DOM-dump script is an arrow function, not a self-calling IIFE: Aside's
`pg.evaluate($_DUMP)` receives the function and runs it in the page (the IIFE
form executed in the repl sandbox, where `document` does not exist), and the
fallback engine calls it with `$B js "($_DUMP)()" --out --raw`. Hygiene widens
to every URL-bearing attribute (src, srcset per candidate, poster, action,
formaction, data, ping, cite lose their query strings and fragments) and to
data: URLs inside existing <style> nodes. The persist and scan blocks restate
REPORT_DIR and RUN_ID literally instead of relying on a shell variable from an
earlier block; the baseline's targetSet is defined per mode (repo-relative
paths in source mode, page slugs in DOM mode) so DOM-mode deltas can match; the
PR-body Detector line lists the states the probe can actually print. The DOM
fixture is re-captured with the new script from outside the repo (the engine
walks up from cwd for DESIGN.md, which the metadata now records).

Doctrine contradictions the design specialist found: the landing-page motion
rule matches the one-authored-moment reflex; the background rule names the
catalog's halo/spotlight/stripe/grid slop instead of asking for gradients; the
universal font rule is scoped to the display voice with the body/UI exceptions;
"two typefaces max" allows the mono; the methodology's banned-font line renders
BANNED_FONTS; Courier New is banned outright; the Brutalist, Retro-Futuristic,
and Playful menu entries stop recommending system stacks, glow, and bounce; the
coherence nudge uses the decoration vocabulary; Path A's gate names the display
voice; font-loading prose points at the source the procedure verified;
centered-everything is MEDIUM (an aggregate heuristic); the mockup guard reads
"Never by default (unless the brief above asks for it)". The checklist's
AUTO-FIX list renders the catalog's auto-fix rules; category 9 and the Hard
Rules pointer count from the same partition helpers (detectorSlopEntries,
judgmentTellEntries); the handoff list renders from HANDOFF_COMMANDS; a missing
catalog id fails gen-skill-docs by name. gstack's own DESIGN.md gains border
tokens and Decisions Log rows for its live-feed pulse and 11px mono labels.
frontend-scope is case-sensitive like the bash arm. gen-skill-docs shares one
emitGenerated helper for sections and lib-derived assets; renderCatalog keeps
the one style with a caller. Tests: shared sliceBetween that fails on a missing
end marker, the slop-gate fixture's real end marker, an isolated browse daemon
for the DOM-mode E2E, the DOM hygiene test gated to CI or opt-in, docs notes
for the two superseded plan sentences.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
…project; DOM dumps scan without inline ignores

Second review cycle, security + checklist:

- IMPECCABLE_BIN=/bin/sh (or node) was READY, and `detect` with cwd=repoRoot
  made the interpreter run the repository's own `detect` file. Every engine
  candidate (env override, PATH entry, cache, sibling) is now judged by the
  realpath of the FILE and must be named impeccable[.exe]; PATH and cache
  candidates that resolve into the repository are skipped like the others.
  "Inside the project" means the repository, or cwd when cwd is a project
  directory: HOME and its ancestors are exempt, so a URL-mode review launched
  from HOME still finds the HOME-rooted installs.
- A base for --changed that starts with `-` was spliced into git argv
  (`--output=<file>` made git write a file and report no changes); an option-
  like or missing base is DETECT_REFUSED (not a ref name), exit 1, and the
  parser no longer defaults a missing value to main.
- DOM dumps are the audited page's bytes, so an in-file `impeccable-disable`
  comment there is page-controlled: batches under the designs root run with
  --no-inline-ignores, repository batches keep the project's own ignores.
- neutralizeSentinels covers the shapes it missed (bare sentinels such as
  DETECT_TOP total= and IMPECCABLE_DISABLED, the DETECT_EXIT_CODE= echo, the
  `[rule-id] impact=` group header) in one precompiled alternation instead of
  37 replaceAll passes per field; only kept findings are normalized, and the
  summary's total stays the engine's count.
- The minimal engine environment compares keys case-insensitively on Windows
  (process.env enumerates Path, SystemRoot there) and passes PATHEXT, COMSPEC,
  HOMEDRIVE, HOMEPATH, PROGRAMDATA.
- Bare 64s move into DETECT_LIMITS; the unused SentinelName type is gone; the
  header states the directory-target contract (the engine's own walk).

Tests: an interpreter as IMPECCABLE_BIN never runs the repo's detect file; a
PATH symlink into the repository is never READY; option-like and empty bases
are refused with no file written; the designs-root batch carries
--no-inline-ignores and the repo batch does not; the identity label is
deterministic per binary; the bare-sentinel and header shapes are neutralized;
the installed fake engine works without IMPECCABLE_FAKE_OUTPUT (the helper
copies the sample beside it); two tests clean up in finally.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
…, control characters quoted

- insertMarker and spliceSection normalized every line ending to LF, so a CRLF
  DESIGN.md came back rewritten beyond the one line they promised to touch.
  Both detect the file's dominant line ending and restore it.
- parseDesignMd and spliceSection each walked headings with their own fence
  tracking; they now share headingLines (and upsertSection shares
  headingMatches). An unclosed ``` is treated as prose for that file: it used
  to swallow every later section on a splice.
- A token value carrying a control character (an LLM-extracted font family
  with an embedded newline) was emitted as a bare multi-line scalar that
  Bun.YAML rejects, turning a freshly written DESIGN.md into
  frontmatter-unparsable; needsQuotes routes it through the quoted form.
- The marker-line regex variants are built once beside YAML_MARKER_RE; the
  dead setMarker export and a no-op ternary are gone; LEGACY_HEADINGS derives
  from the identity list; the header diagram names the text-level editors as
  the write path for user-owned files; the bin validates and prints the mark
  choices from FORMAT_CHOICES.

Tests: CRLF round-trips for both editors, a fenced ## inside a section and an
unclosed fence, and a newline-bearing scalar parsing back.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
…zed to the dump cap; doctrine made consistent

- The DOM-dump Aside block was the only double-quoted `aside repl` script in
  the tree (to splice the function text), which put the agent-filled <url>
  inside a double-quoted bash string: a same-origin href carrying $(...) would
  run in the reviewer's shell when Phase 3 opened that page. The script is
  single-quoted like every other Aside script and the function text enters
  through a closed-quote segment ('"$_DUMP"'); the fallback line is
  `$B js '('"$_DUMP"')()'`. A free test pins that no rendered Aside script
  opens with a double quote.
- The persist block capped dumps at 10 MiB but ran gstack-redact with its
  1 MiB default, so every real page between the two was deleted as
  DOM_DUMP_REDACTION_BLOCKED; the gate passes --max-bytes at the dump cap and
  blocks on any exit other than clean (0) or MEDIUM (2), so a redaction tool
  that fails to run can no longer fall through to "persist".
- Dump hygiene removes <template> and <noscript> subtrees (invisible to the
  attribute walk), inline on* handlers, and the cross-origin <link> nodes
  already named in the note, so the file handed to the engine references no
  remote stylesheet.
- Doctrine: the Codex design-voice prompts said "2-3 intentional motions"
  against the one-authored-moment rule; the overused-display heading scoped
  its ban to Persuade/Experience while the catalog and hard rules ban it
  everywhere; design-consultation's Important Rule 4 still said "as primary";
  design-html's blacklist header is now "Never include by default" with the
  mockup/DESIGN.md/user-ask override the catalog grants; the slop gate honors
  Decisions Log and Do's and Don'ts blessings like /review does; the landing
  "poster" line says poster in stance, not type size; the design binary's
  variant dials no longer flip light/dark for variety; gstack's DESIGN.md
  rows name data labels (UI labels stay the DM Sans token) and call the
  skill-bar fill and hovers functional transitions.
- design-review names how the base branch is found (gh pr view, then the
  repo default; never main) for the source-mode scan and the diff-aware mode.
- frontend-scope matches the config globs at the repo root only, like the
  bash arm; the parity test carries nested samples.
- Cleanups: renderCatalog's stale style option, an unused import, the
  identity-map bannedFontNames, the checklist header's "same entries" claim,
  the catalog header's consumer list, the orphaned main() docstring, the
  plan doc's IIFE bullet. design-html's skeleton ceiling is re-measured
  (54,184) for the two doctrine sentences.

Tests: AUTO-FIX rendering from the catalog, the E2E slice markers checked in
the free suite, the hygiene cases for templates/noscript/handlers/remote
links, and the review E2E counting detector rows separately from the seven
checklist plants.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
…line ignores; a whole-scan budget; prototype-safe rule counts

Third review cycle + Red Team, all reproduced before the fix:

- With no repository, the wrapper adopted cwd as the repo root, so a review
  launched from HOME (URL mode can run from anywhere) rejected every
  HOME-rooted install as "repository-local", reported the user's own skill
  install with the wrong hint, and, for targets, accepted all of HOME
  (~/.ssh/id_rsa scanned). A project directory is now one strictly below
  HOME: `git init ~` never turns the user's installs into repository files,
  and from HOME only the designs allow-list qualifies as a target.
- --no-inline-ignores keyed on "not inside the repo", which misclassified
  dumps when GSTACK_HOME sits under the repo and stripped the design-html
  gate's own `<!-- impeccable-disable -->` from finalized.html. Targets are
  classified as project / dom-dump (designs/<audit>/dom/**, the page's bytes)
  / artifact (other designs/ files, gstack-authored); only dumps drop inline
  ignores.
- A repository's .impeccable/config.json can hide rules from the review;
  detector.ignoreValues was never surfaced. The probe prints
  IMPECCABLE_IGNORED_VALUES beside the rules, and the prose stops calling
  repo-config ignores "a decision the user made".
- An engine id named `constructor` corrupted byRule through
  Object.prototype and `__proto__` counts vanished; byRule is a null-
  prototype object and an id that fails the shape check is `unmapped` as a
  key too.
- Batches ran with no total budget (10,000 un-ignored files: hours). The
  scan stops at 5x the per-batch timeout with DETECT_TIMEOUT and exit 1.
- The scan JSON carries an `untrusted` list of the engine- and page-derived
  fields, so the agent reading past the fenced DETECT_TOP block is told what
  is evidence.
- The PATH walk keeps launcher-present for a .cmd wrapper or a differently
  named real file (the name gate applies to READY only).

Tests: probe and scan from a fake HOME (cache READY, HOME file refused, dump
scanned without inline ignores), artifact vs dump batches, prototype-member
ids, the whole-scan budget over 11 batches, ignoreValues surfaced, the
`untrusted` field.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
…the majority line ending, refuse an unclosed fence

- `mark`, `convert --write`, and the design binary's extraction replaced a
  symlinked DESIGN.md (a docs-site layout) with a regular file and left the
  real target untouched; both writers resolve the link first.
- A single stray CRLF flipped a whole LF file to CRLF: the editors now keep
  the majority ending. A UTF-8 BOM broke format detection and ended up
  mid-file after `mark`; it is recognized and kept at byte 0.
- Re-running `mark` on a marked file deleted the blank line after the marker
  (`\s*$` matched across the newline); the marker regexes use `[ \t]*`.
- Fences: readers follow markdown (an unclosed fence runs to EOF); the
  text-level editors refuse such a file with DesignMdEditRefused
  (DESIGN_MD_EDIT_REFUSED) instead of splicing the wrong section, and the
  design binary reports that and leaves the file alone.
- needsQuotes also quotes a scalar containing ` #` (an inline-comment
  shape parsed back as a truncated value).

Co-Authored-By: Claude Fable 5.1 <[email protected]>
…s persist owner-only; ignore prose treats repo config as evidence

- The dump script cuts query strings from CSS url() in style attributes,
  <style> nodes, and the inlined stylesheets (signed asset URLs), empties
  srcdoc, and covers background and xlink:href.
- Persisted dumps are chmod 600; MEDIUM redaction findings persist (an
  authenticated page shows emails) and the prose says so; earlier runs'
  dumps are swept before the first dump of a run unless --keep-dom.
- The Aside dump prose asks for `'` in a pasted URL to be percent-encoded
  (a bare single quote would end the script) and never to paste an unread
  URL.
- Repo-config ignores are evidence, not settled decisions, in /review,
  /ship, and design-review's probe prose; the scan JSON's text fields are
  named as untrusted.
- design-html's skeleton ceiling is re-measured (54,545); ship goldens
  refreshed for the checklist prose.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
…e lines on stderr; refused base always exits 1; PATH loses project entries

Adversarial review (Claude subagent):

- A DIRECTORY target under designs/ (the audit dir, which the prose hands the
  agent as REPORT_DIR) classified as an artifact, so the engine walked its
  dom/ subtree WITH inline ignores honored. Any directory under designs/ is
  now scanned as dumps.
- A scan whose probe no longer finds an engine wrote its sentinel lines to
  stdout and exited 0, so `scan > "$_DJ"` captured "IMPECCABLE_NOT_AVAILABLE"
  as the scan result and the rendered bash read a clean scan. Probe lines go
  to stderr on every path; stdout is the JSON document or nothing.
- A refused --changed base exited 0/2 when explicit targets were also given;
  it folds into the exit code (1 over 2 over 0). A trailing --changed no
  longer defaults to main.
- A hand-edited `design_detector: Off` re-enabled the detector; the value is
  compared case-insensitively.
- The engine inherited PATH entries inside the project (a direnv .envrc
  adding node_modules/.bin); those are filtered like every other project path.
- DOM_DUMP_MISSING names the case where the dump script wrote nothing.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
… fences, ~~~ blocks, duplicate headings, YAML 1.2 numerics

- insertMarker keyed on "starts with ---", so a legacy file opening with a
  horizontal rule got a `# gstack:` line rendered as a heading that the
  parser then never read back (the conversion question re-asked every run).
  It keys on parsed front matter.
- A closing front-matter fence with trailing spaces (`---  `) made a valid
  spec file `unknown`; the closer is any whole `---` line.
- `~~~` fences hid nothing, so a `## ` inside one was a section boundary and
  a splice corrupted the fence; both fence kinds are tracked and only the
  same kind closes an opener.
- convertLegacy silently kept the first of two `## Layout` bodies (and one
  of `## Color` / `## Colors`); it refuses with DESIGN_MD_CONVERT_REFUSED and
  the bin leaves the file and writes no backup.
- needsQuotes covers 0x / 0o / .inf / .nan (YAML 1.2 numerics that changed
  type on round-trip); emitYamlBlock throws on an object inside an array
  instead of writing "[object Object]".
- The design binary coerces the model's extraction JSON at the parse
  boundary (null names, missing arrays) so the paid call's result survives.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
…CSS; no cross-run dump sweep; probe-state and design-system caveats in prose

- The dump inlined every linked sheet's rules as active CSS, so a print
  sheet's 12pt black text or an alternate theme produced tiny-text and
  palette findings the user never sees; disabled and alternate sheets are
  skipped and a media-scoped sheet is wrapped in its @media block.
- The cross-run dump sweep is gone: two same-day reviews shared REPORT_DIR
  and one run's sweep deleted the other's dumps mid-audit. Dumps stay per
  run, owner-only, deleted after Phase 9 unless --keep-dom (now defined in
  the prose), and an interrupted run's dumps wait for the user.
- Prose: design-system-* rows in DOM mode compare the page to THIS repo's
  DESIGN.md and apply only to the repo's own app; an empty scan JSON with
  exit 0 means the probe state changed since Setup (read stderr); the
  persist block names a missing dump instead of mislabeling it as a
  redaction block.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@trunk-io

trunk-io Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

@github-actions

github-actions Bot commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

E2E Evals: ❌ FAIL

93/94 tests passed | $13.33 total cost | reconcile exit: 0

Shard Result Status Cost
e2e-browse/skill-e2e-bws 7/7 ✅ $0.41
e2e-coverage-audit/skill-e2e-coverage-audit 2/2 ✅ $0.17
e2e-cso/skill-e2e-cso 1/1 ✅ $0.5
e2e-deploy/skill-e2e-deploy 6/6 ✅ $1.21
e2e-design/skill-e2e-design 2/3 ❌ $0.47
e2e-docsync-spawned/skill-e2e-docsync-spawned 1/1 ✅ $0.17
e2e-hermetic/skill-e2e-hermetic-canary 2/2 ✅ $0.02
e2e-learnings/skill-e2e-learnings 1/1 ✅ $0.12
e2e-opus-47/skill-e2e-opus-47 6/6 ✅ $1.37
e2e-plan-tune/skill-e2e-plan-tune 1/1 ✅ $0.23
e2e-plan/skill-e2e-plan 7/7 ✅ $1.97
e2e-qa-workflow/skill-e2e-qa-workflow 3/3 ✅ $1.04
e2e-retro/skill-e2e-retro 1/1 ✅ $0.34
e2e-review-army/skill-e2e-review-army 5/5 ✅ $0.85
e2e-review-attribution/skill-e2e-review-attribution 3/3 ✅ $0.34
e2e-review/skill-e2e-review 2/2 ✅ $0.25
e2e-session-intelligence/skill-e2e-session-intelligence 4/4 ✅ $0.31
e2e-ship-docsync/skill-e2e-ship-docsync 1/1 ✅ $0.43
e2e-skillify/skill-e2e-skillify 3/3 ✅ $1.34
e2e-third-party-actions/skill-e2e-third-party-actions 5/5 ✅ $0.36
e2e-triage/skill-e2e-triage 1/1 ✅ $0.17
e2e-workflow/skill-e2e-workflow 4/4 ✅ $0.76
llm-judge/skill-llm-eval 25/25 ✅ $0.5
Fail-closed reconciliation
 test/skill-e2e-skillify.test.ts
  slice 2  passed              0s  test/skill-routing-e2e.test.ts
  slice 3  passed              0s  test/skill-e2e-autoplan-dual-voice.test.ts
  slice 3  passed            105s  test/skill-e2e-design.test.ts
  slice 3  passed              0s  test/skill-e2e-ios-device.test.ts
  slice 3  passed              0s  test/skill-e2e-office-hours-brain-writeback.test.ts
  slice 3  passed             59s  test/skill-e2e-plan-design-with-ui.test.ts
  slice 3  passed              0s  test/skill-e2e-plan-tune-cathedral.test.ts
  slice 3  passed            302s  test/skill-e2e-review-army.test.ts
  slice 3  passed             83s  test/skill-e2e-third-party-actions.test.ts
  slice 4  passed             83s  test/skill-e2e-bws.test.ts
  slice 4  passed             30s  test/skill-e2e-diagram.test.ts
  slice 4  passed              0s  test/skill-e2e-ios-swift-build.test.ts
  slice 4  passed              0s  test/skill-e2e-office-hours-phase4.test.ts
  slice 4  passed            197s  test/skill-e2e-plan-devex-finding-floor.test.ts
  slice 4  passed             63s  test/skill-e2e-plan-tune.test.ts
  slice 4  passed            107s  test/skill-e2e-review-attribution.test.ts
  slice 4  passed             41s  test/skill-e2e-triage.test.ts
  slice 5  passed              0s  test/skill-e2e-context-skills.test.ts
  slice 5  passed             58s  test/skill-e2e-docsync-spawned.test.ts
  slice 5  passed              0s  test/skill-e2e-ios.test.ts
  slice 5  passed              0s  test/skill-e2e-office-hours.test.ts
  slice 5  passed            485s  test/skill-e2e-plan-devex-plan-mode.test.ts
  slice 5  passed            298s  test/skill-e2e-plan.test.ts
  slice 5  passed             84s  test/skill-e2e-review.test.ts
  slice 5  passed            205s  test/skill-e2e-workflow.test.ts
  slice 6  passed             37s  test/skill-e2e-coverage-audit.test.ts
  slice 6  passed              0s  test/skill-e2e-first-task-scaffold.test.ts
  slice 6  passed             22s  test/skill-e2e-learnings.test.ts
  slice 6  passed             19s  test/skill-e2e-opus-47.test.ts
  slice 6  passed              0s  test/skill-e2e-plan-format.test.ts
  slice 6  passed              0s  test/skill-e2e-qa-bugs.test.ts
  slice 6  passed             61s  test/skill-e2e-session-intelligence.test.ts
  slice 6  passed              0s  test/skill-llm-eval-spec.test.ts
[test:paid] report: ⚠ 14 shard(s) passed with EVERY test skipped — they verified nothing:
  ⚠ test/llm-judge-recommendation.test.ts (1 skipped — external service missing or tier mismatch)
  ⚠ test/skill-e2e-gbrain-roundtrip-local.test.ts (3 skipped — external service missing or tier mismatch)
  ⚠ test/skill-e2e-plan-prosons.test.ts (12 skipped — external service missing or tier mismatch)
  ⚠ test/skill-routing-e2e.test.ts (10 skipped — external service missing or tier mismatch)
  ⚠ test/skill-e2e-autoplan-dual-voice.test.ts (3 skipped — external service missing or tier mismatch)
  ⚠ test/skill-e2e-ios-device.test.ts (4 skipped — external service missing or tier mismatch)
  ⚠ test/skill-e2e-office-hours-brain-writeback.test.ts (3 skipped — external service missing or tier mismatch)
  ⚠ test/skill-e2e-plan-tune-cathedral.test.ts (5 skipped — external service missing or tier mismatch)
  ⚠ test/skill-e2e-office-hours-phase4.test.ts (3 skipped — external service missing or tier mismatch)
  ⚠ test/skill-e2e-context-skills.test.ts (9 skipped — external service missing or tier mismatch)
  ⚠ test/skill-e2e-office-hours.test.ts (6 skipped — external service missing or tier mismatch)
  ⚠ test/skill-e2e-first-task-scaffold.test.ts (1 skipped — external service missing or tier mismatch)
  ⚠ test/skill-e2e-plan-format.test.ts (12 skipped — external service missing or tier mismatch)
  ⚠ test/skill-e2e-qa-bugs.test.ts (5 skipped — external service missing or tier mismatch)
[test:paid] report: every planned shard accounted and passed

Sliced lane: diff-selected gate census via scripts/test-paid-shards.ts (planner → 6 executors → fail-closed report)

Failures

  • ❌ /design-review detector shim (dom): success

garrytan and others added 6 commits September 9, 2026 04:51
…ectly

Under the six-shard CI free suite the test's private browse daemon never
answered its health probe (two minutes of retries), failed the shard, and
starved two unrelated test files into failing before the runner's timeout.
The test now launches the same Chromium through playwright-core and calls the
dump function with page.evaluate, the way Aside's pg.evaluate does: no state
file, no daemon, no health window. It self-skips when the Playwright Chromium
bundle is absent. Two more hygiene rules are pinned along the way (print
sheets keep their @media, alternate sheets are dropped).

Co-Authored-By: Claude Fable 5.1 <[email protected]>
gen-skill-docs prints repo-relative paths with the OS separator, so the
checklist render pins (`GENERATED: review/design-checklist.md`) failed on the
Windows lane against `review\design-checklist.md`.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
The quality gate scans every added line of the PR diff through gstack-redact;
the redaction test's literal PEM header was a HIGH finding on our own test
file. The block is now built from fragments, so the scanned file never carries
a key-shaped line while the test still plants a HIGH finding.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
…d receipted

`gstack-design-detect.ts install` is the one download gstack makes, and only
after a design skill's one-time question got a yes. It fetches the engine
version gstack has tested (0.1.3) for this platform from impeccable's own
GitHub release, verifies it against the checksum pinned in
lib/design-detect-contract.ts (all five platforms, captured from the
release's .sha256 sidecars; linux-x64 equals the fixture engine), writes an
egress receipt before the fetch and refuses to download when the receipt
cannot be written (fail-closed; the sink is registered in the wiring test's
polarity table), caps the download at 32 MB, streams with the cap enforced,
writes the file only after the hash matches, and places it under
~/.impeccable/bin/<version>/ (a trusted IMPECCABLE_HOME is honored; never
inside a project). No skill, no hook, no launcher, no npx. --sha256 accepts a
sidecar checksum for a version gstack has not pinned; --base allows a mirror
(https, or http on loopback for tests). After a successful install the probe
runs and its lines follow, so the skill sees READY at once.

The probe ends with DESIGN_DETECTOR_INSTALL_OFFER (version, platform, bytes,
destination) whenever it found no engine and the user has not answered the
question; once design_detector_install_prompted is true it prints neither the
offer nor the NOT_CACHED hint, which used to repeat on every run. The hint's
npx wording is corrected: `npx impeccable detect --help` caches the engine
for npx only, not where the probe looks.

gstack-config gains design_detector_install_prompted (true|false, typo
rejected, enumerated in list and defaults). Tests: a loopback mirror (async
spawn, so the in-process server can answer) covers install, re-install as a
verified no-op, checksum mismatch, 404, unpinned version, non-https base,
design_detector off, and IMPECCABLE_HOME inside the repo; the offer and the
silenced hint; pin completeness per platform.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
When the probe prints DESIGN_DETECTOR_INSTALL_OFFER the design skills ask the
user one AskUserQuestion, in interactive sessions only (spawned or headless
runs never install and never ask; Conductor gets the prose brief), before
any other step: install the engine now, not now, never ask again
(design_detector_install_prompted), or turn the detector off. A yes runs the
receipted, checksum-pinned install and the skill continues with a READY probe.
The brief says what impeccable is, what the one file is, where it goes, how
it is verified and logged, and that no skill or hook comes with it; users who
want the /impeccable skill run npx impeccable install themselves.

design-review carries the brief inline (it is not carved). design-html keeps
its skeleton small: the probe block points at a new read-on-demand section,
sections/detector-install-offer.md, registered in its manifest and carve
guard; its skeleton ceiling is re-measured (55,262) and its eager ceiling
set to the measured 13,767. The review and ship passes state that they never
offer an install. NOTICE.md, README, docs/skills.md, the interop design doc,
and the CHANGELOG describe the new posture: gstack still never runs
impeccable's installer or launcher; the one download is consented, pinned,
and receipted. Ship goldens refreshed for the review-pass wording.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
…; re-bump to v1.84.0.0

Conflicts resolved by keeping both sides: gstack-config enumerates
design_detector, design_detector_install_prompted, and memorable_recall; the
egress wiring test carries both new fail-closed sinks (design-detect-engine-
download, memorable-recall) and both new module sinks; PROJECT_STRUCTURE's
bin/ line names the design tools and gstack-memorable. This branch's
CHANGELOG entry moves to 1.84.0.0 (dated today) above main's 1.83.0.0;
VERSION, package.json, and the agents digest were written by
gstack-version-bump. Main touched no template or resolver, so no render
changed (gen-skill-docs --dry-run: all FRESH).

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@garrytan garrytan changed the title v1.82.0.0 feat: impeccable interop: detector pre-pass in four design skills, DOM-mode scans, open DESIGN.md format, one typed slop catalog v1.84.0.0 feat: impeccable interop: detector pre-pass in four design skills, DOM-mode scans, open DESIGN.md format, one typed slop catalog Sep 9, 2026
@garrytan
garrytan merged commit c8f0c4e into main Sep 9, 2026
20 of 21 checks passed
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