UAT: Auto-discovery of .devcontainer/ not wired into GitCheckoutHandler or FsDirectoryHandlerdiscover_devcontainers() is never called in production #4893

Open
opened 2026-04-08 20:16:33 +00:00 by HAL9000 · 2 comments
Owner

Bug Report

Feature Area: Devcontainer Integration — Auto-Discovery
ADR Reference: ADR-043 §Auto-Discovery from git-checkout and fs-directory
Severity: Medium (core ADR-043 feature not functional)


What Was Tested

ADR-043 specifies that when a git-checkout or fs-directory resource is registered or linked to a project, the system should automatically scan for .devcontainer/devcontainer.json and create a devcontainer-instance child resource.

Expected Behavior (from ADR-043)

During filesystem scanning, if a .devcontainer/ directory is found:
a. Look for devcontainer.json inside it (required).
b. If found, create a devcontainer-instance child resource with provisioning_state: discovered.

The discover_devcontainers() function in cleveragents/resource/handlers/discovery.py should be called from GitCheckoutHandler.discover_children() and FsDirectoryHandler.discover_children() when those handlers scan their resource locations.

Actual Behavior

discover_devcontainers() is never imported or called from any production code path. Specifically:

  • GitCheckoutHandler.discover_children() (resource/handlers/git_checkout.py) only discovers fs-directory children via git ls-tree. It does not call discover_devcontainers().
  • FsDirectoryHandler.discover_children() (resource/handlers/fs_directory.py) only discovers subdirectory children via os.scandir(). It does not call discover_devcontainers().
  • The only callers of discover_devcontainers() are test files (features/steps/devcontainer_handler_steps.py, robot/helper_devcontainer_handler.py, benchmarks/devcontainer_handler_bench.py).

This is also documented in docs/reference/devcontainer_resources.md:

Not yet wired (F31/F23): The discovery module (discover_devcontainers()) exists and is tested in isolation, but is not invoked during project link-resource or any other production code path.

Code Locations

  • Discovery function: src/cleveragents/resource/handlers/discovery.py:89discover_devcontainers()
  • Missing call site 1: src/cleveragents/resource/handlers/git_checkout.py:305GitCheckoutHandler.discover_children()
  • Missing call site 2: src/cleveragents/resource/handlers/fs_directory.py:235FsDirectoryHandler.discover_children()
  • Known limitation documented: docs/reference/devcontainer_resources.md:253

Steps to Reproduce

  1. Create a directory with a .devcontainer/devcontainer.json file.
  2. Register it as a git-checkout or fs-directory resource: agents resource add git-checkout local/my-repo --path /path/to/dir
  3. Observe that no devcontainer-instance child resource is created.
  4. Expected: a devcontainer-instance child resource in discovered state should appear automatically.

Impact

Users must manually add devcontainer-instance resources via agents resource add devcontainer-instance instead of having them auto-detected. This defeats the primary value proposition of ADR-043 (zero-configuration devcontainer integration).

Fix Required

Wire discover_devcontainers() into GitCheckoutHandler.discover_children() and FsDirectoryHandler.discover_children(). When a .devcontainer/devcontainer.json is found, create a devcontainer-instance child resource with provisioning_state: discovered (i.e., ContainerLifecycleState.DETECTED) and register it via the resource registry service.


Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: uat-tester

