b2e923173f
CI / lint (pull_request) Successful in 18s
CI / typecheck (pull_request) Successful in 32s
CI / quality (pull_request) Successful in 19s
CI / security (pull_request) Successful in 33s
CI / benchmark-publish (pull_request) Has been skipped
CI / build (pull_request) Successful in 16s
CI / unit_tests (pull_request) Successful in 2m5s
CI / integration_tests (pull_request) Successful in 2m50s
CI / docker (pull_request) Successful in 15s
CI / coverage (pull_request) Successful in 4m19s
CI / lint (push) Successful in 12s
CI / quality (push) Successful in 18s
CI / security (push) Successful in 30s
CI / build (push) Successful in 22s
CI / typecheck (push) Successful in 58s
CI / benchmark-regression (push) Has been skipped
CI / unit_tests (push) Successful in 2m6s
CI / docker (push) Successful in 50s
CI / integration_tests (push) Successful in 3m21s
CI / coverage (push) Successful in 4m12s
CI / benchmark-publish (push) Has been cancelled
CI / benchmark-regression (pull_request) Successful in 24m46s
Consolidate 141 BDD feature files that each complete in under 0.1 seconds into 25 domain-grouped feature files, reducing subprocess count from 339 to ~223. Each consolidated file groups scenarios from the same domain/module that share step definitions and fixtures. All scenarios are preserved with clear comment headers indicating their original source file. This reduces subprocess overhead by ~116 invocations (141 original files replaced by 25 consolidated files), targeting the 42% of subprocess count that contributed only 0.2% of actual test runtime. ISSUES CLOSED: #485
239 lines
8.6 KiB
Gherkin
239 lines
8.6 KiB
Gherkin
Feature: Consolidated Context
|
|
Combined scenarios from: context_analysis_agent_coverage, context_manager_coverage, context_service_analysis, context_vector_search, project_context_policy
|
|
|
|
# ============================================================
|
|
# Originally from: context_analysis_agent_coverage.feature
|
|
# Feature: Context Analysis Agent Coverage
|
|
# ============================================================
|
|
|
|
# ============================================================
|
|
# Originally from: context_manager_coverage.feature
|
|
# Feature: Context manager coverage
|
|
# ============================================================
|
|
|
|
@coverage
|
|
Scenario: Load stored context JSON files
|
|
Given a context manager storage directory with valid JSON files
|
|
When I initialize the context manager from that directory
|
|
Then the stored context data should be loaded
|
|
|
|
|
|
@coverage
|
|
Scenario: Ignore invalid JSON files for context storage
|
|
Given a context manager storage directory with invalid JSON files
|
|
When I initialize the context manager from that directory
|
|
Then invalid context files should load as empty defaults
|
|
|
|
|
|
@coverage
|
|
Scenario: Use default home context path and delete
|
|
Given a temporary home directory for the context manager
|
|
When I initialize the context manager without a context directory
|
|
Then the context manager should use the default home context path
|
|
And deleting the context should remove the directory
|
|
|
|
|
|
@coverage
|
|
Scenario: Update state and metadata and report existence
|
|
Given a context manager for state and metadata updates
|
|
When I update state and metadata in the context manager
|
|
Then the context manager should return the updated values
|
|
And the context should report it exists on disk
|
|
|
|
|
|
@coverage
|
|
Scenario: Return last messages and clear context
|
|
Given a context manager with stored messages
|
|
When I request the last message and clear the context
|
|
Then the last message should be returned and the context reset
|
|
|
|
|
|
@coverage
|
|
Scenario: Export and import a context snapshot
|
|
Given a context manager with exportable data
|
|
When I export and import the context
|
|
Then the imported context should match the exported data
|
|
|
|
|
|
# ============================================================
|
|
# Originally from: context_service_analysis.feature
|
|
# Feature: Context Service Analysis Integration
|
|
# ============================================================
|
|
|
|
# ============================================================
|
|
# Originally from: context_vector_search.feature
|
|
# Feature: Context Vector Search
|
|
# ============================================================
|
|
|
|
# ============================================================
|
|
# Originally from: project_context_policy.feature
|
|
# Feature: Project Context Policy Domain Model
|
|
# ============================================================
|
|
|
|
Scenario: Empty policy defaults to including everything
|
|
When I create an empty project context policy
|
|
Then the default view should include all resources
|
|
And the default view should include all paths
|
|
And the default view should have no file size limit
|
|
And the default view should have no total size limit
|
|
|
|
# ---- View inheritance ----
|
|
|
|
|
|
Scenario: Strategize inherits from default when not overridden
|
|
Given a policy with only a default view
|
|
When I resolve the view for phase "strategize"
|
|
Then the resolved view should be the default view
|
|
|
|
|
|
Scenario: Execute inherits from strategize when not overridden
|
|
Given a policy with default and strategize views
|
|
When I resolve the view for phase "execute"
|
|
Then the resolved view should be the strategize view
|
|
|
|
|
|
Scenario: Apply inherits from execute when not overridden
|
|
Given a policy with default strategize and execute views
|
|
When I resolve the view for phase "apply"
|
|
Then the resolved view should be the execute view
|
|
|
|
|
|
Scenario: Execute inherits from default when strategize is None
|
|
Given a policy with only a default view
|
|
When I resolve the view for phase "execute"
|
|
Then the resolved view should be the default view
|
|
|
|
|
|
Scenario: Apply falls through to default when all overrides are None
|
|
Given a policy with only a default view
|
|
When I resolve the view for phase "apply"
|
|
Then the resolved view should be the default view
|
|
|
|
|
|
Scenario: Resolve default phase returns default view
|
|
Given a policy with only a default view
|
|
When I resolve the view for phase "default"
|
|
Then the resolved view should be the default view
|
|
|
|
# ---- Override isolation ----
|
|
|
|
|
|
Scenario: Override at execute level does not affect strategize
|
|
Given a policy with a custom execute view
|
|
When I resolve the view for phase "strategize"
|
|
Then the resolved view should be the default view
|
|
|
|
|
|
Scenario: Override at execute returns execute view
|
|
Given a policy with a custom execute view
|
|
When I resolve the view for phase "execute"
|
|
Then the resolved view should be the execute view
|
|
|
|
# ---- Invalid phase name ----
|
|
|
|
|
|
Scenario: Invalid phase name raises error
|
|
Given a policy with only a default view
|
|
When I try to resolve the view for phase "invalid_phase"
|
|
Then a context policy error should be raised
|
|
And the context policy error should mention "Invalid phase"
|
|
|
|
|
|
Scenario: Unknown phase name raises error
|
|
Given a policy with only a default view
|
|
When I try to resolve the view for phase "plan"
|
|
Then a context policy error should be raised
|
|
And the context policy error should mention "Invalid phase"
|
|
|
|
# ---- Include/exclude resource patterns ----
|
|
|
|
|
|
Scenario: Include resources filters correctly
|
|
When I create a context view with include resources "db-*,cache-*"
|
|
Then the context view should have 2 include resources
|
|
|
|
|
|
Scenario: Exclude resources filters correctly
|
|
When I create a context view with exclude resources "temp-*"
|
|
Then the context view should have 1 exclude resource
|
|
|
|
|
|
Scenario: Combined include and exclude resources
|
|
When I create a context view with include "db-*" and exclude "db-test"
|
|
Then the context view should have 1 include resource
|
|
And the context view should have 1 exclude resource
|
|
|
|
# ---- Include/exclude path globs ----
|
|
|
|
|
|
Scenario: Include paths accepts globs
|
|
When I create a context view with include paths "src/**/*.py,tests/**"
|
|
Then the context view should have 2 include paths
|
|
|
|
|
|
Scenario: Exclude paths accepts globs
|
|
When I create a context view with exclude paths "*.pyc,__pycache__/**"
|
|
Then the context view should have 2 exclude paths
|
|
|
|
# ---- Size limit validation ----
|
|
|
|
|
|
Scenario: Valid max file size is accepted
|
|
When I create a context view with max file size 1048576
|
|
Then the context view max file size should be 1048576
|
|
|
|
|
|
Scenario: None max file size means no limit
|
|
When I create a context view with no file size limit
|
|
Then the context view max file size should be None
|
|
|
|
|
|
Scenario: Zero max file size raises error
|
|
When I try to create a context view with max file size 0
|
|
Then a context policy error should be raised
|
|
And the context policy error should mention "positive integer"
|
|
|
|
|
|
Scenario: Negative max file size raises error
|
|
When I try to create a context view with max file size -100
|
|
Then a context policy error should be raised
|
|
And the context policy error should mention "positive integer"
|
|
|
|
|
|
Scenario: Valid max total size is accepted
|
|
When I create a context view with max total size 10485760
|
|
Then the context view max total size should be 10485760
|
|
|
|
|
|
Scenario: Zero max total size raises error
|
|
When I try to create a context view with max total size 0
|
|
Then a context policy error should be raised
|
|
And the context policy error should mention "positive integer"
|
|
|
|
|
|
Scenario: Negative max total size raises error
|
|
When I try to create a context view with max total size -50
|
|
Then a context policy error should be raised
|
|
And the context policy error should mention "positive integer"
|
|
|
|
# ---- Serialization round-trip ----
|
|
|
|
|
|
Scenario: Policy survives JSON round-trip
|
|
Given a fully populated context policy
|
|
When I serialize and deserialize the policy
|
|
Then the deserialized policy should match the original
|
|
|
|
# ---- ContextView model_dump ----
|
|
|
|
|
|
Scenario: ContextView model_dump has expected keys
|
|
When I create a context view with defaults
|
|
Then the context view dump should have key "include_resources"
|
|
And the context view dump should have key "exclude_resources"
|
|
And the context view dump should have key "include_paths"
|
|
And the context view dump should have key "exclude_paths"
|
|
And the context view dump should have key "max_file_size"
|
|
And the context view dump should have key "max_total_size"
|
|
|