✨ Use API-backed build status#317
Merged
Merged
Conversation
Read the dedicated status contract so processing, comparison, and review facts stay separate. Preserve legacy JSON fields and links without inventing missing counts or progress.
Robdel12
marked this pull request as ready for review
July 22, 2026 03:35
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.
Why
The CLI status command was reading the general build endpoint and reconstructing lifecycle state from a handful of legacy fields. That made review-pending counts look like unfinished processing, produced zeroes when the API had not supplied a fact, and calculated a progress percentage from an incomplete denominator.
Approach
Status now reads the dedicated
/api/sdk/builds/:id/statuscontract. Processing, comparison outcomes, review counts, review flow, canonical conclusion, scope, and links remain separate API-owned facts. The established camelCase JSON fields stay available as compatibility projections, but missing source values are omitted instead of filled in client-side.Cricket review state is preferred with the existing legacy approval fallback. Human output shows exact processing counts and concrete commands for build context and comparisons; it no longer invents progress or an uncompared screenshot count. API-provided slug links win, while the legacy
project_idroute remains available when slug scope is missing.Failure behavior stays narrow: build and processing failures still fail human status, while review-required and rejected conclusions retain the previous successful exit behavior. Logged-in user tokens now work alongside project tokens because the current status endpoint supports both.
Evidence
A real CLI process talks to a loopback server and verifies the canonical status endpoint, response fields, missing legacy approval field, and optional-preview behavior. Focused coverage also exercises legacy responses with absent facts, Cricket and legacy review state, slug and project-ID links, exact zero counts, user authentication, and unchanged failure semantics. The full 2,318-test suite passes with six existing skips; lint, formatting, type definitions, production build, and package contents are clean.
Risk
Scripts that depended on fabricated zeroes for absent legacy fields will now see those fields omitted. That is deliberate: unknown API state should not look like a measured zero.