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
+11 -6
View File
@@ -15,11 +15,16 @@ from text_files.markdown_text import listed
from project_config.settings import PARALLEL_CHUNKS
from do_epic.parked import parked_chunks
from chunk_pr.approval import PARKS
from loop_state.paths import STATE_FOLDER
from loop_state.paths import state_folder
from agent_cycle import tmux
# Under the home folder, a folder per epic key holds the epic's lock file, which `claims.LOCK` names. A chunk without a repo works there.
STATE = f"{STATE_FOLDER}/do-epic"
# In the state folder, where a folder per epic key holds the epic's lock file, which `claims.LOCK` names. A chunk without a repo works there.
STATE = "do-epic"
def epic_folder(state: pathlib.Path, key: str) -> pathlib.Path:
"""The folder of the epic called key, in the state folder state."""
return state / STATE / key
# Why a human's task with a live window waits, as the epic's status says.
HUMAN_WAIT = "it is a human's task; do-epic polls Jira until you close it"
@@ -82,7 +87,7 @@ class Epic:
@property
def folder(self) -> pathlib.Path:
return self.home / STATE / self.key
return epic_folder(state_folder(self.env, self.home), self.key)
def unblocks(status: str, unblocking: tuple[str, ...]) -> bool:
@@ -228,7 +233,7 @@ def start_chunk(epic: Epic, chunk: Chunk, own: str | None, windows: list[tmux.Li
if isinstance(located, Failure):
return Waits(chunk.issue, located.reason)
checkout, limit = located
with starting(project_lock(str(checkout), epic.home)) as unlocked:
with starting(project_lock(str(checkout), epic.home, epic.env)) as unlocked:
if unlocked:
return unlocked
if reason := refusal(chunk.repo, room_in(str(checkout), limit, (session, own), epic.home, run)):
@@ -254,7 +259,7 @@ def resume(epic: Epic, repo: str, window: tmux.Window, run: tmux.Tmux) -> str |
if isinstance(located, Failure):
return located.reason
checkout, limit = located
with starting(project_lock(str(checkout), epic.home)) as unlocked:
with starting(project_lock(str(checkout), epic.home, epic.env)) as unlocked:
if unlocked:
return unlocked.reason
if reason := refusal(repo, room_in(str(checkout), limit, (window.session, window.name), epic.home, run)):