5ee08ea946
CI / benchmark-regression (push) Has been skipped
CI / lint (push) Successful in 1m21s
CI / quality (push) Successful in 1m33s
CI / helm (push) Successful in 51s
CI / build (push) Successful in 1m12s
CI / push-validation (push) Successful in 50s
CI / security (push) Successful in 1m59s
CI / typecheck (push) Successful in 2m18s
CI / integration_tests (push) Successful in 4m51s
CI / e2e_tests (push) Successful in 5m1s
CI / unit_tests (push) Successful in 6m42s
CI / docker (push) Successful in 1m36s
CI / coverage (push) Successful in 13m8s
CI / status-check (push) Successful in 3s
CI / benchmark-publish (push) Successful in 1h25m1s
CI / benchmark-publish (pull_request) Has been skipped
CI / benchmark-regression (pull_request) Failing after 1m12s
CI / typecheck (pull_request) Successful in 1m36s
CI / docker (pull_request) Successful in 1m28s
CI / integration_tests (pull_request) Successful in 4m52s
CI / push-validation (pull_request) Successful in 20s
CI / quality (pull_request) Successful in 1m23s
CI / helm (pull_request) Successful in 36s
CI / build (pull_request) Successful in 58s
CI / lint (pull_request) Successful in 1m6s
CI / security (pull_request) Successful in 1m47s
CI / e2e_tests (pull_request) Successful in 4m21s
CI / unit_tests (pull_request) Successful in 5m51s
CI / coverage (pull_request) Successful in 12m1s
CI / status-check (pull_request) Successful in 4s
- Remove @tdd_expected_fail from Tree with json format scenario in plan_explain.feature (bug is now fixed by the envelope implementation) - Update scenario assertions to verify new spec-required envelope format instead of old bare-array format - Add step_tree_json_valid_envelope step definition in plan_explain_steps.py - Fix ruff format violation in plan_explain_cli_coverage_steps.py ISSUES CLOSED: #9163
172 lines
7.6 KiB
Gherkin
172 lines
7.6 KiB
Gherkin
Feature: Plan explain and decision tree CLI commands
|
|
Validates the plan explain and plan tree commands including
|
|
formatting, filtering, and flag-controlled detail views.
|
|
|
|
# ------------------------------------------------------------------
|
|
# plan explain - default format
|
|
# ------------------------------------------------------------------
|
|
|
|
Scenario: Explain a decision with default format
|
|
Given a test decision for explain
|
|
When I build the explain dict with default options
|
|
Then the explain dict should contain key "decision_id"
|
|
And the explain dict should contain key "question"
|
|
And the explain dict should contain key "chosen"
|
|
And the explain dict should contain key "type"
|
|
And the explain dict should contain key "alternatives_considered"
|
|
And the explain dict should not contain key "rationale"
|
|
And the explain dict should not contain key "context_snapshot"
|
|
|
|
# ------------------------------------------------------------------
|
|
# plan explain - show-context
|
|
# ------------------------------------------------------------------
|
|
|
|
Scenario: Explain with show-context flag
|
|
Given a test decision with context snapshot for explain
|
|
When I build the explain dict with show-context enabled
|
|
Then the explain dict should contain key "context_snapshot"
|
|
And the context snapshot should contain key "hot_context_hash"
|
|
And the context snapshot should contain key "relevant_resources"
|
|
|
|
# ------------------------------------------------------------------
|
|
# plan explain - show-reasoning
|
|
# ------------------------------------------------------------------
|
|
|
|
Scenario: Explain with show-reasoning flag
|
|
Given a test decision with reasoning for explain
|
|
When I build the explain dict with show-reasoning enabled
|
|
Then the explain dict should contain key "rationale"
|
|
And the explain dict should contain key "actor_reasoning"
|
|
|
|
# ------------------------------------------------------------------
|
|
# plan explain - alternatives always included
|
|
# ------------------------------------------------------------------
|
|
|
|
Scenario: Explain includes alternatives by default
|
|
Given a test decision with alternatives for explain
|
|
When I build the explain dict with default options
|
|
Then the explain dict should contain key "alternatives_considered"
|
|
And the alternatives list should have 2 items
|
|
|
|
# ------------------------------------------------------------------
|
|
# plan explain - json format
|
|
# ------------------------------------------------------------------
|
|
|
|
Scenario: Explain with json format
|
|
Given a test decision for explain
|
|
When I format the explain dict as json
|
|
Then the json output should contain "decision_id"
|
|
And the plan explain json output should be valid
|
|
|
|
# ------------------------------------------------------------------
|
|
# plan explain - yaml format
|
|
# ------------------------------------------------------------------
|
|
|
|
Scenario: Explain with yaml format
|
|
Given a test decision for explain
|
|
When I format the explain dict as yaml
|
|
Then the yaml output should contain "decision_id"
|
|
|
|
# ------------------------------------------------------------------
|
|
# plan explain - non-existent decision
|
|
# ------------------------------------------------------------------
|
|
|
|
Scenario: Explain for non-existent decision returns error marker
|
|
Given a non-existent decision id
|
|
Then the explain lookup should indicate not found
|
|
|
|
# ------------------------------------------------------------------
|
|
# plan tree - default format
|
|
# ------------------------------------------------------------------
|
|
|
|
Scenario: Tree with default format builds tree structure
|
|
Given a set of test decisions forming a tree
|
|
When I build the decision tree with default options
|
|
Then the tree should have at least 1 root node
|
|
And the first root node should have children
|
|
|
|
# ------------------------------------------------------------------
|
|
# plan tree - show-superseded
|
|
# ------------------------------------------------------------------
|
|
|
|
Scenario: Tree with show-superseded includes superseded decisions
|
|
Given a set of test decisions with superseded entries
|
|
When I build the decision tree with show-superseded enabled
|
|
Then the tree should include superseded decision nodes
|
|
|
|
# ------------------------------------------------------------------
|
|
# plan tree - depth limit
|
|
# ------------------------------------------------------------------
|
|
|
|
Scenario: Tree with depth limit restricts tree depth
|
|
Given a set of test decisions forming a deep tree
|
|
When I build the decision tree with depth 1
|
|
Then the root nodes should have no children
|
|
|
|
# ------------------------------------------------------------------
|
|
# plan tree - json format
|
|
# ------------------------------------------------------------------
|
|
|
|
@tdd_issue @tdd_issue_4254
|
|
Scenario: Tree with json format
|
|
Given a set of test decisions forming a tree
|
|
When I format the tree as json
|
|
Then the json tree output should be a valid json envelope
|
|
And the json tree output should contain "command"
|
|
|
|
# ------------------------------------------------------------------
|
|
# plan tree - yaml format
|
|
# ------------------------------------------------------------------
|
|
|
|
Scenario: Tree with yaml format
|
|
Given a set of test decisions forming a tree
|
|
When I format the tree as yaml
|
|
Then the yaml tree output should contain "decision_id"
|
|
|
|
# ------------------------------------------------------------------
|
|
# plan tree - no decisions
|
|
# ------------------------------------------------------------------
|
|
|
|
Scenario: Tree for plan with no decisions
|
|
Given an empty list of decisions
|
|
When I build the decision tree with default options from empty list
|
|
Then the tree should be empty
|
|
|
|
# ------------------------------------------------------------------
|
|
# plan tree - filters superseded by default
|
|
# ------------------------------------------------------------------
|
|
|
|
Scenario: Tree filters out superseded decisions by default
|
|
Given a set of test decisions with superseded entries
|
|
When I build the decision tree with default options
|
|
Then the tree should not include superseded decision nodes
|
|
|
|
# ------------------------------------------------------------------
|
|
# plan tree - per-type ordinals in decision labels
|
|
# ------------------------------------------------------------------
|
|
|
|
Scenario: Decision labels use per-type ordinals
|
|
Given a set of test decisions with multiple types for ordinal testing
|
|
When I generate decision labels with per-type ordinals
|
|
Then the first invariant should be labeled "Invariant 1"
|
|
And the second invariant should be labeled "Invariant 2"
|
|
And the first strategy should be labeled "Strategy"
|
|
And the first parallel should be labeled "Parallel 1"
|
|
|
|
Scenario: Decision labels restart counting per decision type
|
|
Given a set of test decisions with mixed types
|
|
When I generate decision labels with per-type ordinals
|
|
Then each decision type should start counting from 1
|
|
And invariants should have sequential numbers
|
|
And parallel spawns should have sequential numbers
|
|
And spawn decisions should have sequential numbers
|
|
|
|
Scenario: Full tree output includes per-type ordinal labels
|
|
Given a set of test decisions forming a tree with multiple types
|
|
When I build the plain format tree output with decision labels
|
|
Then the decision tree output should contain "Invariant 1"
|
|
And the decision tree output should contain "Invariant 2"
|
|
And the decision tree output should contain "Strategy"
|
|
And the decision tree output should not contain "Invariant 6"
|
|
And the decision tree output should not contain "Strategy 7"
|