Skip to content

feat(capture): set STYLEPROOF_CAPTURE_SOURCE_MAPS for capture builds - #1429

Open
BenSheridanEdwards wants to merge 3 commits into
mainfrom
feat/capture-source-maps-env
Open

BenSheridanEdwards wants to merge 3 commits into
mainfrom
feat/capture-source-maps-env

Conversation

@BenSheridanEdwards

@BenSheridanEdwards BenSheridanEdwards commented Nov 16, 2026 •

Copy link
Copy Markdown
Owner

Why

Capture builds must respect a caller's source-map opt-out through the actual build/server process. Previously the capture helper preserved an exported 0 or empty value, then the generated Playwright webServer.env replaced it with 1.

Part of #1002, stage 2. This supplies the environment for capture-only framework settings; automatic framework configuration and check-policy stages remain separate.

What changed

  • captureSourceMapsEnv() defaults a missing variable to 1 and preserves explicit values. styleproof-map uses it for capture children.
  • Generated webServer.env reads process.env.STYLEPROOF_CAPTURE_SOURCE_MAPS ?? '1' at runtime, preserving opt-outs at the final server boundary. External-server configs omit that field and the webServer block.
  • Four real Playwright webServer-process cases cover unset, 0, empty and 1. Existing helper/child-env and single/split workflow byte-identity tests remain.
  • README and changelog describe the variable's limits: framework settings still need to read it.

Reviewer view

Caller value Capture child Generated build/server
Unset 1 1
0 0 0
Empty Empty Empty
1 1 1

The generated config uses the caller's runtime environment, rather than freezing the initializer's environment.

Proof

The four new tests launch the actual Playwright webServer plugin, with a minimal HTTP server recording the environment it received. They request no browser fixture. Before the repair, unset and 1 passed; 0 and empty failed with actual value 1. Final green receipts are recorded below.

Screenshots: Not applicable. This changes process environment and generated configuration; report rendering and J2 wording are unchanged. The server's recorded value is the behavioural proof.

Behaviour changes

New capture children and generated build/servers default the variable to 1 only when unset. Existing explicit caller values survive both boundaries. Existing generated configs are left untouched by the initializer's normal idempotency rules. No framework automatically gains source maps from this slice alone.

Not asked for

Framework configuration edits, --check / --require-source-maps, J2 remedies, sibling-map discovery and release work. CI workflow template bytes and protected gates are unchanged. No merge is authorized here.

Review guide

Read bin/capture-env.mjs, its use in bin/styleproof-map.mjs, and playwrightConfigTemplate in bin/init/templates.mjs. Then inspect the actual-server cases in test/init.test.mjs, alongside test/map-workers.test.mjs and the preserved workflow baseline tests.

Verification summary

Current security hold — not merge-ready. A fresh bounded pnpm audit --audit-level=high fails for locked picomatch 4.0.5 (GHSA-fc5q-39xc-vjpf). No validated compatible remedy is currently available. No dependency, audit-threshold, release-age or other security control was changed. Earlier passing implementation/hosted checks below do not establish current security readiness.

  • Exact head: 13c93b51b4221a6390815fe96fc87d9791be55b9; git remote SHA and PR readback match. All eight frozen implementation blobs match the independent review manifest.
  • Final pnpm run verify: passed, 7,082 tests, zero failures. Repaired focus: six passing tests, including all four actual server-boundary cases; CLI scaffold assertion separately failed then passed.
  • Normal pre-commit hooks passed: lint, formatting, gitleaks, Fallow and commitlint. Normal pre-push hooks passed: 469 affected unit tests; 1267 Chromium cases passed, one existing non-Chromium-only case skipped (selected by hosted Firefox).
  • Final independent Astra review: APPROVE recommendation on this exact local commit after the stale CLI assertion fix. No submitted GitHub approval or human signoff.
  • Raw non-Markdown insertions versus main: 161/400. CI workflow templates remain byte-identical.
  • Hosted CI passed on this exact head in attempt 2. The original macOS job was abandoned before acquiring a runner; rerunning that job and its dependent aggregate passed without source, workflow or gate changes. All seven protected checks were verified green after the retry; current PR checks remain the readiness authority. No merge performed; Change Reach 2.4: setup turns on capture-build source maps #1002 remains open and staged framework/check work remains separate.

@github-actions

github-actions Bot commented Nov 16, 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 16, 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.

@BenSheridanEdwards

Copy link
Copy Markdown
Owner Author

Tie-off 17 Nov 2026, 07:50 GMT Europe/London (Goji relaying Ben). All queued Opus GOs are cancelled; no review is started in this tie-off.

This PR (Part of #1002, not Fixes) is green and CLEAN at 7bd85f895 after the shallow-checkout CI fix. Next: on a fresh GO, Opus-review, then merge. Not merged here.

@BenSheridanEdwards

BenSheridanEdwards commented Nov 17, 2026 •

Copy link
Copy Markdown
Owner Author

Independent Astra review found a P2 blocker on 7bd85f895432c505040ec91362a987f791281d66: the generated webServer.env hardcodes STYLEPROOF_CAPTURE_SOURCE_MAPS: '1', overriding an explicit caller value of '0' or '' after the capture helper preserves it. The existing tests stop at the Playwright child environment and miss the final build/server boundary.

I am repairing that boundary and adding real webServer-process regression evidence. This head is not merge-ready despite its green checks. No merge or release is authorized in this sweep.

Resolved at 13c93b51b4221a6390815fe96fc87d9791be55b9. Runtime nullish fallback now preserves explicit zero and empty values through the actual build/server process. Four real webServer-process regressions cover unset/zero/empty/enabled; the two opt-out cases failed before the repair. Full verify passed 7,082 tests; normal push hooks passed 469 affected unit tests and 1,267 Chromium cases (one existing non-Chromium-only skip). Independent Astra review recommends APPROVE on that exact commit, with all eight frozen implementation blobs bound. Hosted CI passed on attempt 2 after an abandoned macOS runner was retried; current PR checks remain the readiness authority. No merge or human signoff was performed.

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