refactor: rename container to docker and add orchestrator bridge helpers#257
Merged
refactor: rename container to docker and add orchestrator bridge helpers#257
Conversation
Design for implementing the Op struct and plan.Task() method that all 24 examples reference but was never built. Replaces the hardcoded DockerXxx() methods with a generic operation dispatch registry covering all 23 documented operations. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
8-task plan to implement Op struct, plan.Task(), operation registry, delete docker.go DSL, update all examples, and verify everything compiles. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Replace the Op dispatch registry design with a simpler approach: add CollectionResult and StructToMap bridge helpers to the SDK, delete the misplaced docker.go DSL, and fix all examples to use TaskFunc (matching how osapi-orchestrator actually works). 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Reordered: SDK helpers first with 100% coverage, delete docker DSL, fix all examples (verify each compiles), update docs, final verification. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
The Op-based dispatch design was replaced by the bridge helpers approach. Remove the old design doc to avoid confusion. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Container operations will be managed through the standard API/CLI/SDK path using the new container domain endpoints, not through an in-process DSL that runs osapi inside containers. Remove RuntimeTarget, DockerTarget, ScopedPlan, ContainerProvider, deploy helpers, provider run CLI, and provider registry. Rewrite container-targeting example and docs to use SDK client directly. Update design doc and implementation plan. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Design doc for renaming the generic container domain to docker-specific, with per-runtime domains, CLI nesting under `client container docker`, API paths at /container/docker, and orchestrator DSL helpers. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Rename PermContainer{Read,Write,Execute} constants to
PermDocker{Read,Write,Execute} with docker:* string values.
Update AllPermissions, DefaultRolePermissions, and the
combined OpenAPI spec security scopes.
Co-Authored-By: Claude <noreply@anthropic.com>
Flatten provider/container/runtime/ to provider/docker/, rename all job
operation constants (OperationContainer* to OperationDocker*), data
types (ContainerCreateData to DockerCreateData, etc.), client methods
(ModifyContainerCreate to ModifyDockerCreate, etc.), agent processor
category routing, and API handler method signatures and schema types to
match the new generated OpenAPI types. Update all HTTP test paths from
/node/{hostname}/container to /node/{hostname}/container/docker.
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Update all documentation to reflect the container→docker rename:
- Permissions: container:read/write/execute → docker:read/write/execute
- CLI commands: client container <op> → client container docker <op>
- SDK calls: c.Container.* → c.Docker.*
- Generated types: gen.Container* → gen.Docker*
- API paths: /node/{hostname}/container/* → /node/{hostname}/container/docker/*
- Job operations: container.*.* → docker.*.*
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Rename processor_container.go → processor_docker.go - Rename handler_container.go → handler_docker.go - Rename containerProvider → dockerProvider throughout agent package - Rename GetContainerHandler → GetDockerHandler in API wiring - Update all tests to match 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Remove the Service/Driver/Provider split. Client now directly implements Provider (with Ping merged in). This eliminates the pure-delegation Service layer and renames NewDriver → New. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Add closure execution and error path tests for all 8 Docker DSL methods using httptest servers with proper JSON responses. Coverage goes from 16.7% to 100% per method. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Add Changed bool to Container, ActionResult, ExecResult, and PullResult so the agent handler can extract it consistently via extractChanged(). Start/Stop/Remove now return *ActionResult instead of bare error, matching the pattern used by DNS, command, file, and host providers. Also fix broken Docusaurus link to renamed API doc path. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Move the 8 Docker CLI operation docs from container/ to container/docker/ to match the CLI command hierarchy (client container docker <op>). Add docker.mdx parent page and simplify container.mdx to a runtime grouping. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Rename 8 operation doc files from container-*.md to docker-*.md to match the docker.* operation names. Update links in orchestrator.md and fix container-ops → docker-ops role name. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Cleanup (remove) was at the same dependency level as exec and inspect tasks, causing a race where the container could be deleted before exec commands ran. Fix by making cleanup depend on all tasks that need the container. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Cleanup was skipped because it depended on deliberately-fails which always errors. That task is independent and shouldn't block cleanup. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Add a pre-cleanup task that removes any leftover container from a previous run before creating a new one. Errors are swallowed since the container may not exist. This prevents "name already in use" failures on re-runs. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Add bridge helpers that let SDK consumers build orchestrator Results from Collection responses without reinventing mapping logic. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Domain-specific operation methods belong in consumer packages like osapi-orchestrator, not in the SDK engine. The SDK provides CollectionResult and StructToMap as bridge helpers instead. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Replace all broken plan.Task(name, &orchestrator.Op{...}) calls with
plan.TaskFunc() using the SDK client directly. Add 8 new Docker
operation examples. Fix variable shadowing in only-if-failed.go.
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Add injectable jsonUnmarshalFn to cover the unmarshal error branch in StructToMap. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
3757ac7 to
a974301
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #257 +/- ##
==========================================
- Coverage 99.94% 99.94% -0.01%
==========================================
Files 222 222
Lines 9512 9393 -119
==========================================
- Hits 9507 9388 -119
Misses 3 3
Partials 2 2
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
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
containerdomain todockeracross all layers (API,provider, agent, job, CLI, SDK, permissions, docs, tests)
client container docker <op>to support futureruntimes under the
containerparentCollectionResult[T]andStructToMapbridge helpers topkg/sdk/orchestrator/so consumers likeosapi-orchestratordon'tneed to reinvent result conversion
(domain ops belong in consumer packages)
unimplemented
orchestrator.Optype — rewritten to useTaskFuncChanged boolto Docker provider result types for consistentchange tracking
Test plan
go test ./...passes (all packages)golangci-lint runreports 0 issuesdocs buildsucceeds with no broken linkspkg/sdk/client/,pkg/sdk/orchestrator/,pkg/sdk/platform/just go::unit-int)🤖 Generated with Claude Code