Skip to content

fix: extractBashWritePaths rejects garbage paths#14

Merged
George-iam merged 3 commits intomainfrom
feat/bash-extract-fix-20260406
Apr 6, 2026
Merged

fix: extractBashWritePaths rejects garbage paths#14
George-iam merged 3 commits intomainfrom
feat/bash-extract-fix-20260406

Conversation

@George-iam
Copy link
Copy Markdown
Contributor

Summary

  • extractBashWritePaths was adding garbage paths to filesChanged: /, 1:, 0:
  • Root cause: redirect regex + segment split by [;&|]+ creates artifacts from 2>&1 patterns
  • Added isValidFilePath filter: rejects bare /, fd-redirect artifacts (0:, 1:, &1), paths not starting with valid prefixes
  • Added / to IGNORED_PATHS

Test plan

  • 11/11 new bash-extract tests (valid extractions + garbage rejection)
  • 119/119 full-storage regression

Add isValidFilePath filter: rejects bare /, fd-redirect artifacts
(0:, 1:, &1), and paths not starting with valid prefixes.
Root / added to IGNORED_PATHS.

Tests: 11/11 bash-extract, 119/119 full-storage.
Extends merged-PR check from git push only to also cover git commit
and git add. Prevents wasted work on stale branches that would require
cherry-pick to recover.

Refactored: extracted detectBranch and checkMergedBranch helpers from
the inline push check.

Tests: commit/add/push all BLOCKED on merged branch, allowed on open
branch, read-only git commands unaffected, 24/24 safety regression.
Tool description now explicitly states it is ONLY for questions that
require user decisions (architectural choices, ambiguous requirements).
Includes anti-example to prevent agents from logging bugs or TODOs
as open questions.
@George-iam George-iam merged commit afb3b4b into main Apr 6, 2026
@George-iam George-iam deleted the feat/bash-extract-fix-20260406 branch April 7, 2026 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant