From b6dc05de39538632c5f77bdeb76c98c97cb60069 Mon Sep 17 00:00:00 2001 From: cangen185-sudo <234582933+cangen185-sudo@users.noreply.github.com> Date: Wed, 28 Oct 2026 12:49:16 +0800 Subject: [PATCH] docs(file-io): clarify bounded-read safety guarantee --- reme/steps/file_io/_file_io.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/reme/steps/file_io/_file_io.py b/reme/steps/file_io/_file_io.py index 56c23dde..ee11e13b 100644 --- a/reme/steps/file_io/_file_io.py +++ b/reme/steps/file_io/_file_io.py @@ -111,8 +111,10 @@ async def read_file_safe( """Read file in byte mode and decode using extension-aware strategy. Returns ``(text, encoding)``. With ``require_complete``, reject files above - the byte limit or reads that do not reach EOF, so a caller cannot write back - truncated contents during a read-modify-write operation. + the byte limit or reads that leave unread bytes at the EOF check. This only + prevents returning a truncated bounded read for write-back; it does not + support oversized-file editing, provide a stable snapshot against concurrent + changes, or make subsequent writes atomic. """ stat = await aiofiles.os.stat(str(file_path)) if require_complete and stat.st_size > max_bytes: