Skip to content

fix: The constitution gate cannot run on an SELinux host, and says the validator is missing (#38) - #46

Merged
ashigaru-crunchtools[bot] merged 2 commits into
mainfrom
ashigaru/issue-38
Nov 12, 2026
Merged

ashigaru-crunchtools[bot] merged 2 commits into
mainfrom
ashigaru/issue-38

Conversation

@ashigaru-crunchtools

Copy link
Copy Markdown
Contributor

The launcher half of #38 was already fixed in bin/sdlc: host_constitution() resolves the symlink with cd -P and mounts the real directory. I left that alone. The remaining gap was the misleading message. In validate, an unreadable checkout directory fell through to required.exists(), which returns False on a permission error, so it reported "missing validate-constitution.py". I added an os.listdir(checkout) check before the existence loop. If it fails, it now dies with "cannot read the constitution checkout ... check its SELinux label and mode, not the constitution tag". I also added the os import and a CHANGELOG entry. I did not add a test, and I did not run anything, so the new check is untested.

Closes #38

Opened by Ashigaru. Merges automatically once the required checks pass.

…e validator is missing (#38)

The launcher half of #38 was already fixed in `bin/sdlc`: `host_constitution()` resolves the symlink with `cd -P` and mounts the real directory. I left that alone. The remaining gap was the misleading message. In `validate`, an unreadable checkout directory fell through to `required.exists()`, which returns False on a permission error, so it reported "missing validate-constitution.py". I added an `os.listdir(checkout)` check before the existence loop. If it fails, it now dies with "cannot read the constitution checkout ... check its SELinux label and mode, not the constitution tag". I also added the `os` import and a CHANGELOG entry. I did not add a test, and I did not run anything, so the new check is untested.

Closes #38

Co-Authored-By: Claude <noreply@anthropic.com>
@ashigaru-crunchtools
ashigaru-crunchtools Bot enabled auto-merge (squash) November 12, 2026 10:50

@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 medium)

Full review.

Comment thread validate
validator = checkout / "validate-constitution.py"
# A directory that cannot be listed (an SELinux label, a mode) is not a
# directory with a file missing; `exists()` cannot tell them apart.
try:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

MEDIUM (Test Coverage): The new unreadable-checkout error path has no corresponding test in the changes shown. This behavior distinguishes a directory that cannot be listed from one where the validator file is missing, so an untested regression could restore the misleading missing-file diagnostic.

Suggestion: Add a test that makes os.listdir(checkout) raise OSError and verifies validation reports that it cannot read the constitution checkout, including the relevant path or error context.

Evidence:

try:
    os.listdir(checkout)
except OSError as exc:
    die(
        f"cannot read the constitution checkout at {checkout} ({tag}): {exc}; "
        f"the checkout is there but not readable -- check its SELinux label "
        f"and mode, not the constitution tag"
    )

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed in a01fcf0

Co-Authored-By: Claude <noreply@anthropic.com>
@ashigaru-crunchtools

Copy link
Copy Markdown
Contributor Author

Ashigaru fix round 1: Added tests/test_validate_checkout.py to cover the unreadable-checkout diagnostic in validate. It loads the script by path, points CACHE at a temp dir and patches os.listdir to raise. I could not run the test or set its executable bit, because the sandbox denied those commands, so it is untested.

1 finding(s) answered, 0 left, pushed a01fcf0.

@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.

Reviewed 1 commit since 7ecebf8 (incremental).

1 of 8 agents served by google/gemini-3.1-flash-lite (primary unavailable).

@ashigaru-crunchtools
ashigaru-crunchtools Bot merged commit 25cb0d4 into main Nov 12, 2026
13 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.

The constitution gate cannot run on an SELinux host, and says the validator is missing

0 participants