Skip to content

fix+refactor: 12-expert review — bugs, dead code, safety, quality#34

Merged
robbycochran merged 6 commits into
mainfrom
rc-post-bash
Jun 5, 2026
Merged

fix+refactor: 12-expert review — bugs, dead code, safety, quality#34
robbycochran merged 6 commits into
mainfrom
rc-post-bash

Conversation

@robbycochran

Copy link
Copy Markdown
Collaborator

Summary

  • 7 bug fixes: kubectl quiet-mode retry (never retried on transient errors), non-seekable stdin retry (replayed empty input), gateway timeout returning exit 0, goroutine leak in preflight runQuiet, buggy test helpers, kubectl error message mismatch
  • Dead code deletion: removed SandboxUpload/SandboxExec (zero callers), Warnf, decodeBase64 wrapper, internal/util package, unused Gateway sub-interfaces (~57 lines)
  • Safety improvements: swallowed errors in deploy/new, staging dir TOCTOU fix (os.MkdirTemp), teardown requires explicit flags, --local/--remote mutual exclusion, BuildSandboxEnv shell quoting (%q), file permission fixes (0600)
  • Code quality: parseFirstColumn dedup, file merges (parse.go, check.go), test mock relocation to helpers_test.go, RunHelm signature fix
  • Cleanup: detectHarnessDir dedup + fail-fast, preflight unknown subcommand error, Makefile lint/vet targets

Net: -51 lines across 21 files. All tests passing.

Test plan

  • go test ./... passes (both modules)
  • go vet ./... clean
  • make validate (full integration — podman + OCP)

🤖 Generated with Claude Code

robbycochran and others added 6 commits June 5, 2026 07:04
- kubectl quiet mode now captures stderr for transient error detection
- kubectl retry with non-seekable stdin returns error instead of replaying empty input
- kubectl error messages include actual executed args (with injected flags)
- deployRemote gateway timeout returns error instead of exit 0
- runQuiet uses context.WithTimeout instead of leaking goroutines
- buggy contains()/indexOf() test helpers replaced with strings.Contains

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Remove SandboxUpload/SandboxExec from Gateway interface and CLI impl (zero callers)
- Remove status.Warnf (zero callers)
- Inline decodeBase64 (trivial stdlib wrapper, one caller)
- Delete internal/util package (single FileExists function, inline at call site)
- Flatten Gateway sub-interfaces into single interface (no consumer used the narrow types)
- Remove no-op cmd.Stderr = nil in runOutput

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Check os.UserHomeDir and GatewaySelect errors in deployRemote
- Add failure guidance on deploy error (suggests harness teardown --k8s)
- Teardown requires at least one flag instead of defaulting to delete-all
- Validate --local/--remote mutual exclusion on new command
- Use os.MkdirTemp for staging dir instead of hardcoded /tmp/openshell
- Defer cleanup of staging dir on all exit paths
- Quote values in BuildSandboxEnv (%q) to prevent shell injection
- Write sandbox.env with 0600 instead of 0644
- Fix stale ./setup-providers.sh reference to harness providers

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ature

- Extract parseFirstColumn to deduplicate ProviderList/SandboxList parsing
- Merge parse.go into profile.go (arbitrary split, 30 lines)
- Merge check.go into preflight.go (arbitrary split, check.go depended on preflight.go types)
- Move shared test mock (mockGW) to cmd/helpers_test.go
- Change RunHelm to return error only (string return was always empty)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…le lint

- Deduplicate directory walk loop in detectHarnessDir (roots slice)
- Fail fast with clear error instead of silently falling back to "."
- Add default case in preflight subcommand switch (rejects unknown args)
- Add make vet and make lint targets to Makefile

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@robbycochran robbycochran merged commit 40fb5b6 into main Jun 5, 2026
@robbycochran robbycochran deleted the rc-post-bash branch June 13, 2026 14:02
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.

1 participant