Skip to content

feat(stardust): sizing, direction decisions and migration settings move out of DESIGN.json - #849

Merged
paolomoz merged 5 commits into
mainfrom
stardust/design-context-data
Dec 2, 2026
Merged

paolomoz merged 5 commits into
mainfrom
stardust/design-context-data

Conversation

@paolomoz

@paolomoz paolomoz commented Nov 30, 2026 •

Copy link
Copy Markdown
Collaborator

What and why

Second of three pull requests that replace DESIGN.json with the fixed design/ structure (tracking: #846; stacked on #847, merge that first). This one moves the data that is not design out of DESIGN.json, with the same key names and shapes, and makes the scripts fail when a model they need is missing instead of guessing a default.

New file Holds Written by Read by
stardust/replica/sizing.json the measured cap model (containerMaxWidth, probeWidth, shellMaxWidth, caps, modules, capRegister, capProvenance) and replica's target breakpoints cap-probe.mjs --write-sizing cap-probe compare, gate-all --wide, qa-gate, breakpoint-lint, reskin's deployed parity
stardust/direction.json (per variant stardust/candidates/<id>/direction.json) divergence, iaPriorities, motion.register + registerRationale, capOverrides direct; prototype adds divergence.anti_toolbox_hits prototype, uplift, migrate
stardust/migration.json canon, modules, widgets, colorReservations, metadata (incl. keyFacts) extract --prep, direct --prep, prototype --prep migrate, prepare-migration, deploy

Behaviour changes

  • No silent fallbacks for sizing. Before, a missing model meant gate-all --wide ran at 2560 px, qa-gate asserted no outer cap and used a 1340 px block width (one warning), and cap-probe compare derived the width from the live page. Now each exits non-zero and names the capture that writes the model. qa-gate --no-cap is the explicit opt-out for a prototype with no captured source.
  • Fixed on the way: when DESIGN.json carried impeccable's array form of breakpoints, cap-probe's merge set named properties on the array and JSON.stringify dropped them, so the model was lost without a message. The model now has its own file; writing into an array is refused.
  • CLI flags: cap-probe --write-design <f> / --design <f> become --write-sizing / --sizing <f> (default stardust/replica/sizing.json); gate-all, qa-gate and breakpoint-lint take --sizing. The old flags exit with a message naming the new ones.
  • migrate's skip key hashes stardust/migration.json and stardust/direction.json beside DESIGN.md/DESIGN.json, so editing either re-renders the pages (migrationJsonSha, directionJsonSha in the sidecar and the provenance block; golden re-baselined for exactly these).
  • prototype refuses when the direction file is missing, as it does for DESIGN.md.
  • reskin's canon bridge (canon-from-reskin.mjs, from feat(stardust): reskin hands off to migrate — renderer, canon bridge, chrome hardening (M3) #531) records canon and modules in stardust/migration.json; reskin-preflight reads them there.
  • qa-gate names a missing playwright before a missing sizing model.

Token budgets. The boy-scout check fails a pull request that edits a SKILL.md over its budget, and this change and the next must edit five of them. So extract, direct, uplift and stardust move whole sections verbatim into references/ (each phase keeps a summary, its guards and a "Read reference/… before Phase N" line), and three skills get a scenario eval:

SKILL.md before → after (tokens) eval
extract 11,377 → 4,353 extract-multipage (existing)
direct 12,325 → 4,699 direct-from-phrase (existing)
uplift 6,606 → 4,561 new uplift-variant-roles
stardust 8,460 → 4,564 new stardust-resume-state-report
prepare-migration 4,195 (unchanged text) new prepare-migration-replica-guard

New library: skills/stardust/scripts/lib/sizing.mjs (SIZING_FILE, readSizing, mergeSizing), re-exported by contracts.mjs. No new CLI, hook, MCP server or network endpoint.

How I checked it

  • npm ci && npm run validate && node scripts/check-release-configs.mjs && npm run lint:stardust; npm test (217 pass); node scripts/check-facts.mjs; node scripts/check-skills.mjs --tokens plugins/stardust (every touched SKILL.md under budget).
  • Script tests: lib, layout, contracts-characterize, cap-probe, gate-all, breakpoint-lint, qa-gate, migrate, reskin deployed-gate-parity and deployed-gate-inherited, golden chain. The browser parts of cap-probe, qa-gate and the reskin deployed gates were run from a project copy with playwright installed (capture writes sizing.json and keeps target; compare reads it; the real qa-gate asserts the cap from it).
  • A grep for every moved key next to DESIGN.json across skills, references and evals finds none left.
  • Lab validation runs once on this branch and the next one together; the plan and pass criteria will be on stardust: design context (design/ replaces DESIGN.json) #846 before any run.

prose-delta: +321 lines, +2022 words across skill docs. The always-loaded SKILL.md text drops by 11,212 words (extract −3,703, direct −4,165, stardust −2,283, uplift −1,061); the reference files gain the same text plus a title and consumer line each and the pointer lines.

Checklist

  • The change is to one plugin, or to repository tooling
  • npm run validate passes
  • Paths, commands and skills that the change names exist
  • New scripts, hooks, MCP servers or network endpoints are called out above
  • The human label is set, if a person and not an agent wrote this

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

claude: approved on a24924e

This pull request moves the sizing model, the direction decisions and the migration settings out of DESIGN.json into stardust/replica/sizing.json, stardust/direction.json and stardust/migration.json. When a model is missing, the scripts now stop and name the capture to run instead of guessing a default. Four SKILL.md files move sections into references/, and three scenario evals are added.

Since the last review: claude and codex both approved 964c77e. The head, a24924e, is a rebase onto main now that #847 has landed. git range-diff bda482c5..964c77e3 2f8941f3..HEAD shows all five commits patch-identical (=). The new base commits that touch stardust are a release bump of version and CHANGELOG, and a one-line note in reskin's vocabulary.md about import/no-cycle. Neither touches a file or a DESIGN.json key that this pull request changes. No line of the pull request changed since the approved revision.

Checks on the head:

  • npm run validate and the release config check pass, on both head and base.
  • npm test: 217 pass, 0 fail.
  • npm run lint:stardust: 0 findings, and the manifests are in step.
  • Test drive: 16 of 16 skills loaded in claude, codex, grok and agy. agy's note about the plugin's AGENTS.md predates this change.

Redundant lines: none. Under the re-review rule, I only probe lines added or changed since the last review and lines an earlier review named as redundant. None changed, and the two passages named earlier were cut in a24924e (formerly 964c77e). Lines probed: 0, redundant: 0, not probed: 0.

Not run: no eval this round, because nothing in the pull request changed. Still open from earlier rounds, and not blocking: the stardust-resume-state-report criteria scripts_dir_copied and gitignore_installed remain unvalidated.

`browser.mjs` (`skills/stardust/SKILL.md` § Setup, step 7).
2. Capture at three viewports — desktop **1440×900**, tablet **768×1024**,
mobile **390×844**:
- Full-page screenshot.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

claude: Redundant (lines 15–24). I asked the baseline "I've generated a static HTML landing page and want to verify in a headless browser that it actually works before telling the user it's done. What exactly should I capture and check, and at which viewport sizes?" and then "How should an AI coding agent check that a web page prototype it just built renders correctly? List what to inspect and which screen sizes to use." Both answers gave this whole list: a full-page screenshot per viewport, console errors and warnings, failed 4xx/5xx requests and missing assets, uncaught exceptions, no horizontal overflow, key landmarks present, alt text, labels and contrast, and nav toggles, hover and CTA reachability. Both also listed 1440×900, 768×1024 and 390×844 among their viewports.

Keep line 13: choosing exactly these three viewports is a stardust convention the baseline didn't make. Keep steps 1, 3 and 4 (browser.mjs, the fix-and-re-run rule, the stardust/validation/<artifact>/<viewport>.png path). Drop the sub-bullets, or keep only a pointer such as "the usual console / network / overflow / a11y / interaction checks".

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Cut to one line in a6a46273: the three viewports stay (they are stardust's), and the generic checklist is named, not listed.


The default mode for `direct` is determined by whether an extracted
brand surface exists with usable signal — **not** by the user's
freeform phrase alone. Ambiguous refresh phrases ("make it modern",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

claude: Redundant (lines 14–18, from "Ambiguous refresh phrases" to "requires the user to name it"). I asked the baseline "A client asks me to redesign their existing website and says 'make it modern'. … Should I keep their current brand colors and typefaces or design a new visual identity?" and then "The brief just says 'stunning new version'. Do I treat that as permission to rebrand (new palette, new fonts), or not?" Both times it said to keep the palette and type by default and to treat a rebrand as something the client has to ask for explicitly. That is this sentence and its rationale.

The numbered precedence below earns its place and stays: signal-strong/-thin/-absent, the trigger list, --rebrand and the plan lines. Cut lines 14–18 to the pointer "Mode A is the default; a rebrand needs an explicit trigger (below)."

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Removed in a6a46273. The precedence list below it still makes Mode A the default and the rebrand the named exception.

challenged (Cloudflare challenge, field-confirmed). Probe one
asset with curl BEFORE reaching for in-page-fetch machinery; the
in-page harvest is the fallback, not the default.
- **JavaScript-only content.** Playwright already handles this. If

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

claude: Not redundant, but part of it is already known. I asked "networkidle never fires on JS-heavy pages, what should I do?" and "page.goto times out on SPA pages, what fallback, and should I record anything?" Both answers gave the domcontentloaded fallback and capturing what rendered, and the second said to log the strategy used. Neither knew where to record it (_provenance.waitMode) or about the wait-summary line in the final report. If you trim this line, keep those two parts.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Trimmed in a6a46273 to where the fallback is recorded: _provenance.waitMode and the wait-summary line.

@github-actions

github-actions Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

codex: approved on a24924e

The revision addresses the earlier redundancy findings and stale sizing references. No new blocking defect was confirmed. Base and head validation pass; Stardust lint and targeted tests pass (one skipped). All four clients install and load 16/16 skills.

Claude's prepare-migration-replica-guard scenario correctly refused prep without changing files; without the plugin, it incorrectly recommended prep after replica. Impeccable was unavailable, so full setup remains unvalidated.

Redundant lines: none remaining from the earlier findings. Seven revised lines probed; zero redundant; zero unable to probe.

(`colors`, `typography`, `rounded`, `spacing`, `components`) from
the captured tokens. The `extensions` block of DESIGN.json carries
v1's `componentStyle`, `motifs`, and `voice` arrays so nothing is
lost, and `breakpoints` — the cap-probe sizing model — verbatim.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

codex: This relocated instruction still identifies DESIGN.json extensions.breakpoints as the cap-probe sizing model and asks extraction to copy it verbatim. Phase 3 now writes that model to stardust/replica/sizing.json. Update this instruction to use the new artifact so extraction does not recreate the obsolete storage shape.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Fixed in a6a46273: the line now says the sizing model stays in stardust/replica/sizing.json. (#856 rewrites this file for stardust/current/design/.)

prototypes, and the target `PRODUCT.md` / `DESIGN.md` at the root.
- No `stardust/.gitignore` and no `stardust/scripts/`: the setup steps that
write them have not run in this project yet. Not a git repository.
- Impeccable installed.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

codex: The Claude test drive did not have impeccable installed. The plugin loaded and produced the expected state report, but deferred copying scripts and installing .gitignore, so those new criteria remain unvalidated. Provision impeccable for this scenario and rerun it before treating it as evidence that the complete resume setup works.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. No scenario in this plugin provisions impeccable; the format here has no way to install a second plugin. So I ran it locally with the plugin runner, which loads impeccable. The report was correct: visit stale with its reason, next step $stardust prototype board, nothing else written. It did not copy the scripts dir or write stardust/.gitignore for a read-only status, though, so scripts_dir_copied and gitignore_installed are still unvalidated. I am leaving them as the intended contract rather than weakening them.

@paolomoz

paolomoz commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks. Both redundant passages are cut in a6a46273, so the denial's two items are addressed. The commit is on this branch and #856 is rebased on it.

Redundant lines: validation-loop.md keeps the three viewports and names the usual rendered-page checks in one line. In phase-2-divergence-inputs.md, the ambiguous-phrase rationale is gone; the precedence list below it still makes the brand-faithful mode the default.

Not anchored: reskin/reference/gates.md now names sizing.json for qa-gate's input, in both places.

direct-from-phrase: agreed, the scenario has no scenario.json, so the eval tooling never installs its fixture. That predates this pull request. The plugin's own runner copies fixture/, and with it the scenario scores 85 on this stack against 75 on main (results on #846).

Can you re-review?

@paolomoz
paolomoz force-pushed the stardust/design-context-data branch from a6a4627 to 964c77e Compare December 1, 2026 07:28
Base automatically changed from stardust/design-system-schemas to main December 2, 2026 05:58
paolomoz and others added 5 commits December 2, 2026 06:59
….json

The measured container model (containerMaxWidth, probeWidth, caps, modules,
capRegister) and replica's target breakpoints leave DESIGN.json for their
own file, with the same key names and shapes. One reader and writer in the
shared library (lib/sizing.mjs).

cap-probe --write-sizing / --sizing replace --write-design / --design;
gate-all --wide, qa-gate and breakpoint-lint read the same file. A missing
model is now an error naming the capture instead of a 2560 px wide width or
a 1340 px cap (qa-gate --no-cap is the explicit opt-out for a prototype with
no captured source). Writing to a fresh file also ends the case where an
array-form breakpoints key made cap-probe drop the model silently.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…DESIGN.json

DESIGN.json keeps design only. Two files take what it carried, with the
same key names and shapes:

- stardust/direction.json (per variant stardust/candidates/<id>/direction.json):
  divergence, iaPriorities, motion.register + registerRationale,
  capOverrides. direct writes it; prototype, uplift and migrate read it;
  prototype stops when it is missing.
- stardust/migration.json: canon, modules, widgets, colorReservations,
  metadata (incl. keyFacts). extract --prep, direct --prep and
  prototype --prep write it; migrate, prepare-migration and deploy read it.

migrate's skip key hashes both files, so a change to either re-renders
(golden re-baselined: two new sidecar keys and provenance lines).

To edit them, five SKILL.md files over their token budget come under it:
extract, direct, uplift and stardust move whole sections verbatim into
references/, and uplift, stardust and prepare-migration get a scenario
eval (uplift-variant-roles, stardust-resume-state-report,
prepare-migration-replica-guard).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n stardust/migration.json

canon-from-reskin.mjs (the reskin -> migrate bridge) wrote canon and the
module catalog into DESIGN.json extensions; they are migration settings and
now go to stardust/migration.json like the rest of the prep cascade's (other
keys of the file are kept). reskin-preflight reads them there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…odel

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…stale sizing pointers

validation-loop's generic rendered-page checklist and the ambiguous-phrase
rationale in direct's mode precedence are cut to what a baseline does not
know; extract's JavaScript-only fallback keeps only where it is recorded.
extract's phase-4 seed and reskin's gates table now name
stardust/replica/sizing.json.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@paolomoz
paolomoz force-pushed the stardust/design-context-data branch from 964c77e to a24924e Compare December 2, 2026 06:00
@paolomoz
paolomoz merged commit f566b6b into main Dec 2, 2026
35 checks passed
@paolomoz
paolomoz deleted the stardust/design-context-data branch December 2, 2026 06:17
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