UAT: ContainerLifecycleState uses DETECTED but ADR-043 specifies provisioning_state: discovered — state name mismatch between spec and implementation #4899

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

Bug Report

Feature Area: Devcontainer Integration — Lifecycle State Machine
ADR Reference: ADR-043 §Lifecycle: Lazy Activation
Severity: Medium (spec/implementation terminology mismatch; compliance tests reference wrong state names)


What Was Tested

ADR-043 defines the provisioning_state property of devcontainer-instance with specific enum values. The implementation uses different state names.

Expected Behavior (from ADR-043)

ADR-043 §Properties table specifies:

| provisioning_state | enum | discovered | building | active | stopped | failed |

And the lifecycle section states:

  1. Discovery (provisioning_state: discovered): When git-checkout or fs-directory auto-discovery finds .devcontainer/devcontainer.json, a devcontainer-instance resource is created.
  2. Activation (provisioning_state: active): Once the container is running...

Actual Behavior

ContainerLifecycleState in domain/models/core/container_lifecycle.py uses different state names:

class ContainerLifecycleState(StrEnum):
    DETECTED = "detected"   # ADR-043 says: "discovered"
    BUILDING = "building"   # ✓ matches
    RUNNING = "running"     # ADR-043 says: "active"
    STOPPING = "stopping"   # not in ADR-043 (implementation-only intermediate)
    STOPPED = "stopped"     # ✓ matches
    FAILED = "failed"       # ✓ matches

The code itself acknowledges this in a comment:

SPEC-1 reconciliation: Issue #514 acceptance criteria use a different vocabulary: inactive/starting/active/stopping/stopped/error. After design review these were renamed to better reflect the container lifecycle semantics.

However, the renaming diverges from ADR-043's provisioning_state enum values (discovered, building, active, stopped, failed).

Code Locations

  • State enum: src/cleveragents/domain/models/core/container_lifecycle.py:86-91
  • ADR-043 spec: docs/adr/ADR-043-devcontainer-integration.md:108
  • CLI display: src/cleveragents/cli/commands/resource.py:170 — shows "detected (not built)" to users instead of "discovered"

Impact

  1. User-facing confusion: agents resource show local/my-devcontainer displays "detected (not built)" instead of "discovered" as documented in ADR-043.
  2. ADR-043 compliance tests reference provisioning_state: discovered and provisioning_state: active — these cannot pass with the current state names.
  3. API consumers (e.g., A2A clients) that read provisioning_state from resource properties will receive "detected" and "running" instead of the spec-defined "discovered" and "active".

Fix Required

Either:

  1. Align implementation to spec: Rename DETECTED → DISCOVERED and RUNNING → ACTIVE in ContainerLifecycleState, update all references, and update the CLI display string.
  2. Update the spec: If the implementation names are intentional, update ADR-043's provisioning_state enum values to match (detected, building, running, stopping, stopped, failed).

Option 1 is preferred as it aligns with the authoritative ADR-043 spec. The stopping intermediate state can be kept as an implementation detail not exposed in provisioning_state.


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

