test: harden code sandbox, add path traversal protection, and fix test mocks
CI / lint (pull_request) Failing after 3s
CI / typecheck (pull_request) Failing after 3s
CI / coverage (pull_request) Has been skipped
CI / quality (pull_request) Failing after 5s
CI / security (pull_request) Failing after 6s
CI / behave (3.11) (pull_request) Failing after 2s
CI / behave (3.12) (pull_request) Failing after 2s
CI / behave (3.13) (pull_request) Failing after 3s
CI / docker (pull_request) Has been skipped
CI / helm (pull_request) Has been skipped
CI / build (pull_request) Failing after 3s

This commit is contained in:
2026-02-12 01:07:44 +00:00
parent 0511261ebe
commit 761db2518c
12 changed files with 424 additions and 68 deletions
+40
View File
@@ -122,6 +122,46 @@ Feature: Plan edge case scenarios
When I apply the edge case changes
Then the deeply nested file should exist
# ──────────────────────────────────────────────────
# Section 2b: Path traversal rejection (H4)
# ──────────────────────────────────────────────────
Scenario: Apply CREATE change with relative path traversal is rejected
Given I have a temporary test directory for edge case plan service
And I have a Unit of Work instance for edge case plan testing
And I have an edge case PlanService instance
And I have a saved project with current plan for edge cases
And the plan has a CREATE change with a path traversal in file_path
When I try to apply the edge case changes
Then a PlanError should be raised mentioning path traversal
Scenario: Apply MODIFY change with absolute path outside project is rejected
Given I have a temporary test directory for edge case plan service
And I have a Unit of Work instance for edge case plan testing
And I have an edge case PlanService instance
And I have a saved project with current plan for edge cases
And the plan has a MODIFY change with an absolute path outside the project
When I try to apply the edge case changes
Then a PlanError should be raised mentioning path traversal
Scenario: Apply DELETE change with path traversal is rejected
Given I have a temporary test directory for edge case plan service
And I have a Unit of Work instance for edge case plan testing
And I have an edge case PlanService instance
And I have a saved project with current plan for edge cases
And the plan has a DELETE change with a path traversal in file_path
When I try to apply the edge case changes
Then a PlanError should be raised mentioning path traversal
Scenario: Apply MOVE change with path traversal in new_path is rejected
Given I have a temporary test directory for edge case plan service
And I have a Unit of Work instance for edge case plan testing
And I have an edge case PlanService instance
And I have a saved project with current plan for edge cases
And the plan has a MOVE change with a path traversal in new_path
When I try to apply the edge case changes
Then a PlanError should be raised mentioning path traversal
# ──────────────────────────────────────────────────
# Section 3: Validation failure chains
# ──────────────────────────────────────────────────