feat(core): add phase 7 small rules bundle - #204
Conversation
Add six new design-system rules: - type/family-conformance: flag font-family not in type.families - type/weight-conformance: flag font-weight not in type.weights - shadow/scale-conformance: flag box-shadow not matching shadow.scale - sibling/padding-consistency: flag siblings with inconsistent padding - z/scale-conformance: flag z-index not in z_index.scale - opacity/scale-conformance: flag opacity not in opacity.scale Also adds config/schema/defaults for shadow.scale, z_index.scale, opacity.scale, and rhythm spec (schema only, rule in #73). Each rule includes golden snapshot test, determinism test, and docs. Closes #66, closes #67, closes #69, closes #70, closes #71, closes #72 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add the 6 missing rule documentation entries to the explain_rule table (opacity/scale-conformance, shadow/scale-conformance, sibling/padding-consistency, type/family-conformance, type/weight-conformance, z/scale-conformance) and accept the SARIF snapshot drift caused by the new ruleIndex entries. Fixes CI: every_builtin_rule_has_doc_entry and sarif_snapshot tests. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
I have enough to write the review. All 6 new rules follow the cookie-cutter pattern cleanly; let me document the specific issues I found. Review — Phase 7 small-rules bundle (95c5bc3…f5f8d73)File buckets touched
1. Determinism — PASSEvery observable output path uses 2. Workspace layering — PASSAll new rule code lives in 3. Error handling — PASSNo
Each is private, only called once, and the call site has an 4. Test coverage — PASSAll six rules have:
The 5. Documentation — PASSSix new rule pages. No banned AI-writing phrases. Punch listAdvisory — The tracking issue is cited, satisfying the no-legacy-code requirement. However, this adds a public Advisory — let mut best = scale[0]; // panics if called with an empty sliceThe invariant is maintained by the Advisory — sorted.sort_by(|a, b| a.partial_cmp(b).unwrap_or(std::cmp::Ordering::Equal));Prefer sorted.sort_by(|a, b| a.total_cmp(b));No practical impact; CSS px values are never NaN. SummaryAll hard rules pass. Checklist:
The three advisories are cosmetic; none violates a hard rule. The Verdict: APPROVE |
…292) * fix(ci): unstick Preflight + tolerate Dogfood warnings/nextjs flake PR #287 deleted docs/src/ci/release-prep.md and removed the matching guard in tests/install-smoke-validate.sh, but missed the parallel guard in tests/release-security-validate.sh. The validator has been failing on every CI run since 2026-05-07, skipping every downstream job (MSRV, deny, Test, Size, Coverage, Determinism, Docs). Drop the stale RELEASE_PREP_DOC declaration and the corresponding sentinel-grep block. The Homebrew + npm contracts are still validated authoritatively against dist-workspace.toml and install-smoke.yml in sections 5 and 6 of the same script. Two follow-on dogfood fixes since the daily run has been red since 2026-05-02 (after the Phase 7 rule additions in #202/#204/#207): - lint-canonical-docs now tolerates exit 3 (warnings/info only) alongside exit 0, mirroring the test-sites leg in the same workflow. Errors still fail. The 318-violation steady state on the live docs site is a separate content/theme cleanup, not a CI bug. - nextjs leg gets continue-on-error on both plumb invocations to mirror the e2e-sites stance on the upstream chromiumoxide WebSocket flake tracked in #233. Also drops the dead docs/src/ci/release-prep.md reference from the install-smoke.yml header comment. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * test(cdp): gate macos_candidate ordering test to unix The `macos_candidate_order_lists_system_apps_then_user_apps` test in crates/plumb-cdp/src/chrome_path.rs asserts that paths returned by `macos_candidates` start with `/Users/example/Applications/...` — forward slashes against `Path::display()`. On Windows, `Path::join` uses `\`, so display[3] becomes `/Users/example\Applications\Google Chrome.app\...` and the starts_with check fails. `detect_with` short-circuits to `None` on non-macOS targets, so the function is never reached in production on Windows. Gate the test to `#[cfg(unix)]` to keep the existing Linux coverage and drop the unreachable Windows leg. This test was previously masked because Preflight has been failing on every CI run since 2026-05-07, which skipped Test (windows-latest) entirely. Surfacing now as a side effect of the validator fix in this same PR. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(cdp): gate macos_candidates import to unix in tests Follow-up to 890b14c. Gating the test to `#[cfg(unix)]` left `macos_candidates` as an unused import on Windows, breaking the `Test (windows-latest)` build with `error: unused import: \`macos_candidates\``. Mirror the gate on the import. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
type/family-conformance,type/weight-conformance,shadow/scale-conformance,sibling/padding-consistency,z/scale-conformance,opacity/scale-conformanceshadow.scale,z_index.scale,opacity.scale, andRhythmSpec(schema only — rule in feat(core): rule baseline/rhythm (font metrics + CDP textBoxes) #73)Closes #66, closes #67, closes #69, closes #70, closes #71, closes #72
Rules added
type/family-conformancefont-familynot in allowed listtype.familiestype/weight-conformancefont-weightnot in allowed listtype.weightsshadow/scale-conformancebox-shadownot matching a named tokenshadow.scalesibling/padding-consistencyz/scale-conformancez-indexnot in allowed scalez_index.scaleopacity/scale-conformanceopacitynot in allowed scaleopacity.scaleValidations
git diff --check— no whitespace errorsregister_builtin()in sorted orderdocs/src/rules/with correct shapeSUMMARY.mdandoverview.mdupdatedShadowSpec,ZIndexSpec,OpacitySpec,RhythmSpecwith serde defaultsunwrap/expect/todo!/dbg!in library codecargo check,cargo nextest,cargo clippy(pending CI run)Test plan
cargo test --test golden_opacity_scale_conformancecargo test --test golden_shadow_scale_conformancecargo test --test golden_sibling_padding_consistencycargo test --test golden_type_family_conformancecargo test --test golden_type_weight_conformancecargo test --test golden_z_scale_conformance🤖 Generated with Claude Code