Skip to content

fix(cli): honest offboard closing + clear pointer on failed wipe; drop stale client-list hints#168

Merged
saadqbal merged 1 commit into
developfrom
fix/delete-pointer-after-wipe
Jul 7, 2026
Merged

fix(cli): honest offboard closing + clear pointer on failed wipe; drop stale client-list hints#168
saadqbal merged 1 commit into
developfrom
fix/delete-pointer-after-wipe

Conversation

@saadqbal

@saadqbal saadqbal commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

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 ~/.tracebloc failed, the default path left the active-client pointer intact (the --keep-data path 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 connected printed unconditionally, even when uninstall / cluster teardown / data wipe left real state behind (all best-effort warns). Now a degraded flag 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."

  • Image reclaim is pure disk cleanup, so it's excluded from degraded (its own warning already surfaces).
  • Exit stays 0: the credential revoke — the security-critical core — succeeded. (Happy to make degraded exit 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 status errors pointed at the now-hidden client list; retargeted to client create / the installer (matching the phrasing used elsewhere in the diff).
  • Fixed a create/use comment (use was 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-data vs full wipe), so the host does not still look enrolled under a dead credential. If rm -rf ~/.tracebloc fails, the cleared pointer is persisted via cfg.Save() anyway.

A degraded flag 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 set degraded.

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 status errors for a missing active client retarget guidance from hidden client list to client 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.

…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>
@saadqbal saadqbal self-assigned this Jul 7, 2026
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.

3 participants