fix(ci): dedupe capture-aws-control server, unbreak jscpd gate on main - #6434
Conversation
capture-aws-control.mjs duplicated capture-hero-art-proxy.mjs's 17-line static server verbatim, tipping repo-wide jscpd duplication to 0.01% over the 0% threshold -- every branch cut from main fails the Copy/paste detection gate. Use the shared scripts/lib/serve-dist.mjs helper (ephemeral port, same SPA fallback + /logo.png route) instead.
UX Review (Fable 5) — ✅ PASSUX-level review of UX-Verdict: PASS Developer-only refactor of a screenshot-capture script; no user-facing UI, strings, states, or screenshots change — nothing a product user ever sees. [UX-REVIEWED] a2db9d2 |
Design Review (Fable 5) — ✅ PASSDesign-level review of Design-Verdict: PASS Root-cause dedupe onto the existing canonical helper ( [DESIGN-REVIEWED] a2db9d2 |
Opus 4.8 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 5.6 Review — ✅ no blocking findingsGPT 5.6 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
NicholasRBowers
left a comment
There was a problem hiding this comment.
Tier 1 auto-approve: fix (1 file). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, SAST annotations clean, security checklist all-NO, AI reviewers green. Category: single-file CI capture-script fix with clear root cause — replaces the duplicated inline static server in capture-aws-control.mjs with the shared serveDist() helper, unbreaking the jscpd duplication gate on main.
Problem / Motivation
The
Copy/paste detectionstep (npx jscpd ., threshold 0%) in Frontend Lint & Type Check fails on every branch cut from current main:ERROR: jscpd found too many duplicates (0.01%) over threshold (0%). Reproduced on a pristineorigin/mainworktree with the pinned jscpd — this is main's own breakage, not any PR's.Why it matters
Every open PR red-lights on a gate its diff cannot influence; contributors burn CI rounds triaging a failure that is inherited. (Hit live while babysitting #6428.)
What changed (motivation → approach → change)
capture-aws-control.mjs(landed recently) hand-rolled the same 17-line static-file server thatcapture-hero-art-proxy.mjscarries, pushing repo-wide duplication from one tolerated clone (rounds to 0%) to two (0.01% > 0%). The repo already has the shared harness helper for exactly this:scripts/lib/serve-dist.mjs. The fix deletes the hand-rolled server fromcapture-aws-control.mjsand usesserveDist()(ephemeral port instead of hardcoded 6813, same SPA-fallback +/logo.pngbehavior — the helper is the canonical implementation the other harnesses use).Tests
jscpdon this branch: back to 1 clone / exit 0 (the pre-existing queue-edit/upload-error pair, which rounds to 0% and passes). N/A for unit tests — capture harness script, not shipped code.Manual verification
Ran the fixed script end-to-end against a built dist (
node scripts/capture-aws-control.mjs /tmp/aws-verify): server starts on an ephemeral port, SPA loads,home.pngandaccount.pngcaptured.node --checkclean.Why no screenshot: capture-harness plumbing only; no shipped UI renders differently.
Related Issues
no linked issue: found while babysitting #6428; fixed directly as a main-unblocker.
Checklist
feat|fix|docs|refactor|perf|test|chore|ci|build|revert: ...)