Repository navigation
fix(cli): carry registry error codes through every b4 verify phase - #704
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
blove
force-pushed
the
blove/verify-carries-error-codes
branch
from
September 17, 2026 18:13
05175df to
54ab68f
Compare
blove
enabled auto-merge (squash)
September 17, 2026 18:13
blove
temporarily deployed
to
vercel-preview
September 17, 2026 18:24 — with
GitHub Actions
Inactive
blove
force-pushed
the
blove/verify-carries-error-codes
branch
from
September 17, 2026 20:18
54ab68f to
16cb2a1
Compare
blove
force-pushed
the
blove/verify-carries-error-codes
branch
from
September 17, 2026 20:22
16cb2a1 to
25a781f
Compare
`getFailureCode` only returned a code for the `runtime` check, so an app that `b4 check` diagnoses as `[B4_E1006]` or `[B4_E1007]` failed `b4 verify` with no code at all — on stderr or in `--json`. `VerifyFailedCheckResult.error` now carries an optional `code`, populated when the caught error is a `B4AppError`, and `getFailureCode` reads it for the non-runtime phases. Because the failed check is part of the `--json` payload, the machine-readable surface carries the code too; the field is omitted when the underlying failure has no registry entry. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
blove
force-pushed
the
blove/verify-carries-error-codes
branch
from
September 17, 2026 20:26
25a781f to
cad08e3
Compare
blove
temporarily deployed
to
vercel-preview
September 17, 2026 20:54 — with
GitHub Actions
Inactive
blove
added a commit
that referenced
this pull request
Sep 17, 2026
None of the three touches this page: verify registry error codes, body-less middleware reject status, and a k8s smoke watchdog. Only the generated SEO manifest conflicted, resolved by regenerating per the procedure #712 added to AGENTS.md. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This branch was successfully deployed
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.
Stacked on #701 — base it on
mainonce that merges.Problem
getFailureCodeinpackages/cli/src/commands/verify.tsreturned a code only when the failing check wasruntime. Every other phase returnedundefined, so the two codes #701 adds —B4_E1006(app rootpackage.jsonis not an ES module) andB4_E1007(route entry has no recognisable export) — were reachable throughverify'sappandroutesphases but rendered nowhere.b4 checkon a broken app printed[B4_E1006] See https://b4.run/docs/cli#b4-check;b4 verifyon the same app printed no code, on stderr or in--json.Change
VerifyFailedCheckResult.errorwidens from{ message }to{ code?, message };createVerifyFailureResultpopulatescodewhen the caught error is aB4AppErrorand omits the field otherwise (discovery throws plainErrors for the cases with no registry entry).getFailureCodefalls through to the failed check'serror.codefor the non-runtime phases. Runtime keeps its existing sub-check precedence.--jsonpayload, so the machine-readable surface picks the code up with it.Contract change
--jsongains an optionalerror.codeon failed checks. Documented underb4 verify's--jsonflag inapps/web/content/docs/cli.mdx.The two
verify-command.test.tstests that deep-equal the whole--jsonpayload were checked against the change and neither needed updating:invalid-configfails withdefineConfig is not defined(a plainError) andinvalid-companionfails with the multiple exports message, which is also a plainError—B4_E1007covers the no recognisable export throw. A new test pins that those payloads stay code-free.Tests
Four new tests in
packages/cli/test/verify-command.test.ts:[B4_E1006]and[B4_E1007]on stderr,error.code === "B4_E1006"in--json, and the code-free payload for an uncoded failure.pnpm --filter @b4run/cli test— 1891 passed, 4 skipped. Typecheck, biome,check-docs.mjsgreen;apps/webSEO lastmod manifest regenerated.🤖 Generated with Claude Code