fix: proactive v0.4.0 RC review — fix 4 findings, document 3 non-issues (#106)#110
Merged
Conversation
On `slow_down`, runLogin bumped the poll interval by 1s (`interval++`). RFC 8628 §3.5 requires increasing it by 5s for that and all subsequent polls, so the CLI kept polling too aggressively after the server asked it to back off. Test captures the durations handed to the pollAfter seam: post-slow_down wait is now 10s (5+5), not 6s. Bugbot: "Device flow slow_down interval" (Medium, v0.4.0 RC, #107) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
backendHost switched on CLIENT_ENV case-sensitively, but the API client (api.ResolveEnv/BaseURL) lowercases env values. A non-lowercase CLIENT_ENV on the edge box (e.g. "DEV") fell through to the prod default, so `cluster doctor` probed api.tracebloc.io even when the cluster targeted dev/stg. Normalize with ToLower+TrimSpace before the switch. Test extends TestBackendHost with "DEV"/"Stg"/" dev " cases. Bugbot: "Doctor backend env casing" (Low, v0.4.0 RC, #107) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
ListClients attempted the unpaginated bare-array decode on every iteration. A
bare array is only valid as the sole response (a paginated chain is a
{next,results} object on every page), so a stray bare body mid-chain could
silently end the loop and drop earlier pages. Guard the bare decode to pageNum 0.
Test: a bare-array response still returns the full list.
Found in the proactive RC review (low; latent — DRF doesn't mix shapes).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ck (#106) `client create` built the namespace-collision set from ALL clients, including the one already anchored to this cluster. On an idempotent re-run with the same --name, that bumped the derived slug (lab-one → lab-one-2) and showed it in the review — but the backend adopts on cluster_id and returns the original namespace, so the review contradicted the actual outcome. Skip the client whose cluster_id matches this cluster's anchor. Test: a re-run review no longer shows a bumped namespace. Found in the proactive RC review (low; cosmetic — backend state was correct). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
LukasWodka
approved these changes
Jun 24, 2026
4 tasks
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.
A proactive review of the whole
develop→mainRC diff (4,142 lines / 31 files) to get ahead of Cursor Bugbot's incremental passes on #107. Combined Bugbot's outstanding findings with a fan-out review across the high-risk packages (auth,api,config,client,cluster,doctor,push,slug), then adversarially verified every candidate against the code. Rolls up under #106.Fixed (4 — all verified real, each with a regression test)
cli/auth.goslow_downbumped the poll interval by 1s, not the 5s RFC 8628 §3.5 requires — kept polling too aggressively after the server said back offdoctor/doctor.gobackendHostmatchedCLIENT_ENVcase-sensitively while the API client lowercases — a"DEV"env madecluster doctorprobe prod on a dev/stg clusterapi/client.goListClientstried the bare-array decode on every page; a stray bare body mid-chain could silently end pagination early. Guarded to page 0cli/client.goclient createcounted this cluster's own client in the namespace-collision set, so an idempotent re-run showed a bumpedlab-one-2in the review while the backend adoptedlab-oneReviewed and deliberately NOT changed (3 — documented so they're consciously closed, not missed)
select(auth.go) — overshoot is bounded by one poll interval against a 10-min code TTL; negligible. Not worth restructuring.PollTokentreats a 2xx body as success (api/client.go) — the CLI is coded to the RFC 8628 + its own tested contract (poll errors arrive on 4xx; 2xx = token). Treating a 2xxerrorfield as a poll sentinel could mask a real backend bug. Won't fix.randHexignores thecrypto/rand.Readerror (cli/client.go) —crypto/rand.Readis contractually non-failing on supported platforms (the code says so); adding error plumbing for an unreachable path is noise.push/dataset/slug/teardownand the rest ofdoctorcame back clean under a deep trace (incl. table-name traversal, DROP-TABLE quoting, teardown pod/uid targeting, slug collision, node-fit math).Tests
4 new regression tests (slow_down back-off timing via the
pollAfterseam;backendHostcase-insensitivity; bare-array list; re-run review namespace).gofmt/vet/buildclean; fullgo test -race -cover ./...green.🤖 Generated with Claude Code
Note
Low Risk
Targeted correctness fixes in login polling, doctor probes, client listing, and create review text; behavior changes are narrow and covered by new tests.
Overview
Addresses four proactive RC review findings, each with a regression test.
Login (
tracebloc login) — On OAuth device-flowslow_down, the poll interval now increases by 5 seconds (RFC 8628 §3.5), not 1 second, so the CLI backs off as the spec requires.cluster doctor—backendHostnormalizesCLIENT_ENVwith trim + lower-case, aligned with the API client, so values like"DEV"or" dev "probe dev-api instead of defaulting to prod.ListClients— Unpaginated bare JSON arrays are only accepted on page 0; a stray bare body later in a paginated chain can no longer end pagination early and truncate the client list.client create— When deriving the namespace for the review step, clients already anchored to the current cluster are excluded from collision detection, so an idempotent re-run shows the adopted namespace (e.g.lab-one) instead of a bumped slug (lab-one-2).Reviewed by Cursor Bugbot for commit 87777ba. Bugbot is set up for automated code reviews on this repo. Configure here.