fix(cli): honest offboard closing + clear pointer on failed wipe; drop stale client-list hints#168
Merged
Merged
Conversation
…p stale client-list hints Thorough review pass on the develop->main PR (#164), addressing the new Bugbot finding plus adjacent gaps a review flagged: - Stale client pointer after a failed wipe (Bugbot): after revoke, if `rm -rf ~/.tracebloc` failed the default path left the active-client pointer intact (the --keep-data path cleared it). Now the pointer is cleared in memory once after revoke and persisted in BOTH paths, incl. the wipe-failure branch — the host never looks enrolled under a dead credential. - Misleading success line: the closing "Offboarded … no longer connected" printed unconditionally even when uninstall/teardown/wipe left real state behind (all best-effort warns). Track a `degraded` flag over the state-leaving steps and print an honest closing that tells the user to finish the flagged steps by hand. (Image reclaim is pure disk cleanup — excluded; exit stays 0 since the credential revoke, the core, succeeded.) - Online guard: a stored id not in the signed-in account (found=false) now emits a hint instead of silently passing the guard. - Stale copy: `client status` errors pointed at the now-hidden `client list`; retargeted to `client create` / the installer, matching the phrasing used elsewhere. Fixed a `create/use` comment (use removed). Tests added: wipe-failure clears the pointer; a failed teardown produces the degraded closing. go build/vet/test green (11 pkgs). Rolls up under the §7.10 offboarding work (Bugbot follow-up). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
divyasinghds
approved these changes
Jul 7, 2026
This was referenced Jul 7, 2026
Closed
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.
Thorough review pass on the develop→main PR #164 — resolves the new Cursor Bugbot finding and the adjacent issues a full review surfaced, so #164 can go clean.
Bugbot: stale client pointer after a failed wipe
After revoke, if
rm -rf ~/.traceblocfailed, the default path left the active-client pointer intact (the--keep-datapath cleared it — an asymmetry my earlier #165 fix introduced). Now the pointer is cleared in memory once after revoke and persisted in both paths, including the wipe-failure branch. The host never looks enrolled under a dead credential.Misleading success line
The closing
Offboarded … no longer connectedprinted unconditionally, even when uninstall / cluster teardown / data wipe left real state behind (all best-effort warns). Now adegradedflag tracks the state-leaving steps and the closing tells the truth — "the credential is revoked, but some cleanup didn't complete; finish the flagged steps by hand."degraded(its own warning already surfaces).degradedexit non-zero for automation if you'd prefer — flag it.)Online guard found=false
A stored id not in the signed-in account now emits a hint instead of silently passing the guard (wrong-account / stale-pointer case).
Stale copy
client statuserrors pointed at the now-hiddenclient list; retargeted toclient create/ the installer (matching the phrasing used elsewhere in the diff).create/usecomment (usewas removed this release).Review scope
Fanned out a full correctness review across the whole #164 diff (offboard, surface/API, schema+parity/goldens). The schema/parity + registry changes came back clean. Remaining offboard candidates were either documented invariants (release-name = namespace) or speculative, and are left as-is.
Tests
Added: failed wipe still clears the pointer; a failed teardown produces the degraded closing.
go build/vet/test ./...green (11 pkgs).Rolls up under the §7.10 offboarding work (Bugbot follow-up — no separate ticket).
🤖 Generated with Claude Code
Note
Medium Risk
Changes offboarding behavior and local config persistence after revoke; mistakes could leave users thinking offboard succeeded or still enrolled, but scope is CLI UX/guards with tests and exit 0 only when revoke succeeds.
Overview
Offboard (
tracebloc delete) now reports outcomes honestly and keeps local enrollment state consistent after revoke.After credential revoke, the active-client pointer is cleared in memory once (before
--keep-datavs full wipe), so the host does not still look enrolled under a dead credential. Ifrm -rf ~/.traceblocfails, the cleared pointer is persisted viacfg.Save()anyway.A
degradedflag tracks best-effort steps that leave real state behind (Helm uninstall, cluster teardown, missing namespace skip, failed data wipe). The final line is a warning when cleanup was incomplete, not an unconditional “no longer connected” success. Image prune failures still only warn and do not setdegraded.The pre-offboard online guard now hints when the stored client id is missing from the signed-in account (stale pointer / wrong env) instead of passing silently.
client statuserrors for a missing active client retarget guidance from hiddenclient listtoclient create/ the installer. Tests cover failed wipe + pointer clear and degraded closing.Reviewed by Cursor Bugbot for commit 34ff314. Bugbot is set up for automated code reviews on this repo. Configure here.