test(udg): drop stale product-prefix assertions from derived-state tests #76

Merged
peterswimm merged 1 commit from test/derived-state-stale-assertions into main 2026-07-30 16:45:02 +00:00
Member

closes #72

Both test_derived_states.py tests flagged in #72 asserted product-prefixed
derived-state var names (--spelwork-color-primary-hover etc.) that the
emitter never produces and that the three products' color.json
$description fields explicitly reject — they are self-defined on the
canonical --udg-color-* identities so agnostic surfaces/clients can
read/inherit them. Their other premises were also wrong: tctd has no
accent.* grouping, and fux-capacity has a real brand.primary
(#E63535, udg.dart-key: brandPrimary).

  • test_missing_primary_role_skips_primary_states deleted — no shipping
    product has this scenario, and test_absent_base_token_is_skipped already
    covers the skip logic with a synthetic palette.
  • test_bespoke_canonical_palettes_are_covered rewritten as
    test_no_baseline_inheritance_products_resolve_on_own_tokens — pins that
    spelwork/tctd/fux-capacity (all color_inherits_baseline: false) resolve
    all three roles from their own tokens and emit the shared canonical names,
    never a product-prefixed one.

extract.py is untouched — this is test-only, naming/premises, not the
mix-ratio question. That stays PROVISIONAL; follow-up filed at #75.

Verification: python -m pytest generator/tests/ — 138 passed, 18 skipped
(was 137 passed/2 failed/18 skipped; net one fewer test from the single
deletion, no other regression). just check (dist drift, WCAG, ForgeBlock
manifest) — all green, no dist drift.

closes #72 Both `test_derived_states.py` tests flagged in #72 asserted product-prefixed derived-state var names (`--spelwork-color-primary-hover` etc.) that the emitter never produces and that the three products' `color.json` `$description` fields explicitly reject — they are self-defined on the canonical `--udg-color-*` identities so agnostic surfaces/clients can read/inherit them. Their other premises were also wrong: tctd has no `accent.*` grouping, and fux-capacity has a real `brand.primary` (`#E63535`, `udg.dart-key: brandPrimary`). - `test_missing_primary_role_skips_primary_states` deleted — no shipping product has this scenario, and `test_absent_base_token_is_skipped` already covers the skip logic with a synthetic palette. - `test_bespoke_canonical_palettes_are_covered` rewritten as `test_no_baseline_inheritance_products_resolve_on_own_tokens` — pins that spelwork/tctd/fux-capacity (all `color_inherits_baseline: false`) resolve all three roles from their own tokens and emit the shared canonical names, never a product-prefixed one. `extract.py` is untouched — this is test-only, naming/premises, not the mix-ratio question. That stays PROVISIONAL; follow-up filed at #75. Verification: `python -m pytest generator/tests/` — 138 passed, 18 skipped (was 137 passed/2 failed/18 skipped; net one fewer test from the single deletion, no other regression). `just check` (dist drift, WCAG, ForgeBlock manifest) — all green, no dist drift.
test(udg): drop stale product-prefix assertions from derived-state tests
Some checks failed
UDG dist drift gate / dist/ matches dtcg + udg sources (pull_request) Successful in 23s
Test Generator / lint-workflows (pull_request) Successful in 25s
Test Generator / lint-prose (pull_request) Successful in 27s
Security Scans / Gitleaks secret scan (pull_request) Successful in 28s
Security Scans / Trivy filesystem scan (pull_request) Successful in 30s
Test Generator / test (pull_request) Failing after 45s
29bd535629
Both tests asserted product-prefixed derived-state var names
(--spelwork-color-primary-hover etc.) that the emitter never produced and that
the three products' color.json $description fields explicitly reject: they are
"self-defined on canonical --udg-color-* identities ... keeps the standard
contract so agnostic surfaces and clients can read/inherit it".

Their other premises were also wrong: tctd has no accent.* grouping (only
brand/bg/text/border/safety), and fux-capacity has a real brand.primary
(#E63535, udg.dart-key brandPrimary), so "no primary token" never held.

Rewrote the covered-palettes test to pin what was actually untested - that
color_inherits_baseline: false products resolve all three roles from their own
tokens - and deleted the missing-primary test, whose scenario has no fixture
and whose logic test_absent_base_token_is_skipped already covers.

Mix ratios remain PROVISIONAL; that is a separate question.
peterswimm deleted branch test/derived-state-stale-assertions 2026-07-30 16:45:03 +00:00
Sign in to join this conversation.
No description provided.