Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion bin/sdlc
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
13 changes: 13 additions & 0 deletions tests/test_host_contract.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

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"

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'
Expand Down
Loading