Answer prose round 1: 0 🔴, 7 🟡 (0 misread); make the entry kinds' docstrings match the code, untangle after_mark and checked, and rename three tests to what they check

This commit was merged in pull request #441.
This commit is contained in:
2026-11-09 00:52:37 +01:00
parent 7a5df16882
commit 09159d7158
6 changed files with 13 additions and 14 deletions
+1 -1
View File
@@ -33,7 +33,7 @@ class Spent(typing.NamedTuple):
def messages(entries: list[Entry]) -> list[Message]:
"""The assistant messages, counted once each, each with the tools whose results it took in, or `prompt` where it took none in."""
# Claude Code writes one entry per content block of a message, each with the message's usage. The usage is the same in every entry (none of 1,681 multi-entry messages in the archive of 2026-10-28 differed), so the first is kept, where reading_cost's tokens_in keeps the last.
# A message's usage is the same in each of its entries (none of 1,681 multi-entry messages in the archive of 2026-10-28 differed), so the first is kept, where reading_cost's tokens_in keeps the last.
kept: dict[str, tuple[AssistantTurn, list[str]]] = {}
for entry in entries:
if isinstance(entry, AssistantTurn):