fix(6471): the end-of-turn shape check hears every definition a write made

The write hooks recorded at most 12 definitions per write (alphabetical,
so test functions were the ones dropped) and the post-Bash hook stopped
after 4 files, so the Stop hook never asked about the rest. The caps
bound the prior-art query; the written ledger now gets the full list,
up to 40 files per Bash call, while the query stays at 4 files x 12 names.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-26 16:26:15 -04:00
co-authored by Claude Opus 5.5
parent db2427a3dc
commit 83cb6420e2
4 changed files with 54 additions and 11 deletions
+13
View File
@@ -103,6 +103,19 @@ def test_an_edit_to_an_existing_file_adds_no_file_line(tmp_path):
assert lines == ["lib.py\tsym\thelper"]
def test_a_write_with_many_definitions_notes_every_one(tmp_path):
"""The ledger is not bounded by the twelve names the prior-art query sends:
a new test file with twenty functions is asked about in full."""
with http_sink(b'{"note_ids":[]}') as (port, _seen):
env = _env(tmp_path, f"http://127.0.0.1:{port}")
repo = _repo(tmp_path)
body = "".join(f"def test_case_{i:02d}():\n assert {i}\n\n" for i in range(20))
_pre_write(env, repo, "test_many.py", body)
lines = _ledger(tmp_path).read_text().splitlines()
assert len(lines) == 20
assert "test_many.py\tsym\ttest_case_19" in lines
def test_a_skipped_path_notes_nothing(tmp_path):
with http_sink(b'{"note_ids":[]}') as (port, _seen):
env = _env(tmp_path, f"http://127.0.0.1:{port}")