Repository navigation
Description
For Scott
What: on a Fedora laptop the constitution check in sdlc push never runs — it reports the validator as missing and the push is refused, with no way to get past it except editing the cache by hand.
Why it matters: it blocks every push in every Python repo whose constitution pin is newer than the warm cache on that machine. It cost about forty minutes today on the first repo of RT #1601 and would have cost that again on each of the sixteen behind it. The failure message blames the constitution repo, so the time goes into looking in the wrong place.
Recommendation: one line in bin/sdlc — mount the resolved path instead of the symlink. Size S.
Needs from you: nothing.
Where it fits
Feature or program: standalone, owns the host-side constitution mount added in 0.6.0. Related: RT #1601, where it surfaced; claude-agent#9 is the gateway-proxy problem that introduced the host-side clone in the first place.
Why now: it can wait only as long as nobody bumps a constitution pin. RT #1601 moves seventeen repos to v1.36.0, so in practice it is live now; I have worked around it locally with chcon so that sweep can proceed.
For the agent
Problem: host_constitution() in bin/sdlc clones into mktemp -d "$_root/.$_tag.XXXXXX" and publishes it with ln -sn, then mounts the symlink:
CONSTITUTION_MOUNT="$_dir:/cache/constitution/$_tag:ro,z"
z relabels the path it is given. For a symlink that is lsetfilecon on the link itself, so the clone directory keeps its original cache_home_t label and the container cannot read it. Measured on Fedora 45, rootless podman, python-sdlc 0.6.0:
$ ls -Zd ~/.cache/python-sdlc/constitution/.v1.36.0.lXXQK3
unconfined_u:object_r:cache_home_t:s0 .v1.36.0.lXXQK3
$ podman run --rm -v "$HOME/.cache/python-sdlc/constitution/v1.36.0:/cache/constitution/v1.36.0:ro,z" \
--entrypoint bash quay.io/crunchtools/python-sdlc:0.6.0 -c 'ls /cache/constitution/v1.36.0'
ls: cannot open directory '/cache/constitution/v1.36.0': Permission denied
$ podman run --rm --security-opt label=disable -v "...:ro" ... -c 'ls ...'
CHANGELOG.md LICENSE README.md constitution.md examples ... validate-constitution.py
chcon -R -t container_file_t on the clone directory makes the same :ro,z mount readable, which confirms the label and rules out the directory mode (0700 from mktemp -d — I raised it to 0755 first and it changed nothing).
What the user sees is misleading in a specific way. sdlc-validate tests (checkout / ".git").is_dir(), which succeeds — test -d only needs to traverse — and then required.exists() on validate-constitution.py fails, so it dies with:
GATE CANNOT RUN: the constitution checkout at v1.36.0 is missing validate-constitution.py; its checks would silently do nothing
That reads as a problem in crunchtools/constitution at that tag. It is not: the tag is complete, and git ls-tree v1.36.0 shows the file. I cleared the host cache, cleared the empty mountpoint inside the crunchtools-hook-cache volume, re-cloned and re-pushed four times before measuring the label.
git push then exits 1 with only error: failed to push some refs; the hook's own Failed line scrolls past under ~90 lines of green check output, so the cause is invisible without GIT_TRACE=1.
Files: bin/sdlc, host_constitution() (the CONSTITUTION_MOUNT= line); /usr/local/bin/sdlc-validate in the image for the message.
Proposed fix:
- Mount the resolved directory, not the symlink:
CONSTITUTION_MOUNT="$(readlink -f "$_dir"):/cache/constitution/$_tag:ro,z". Thenzrelabels the clone itself. (chconafter the clone also works and is worse: it needs the tool on the host and leaves the symlink case still wrong for anyone who mounts it another way.) - Have
sdlc-validatesay which of the two it found, so a label problem cannot read as a missing file: a directory it cannot list and a directory missing a file are different sentences.os.listdirfailing withPermissionErroris the signal. - Test: assert the published mount source resolves to a real directory rather than a symlink. A test that mounts and lists needs podman and SELinux, so the cheap one is on the string the launcher builds.
Done when: a push in a repo pinned to a constitution tag that is not yet in the host cache runs the constitution check and reports its verdict, on a Fedora host with SELinux enforcing and no manual chcon; and the "missing" message is no longer reachable by a permission error.
Out of scope: the in-container clone fallback and the gateway proxy route (claude-agent#9), the empty mountpoint directories podman leaves in the cache volume (harmless), and whether the cache should be a volume at all.
Activity