Skip to content

✨ Use API-backed build status#317

Merged
Robdel12 merged 1 commit into
mainfrom
rd/api-backed-status
Jul 22, 2026
Merged

✨ Use API-backed build status#317
Robdel12 merged 1 commit into
mainfrom
rd/api-backed-status

Conversation

@Robdel12

Copy link
Copy Markdown
Contributor

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/status contract. 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_id route 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.

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
Robdel12 marked this pull request as ready for review July 22, 2026 03:35
@Robdel12
Robdel12 merged commit f4cbf76 into main Jul 22, 2026
30 checks passed
@Robdel12
Robdel12 deleted the rd/api-backed-status branch July 22, 2026 03:36
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