From b305a2fbfd35afa54b3c2cea177924f12e3ec702 Mon Sep 17 00:00:00 2001 From: Scott McCarty Date: Wed, 11 Nov 2026 05:31:30 -0500 Subject: [PATCH] fix: mount the constitution checkout, not the link to it 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 Claude-Session: https://claude.ai/code/session_01R7Y1jh5QhdxRuFKyWVev5h --- CHANGELOG.md | 9 +++++++++ bin/sdlc | 7 ++++++- tests/test_host_contract.sh | 13 +++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f0176e8..9cdae40 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,15 @@ All notable changes to this project are documented here, following ## [Unreleased] +### Fixed + +- **The constitution check could not run on an SELinux host with a cold + cache.** The launcher mounted the `ln -sn` link to the host's checkout, and + podman's `z` relabels the path it is given, so the link was relabelled and + the directory behind it kept `cache_home_t`. The container was refused it and + reported "missing validate-constitution.py". It now mounts the resolved + directory. Found converting mcp-atlassian (RT#1552). + ## [0.6.2] - 2026-11-10 ### Changed diff --git a/bin/sdlc b/bin/sdlc index 88f42fe..42bb5e8 100755 --- a/bin/sdlc +++ b/bin/sdlc @@ -214,7 +214,12 @@ host_constitution() { ln -sn "${_own##*/}" "$_dir" 2>/dev/null || rm -rf "$_own" [ -f "$_dir/constitution.md" ] || return 0 fi - CONSTITUTION_MOUNT="$_dir:/cache/constitution/$_tag:ro,z" + # Mount the checkout, not the link to it. Podman relabels the path it is + # given, and given the link it relabels the LINK: the directory keeps + # cache_home_t, the container is refused it, and on an SELinux host every + # cold tag came back "missing validate-constitution.py" (RT#1552). + _src=$(cd -P -- "$_dir" 2>/dev/null && pwd) || return 0 + CONSTITUTION_MOUNT="$_src:/cache/constitution/$_tag:ro,z" } host_constitution diff --git a/tests/test_host_contract.sh b/tests/test_host_contract.sh index b6be1f1..bc1886f 100755 --- a/tests/test_host_contract.sh +++ b/tests/test_host_contract.sh @@ -698,6 +698,19 @@ if [ "$_links" = 1 ] && [ "$_dirs" = 1 ] && [ "$_nested" = 0 ] \ else bad "concurrent constitution clones left $_links link(s), $_dirs dir(s), $_nested nested" fi +# The mount must name the checkout itself. `z` relabels the path podman is +# given, so a symlink source relabels only the link and SELinux refuses the +# directory behind it. +log_mark +PATH="$CLONESHIM" XDG_CACHE_HOME="$CLONECACHE" sh bin/sdlc mypy >/dev/null 2>&1 || : +log_since +_mnt=$(tr ' ' '\n' < "$RUN/podman.log" | grep ':/cache/constitution/' | head -1) +_mnt=${_mnt%%:*} +if [ -n "$_mnt" ] && [ -d "$_mnt" ] && [ ! -L "$_mnt" ]; then + ok "the constitution mount names the checkout, not the link" +else + bad "the constitution mount source is '${_mnt:-absent}', not a resolved directory" +fi rm -rf "$CLONESHIM" "$CLONECACHE" printf '\n'