Orchestrata Ultimate › Plans › prolog-utilization-plan

Prolog utilization plan — unused engine capabilities mapped to orchestrata

Source: plans/prolog-utilization-plan.md at 8a2cb42ad · last changed 2026-07-27 · first committed 2026-07-10 · 262 lines.

Prose pending.

Plan text

Prolog utilization plan — unused engine capabilities mapped to orchestrata

Status: PROPOSED (2026-07-10). No implementation yet — this documents the options, their landing sites, effort/value, and a recommended sequence. Companion to the governance janus migration (session 165) and the SPEC-007 policy engine.

As-is: what Prolog does today

Prolog currently serves as a deny-by-default decision table:

Pattern: assert ground facts via janus, consult rules from .pl files, ask yes/no. Single-step inference only. The three Prolog containers (10.92.53.16/.17/.18) are essentially idle — janus does the real work in-process.

Standing constraints (do not violate)

  1. Variable-bearing rules live in .pl files (consult); only GROUND facts are assertz'd — user ruling, session 165 (see memory: project-prolog-pyswip-load-bearing). Never reintroduce pyswip.
  2. Deny-by-default everywhere a decision gate exists.
  3. Test discipline applies: no mocks; real janus engine; the shared-engine isolation lessons from tests/governance/conftest.py (unload + abolish, user: shadowing) apply to every new rule file.
  4. Specs are authoritative — each adopted item below should get a SPEC (next free numbers) before implementation.

The nine unutilized capabilities

1. Deductive reasoning over the knowledge graph (with tabling)

2. Constraint solving — CLP(FD)

3. Proof trees / explanations for governance decisions

4. DCGs for intent and spec parsing

5. Pipeline plan derivation and verification

6. Integrity constraints over the RTM / traceability

7. Abductive diagnosis for test failures

8. Temporal / event-calculus reasoning over audit history

9. Defeasible policy layering (defaults + exceptions)

Infra note

The Prolog containers (.16/.17/.18) are the natural host for the long-lived, tabled fact bases (#1, #8) — an engine that survives process restarts and serves queries over MQI/socket, while janus stays the in-process path for per-decision governance (#3, #9). Do not build this split until #1 actually needs persistence; in-process janus with on-demand fact loading is the right first cut.

Extension: CLIPS — forward-chaining production system

CLIPS (C Language Integrated Production System, NASA-lineage expert-system shell, Rete algorithm; Python bindings via clipspy) complements rather than competes with Prolog. The division of labor is the classic one:

Non-negotiable boundary: Prolog remains the single source of truth for governance/policy DECISIONS (SPEC-007 lineage). CLIPS never re-encodes policy rules — it may only consume derived facts (e.g. a deny event Prolog already issued) as inputs to reactive monitoring. Two engines answering the same policy question is a split-brain waiting to happen.

C1. Event-stream watchdog (pilot)

C2. Resource / infra health correlation

C3. KG anomaly detection rules

CLIPS integration mechanics

Phase Items Rationale
P1 #3 proof trees, #1 KG deduction + tabling, #6 RTM integrity constraints Highest value:effort; #3 is small and pays into every later item; #1 replaces real Python complexity; #6 rides the existing requirement-fact pipeline
P2 #5 pipeline verification (verify-only), #9 defeasible layering, #4 DCG intent parsing Correctness layers over existing behavior; each keeps the current implementation as fallback until parity
P3 #7 abductive diagnosis, #8 event calculus (after KG audit cleanup), #2 CLP(FD) (only on demonstrated need) Follow-ons that depend on P1 machinery or on data-quality prerequisites
Ext C1 CLIPS event watchdog (pilot, after P1) → C2 health correlation → C3 KG anomaly rules Forward-chaining lane; gated on the C1 pilot paying for itself, Prolog stays authoritative for policy

Each adopted item gets: a SPEC (next free number) with requirements + TST IDs before code; rules in .pl files under src/orchestrata_ultimate/ prolog/; ground-facts-only assertion; engine-isolation fixtures per the governance conftest pattern; ≥90% coverage like everything else.