feat(cli): auto-discover the client's namespace, rewrite the first-touch surface, ship a tb alias#142
Merged
Conversation
… rewrite
Fixes the out-of-box dead end: on a standard install the client lives in
its slug namespace, but data/cluster commands searched only the
kubeconfig default ("default") and errored — telling customers to run
helm install, the exact thing the CLI promises they never do.
Namespace discovery (§7.3):
- New cluster.FindClientNamespaces: cluster-wide scan for jobs-manager
Deployments (same selector as single-namespace discovery).
- discoverRelease fallback in the shared resolve seam: a miss in the
DEFAULT namespace scans; exactly one client → visible-note retarget
(never silent), several → named + pick via --namespace/client use,
none/RBAC-denied → the original error stands.
- §7.5 guard: the scan NEVER engages for an explicit --namespace/
--context or an active-client binding miss (which keeps the §7.3
"runs elsewhere" message) — pinned by activeClientBinding.allowScan()
+ table test. cluster info now binds the active client exactly like
the data commands, so the pre-flight targets what data ingest will.
Surface rewrite:
- Root: tagline/Long/home screen rewritten around the real scope (two
contexts: your account / this machine's client); login leads Get
started; protocol jargon + internal issue links removed.
- ingest/data-ingest collision: validate moved to `data validate`;
top-level `ingest` is a hidden deprecated alias, and a bare path
there redirects: did you mean `tracebloc data ingest <path>`.
- No-client error copy: --namespace / installer one-liner (https) /
cluster doctor — never helm. Sentinel renamed to "no tracebloc
client found"; doctor no longer tells you to run doctor.
- Noun sweep: parent (client) release → client; vendors → other
collaborators; PVC jargon out of Shorts/flag help; README command
names updated.
Verified live on a real cluster (client in a non-default namespace):
data list / cluster info auto-find it; explicit -n default gets the
actionable error. go build/vet/test green; new tests cover the scan
(single/multi/none/explicit), the alias moves, and the allowScan
contract.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The kubectl→k pattern for the most-typed word in the product: the shell installer symlinks $PREFIX/tb → tracebloc (skipped if an unrelated tb already sits there); the PowerShell installer drops a tb.cmd shim. Both announce the alias in the install output + README. Requested by Lukas (2026-07-06). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The verification harness runs install.sh under a restricted PATH that didn't include ln → rc=127 on the happy path. Two-sided fix: the alias block now degrades silently when ln is unavailable or fails (an alias must never fail an install), and the harness whitelists ln+readlink and asserts the tb symlink exists and points at the binary on the happy path (12 checks now). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…effort on Windows Two review follow-ups on this PR: - cluster info printed the "namespace" field before the cluster-wide fallback scan retargets resolved.Namespace, so when the scan finds the client in its slug namespace the pre-flight reported "default" while the Client-install section and ingestor-SA path below showed the real namespace. Print the field after the retarget — the command's whole job is to report what the next `data ingest` will target. - install.ps1's tb alias wasn't actually best-effort: under $ErrorActionPreference='Stop' a Set-Content failure aborted the whole install (the third commit only hardened the Unix side). Wrap it in try/catch so a write failure just skips the alias. Also tighten the "is this tb.cmd ours?" guard from a loose "*tracebloc.exe*" substring (which would clobber any unrelated tb.cmd merely mentioning the name) to an exact match on our quoted binary path — matching install.sh's strict readlink-target equality. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Collaborator
|
Reviewed and pushed a couple of small fixes (31e8a1f):
Otherwise a clean, well-tested PR — the namespace-scan logic checks out. 👍 |
saadqbal
approved these changes
Jul 7, 2026
saadqbal
added a commit
that referenced
this pull request
Jul 7, 2026
…lete + nodeboot develop's #142 landed the §7.3 namespace-discovery + cluster-info binding (the pieces this branch had folded from #133), so those are dropped as redundant. What remains unique to this prototype (RFC-0001 §15, cli#136) is re-applied cleanly on top of #142: - `client use` removed; `client list` hidden (installer #303 pre-flight only); `client delete` added — deprovision + helm uninstall + local cluster delete. - internal/nodeboot (TeardownCluster + UninstallChart) + api.DeleteClient. - RFC-0001 §15 amendment (PROPOSED). Rebuilt via reset-to-develop + re-apply to avoid a semantic mis-merge (the auto-merge had silently reverted the surface to develop's create/list/use). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This was referenced Jul 7, 2026
This was referenced 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.
Summary
Fixes the CLI's out-of-box dead end and rewrites its first-touch surface, driven by a real session on a standard install (Lukas's Mac, client in its slug namespace):
A working client was right there on the cluster — the CLI just never looked beyond the kubeconfig's default namespace, then told a customer to run Helm (the exact thing its own help promises they never do).
1. Namespace auto-discovery (§7.3)
cluster.FindClientNamespaces— cluster-wide scan for jobs-manager Deployments (same selector as single-namespace discovery).discoverReleasefallback in the shared resolve seam: a miss in the default namespace triggers the scan. Exactly one client → retarget with a visible note (· No client in namespace "default" — using the one in "tracebloc" …); several → named, pick via--namespace/client use; none or RBAC-denied scan → the original error stands.--namespace/--context, and never for an active-client binding miss (that keeps the §7.3 "runs elsewhere" message — a stale binding must not silently retarget a different machine's client). Pinned byactiveClientBinding.allowScan()+ table test.cluster infonow binds the active client exactly like the data commands — the pre-flight targets whatdata ingestwill actually target, and the multi-client "set your active client" remediation works there too.2. First-touch surface
loginleads Get started;POST /internal/…protocol jargon and issue links removed.ingestvsdata ingestcollision:validatemoved todata validate; top-levelingestis a hidden deprecated alias, andtracebloc ingest <path>now redirects: did you meantracebloc data ingest <path>.--namespace→ installer one-liner (https) →cluster doctor; never Helm. Sentinel renamed tono tracebloc client found;cluster doctorno longer advises runningcluster doctor.data ingest/data validate.3.
tbshort alias (second commit)The installers now ship
tbnext to the binary (symlink on Unix,tb.cmdshim on Windows; both skip if an unrelatedtbexists).tb data ingest ./data. Requested by Lukas.Verification
data list+cluster infoauto-find it with the note; explicit-n defaultgets the new actionable error; invocation via atbsymlink verified.go build/go vet/ fullgo test ./...green. New tests: scan (single/multi/none/explicit-no-scan),allowScancontract table,data validate+ingest validatealias resolution, updated string pins.Context: part of the CLI/installer UX pass with tracebloc/client#307 and the v2 spec (backend#992); complements cli#137/cli#138 (which cover
client createauto-naming and the login/status contract).🤖 Generated with Claude Code