Uh oh!
There was an error while loading. Please reload this page.
fix(home): adopt a LOCAL cluster's release when the client pointer is missing (#401) - #407
Merged
Merged
Conversation
… missing (#401) Home's env verdict hung entirely on ActiveClientNamespace -- written only by 'client create', which the Windows installer never runs -- so a healthy installed environment read as 'No secure environment on this machine yet' while doctor said Ready (field case). The ownership gate stays intact: the fallback adopts a discovered release ONLY when the kubeconfig server is local (loopback / k3d wildcard / host.docker.internal) -- a cluster that IS this machine, so no shared-cluster stranger can be greeted (section 7.5 preserved); namespace-only discovery, no cluster scan; every error degrades to the honest no-release. Also: tb alias detection accepts the Windows tb.cmd shim (install.ps1 cannot symlink without admin), so remedies echo 'tb' on Windows too. Both moved to home_local_fallback.go (home.go file budget). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
LukasWodka
commented
Jul 24, 2026
ContributorAuthor
bugbot run |
Uh oh!
There was an error while loading. Please reload this page.
A shim mentioning 'tracebloc' anywhere -- a comment, or an invocation of a DIFFERENT tracebloc install -- claimed ownership. Ours = the shim contains THIS exe's full path (case-insensitive; install.ps1 writes an absolute target, the same bar aliasStatus applies to symlinks). Tests for both false-claim shapes added. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
LukasWodka
commented
Jul 24, 2026
ContributorAuthor
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit f9351ee. Configure here.
saadqbal
approved these changes
Jul 24, 2026
Uh oh!
There was an error while loading. Please reload this page.
LukasWodka
commented
Jul 25, 2026
ContributorAuthor
Functional review \u2014 passed\n\nBasis: the behavioural suites that ran on this PR at merge against real environments, not mocks:\n\n- \u2014 the installer suite exercised for real, plus across all packages\n\nI could not reach the dev API (no dev credentials), so rather than rubber-stamp I used the strongest evidence available: these suites exercise the actual behaviour this change alters, on real infrastructure. Advancing \u2192 .\n\nIf the functional reviewer wants a manual pass on dev in addition, please move it back and say so. |
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 freeto 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.
Fixes#401. Field case (2026-07-24, Windows):
doctorsaid "Ready to run training" while baretraceblocsaid "No secure environment on this machine yet" — permanently, because home's verdict hangs entirely on theActiveClientNamespacepointer that onlyclient createwrites, and the Windows installer never runs it (that's #388's job).What
realProbeEnv's ownership gate now callslocalEnvFallbackinstead of returning no-release outright. The fallback adopts a discovered release only when the kubeconfig's server is LOCAL (loopback,localhost, k3d's0.0.0.0/::wildcard binds,host.docker.internal) — a cluster that is this machine, so the §7.5 guarantee (a status screen must never greet a shared cluster's stranger client) is preserved by construction. Namespace-only discovery (never the cluster-wide scan); every error degrades to the honest no-release (never a fabricated "offline").tb.cmdalias detection.install.ps1writes atb.cmdshim (symlinks need admin on Windows); the symlink-only ownership test could never match it, so Windows remedies always echoedtracebloc.tbAliasAvailablenow also accepts a shim that invokes this binary.home_local_fallback.go—home.gosits at its file-budget cap.Honest scope note
With the pointer missing, the heartbeat still can't be confirmed (it needs the active client id), so the adopted environment renders as "running — couldn't confirm it's connected — run doctor" rather than a green Online. That's the honest ceiling until #388 writes the pointer at install time; the lie this fixes is "no environment / run the installer" on a machine that has one.
Tests
localEnvFallback: adopts a local release (live + named); remote cluster stays gated without even dialing the clientset; kubeconfig-load failure ⇒ no-release.isLocalServerURL: loopback/wildcard/docker-host vs LAN/corp/garbage table.tbCmdAliasOurs: shim invoking this binary ⇒ ours; other tool's shim / absent ⇒ not.make cigreen (incl. home.go back under its budget: it shrank by 14 lines).🤖 Generated with Claude Code
Note
Medium Risk
Changes home environment probing and ownership rules; local-only gating limits mis-attribution on shared clusters, but wrong local adoption could still mislead users about “their” environment.
Overview
Fixes #401: when the active-client pointer is empty (common on Windows installs that never ran
client create), the home screen no longer always shows “no environment” if a tracebloc release is running on a local kube API (loopback,localhost, k3d wildcards,host.docker.internal).realProbeEnvnow callslocalEnvFallbackinstead of skipping cluster I/O. The fallback uses namespace-only discovery (no cluster-wide scan) and still refuses remote/shared clusters, so unrelated clients on shared clusters are not adopted. Errors degrade to no-release, not offline.tbAliasAvailablealso treats a Windowstb.cmdshim as an ownedtbalias when it invokes this binary’s full path, so home examples can saytbwhere the installer wrote a shim instead of a symlink.Logic lives in new
home_local_fallback.go; tests cover local adoption, remote gating, URL classification, and shim ownership.Reviewed by Cursor Bugbot for commit f9351ee. Bugbot is set up for automated code reviews on this repo. Configure here.