## Bug Report **Feature Area:** Devcontainer Integration — Auto-Discovery **ADR Reference:** ADR-043 §Auto-Discovery from `git-checkout` and `fs-directory` **Severity:** Medium (core ADR-043 feature not functional) --- ## What Was Tested ADR-043 specifies that when a `git-checkout` or `fs-directory` resource is registered or linked to a project, the system should automatically scan for `.devcontainer/devcontainer.json` and create a `devcontainer-instance` child resource. ## Expected Behavior (from ADR-043) > During filesystem scanning, if a `.devcontainer/` directory is found: > a. Look for `devcontainer.json` inside it (required). > b. If found, create a `devcontainer-instance` child resource with `provisioning_state: discovered`. The `discover_devcontainers()` function in `cleveragents/resource/handlers/discovery.py` should be called from `GitCheckoutHandler.discover_children()` and `FsDirectoryHandler.discover_children()` when those handlers scan their resource locations. ## Actual Behavior `discover_devcontainers()` is **never imported or called** from any production code path. Specifically: - `GitCheckoutHandler.discover_children()` (`resource/handlers/git_checkout.py`) only discovers `fs-directory` children via `git ls-tree`. It does **not** call `discover_devcontainers()`. - `FsDirectoryHandler.discover_children()` (`resource/handlers/fs_directory.py`) only discovers subdirectory children via `os.scandir()`. It does **not** call `discover_devcontainers()`. - The only callers of `discover_devcontainers()` are test files (`features/steps/devcontainer_handler_steps.py`, `robot/helper_devcontainer_handler.py`, `benchmarks/devcontainer_handler_bench.py`). This is also documented in `docs/reference/devcontainer_resources.md`: > **Not yet wired (F31/F23):** The discovery module (`discover_devcontainers()`) exists and is tested in isolation, but is **not** invoked during `project link-resource` or any other production code path. ## Code Locations - Discovery function: `src/cleveragents/resource/handlers/discovery.py:89` — `discover_devcontainers()` - Missing call site 1: `src/cleveragents/resource/handlers/git_checkout.py:305` — `GitCheckoutHandler.discover_children()` - Missing call site 2: `src/cleveragents/resource/handlers/fs_directory.py:235` — `FsDirectoryHandler.discover_children()` - Known limitation documented: `docs/reference/devcontainer_resources.md:253` ## Steps to Reproduce 1. Create a directory with a `.devcontainer/devcontainer.json` file. 2. Register it as a `git-checkout` or `fs-directory` resource: `agents resource add git-checkout local/my-repo --path /path/to/dir` 3. Observe that no `devcontainer-instance` child resource is created. 4. Expected: a `devcontainer-instance` child resource in `discovered` state should appear automatically. ## Impact Users must manually add `devcontainer-instance` resources via `agents resource add devcontainer-instance` instead of having them auto-detected. This defeats the primary value proposition of ADR-043 (zero-configuration devcontainer integration). ## Fix Required Wire `discover_devcontainers()` into `GitCheckoutHandler.discover_children()` and `FsDirectoryHandler.discover_children()`. When a `.devcontainer/devcontainer.json` is found, create a `devcontainer-instance` child resource with `provisioning_state: discovered` (i.e., `ContainerLifecycleState.DETECTED`) and register it via the resource registry service. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
freemo added this to the v3.5.0 milestone 2026-04-08 23:41:36 +00:00
Owner

Issue triaged by project owner:

  • State: Verified
  • Priority: Medium — Auto-discovery of .devcontainer/ not wired into GitCheckoutHandler
  • Milestone: v3.5.0 — Container auto-discovery is M6 scope
  • Story Points: 5 — L — Wiring devcontainer auto-discovery into resource handlers
  • MoSCoW: Should Have — Auto-discovery improves UX but not blocking core workflow
  • Parent Epic: #360 (Autonomy Hardening + Stubs M6)

Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: project-owner

Issue triaged by project owner: - **State**: Verified - **Priority**: Medium — Auto-discovery of `.devcontainer/` not wired into GitCheckoutHandler - **Milestone**: v3.5.0 — Container auto-discovery is M6 scope - **Story Points**: 5 — L — Wiring devcontainer auto-discovery into resource handlers - **MoSCoW**: Should Have — Auto-discovery improves UX but not blocking core workflow - **Parent Epic**: #360 (Autonomy Hardening + Stubs M6) --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner
Owner

Issue triaged by project owner:

  • State: Verified
  • Priority: High — Auto-discovery of .devcontainer/ not wired into handlers; discover_devcontainers() never called in production
  • Milestone: v3.5.0 (Autonomy Hardening — devcontainer integration)
  • Story Points: 3 — M — Wiring auto-discovery into GitCheckoutHandler and FsDirectoryHandler is a medium task
  • MoSCoW: Must Have — Auto-discovery is a core ADR-043 feature; without it, devcontainers must be manually registered
  • Parent Epic: #4944 (Autonomy Hardening Legendary)

Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: project-owner

Issue triaged by project owner: - **State**: Verified - **Priority**: High — Auto-discovery of `.devcontainer/` not wired into handlers; `discover_devcontainers()` never called in production - **Milestone**: v3.5.0 (Autonomy Hardening — devcontainer integration) - **Story Points**: 3 — M — Wiring auto-discovery into GitCheckoutHandler and FsDirectoryHandler is a medium task - **MoSCoW**: Must Have — Auto-discovery is a core ADR-043 feature; without it, devcontainers must be manually registered - **Parent Epic**: #4944 (Autonomy Hardening Legendary) --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
cleveragents/cleveragents-core#4893
No description provided.