Files
CoreRasurae cf67ba0a86
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 15s
CI / build (pull_request) Successful in 16s
CI / quality (pull_request) Successful in 18s
CI / security (pull_request) Successful in 35s
CI / typecheck (pull_request) Successful in 37s
CI / unit_tests (pull_request) Successful in 2m27s
CI / docker (pull_request) Successful in 49s
CI / integration_tests (pull_request) Successful in 3m46s
CI / coverage (pull_request) Successful in 4m56s
CI / lint (push) Successful in 12s
CI / build (push) Successful in 14s
CI / quality (push) Successful in 16s
CI / security (push) Successful in 32s
CI / typecheck (push) Successful in 36s
CI / benchmark-regression (push) Has been skipped
CI / unit_tests (push) Successful in 4m7s
CI / integration_tests (push) Successful in 4m41s
CI / docker (push) Successful in 44s
CI / coverage (push) Successful in 4m56s
CI / benchmark-publish (push) Successful in 17m17s
CI / benchmark-regression (pull_request) Successful in 31m25s
feat(devcontainer): add lazy activation and lifecycle management
Implemented lazy container activation for devcontainer-instance resources
with ContainerLifecycleState enum tracking six states (inactive, starting,
active, stopping, stopped, error) with validated transitions. Extended
DevcontainerHandler with devcontainer up CLI integration and JSON output
parsing for container start. Added periodic health checking via
devcontainer exec ping with configurable interval. Added agents resource
stop and agents resource rebuild CLI commands for manual lifecycle
control. Wired session close and plan completion hooks to automatic
container cleanup. Includes lifecycle state persistence in resource
registry with timestamped transitions. Added Behave BDD tests, Robot
integration tests, and ASV activation latency benchmarks.

- Added remoteWorkspaceFolder absolute-path validation
- Aligned spec: handler name, rebuild types, --yes flag on stop/rebuild
- Added registry re-read in stop_container success path for consistency
- Added session_id field to ContainerLifecycleTracker for scoped cleanup
- Scoped stop_all_active_containers to session_id when provided
- Wired _cleanup_devcontainers into fail_apply and fail_execute
- Wired start_health_check into activate_container success path
- Restructured facade session close to always run container cleanup
  even without session service (F4)
- Re-read tracker from registry in activate_container success path
- Added evict_terminal_trackers to cap registry growth
- Updated devcontainer_resources.md: health check auto-start, scoped
  cleanup hooks, known limitations for eviction and sandbox_strategy
- Wired evict_terminal_trackers into stop_all_active_containers so
  terminal-state trackers are actually evicted in production
- Made stop_container idempotent: returns early when container is
  already in a terminal state instead of raising ValueError
- Fixed benchmark health check thread leak in TimeActivationLatency
  by clearing registry after each timing loop
- Added rebuild pass-through (--reset-container flag to devcontainer up)
- Added host_workspace_path field on ContainerLifecycleTracker so
  health probes use the host-side path for devcontainer exec
- Wired lazy activation into DevcontainerHandler.resolve() for
  devcontainer-instance resources in non-running states
- Changed _default_strategy from SNAPSHOT to NONE (container
  itself provides isolation; SandboxFactory raises NotImplementedError
  for snapshot)
- Restricted _STOPPABLE_TYPES to devcontainer-instance only
  (container-instance is not directly stoppable via CLI)

ISSUES CLOSED: #514
2026-03-10 12:17:51 +00:00

81 lines
3.6 KiB
Plaintext

*** Settings ***
Documentation CONC3 - Cleanup commands integration smoke tests
Library OperatingSystem
Library Collections
Library String
Resource ${CURDIR}/common.resource
*** Variables ***
${SRC_DIR} ${CURDIR}/../src/cleveragents
*** Test Cases ***
Cleanup Service Module Exists
[Documentation] Verify cleanup service module is present
File Should Exist ${SRC_DIR}/application/services/cleanup_service.py
Cleanup CLI Module Exists
[Documentation] Verify cleanup CLI command module is present
File Should Exist ${SRC_DIR}/cli/commands/cleanup.py
Cleanup Service Exports Expected Symbols
[Documentation] Verify cleanup_service.py exports the public API
${content}= Get File ${SRC_DIR}/application/services/cleanup_service.py
Should Contain ${content} class CleanupService
Should Contain ${content} def scan
Should Contain ${content} def purge
# F26 fix: CleanupReport, StaleItem, ResourceCleanupSummary were
# extracted to cleanup_models.py (F8 fix). Verify definitions live
# there and that cleanup_service.py re-exports them via __all__.
Should Contain ${content} CleanupReport
Should Contain ${content} StaleItem
Should Contain ${content} ResourceCleanupSummary
Cleanup Models Defines Data Classes
[Documentation] Verify cleanup_models.py contains the extracted data classes
${models}= Get File ${SRC_DIR}/application/services/cleanup_models.py
Should Contain ${models} class CleanupReport
Should Contain ${models} class StaleItem
Should Contain ${models} class ResourceCleanupSummary
Cleanup CLI Has Scan Command
[Documentation] Verify cleanup CLI has scan subcommand
${content}= Get File ${SRC_DIR}/cli/commands/cleanup.py
Should Contain ${content} def scan
Should Contain ${content} dry-run
Cleanup CLI Has Purge Command
[Documentation] Verify cleanup CLI has purge subcommand
${content}= Get File ${SRC_DIR}/cli/commands/cleanup.py
Should Contain ${content} def purge
Should Contain ${content} --all
Should Contain ${content} --dry-run
Should Contain ${content} --yes
Cleanup CLI Has Status Command
[Documentation] Verify cleanup CLI has status subcommand
${content}= Get File ${SRC_DIR}/cli/commands/cleanup.py
Should Contain ${content} def status
Should Contain ${content} Retention Policies
Settings Has Retention Policy Fields
[Documentation] Verify settings includes cleanup config fields
${content}= Get File ${SRC_DIR}/config/settings.py
Should Contain ${content} cleanup_sandbox_max_age_hours
Should Contain ${content} cleanup_checkpoint_max_per_plan
Should Contain ${content} cleanup_session_inactivity_days
Should Contain ${content} cleanup_log_retention_days
Should Contain ${content} cleanup_backup_retention_days
Should Contain ${content} cleanup_schedule
Main CLI Registers Cleanup Command
[Documentation] Verify main.py registers the cleanup command group
${content}= Get File ${SRC_DIR}/cli/main.py
Should Contain ${content} cleanup
Should Contain ${content} Garbage collection
Cleanup Service Does Not Use Eval Or Exec
[Documentation] Security check: no eval/exec in cleanup service
${content}= Get File ${SRC_DIR}/application/services/cleanup_service.py
Should Not Contain ${content} eval(
Should Not Contain ${content} exec(