Orchestrata Ultimate › Gates › rulings-lint

Gate: rulings-lint

Purpose Keep every ruling backed by a mechanism that exists, so no ruling silently regresses to prose
Where it runs Suite preflight scripts/run_tests.py::_run_gates (fifth of five); also scripts/health_check.py; scripts/check_wiring.py (W4) imports its rulings-directory resolution
Trigger Every run_tests.py run unless --skip-gates
Exact command python scripts/rulings_lint.py [--rulings-dir PATH] [--json]
Blocks Exit 1 on a ruling with no ## Enforcement section or with a declared mechanism that does not exist. A missing rulings directory is a SKIP (exit 0, with a warning)
Ruling / ADR RUL-014 — its own Enforcement line is gate scripts/rulings_lint.py enforcement:

Why it exists

The module docstring calls it the lint that "closes the prose-only loophole (SPEC-023 Phase 2)". A ruling is binding only when a mechanism enforces it; this gate checks that each declared mechanism actually exists. The gate reads the rulings from the git-backed wiki store on the filesystem (~/workspace/knowledge-wiki/rulings, override RULINGS_DIR), never through a live Wiki.js server, so it works with the wiki down.

What it checks

Each RUL-*.md page lists one bullet per mechanism under ## Enforcement, in one of five grammars (docstring, verbatim):

Directive Passes when
hook <path> the file exists and is executable
gate <script> <rule-id> the script exists and <rule-id> is a literal substring of its text
banned-deps <name> <name> is a non-comment line in .claude/banned-libraries.txt
constitution <article-text> the text is a literal substring of src/orchestrata_ultimate/prolog/constitutional.pl
none (judgment) always; reported as judgment-only

Real output from the 2026-10-22 push logs:

[rulings-lint] rulings_dir=/home/mohamed/workspace/knowledge-wiki/rulings
[rulings-lint] checked 41 ruling(s)
[rulings-lint] judgment-only (6): RUL-034, RUL-035, RUL-036, RUL-037, RUL-038, RUL-041
[rulings-lint] ✅ all declared mechanisms verified

Typical failures and how to fix them

Failure Fix
A new ruling page has no ## Enforcement section Add one. If no mechanism exists yet, - none (judgment) is honest; the gate reports it as judgment-only
gate <script> <rule-id>: the rule id is not in the script text The id moved or was renamed (for example, test-review's env-key rule is T21, not T17); point the bullet at the real literal
hook <path> is not executable chmod +x the hook, or point at the shipped copy
The machine has no knowledge-wiki clone The gate skips with a warning rather than going false-red, the same honesty rule as --skip kernel

Six rulings were judgment-only on 2026-10-22 (above). Judgment-only passes this gate but leaves the ruling without a mechanism; RUL-038's container-creation gate, for example, is recorded on its page as "still owed".