Skip to content

fix: mount the constitution checkout, not the link to it - #42

Merged
fatherlinux merged 1 commit into
mainfrom
fix/constitution-mount-resolve
Nov 11, 2026
Merged

fatherlinux merged 1 commit into
mainfrom
fix/constitution-mount-resolve

Conversation

@fatherlinux

Copy link
Copy Markdown
Member

Summary

  • host_constitution mounted the ln -sn link to the host's constitution checkout. Podman's z relabels the path it's given, so it relabelled the link, and the checkout kept cache_home_t. On an SELinux-enforcing host, every cold tag made the gate report missing validate-constitution.py and exit "could not run".
  • It now mounts the resolved directory (cd -P && pwd, POSIX, no new host tool).
  • tests/test_host_contract.sh asserts that the mount source is a real directory and not a symlink. Verified that it FAILS against the old launcher and passes with this change.

Reproduced on Fedora 44 while converting mcp-atlassian (RT#1552): a cold ~/.cache/python-sdlc/constitution, then sdlc constitution, gave "could not run". ls -Z showed the link at container_file_t and the checkout at cache_home_t.

The local Gatehouse hook was skipped because this seat has no Gatehouse key. CI's Gatehouse reviews it.

Test plan

  • sh tests/test_host_contract.sh, which passes, including the new check
  • The same test against the old bin/sdlc fails on the new check
  • CI green

🤖 Generated with Claude Code

https://claude.ai/code/session_01R7Y1jh5QhdxRuFKyWVev5h

Podman's z relabels the path it is handed. Handed the ln -sn link, it
relabelled the link and left the checkout at cache_home_t, so on an
SELinux host every cold tag reported 'missing validate-constitution.py'
and the constitution gate could not run. Mount the resolved directory.
The host-contract test now asserts the mount source is not a symlink;
it fails against the old launcher.

Found converting mcp-atlassian (RT#1552).

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

@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 1 issues (1 low)

Full review.

log_since
_mnt=$(tr ' ' '\n' < "$RUN/podman.log" | grep ':/cache/constitution/' | head -1)
_mnt=${_mnt%%:*}
if [ -n "$_mnt" ] && [ -d "$_mnt" ] && [ ! -L "$_mnt" ]; then

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LOW (Test Coverage): This assertion checks only that the mount source is some existing non-symlink directory; it does not verify that it is the resolved constitution checkout. A regression that mounts an unrelated directory could still pass.

Suggestion: Compare _mnt with the canonical path of the checkout created by this test, rather than checking only that it is a directory and not a symlink.

Evidence:

if [ -n "$_mnt" ] && [ -d "$_mnt" ] && [ ! -L "$_mnt" ]; then
  ok "the constitution mount names the checkout, not the link"

@fatherlinux
fatherlinux merged commit 2a8293b into main Nov 11, 2026
10 checks passed
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