Answer architecture round 1: give the transcript archive one module that writes and reads it, anchor the finished line to its stamp, build Reads once, and record the scoring run

This commit is contained in:
2026-10-08 16:28:49 +02:00
parent 13d8b167a7
commit 471350d388
8 changed files with 70 additions and 22 deletions
+5 -4
View File
@@ -20,15 +20,16 @@ class Reads:
def shell_reads(command: str, cwd: str, home: str) -> Reads:
reads = Reads([], [])
read: list[str] = []
added: list[str] = []
base = cwd
for tokens in shell_lines(command):
for words in segments(tokens):
if words[0] == "cd" and len(words) == 2:
base = resolved(base, words[1], home)
reads.read.extend(resolved(base, word, home) for word in operands(words))
reads.added.extend(resolved(base, path, home) for path in worktree_added(words))
return reads
read += [resolved(base, word, home) for word in operands(words)]
added += [resolved(base, path, home) for path in worktree_added(words)]
return Reads(read, added)
def shell_lines(command: str) -> typing.Iterator[list[str]]: