feat(status): surface the environment's seal-check verdict (client status --seal)#395
Open
LukasWodka wants to merge 4 commits into
Open
feat(status): surface the environment's seal-check verdict (client status --seal)#395LukasWodka wants to merge 4 commits into
LukasWodka wants to merge 4 commits into
Conversation
…atus --seal) `tracebloc client status --seal` runs the chart's conformance checks (its helm-test hooks — the RFC-0003 §8.2 seal check) against this machine's secure environment and prints an honest verdict with per-check detail: sealed every conformance check passed (exit 0) unsealed a check failed — a protection is not enforced (exit 2) unknown the chart ships no checks; nothing was verified (exit 2) Chart contract (works against today's probes, picks up the growing backend#1184 suite as it lands): test hooks labelled `tracebloc.io/seal-check: "true"` form the suite; with no labelled hook every helm test runs, with a visible fallback note; the optional `tracebloc.io/seal-name` / `tracebloc.io/seal-hint` annotations refine a check's display name and its failure hint. Checks run one `helm test --filter name=<hook>` at a time so a first failure can't hide the rest of the suite's state, and helm stays pinned to the resolved kubeconfig/context — never the ambient one. Honest-output rules (the #389 spirit): only a fully-passed suite exits 0; "unknown" is never worded as sealed; a cancelled run (Ctrl-C) and a failed hook enumeration yield no verdict at all. Also: moves the status command into client_status.go (client.go sat at its 1050-line file-budget ceiling) and adds Printer.Spinner strings to the copy-catalog harvest (they print as static lines on non-TTY runs and were previously missed by the backstop). Closes #393 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
Author
|
bugbot run |
Contributor
Author
|
👋 Heads-up — Code review queue is at 31 / 30 Above the WIP limit. The team convention is to review existing PRs before opening new work. Open PRs currently in Code review (oldest first):
Pull from review before opening new work. (This is a nudge from the kanban WIP check, not a block.) |
The table is the cross-command scripting contract; the new seal mode produces 2 (unsealed / unknown via exitChecksFailed) and shares the 3 / 4 cluster-resolution codes with the data and resources commands. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
Author
|
bugbot run |
…ks in every filter Two alignments against the chart-side suite (client docs/SEAL-CHECK.md, backend#1184) that landed in parallel: - The per-check identifier is the tracebloc.io/seal-check-name LABEL (values: egress-enforcement, backend-reachability, storage-assertions), not a seal-name annotation — read it from labels. The hint stays an optional CLI-side annotation (labels cannot carry sentences); absent, the kubectl-logs fallback stands. - The storage-assertions Job depends on a ServiceAccount/RBAC that are themselves test hooks at negative hook-weight, and helm's --filter excludes every unlisted test hook — plumbing included. Filtering to the check alone would strand the Job without its SA and report a false Unsealed. Every per-check run now lists the check PLUS the release's non-runnable test hooks (applied instantly; helm only waits on Jobs/Pods), while other checks stay excluded so the verdict remains per-check. Non-runnable hooks never count as checks: a chart whose only test hooks are plumbing is still honestly "unknown". Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
Author
|
bugbot run |
…C during enumeration (Bugbot) - helm.TestTarget.KubeContext now carries target.Resolved.Context, not the raw --context flag: with the flag omitted the raw value is empty and helm falls back to its own ambient resolution ($HELM_KUBECONTEXT included), which can diverge from the context client-go discovery just used. Same pinning `resources set` applies. - A context cancellation during `helm get hooks` now exits 130 quietly (like the per-check loop and `status --wait`) instead of reporting a hard enumeration failure. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
Author
|
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 1d9c07c. Configure here.
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.
Closes #393. Companion to RFC-0003 §8.2 D12 (#366) and the chart-side seal-check suite work (backend#1184).
Summary
tracebloc client status --sealruns the chart's conformance checks (its helm-test hooks — the seal check) against this machine's secure environment and prints an honest verdict with per-check detail:(Exit 3 = kubeconfig/cluster unreachable, exit 4 = no tracebloc client found — the same contract as the data/resources commands.)
Design choices
client status, not a new command. The repo has no top-levelstatus; its status command istracebloc client status, and the seal is the conformance dimension of that status.--waitset the precedent for mode flags there.--sealis mutually exclusive with--wait, and the cluster-targeting flags (--kubeconfig/--context/--namespace) +--timeoutare rejected when their mode isn't active rather than silently ignored.internal/helm/seal.go) — aligned with the chart side'sdocs/SEAL-CHECK.md(backend#1184 branchsecurity/seal-check-suite-1184): runnable test hooks (Jobs/Pods) labelledtracebloc.io/seal-check: "true"form the suite, andtracebloc.io/seal-check-nameis each check's stable identifier (egress-enforcement,backend-reachability,storage-assertions). No labelled hooks → run all of the chart's runnable helm tests, with a visible fallback note (works against today's unlabelled probes until the chart PR merges). No runnable test hooks at all → unknown, honestly. Atracebloc.io/seal-hintannotation is a CLI-side optional channel for a per-check failure hint (labels can't carry sentences); absent, the hint falls back to a copy-pasteablekubectl logspointer.helm test --filter name=<hook>,…per check, because helm stops a suite at the first failure — per-check invocation reports every check's state (the partially-degraded picture status: surface environment conformance (seal check) result #393 asks for), with the exit code as the unambiguous per-check signal. Each run's filter also carries the release's non-runnable test hooks (the storage check's SA/RBAC plumbing at negative hook-weight): helm's--filterexcludes every unlisted test hook, so filtering to the check alone would strand it without its ServiceAccount and report a false Unsealed. Plumbing never counts as a check (a plumbing-only chart is still "unknown"). Hook names come fromhelm get hookson the same release store the test action reads, so they can't drift.resolveClusterTarget(§7.3 active-client binding, "runs on another machine" rewrite, discovered release name — release ≠ namespace on customer-managed installs) and helm stays pinned to the resolved kubeconfig/context, never the ambient one.Also in this PR
client.gosat at its 1050-line file-budget ceiling, so the status command moved verbatim intoclient_status.go(client.go → 871 lines; the diff on client.go is a pure removal).Printer.Spinnerstrings added to the copy-catalog harvest — they render as static lines on non-TTY runs and were previously missing from thezz-all-strings.goldenbackstop (this PR'sChecking <check>…included).08-client.golden(rendered through the purerenderSealResult), withmustRendermarkers so they can't silently vanish.Test plan
make ciall green (vet, race tests, lint, fmt-check, schema-check, vulncheck, file-budget, deadcode, check-style);internal/clicoverage 84%+ (floor 80),internal/helm94%internal/helm/seal_test.go: hook parsing against realistichelm get hooksoutput (both seal labels, hint annotation, aux SA hook non-runnable, non-test hooks filtered, legacytest-successcounted, comment-only docs skipped), fail-closed on unparseable manifests, exact argv forget hooks/test --filter name=a,name=bincl. kubeconfig/context pinning, raw error+output passthroughinternal/cli/seal_test.go: sealed / unsealed (failure detail distilled from helm's output, chart hint + kubectl-logs fallback, suite continues past a failure) / unknown for both no-hooks and plumbing-only charts (never claims sealed) / fallback-unlabeled / labelled-subset-only / aux plumbing carried in every filter but never counted / enumeration-error → no verdict / resolve-error propagation (exit 4) / Ctrl-C → exit 130, no verdict /helmFailureDetailtable / cobra flag guards /--seal --timeoutreaches the per-check budgetTB_UPDATE_GOLDEN=1) and reviewed: three seal screens + new--helpin08-client.golden, all new strings inzz-all-strings.golden--wait --sealand cluster-flags-without---sealguards fire with exit 1security/seal-check-suite-1184) merges — until then the fallback path exercises today's unlabelled probes🤖 Generated with Claude Code
Note
Medium Risk
Touches cluster resolution and helm test execution on customer environments; exit-code contract is script-facing but behavior is heavily tested and fails closed on ambiguous states.
Overview
tracebloc client status --sealruns the chart’s helm-test conformance hooks against the active secure environment and prints a per-check verdict (sealed / unsealed / unknown). Only a full pass exits 0; unsealed and unknown use exit 2, with cluster errors aligned to existing data-command codes (3/4).--wait(backend online polling) and--sealare mutually exclusive; kubeconfig/context/namespace and--timeoutapply only when the matching mode is active.New
internal/cli/seal.goandinternal/helm/seal.godiscover hooks viahelm get hooks, run onehelm testper check (so every check is reported), and always include non-runnable aux hooks in the filter so checks don’t false-fail. Older charts without seal labels fall back to all runnable tests; hook-list failures and Ctrl-C avoid printing a misleading verdict.client statuslogic moves fromclient.gointoclient_status.go(file-budget). Troubleshooting exit-code docs and copy-catalog goldens cover the three seal screens and new user strings.Reviewed by Cursor Bugbot for commit 1d9c07c. Bugbot is set up for automated code reviews on this repo. Configure here.