fix(adapter): resolve all WHYNOT-WP-0002 drift — designbook-refresh green
Some checks failed
ci / check (push) Has been cancelled
ci / release (push) Has been cancelled

Triage the three surfaced divergences the governance-correct way (no stack->React
back-edit, no ir/ hand-edit); make adapt-lit/parity-lit/designbook-refresh now
exit 0:

- PipelineStrip: documented TAG_OVERRIDES in scripts/ir-extract.mjs maps the
  React 'PipelineStrip' to the established tag wn-pipeline (the web-component tag
  is an IR-projection detail, not React-dictated; the component name stays
  faithful). Tag now matches the element; parity tests it (no longer skipped).
- PageHeader.actions: the drift detector now collects each element's named slots
  and treats an IR prop honoured by a same-named slot (<slot name="actions">) as
  satisfied (prop-via-slot, informational) rather than prop-missing.
- Sidebar.current: recorded as an auditable accepted divergence in
  adapters/lit/drift.accepted.json (React monolithic 'current' key vs Lit per-item
  'active' on composable <wn-sidebar-item>) — listed, downgraded to info, not gated.

Rendered surfaces (src/, examples/) untouched — verified zero diff; parity renders
all 10 components green. Adapt/parity outputs idempotent (stable re-run).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-30 09:53:59 +02:00
parent 756634c27f
commit 05fa31e2b5
18 changed files with 156 additions and 67 deletions

View File

@@ -38,6 +38,18 @@ const COMPONENT_SOURCES = ["Atoms.jsx", "Chrome.jsx"];
const log = (...a) => console.log(...a);
const kebab = (s) => s.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
// The custom-element tag is an IR-*projection* detail, not something the React
// designbook dictates (React components have no tag). The default mapping is
// `wn-${kebab(Name)}`, but a component's canonical tag can differ from a literal
// kebab of its React name. These overrides record those decisions in one place
// (resolving a tag-mismatch drift the governance-correct way — at the projection,
// not by renaming the hand-authored stack element). The component *name* stays
// faithful to React; only the projected tag is overridden.
const TAG_OVERRIDES = {
PipelineStrip: "wn-pipeline", // React "PipelineStrip"; the established web-component tag is wn-pipeline.
};
const tagFor = (name) => TAG_OVERRIDES[name] || `wn-${kebab(name)}`;
// ---------- Tokens: _ds_manifest.json tokens[] → W3C DTCG ----------
// Each manifest token: { name:"--ink", value:"#0A0A0A", kind:"color", definedIn }.
// Group + DTCG $type are decided by name prefix (kind is a fallback hint).
@@ -204,7 +216,7 @@ function extractComponents() {
const card = matchExemplar(name, cards);
const contract = {
name,
tag: `wn-${kebab(name)}`,
tag: tagFor(name),
group,
description: `${name} — extracted from designbook ui_kits/${KIT}/${file}.`,
props,