Orchestrata Ultimate › Gates › prolog-boundary

Gate: prolog-boundary

At a glance

Purpose Refuse a governance-shaped Python Prolog query whose predicate/arity no consulted .pl file declares, and an un-whitelisted dynamic query.
Where it runs The scripts/gates.py battery (registered as prolog-boundary), the suite preflight _run_gates() in scripts/run_tests.py, and scripts/health_check.py.
Trigger A battery run whose src/ fingerprint changed; every suite run's preflight; a health check.
Exact command python scripts/check_prolog_boundary.py (--source PATH for the preflight's test seam)
Blocks Exit 1 on a missing predicate/arity or an un-whitelisted dynamic site; 0 otherwise. The advisory section never changes the exit.
Ruling / ADR reports/proposal-wire-prolog-governance.md §7 Phase 1 (the brief); no RUL page or ADR names this gate. Neighbouring: ADR-0025 — the governance rulebase bans dynamic predicate construction.
Last recorded verdict ok: true in the primary checkout's .cache/gates.json (file last written 2026-09-22 10:01 local). wt-MAP-PRECOMMIT has no .cache/gates.json.

What it refuses

A Python query site (query/query_once/query_bool/query_one on a PrologBridge/PrologEngine/janus-shaped receiver) whose target predicate/arity does not exist in the consulted .pl rule base — or an unresolvable dynamic query in a governance-shaped directory with no justified whitelist entry.

Why it exists

Module docstring:

"Proves every Python Prolog query site targets a predicate/arity that actually exists in the consulted rule base. Phase 1 of reports/proposal-wire-prolog-governance.md §7: a mechanical contract between the 42+ hand-written Python query strings across src/orchestrata_ultimate and the hand-written .pl declarations they target. Eight of those sites were found querying predicates that do not exist at the queried arity/argument order (F2/F3/ F4/F6 in the report) — four of them failing silently OPEN. This gate closes that residue."

How it runs (design decisions, all binding per its brief)

Typical failures and how to fix them

Wiring