Teknium
6d51c831eb
fix(file_tools): refuse plain-text writes that corrupt binary documents
...
Port from nearai/ironclaw#7109 : read_file auto-extracts .docx/.xlsx/.pptx
(and PDF via anydoc) to readable text, so a model plausibly believes it
holds the file's contents and writes the edited text back with
write_file/patch — silently destroying the document container. Proven
live on main: write_file over a valid .docx left a non-zip corpse, and a
text write over an existing .pdf clobbered the %PDF header.
- tools/binary_extensions.py: OPAQUE_DOCUMENT_EXTENSIONS +
has_opaque_document_extension() + is_pdf_path() (pure string checks)
- tools/file_tools.py: _check_binary_document_write() — opaque container
formats (doc/docx/xls/xlsx/ppt/pptx/odt/ods/odp) always rejected; .pdf
rejected only when overwriting an existing regular file (new-PDF
creation stays allowed, matching the upstream split guard). Wired into
write_file_tool and patch_tool (replace + V4A Update/Add headers;
Delete/Move skip the guard since they write no text).
- tests/tools/test_binary_document_write_guard.py: guard unit tests +
end-to-end write_file/patch coverage incl. bytes-untouched assertions.
2026-08-15 02:51:59 +05:30
..
2026-08-12 21:53:11 -07:00
2026-08-13 20:30:26 -07:00
2026-07-28 07:58:16 -07:00
2026-07-17 04:53:38 -07:00
2026-08-14 17:48:28 +05:30
2026-08-11 09:56:13 +10:00
2026-07-28 11:52:44 -07:00
2026-08-15 02:51:59 +05:30
2026-08-07 17:45:06 +05:30
2026-08-02 00:11:50 -07:00
2026-07-27 14:32:05 -07:00
2026-05-19 22:34:05 -07:00
2026-07-29 10:54:04 -07:00
2026-08-13 02:38:28 -07:00
2026-08-14 13:51:07 -07:00
2026-06-21 17:46:38 +05:30
2026-07-29 10:14:11 -07:00
2026-08-13 01:19:42 -05:00
2026-08-13 01:19:42 -05:00
2026-08-06 19:35:47 -06:00
2026-08-12 17:42:34 +05:30
2026-07-29 12:19:37 -07:00
2026-08-08 05:44:18 -07:00
2026-08-13 10:46:13 -07:00
2026-07-02 04:20:43 -07:00
2026-06-25 13:52:06 -07:00
2026-08-13 11:09:51 -07:00
2026-07-20 06:50:31 -07:00
2026-08-07 09:07:42 -07:00
2026-07-22 12:13:01 -05:00
2026-08-02 00:11:50 -07:00
2026-08-02 00:36:03 -07:00
2026-08-01 21:17:51 -04:00
2026-05-22 04:10:45 -07:00
2026-05-08 16:39:32 -07:00
2026-05-08 16:39:32 -07:00
2026-08-13 01:34:00 +05:30
2026-04-21 16:41:26 -07:00
2026-08-15 02:51:59 +05:30
2026-07-31 10:17:55 -04:00
2026-08-06 19:35:47 -06:00
2026-08-12 15:21:47 +05:30
2026-08-02 00:11:50 -07:00
2026-08-13 11:09:51 -07:00
2026-08-08 19:59:12 -04:00
2026-08-08 04:19:38 -07:00
2026-07-06 04:58:42 -07:00
2026-08-13 10:47:40 -07:00
2026-08-12 20:02:07 -07:00
2026-08-08 12:32:23 -07:00
2026-07-17 04:50:47 -07:00
2026-07-28 00:53:16 -05:00
2026-08-12 19:44:17 -07:00
2026-08-03 14:24:37 +05:30
2026-07-18 04:15:13 -07:00
2026-08-12 02:43:28 -07:00
2026-08-08 12:32:23 -07:00
2026-05-08 09:27:26 -07:00
2026-07-29 10:13:50 -07:00
2026-07-28 14:07:21 -07:00
2026-08-06 19:35:47 -06:00
2026-08-02 10:02:33 -07:00
2026-08-01 10:47:20 -07:00
2026-08-12 15:21:47 +05:30
2026-07-29 10:14:00 -07:00
2026-08-14 01:09:42 -07:00
2026-06-25 16:40:27 -05:00
2026-08-06 19:35:47 -06:00
2026-08-10 01:28:57 -07:00
2026-08-06 19:35:47 -06:00
2026-08-06 19:35:47 -06:00
2026-08-08 22:17:38 -05:00
2026-08-12 19:13:32 -07:00
2026-08-07 08:58:25 -07:00
2026-08-08 14:56:38 +05:30
2026-08-12 16:27:19 -07:00
2026-08-03 17:50:58 +05:30
2026-08-13 01:06:51 -05:00
2026-08-12 13:57:59 +05:30
2026-08-08 11:12:27 -07:00
2026-08-12 15:21:47 +05:30
2026-05-04 02:42:16 -07:00
2026-07-31 07:30:30 -07:00
2026-05-23 17:47:26 -07:00
2026-08-12 01:45:18 -07:00
2026-08-12 01:45:18 -07:00
2026-07-30 22:31:42 -07:00
2026-07-28 04:24:50 -05:00
2026-08-13 11:49:14 -07:00
2026-05-15 14:00:01 -07:00
2026-08-13 11:09:51 -07:00
2026-08-12 19:44:45 -07:00
2026-08-02 15:08:35 -07:00
2026-08-14 01:09:42 -07:00
2026-05-29 03:44:49 -07:00
2026-07-01 01:05:28 -07:00
2026-08-02 10:04:48 -07:00
2026-07-22 06:56:53 -07:00
2026-08-02 10:04:48 -07:00
2026-05-31 00:50:19 -07:00
2026-06-30 16:39:41 -07:00
2026-08-03 19:11:30 +05:30
2026-08-12 19:01:30 -07:00
2026-07-28 22:31:40 -07:00
2026-07-28 11:55:01 -07:00
2026-08-12 11:04:45 -07:00
2026-07-28 14:17:45 -07:00
2026-08-08 19:59:12 -04:00
2026-08-10 10:40:19 -07:00
2026-08-12 19:01:30 -07:00
2026-08-08 13:49:24 +05:30
2026-08-13 11:09:51 -07:00
2026-07-04 15:08:49 -07:00
2026-08-08 12:34:46 -07:00
2026-06-10 02:57:15 -07:00
2026-07-23 21:06:47 -07:00
2026-08-08 12:32:23 -07:00
2026-06-29 21:11:58 -07:00
2026-05-23 01:40:35 -07:00