Skip to content

Add save_text/read_text methods and fix open_file write-mode bugs#4

Merged
pastewka merged 2 commits intomainfrom
claude/check-generic-file-writing-qVd99
Apr 6, 2026
Merged

Add save_text/read_text methods and fix open_file write-mode bugs#4
pastewka merged 2 commits intomainfrom
claude/check-generic-file-writing-qVd99

Conversation

@pastewka
Copy link
Copy Markdown
Contributor

@pastewka pastewka commented Apr 6, 2026

  • Add save_text(filename, str, encoding) to StorageBackend protocol,
    LocalStorageBackend, S3StorageBackend, and TaskContext
  • Add read_text(filename, encoding) convenience to TaskContext
  • Guard open_file against write modes (w/a/x) in both backends with
    ValueError; previously Local silently bypassed all safety checks
    and S3 silently ignored writes entirely
  • Add tests: save_text round-trip, write-once, protected-file, encoding,
    written_files tracking, open_file write-mode rejection

https://claude.ai/code/session_0195vE8XNA52GbQqGBf4xNcL

claude added 2 commits April 6, 2026 05:39
- Add save_text(filename, str, encoding) to StorageBackend protocol,
  LocalStorageBackend, S3StorageBackend, and TaskContext
- Add read_text(filename, encoding) convenience to TaskContext
- Guard open_file against write modes (w/a/x) in both backends with
  ValueError; previously Local silently bypassed all safety checks
  and S3 silently ignored writes entirely
- Add tests: save_text round-trip, write-once, protected-file, encoding,
  written_files tracking, open_file write-mode rejection

https://claude.ai/code/session_0195vE8XNA52GbQqGBf4xNcL
CHANGELOG: document save_text/read_text addition and open_file write-mode
fix under v0.2.0 new features.

DESIGN.md:
- Remove historical/change-oriented language ("Early versions", "Before
  this change", "The original ... was") and restate each section in
  terms of the current design only
- Remove the "Future: Redis-based progress" section (speculative, not
  implemented)
- Add "File write methods" table under the file-communication section,
  documenting all four save_* methods and their OutputFile.file_type
  correspondence

https://claude.ai/code/session_0195vE8XNA52GbQqGBf4xNcL
@pastewka pastewka merged commit 328cf9b into main Apr 6, 2026
5 of 6 checks passed
@pastewka pastewka deleted the claude/check-generic-file-writing-qVd99 branch April 6, 2026 05:46
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.

2 participants