forked from cleveragents/cleveragents-core
38e05ac45a
Implement the full correction-checkpoint rollback pipeline: - Workspace snapshots: CheckpointService.create_workspace_snapshot() creates diff-based checkpoints before decision execution, storing only changed file paths in metadata.extra["diff_paths"] - CorrectionService.revert_decisions(): new high-level entry point that creates a correction, computes impact, invokes checkpoint rollback, and archives artifacts in a single call - Physical artifact archival: CheckpointService.archive_artifacts() moves files to .cleveragents/archived_artifacts/ instead of just flagging metadata. CorrectionService._archive_decision_artifacts() delegates to this during revert execution - Selective rollback: CheckpointService.selective_rollback() wraps rollback_to_checkpoint with atomic semantics — captures HEAD before rollback and recovers on failure - Diff-based storage: _compute_diff_snapshot() computes changed paths between checkpoints via git diff; snapshots store diff manifest and SHA-256 hash in metadata - CLI: plan rollback now accepts --to-checkpoint <id> in addition to the positional checkpoint_id argument; uses selective_rollback for atomic execution - DI wiring: Container now injects checkpoint_service into CorrectionService; CLI correct command uses container-provided service instead of ad-hoc instance (fixes bug #986) - Checkpoint model: pre_decision added to allowed checkpoint_type values - TDD: Removed @tdd_expected_fail from wiring test feature since the DI bug is now fixed ISSUES CLOSED: #943
22 lines
1.1 KiB
Gherkin
22 lines
1.1 KiB
Gherkin
@tdd_issue @tdd_issue_986 @mock_only
|
|
Feature: TDD Issue #986 — CorrectionService missing checkpoint_service wiring in DI container
|
|
As a developer
|
|
I want to verify that CorrectionService receives checkpoint_service
|
|
from the DI container
|
|
So that revert-mode corrections can perform checkpoint rollback
|
|
|
|
Bug #986 (fixed in #943): The DI container now registers
|
|
CorrectionService with both checkpoint_service and event_bus.
|
|
The CLI correct command also uses the container-provided service
|
|
instead of creating an ad-hoc instance.
|
|
|
|
Scenario: DI container wires checkpoint_service into CorrectionService
|
|
Given tccw a fresh DI container with an in-memory database
|
|
When tccw I resolve the correction_service from the container
|
|
Then tccw the correction_service should have a non-None checkpoint_service
|
|
|
|
Scenario: Container-provided CorrectionService checkpoint_service is a CheckpointService instance
|
|
Given tccw a fresh DI container with an in-memory database
|
|
When tccw I resolve the correction_service from the container
|
|
Then tccw the checkpoint_service should be a CheckpointService instance
|