Files
cleveragents-core/features/plan_preflight_guardrail_coverage_boost.feature
T
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

65 lines
3.6 KiB
Gherkin

Feature: Plan Preflight Guardrail — coverage boost for uncovered branches
As a developer
I want thorough test coverage of the plan preflight guardrail
So that all code paths are validated, including repr, format_report, and edge cases
# Target: lines 52-53 PreflightCheckResult.__repr__ for a passing result
Scenario: PreflightCheckResult repr shows PASS for a passing check
Given a passing PreflightCheckResult for action_schema_validation
When I get the repr of the check result
Then the repr should contain "PASS"
And the repr should contain "action_schema_validation"
# Target: lines 52-53 — PreflightCheckResult.__repr__ for a failing result
Scenario: PreflightCheckResult repr shows FAIL for a failing check
Given a failing PreflightCheckResult for actor_availability with message "missing roles"
When I get the repr of the check result
Then the repr should contain "FAIL"
And the repr should contain "missing roles"
# Target: lines 86-90 — PreflightReport.format_report with mixed results
Scenario: PreflightReport format_report renders a human-readable summary with mixed results
Given a PreflightReport with one passing and one failing check result
When I format the report
Then the formatted report should start with "Pre-flight Guardrail Report:"
And the formatted report should contain a PASS line
And the formatted report should contain a FAIL line
# Target: lines 86-90 — PreflightReport.format_report with all passing results
Scenario: PreflightReport format_report renders correctly when all checks pass
Given a PreflightReport with only passing check results
When I format the report
Then the formatted report should start with "Pre-flight Guardrail Report:"
And the formatted report should not contain "[FAIL]"
# Target: lines 166-169 — check_action_schema when action_name is None
Scenario: Action schema check fails when no action name is provided
Given a fresh plan preflight guardrail instance
When I check action schema with no action name
Then the action schema check should fail
And the action schema check message should contain "No action specified"
# Target: line 221 — check_skill_tool_existence with missing skills only
Scenario: Skill/tool existence check fails when skills are missing from registry
Given a fresh plan preflight guardrail instance
And a skill registry containing only "data-transform"
When I check skill/tool existence for skills "data-transform,missing-skill"
Then the skill tool check should fail
And the skill tool check message should contain "Missing skills"
And the skill tool check message should contain "missing-skill"
# Target: line 221 — both missing tools AND missing skills in the same call
Scenario: Skill/tool existence check reports both missing tools and missing skills
Given a fresh plan preflight guardrail instance
When I check skill/tool existence for tools "absent-tool" and skills "absent-skill" with empty registries
Then the skill tool check should fail
And the skill tool check message should contain "Missing tools"
And the skill tool check message should contain "Missing skills"
# Target: lines 166-169 via run_all_checks — action_name=None triggers rejection
Scenario: run_all_checks rejects when action_name is None
Given a fresh plan preflight guardrail instance with all registries populated but no action name
When I run all preflight checks with action_name as None
Then a preflight rejection should be raised for "action_schema_validation"
And the preflight rejection message should contain "No action specified"