Skip to content

Commit 05bb79a

Browse files
committed
fixup! docs(privacy): say what auto-capture copies, tool by tool, in every project (#737, slice 4)
1 parent c79e53f commit 05bb79a

3 files changed

Lines changed: 24 additions & 9 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,9 @@ adheres to [Semantic Versioning](https://semver.org/).
139139

140140
- `PRIVACY.md` now says what the PostToolUse auto-capture copies, tool by tool:
141141
the response of Edit, Write, MultiEdit, NotebookEdit, Bash, WebFetch and
142-
WebSearch, the first 200 characters of a Bash command, only the path or pattern
143-
of Read, NotebookRead, Glob and Grep. It also says that this applies to every
142+
WebSearch, the first 200 characters of a Bash command, the path or pattern of
143+
Read, NotebookRead, Glob and Grep, and the full response of any tool once it
144+
exceeds 3000 characters (written to an artifact file). It also says that this applies to every
144145
project, that personal data is not redacted, and that an artifact can outlive a
145146
capture refused after hand-over (#737, slice 4). A test compares the tool lists
146147
and limits in that text with the hook's own constants.

‎PRIVACY.md‎

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,17 @@ To build and retrieve memory, Cortex reads and processes:
2323
is at least 50 characters long, plus the edited file's path or, for Bash, the
2424
first 200 characters of the command line. A pattern or name typed in a command
2525
is copied even when the command prints nothing useful.
26-
- Read, NotebookRead, Glob and Grep: the path, glob or search pattern only, not
27-
the file contents or the matches. A Grep pattern made of names copies those
28-
names.
26+
- Read, NotebookRead, Glob and Grep: the path, glob or search pattern in the
27+
memory row, not the file contents or the matches. A Grep pattern made of
28+
names copies those names. A response longer than 3000 characters is the
29+
exception: its full text is written to an artifact file (below), and the row
30+
points to it, so a long file you read is copied whole.
2931
- WebFetch and WebSearch: the response, when it is at least 50 characters long.
3032

31-
A response longer than 3000 characters is stored as a short gist in the memory
32-
row, and its full text goes to a file under `~/.claude/methodology/artifacts/`
33-
(one file per distinct content and month, shared by every memory that captured
34-
that content in that month). A
33+
For the other tools, a response longer than 3000 characters is stored as a
34+
short gist in the memory row. For every tool, its full text goes to a file
35+
under `~/.claude/methodology/artifacts/` (one file per distinct content and
36+
month, shared by every memory that captured that content in that month). A
3537
capture that never leaves the hook removes the file it created. A capture
3638
handed to the capture worker or spool and then refused there can still leave
3739
that file on disk with no memory pointing to it; no sweep removes such files

‎tests_py/hooks/test_capture_privacy_disclosure.py‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,3 +109,15 @@ def test_a_long_response_goes_to_an_artifact_and_the_row_keeps_a_gist(captured):
109109
assert files[0].read_text(encoding="utf-8") == response
110110
assert response not in captured[-1]
111111
assert str(files[0]) in captured[-1]
112+
113+
114+
def test_a_long_read_response_is_copied_whole_into_an_artifact(captured):
115+
assert "a long file you read is copied whole" in _paragraph()
116+
contents = "Alice Martin, 12 rue des Lilas, diabetic\n" * 120
117+
assert len(contents) > GIST_BUDGET
118+
hook.process_event(_event("Read", {"file_path": "/p/clients.csv"}, contents))
119+
files = list(artifact_store.ARTIFACTS_DIR.rglob("*.md"))
120+
assert len(files) == 1
121+
assert files[0].read_text(encoding="utf-8") == contents
122+
assert "Alice Martin" not in captured[-1]
123+
assert str(files[0]) in captured[-1]

0 commit comments

Comments
 (0)