Answer round 1: check the model against the ladder, keep faults together, fix prose
CI / tests (pull_request) Successful in 2m36s

This commit is contained in:
2026-11-18 10:28:39 +01:00
parent b34d1087ca
commit b93d3799c3
5 changed files with 43 additions and 22 deletions
+3 -2
View File
@@ -6,6 +6,9 @@ Run inside a checkout, or a worktree of one. It finds the config that names the
~/.claude-projects/<key>/config.toml, and prints each setting and its absolute path, as in
`plan: /home/me/code/acme/todo.md`. Given a setting, it prints only that setting's path.
`~/.claude-projects/do-epic/` holds do-epic's machine-wide settings, not a project's. It needs no `checkout`,
and project-config doesn't read anything from it, so no project may use `do-epic` as its key.
The config is TOML. `checkout` names the project's main checkout, and every setting in the example below is a path:
"checkout:<path>" inside the checkout, "folder:<path>" inside the config's own folder, or one that
starts with / or ~/. In a worktree, a "checkout:" path is the worktree's own file.
@@ -128,8 +131,6 @@ Jira project's key before {id}, as here for the key ABC:
The chunk for the issue ABC-123 is then on the branch ABC-123, in the worktree <checkout>-ABC-123,
and its commits and pull request are titled "ABC-123 - …".
`~/.claude-projects/do-epic/` holds do-epic's machine-wide settings, not a project's, so no project may use `do-epic` as its key and project-config reads nothing from that folder.
Exit 1, naming each fault on stderr, where no config names the checkout, or its config leaves out a
setting, names an unknown one, misspells a path, a language or a template, sets `wait-for-approval` or
`tooling-on-host` to anything but true or false, sets `notifier` to anything but mattermost or slack or
+6 -6
View File
@@ -17,7 +17,7 @@ from plan.ranking import variables
PROJECTS = ".claude-projects"
CONFIG = "config.toml"
# The folder of do-epic's machine-wide settings, which names no checkout. No project may use it as its key.
# The key of do-epic's machine-wide settings: the folder's config.toml has no `checkout`, so no project may use the key.
DO_EPIC = "do-epic"
# A Jira Cloud or Confluence Cloud site's address: only https, so the credentials are never sent in the clear.
SITE = r"https://[A-Za-z0-9.-]+(?::[0-9]+)?"
@@ -294,13 +294,13 @@ def name_of(value: object) -> str | None:
def epic_of(value: object) -> Epic | None:
"""The epic a setting's value spells; None where it spells none. Only https, so the credentials are never sent in the clear."""
"""The epic a setting's value spells; None where it spells none."""
spelt = isinstance(value, str) and re.fullmatch(rf"{JIRA}({SITE})/browse/([A-Z][A-Z0-9_]*-[0-9]+)", value)
return Epic(spelt.group(1), spelt.group(2)) if spelt else None
def page_of(value: object) -> Page | None:
"""The page a setting's value spells; None where it spells none. Only https, as for an epic."""
"""The page a setting's value spells; None where it spells none."""
spelt = isinstance(value, str) and re.fullmatch(rf"{CONFLUENCE}({SITE})/wiki/spaces/[^/?#]+/pages/([0-9]+)(?:/[^/?#]*)?", value)
return Page(spelt.group(1), spelt.group(2), spelt.string) if spelt else None
@@ -351,18 +351,18 @@ def held(folder: pathlib.Path, home: pathlib.Path) -> ProjectConfig | Failure |
def configs(home: pathlib.Path) -> list[pathlib.Path]:
"""Every project's config file under home, in key order. do-epic's is no project's."""
"""Every project's config file under home, in key order. do-epic's machine-wide config is not a project's."""
return sorted(file for file in (home / PROJECTS).glob(f"*/{CONFIG}") if file.parent.name != DO_EPIC)
def env_files(home: pathlib.Path) -> list[pathlib.Path]:
"""Every config's env-file, do-epic's included, read without the checks load makes, so a config that fails them still keeps its credentials guarded; a config that cannot be read names none."""
"""Every config's env-file, do-epic's included. Each is read without the checks load makes, so a config that fails them still keeps its credentials guarded. A config that can't be read doesn't name one."""
values = [parsed(file) for file in (*configs(home), home / PROJECTS / DO_EPIC / CONFIG)]
return [path for found in values if not isinstance(found, Failure) and (path := anywhere(found.get(ENV_FILE), home))]
def parsed(file: pathlib.Path) -> dict[str, object] | Failure:
"""The TOML values file holds."""
"""The TOML values in file; a Failure where file can't be read or parsed."""
try:
return tomllib.loads(file.read_text(encoding="utf-8"))
except (OSError, UnicodeDecodeError, tomllib.TOMLDecodeError) as failure: