UAT: auto_discover_children() never activates for devcontainer-instance — missing "enabled": true in auto_discovery config #3538

Open
opened 2026-04-05 19:04:43 +00:00 by freemo · 2 comments
Owner

Metadata

  • Branch: fix/devcontainer-instance-auto-discovery-enabled
  • Commit Message: fix(resources): add enabled flag and rules to devcontainer-instance auto_discovery config
  • Milestone: None (backlog)
  • Parent Epic: #398

Backlog note: This issue was discovered during autonomous operation
on milestone v3.6.0. It does not block milestone completion and has been
placed in the backlog for human review and future milestone assignment.

Background and Context

The ResourceRepository.auto_discover_children() method in src/cleveragents/infrastructure/database/repositories.py checks for auto_disc.get("enabled", False) (line 2604) to determine whether auto-discovery should run. However, the devcontainer-instance resource type's auto_discovery configuration in src/cleveragents/application/services/_resource_registry_data.py (lines 225–231) does not include an "enabled": True field:

"auto_discovery": {
    "trigger_types": ["git-checkout", "fs-directory"],
    "scan_paths": [
        ".devcontainer/devcontainer.json",
        ".devcontainer.json",
    ],
},

This means even if auto_discover_children() were called (it currently isn't — see related issue #3536), it would immediately return an empty list because auto_disc.get("enabled", False) evaluates to False.

Per the spec and ADR-043, devcontainer-instance resources should be auto-discovered when a git-checkout or fs-directory resource contains a .devcontainer/ directory. The current config structure is also architecturally misaligned: auto_discover_children() is designed to discover children of a resource type (e.g., what children does a git-checkout create), but the current devcontainer-instance config describes what triggers its creation. The trigger_types and scan_paths fields are never read by any production code path.

Current Behavior

  • auto_discover_children() checks auto_disc.get("enabled", False) → evaluates to False → returns empty list immediately.
  • The trigger_types and scan_paths fields in the devcontainer-instance auto_discovery config are never consumed by any production code.
  • No devcontainer-instance children are ever auto-discovered for git-checkout or fs-directory resources.

Expected Behavior

Per the spec and ADR-043:

  • The git-checkout and fs-directory resource type definitions should each include an auto_discovery config with "enabled": True and "rules" entries that describe how to discover devcontainer-instance children (scanning for .devcontainer/devcontainer.json and .devcontainer.json).
  • When auto_discover_children() is called for a git-checkout or fs-directory resource, it correctly creates devcontainer-instance children when the relevant config files are present.
  • The devcontainer-instance type's auto_discovery config should be corrected or removed to reflect that it is a discovered child, not a discoverer.

Acceptance Criteria

  • The git-checkout resource type definition includes auto_discovery with "enabled": True and "rules" that scan for .devcontainer/devcontainer.json and .devcontainer.json to create devcontainer-instance children.
  • The fs-directory resource type definition includes the same auto_discovery config.
  • The devcontainer-instance resource type's auto_discovery config is corrected to not misrepresent the discovery direction (either removed or restructured to reflect its role as a discovered child).
  • auto_discover_children() called on a git-checkout or fs-directory resource with a .devcontainer/devcontainer.json present returns a non-empty list of devcontainer-instance children.
  • Unit tests cover the corrected auto-discovery logic for both git-checkout and fs-directory trigger types.
  • No regression in existing auto-discovery behaviour for other resource types.

Supporting Information

  • Code locations:
    • src/cleveragents/infrastructure/database/repositories.py line 2604: if not auto_disc.get("enabled", False): return []
    • src/cleveragents/application/services/_resource_registry_data.py lines 225–231: devcontainer-instance auto_discovery config missing "enabled": True and "rules"
  • Related issue: #3536 (auto_discover_children not being called at all)
  • Spec reference: ADR-043 (devcontainer integration), Resource Type definition (auto-discovery rules)
  • Fix direction: Add "enabled": True and "rules" to the git-checkout and fs-directory type definitions (architecturally correct per ADR-043), and correct the devcontainer-instance config accordingly.

Subtasks

  • Audit _resource_registry_data.py — identify all fields in devcontainer-instance auto_discovery that are unused or misaligned with auto_discover_children() logic
  • Add "enabled": True and "rules" to git-checkout type's auto_discovery config to scan for .devcontainer/devcontainer.json and .devcontainer.json
  • Add "enabled": True and "rules" to fs-directory type's auto_discovery config with the same scan targets
  • Correct or remove the devcontainer-instance auto_discovery config to eliminate the architectural mismatch
  • Tests (unit): Add/update tests for auto_discover_children() with git-checkout and fs-directory resources containing devcontainer config files
  • Tests (unit): Verify auto_discover_children() returns empty list when no devcontainer config files are present
  • Verify coverage ≥ 97% via nox -s coverage_report
  • Run nox (all default sessions), fix any errors

Definition of Done

This issue is complete when:

  • All subtasks above are completed and checked off.
  • A Git commit is created where the first line of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional lines providing relevant details about the implementation.
  • The commit is pushed to the remote on the branch matching the Branch in Metadata exactly.
  • The commit is submitted as a pull request to master, reviewed, and merged before this issue is marked done.
  • All nox stages pass.
  • Coverage ≥ 97%.

Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: ca-new-issue-creator

## Metadata - **Branch**: `fix/devcontainer-instance-auto-discovery-enabled` - **Commit Message**: `fix(resources): add enabled flag and rules to devcontainer-instance auto_discovery config` - **Milestone**: None (backlog) - **Parent Epic**: #398 > **Backlog note:** This issue was discovered during autonomous operation > on milestone v3.6.0. It does not block milestone completion and has been > placed in the backlog for human review and future milestone assignment. ## Background and Context The `ResourceRepository.auto_discover_children()` method in `src/cleveragents/infrastructure/database/repositories.py` checks for `auto_disc.get("enabled", False)` (line 2604) to determine whether auto-discovery should run. However, the `devcontainer-instance` resource type's `auto_discovery` configuration in `src/cleveragents/application/services/_resource_registry_data.py` (lines 225–231) does **not** include an `"enabled": True` field: ```python "auto_discovery": { "trigger_types": ["git-checkout", "fs-directory"], "scan_paths": [ ".devcontainer/devcontainer.json", ".devcontainer.json", ], }, ``` This means even if `auto_discover_children()` were called (it currently isn't — see related issue #3536), it would immediately return an empty list because `auto_disc.get("enabled", False)` evaluates to `False`. Per the spec and ADR-043, `devcontainer-instance` resources should be **auto-discovered** when a `git-checkout` or `fs-directory` resource contains a `.devcontainer/` directory. The current config structure is also architecturally misaligned: `auto_discover_children()` is designed to discover children **of** a resource type (e.g., what children does a `git-checkout` create), but the current `devcontainer-instance` config describes what **triggers** its creation. The `trigger_types` and `scan_paths` fields are never read by any production code path. ## Current Behavior - `auto_discover_children()` checks `auto_disc.get("enabled", False)` → evaluates to `False` → returns empty list immediately. - The `trigger_types` and `scan_paths` fields in the `devcontainer-instance` `auto_discovery` config are never consumed by any production code. - No `devcontainer-instance` children are ever auto-discovered for `git-checkout` or `fs-directory` resources. ## Expected Behavior Per the spec and ADR-043: - The `git-checkout` and `fs-directory` resource type definitions should each include an `auto_discovery` config with `"enabled": True` and `"rules"` entries that describe how to discover `devcontainer-instance` children (scanning for `.devcontainer/devcontainer.json` and `.devcontainer.json`). - When `auto_discover_children()` is called for a `git-checkout` or `fs-directory` resource, it correctly creates `devcontainer-instance` children when the relevant config files are present. - The `devcontainer-instance` type's `auto_discovery` config should be corrected or removed to reflect that it is a **discovered child**, not a **discoverer**. ## Acceptance Criteria - [ ] The `git-checkout` resource type definition includes `auto_discovery` with `"enabled": True` and `"rules"` that scan for `.devcontainer/devcontainer.json` and `.devcontainer.json` to create `devcontainer-instance` children. - [ ] The `fs-directory` resource type definition includes the same `auto_discovery` config. - [ ] The `devcontainer-instance` resource type's `auto_discovery` config is corrected to not misrepresent the discovery direction (either removed or restructured to reflect its role as a discovered child). - [ ] `auto_discover_children()` called on a `git-checkout` or `fs-directory` resource with a `.devcontainer/devcontainer.json` present returns a non-empty list of `devcontainer-instance` children. - [ ] Unit tests cover the corrected auto-discovery logic for both `git-checkout` and `fs-directory` trigger types. - [ ] No regression in existing auto-discovery behaviour for other resource types. ## Supporting Information - **Code locations:** - `src/cleveragents/infrastructure/database/repositories.py` line 2604: `if not auto_disc.get("enabled", False): return []` - `src/cleveragents/application/services/_resource_registry_data.py` lines 225–231: `devcontainer-instance` `auto_discovery` config missing `"enabled": True` and `"rules"` - **Related issue:** #3536 (auto_discover_children not being called at all) - **Spec reference:** ADR-043 (devcontainer integration), Resource Type definition (auto-discovery rules) - **Fix direction:** Add `"enabled": True` and `"rules"` to the `git-checkout` and `fs-directory` type definitions (architecturally correct per ADR-043), and correct the `devcontainer-instance` config accordingly. ## Subtasks - [ ] Audit `_resource_registry_data.py` — identify all fields in `devcontainer-instance` `auto_discovery` that are unused or misaligned with `auto_discover_children()` logic - [ ] Add `"enabled": True` and `"rules"` to `git-checkout` type's `auto_discovery` config to scan for `.devcontainer/devcontainer.json` and `.devcontainer.json` - [ ] Add `"enabled": True` and `"rules"` to `fs-directory` type's `auto_discovery` config with the same scan targets - [ ] Correct or remove the `devcontainer-instance` `auto_discovery` config to eliminate the architectural mismatch - [ ] Tests (unit): Add/update tests for `auto_discover_children()` with `git-checkout` and `fs-directory` resources containing devcontainer config files - [ ] Tests (unit): Verify `auto_discover_children()` returns empty list when no devcontainer config files are present - [ ] Verify coverage ≥ 97% via `nox -s coverage_report` - [ ] Run `nox` (all default sessions), fix any errors ## Definition of Done This issue is complete when: - All subtasks above are completed and checked off. - A Git commit is created where the **first line** of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional lines providing relevant details about the implementation. - The commit is pushed to the remote on the branch matching the **Branch** in Metadata exactly. - The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done. - All nox stages pass. - Coverage ≥ 97%. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-new-issue-creator
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • Priority: Medium — Auto-discovery config is architecturally misaligned but the feature is not yet wired (see related #3536). This is a prerequisite fix for #3536.
  • Milestone: v3.6.0 — Devcontainer auto-discovery is in scope for M7.
  • Story Points: 3 — M — Requires restructuring auto_discovery config across multiple resource type definitions and updating validation logic.
  • MoSCoW: Should Have — Auto-discovery is specified in ADR-043 and is important for the devcontainer workflow, but manual registration works as a fallback.
  • Parent Epic: #398 (Post-MVP Resources)

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

Issue triaged by project owner: - **State**: Verified - **Priority**: Medium — Auto-discovery config is architecturally misaligned but the feature is not yet wired (see related #3536). This is a prerequisite fix for #3536. - **Milestone**: v3.6.0 — Devcontainer auto-discovery is in scope for M7. - **Story Points**: 3 — M — Requires restructuring auto_discovery config across multiple resource type definitions and updating validation logic. - **MoSCoW**: Should Have — Auto-discovery is specified in ADR-043 and is important for the devcontainer workflow, but manual registration works as a fallback. - **Parent Epic**: #398 (Post-MVP Resources) --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: ca-project-owner
freemo added this to the v3.6.0 milestone 2026-04-05 19:37:42 +00:00
Author
Owner

Milestone Triage Decision: Moved to Backlog

This devcontainer feature has been moved out of v3.6.0 during aggressive milestone triage. Devcontainer auto-discovery is an infrastructure enhancement, not an advanced concept.

Reasoning:

  • v3.6.0 focus: Advanced concepts that extend beyond core MVP
  • This issue: Devcontainer-instance auto discovery - infrastructure feature
  • Impact: Development tooling enhancement, not advanced conceptual capability

Should be addressed when devcontainer functionality is prioritized or in a dedicated development tooling milestone.

**Milestone Triage Decision: Moved to Backlog** This devcontainer feature has been moved out of v3.6.0 during aggressive milestone triage. Devcontainer auto-discovery is an infrastructure enhancement, not an advanced concept. **Reasoning:** - v3.6.0 focus: Advanced concepts that extend beyond core MVP - This issue: Devcontainer-instance auto discovery - infrastructure feature - Impact: Development tooling enhancement, not advanced conceptual capability Should be addressed when devcontainer functionality is prioritized or in a dedicated development tooling milestone.
freemo removed this from the v3.6.0 milestone 2026-04-06 23:43:13 +00:00
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.

Blocks
#398 Epic: Post-MVP Resources
cleveragents/cleveragents-core
Reference
cleveragents/cleveragents-core#3538
No description provided.