fix: harden salvage of #65605 — redaction-gated test, sibling test baseline, docs
- test_file_staleness redacted-read case now force-enables redaction (matches tests/agent/test_redact.py convention) so it exercises the sentinel path in hermetic CI where security.redact_secrets is unset. - test_write_verification CRLF case establishes a read baseline first (the new guard refuses unread existing-file overwrites by design). - tools-reference.md documents the read-before-overwrite contract. - contributors/emails mapping for DanSpicyTaco.
This commit is contained in:
@@ -33,6 +33,10 @@ class TestWriteVerification:
|
||||
# still report verified.
|
||||
f = workdir / "win.txt"
|
||||
f.write_bytes(b"old line\r\n")
|
||||
# Establish a full-read baseline: write_file refuses to overwrite
|
||||
# existing files the task has never read (stale-write guard).
|
||||
from tools.file_tools import read_file_tool
|
||||
json.loads(read_file_tool(str(f), task_id="t-wv"))
|
||||
r = json.loads(write_file_tool(str(f), "new line\nsecond\n", task_id="t-wv"))
|
||||
assert "error" not in r
|
||||
assert r.get("verified") is True
|
||||
|
||||
@@ -115,7 +115,7 @@ Scoped to the Feishu document-comment handler. Drives comment read/write operati
|
||||
| `patch` | Targeted find-and-replace edits in files. Use this instead of sed/awk in terminal. Uses fuzzy matching (9 strategies) so minor whitespace/indentation differences won't break it. Returns a unified diff. Auto-runs syntax checks after editing… | — |
|
||||
| `read_file` | Read a text file with line numbers and pagination. Use this instead of cat/head/tail in terminal. Output format: 'LINE_NUM\|CONTENT'. Suggests similar filenames if not found. Use offset and limit for large files. Reads exceeding ~100K characters are truncated on a line boundary and return a next_offset. Jupyter notebooks (.ipynb), Word documents (.docx), and Excel workbooks (.xlsx) a… | — |
|
||||
| `search_files` | Search file contents or find files by name. Use this instead of grep/rg/find/ls in terminal. Ripgrep-backed, faster than shell equivalents. Content search (target='content'): Regex search inside files. Output modes: full matches with line… | — |
|
||||
| `write_file` | Write content to a file, completely replacing existing content. Use this instead of echo/cat heredoc in terminal. Creates parent directories automatically. OVERWRITES the entire file — use 'patch' for targeted edits. Auto-runs syntax checks on .py/.json/.yaml/.toml and other linted languages; only NEW errors introduced by the write are surfaced. | — |
|
||||
| `write_file` | Write content to a file, completely replacing existing content. Use this instead of echo/cat heredoc in terminal. Creates parent directories automatically. OVERWRITES the entire file — use 'patch' for targeted edits. For existing files in host-visible workspaces, the file must be read (full, unredacted) or written by the same task first: writes without a current baseline, and writes after an external on-disk modification, are refused before any disk mutation so a stale conversation copy can never clobber newer content. Auto-runs syntax checks on .py/.json/.yaml/.toml and other linted languages; only NEW errors introduced by the write are surfaced. | — |
|
||||
|
||||
## `homeassistant` toolset
|
||||
|
||||
|
||||
Reference in New Issue
Block a user