Skip to content

feat: add 'ln -sf' and 'truncate' to bash write-path extraction patterns #63

@George-iam

Description

@George-iam

The bash file extraction utility (src/utils/bash-file-extract.ts) detects file paths written by common bash commands (redirects, cp, mv, rm, touch, etc.). Two common write patterns are missing: ln -sf target link_path (creates/overwrites a symlink) and truncate -s 0 file (empties a file). Adding these patterns would improve the file-change tracking accuracy for sessions where agents use these commands.

Relevant files:

  • src/utils/bash-file-extract.ts — add new regex patterns to the WRITE_PATTERNS array
  • test/ — add corresponding test cases (can be in an existing or new test file)

Acceptance criteria:

  • extractBashWritePaths('ln -sf /usr/bin/node /usr/local/bin/node') returns ['/usr/local/bin/node']
  • extractBashWritePaths('truncate -s 0 /var/log/app.log') returns ['/var/log/app.log']
  • At least 4 new test cases covering these patterns (with flags, multiple args, etc.)
  • npm test passes

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions