/trinity-3nl-fusion

Formal Verification L3 Production low usage

/trinity-3nl-fusion

Overview

/trinity-3nl-fusion is a production command in the Formal Verification category of the Prismatic Platform. It validates claims, beliefs, and system properties through the fused Trinity-3NL verification pipeline, combining the Trinity Gate's three-layer consistency checks (structural, logical, formal) with the 3NL framework's three normalization levels (syntactic, semantic, pragmatic). This fusion produces the platform's highest confidence verification: claims that pass the Trinity-3NL fusion pipeline have been validated through six independent verification dimensions, achieving confidence levels that either dimension alone cannot reach.

This command operates under the L3 authority level and is executed by the trinity-specialist agent. It is part of the platform's 216-command slash command registry, built on the AIAD (Autonomous Intelligence Agent Design) standard. The L3 authority level reflects the command's access to the formal verification toolchain (Lean4, Prolog) and its authority to issue binding verification verdicts that affect downstream operations.

The Trinity Gate alone validates structural consistency (belief network forms valid DAG), logical consistency (propositions follow logical rules), and formal necessity (claims proven in formal systems). The 3NL framework alone normalizes claims through syntactic standardization, semantic disambiguation, and pragmatic context alignment. The fusion pipeline combines these: first normalizing claims through 3NL to eliminate ambiguity, then subjecting the normalized claims to Trinity Gate verification. This two-stage process catches verification failures that each system misses independently -- ambiguous claims that pass Trinity, or normalized claims with hidden structural inconsistencies.

Architecture

The fusion pipeline operates as a sequential two-stage system with feedback loops.

Fusion Architecture

             /trinity-3nl-fusion
                      |
              Fusion Orchestrator
                      |
          +-----------+-----------+
          |                       |
    3NL Normalizer          Trinity Gate
          |                       |
    +-----+-----+          +-----+-----+
    |     |     |          |     |     |
   L1    L2    L3        Gate1  Gate2  Gate3
   Syn   Sem   Prag     Struct  Logic  Formal
    |     |     |          |     |     |
    +-----+-----+          +-----+-----+
          |                       |
    Normalized Claims       Gate Verdicts
          |                       |
          +-----------+-----------+
                      |
              Fusion Correlator
                      |
          +-----------+-----------+
          |           |           |
       Passed      Failed     Uncertain
       (High τ)    (Evidence)  (More data)
                      |
              Verdict Report

Verification Dimensions

DimensionSourceWhat It ChecksFailure Mode
Syntactic Normalization3NL L1Claim is well-formed and standardizedMalformed or ambiguous claim syntax
Semantic Normalization3NL L2Claim meaning is unambiguousMultiple valid interpretations
Pragmatic Normalization3NL L3Claim is contextually appropriateContext mismatch or scope violation
Structural ConsistencyTrinity Gate 1Belief network is valid DAGCircular dependencies or orphaned nodes
Logical ConsistencyTrinity Gate 2Propositions follow logical rulesContradiction or invalid inference
Formal NecessityTrinity Gate 3Claims proven in formal systemUnprovable or falsifiable

Confidence Threshold Integration

ContextRequired ThresholdTrinity Gate3NL Level
Critical Decisions0.95ALL 3 gates MANDATORYAll 3 levels
Standard Operations0.80ALL 3 gates MANDATORYL1 + L2 minimum
Exploratory Analysis0.60Gate 1 + 2 RECOMMENDEDL1 minimum
Research Queries0.50Gate 1 OPTIONALL1 optional

Usage

# Validate a claim through full fusion pipeline
/trinity-3nl-fusion "The security rating algorithm produces scores between 300 and 900"

# Validate with specific confidence threshold
/trinity-3nl-fusion --threshold 0.95 "All routes require authentication"

# Validate system property
/trinity-3nl-fusion --type property "PrismaticPerimeter.discover/1 always returns {:ok, _} or {:error, _}"

# Validate architectural claim
/trinity-3nl-fusion --type architecture "Storage adapters are interchangeable"

# Validate with verbose gate details
/trinity-3nl-fusion --verbose "Quality score cannot decrease during evolution"

# Batch validate multiple claims
/trinity-3nl-fusion --batch ./claims.yaml

# Export verification report
/trinity-3nl-fusion --format json --export ./verification-report.json

# Dry run showing verification plan
/trinity-3nl-fusion --dry-run "The platform has 228 commands"

Practical Examples

# Verify security-critical claim before deployment
/trinity-3nl-fusion --threshold 0.95 --type security "No route exposes PII without authentication"

# Validate performance claim with formal proof
/trinity-3nl-fusion --type performance "Page load time is always under 250ms for health checks"

# Verify compliance claim for audit
/trinity-3nl-fusion --type compliance --formal-proof "NIS2 Article 21 requirements are fully addressed"

# Validate architectural invariant
/trinity-3nl-fusion --type invariant "Supervision trees restart failed processes within 5 seconds"

# Batch verification for release checklist
/trinity-3nl-fusion --batch ./release-claims.yaml --format markdown --export ./release-verification.md

Options

OptionTypeDefaultDescription
--thresholdfloat0.80Required confidence threshold (0.0-1.0)
--typeenumclaimClaim type: claim, property, architecture, security, performance, compliance, invariant
--verboseflagfalseShow detailed gate-by-gate verification results
--formal-proofflagfalseRequire Lean4 formal proof for Gate 3
--batchpathnoneBatch verify claims from YAML file
--formatenumtextOutput format: text, json, markdown
--exportpathnoneExport verification report
--dry-runflagfalseShow verification plan without executing
--skip-3nlflagfalseSkip 3NL normalization (Trinity-only mode)
--skip-trinityflagfalseSkip Trinity Gate (3NL-only mode)
--evidenceflagfalseInclude supporting evidence for each gate
--counterexampleflagfalseSearch for counterexamples on failure
--lean4-timeoutduration30sMaximum time for Lean4 proof search

