docs+quality: CLI reference drift, one ErrHandled, real flags for the hand-parsed leaves, parity holes (2026-09-05 review) - #172
Merged
Conversation
fentas
changed the base branch from
fix/review-supply-chain
to
feat/go-single-binary
September 6, 2026 06:33
… hand-parsed leaves, parity holes Docs (2026-09-05 review, quality/docs slice) - docs/reference/cli.md: `lo up --ci/--timeout` (+ the tilt ci exit-status contract), `lo tilt ci|preflight`, `lo kubehz join <node> [--print-token]`, `lo kubehz claim --nonce -` / KUBEHZ_CLAIM_NONCE, the argsh#176 footnote gone (the binary reads stdin itself), `lo kustomize test` names its prerequisite (make + Go), and the `lo up` paragraph states what the binary does without a spec (stops on ResolveSpec; no legacy fallback). - README: `lo status` no longer promises per-target build state; `lo up --ci`, `lo addons [name...] [--detail]`, `lo tilt ci|preflight`; the `.mcp.json` clause says it launches the argsh-builtin server. - docs/guide/toolchain.md: "owner decision" → "planned". - mise.toml: the deprecated PATH_SECRETS export is a comment now. - docs/reference/go-migration.md: B6 — `lo image clean` names the cache registry from different sources in the two implementations (found by the new harness line; not aligned here). Quality - Ported `addons` / `kustomize` builders take their Short from the spec; TestCommandTreeMatchesArgshUsage now also compares the ASSEMBLED tree's Short texts (mutation-checked: a hard-coded Short goes red). - One ui.ErrHandled: every package sentinel (cli, tilt, scaffold, kubehz, recover, operator, env, image, hooks, build, deploy, addons, secrets/lint/oidc ErrPrinted) is the same value; the six `==` compares are errors.Is. Behaviour unchanged (the mapping shims stay). - argshErrorf lives next to ErrHandled in root.go. - Real cobra flags for `lo secrets set|env`, `lo kubehz handover receive`, `lo env services` (help, completion and the MCP schema see them). The bash shorthand shadowing (-s = --namespace / --snapshot) is kept by declaring a local `cluster` flag so cobra skips the inherited one; the argsh error text comes through argshFlagErrors. Flag-binding tests replace the parser tests (mutation-checked). - `lo kustomize <unknown>`: `Invalid command: x`, rc 1 (was: group help, rc 0) — the `ai` group's shape. - hack/parity-*.sh gain: trust (stubbed mkcert), kustomize list/clean/ bogus, image clean, tilt restart, kubehz claim-code. - internal/execx has unit tests: Look prefers .bin over PATH and skips non-executables, Run appends Env, honours Dir, uses a path as-is, and reports an unresolvable tool (mutation-checked). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…for shorthand flag errors - The `lo image clean` "divergence" recorded as B6 was the documented D3 flag-placement effect: bash main resolves the spec (and with it the registry network name) from the domain it parsed BEFORE dispatch, so a --domain after the verb is invisible to that lookup in bash only. The harness line now puts --domain first, needs no allow-list, and B6 is gone from the catalogue. - argshFlagErrors rewrites pflag's SHORTHAND messages into argsh's (`unknown flag: -x`, `missing value for flag: <long name>`); the long forms already matched. The flag-binding tests pin the bash wording (mutation-checked: normalisation off → FAIL). - D23: a `-s` placed before the subcommand binds to the leaf's own `-s` on secrets set/env and handover receive (cobra is position-insensitive; argsh's main consumed it as --cluster). - cmd_env.go header no longer describes the deleted hand-parser; secretsArgs' comment names what it is; the secrets flag test lives in cmd_secrets_test.go; the drift-test comment says "top-level only"; cli.md's --print-token line matches the flag text. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
fentas
force-pushed
the
fix/review-docs-quality
branch
from
September 6, 2026 06:59
38f03e3 to
3a106bc
Compare
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.
Docs and small-quality findings of the 2026-09-05 lok8s review (code-quality / docs / feature-completeness slice). Stacked on #171 (
fix/review-supply-chain) because both touchinternal/cli/cmd_kubehz.go; retarget tofeat/go-single-binaryonce #171 merges.Docs
docs/reference/cli.md:lo up --ci [--timeout]with thetilt ciexit-status contract;lo tilt ci|preflight(flags verified against--help);lo kubehz join <node> [--print-token];lo kubehz claim --nonce -/KUBEHZ_CLAIM_NONCE; the argsh#176 footnote dropped (the binary reads stdin itself);lo kustomize testnames its prerequisite; thelo up"legacy fallback" sentence replaced by what the binary does (verified ininternal/provision/spec.go:ResolveSpecstops withNo cluster.lok8s.yaml or deploy.lok8s.yaml found; no spec-less path exists).lo status→ "Cluster health (the driver's status check)";lo up --ci,lo addons [name...] [--detail],lo tilt …|ci|preflight; the.mcp.jsonsentence says it launches the argsh-builtin server.docs/guide/toolchain.md: "each step is an owner decision" → "planned; sequenced separately".mise.toml:PATH_SECRETSexport commented out with the reason./mnt/scratch/github/kernpilot/TODO.md: thelo audit --sarifline struck (shipped in feat(audit): lo audit --sarif — SARIF 2.1.0 output for GitHub code scanning #163) — edited directly, it is not in a repo.docs/reference/go-migration.md: D23 — a-splaced before the subcommand binds to the leaf's own-sonsecrets set|envandhandover receive(cobra is position-insensitive; argsh's main consumed it as--cluster). (A first push recorded a "B6" forlo image clean; the reviewer showed it was the documented D3 flag-placement effect — withdrawn, see "Review round".)Quality
addons/kustomizebuilders come from the spec;TestCommandTreeMatchesArgshUsagenow compares the assembled tree'sShorttoo (the gate's boundary is stated in the test: flags/arity/long help stay outside).ui.ErrHandled: all 15 package sentinels alias it; the six==compares areerrors.Is. Mechanical, behaviour unchanged.argshErrorfmoved toroot.gonext toErrHandled.lo secrets set|env,lo kubehz handover receive,lo env services—--help, completion and the ophis MCP schema see them now. The bash first-match shorthand semantics are kept:-s=--namespace/--snapshoton those leaves; a localclusterflag (same name, no shorthand) makes cobra skip the inherited global instead of panicking on the redefinition.env serviceskeeps the opposite resolution (inherited-s/-rwin) exactly as the old comment documented. Error text goes throughargshFlagErrors. The parser unit tests became flag-binding tests through the assembled tree.lo kustomize <unknown>now printsInvalid command: xand exits 1 (cobra printed the group help and exited 0); same message as bash (rc 2 there, D1).lo trust(stubbedmkcertin a dedicated project; the real one would install a CA into the ambient trust store),lo kustomize list|clean|bogus,lo image clean(--domainbefore the verb, D3),lo tilt restart,lo kubehz claim-code.argshFlagErrorsrewrites pflag'sunknown shorthand flag: 'x' in -x→unknown flag: -xandflag needs an argument: 'n' in -n→missing value for flag: <long name>; long forms already matched.lo mcpis Go-only (allowlisted in the drift gate) so it has no bash twin to diff;lo kustomize build|testneed a Go toolchain in the synthetic project and stay out.internal/execxunit tests:Lookorder (.bin over PATH, non-executables skipped, miss reported),Runenv merge,Dir, path-as-is, unresolvable tool.Gates (run locally with
env -u PATH_*, on the rebased head)make build/make build-fullgo vet ./...(core + inprocess)go test ./... -count=1(core + inprocess)golangci-lint run(core +--build-tags inprocess)hack/parity-*.sh×bin/loandbin/lo-full./.bin/argsh test tests/unit/·tests/operator/hack/lint-shell.shas a whole: rc 123 on the pristine base too — pre-existing AG007 warnings in untouched files)Mutation checks
Hard-coded
addonsShort →TestCommandTreeMatchesArgshUsageFAIL;-sshorthand removed fromsecrets set→TestSecretsSetEnvFlagsBindLikeTheBashSpecFAIL;-sremoved fromhandover receive→TestHandoverReceiveFlagsBindLikeTheBashSpecFAIL;Lookno longer prefers.bin→TestLookPrefersTheProjectBinOverPATHFAIL;Rundrops the inherited env →TestRunMergesEnvAndSetsDirAndUsesPathsAsIsFAIL; thekustomizeRunE was proven by the harness going red before it existed (lo kustomize bogus — rc=0, want 1).Review round
Reviewer verdict on the first push: REQUEST CHANGES — the B6 row misdiagnosed the
image cleandifference (it is D3: bash resolves the spec from the domain parsed before dispatch, so a trailing--domainis invisible there). Fixed:--domainfirst in the harness, no allow-list, B6 withdrawn. Should-fixes taken: stalecmd_env.goheader, shorthand error wording normalised inargshFlagErrors(tests pin the bash text, mutation-checked), D23 documented. Nits taken:secretsArgscomment, test moved tocmd_secrets_test.go,cli.md--print-tokenwording, drift-test comment says "top-level only". All gates re-run on the fixed head (table above reflects it).Skipped (from the brief, on purpose)
The env/exec seam migration, the three
spec.bootstrapparsers,lo secrets remove-key(#137 needs the bash twin first), the long-function splits.TODO(go-port)→TODO(WP3)/(WP5): noTODO(go-port)exists on this head any more (grep is empty), nothing to rename.🤖 Generated with Claude Code