feat(devcontainer): Persist devcontainer lifecycle state to database (F20) #8971

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

Background and Context

Per ADR-043 and the v3.5.0 milestone (M6: Autonomy Hardening), devcontainer lifecycle state must be persisted to the database so that container state survives process restarts. Currently, devcontainer state is held only in memory and is lost when the agent process exits. This is tracked as feature F20 in the Epic #4952 scope.

Without database persistence, the agent cannot resume work on a devcontainer after a restart, breaking the autonomy hardening goal of long-running task execution.

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

Acceptance Criteria

  • ContainerLifecycleState is persisted to the database on every state transition
  • On process restart, devcontainer state is rehydrated from the database
  • State transitions (discoveredstartingrunningstopped) are correctly stored and retrieved
  • ContainerLifecycleState uses discovered (not DETECTED) as the initial state value
  • Database schema migration is included for the new persistence fields
  • All nox stages pass with coverage >= 97%

Subtasks

  • Design and implement database schema for devcontainer_lifecycle_state table
  • Write migration script for the new table
  • Implement DevcontainerStateRepository with CRUD operations
  • Wire state transitions in DevcontainerLifecycleManager to call repository on each transition
  • Implement rehydration logic on process startup (load state from DB)
  • Fix ContainerLifecycleState enum to use discovered instead of DETECTED
  • Write unit tests for repository and state transition persistence
  • Write integration tests for restart/rehydration scenario
  • 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): persist lifecycle state to database (F20)
  • Branch name: feat/m6/devcontainer-lifecycle-persistence

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

## Background and Context Per ADR-043 and the v3.5.0 milestone (M6: Autonomy Hardening), devcontainer lifecycle state must be persisted to the database so that container state survives process restarts. Currently, devcontainer state is held only in memory and is lost when the agent process exits. This is tracked as feature F20 in the Epic #4952 scope. Without database persistence, the agent cannot resume work on a devcontainer after a restart, breaking the autonomy hardening goal of long-running task execution. Parent Epic: #4952 (EPIC: Devcontainer Lifecycle Management — State Persistence & Auto-Discovery) ## Acceptance Criteria - [ ] `ContainerLifecycleState` is persisted to the database on every state transition - [ ] On process restart, devcontainer state is rehydrated from the database - [ ] State transitions (`discovered` → `starting` → `running` → `stopped`) are correctly stored and retrieved - [ ] `ContainerLifecycleState` uses `discovered` (not `DETECTED`) as the initial state value - [ ] Database schema migration is included for the new persistence fields - [ ] All nox stages pass with coverage >= 97% ## Subtasks - [ ] Design and implement database schema for `devcontainer_lifecycle_state` table - [ ] Write migration script for the new table - [ ] Implement `DevcontainerStateRepository` with CRUD operations - [ ] Wire state transitions in `DevcontainerLifecycleManager` to call repository on each transition - [ ] Implement rehydration logic on process startup (load state from DB) - [ ] Fix `ContainerLifecycleState` enum to use `discovered` instead of `DETECTED` - [ ] Write unit tests for repository and state transition persistence - [ ] Write integration tests for restart/rehydration scenario - [ ] 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): persist lifecycle state to database (F20)` - **Branch name:** `feat/m6/devcontainer-lifecycle-persistence` --- **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 lifecycle state persistence is a v3.5.0 deliverable (F20). MoSCoW: Must-have. Priority: Medium.


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

✅ **Verified** — Devcontainer lifecycle state persistence is a v3.5.0 deliverable (F20). 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#8971
No description provided.