Files
cleveragents-core/features/resume_model_coverage_boost.feature
freemo a808c395f9
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 15s
CI / build (pull_request) Successful in 15s
CI / quality (pull_request) Successful in 17s
CI / typecheck (pull_request) Successful in 35s
CI / security (pull_request) Successful in 50s
CI / unit_tests (pull_request) Successful in 2m46s
CI / integration_tests (pull_request) Successful in 3m16s
CI / docker (pull_request) Successful in 40s
CI / coverage (pull_request) Successful in 5m6s
CI / lint (push) Successful in 13s
CI / quality (push) Successful in 16s
CI / build (push) Successful in 18s
CI / security (push) Successful in 32s
CI / typecheck (push) Successful in 35s
CI / benchmark-regression (push) Has been skipped
CI / unit_tests (push) Successful in 2m52s
CI / integration_tests (push) Successful in 3m8s
CI / docker (push) Successful in 39s
CI / coverage (push) Successful in 5m53s
CI / benchmark-publish (push) Successful in 16m55s
CI / benchmark-regression (pull_request) Successful in 33m0s
test(coverage): add Behave BDD tests to improve unit test coverage across 53 source modules
Add 53 new .feature files and corresponding step definition files targeting
uncovered lines identified in build/coverage.xml. Fix AmbiguousStep conflicts
in 7 pre-existing step files by disambiguating step text.

New tests cover: ACP clients/facade, actor CLI/config, application container,
ACMS service/strategies, async worker, automation profile CLI, autonomy
guardrail, bridge, change model, config CLI/service, context service,
cross-plan correction, database models, decision service, decomposition
clustering/service, discovery handler, langchain chat provider, langgraph
nodes, materializers, multi-project service, plan apply/CLI/lifecycle/model/
preflight/resume/service, PostgreSQL analyzer, project CLI/context CLI,
provider registry, reactive application/route, repositories, resolver handler,
resource registry service, resume model, retry patterns, sandbox protocol,
server CLI, skill CLI/service, skills registry, subplan execution/service,
system CLI, UKO loader, UoW, and YAML template engine.

Closes #645
2026-03-09 13:01:58 -04:00

70 lines
3.3 KiB
Gherkin

Feature: Resume model coverage boost
As a developer
I want full test coverage for the resume domain models
So that the record_checkpoint error path and as_cli_dict method are verified
# --- ResumeMetadata.record_checkpoint error path ---
Scenario: Recording a checkpoint with negative step_index raises ValueError
Given I have a ResumeMetadata instance with 5 total steps
When I record a checkpoint with step_index -1
Then a ValueError should be raised with message "Checkpoint step_index must be >= 0"
# --- ResumeSummary.as_cli_dict base case ---
Scenario: as_cli_dict returns base fields when no optional fields are set
Given I have a ResumeSummary with no optional fields
When I call as_cli_dict on the resume summary
Then the cli dict should have key "plan_id"
And the cli dict should have key "phase"
And the cli dict should have key "processing_state"
And the cli dict should have key "last_completed_step"
And the cli dict should have key "next_step_index"
And the cli dict should have key "total_steps"
And the cli dict should lack key "decision_id"
And the cli dict should lack key "last_checkpoint_id"
And the cli dict should lack key "sandbox_ref"
# --- ResumeSummary.as_cli_dict with decision_id ---
Scenario: as_cli_dict includes decision_id when set
Given I have a ResumeSummary with decision_id "DEC001"
When I call as_cli_dict on the resume summary
Then the cli dict value for "decision_id" should be "DEC001"
# --- ResumeSummary.as_cli_dict with last_checkpoint_id ---
Scenario: as_cli_dict includes last_checkpoint_id when set
Given I have a ResumeSummary with last_checkpoint_id "01JCHKPT0000000000000CHKPT"
When I call as_cli_dict on the resume summary
Then the cli dict value for "last_checkpoint_id" should be "01JCHKPT0000000000000CHKPT"
# --- ResumeSummary.as_cli_dict with sandbox_ref ---
Scenario: as_cli_dict includes sandbox_ref when set
Given I have a ResumeSummary with sandbox_ref "/tmp/sandbox-abc123"
When I call as_cli_dict on the resume summary
Then the cli dict value for "sandbox_ref" should be "/tmp/sandbox-abc123"
# --- ResumeSummary.as_cli_dict with all optional fields ---
Scenario: as_cli_dict includes all optional fields when all are set
Given I have a ResumeSummary with all optional fields set
When I call as_cli_dict on the resume summary
Then the cli dict should have key "decision_id"
And the cli dict should have key "last_checkpoint_id"
And the cli dict should have key "sandbox_ref"
And the cli dict should have exactly 9 keys
# --- ResumeSummary.as_cli_dict verifies correct base values ---
Scenario: as_cli_dict base field values match the model
Given I have a ResumeSummary with plan_id "01JABCDE1234567890ABCDEFGH" and phase "execute" and state "processing" and last_step 2 and next_step 3 and total 5
When I call as_cli_dict on the resume summary
Then the cli dict value for "plan_id" should be "01JABCDE1234567890ABCDEFGH"
And the cli dict value for "phase" should be "execute"
And the cli dict value for "processing_state" should be "processing"
And the cli dict integer for "last_completed_step" should be 2
And the cli dict integer for "next_step_index" should be 3
And the cli dict integer for "total_steps" should be 5