Skip to content

feat: [tool.sdlc] project, for a repo whose Python is in a subdirectory - #15

Merged
fatherlinux merged 1 commit into
mainfrom
feature/1552-nested-project
Nov 4, 2026
Merged

fatherlinux merged 1 commit into
mainfrom
feature/1552-nested-project

Conversation

@fatherlinux

Copy link
Copy Markdown
Member

The launcher resolved every check against the mount root, so a repo holding its
Python project one directory down could not be gated at all. need_project
found the root pyproject.toml, uv sync ran where there was no lockfile, and
the gate exited 2 while the code it was meant to check sat untouched below.

project = "image-server" in the ROOT pyproject.toml moves the uv-driven
checks -- mypy, pytest, pip-audit and the sync they share -- into that
directory. Everything repo-wide stays at the root: the constitution validator,
Gourmand, Gatehouse, CodeQL, and ruff check ., whose config is hierarchical
and already applies a nested pyproject.toml to the files beneath it.

Design decisions worth stating:

  • The root pyproject, not an env var or a CI argument. The pre-commit hook,
    the pre-push hook and the CI job all read that file, and all three must agree
    on where the project is. Three entry points means three places to forget.
  • Validated when the config is read, not when a check runs: relative, inside
    the repo, and holding a pyproject.toml. sdlc_config() already calls into
    the whole config on every command, so a bad value fails on the next commit
    rather than in CI. Seven tests in tests/test_plan.py cover the refusals and
    the default.
  • The venv cache key includes the subdirectory. One repo can hold two
    projects, and gates.sh already recorded what happens when two projects share
    a UV_PROJECT_ENVIRONMENT: uv rebuilds the venv on every invocation, in both
    directions, forever.
  • A single string, not a list. No repo needs two projects yet, and a list is
    a later change if one does.
  • Default ".", so nothing changes for the 26 repos already converted.

run() gains a cwd parameter for this, defaulting to the repo root, and the
five uv call sites pass the project directory. Nothing else moved.

Prompted by crunchtools/rotv, the last repo in the RT#1552 conversion: a
Node.js project whose image-server/ is a deployed Python service with 19
modules, strict = true declared but never run, and six test files that no
workflow has ever executed. The alternative was promoting image-server's config
to the root, which the constitution's own version_files glob would then force
to share rotv's release version, or declaring rotv exempt and leaving that
service ungated. Neither is worth avoiding a six-line resolver.

RT#1552

🤖 Generated with Claude Code

https://claude.ai/code/session_01R7Y1jesjfgxHeqtKJCvay6

…tory

The launcher resolved every check against the mount root, so a repo holding its
Python project one directory down could not be gated at all. `need_project`
found the root pyproject.toml, `uv sync` ran where there was no lockfile, and
the gate exited 2 while the code it was meant to check sat untouched below.

`project = "image-server"` in the ROOT pyproject.toml moves the uv-driven
checks -- mypy, pytest, pip-audit and the sync they share -- into that
directory. Everything repo-wide stays at the root: the constitution validator,
Gourmand, Gatehouse, CodeQL, and `ruff check .`, whose config is hierarchical
and already applies a nested pyproject.toml to the files beneath it.

Design decisions worth stating:

- **The root pyproject, not an env var or a CI argument.** The pre-commit hook,
  the pre-push hook and the CI job all read that file, and all three must agree
  on where the project is. Three entry points means three places to forget.
- **Validated when the config is read**, not when a check runs: relative, inside
  the repo, and holding a pyproject.toml. `sdlc_config()` already calls into
  the whole config on every command, so a bad value fails on the next commit
  rather than in CI. Seven tests in tests/test_plan.py cover the refusals and
  the default.
- **The venv cache key includes the subdirectory.** One repo can hold two
  projects, and gates.sh already recorded what happens when two projects share
  a UV_PROJECT_ENVIRONMENT: uv rebuilds the venv on every invocation, in both
  directions, forever.
- **A single string, not a list.** No repo needs two projects yet, and a list is
  a later change if one does.
- **Default `"."`**, so nothing changes for the 26 repos already converted.

`run()` gains a `cwd` parameter for this, defaulting to the repo root, and the
five uv call sites pass the project directory. Nothing else moved.

Prompted by crunchtools/rotv, the last repo in the RT#1552 conversion: a
Node.js project whose `image-server/` is a deployed Python service with 19
modules, `strict = true` declared but never run, and six test files that no
workflow has ever executed. The alternative was promoting image-server's config
to the root, which the constitution's own `version_files` glob would then force
to share rotv's release version, or declaring rotv exempt and leaving that
service ungated. Neither is worth avoiding a six-line resolver.

RT#1552

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R7Y1jesjfgxHeqtKJCvay6

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gatehouse found no issues.

Full review.

4 finding(s) dropped: their evidence is not in the diff.

@fatherlinux
fatherlinux merged commit 9d5efc7 into main Nov 4, 2026
10 checks passed
@fatherlinux
fatherlinux deleted the feature/1552-nested-project branch November 4, 2026 23:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant