UAT: devcontainer-instance spec-required properties (devcontainer_config, config_path, workspace_folder, etc.) not stored on Resource model #3546

Open
opened 2026-04-05 19:12:36 +00:00 by freemo · 1 comment
Owner

Metadata

  • Branch: fix/devcontainer-instance-resource-properties
  • Commit Message: fix(resources): persist devcontainer-instance spec properties to Resource model
  • Milestone: None (backlog — see note below)
  • 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

ADR-043 (§Properties) specifies that devcontainer-instance resources must store the following additional properties beyond those inherited from container-instance:

Property Type Description
devcontainer_config object Parsed contents of devcontainer.json
config_path path Absolute path to the devcontainer.json file
workspace_folder path Host folder mounted as the container workspace
workspace_mount string The workspace mount specification
features list Installed devcontainer features with version pins
post_create_command string/list Command(s) to run after container creation
post_start_command string/list Command(s) to run after container start
post_attach_command string/list Command(s) to run after attaching to the container
remote_user string The user to run commands as inside the container
container_env map Environment variables set inside the container
provisioning_state enum discovered | building | active | stopped | failed

None of these properties are stored on the Resource domain model. The Resource model in src/cleveragents/domain/models/core/resource.py has a generic properties: dict[str, Any] field, but:

  1. The discover_devcontainers() function in src/cleveragents/resource/handlers/discovery.py returns a DevcontainerDiscoveryResult with config_data and config_path, but this data is never persisted to the resource's properties field.
  2. The ContainerLifecycleTracker in src/cleveragents/domain/models/core/container_lifecycle.py stores container_id, workspace_path, and host_workspace_path in-memory only — not persisted to the database.
  3. The devcontainer.json parsing described in ADR-043 (§Devcontainer.json Parsing) — mapping image, build.dockerfile, workspaceFolder, features, forwardPorts, mounts, postCreateCommand, postStartCommand, postAttachCommand, remoteUser, containerEnv to resource properties — is not implemented anywhere in the production code.

Expected behavior (from ADR-043):
When a devcontainer-instance resource is created (either manually or via auto-discovery), the devcontainer.json should be parsed and its fields stored as resource properties. These properties should be persisted to the database and visible via agents resource show <name>.

Actual behavior:

  • devcontainer.json is never parsed and stored as resource properties
  • config_path, workspace_folder, features, post_create_command, etc. are not stored anywhere
  • provisioning_state is tracked in-memory via ContainerLifecycleTracker but not persisted to the database — it is lost on process restart
  • agents resource show local/my-devcontainer would show no devcontainer-specific properties

Code locations:

  • src/cleveragents/resource/handlers/discovery.pyDevcontainerDiscoveryResult has config_data but it's never used to populate resource properties
  • src/cleveragents/domain/models/core/container_lifecycle.pyContainerLifecycleTracker is in-memory only
  • src/cleveragents/domain/models/core/resource.pyResource.properties is generic dict, no devcontainer-specific schema

Impact:

  • Devcontainer properties are not visible to users or other system components
  • provisioning_state is lost on process restart (containers appear as detected again)
  • The execution environment router cannot inspect devcontainer properties (e.g., features, remote_user) to make routing decisions

Subtasks

  • Implement devcontainer.json parsing in src/cleveragents/resource/handlers/discovery.py, mapping all ADR-043 §Devcontainer.json Parsing fields to resource properties
  • Update discover_devcontainers() to persist parsed config_data and config_path into the resource's properties field
  • Persist provisioning_state to the database (replace in-memory ContainerLifecycleTracker or supplement it with DB-backed state)
  • Persist workspace_folder, workspace_mount, features, post_create_command, post_start_command, post_attach_command, remote_user, and container_env to Resource.properties on creation and update
  • Write Behave unit tests covering devcontainer.json parsing and property persistence
  • Write Robot Framework integration test verifying agents resource show <name> displays devcontainer-specific properties
  • Verify provisioning_state survives process restart (persisted to DB, not in-memory only)

Definition of Done

  • All subtasks above are checked off
  • agents resource show local/my-devcontainer displays all ADR-043-specified properties (config_path, workspace_folder, features, provisioning_state, etc.)
  • provisioning_state is persisted to the database and survives process restart
  • devcontainer.json parsing covers all fields specified in ADR-043 §Devcontainer.json Parsing
  • All nox stages pass
  • Coverage >= 97%

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

