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
CI / tests (pull_request) Successful in 6m34s
This commit is contained in:
@@ -4,16 +4,15 @@ An entry point holds `starting` on `project_lock` while it lists the windows of
|
||||
"""
|
||||
import contextlib
|
||||
import fcntl
|
||||
from collections.abc import Mapping
|
||||
import pathlib
|
||||
import typing
|
||||
|
||||
from failure import Failure
|
||||
from transcript_archive.project_key import project_key
|
||||
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 project key holds LOCK.
|
||||
CLAIMS = f"{STATE_FOLDER}/loop-claude"
|
||||
# The file an entry point keeps locked with flock while it lists the windows of a project's chunks and starts new ones. Two loops whose chunks finish together then don't start a chunk twice, and do-epic, which holds the same lock, never starts a chunk in a checkout while build-release does.
|
||||
LOCK = "starting"
|
||||
# The flag that tells the entry point in a window its chunk, as `--chunk item-372` for build-release and `--chunk ABC-34 ABC-12` for do-epic. Nobody types it, so no panel picked it.
|
||||
@@ -47,9 +46,14 @@ def locked(file: pathlib.Path) -> typing.Iterator[Failure | None]:
|
||||
yield None
|
||||
|
||||
|
||||
def project_lock(root: str, home: pathlib.Path) -> pathlib.Path:
|
||||
def claims_folder(state: pathlib.Path) -> pathlib.Path:
|
||||
"""The folder, in the state folder, that holds a folder per project key for its LOCK."""
|
||||
return state / "claims"
|
||||
|
||||
|
||||
def project_lock(root: str, home: pathlib.Path, env: Mapping[str, str]) -> pathlib.Path:
|
||||
"""The folder of the LOCK that everything starting a chunk in the checkout root holds."""
|
||||
return home / CLAIMS / project_key(root, home)
|
||||
return claims_folder(state_folder(env, home)) / project_key(root, home)
|
||||
|
||||
|
||||
def loop_session(root: str, home: pathlib.Path) -> str:
|
||||
|
||||
Reference in New Issue
Block a user