Skip to content

Refactor cleanup branch integration#12

Merged
stenh0use merged 73 commits into
mainfrom
refactor-cleanup
May 2, 2026
Merged

Refactor cleanup branch integration#12
stenh0use merged 73 commits into
mainfrom
refactor-cleanup

Conversation

@stenh0use

@stenh0use stenh0use commented May 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • integrate the accumulated refactor-cleanup branch work into main
  • include provider/build refactors, CLI correctness fixes, test and boundary hardening, and team runtime/documentation updates accumulated on this branch
  • add pull request CI automation with required checks (make test, make hind-cli) and image build validation (./bin/hind build all)

Test plan

  • make test
  • make hind-cli
  • Confirm GitHub Actions PR CI job passes on this PR

🤖 Generated with Claude Code

stenh0use and others added 30 commits April 26, 2026 10:32
Align the start command contract with actual runtime behavior by removing the unsupported --version flag and updating command coverage and docs.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Require committing coordinator-branch changes before spawning worktrees, basing subagent worktrees on the active branch, and rebasing before integration gates.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Capture restart context, branch anchors, worktree status, and next actions with references to canonical team docs to minimize context reload cost.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Prevent nil-pointer panic in Manager.Get when network inspection returns nil and add regression coverage for missing-network and inspect-error paths.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Block traversal and absolute/root-escape in cluster name and file path handling, and add focused regression tests for confinement behavior.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Treat first-run missing cluster config directory as an empty list so `hind list`
returns the empty-state success output instead of an error.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Ensure manager read/stop operations always honor persisted cluster topology while preserving default config behavior when no state file exists.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Compute get status from runtime container states and format port slices for readable output without fmt artifacts.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
In Stop() and Delete(), InspectContainer returned (nil, err) when the
docker daemon failed. The nil-check on containerInfo fired first,
causing the error to be silently swallowed and execution to continue.

In Delete(), InspectNetwork errors were also discarded - the condition
err == nil && netInfo != nil silently dropped any non-nil error.

Fix all three sites by checking err != nil before checking for nil
info, and add fmt.Errorf wrapping with percent-w for context. Add three
tests that verify each error is propagated via errors.Is.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Apply scoped correctness fixes for reconcile planning, network list error text,
container image fallback, vault port assignment, and polling timer handling.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Delete the unreferenced pkg/cluster/cni scaffolding and clean stale AGENTS guidance
so architecture docs match runtime reality.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Clarify that hind no longer supports enabling Cilium via the start command after CNI package removal, preventing users from following a broken CLI path.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
(cherry picked from commit 7d11f3297b710eed7ba5530a7b7eb063d2de4bdf)
Remove hardcoded dockercli construction from cluster.New by requiring an injected provider.Client, then update command callsites to pass dockercli explicitly and add constructor DI seam tests.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Use root-relative EnsureDir usage in image file templating so hind build no longer fails with "path must be relative" after path confinement hardening, and add regression coverage for embedded build context extraction.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…numbering collision

Adds newNomadClientNode, parseClientNodeNumber, and nextClientNodeNumber to
types.go as a single source of truth for client node construction. Wires
addClientNodes in manager.go to use nextClientNodeNumber (max-based, not
count-based) and newNomadClientNode, eliminating the collision bug where adding
a node to a cluster with gaps (e.g. clients 01, 03) would produce a duplicate
instead of the next available number.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add ClientStub to pkg/provider/mock package with optional func fields
for each interface method. Each method dispatches to its Fn field if
non-nil, otherwise returns zero values. Includes compile-time interface
assertion to ensure ClientStub implements provider.Client.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Delete four duplicated local stub types (stubProviderClient,
managerProviderStub, stubProvider, waitFakeProvider) and replace all
usages with *mock.ClientStub from pkg/provider/mock.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
stenh0use and others added 28 commits April 30, 2026 20:57
- Mark BL-018 done (default-version resolution + dependency messaging gaps closed)
- Remove worktree-agent-ace3ba77e384a7624 (strict ancestor of refactor-cleanup)
- Promote BL-019 to in-progress with staff planning gate open
- Commit BL-017 stop behavior product code (force/verbose/partial/idempotent)
- Update team runtime files: work-items, log, handoff

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Merges worktree-agent-aa19bb280d37fcce0 (BL-019) into refactor-cleanup.
Resolves conflicts in rm.go, start.go, start_test.go by preserving the
factory-seam pattern from BL-019 with correct three-arg cluster.New calls.
Also fixes pre-existing test failures: stop_test.go duplicate removal,
StopWithOptions config-name requirement, and aggregation contract update.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Extend BuildImageOptions with Dockerfile, WithCache, Platform fields
- Add BuildImageResult struct with Digest and ImageRef
- Update Client interface: BuildImage returns (BuildImageResult, error)
- Update dockercli stub and mock/ClientStub to match new signature

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
… extraction

- Add CommandExecutor seam to Client struct for test injection
- Add newWithExecutor constructor for tests
- Implement checkBuildxAvailable in info.go (call-time check, not construction)
- Full BuildImage: buildx args with --load unconditional, metadata-file digest extraction
- Validate digest starts with sha256: before returning BuildImageResult
- Add 7 unit tests covering buildx-absent, success, empty-digest, --load, --platform omit, --no-cache

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…provider

Phase 3: image.go — replace []docker.BuildArg with map[string]string;
remove internal/docker import from image.go; packagesToBuildArgs and
buildArgs now return map[string]string.

Phase 4: builder.go — add provider.Client field; NewBuilder takes
client provider.Client; BuildImage delegates to client.BuildImage;
checkDependencies uses client.TagExists; no internal/docker import.

build.go call site updated to construct dockercli.New(logger) and pass it
to NewBuilder.

Tests: builder_test.go updated for new NewBuilder signature with stub
client; added TestBuilder_CheckDependencies tests; added image_test.go
asserting map return types for buildArgs and packagesToBuildArgs.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
All runtime Docker operations now go through pkg/provider/dockercli.
No production code imports pkg/build/image/internal/docker. Full deletion
is safe; logic has been reproduced in pkg/provider/dockercli/{build,info}.go.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Implements W-026 by adding GitHub Actions pre-merge checks for pull requests to main, including test and CLI build validation with team protocol artifacts.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@stenh0use stenh0use merged commit bc1604b into main May 2, 2026
1 check passed
@stenh0use stenh0use deleted the refactor-cleanup branch May 4, 2026 16:32
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