## Metadata - **Branch**: `fix/devcontainer-instance-resource-properties` - **Commit Message**: `fix(resources): persist devcontainer-instance spec properties to Resource model` - **Milestone**: None (backlog — see note below) - **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 ADR-043 (§Properties) specifies that `devcontainer-instance` resources must store the following additional properties beyond those inherited from `container-instance`: | Property | Type | Description | |----------|------|-------------| | `devcontainer_config` | object | Parsed contents of `devcontainer.json` | | `config_path` | path | Absolute path to the `devcontainer.json` file | | `workspace_folder` | path | Host folder mounted as the container workspace | | `workspace_mount` | string | The workspace mount specification | | `features` | list | Installed devcontainer features with version pins | | `post_create_command` | string/list | Command(s) to run after container creation | | `post_start_command` | string/list | Command(s) to run after container start | | `post_attach_command` | string/list | Command(s) to run after attaching to the container | | `remote_user` | string | The user to run commands as inside the container | | `container_env` | map | Environment variables set inside the container | | `provisioning_state` | enum | `discovered` \| `building` \| `active` \| `stopped` \| `failed` | None of these properties are stored on the `Resource` domain model. The `Resource` model in `src/cleveragents/domain/models/core/resource.py` has a generic `properties: dict[str, Any]` field, but: 1. The `discover_devcontainers()` function in `src/cleveragents/resource/handlers/discovery.py` returns a `DevcontainerDiscoveryResult` with `config_data` and `config_path`, but this data is never persisted to the resource's `properties` field. 2. The `ContainerLifecycleTracker` in `src/cleveragents/domain/models/core/container_lifecycle.py` stores `container_id`, `workspace_path`, and `host_workspace_path` in-memory only — not persisted to the database. 3. The `devcontainer.json` parsing described in ADR-043 (§Devcontainer.json Parsing) — mapping `image`, `build.dockerfile`, `workspaceFolder`, `features`, `forwardPorts`, `mounts`, `postCreateCommand`, `postStartCommand`, `postAttachCommand`, `remoteUser`, `containerEnv` to resource properties — is not implemented anywhere in the production code. **Expected behavior (from ADR-043):** When a `devcontainer-instance` resource is created (either manually or via auto-discovery), the `devcontainer.json` should be parsed and its fields stored as resource properties. These properties should be persisted to the database and visible via `agents resource show <name>`. **Actual behavior:** - `devcontainer.json` is never parsed and stored as resource properties - `config_path`, `workspace_folder`, `features`, `post_create_command`, etc. are not stored anywhere - `provisioning_state` is tracked in-memory via `ContainerLifecycleTracker` but not persisted to the database — it is lost on process restart - `agents resource show local/my-devcontainer` would show no devcontainer-specific properties **Code locations:** - `src/cleveragents/resource/handlers/discovery.py` — `DevcontainerDiscoveryResult` has `config_data` but it's never used to populate resource properties - `src/cleveragents/domain/models/core/container_lifecycle.py` — `ContainerLifecycleTracker` is in-memory only - `src/cleveragents/domain/models/core/resource.py` — `Resource.properties` is generic dict, no devcontainer-specific schema **Impact:** - Devcontainer properties are not visible to users or other system components - `provisioning_state` is lost on process restart (containers appear as `detected` again) - The execution environment router cannot inspect devcontainer properties (e.g., `features`, `remote_user`) to make routing decisions ## Subtasks - [ ] Implement `devcontainer.json` parsing in `src/cleveragents/resource/handlers/discovery.py`, mapping all ADR-043 §Devcontainer.json Parsing fields to resource properties - [ ] Update `discover_devcontainers()` to persist parsed `config_data` and `config_path` into the resource's `properties` field - [ ] Persist `provisioning_state` to the database (replace in-memory `ContainerLifecycleTracker` or supplement it with DB-backed state) - [ ] Persist `workspace_folder`, `workspace_mount`, `features`, `post_create_command`, `post_start_command`, `post_attach_command`, `remote_user`, and `container_env` to `Resource.properties` on creation and update - [ ] Write Behave unit tests covering `devcontainer.json` parsing and property persistence - [ ] Write Robot Framework integration test verifying `agents resource show <name>` displays devcontainer-specific properties - [ ] Verify `provisioning_state` survives process restart (persisted to DB, not in-memory only) ## Definition of Done - [ ] All subtasks above are checked off - [ ] `agents resource show local/my-devcontainer` displays all ADR-043-specified properties (`config_path`, `workspace_folder`, `features`, `provisioning_state`, etc.) - [ ] `provisioning_state` is persisted to the database and survives process restart - [ ] `devcontainer.json` parsing covers all fields specified in ADR-043 §Devcontainer.json Parsing - [ ] 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: High — Devcontainer properties are required by ADR-043 and are needed by the execution environment router to make routing decisions. Without them, devcontainer resources are opaque to the system.
  • Milestone: v3.6.0 — Devcontainer resource types are in scope for M7 (Advanced Concepts & Deferred Features), specifically "Additional resource types."
  • Story Points: 8 — XL — Requires implementing devcontainer.json parsing, persisting multiple properties to the Resource model, replacing in-memory ContainerLifecycleTracker with DB-backed state, plus comprehensive tests. Broad surface area across discovery, domain model, and persistence layers.
  • MoSCoW: Should Have — ADR-043 specifies these properties as part of the devcontainer-instance type definition. They are important for full devcontainer functionality but the system can operate at a basic level without them.
  • 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**: High — Devcontainer properties are required by ADR-043 and are needed by the execution environment router to make routing decisions. Without them, devcontainer resources are opaque to the system. - **Milestone**: v3.6.0 — Devcontainer resource types are in scope for M7 (Advanced Concepts & Deferred Features), specifically "Additional resource types." - **Story Points**: 8 — XL — Requires implementing `devcontainer.json` parsing, persisting multiple properties to the Resource model, replacing in-memory `ContainerLifecycleTracker` with DB-backed state, plus comprehensive tests. Broad surface area across discovery, domain model, and persistence layers. - **MoSCoW**: Should Have — ADR-043 specifies these properties as part of the devcontainer-instance type definition. They are important for full devcontainer functionality but the system can operate at a basic level without them. - **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:35:05 +00:00
freemo removed this from the v3.6.0 milestone 2026-04-06 23:38:56 +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#3546
No description provided.