feat(devcontainer): Auto-discover .devcontainer/ directories in GitCheckoutHandler and FsDirectoryHandler #8974

Open
opened 2026-04-14 04:34:42 +00:00 by HAL9000 · 1 comment
Owner

Background and Context

Per ADR-043 and Epic #4952, devcontainer directories must be auto-discovered when a developer checks out a git repository or navigates to a directory containing a .devcontainer/ folder. Currently, devcontainers must be manually registered — there is no automatic discovery wired into the GitCheckoutHandler or FsDirectoryHandler event handlers.

This auto-discovery is essential for the autonomy hardening goal: the agent should automatically detect and manage devcontainers without requiring explicit user configuration.

Parent Epic: #4952 (EPIC: Devcontainer Lifecycle Management — State Persistence & Auto-Discovery)

Acceptance Criteria

  • GitCheckoutHandler scans the checked-out directory for .devcontainer/ and registers any found devcontainer configurations
  • FsDirectoryHandler scans directories for .devcontainer/ on directory open/navigate events
  • Discovered devcontainers are registered with ContainerLifecycleState.discovered
  • Duplicate discovery (same path already registered) is handled gracefully (idempotent)
  • Discovery errors (malformed .devcontainer/devcontainer.json) are logged and do not crash the handler
  • All nox stages pass with coverage >= 97%

Subtasks

  • Implement DevcontainerDiscoveryService.scan_directory(path) that finds .devcontainer/ subdirectories
  • Wire DevcontainerDiscoveryService into GitCheckoutHandler.handle() post-checkout hook
  • Wire DevcontainerDiscoveryService into FsDirectoryHandler.handle() on directory open
  • Implement idempotency check (skip if devcontainer already registered for that path)
  • Add error handling for malformed devcontainer.json files
  • Write unit tests for DevcontainerDiscoveryService.scan_directory()
  • Write integration tests for GitCheckoutHandler and FsDirectoryHandler auto-discovery
  • Run nox (all default sessions), fix any errors

Definition of Done

  • All acceptance criteria met
  • Tests written and passing (coverage >= 97%)
  • Code reviewed and approved
  • Documentation updated if needed
  • No regressions introduced

Metadata

  • Commit message: feat(devcontainer): auto-discover .devcontainer/ in checkout and directory handlers
  • Branch name: feat/m6/devcontainer-autodiscovery

Automated by CleverAgents Bot
Supervisor: Epic Planning Pool | Agent: epic-planning-pool-supervisor

## Background and Context Per ADR-043 and Epic #4952, devcontainer directories must be auto-discovered when a developer checks out a git repository or navigates to a directory containing a `.devcontainer/` folder. Currently, devcontainers must be manually registered — there is no automatic discovery wired into the `GitCheckoutHandler` or `FsDirectoryHandler` event handlers. This auto-discovery is essential for the autonomy hardening goal: the agent should automatically detect and manage devcontainers without requiring explicit user configuration. Parent Epic: #4952 (EPIC: Devcontainer Lifecycle Management — State Persistence & Auto-Discovery) ## Acceptance Criteria - [ ] `GitCheckoutHandler` scans the checked-out directory for `.devcontainer/` and registers any found devcontainer configurations - [ ] `FsDirectoryHandler` scans directories for `.devcontainer/` on directory open/navigate events - [ ] Discovered devcontainers are registered with `ContainerLifecycleState.discovered` - [ ] Duplicate discovery (same path already registered) is handled gracefully (idempotent) - [ ] Discovery errors (malformed `.devcontainer/devcontainer.json`) are logged and do not crash the handler - [ ] All nox stages pass with coverage >= 97% ## Subtasks - [ ] Implement `DevcontainerDiscoveryService.scan_directory(path)` that finds `.devcontainer/` subdirectories - [ ] Wire `DevcontainerDiscoveryService` into `GitCheckoutHandler.handle()` post-checkout hook - [ ] Wire `DevcontainerDiscoveryService` into `FsDirectoryHandler.handle()` on directory open - [ ] Implement idempotency check (skip if devcontainer already registered for that path) - [ ] Add error handling for malformed `devcontainer.json` files - [ ] Write unit tests for `DevcontainerDiscoveryService.scan_directory()` - [ ] Write integration tests for `GitCheckoutHandler` and `FsDirectoryHandler` auto-discovery - [ ] Run `nox` (all default sessions), fix any errors ## Definition of Done - [ ] All acceptance criteria met - [ ] Tests written and passing (coverage >= 97%) - [ ] Code reviewed and approved - [ ] Documentation updated if needed - [ ] No regressions introduced ## Metadata - **Commit message:** `feat(devcontainer): auto-discover .devcontainer/ in checkout and directory handlers` - **Branch name:** `feat/m6/devcontainer-autodiscovery` --- **Automated by CleverAgents Bot** Supervisor: Epic Planning Pool | Agent: epic-planning-pool-supervisor
HAL9000 added this to the v3.5.0 milestone 2026-04-14 04:44:57 +00:00
Author
Owner

Verified — Devcontainer auto-discovery is a v3.5.0 deliverable. MoSCoW: Must-have. Priority: Medium.


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

✅ **Verified** — Devcontainer auto-discovery is a v3.5.0 deliverable. MoSCoW: Must-have. Priority: Medium. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner-pool-supervisor
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
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#8974
No description provided.