Skip to content

feat(report): explain missing script source maps - #1434

Open
BenSheridanEdwards wants to merge 2 commits into
mainfrom
fix/source-map-gap-guidance
Open

BenSheridanEdwards wants to merge 2 commits into
mainfrom
fix/source-map-gap-guidance

Conversation

@BenSheridanEdwards

@BenSheridanEdwards BenSheridanEdwards commented Nov 17, 2026 •

Copy link
Copy Markdown
Owner

Why

Reviewers need an actionable explanation when missing JavaScript source maps limit the evidence accompanying a computed-CSS comparison. Naming the capture setting and the affected script count makes that limitation visible without overstating what J2 proves.

Part of #1002. Framework configuration writers and check policy remain separate staged work behind #1429 landing; this delivers the independently actionable report wording.

What changed

  • Missing-map gaps name Next.js productionBrowserSourceMaps, or Vite hidden maps and webpack hidden-source-map, based on captured script paths.
  • Manual remedies require a capture-only setting behind STYLEPROOF_CAPTURE_SOURCE_MAPS=1; no unavailable initializer auto-fix is advertised.
  • A base-only gap points to the next baseline captured with those settings only when measured head maps are available. The strip counts distinct missing-map URLs within each revision side.
  • Add 18 public-function regressions, setup/reference documentation, and four reproducible renderer diagnostics. J2 remains warn-only; schema and blocking gates are unchanged.

Reviewer view

classifyScriptReach → evidenceSide → missing-map remedy → scriptStripLines / gap details → Markdown, HTML and published JSON.

In src/script-join.ts, Next.js paths select its framework setting; other paths select Vite/webpack guidance. Only fully measured mapped head evidence permits the qualified baseline-refresh message. src/report/reach.ts adds the missing-map notice while retaining existing confidence warnings.

Proof

  • Actual prior compiled modules: 13 new cases failed and one unrelated-gap compatibility case passed. The four budget follow-up cases then gave two failures and two compatibility passes against that candidate. Repaired compiled modules: all 18 guidance cases pass, alongside existing budget compatibility cases. Cases cover URL path versus query, mixed bundlers, distinct URL counts, both revision sides, incomplete/legacy/vendor head evidence, Markdown/HTML/JSON output, and missing-map totals after zero/partial/full detail budgets.
  • Proof Law: this change is false if missing head maps receive the baseline-only remedy, an unrelated gap gains the missing-map notice, or a missing-map remedy is absent from the rendered/published evidence.
  • Generated diagnostic excerpt: “J2 script reach (warn-only) … Source maps absent on 1 script(s) — see J2 gaps.” The full diagnostic retains “Reach incomplete” and “Synthetic fixture; this does not certify a CSS comparison.”

Synthetic Next.js missing head maps; no CSS comparison certified

Synthetic Vite/webpack missing head maps; no CSS comparison certified

Synthetic qualified base-only refresh; no CSS comparison certified

Synthetic five missing scripts retained after truncation; no CSS comparison certified

Behaviour changes

  • Given missing head maps, when J2 renders the gap, then it names the capture-only framework setting and export instruction.
  • Given only base maps missing and measured mapped head evidence, when the gap renders, then it names a baseline refresh with those source-map settings.
  • Given any missing-map gap, when the strip renders, then it calls out the affected script count; unrelated reasons retain their generic remedy.

Not asked for

No framework configuration editing, initializer/check policy, workflow, dependency, audit, release-age, schema, or J2 gate changes. #1002 stays open. No release, merge, or human signoff is performed.

Review guide

Start with sourceMapGap in src/script-join.ts, then test/source-map-guidance.test.mjs for the negative head-evidence cases. Compare all four PNGs with the generated Markdown/JSON under docs/proof/source-map-guidance/; these are advisory diagnostics, not a certified app comparison.

Verification summary

Current security hold — not merge-ready. The bounded current pnpm audit --audit-level=high --json exits 1 for picomatch 4.0.5 / GHSA-fc5q-39xc-vjpf. The shared lock is unchanged. No compatible validated remedy is available; audit, release-age, hooks and security controls are preserved. Historical passing checks do not establish current security readiness.

  • pnpm run build; focused compiled guidance and budget compatibility tests: PASS (18 guidance cases).
  • pnpm run verify: PASS, 7090 tests. First attempt stopped on an advisory URL outside the privacy allowlist in the new task note; the note now retains the advisory ID without that URL, and the unchanged privacy validator passes.
  • Proof generation and pnpm run demo:check: PASS. All four final PNGs were visually inspected before commit, with warnings and the no-certification statement visible.
  • Normal commit and push hooks: PASS; Chromium 1267 passed, one existing project-selection skip. The effective worktree hook path is .husky/_, with no config.worktree override. No hooks were bypassed.
  • Independent Astra review found one P2 in the frozen candidate: truncation preview counts could understate missing maps. The owner preserved the aggregate in the mandatory notice and added the four budget regressions (two red, two compatibility passes before the correction). This small follow-up has no additional independent review; the exact remote head and all 15 final substantive source/proof blobs now match this delivery. The owner follow-up is not represented as independent Astra approval. The security hold applies regardless of functional test results.

Final delivery head: 994ac12eac85658ef3e4f7bf44e781a247625cff. The initial and bookkeeping commits both ran normal hooks: 2,329 affected unit tests and 1,267 Chromium tests passed on each push, with the same existing project-selection skip. The worktree is clean; all seven proof files, including four PNGs, match the committed GitHub blobs. Hosted CI on this head completed: coverage and all shards, browser tests/evidence, corpus, Windows smoke and macOS smoke passed. build (node 22) failed solely at the HIGH picomatch audit, so aggregate required failed; the six other protected contexts passed. See audit job and aggregate receipt. The bounded current audit was refreshed at 20:36 UTC and still exits 1; no merge-ready claim is made.

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Note

Synthetic action dogfood receipt. This report is the final deliberately failing fixture in the action contract suite. It proves that unproven evidence is rejected; it does not certify this pull request.

🗺️ StyleProof report

📊 View the side-by-side visual report →


Coverage, determinism, report/diff consistency, or Change Reach (changeReach: 'gate') evidence is incomplete — this is not a base recapture failure. Repair the named evidence in the report.

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Note

Live StyleProof-on-StyleProof (advisory). This report is captured from the surfaces declared in styleproof.config.ts (example/demo). home@* carries matching productState {id, revision} (comparable / certifying path); the product-state acknowledgement file stays armed but empty so undeclared new pairs fail closed. fail-on-diff is false; the check is not part of hosted required CI. The synthetic Action contract suite remains action-dogfood.yml.

🗺️ StyleProof report

Nothing changed, so no report was uploaded. The verdict is in the run summary.


Advisory-only mode: no reviewable changes detected — the StyleProof dogfood check remains green.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant