← Back to Pull requests

fix(weft-mcp-diagnostics): cascade order, audit ellipsis, stale warnings #80

Open
unknown opened this pull request with 210 lines diff across 2 files
View on GitHub
unknown unknown commented on Nov 29, 2026 05:12 UTC
Author

Five MCP / diagnostics pain points from live usage, all in one branch since they sit in the same surface (root CSS, audit, screenshot).

shared/root-css.ts sortWidthMedia: invert the @media sort so it matches the browser cascade instead of fighting it. max-width rules now go narrowest-first, min-width widest-first — a desktop-first stylesheet with the mobile rule written last now applies on mobile, instead of silently overriding it.

shared/root-css.ts parseBlock: reject "prop: null" inside the css text with a clear message that points to the structured vars / classes params (where null actually removes a property).

server/audit.ts buildDomAuditScript: skip the horizontal-overflow / clipped-X check when an element has text-overflow: ellipsis alongside overflow-x: hidden. Truncation is intentional, not a bug, so a list of truncating rows no longer keeps audit_artboard's ok signal false.

server/design-system.ts widthMediaConflicts + updateRootCss: only emit a width-only @media conflict when it's genuinely new since the previous call AND when the two rules actually differ in value. Five of the previous nine warnings were either stale or benign duplicates.

server/mcp-tools.ts get_screenshot: reject a nodeId that doesn't actually live on the artboard we'd load, instead of letting the renderer's unscoped [data-layer] selector hit a colliding element on a different artboard and screenshot the wrong thing.

server/mcp-tools.ts GUIDE: one sentence noting that null isn't a CSS value and pointing to the structured params.

  • fix-weft-mcp-diagnostics.md: the plan, kept alongside fixlater.md and bugs.md for review.
  • Tests and verification still to come.

    Diff: 210 lines (+157 / -53) across 2 files Reviewer: copilot-pull-request-reviewer[bot] Review duration: 1m
    All Vouch review confidence checks passed
    Residual risk 0.31 = Change Risk (0.36) × (1 − Review Confidence (0.14)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.36 · 210 lines diff across 2 files
    0.36
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 19% · Reviewer familiarity: 35%
    14%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.320
    Real PR Conversation Timeline
    1 comments
    "Review active on #80"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: low confidence: 14% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 36.5% (MEDIUM) · Higher = larger blast radius
    36.5%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 14% · Lower = rushed or shallow review
    14%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 31.4% · Safe to merge
    31.4%