Execution Flow

Phase 1: Claim Intake

The fusion orchestrator receives the claim and classifies it by type (property, architecture, security, etc.). The claim type determines which verification dimensions are most relevant and which confidence threshold applies.

Phase 2: 3NL Normalization

The claim passes through three normalization levels. L1 (Syntactic) standardizes the claim into a canonical form, resolving abbreviations, normalizing terminology, and structuring the assertion. L2 (Semantic) disambiguates the claim's meaning, identifying any terms with multiple valid interpretations and resolving them to specific definitions. L3 (Pragmatic) aligns the claim with its operational context, ensuring the claim's scope matches its intended domain.

Phase 3: Trinity Gate Verification

The normalized claim enters the Trinity Gate. Gate 1 (Structural Consistency) verifies that the claim's belief network forms a valid DAG without circular dependencies. Gate 2 (Logical Consistency) checks that the claim follows from its premises without contradictions. Gate 3 (Formal Necessity) attempts to prove the claim in a formal system -- Lean4 for mathematical properties, Prolog for logical rules.

Phase 4: Fusion Correlation

Results from both pipelines are correlated. The fusion correlator checks for alignment: a claim that normalizes cleanly but fails a Trinity gate indicates a semantically valid but structurally unsound claim. A claim that passes Trinity but has 3NL normalization issues indicates a technically correct but ambiguously stated claim. Both patterns generate specific diagnostic feedback.

Phase 5: Verdict Generation

The final verdict is computed as a confidence score incorporating all six dimensions. Claims meeting the threshold receive a PASSED verdict with supporting evidence. Claims below the threshold receive a FAILED verdict with specific gate failure details and remediation suggestions. Claims near the threshold receive an UNCERTAIN verdict with recommendations for additional evidence.

Integration Points

ComponentIntegration TypeDescription
/trinityFoundationTrinity Gate system status and rigidity scores
/leanEngineLean4 formal proof engine for Gate 3
/prologEngineProlog logical reasoning for Gate 2
/formal-verifyPeerGeneral formal verification of properties
/nabla-statusConsumerFusion results feed NABLA epistemic health
/quality-gatesEnforcementVerification verdicts inform gate passage
NABLA InfinityFrameworkEpistemic framework governing verification
TelemetryMonitoringVerification latency and pass/fail rates

Best Practices

Threshold Selection

Use 0.95 threshold for claims that affect security, compliance, or production stability. Use 0.80 for standard operational claims. Use 0.60 for exploratory analysis where false negatives are acceptable. Never use thresholds below 0.50 for claims that influence platform behavior.

Claim Specificity

Vague claims produce weak verification results. "The system is secure" is unverifiable. "No unauthenticated user can access /perimeter/assets" is verifiable. Write claims as specific, falsifiable assertions for strongest verification.

Batch Verification for Releases

Before every release, maintain a claims file (release-claims.yaml) containing all critical invariants and use --batch to verify them. This provides a formal release gate that catches regressions in system properties.

Evidence Preservation

Use --evidence --export to preserve verification evidence for compliance audits. The exported report provides traceable proof chains for every passed claim, which auditors can independently verify.

Error Handling

Error CodeDescriptionResolution
CLAIM_UNPARSEABLECannot normalize claim through 3NLRephrase claim in clearer terms
SEMANTIC_AMBIGUITYMultiple valid interpretations foundAdd qualifiers to disambiguate
STRUCTURAL_CYCLEBelief network contains circular dependencyRestructure claim to eliminate cycles
LOGICAL_CONTRADICTIONClaim contradicts established factsReview claim premises
LEAN4_TIMEOUTFormal proof search exceeded timeoutSimplify claim or increase timeout
LEAN4_UNPROVABLENo formal proof foundClaim may be false; review evidence
FUSION_DIVERGENCE3NL and Trinity produce conflicting resultsManual review required

Advanced Usage

Custom Axiom Sets

Load project-specific axioms for verification:

/trinity-3nl-fusion --axioms ./axioms/prismatic-security.lean "Authentication is mandatory for all API endpoints"

Incremental Verification

Verify a claim incrementally as evidence accumulates:

/trinity-3nl-fusion --incremental --claim-id "sec-001" --add-evidence ./new-evidence.json

When a claim fails, search for specific counterexamples:

/trinity-3nl-fusion --counterexample --verbose "All storage adapters implement the full contract"

Doctrine Compliance

All commands operate under the NO MERCY, NO DOUBTS doctrine:

  • NO MERCY: Zero tolerance for incomplete execution or quality violations. Every verification dimension is checked without exception. No claim receives a PASSED verdict without meeting all required gate thresholds.
  • NO DOUBTS: Full investigation before action, evidence-based results. Every verdict includes traceable evidence from each verification dimension. UNCERTAIN verdicts are never silently promoted to PASSED.
  • /trinity - Trinity system status and rigidity score verification
  • /lean - Execute Lean 4 code or prove a theorem with the lean-specialist agent
  • /prolog - Prolog-based logical reasoning and inference operations
  • /formal-verify - Formal verification of system properties and invariants
  • /nabla-status - NABLA Infinity epistemic framework health and status
  • /white-verify - White team constructive verification and formal proofs
  • /quality-gates - Enforce quality gate checkpoints with zero-warning compilation validation

Connect & Contribute

Created by Tomáš Korcak (korczis) | Open Source under GHL