Answer stability round 1: 0 🔴, 6 🟡; name no rung without evidence, test the prompt's task, premises and records and the replay's edges, and name a copy and its outcomes file in one module
This commit is contained in:
@@ -5,6 +5,9 @@ import typing
|
||||
from claude_code.transcript import first_timestamped_line
|
||||
from project_key import project_key
|
||||
|
||||
# What an outcomes file's name ends with, in place of its transcript copy's .jsonl.
|
||||
FILE_SUFFIX = ".outcomes.md"
|
||||
|
||||
|
||||
def archive_root(home: pathlib.Path, env: typing.Mapping[str, str]) -> pathlib.Path:
|
||||
"""Where loop-claude archives every project's chunks."""
|
||||
@@ -18,3 +21,13 @@ def project_archive(checkout_root: str, home: pathlib.Path, env: typing.Mapping[
|
||||
def chunk_folder(project_archive: pathlib.Path, transcript: bytes) -> pathlib.Path:
|
||||
# Each chunk's first timestamped line is its own: a finished chunk's session is deleted, so the next chunk's transcript starts afresh.
|
||||
return project_archive / hashlib.sha256(first_timestamped_line(transcript)).hexdigest()
|
||||
|
||||
|
||||
def outcomes_of(copy: pathlib.Path) -> pathlib.Path:
|
||||
"""The outcomes file beside a transcript copy; transcript_of is its inverse."""
|
||||
return copy.with_suffix(FILE_SUFFIX)
|
||||
|
||||
|
||||
def transcript_of(outcomes: pathlib.Path) -> pathlib.Path:
|
||||
"""The transcript copy an outcomes file sits beside; outcomes_of is its inverse."""
|
||||
return outcomes.with_name(outcomes.name.removesuffix(FILE_SUFFIX) + ".jsonl")
|
||||
|
||||
Reference in New Issue
Block a user