fix: fail loudly if generated format files can't be formatted - #17
Merged
Conversation
The format step in generate-formats.ts ran `npx vp check --fix` inside a try/catch that swallowed every error. The raw generator output has unwrapped imports, so formatting is load-bearing — and the sync-generated CI workflow commits whatever the script writes. A swallowed failure would therefore land unformatted files on main with no signal (the original audit's hazard, via the post-#9 code path). Replace it with a targeted `npx vp fmt` and no catch, so a formatting failure aborts generation (and the CI step). `vp fmt` alone reproduces the committed output exactly; lint/typecheck correctness is already enforced by the `ready` gate, so the heavier `vp check --fix` was unnecessary here. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
dogmar
force-pushed
the
fix/generate-formats
branch
from
June 14, 2026 19:51
37f4c59 to
c4bbec8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Audit fix D (4 of 5).
What the audit found vs. current state
The audit reported
generate-formats.tsshelling out tonpx oxfmt/npx oxlint(IDE-only no-op stubs) → unformatted files committed, plus async-generated.ymlmissing atypes.tstrigger. Both were already resolved by #9 (merged): the script now usesnpx vp check --fix, and the workflow runs on every PR (no paths filter). I verified the headline bug no longer reproduces — regenerating offmainproduces a clean diff.The remaining, real hazard
The post-#9 format step is still wrapped in a
try { … } catch {}that silently swallows any failure:The raw generator output has unwrapped imports (formatting changes ~860 lines across the 7 files — verified by skipping the step), so the format step is load-bearing. And
sync-generated.ymlcommits whatever the script writes. So ifnpx vp check --fixever fails, unformatted files land onmainwith no signal — the same end state the audit was worried about, just via the new code path.Fix
Replace it with a targeted, fail-loud format:
vp fmtinstead ofvp check --fix— verifiedvp fmtalone reproduces the committed output byte-for-byte; the heaviercheckalso ran lint-fix + typecheck (whose failures were being swallowed), and lint/typecheck correctness is already enforced by thereadygate.Verification
vp run ready: lint+typecheck 0/0, all suites green.🤖 Generated with Claude Code