## Bug Report **Feature Area:** Devcontainer Integration — Lifecycle State Machine **ADR Reference:** ADR-043 §Lifecycle: Lazy Activation **Severity:** Medium (spec/implementation terminology mismatch; compliance tests reference wrong state names) --- ## What Was Tested ADR-043 defines the `provisioning_state` property of `devcontainer-instance` with specific enum values. The implementation uses different state names. ## Expected Behavior (from ADR-043) ADR-043 §Properties table specifies: > | `provisioning_state` | enum | `discovered` \| `building` \| `active` \| `stopped` \| `failed` | And the lifecycle section states: > 1. **Discovery** (`provisioning_state: discovered`): When `git-checkout` or `fs-directory` auto-discovery finds `.devcontainer/devcontainer.json`, a `devcontainer-instance` resource is created. > 3. **Activation** (`provisioning_state: active`): Once the container is running... ## Actual Behavior `ContainerLifecycleState` in `domain/models/core/container_lifecycle.py` uses different state names: ```python class ContainerLifecycleState(StrEnum): DETECTED = "detected" # ADR-043 says: "discovered" BUILDING = "building" # ✓ matches RUNNING = "running" # ADR-043 says: "active" STOPPING = "stopping" # not in ADR-043 (implementation-only intermediate) STOPPED = "stopped" # ✓ matches FAILED = "failed" # ✓ matches ``` The code itself acknowledges this in a comment: > **SPEC-1 reconciliation**: Issue #514 acceptance criteria use a different vocabulary: `inactive/starting/active/stopping/stopped/error`. After design review these were renamed to better reflect the container lifecycle semantics. However, the renaming diverges from ADR-043's `provisioning_state` enum values (`discovered`, `building`, `active`, `stopped`, `failed`). ## Code Locations - State enum: `src/cleveragents/domain/models/core/container_lifecycle.py:86-91` - ADR-043 spec: `docs/adr/ADR-043-devcontainer-integration.md:108` - CLI display: `src/cleveragents/cli/commands/resource.py:170` — shows `"detected (not built)"` to users instead of `"discovered"` ## Impact 1. **User-facing confusion**: `agents resource show local/my-devcontainer` displays `"detected (not built)"` instead of `"discovered"` as documented in ADR-043. 2. **ADR-043 compliance tests** reference `provisioning_state: discovered` and `provisioning_state: active` — these cannot pass with the current state names. 3. **API consumers** (e.g., A2A clients) that read `provisioning_state` from resource properties will receive `"detected"` and `"running"` instead of the spec-defined `"discovered"` and `"active"`. ## Fix Required Either: 1. **Align implementation to spec**: Rename `DETECTED → DISCOVERED` and `RUNNING → ACTIVE` in `ContainerLifecycleState`, update all references, and update the CLI display string. 2. **Update the spec**: If the implementation names are intentional, update ADR-043's `provisioning_state` enum values to match (`detected`, `building`, `running`, `stopping`, `stopped`, `failed`). Option 1 is preferred as it aligns with the authoritative ADR-043 spec. The `stopping` intermediate state can be kept as an implementation detail not exposed in `provisioning_state`. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
freemo added this to the v3.5.0 milestone 2026-04-08 23:40:27 +00:00
Owner

Issue triaged by project owner:

  • State: Verified
  • Priority: Medium — ContainerLifecycleState uses DETECTED but ADR-043 specifies provisioning
  • Milestone: v3.5.0 — Container lifecycle is M6 scope
  • Story Points: 3 — M — Aligning enum value with ADR-043 spec
  • MoSCoW: Should Have — Spec alignment is important for correctness
  • 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 — ContainerLifecycleState uses DETECTED but ADR-043 specifies `provisioning` - **Milestone**: v3.5.0 — Container lifecycle is M6 scope - **Story Points**: 3 — M — Aligning enum value with ADR-043 spec - **MoSCoW**: Should Have — Spec alignment is important for correctness - **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: Medium — ContainerLifecycleState uses DETECTED but ADR-043 specifies provisioning_state: discovered; terminology mismatch
  • Milestone: v3.5.0 (Autonomy Hardening — devcontainer integration)
  • Story Points: 2 — S — Renaming a state constant and updating references is a small task
  • MoSCoW: Should Have — Spec/implementation terminology alignment is important for maintainability
  • Parent Epic: #4944 (Autonomy Hardening Legendary)

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

Issue triaged by project owner: - **State**: Verified - **Priority**: Medium — `ContainerLifecycleState` uses `DETECTED` but ADR-043 specifies `provisioning_state: discovered`; terminology mismatch - **Milestone**: v3.5.0 (Autonomy Hardening — devcontainer integration) - **Story Points**: 2 — S — Renaming a state constant and updating references is a small task - **MoSCoW**: Should Have — Spec/implementation terminology alignment is important for maintainability - **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#4899
No description provided.