Keep configs in ~/.config/build-release/ and tool state in ~/.local/state/build-release/, under XDG_* where set
CI / tests (pull_request) Successful in 6m34s

This commit is contained in:
2026-12-03 18:56:28 +01:00
parent 20c83f861f
commit 1ca2c8efe0
142 changed files with 1095 additions and 933 deletions
+1 -1
View File
@@ -5,7 +5,7 @@
<archive root>/<project key>/<chunk>/session/...
<archive root>/<project key>/<chunk>/judge/<sha256>.json
- The archive root is $BUILD_RELEASE_TRANSCRIPTS, or ~/.claude/loop-claude-transcripts (location.archive_root).
- The archive root is $BUILD_RELEASE_TRANSCRIPTS, or ~/.local/state/build-release/transcripts (location.archive_root).
- The project key is the checkout's path relative to ~/code, or to / outside it (project_key.project_key).
- <chunk> is the hash of the transcript's first line with a timestamp (location.chunk_folder). It is the
same for every cycle of a chunk, and differs between chunks, since a finished chunk's session is deleted
+2 -2
View File
@@ -2,9 +2,9 @@ import hashlib
import pathlib
import typing
from loop_state.paths import CLAUDE_HOME
from claude_code.transcript import first_timestamped_line
from transcript_archive.project_key import project_key
from loop_state.paths import state_folder
# What an outcomes file's name ends with, in place of its transcript copy's .jsonl.
FILE_SUFFIX = ".outcomes.md"
@@ -12,7 +12,7 @@ FILE_SUFFIX = ".outcomes.md"
def archive_root(home: pathlib.Path, env: typing.Mapping[str, str]) -> pathlib.Path:
"""Where build-release archives every project's chunks."""
return pathlib.Path(env["BUILD_RELEASE_TRANSCRIPTS"]).expanduser() if env.get("BUILD_RELEASE_TRANSCRIPTS") else home / CLAUDE_HOME / "loop-claude-transcripts"
return pathlib.Path(env["BUILD_RELEASE_TRANSCRIPTS"]).expanduser() if env.get("BUILD_RELEASE_TRANSCRIPTS") else state_folder(env, home) / "transcripts"
def project_archive(checkout_root: str, home: pathlib.Path, env: typing.Mapping[str, str]) -> pathlib.Path:
@@ -262,7 +262,7 @@ class Location(unittest.TestCase):
self.assertEqual(project_key("/h/code/log", home), "log")
self.assertEqual(project_key("/h/code", home), "h/code")
self.assertEqual(project_key("/srv/log", home), "srv/log")
self.assertEqual(project_archive("/h/code/log", home, {}), pathlib.Path("/h/.claude/loop-claude-transcripts/log"))
self.assertEqual(project_archive("/h/code/log", home, {}), pathlib.Path("/h/.local/state/build-release/transcripts/log"))
self.assertEqual(project_archive("/h/code/log", home, {"BUILD_RELEASE_TRANSCRIPTS": "/a"}), pathlib.Path("/a/log"))
def test_finds_the_checkout_a_key_names_under_code_or_else_under_the_root(self):