Skip to content

feat(hashline): add file deletion operation to hashline_edit #325

@randomm

Description

@randomm

Problem

There is no mechanism to delete a file via hashline. With hashline as the sole file editing mechanism, agents cannot remove files during refactoring (e.g. deleting deprecated modules, cleaning up generated files).

Proposed Solution

Add a delete_file operation to hashline_edit:

{ "op": "delete_file" }
  • Requires a prior hashline_read (same enforcement as other ops)
  • Atomically deletes the file from disk
  • Clears the file's entry from FileTime state

Acceptance Criteria

  • hashline_edit with op: "delete_file" removes the file from disk
  • Operation is rejected if hashline_read was not called first
  • File deletion is reflected in FileTime state (subsequent edits correctly require a new read)
  • Attempting to delete a non-existent file returns a clear error
  • All existing hashline tests still pass
  • Adversarial review: APPROVED

Quality Gates

  • bun run typecheck — 0 errors
  • bun test — 0 failures

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions