fix(adapter): resolve all WHYNOT-WP-0002 drift — designbook-refresh green
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:
@@ -24,7 +24,7 @@ import { readFileSync, readdirSync, existsSync, mkdirSync, writeFileSync, rmSync
|
||||
import { spawn } from "node:child_process";
|
||||
import { join, dirname } from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { parseLitElements, componentDrift } from "./scaffold.mjs";
|
||||
import { parseLitElements, componentDrift, loadAccepted } from "./scaffold.mjs";
|
||||
|
||||
const REPO = join(dirname(fileURLToPath(import.meta.url)), "..", "..");
|
||||
const IR_COMPONENTS = join(REPO, "ir", "components");
|
||||
@@ -96,13 +96,14 @@ async function main() {
|
||||
// type-coercion false positives). The browser then confirms the element
|
||||
// actually upgrades + renders — the thing static analysis cannot prove.
|
||||
const byTag = parseLitElements(REPO);
|
||||
const accepted = loadAccepted(REPO);
|
||||
|
||||
const results = [];
|
||||
for (const c of contracts) {
|
||||
const tag = c.tag;
|
||||
const drift = componentDrift(c, byTag);
|
||||
const attrMismatch = drift.issues.filter((i) => i.kind === "attribute-mismatch");
|
||||
const missing = drift.issues.filter((i) => i.kind === "prop-missing");
|
||||
const drift = componentDrift(c, byTag, accepted);
|
||||
const attrMismatch = drift.issues.filter((i) => i.kind === "attribute-mismatch" && i.severity === "drift");
|
||||
const missing = drift.issues.filter((i) => i.kind === "prop-missing" && i.severity === "drift");
|
||||
const hasDefaultSlot = (c.slots || []).some((s) => s.name === "default");
|
||||
|
||||
const observed = await page.evaluate(async ({ tag, attrs, hasDefaultSlot }) => {
|
||||
|
||||
Reference in New Issue
Block a user