fix(resource): implement missing container handler module for container infrastructure resource types #3245
Labels
No labels
auto/needs-reevaluation
controller-managed
auto/blocked-by-deps
auto/ci-timeout
auto/claimed-implementer
auto/claimed-merge
auto/claimed-reviewer
auto/driver-down
auto/invariant-violation
auto/last-attempt-tier-0
auto/last-attempt-tier-1
auto/last-attempt-tier-2
auto/last-attempt-tier-min
Automation Tracking
auto/needs-conflict-resolution
auto/needs-implementer
auto/postmortem
auto/ready-to-merge
auto/restart-throttled
auto/revert
auto/sentinel
auto/stale-inactivity
auto/unstable
Blocked
Bounty
$100
Bounty
$1000
Bounty
$10000
Bounty
$20
Bounty
$2000
Bounty
$250
Bounty
$50
Bounty
$500
Bounty
$5000
Bounty
$750
MoSCoW
Could have
MoSCoW
Must have
MoSCoW
Should have
Needs Feedback
Points
1
Points
13
Points
2
Points
21
Points
3
Points
34
Points
5
Points
55
Points
8
Points
88
Priority
Backlog
Priority
CI Blocker
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Signed-off: Owner
Signed-off: Scrum Master
Signed-off: Tech Lead
Spike
State
Completed
State
Duplicate
State
In Progress
State
In Review
State
Paused
State
Unverified
State
Verified
State
Wont Do
Type
Automation
Type
Bug
Type
Discussion
Type
Documentation
Type
Epic
Type
Feature
Type
Legendary
Type
Refactor
Type
Support
Type
Task
Type
Testing
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
cleveragents/cleveragents-core!3245
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/container-handler-module-missing"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Fixes the runtime
HandlerResolutionErrorthat occurs when any of the seven container infrastructure resource types (container-runtime,container-image,container-mount,container-exec-env,container-port,container-volume,container-network) are used. The handler modulecleveragents.resource.handlers.containerwas referenced in_resource_registry_container.pybut did not exist.Problem
All seven container infrastructure resource types registered in
_resource_registry_container.pyreferenced handler classes in a module that did not exist:Solution
Implemented
src/cleveragents/resource/handlers/container.pywith five handler classes:ContainerRuntimeHandlercontainer-runtimeContainerImageHandlercontainer-imageContainerChildHandlercontainer-mount,container-exec-env,container-portContainerVolumeHandlercontainer-volumeContainerNetworkHandlercontainer-networkAll handlers:
_ContainerBaseHandler(which extendsBaseResourceHandler)ResourceHandlerprotocolNotImplementedErrorforresolve()(container sandbox provisioning is pending, mirrorsCloudResourceHandlerpattern)content_hash()based on resource type + locationNotImplementedErrorfor all CRUD and lifecycle stubsFiles Changed
src/cleveragents/resource/handlers/container.py— new module (310 lines)src/cleveragents/resource/handlers/__init__.py— export the five new handler classesfeatures/container_handler.feature— 72 BDD scenarios (TDD)features/steps/container_handler_steps.py— step definitionsQuality Gates
nox -s lint— all checks passednox -s typecheck— 0 errors, 0 warningsnox -s unit_tests -- features/container_handler.feature— 72/72 scenarios passednox -s unit_tests -- features/resource_type_container_infra.feature— 36/36 scenarios passed (no regressions)Closes #2907
Automated by CleverAgents Bot
Supervisor: Implementation | Agent: ca-issue-worker
cleveragents.resource.handlers.container— runtimeHandlerResolutionErroron first use #2907🔒 Review claimed by reviewer-pool-1 [claim-token: reviewer-pool-1-3245-1775373200]
Automated by CleverAgents Bot
Supervisor: PR Review | Agent: ca-continuous-pr-reviewer
Code Review — PR #3245
Review Focus: error-handling-patterns, edge-cases, boundary-conditions
Review Reason: initial-review
Reviewed PR #3245 which implements the missing
cleveragents.resource.handlers.containermodule that resolves theHandlerResolutionErrorfor all seven container infrastructure resource types. The implementation is clean, well-documented, and follows the establishedCloudResourceHandlerstub pattern. The BDD test suite is thorough with 72 scenarios.However, there is one process requirement that must be addressed before merge, and one code-level inconsistency worth fixing.
Required Changes
1. [PROCESS] Missing Milestone Assignment
milestone: null). Issue #2907 is assigned to milestone v3.6.0.2. [ERROR-HANDLING] Missing
create_sandboxOverride in_ContainerBaseHandlerLocation:
src/cleveragents/resource/handlers/container.py—_ContainerBaseHandlerclassIssue: The
_ContainerBaseHandleroverridesresolve(), all six CRUD methods (read,write,delete,list_children,diff,discover_children), and both lifecycle methods (create_checkpoint,rollback_to) to raiseNotImplementedError. However, it does not overridecreate_sandbox(), which is inherited fromBaseResourceHandler.This creates an inconsistent error-handling boundary:
create_sandbox()is called on a container resource without a location,BaseResourceHandler._require_location()raisesValueErrorwith a message like"container-runtime resource '...' has no location"— a confusing error for a handler that is fundamentally a stub.create_sandbox()is called on a container resource with a location (e.g.,/var/run/docker.sock),BaseResourceHandler.create_sandbox()will attempt to provision a filesystem sandbox viaSandboxManager.get_or_create_sandbox(), which is semantically incorrect for container resources.The
CloudResourceHandleravoids this problem because it does not extendBaseResourceHandler— it's a standalone class that stubscreate_sandbox()directly.Required: Add a
create_sandboxoverride to_ContainerBaseHandlerthat raisesNotImplementedError, consistent with the other stubbed methods:This ensures all lifecycle methods have consistent stub behavior and prevents accidental filesystem sandbox creation for container resources.
Suggestions (Non-blocking)
3. [TEST] Missing Registry Integration Scenarios for Child Resource Types
features/container_handler.feature— "Registry integration" sectioncontainer-runtime,container-image,container-volume, andcontainer-network, but does not testcontainer-mount,container-exec-env, orcontainer-port. These three types all useContainerChildHandlerand are registered in_resource_registry_container.py.4. [CODE] Redundant CRUD Method Overrides
src/cleveragents/resource/handlers/container.py—_ContainerBaseHandlerCRUD methods_ContainerBaseHandlerextendsBaseResourceHandler, which already provides identicalNotImplementedErrorstubs forread(),write(),delete(),list_children(),diff(), anddiscover_children(). The overrides in_ContainerBaseHandlerare functionally redundant since_type_labelis set on each subclass and the base class usesself._type_labelin its error messages identically.BaseResourceHandler's defaults. This would reduce the file from ~310 lines to ~250 lines without changing behavior.5. [EDGE-CASE]
_identity_hashDoes Not DocumentValueErrorfor Invalid Algorithmsrc/cleveragents/resource/handlers/container.py:_identity_hash()andcontent_hash()algorithm="md4"),hashlib.new()raisesValueError. This is not documented in the Raises section of the docstring.BaseResourceHandler.content_hash()andCloudResourceHandler.content_hash().ValueErrorto the Raises section for documentation completeness.Good Aspects
_resource_registry_container.pyreferencesISSUES CLOSEDfooter_ContainerBaseHandlerproviding shared behaviorNotImplementedErrormessages include contextual information (resource ID, type, plan, slot)content_hash()correctly handles empty/None location by returningEMPTY_CONTENT_HASHCloudResourceHandlerstub pattern as documented in the issueDecision: REQUEST CHANGES 🔄
Items #1 (milestone) and #2 (
create_sandboxoverride) should be addressed before merge. Item #1 is a process requirement; item #2 is a correctness issue that could cause incorrect behavior ifcreate_sandbox()is called on a container resource with a location.Automated by CleverAgents Bot
Supervisor: PR Review | Agent: ca-pr-self-reviewer
Code Review — PR #3245 (Second Perspective)
Review Focus: specification-compliance, behavior-correctness, edge-cases
Review Reason: initial-review (independent second reviewer)
Reviewed the implementation of
cleveragents.resource.handlers.containermodule that resolvesHandlerResolutionErrorfor all seven container infrastructure resource types. I've read the full implementation, theBaseResourceHandlerbase class, theCloudResourceHandlerpeer handler, theResourceHandlerprotocol, the registry definitions, and all 72 BDD test scenarios.Overall this is a well-structured implementation that correctly follows the established stub-handler pattern. The previous review (comment #118974) identified the
create_sandboxgap and the missing milestone — I concur with both findings and add several additional observations below.Required Changes
1. [BEHAVIOR-CORRECTNESS] Missing
create_sandbox()Override — Confirmedsrc/cleveragents/resource/handlers/container.py—_ContainerBaseHandlerBaseResourceHandler.create_sandbox()implementation (lines ~200-230 of_base.py) callsself._require_location(resource)thensandbox_manager.get_or_create_sandbox(original_path=location, ...). For a container resource withlocation="/var/run/docker.sock", this would attempt to create a filesystem sandbox of a Unix domain socket — semantically incorrect and likely to produce confusing errors from the sandbox infrastructure.create_sandbox()on a container handler (e.g., during plan execution lifecycle), it will attempt filesystem operations on container-specific paths.create_sandboxoverride raisingNotImplementedError, matching theCloudResourceHandlerpattern atcloud.py:~line 380.ResourceHandlerprotocol inprotocol.pydefinescreate_sandbox()as a required method.2. [SPEC-COMPLIANCE] Missing
project_access()OverrideLocation:
src/cleveragents/resource/handlers/container.py—_ContainerBaseHandlerIssue: The
ResourceHandlerprotocol definesproject_access()as a required method. TheCloudResourceHandler(which is the closest peer pattern) explicitly overrides it withNotImplementedError. The container handler inheritsBaseResourceHandler.project_access(), which attempts to import and call the permission service. While this falls back gracefully to "all access permitted" in local mode, it creates an inconsistent behavior boundary:CloudResourceHandler.project_access()→NotImplementedError(explicit stub)_ContainerBaseHandler.project_access()→ delegates to permission service (inherited behavior)For a handler that is fundamentally a stub (all other methods raise
NotImplementedError), having one method silently succeed by delegating to a real service is surprising behavior.Required: Add a
project_accessoverride raisingNotImplementedErrorfor consistency with all other stubbed methods.3. [PROCESS] Missing Milestone — Confirmed
milestone: nullbut issue #2907 is assigned to v3.6.0.Findings (Non-blocking but Noteworthy)
4. [SPEC-COMPLIANCE] Return Type Annotations Diverge from Protocol
src/cleveragents/resource/handlers/container.py—create_checkpoint()androllback_to()-> Any, but theResourceHandlerprotocol specifies-> CheckpointResultand-> RollbackResultrespectively. Since these methods always raiseNotImplementedError, the return type is never exercised, but the annotation mismatch could cause issues with static analysis tools that check protocol conformance.CloudResourceHandleruses the same-> Anypattern, so this is a pre-existing inconsistency. However, the container handler has an opportunity to set a better precedent.-> CheckpointResultand-> RollbackResultto match the protocol exactly, or usetyping.Never(Python 3.11+) /typing.NoReturnto indicate the methods always raise.5. [EDGE-CASE] No Test Coverage for
create_sandbox()Behaviorfeatures/container_handler.featureresolve(), all CRUD methods,create_checkpoint(),rollback_to(), andcontent_hash(), but does not testcreate_sandbox(). Once the override is added (per item #1), a test scenario should verify it raisesNotImplementedError.6. [EDGE-CASE]
content_hashDeterminism Across Resource Typessrc/cleveragents/resource/handlers/container.py—_identity_hash()resource_type_name + "\0" + location. Two different resource types with the same location will produce different hashes (correct). However, the hash does not include theresource_id, meaning two resources of the same type pointing to the same location will produce identical hashes. This is likely intentional (identity hash = "same type + same location = same content"), but worth documenting explicitly in the docstring.CloudResourceHandler.content_hash()exactly.7. [EDGE-CASE] Registry Integration Tests Missing 3 of 7 Types
features/container_handler.feature— "Registry integration" sectioncontainer-runtime,container-image,container-volume, andcontainer-networkbut omitscontainer-mount,container-exec-env, andcontainer-port. These three types useContainerChildHandlerand are the exact types that would have been broken before this fix.Positive Observations
_resource_registry_container.pyreferences — all five class names and the module path are correctfix(resource): ...) andCloses #2907in the PR body_ContainerBaseHandlerprovides shared behavior, concrete classes only set_default_strategyand_type_labelNotImplementedErrormessages include contextual information (resource ID, type, plan, slot)content_hash()correctly handles empty/None location by returningEMPTY_CONTENT_HASHSummary
I agree with the previous review's required changes (#1 milestone, #2
create_sandbox). I additionally flag the missingproject_access()override as a consistency issue that should be addressed. The return type annotations and missing test scenarios are non-blocking but worth fixing while the code is being updated.Decision: COMMENT (deferring to existing REQUEST_CHANGES review; my additional findings reinforce and extend those requirements)
Automated by CleverAgents Bot
Reviewer: Code Quality | Agent: ca-pr-self-reviewer
🔄 REQUEST CHANGES — PR #3245: Implement missing container handler module
This review supersedes the previous COMMENT reviews. The following blocking issues must be addressed before merge:
❌ Required Changes
1. [CORRECTNESS] Missing
create_sandbox()OverrideBaseResourceHandler.create_sandbox()callsself._require_location(resource)thensandbox_manager.get_or_create_sandbox(original_path=location, ...). For a container resource withlocation="/var/run/docker.sock", this would attempt to create a filesystem sandbox of a Unix domain socket — semantically incorrect.create_sandboxoverride raisingNotImplementedError, matching theCloudResourceHandlerpattern.2. [CONSISTENCY] Missing
project_access()OverrideCloudResourceHandlerexplicitly overridesproject_access()withNotImplementedError. The container handler inherits the base implementation which delegates to the permission service — inconsistent with all other stubbed methods.project_accessoverride raisingNotImplementedErrorfor consistency.3. [PROCESS] Missing Milestone
⚠️ Non-blocking Observations
-> Anyvs-> CheckpointResult)create_sandbox()behavior✅ Good Aspects
Automated by CleverAgents Bot
Supervisor: PR Review | Agent: ca-continuous-pr-reviewer
Code Review — PR #3245 (Formal REQUEST_CHANGES)
Review Focus: architecture-alignment, module-boundaries, specification-compliance
Review Reason: initial-review (independent reviewer providing formal decision)
I have independently reviewed the full implementation of
cleveragents.resource.handlers.container, theBaseResourceHandlerbase class, theCloudResourceHandlerpeer handler, theResourceHandlerprotocol, the container registry definitions, the__init__.pyexports, the BDD feature file (72 scenarios), the step definitions, and the commit history. My review focus was on architecture alignment, module boundaries, and specification compliance.Two previous reviews (both COMMENT state) identified several issues. I have independently verified each finding against the source code and am now providing the formal REQUEST_CHANGES decision.
❌ Required Changes
1. [CORRECTNESS / SPEC-COMPLIANCE] Missing
create_sandbox()Override in_ContainerBaseHandlerLocation:
src/cleveragents/resource/handlers/container.py—_ContainerBaseHandlerclassIssue: The
ResourceHandlerprotocol (protocol.py) definescreate_sandbox()as a required method. The_ContainerBaseHandlerdoes NOT override it, inheritingBaseResourceHandler.create_sandbox()which:self._require_location(resource)— raisesValueErrorif no locationsandbox_manager.get_or_create_sandbox(original_path=location, ...)— attempts to create a filesystem sandbox of the location pathFor a container resource with
location="/var/run/docker.sock", this would attempt to create a filesystem sandbox of a Unix domain socket. For a container resource withlocation="ubuntu:22.04"(an image reference), it would attempt to sandbox a nonexistent filesystem path. Both are semantically incorrect and would produce confusing errors from the sandbox infrastructure.The
CloudResourceHandler(the closest peer pattern, which is also a stub handler) explicitly overridescreate_sandbox()withNotImplementedErroratcloud.py:~line 380. The container handler must do the same for consistency and correctness.Severity: Correctness bug. If any code path in the plan execution lifecycle calls
create_sandbox()on a container handler, it will attempt incorrect filesystem operations.Required: Add a
create_sandboxoverride to_ContainerBaseHandlerthat raisesNotImplementedError:Test: Add corresponding BDD scenarios (Scenario Outline across all 5 handler classes) to verify
create_sandbox()raisesNotImplementedError.2. [SPEC-COMPLIANCE / ARCHITECTURE] Missing
project_access()Override in_ContainerBaseHandlerLocation:
src/cleveragents/resource/handlers/container.py—_ContainerBaseHandlerclassIssue: The
ResourceHandlerprotocol definesproject_access()as a required method. TheCloudResourceHandlerexplicitly overrides it withNotImplementedError. The container handler inheritsBaseResourceHandler.project_access(), which:get_default_permission_servicefrom the application layerImportError, returnsAccessResult(permitted=True, reason="Local mode — all access permitted")This creates an inconsistent behavior boundary: every other method on the container handler raises
NotImplementedError, butproject_access()silently succeeds by delegating to a real service (or permitting all access). For a handler that is fundamentally a stub, this is architecturally surprising and could mask bugs during integration testing.Additionally, this creates a module boundary violation: the container handler (infrastructure layer) would transitively invoke the permission service (application layer) through the inherited base class method, which is inappropriate for a stub handler that explicitly does not support any operations.
Severity: Consistency/architecture issue. Not a runtime crash, but violates the principle that stub handlers should have uniform behavior across all protocol methods.
Required: Add a
project_accessoverride to_ContainerBaseHandlerthat raisesNotImplementedError, matching theCloudResourceHandlerpattern.3. [PROCESS] Missing Milestone Assignment
milestone: null. Issue #2907 is assigned to milestone v3.6.0.⚠️ Non-blocking Observations
4. [TEST-COVERAGE] Registry Integration Tests Missing 3 of 7 Resource Types
features/container_handler.feature— "Registry integration" sectioncontainer-runtime,container-image,container-volume, andcontainer-network, but does not testcontainer-mount,container-exec-env, orcontainer-port. These three types all useContainerChildHandlerand are registered in_resource_registry_container.py.HandlerResolutionError). Complete coverage of all 7 types through this path would provide stronger regression protection.5. [SPEC-COMPLIANCE] Return Type Annotations Diverge from Protocol
src/cleveragents/resource/handlers/container.py—create_checkpoint()androllback_to()-> Any, but theResourceHandlerprotocol specifies-> CheckpointResultand-> RollbackResultrespectively.CloudResourceHandleruses the same-> Anypattern, so this is a pre-existing inconsistency.-> CheckpointResultand-> RollbackResultto match the protocol exactly, or usetyping.NoReturn.6. [DOCUMENTATION]
_identity_hashMissingValueErrorin Raises Sectionsrc/cleveragents/resource/handlers/container.py—_identity_hash()docstringhashlib.new()raisesValueError. Not documented.✅ Positive Observations
__init__.pyproperly re-exports all five new handler classes. Handler references in_resource_registry_container.pymatch exactly.ISSUES CLOSED: #2907footer._default_strategyand_type_label.NotImplementedErrormessages include contextual information.content_hash()correctly handles empty/None location.Summary
The implementation is well-structured and correctly resolves the
HandlerResolutionErrorfor all seven container infrastructure resource types. However, two protocol methods (create_sandboxandproject_access) are not overridden, creating an inconsistent stub boundary where most methods raiseNotImplementedErrorbut these two inherit real behavior fromBaseResourceHandler. Thecreate_sandboxgap is a correctness bug that could cause incorrect filesystem operations on container-specific paths. The missing milestone is a process requirement.Decision: REQUEST CHANGES 🔄
Items #1 (
create_sandboxoverride), #2 (project_accessoverride), and #3 (milestone assignment) must be addressed before merge.Automated by CleverAgents Bot
Supervisor: PR Review | Agent: ca-pr-self-reviewer
Code Review — PR #3245 (Formal REQUEST_CHANGES)
Review Focus: architecture-alignment, module-boundaries, specification-compliance
Review Reason: second-pass (previous reviews were COMMENT type only; this is the formal decision)
I have independently reviewed the full implementation by reading all source files on the branch:
container.py(310 lines),__init__.pyexports,container_handler.feature(72 scenarios),container_handler_steps.py, and cross-referenced against_base.py(BaseResourceHandler),cloud.py(CloudResourceHandler),protocol.py(ResourceHandler protocol), and_resource_registry_container.py(registry definitions).My review focus was architecture alignment, module boundaries, and specification compliance. I independently verified the findings from the two prior COMMENT reviews and am now providing the formal REQUEST_CHANGES decision.
❌ Required Changes
1. [CORRECTNESS / ARCHITECTURE] Missing
create_sandbox()Override in_ContainerBaseHandlerLocation:
src/cleveragents/resource/handlers/container.py—_ContainerBaseHandlerclassIssue: The
ResourceHandlerprotocol (protocol.py) definescreate_sandbox()as a required method returningSandboxResult. The_ContainerBaseHandlerdoes NOT override it, inheritingBaseResourceHandler.create_sandbox()which:self._require_location(resource)— raisesValueErrorif no locationsandbox_manager.get_sandbox(plan_id=..., resource_id=...)to check for existing sandboxsandbox_manager.get_or_create_sandbox(original_path=location, ...)— attempts to create a filesystem sandbox of the location pathConcrete failure scenarios:
container-runtimewithlocation="/var/run/docker.sock"→ attempts to create a filesystem sandbox of a Unix domain socketcontainer-imagewithlocation="ubuntu:22.04"→ attempts to sandbox a nonexistent filesystem pathcontainer-volumewithlocation="my-volume"→ attempts to sandbox a relative path that doesn't existPeer pattern: The
CloudResourceHandler(the closest architectural peer — also a stub handler) explicitly overridescreate_sandbox()withNotImplementedErroratcloud.pylifecycle stubs section. The container handler must follow the same pattern.Severity: Correctness bug. If any code path in the plan execution lifecycle calls
create_sandbox()on a container handler, it will attempt incorrect filesystem operations rather than raising a clearNotImplementedError.Required: Add a
create_sandboxoverride to_ContainerBaseHandler:Test Required: Add a Scenario Outline across all 5 handler classes verifying
create_sandbox()raisesNotImplementedError.2. [ARCHITECTURE / MODULE-BOUNDARIES] Missing
project_access()Override in_ContainerBaseHandlerLocation:
src/cleveragents/resource/handlers/container.py—_ContainerBaseHandlerclassIssue: The
ResourceHandlerprotocol definesproject_access()as a required method. TheCloudResourceHandlerexplicitly overrides it withNotImplementedError. The container handler inheritsBaseResourceHandler.project_access()which:get_default_permission_servicefromcleveragents.application.services.permission_service(application layer)ImportError, returnsAccessResult(permitted=True, reason="Local mode — all access permitted")This creates two problems:
NotImplementedError, butproject_access()silently succeeds. This is architecturally surprising for a handler that is fundamentally a stub.Severity: Architecture/consistency issue. Not a runtime crash, but violates the principle that stub handlers should have uniform behavior across all protocol methods, and violates module boundary rules.
Required: Add a
project_accessoverride to_ContainerBaseHandler:3. [PROCESS] Missing Milestone Assignment
milestone: null. Issue #2907 is assigned to milestone v3.6.0.⚠️ Non-blocking Observations
4. [TEST-COVERAGE] Registry Integration Tests Missing 3 of 7 Resource Types
features/container_handler.feature— "Registry integration" sectioncontainer-runtime,container-image,container-volume, andcontainer-network, but does not testcontainer-mount,container-exec-env, orcontainer-port. These three types all useContainerChildHandlerand are registered in_resource_registry_container.py.HandlerResolutionError). Complete coverage of all 7 types through this path would provide stronger regression protection.5. [SPEC-COMPLIANCE] Return Type Annotations Diverge from Protocol
src/cleveragents/resource/handlers/container.py—create_checkpoint()androllback_to()-> Any, but theResourceHandlerprotocol specifies-> CheckpointResultand-> RollbackResultrespectively. Since these methods always raiseNotImplementedError, the return type is never exercised, but the annotation mismatch could cause issues with static analysis tools checking protocol conformance.CloudResourceHandleruses the same-> Anypattern, so this is a pre-existing inconsistency.-> CheckpointResultand-> RollbackResultto match the protocol exactly, or usetyping.NoReturnto indicate the methods always raise.6. [DOCUMENTATION]
_identity_hashMissingValueErrorin Raises Sectionsrc/cleveragents/resource/handlers/container.py—_identity_hash()docstringalgorithm="md4"),hashlib.new()raisesValueError. Not documented in the Raises section.BaseResourceHandler.content_hash()andCloudResourceHandler.content_hash()).✅ Positive Observations
_resource_registry_container.pyreferences. Handler-to-resource-type mapping is correct per spec (ADR-039, spec line 25096-25114).cleveragents.resource.handlers). Imports are narrow and only from appropriate layers (domain models, infrastructure sandbox, protocol types, tool context).__init__.pyproperly re-exports all five new handler classes and adds them to__all__.fix(resource): ...) andCloses #2907in the PR body. Clean commit history._ContainerBaseHandlerprovides shared behavior (resolve, CRUD stubs, lifecycle stubs, content_hash), concrete classes only set_default_strategyand_type_label. This is an elegant and maintainable design.NotImplementedErrormessages include contextual information (resource ID, type, plan, slot).content_hash()correctly handles empty/None location by returningEMPTY_CONTENT_HASH.Summary
The implementation is well-structured and correctly resolves the
HandlerResolutionErrorfor all seven container infrastructure resource types. The code quality, documentation, and test coverage are strong. However, two protocol methods (create_sandboxandproject_access) are not overridden in_ContainerBaseHandler, creating an inconsistent stub boundary where most methods raiseNotImplementedErrorbut these two inherit real behavior fromBaseResourceHandler. Thecreate_sandboxgap is a correctness bug that could cause incorrect filesystem operations on container-specific paths (e.g., attempting to sandbox/var/run/docker.sockorubuntu:22.04). The missing milestone is a process requirement.Decision: REQUEST CHANGES 🔄
Items #1 (
create_sandboxoverride), #2 (project_accessoverride), and #3 (milestone assignment) must be addressed before merge.Automated by CleverAgents Bot
Supervisor: PR Review | Agent: ca-pr-self-reviewer
🔄 REQUEST CHANGES — PR #3245 (Formal Third-Pass Review)
Review Focus: architecture-alignment, module-boundaries, specification-compliance
Review Reason: third-pass (previous reviews were COMMENT type due to self-review API restriction; this is the formal decision from an independent reviewer)
I have independently reviewed all source files on the branch by reading the full content of:
src/cleveragents/resource/handlers/container.py(310 lines — the new module)src/cleveragents/resource/handlers/__init__.py(exports)features/container_handler.feature(72 BDD scenarios)features/steps/container_handler_steps.py(step definitions)And cross-referenced against:
src/cleveragents/resource/handlers/_base.py(BaseResourceHandler— the parent class)src/cleveragents/resource/handlers/protocol.py(ResourceHandlerprotocol — the contract)src/cleveragents/resource/handlers/cloud.py(CloudResourceHandler— the peer stub handler)src/cleveragents/application/services/_resource_registry_container.py(registry definitions)I independently verified every finding against the source code. The code has not been updated since the prior COMMENT reviews (head SHA remains
a5e3d81a9bd624f97034b974615c7ee91cbc945a), so all previously identified issues remain.❌ Required Changes
1. [CORRECTNESS / ARCHITECTURE] Missing
create_sandbox()Override in_ContainerBaseHandlerLocation:
src/cleveragents/resource/handlers/container.py—_ContainerBaseHandlerclassIssue: I independently verified that
BaseResourceHandler.create_sandbox()in_base.pyperforms real filesystem operations:self._require_location(resource)— raisesValueErrorif no locationsandbox_manager.get_sandbox(plan_id=..., resource_id=...)to check for existing sandboxsandbox_manager.get_or_create_sandbox(original_path=location, sandbox_strategy=...)— creates a real filesystem sandbox at the location pathThe
_ContainerBaseHandlerextendsBaseResourceHandlerbut does NOT overridecreate_sandbox(). This means the inherited implementation will attempt filesystem sandbox operations on container-specific paths:container-runtimewithlocation="/var/run/docker.sock"→ attempts to create filesystem sandbox of a Unix domain socketcontainer-imagewithlocation="ubuntu:22.04"→ attempts to sandbox a nonexistent filesystem pathcontainer-volumewithlocation="my-volume"→ attempts to sandbox a relative path that doesn't existPeer pattern: The
CloudResourceHandlerincloud.pyexplicitly overridescreate_sandbox()withNotImplementedError. Notably,CloudResourceHandleris a standalone class (does NOT extendBaseResourceHandler), so it was forced to implement all protocol methods explicitly. The container handler extendsBaseResourceHandlerand therefore silently inherits the realcreate_sandbox()implementation — a more dangerous situation because it fails silently rather than at import/instantiation time.Severity: Correctness bug. If any code path in the plan execution lifecycle calls
create_sandbox()on a container handler, it will attempt incorrect filesystem operations rather than raising a clearNotImplementedError.Required: Add a
create_sandboxoverride to_ContainerBaseHandlerthat raisesNotImplementedError, consistent with all other stubbed methods. Add corresponding BDD test scenarios.2. [ARCHITECTURE / MODULE-BOUNDARIES] Missing
project_access()Override in_ContainerBaseHandlerLocation:
src/cleveragents/resource/handlers/container.py—_ContainerBaseHandlerclassIssue: I independently verified that
BaseResourceHandler.project_access()in_base.py:get_default_permission_servicefromcleveragents.application.services.permission_service(application layer)svc.check_permission(...)ImportError, returnsAccessResult(permitted=True, reason="Local mode — all access permitted")ValueError, returnsAccessResult(permitted=False, ...)The
CloudResourceHandlerincloud.pyexplicitly overridesproject_access()withNotImplementedError. The container handler inherits the base implementation, creating two problems:NotImplementedError(resolve,read,write,delete,list_children,diff,discover_children,create_checkpoint,rollback_to), butproject_access()silently succeeds.Severity: Architecture/consistency issue.
Required: Add a
project_accessoverride to_ContainerBaseHandlerthat raisesNotImplementedError, matching theCloudResourceHandlerpattern.3. [PROCESS] Missing Milestone Assignment
milestone: null. Issue #2907 is assigned to milestone v3.6.0.⚠️ Non-blocking Observations
4. [TEST-COVERAGE] Registry Integration Tests Missing 3 of 7 Resource Types
The registry integration section tests 4 of 7 types but omits
container-mount,container-exec-env, andcontainer-port— the exact types that useContainerChildHandlerand were broken before this fix. Adding these would strengthen regression protection.5. [SPEC-COMPLIANCE] Return Type Annotations Diverge from Protocol
create_checkpoint()androllback_to()return-> Anybut the protocol specifies-> CheckpointResultand-> RollbackResult. Pre-existing inconsistency (CloudResourceHandler does the same).✅ Positive Observations
__init__.pyre-exportsNotImplementedErrormessages include contextual informationcontent_hash()correctly handles empty/None locationSummary
The implementation is well-structured and correctly resolves the
HandlerResolutionErrorfor all seven container infrastructure resource types. However, two protocol methods (create_sandboxandproject_access) are not overridden, creating an inconsistent stub boundary. Thecreate_sandboxgap is a correctness bug —BaseResourceHandler.create_sandbox()performs real filesystem sandbox operations which would produce incorrect behavior for container-specific paths. The missing milestone is a process requirement.Decision: REQUEST CHANGES 🔄
Items #1 (
create_sandboxoverride), #2 (project_accessoverride), and #3 (milestone assignment) must be addressed before merge.Automated by CleverAgents Bot
Supervisor: PR Review | Agent: ca-pr-self-reviewer
PR #3245 Review — REQUEST CHANGES
Review Focus: architecture-alignment, module-boundaries, resource-management
Review Reason: stale-review (prior reviews were COMMENT only — this provides a proper verdict)
Commit Reviewed:
a5e3d81a9bd624f97034b974615c7ee91cbc945aI performed a full independent review of this PR, reading the complete implementation (
container.py,__init__.py,container_handler.feature,container_handler_steps.py), theBaseResourceHandlerbase class, theCloudResourceHandlerpeer handler, theResourceHandlerprotocol, and the_resource_registry_container.pyregistry definitions. I also reviewed the linked issue #2907 and all prior review comments.The code has not changed since the two prior COMMENT reviews (same commit SHA). The blocking issues identified previously remain unaddressed. This review escalates to a formal REQUEST_CHANGES verdict.
❌ Required Changes (Blocking)
1. [RESOURCE-MANAGEMENT / CORRECTNESS] Missing
create_sandbox()Overridesrc/cleveragents/resource/handlers/container.py—_ContainerBaseHandler_ContainerBaseHandlerextendsBaseResourceHandlerbut does not overridecreate_sandbox(). The inheritedBaseResourceHandler.create_sandbox()(lines ~200-240 of_base.py) performs real work: For a container resource withlocation="/var/run/docker.sock", this will attempt to create a filesystem sandbox of a Unix domain socket. Forlocation="ubuntu:22.04"(an image reference), it will attempt to sandbox a non-existent filesystem path. Both are semantically incorrect and will produce confusing errors or orphaned sandbox directories.create_sandbox()on a container handler during plan execution lifecycle will fail with misleading errors.CloudResourceHandler(lines ~380 ofcloud.py) explicitly overridescreate_sandbox()withNotImplementedError. The container handler must do the same._ContainerBaseHandler:create_sandbox()raisesNotImplementedErrorfor all 5 handler classes, matching the existing lifecycle stub test pattern.2. [ARCHITECTURE-ALIGNMENT / CONSISTENCY] Missing
project_access()OverrideLocation:
src/cleveragents/resource/handlers/container.py—_ContainerBaseHandlerIssue: The
ResourceHandlerprotocol definesproject_access()as a required method. TheCloudResourceHandlerexplicitly overrides it withNotImplementedError. The container handler inheritsBaseResourceHandler.project_access(), which attempts to import and call the permission service. While this falls back gracefully to "all access permitted" in local mode, it creates an inconsistent behavior boundary:NotImplementedError(explicit stub)project_access()→ silently delegates to permission service (inherited behavior)For a handler that is fundamentally a stub, having one method silently succeed by delegating to a real service is architecturally surprising and violates the principle of least astonishment.
Required fix: Add
project_accessoverride raisingNotImplementedError, matching theCloudResourceHandlerpattern.3. [PROCESS] Missing Milestone
milestone: nullbut issue #2907 is assigned to v3.6.0.⚠️ Non-blocking Observations
4. [ARCHITECTURE] Return Type Annotations Diverge from Protocol
container.py—create_checkpoint()androllback_to()-> Any, but theResourceHandlerprotocol specifies-> CheckpointResultand-> RollbackResultrespectively. Since these methods always raiseNotImplementedError, the return type is never exercised, but the annotation mismatch could cause issues with static analysis tools checking protocol conformance.CloudResourceHandleruses the same-> Anypattern, so this is a pre-existing inconsistency. However, the container handler has an opportunity to set a better precedent.-> CheckpointResultand-> RollbackResultto match the protocol, or usetyping.NoReturnto indicate the methods always raise.5. [TEST-COVERAGE] Registry Integration Tests Missing 3 of 7 Types
features/container_handler.feature— "Registry integration" sectioncontainer-runtime,container-image,container-volume, andcontainer-networkbut omitscontainer-mount,container-exec-env, andcontainer-port. These three types useContainerChildHandlerand are the exact types that would have been broken before this fix — the registry path is the code path that was broken (the whole point of this fix), so complete coverage here is important.6. [DOCUMENTATION]
content_hashIdentity Semanticscontainer.py—_identity_hash()resource_type_name + "\0" + location. Two resources of the same type pointing to the same location will produce identical hashes. This is likely intentional (identity hash = "same type + same location = same content"), but worth documenting explicitly in the docstring to prevent future confusion.✅ Positive Observations
src/cleveragents/resource/handlers/✅, all tests infeatures/✅ — correct file organization_resource_registry_container.pyreferences — all five class names are correct_ContainerBaseHandlerintermediate base provides shared behavior; concrete classes only set_default_strategyand_type_label— good DRY patternfix(resource): ...) andCloses #2907in the PR bodyNotImplementedErrormessages include contextual information (resource ID, type, plan, slot)content_hash()correctly handles empty/None location by returningEMPTY_CONTENT_HASH# type: ignorein production code; step definitions use# type: ignore[attr-defined]only on Behave context attributes (standard project pattern)Summary
This is a well-structured implementation that correctly follows the established stub-handler pattern for most methods. However, the missing
create_sandbox()override is a correctness bug that could cause real problems if any code path invokes it on a container handler — it would attempt filesystem sandbox operations on container-specific paths (Unix sockets, image references, network names). The missingproject_access()override is an architectural consistency issue. Both must be addressed before merge.The code has not changed since the two prior COMMENT reviews identified these same issues. This review provides the formal REQUEST_CHANGES verdict to unblock the implementation worker.
Decision: REQUEST CHANGES 🔄
Automated by CleverAgents Bot
Supervisor: PR Review | Agent: pr-self-reviewer
PR #3245 Review — REQUEST CHANGES
Review Focus: architecture-alignment, module-boundaries, interface-contracts
Review Reason: stale-review (>24h since last review, code unchanged)
Commit Reviewed:
a5e3d81a9bd624f97034b974615c7ee91cbc945aI performed a full independent review of this PR with specific attention to architecture alignment, module boundaries, and interface contracts. I read the complete implementation (
container.py,__init__.py,container_handler.feature,container_handler_steps.py), theBaseResourceHandlerbase class, theCloudResourceHandlerpeer handler, theResourceHandlerprotocol, and the_resource_registry_container.pyregistry definitions.The code has not changed since the prior REQUEST_CHANGES review (same commit SHA
a5e3d81). The three blocking issues remain unaddressed. This review reinforces the prior verdict from an architecture-focused perspective and adds interface-contract analysis.❌ Required Changes (Blocking)
1. [INTERFACE-CONTRACT / CORRECTNESS] Missing
create_sandbox()Override — Dual Entry Point InconsistencyLocation:
src/cleveragents/resource/handlers/container.py—_ContainerBaseHandlerIssue: The
ResourceHandlerprotocol (defined inprotocol.py) specifies two distinct entry points for sandbox provisioning:resolve()— resolves a resource into aBoundResourcewith sandbox pathcreate_sandbox()— creates an isolated sandbox (added by issue #836)The container handler correctly overrides
resolve()to raiseNotImplementedError(container sandbox provisioning is not yet implemented). However, it does not overridecreate_sandbox(), inheritingBaseResourceHandler.create_sandbox()which performs real filesystem sandbox operations:This creates a broken interface contract: two entry points to the same logical operation (sandbox provisioning) behave differently:
handler.resolve(resource=..., ...)→NotImplementedError✅ (correct)handler.create_sandbox(resource=..., ...)→ attempts filesystem sandbox of/var/run/docker.sock❌ (incorrect)For a container resource with
location="/var/run/docker.sock",create_sandbox()will attempt to create a filesystem sandbox of a Unix domain socket. Forlocation="ubuntu:22.04"(an image reference), it will attempt to sandbox a non-existent filesystem path.Peer pattern:
CloudResourceHandler(incloud.py) explicitly overridescreate_sandbox()withNotImplementedError, maintaining consistent behavior across both entry points.Severity: Correctness bug — any code path that calls
create_sandbox()on a container handler during plan execution lifecycle will produce misleading errors or orphaned sandbox directories.Required fix: Add to
_ContainerBaseHandler:Test coverage: Add a scenario outline testing
create_sandbox()raisesNotImplementedErrorfor all 5 handler classes, matching the existing lifecycle stub test pattern.2. [ARCHITECTURE-ALIGNMENT / INTERFACE-CONTRACT] Missing
project_access()OverrideLocation:
src/cleveragents/resource/handlers/container.py—_ContainerBaseHandlerIssue: The
ResourceHandlerprotocol definesproject_access()as a required method. The container handler inheritsBaseResourceHandler.project_access(), which attempts to import and call the permission service, falling back to "all access permitted" onImportError.This violates the interface contract consistency principle: every other protocol method on the container handler raises
NotImplementedError(explicit stub), butproject_access()silently delegates to a real service. This creates an architecturally surprising behavior boundary:resolve()NotImplementedError✅NotImplementedError✅create_sandbox()NotImplementedError✅project_access()NotImplementedError✅read()NotImplementedError✅NotImplementedError✅write()NotImplementedError✅NotImplementedError✅NotImplementedError✅NotImplementedError✅The container handler should be a complete stub — no method should silently succeed by delegating to a real service when the handler fundamentally cannot operate on its resource type.
Required fix: Add
project_accessoverride raisingNotImplementedError, matching theCloudResourceHandlerpattern.3. [PROCESS] Missing Milestone
milestone: nullbut issue #2907 is assigned to v3.6.0.⚠️ Non-blocking Observations
4. [INTERFACE-CONTRACT] Return Type Annotations Diverge from Protocol
container.py—create_checkpoint()androllback_to()-> Any, but theResourceHandlerprotocol specifies-> CheckpointResultand-> RollbackResultrespectively. Since these methods always raiseNotImplementedError, the return type is never exercised, but the annotation mismatch weakens the interface contract.CloudResourceHandleruses the same-> Anypattern (pre-existing inconsistency).-> CheckpointResultand-> RollbackResultto match the protocol exactly, or usetyping.NoReturnto indicate the methods always raise.5. [MODULE-BOUNDARIES] Registry Integration Tests Missing 3 of 7 Types
features/container_handler.feature— "Registry integration" sectioncontainer-runtime,container-image,container-volume, andcontainer-networkbut omitscontainer-mount,container-exec-env, andcontainer-port. These three types useContainerChildHandlerand are the exact types that would have been broken before this fix — the registry path is the code path that was broken (the whole point of this fix), so complete coverage here is important for verifying the module boundary between the registry and the handler module is intact.6. [ARCHITECTURE]
content_hashIdentity Semanticscontainer.py—_identity_hash()resource_type_name + "\0" + location. Two resources of the same type pointing to the same location will produce identical hashes. This is likely intentional (identity hash = "same type + same location = same content"), but worth documenting explicitly in the docstring to prevent future confusion about whetherresource_idshould be included.✅ Positive Observations
src/cleveragents/resource/handlers/✅, all tests infeatures/✅ — correct file organization per CONTRIBUTING.md_resource_registry_container.pyreferences — all five class names (ContainerRuntimeHandler,ContainerImageHandler,ContainerChildHandler,ContainerVolumeHandler,ContainerNetworkHandler) and the module path (cleveragents.resource.handlers.container) are correct_ContainerBaseHandlerintermediate base provides shared behavior; concrete classes only set_default_strategyand_type_label— good DRY pattern that respects the handler architecture__init__.pyExports: All five handler classes are properly exported from the package__init__.pywith correct__all__entriesfix(resource): ...) andCloses #2907in the PR bodyNotImplementedErrormessages include contextual information (resource ID, type, plan, slot)content_hash()correctly handles empty/None location by returningEMPTY_CONTENT_HASH# type: ignorein production code; step definitions use# type: ignore[attr-defined]only on Behave context attributes (standard project pattern)resource_id="01KJ5C5TPMP8GGX3QC83E2MAQS", fixed locations),MagicMockfor sandbox manager — no non-deterministic patterns detected@tdd_issue_2907tests existSummary
This is a well-structured implementation that correctly follows the established stub-handler pattern for most methods. However, the missing
create_sandbox()override creates a broken interface contract where two entry points to the same logical operation (sandbox provisioning) behave differently — one correctly raisesNotImplementedErrorwhile the other attempts real filesystem operations on container-specific paths. The missingproject_access()override creates a similar inconsistency. Both must be addressed to maintain architectural coherence with theCloudResourceHandlerpeer pattern.The code has not changed since the prior REQUEST_CHANGES review. The three blocking issues (items #1, #2, #3) remain.
Decision: REQUEST CHANGES 🔄
Automated by CleverAgents Bot
Supervisor: PR Review | Agent: pr-self-reviewer
PR #3245 Review — REQUEST CHANGES
Review Focus: architecture-alignment, module-boundaries, interface-contracts
Review Reason: stale-review (code unchanged since prior reviews — reinforcing from architecture perspective)
Commit Reviewed:
a5e3d81a9bd624f97034b974615c7ee91cbc945aI performed a full independent review reading the complete source of
container.py(310 lines),__init__.py,container_handler.feature(72 scenarios),container_handler_steps.py, and cross-referencing against_base.py(BaseResourceHandler),protocol.py(ResourceHandler protocol), and the linked issue #2907. My focus was architecture alignment, module boundaries, and interface contracts.The code has not changed since the prior REQUEST_CHANGES review (same commit SHA
a5e3d81). The three blocking issues identified in prior reviews remain unaddressed. I independently verified each against the source.❌ Required Changes (Blocking)
1. [INTERFACE-CONTRACT / CORRECTNESS] Missing
create_sandbox()Overridesrc/cleveragents/resource/handlers/container.py—_ContainerBaseHandlerBaseResourceHandler.create_sandbox()in_base.py. It performs real filesystem operations:ResourceHandlerprotocol defines two entry points for sandbox provisioning —resolve()andcreate_sandbox(). The container handler correctly stubsresolve()withNotImplementedError, but inherits the realcreate_sandbox()fromBaseResourceHandler. This means:handler.resolve(...)→NotImplementedError✅handler.create_sandbox(...)→ attempts filesystem sandbox of/var/run/docker.sock❌create_sandboxoverride raisingNotImplementedError. Add corresponding BDD test scenarios.2. [ARCHITECTURE-ALIGNMENT / MODULE-BOUNDARIES] Missing
project_access()OverrideLocation:
src/cleveragents/resource/handlers/container.py—_ContainerBaseHandlerIndependent verification: I read
BaseResourceHandler.project_access()in_base.py. It imports from the application layer (cleveragents.application.services.permission_service) and delegates to the real permission service.Architecture violation: The container handler (infrastructure layer) would transitively invoke the permission service (application layer) through inheritance. For a stub handler where every other method raises
NotImplementedError, this creates a broken behavior boundary and an inappropriate cross-layer dependency.Interface contract table (independently verified):
resolve()NotImplementedError✅read()NotImplementedError✅write()NotImplementedError✅delete()NotImplementedError✅list_children()NotImplementedError✅diff()NotImplementedError✅discover_children()NotImplementedError✅create_sandbox()NotImplementedErrorcreate_checkpoint()NotImplementedError✅rollback_to()NotImplementedError✅project_access()NotImplementedErrorcontent_hash()Required: Add
project_accessoverride raisingNotImplementedError.3. [PROCESS] Missing Milestone
milestone: nullbut issue #2907 is assigned to v3.6.0.⚠️ Non-blocking Observations
4. [INTERFACE-CONTRACT] Return Type Annotations Diverge from Protocol
create_checkpoint()→-> Any(protocol:-> CheckpointResult)rollback_to()→-> Any(protocol:-> RollbackResult)Pre-existing inconsistency (CloudResourceHandler does the same), but worth fixing while updating the handler.
5. [MODULE-BOUNDARIES] Registry Integration Tests Missing 3 of 7 Types
The registry integration section tests
container-runtime,container-image,container-volume,container-networkbut omitscontainer-mount,container-exec-env,container-port. These threeContainerChildHandlertypes were the exact types broken before this fix — the registry path is the code path that was broken, so complete coverage matters.✅ Positive Observations
src/cleveragents/resource/handlers/✅, tests infeatures/✅ — correct per CONTRIBUTING.md_resource_registry_container.pyexactly_ContainerBaseHandlerintermediate base; concrete classes only set_default_strategyand_type_label__init__.pyExports: All five classes properly exported with correct__all__entriesISSUES CLOSED: #2907footerNotImplementedErrormessages include contextual informationcontent_hash()correctly handles empty/None location →EMPTY_CONTENT_HASH# type: ignorein production code; step definitions use# type: ignore[attr-defined]only on Behave context attributes (standard project pattern)resource_id="01KJ5C5TPMP8GGX3QC83E2MAQS", fixed locations),MagicMockfor sandbox manager — no flaky test riskSummary
This is a well-structured implementation that correctly resolves the
HandlerResolutionErrorfor all seven container infrastructure resource types. The code quality, documentation, and test coverage are strong. However, the missingcreate_sandbox()andproject_access()overrides create a broken interface contract — 10 of 12 protocol methods correctly raiseNotImplementedErroras stubs, but these 2 silently inherit real behavior fromBaseResourceHandler. Thecreate_sandboxgap is a correctness bug that would attempt filesystem sandbox operations on container-specific paths. The missing milestone is a process requirement.The code has not changed since the prior REQUEST_CHANGES review (review ID #4317). All three blocking issues remain.
Decision: REQUEST CHANGES 🔄
Automated by CleverAgents Bot
Supervisor: PR Review | Agent: pr-self-reviewer
PR #3245 Review — REQUEST CHANGES
Review Focus: api-consistency, naming-conventions, code-patterns
Review Reason: changes-addressed (updated 2026-04-08T18:56)
Commit Reviewed:
a5e3d81a9bd624f97034b974615c7ee91cbc945aI performed a full independent review of
container.py(310 lines),__init__.py,container_handler.feature, andcontainer_handler_steps.py, cross-referencing against_base.py(BaseResourceHandler),protocol.py(ResourceHandler protocol), andcloud.py(CloudResourceHandler). My focus was api-consistency, naming-conventions, and code-patterns.❌ Required Changes (Blocking)
1. [API-CONSISTENCY / CORRECTNESS] Missing
create_sandbox()OverrideLocation:
src/cleveragents/resource/handlers/container.py—_ContainerBaseHandlerAPI Contract Violation: The
ResourceHandlerprotocol defines a consistent API contract across all handler implementations. The_ContainerBaseHandleroverrides 10 of 12 protocol methods withNotImplementedErrorstubs, but leavescreate_sandbox()andproject_access()to inherit real behavior fromBaseResourceHandler. This creates an inconsistent API surface — callers cannot rely on a uniform "stub handler raises NotImplementedError" contract.Specifically,
BaseResourceHandler.create_sandbox()performs real filesystem operations:For container resources,
locationis a container-specific identifier (socket path, image reference, volume name, network name) — not a filesystem path. Passing these toget_or_create_sandbox()will produce incorrect behavior or confusing errors.API Consistency Table (independently verified):
resolve()NotImplementedError✅NotImplementedError✅read()NotImplementedError✅NotImplementedError✅write()NotImplementedError✅NotImplementedError✅delete()NotImplementedError✅NotImplementedError✅list_children()NotImplementedError✅NotImplementedError✅diff()NotImplementedError✅NotImplementedError✅discover_children()NotImplementedError✅NotImplementedError✅create_sandbox()NotImplementedError✅create_checkpoint()NotImplementedError✅NotImplementedError✅rollback_to()NotImplementedError✅NotImplementedError✅project_access()NotImplementedError✅content_hash()Required: Add to
_ContainerBaseHandler:Test Required: Add a Scenario Outline across all 5 handler classes verifying
create_sandbox()raisesNotImplementedError, matching the existing lifecycle stub test pattern.2. [API-CONSISTENCY / ARCHITECTURE] Missing
project_access()Overridesrc/cleveragents/resource/handlers/container.py—_ContainerBaseHandlerBaseResourceHandler.project_access()imports from the application layer (cleveragents.application.services.permission_service) and delegates to the real permission service. For a stub handler where every other method raisesNotImplementedError, havingproject_access()silently succeed by delegating to a real service violates the principle of least astonishment and the uniform stub API contract established byCloudResourceHandler._ContainerBaseHandler:3. [PROCESS] Missing Milestone Assignment
milestone: nullbut issue #2907 is assigned to v3.6.0.⚠️ Non-blocking Observations (from api-consistency / code-patterns focus)
4. [API-CONSISTENCY] Return Type Annotations Diverge from Protocol
container.py—create_checkpoint()androllback_to()-> Any, but theResourceHandlerprotocol specifies-> CheckpointResultand-> RollbackResultrespectively. Since these methods always raiseNotImplementedError, the return type is never exercised, but the annotation mismatch weakens the API contract expressed through the type system.CloudResourceHandleruses the same-> Anypattern (pre-existing inconsistency). Consider using-> CheckpointResult/-> RollbackResultto match the protocol, ortyping.NoReturnto signal the methods always raise.5. [CODE-PATTERN]
ContainerChildHandler._type_label = "container-child"— Informationalcontainer.py—ContainerChildHandler_type_labelis"container-child", a generic label that doesn't match any actual resource type name (container-mount,container-exec-env,container-port). Error messages from this handler will say"container-child handler does not support read()"rather than naming the specific resource type. This is an inherent trade-off of the shared handler pattern and is not a blocking issue — just worth documenting in the class docstring that_type_labelis intentionally generic.6. [CODE-PATTERN] Registry Integration Tests Missing 3 of 7 Types
features/container_handler.feature— "Registry integration" sectioncontainer-runtime,container-image,container-volume, andcontainer-networkbut omitscontainer-mount,container-exec-env, andcontainer-port. These threeContainerChildHandlertypes are the exact types that were broken before this fix — the registry path is the code path that was broken, so complete coverage here provides the strongest regression protection.✅ Positive Observations (from naming-conventions / code-patterns focus)
_ContainerBaseHandler— private base class with underscore prefix ✅_identity_hash,_default_strategy,_type_label— private with underscore prefix ✅__all__defined with all 5 public classes ✅# type: ignorein production code ✅_identity_hashmodule-level helper cleanly separates hash logic ✅_default_strategyand_type_label✅ISSUES CLOSED: #2907footer ✅MagicMockfor sandbox manager — no flaky test risk ✅NotImplementedErrormessages include contextual information ✅content_hash()correctly handles empty/None location →EMPTY_CONTENT_HASH✅Summary
The implementation is well-structured with clean naming conventions and consistent code patterns throughout. However, the API contract is inconsistent: 10 of 12 protocol methods correctly raise
NotImplementedErroras stubs, butcreate_sandbox()andproject_access()silently inherit real behavior fromBaseResourceHandler. From an api-consistency perspective, this is the primary issue — theCloudResourceHandlerpeer handler explicitly stubs all 12 protocol methods, and the container handler must do the same to maintain a uniform API contract.The code has not changed since the prior REQUEST_CHANGES review (review ID #4388, commit
a5e3d81). All three blocking issues remain.Decision: REQUEST CHANGES 🔄
Items #1 (
create_sandboxoverride), #2 (project_accessoverride), and #3 (milestone assignment) must be addressed before merge.Automated by CleverAgents Bot
Supervisor: PR Review | Agent: pr-self-reviewer
Code Review — PR #3245
Reviewer: HAL9001 (independent reviewer)
Decision: ❌ REQUEST CHANGES
I have independently reviewed the full implementation of
cleveragents.resource.handlers.containeragainst all 12 quality criteria. The implementation is well-structured and correctly resolves theHandlerResolutionErrorfor all seven container infrastructure resource types. However, multiple blocking issues must be addressed before merge.❌ Blocking Issues
1. [CRITERION 1] CI Failing
a5e3d81a9bd624f97034b974615c7ee91cbc945a) failed in 28 seconds — indicating a setup/initialization failure before any tests could run.2. [CRITERION 3]
# type: ignoreSuppressions in Step Definitionsfeatures/steps/container_handler_steps.py— throughout the file# type: ignore[attr-defined]suppressions on Behavecontextattribute assignments (e.g.,context.import_error = None # type: ignore[attr-defined],context.container_module = _mod # type: ignore[attr-defined], etc.).# type: ignoresuppressions. Use a typed context wrapper orcast()instead, or annotate the context attributes properly.3. [CRITERION 5] Imports Inside Functions
features/steps/container_handler_steps.py— multiple step functions_get_handler_class():from cleveragents.resource.handlers import container as _container_modstep_import_container_module():import cleveragents.resource.handlers.container as _mod(intentional test, but still violates the rule)step_resolve_handler_ref():from cleveragents.resource.handlers.resolver import ...step_resolve_handler_for_type():from cleveragents.application.services._resource_registry_data import BUILTIN_TYPESandfrom cleveragents.resource.handlers.resolver import ...step_import_container_modulescenario (which tests importability), useimportlib.import_module()with a try/except at the top-level import, or restructure the test to useimportlibrather than a bareimportstatement inside the function.4. [CRITERION 11] Branch Name Does Not Follow Convention
fix/container-handler-module-missingbugfix/mN-name(for bug fixes), wheremNis the milestone numberfix/instead ofbugfix/, and does not include the milestone number. For milestone v3.6.0 (M7), the correct branch name would bebugfix/m7-container-handler-module-missing.bugfix/mN-nameconvention and re-push.5. [PROCESS] Missing Milestone Assignment
milestone: null)6. [CORRECTNESS] Missing
create_sandbox()Override in_ContainerBaseHandlerLocation:
src/cleveragents/resource/handlers/container.py—_ContainerBaseHandlerclassIssue:
_ContainerBaseHandlerextendsBaseResourceHandlerbut does NOT overridecreate_sandbox(). The inheritedBaseResourceHandler.create_sandbox()performs real filesystem operations:_require_location(resource)— raisesValueErrorif no locationsandbox_manager.get_or_create_sandbox(original_path=location, ...)— attempts to create a filesystem sandbox at the location pathFor container resources, this would attempt to sandbox paths like
/var/run/docker.sock(a Unix socket),ubuntu:22.04(an image reference), ormy-volume(a volume name) — all semantically incorrect.The
CloudResourceHandlerpeer explicitly overridescreate_sandbox()withNotImplementedError. The container handler must do the same.Required: Add to
_ContainerBaseHandler:Also add corresponding BDD scenarios (Scenario Outline across all 5 handler classes).
7. [ARCHITECTURE] Missing
project_access()Override in_ContainerBaseHandlerLocation:
src/cleveragents/resource/handlers/container.py—_ContainerBaseHandlerclassIssue:
_ContainerBaseHandlerinheritsBaseResourceHandler.project_access(), which:cleveragents.application.services.permission_service(application layer) — a layer boundary violation for an infrastructure-layer handlerAccessResult(permitted=True)) rather than raisingNotImplementedErrorlike every other method on this stub handlerThe
CloudResourceHandlerpeer explicitly overridesproject_access()withNotImplementedError. The container handler must do the same for consistency and to avoid the cross-layer dependency.Required: Add to
_ContainerBaseHandler:⚠️ Non-blocking Observations
8. [TEST-COVERAGE] Registry Integration Tests Missing 3 of 7 Resource Types
container-runtime,container-image,container-volume, andcontainer-network, but omitscontainer-mount,container-exec-env, andcontainer-port— the exact types that useContainerChildHandlerand were broken before this fix.9. [SPEC-COMPLIANCE] Return Type Annotations Diverge from Protocol
create_checkpoint()androllback_to()are annotated-> Anybut theResourceHandlerprotocol specifies-> CheckpointResultand-> RollbackResultrespectively.CloudResourceHandler.-> CheckpointResult/-> RollbackResultor-> typing.NoReturn.✅ Positive Observations
_resource_registry_container.pyreferences. TheHandlerResolutionErroris correctly resolved._ContainerBaseHandlerprovides shared behavior; concrete classes only set_default_strategyand_type_label. Elegant and maintainable.fix(resource): ...) andCloses #2907in the PR body.content_hash()correctly returnsEMPTY_CONTENT_HASHfor resources with no location.MagicMockusage is correctly confined tofeatures/steps/. ✅Closes #2907present in PR body. ✅Type/Buglabel correctly applied. ✅Summary
# type: ignore[attr-defined]in step definitions7 blocking issues must be resolved before this PR can be merged.
Automated by CleverAgents Bot
Supervisor: PR Review Pool | Agent: pr-review-pool-supervisor
Code Review Decision: REQUEST CHANGES ❌
Reviewer: HAL9001 | PR: #3245 | Review ID: 6219
This is a durable backup of the formal review posted above.
Blocking Issues (7)
[CRITERION 1] CI Failing — Workflow run #9003 failed in 28 seconds (setup failure before tests ran). All CI checks must pass.
[CRITERION 3]
# type: ignoreSuppressions —features/steps/container_handler_steps.pycontains many# type: ignore[attr-defined]suppressions throughout. Must be removed.[CRITERION 5] Imports Inside Functions — Multiple step functions in
container_handler_steps.pycontain imports inside the function body (_get_handler_class,step_import_container_module,step_resolve_handler_ref,step_resolve_handler_for_type). All imports must be at the top of the file.[CRITERION 11] Branch Name Convention — Branch is
fix/container-handler-module-missing; required convention isbugfix/mN-name(e.g.,bugfix/m7-container-handler-module-missing).[PROCESS] Missing Milestone — PR has no milestone; issue #2907 is assigned to v3.6.0. Assign the PR to v3.6.0.
[CORRECTNESS] Missing
create_sandbox()Override —_ContainerBaseHandlerinheritsBaseResourceHandler.create_sandbox()which performs real filesystem operations on container paths (e.g.,/var/run/docker.sock,ubuntu:22.04). Must override withNotImplementedErrormatching theCloudResourceHandlerpattern.[ARCHITECTURE] Missing
project_access()Override —_ContainerBaseHandlerinheritsBaseResourceHandler.project_access()which calls into the application layer (permission service) — a layer boundary violation for an infrastructure stub handler. Must override withNotImplementedError.Non-blocking Suggestions
container-mount,container-exec-env,container-port(3 of 7 types missing)create_checkpoint()androllback_to()to match protocol (-> CheckpointResult,-> RollbackResult)Automated by CleverAgents Bot
Supervisor: PR Review Pool | Agent: pr-review-pool-supervisor
a5e3d81a9bb85b984837b85b98483796b3fdcaf3Claimed by
merge_drive.py(pid 3242924) until2026-05-30T18:38:43.177221+00:00.This claim is advisory and will be released when the cycle ends, or after the TTL by a sibling driver's expired-claim sweep.
bcfdd0257b62c11edb4aApproved by the controller reviewer stage (workflow 65).