diff --git a/.gitignore b/.gitignore index b64abf49..9f5b4fa9 100644 --- a/.gitignore +++ b/.gitignore @@ -56,6 +56,7 @@ !bin/deploy-release !bin/deploy_release/ !bin/deploy_release/*.py +!bin/do-epic !bin/do_epic/ !bin/do_epic/*.py !bin/do_epic/backend/ diff --git a/README.md b/README.md index 18650a5f..6c31b6f2 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,7 @@ Then pick a model with `/model`. Link `loop-claude` onto `PATH`: `ln -s ~/.claude/bin/loop-claude ~/.local/bin/loop-claude`. Every claude it starts, the interactive ones included, skips every permission prompt. loop-claude runs each chunk in its own window of a tmux session per project, so it needs tmux 3.2 or later. -Back up two folders: `~/.claude/loop-claude-transcripts`, where loop-claude keeps every transcript, and `~/.local/state/larv-review`, where larv-review keeps each chunk's reports. To keep them small, add a crontab line that gzips each transcript and review file 30 days after it last changed, and logs each run with its date: +Back up three folders: `~/.claude/loop-claude-transcripts`, where loop-claude keeps every transcript, `~/.claude/do-epic-transcripts`, where do-epic keeps its chunks', and `~/.local/state/larv-review`, where larv-review keeps each chunk's reports. To keep the first and the last small, add a crontab line that gzips each transcript and review file 30 days after it last changed, and logs each run with its date: ```sh 17 4 * * * { date; $HOME/.claude/bin/compress-archives; } >> $HOME/.local/state/compress-archives.log 2>&1 diff --git a/bin/do-epic b/bin/do-epic new file mode 100755 index 00000000..9f0a3e71 --- /dev/null +++ b/bin/do-epic @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 +import os +import pathlib +import sys + +LAUNCHER = pathlib.Path(__file__).resolve() +sys.path.insert(0, str(LAUNCHER.parent)) + +from loop_effects import effects +from do_epic import main +from loop_state import paths + +sys.exit(main.main(sys.argv[1:], os.environ, paths.paths_from(pathlib.Path.home()), LAUNCHER, effects.system_effects())) diff --git a/bin/do_epic/test_main.py b/bin/do_epic/test_main.py index bb46176f..e8e6de96 100644 --- a/bin/do_epic/test_main.py +++ b/bin/do_epic/test_main.py @@ -2,6 +2,7 @@ import contextlib import dataclasses import io import pathlib +import subprocess import sys import tempfile import unittest @@ -58,6 +59,15 @@ class DoEpicTest(unittest.TestCase): return code, out.getvalue(), err.getvalue() +class TheLauncher(unittest.TestCase): + def test_the_repo_ships_a_do_epic_that_prints_its_help(self) -> None: + launcher = pathlib.Path(__file__).resolve().parents[1] / "do-epic" + ran = subprocess.run([str(launcher), "--help"], capture_output=True, text=True, timeout=60) + self.assertEqual((ran.returncode, ran.stdout.split(" ", 2)[2]), (0, main.HELP + "\n")) + tracked = subprocess.run(["git", "ls-files", "--error-unmatch", launcher.name], capture_output=True, cwd=launcher.parent) + self.assertEqual(tracked.returncode, 0, "bin/do-epic is not in the repo; .gitignore lists what it keeps") + + class TheCommand(DoEpicTest): def test_prints_the_help_for_anything_but_one_epic_key(self) -> None: for argv, code in ((["--help"], 0), (["-h"], 0), ([], 1), (["abc"], 1), (["ABC-12", "ABC-13"], 1), (["--chunk", "x", "ABC-12"], 1), (["--chunk", "ABC-12"], 1)): diff --git a/bin/repo_checks/test_gitignore.py b/bin/repo_checks/test_gitignore.py index 3718c53e..546caf11 100644 --- a/bin/repo_checks/test_gitignore.py +++ b/bin/repo_checks/test_gitignore.py @@ -16,6 +16,7 @@ PRIVATE = [ "daemon.log", "daemon/control.key", "debug/a.txt", + "do-epic-transcripts/a/b.jsonl", "file-history/a/b.md", "history.jsonl", "jobs/a/b.json",