TDD: file_write tool accepts a path containing embedded markup/control characters and fails late with a raw OS error instead of rejecting it up front #176
Labels
No labels
auto/blocked-by-deps
auto/ci-timeout
auto/claimed-implementer
auto/claimed-merge
auto/claimed-reviewer
auto/driver-down
auto/invariant-violation
auto/last-attempt-tier-0
auto/last-attempt-tier-1
auto/last-attempt-tier-2
auto/last-attempt-tier-min
Automation Tracking
auto/needs-conflict-resolution
auto/needs-implementer
auto/postmortem
auto/ready-to-merge
auto/restart-throttled
auto/revert
auto/sentinel
auto/stale-inactivity
auto/unstable
Blocked
Bounty
$100
Bounty
$1000
Bounty
$10000
Bounty
$20
Bounty
$2000
Bounty
$250
Bounty
$50
Bounty
$500
Bounty
$5000
Bounty
$750
MoSCoW
Could have
MoSCoW
Must have
MoSCoW
Should have
Needs Feedback
Points
1
Points
13
Points
2
Points
21
Points
3
Points
34
Points
5
Points
55
Points
8
Points
88
Priority
Backlog
Priority
CI Blocker
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Signed-off: Owner
Signed-off: Scrum Master
Signed-off: Tech Lead
Spike
State
Completed
State
Duplicate
State
In Progress
State
In Review
State
Paused
State
Unverified
State
Verified
State
Wont Do
Type
Automation
Type
Bug
Type
Discussion
Type
Documentation
Type
Epic
Type
Feature
Type
Legendary
Type
Refactor
Type
Support
Type
Task
Type
Testing
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Blocks
Depends on
#178 test(agents): capture file_write accepting a malformed path bug (#175)
cleveragents/cleveractors-core
Reference
cleveragents/cleveractors-core#176
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Metadata
Commit Message:
test(agents): capture file_write accepting a malformed path bug (#175)Branch: tdd/m1-file-write-path-validation
Background and context
Companion TDD issue for bug #175 (
_file_write_tool/_validate_file_path_safetyaccepts afileargument containing embedded markup/control characters and only fails late, with a raw OS error, insideFileAccessCore.write()). Per the project's mandatory Bug Fix TDD Workflow, a failing test proving the bug exists must be written and merged to master BEFORE the fix is implemented.Current behavior
No automated test exists that proves
ToolAgent._file_write_tool/_validate_file_path_safetylets afileargument containing illegal/markup characters (e.g.file\" <span class=\"editor-tab\" data-tab=\"file\">some/path.v) through validation unrejected, and that the failure only surfaces later as a rawOSError/[Errno 2]from the underlying filesystem call rather than a clear, earlyExecutionError. See #175 for full root-cause analysis and captured evidence.Expected behavior
A Behave scenario demonstrates the bug: calling the
file_writetool (inunsafemode, so validation reaches the path-safety check rather than stopping earlier) with afileargument containing an embedded markup fragment results in the call proceeding to the underlying OS write attempt and failing with a rawOSError-derived message, instead of being rejected up front by_validate_file_path_safetywith a descriptiveExecutionError. Do not restrict yourself to embedded markup, also consider other invalid formatted paths, i.e. paths that cannot be handled in any meaningful way based on current code logic. The assertion fails while the bug is present, and the scenario is tagged@tdd_expected_failso it passes CI via inversion until the real fix (#175) lands.Acceptance criteria
@tdd_issue @tdd_issue_175 @tdd_expected_failexists infeatures/(new or extended step file).assert/raise AssertionErroronly (per project TDD rules) and asserts that_file_write_toolrejects the malformed path with a descriptiveExecutionErrorbefore any filesystem call occurs (i.e. no attempt is made to open/write the real OS path).@tdd_expected_failinversion.nox -s unit_testsis green; coverage unaffected or improved.features/mocks/; no real network/LLM calls -- the tool call args are constructed directly in the test.Supporting information
Subtasks
@tdd_issue @tdd_issue_175 @tdd_expected_fail._file_write_tool/_validate_file_path_safetydirectly (or via theToolAgenttool-dispatch surface) with a path containing embedded markup, in an isolated temp directory so no real production files are touched. Do not restrict yourself to embedded markup, also consider other invalid formatted paths, i.e. paths that cannot be handled in any meaningful way based on current code logic.fileat a path whose parent directory does not exist, so an unvalidated attempt would raise[Errno 2], and asserting the raised error is the validation error rather than the rawOSError). Do not restrict yourself to embedded markup, also consider other invalid formatted paths, i.e. paths that cannot be handled in any meaningful way based on current code logic. You should validate that the path is sound with respect to the code logic accepted formats.@tdd_expected_failinversion.nox -s unit_tests,nox -s lint, andnox -s typecheckon the new files, fix any errors.Definition of Done
This issue is complete when: