Repository navigation
fix: The constitution gate cannot run on an SELinux host, and says the validator is missing (#38) - #46
Conversation
…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>
| 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: |
There was a problem hiding this comment.
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"
)
Co-Authored-By: Claude <noreply@anthropic.com>
|
Ashigaru fix round 1: Added tests/test_validate_checkout.py to cover the unreadable-checkout diagnostic in 1 finding(s) answered, 0 left, pushed a01fcf0. |
There was a problem hiding this comment.
Gatehouse found no issues.
Reviewed 1 commit since 7ecebf8 (incremental).
1 of 8 agents served by google/gemini-3.1-flash-lite (primary unavailable).
The launcher half of #38 was already fixed in
bin/sdlc:host_constitution()resolves the symlink withcd -Pand mounts the real directory. I left that alone. The remaining gap was the misleading message. Invalidate, an unreadable checkout directory fell through torequired.exists(), which returns False on a permission error, so it reported "missing validate-constitution.py". I added anos.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 theosimport 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.