3

White Team

White Team

Commander: white-verifier-commander Role: Constructive Verification

Overview

The White Team provides the formal verification and constructive proof capability within the Prismatic Platform's six-team color-team security architecture. While Red Team finds vulnerabilities through adversarial simulation and Blue Team builds defenses through monitoring and detection, White Team proves that systems hold through progressive formal methods — from property-based testing through contract validation to full Lean4 theorem proving. White provides mathematical certainty where simulation and observation alone cannot.

The theoretical foundation of White Team operations draws from formal methods in software engineering, type theory, constructive logic, and the Curry-Howard correspondence that links proofs and programs. The Prismatic Platform implements a six-level verification hierarchy (L0-L5) that allows verification effort to be calibrated to the criticality of the system under examination. Low-criticality modules receive L0-L1 verification (unit and property tests), while safety-critical paths receive L4-L5 verification (theorem proving and full formalization).

White Team's role within the color-team architecture is uniquely constructive — while other teams find problems (Red), detect changes (Blue), explore boundaries (Gray), model threats (Black), and synthesize findings (Purple), White Team proves that solutions work. White verification evidence feeds into Purple Team closure decisions, providing the formal proof that a defense implementation actually satisfies its security properties. This constructive role makes White Team essential for the platform's Trinity Gate — the three-layer verification gate that every belief must pass.

Mission and Doctrine

The White Team mission is to provide progressive formal verification of platform systems, producing mathematical evidence that implementations satisfy their specifications. This evidence supports Purple Team closure decisions, Trinity Gate passage, and long-term platform reliability.

Mission Principles

PrincipleDescriptionEnforcement
Progressive VerificationMatch verification depth to system criticalityL0-L5 hierarchy
Constructive EvidenceProduce proofs, not just absence of counterexamplesProof artifact requirement
Target IndependenceNever modify verification targetsRead-only analysis
Trinity Gate SupportProvide formal necessity evidence for gate passageMandatory for critical claims
ReproducibilityAll proofs reproducible from specification to conclusionProof artifact storage

The NO MERCY, NO DOUBTS doctrine governs White operations with emphasis on NO DOUBTS: every verification claim must be backed by reproducible proof artifacts, and no system is declared "verified" without evidence at the appropriate level. NO MERCY manifests in the insistence on genuine verification — proofs that actually prove the property in question, not superficially similar properties that are easier to verify.

Team Composition

The White Team comprises three agents organized around the verification lifecycle: campaign orchestration, contract validation, and invariant proving.

AgentLevelRolePrimary FunctionSpecialization
white-verifier-commanderL3Strategic CommanderVerification campaign orchestration, composite proof constructionCampaign planning, L0-L5 assignment
white-contract-validatorL4Operational SpecialistInterface contract testing, behavior/protocol/API validationContract types (behavior, protocol, API)
white-invariant-proverL4Operational SpecialistProperty-based testing, formal Lean4 proofs, fault injectionDeep verification (L3-L5)

white-verifier-commander

The Verifier Commander orchestrates verification campaigns, assigning verification levels to target systems based on criticality assessment, available specifications, and resource constraints. The commander also constructs composite proofs — combining evidence from multiple verification methods into unified proof packages that satisfy Trinity Gate requirements. Campaign planning considers the priority signals from Purple Team about which findings require formal verification for closure.

white-contract-validator

The Contract Validator specializes in three contract types: behavior contracts (function input/output relationships verified against @spec annotations), protocol contracts (Elixir protocol compliance verification), and API contracts (OpenAPI specification validation for external interfaces). This agent produces test suites that continuously verify contract compliance, serving as the L1-L2 verification layer.

white-invariant-prover

The Invariant Prover conducts the deepest verification work — property-based testing with StreamData, model checking, and formal theorem proving with Lean4. This agent handles L3-L5 verification, producing mathematical proofs of system invariants. The prover also conducts fault injection analysis, verifying that systems maintain their properties under controlled failure conditions.

Verification Hierarchy

Progressive Methodology (L0-L5)

LevelMethodConfidenceToolingTypical Targets
L0Unit Testing0.60ExUnitAll modules
L1Property Testing0.75StreamData, PropCheckPublic APIs, data transformations
L2Contract Testing0.85TypeCheck, custom validatorsModule interfaces, protocol impls
L3Model Checking0.90TLA+ specificationsState machines, concurrency
L4Theorem Proving0.95Lean4Core algorithms, security properties
L5Full Formalization0.99Lean4 + CoqTrinity Gate, NABLA axioms

Verification Pipeline

flowchart TD
    Spec["Specification Extraction"]
    Prop["Property Identification"]
    Level["Level Assignment<br/>(L0-L5 based on criticality)"]
    Gen["Test / Proof Generation"]
    Exec["Execution &amp; Verification"]
    Evid["Evidence Artifact Production"]
    Purple["Purple Team / Trinity Gate Submission"]

    Spec --> Prop --> Level --> Gen --> Exec --> Evid --> Purple

    classDef stage fill:#0f172a,stroke:#e2e8f0,color:#fff
    classDef gate fill:#1e293b,stroke:#a855f7,color:#fff
    class Spec,Prop,Level,Gen,Exec,Evid stage
    class Purple gate

Level Assignment Criteria

CriticalityVerification LevelExample Systems
Critical (failure = security breach)L4-L5Authentication, access control, Trinity Gate
High (failure = data corruption)L3-L4Storage adapters, data transformers
Medium (failure = degraded service)L2-L3API endpoints, state machines
Low (failure = cosmetic/minor)L0-L1UI helpers, formatters

Contract Validation

Three Contract Types

TypeScopeVerification MethodTooling
Behavior ContractFunction I/O relationships@spec enforcement, property testingExUnit, StreamData
Protocol ContractElixir protocol adherenceProtocol compliance testingTypeCheck, custom validators
API ContractExternal interface complianceOpenAPI specification validationOpenApiSpex

Contract Testing Implementation

defmodule PrismaticDark.WhiteTeam.ContractValidator do
  @moduledoc """
  Three-type contract validation for behavior, protocol, and API contracts.
  Produces continuous verification evidence for Purple Team closure support.
  """

  @type contract_type :: :behavior | :protocol | :api
  @type verification_result :: %{
    contract_type: contract_type(),
    target: module(),
    properties_verified: non_neg_integer(),
    properties_failed: non_neg_integer(),
    confidence: float(),
    evidence: [map()]
  }

  @spec validate_behavior_contract(module(), atom(), non_neg_integer()) :: verification_result()
  def validate_behavior_contract(module, function, arity) do
    spec = fetch_spec(module, function, arity)
    properties = extract_properties_from_spec(spec)

    results =
      properties
      |> Enum.map(&verify_property(module, function, &1))

    %{
      contract_type: :behavior,
      target: module,
      properties_verified: Enum.count(results, &(&1.status == :verified)),
      properties_failed: Enum.count(results, &(&1.status == :failed)),
      confidence: calculate_confidence(results),
      evidence: results
    }
  end

  @spec validate_protocol_contract(module(), module()) :: verification_result()
  def validate_protocol_contract(protocol, implementation) do
    required_functions = protocol.__protocol__(:functions)

    results =
      required_functions
      |> Enum.map(fn {name, arity} ->
        verify_protocol_function(implementation, name, arity)
      end)

    %{
      contract_type: :protocol,
      target: implementation,
      properties_verified: Enum.count(results, &(&1.status == :verified)),
      properties_failed: Enum.count(results, &(&1.status == :failed)),
      confidence: calculate_confidence(results),
      evidence: results
    }
  end
end

Invariant Proving

Property-Based Testing

defmodule PrismaticDark.WhiteTeam.InvariantProver do
  @moduledoc """
  Property-based testing and formal proof generation.
  Handles L1-L5 verification with progressive methodology.
  """
  use ExUnit.Case
  use ExUnitProperties

  property "NABLA signal plurality: minimum 2 independent signals for belief" do
    check all signals <- list_of(signal_generator(), min_length: 1, max_length: 20) do
      belief = PrismaticNabla.form_belief(signals)

      case belief do
        {:ok, %{confidence: c}} when c > 0.5 ->
          independent_sources = signals |> Enum.map(& &1.source) |> Enum.uniq()
          assert length(independent_sources) >= 2

        {:error, :insufficient_plurality} ->
          independent_sources = signals |> Enum.map(& &1.source) |> Enum.uniq()
          assert length(independent_sources) < 2

        _ ->
          :ok
      end
    end
  end

  property "account balance invariant: balance >= 0 after any operation sequence" do
    check all operations <- list_of(operation_generator()) do
      account = Account.new()
      final = Enum.reduce(operations, account, &apply_operation/2)
      assert final.balance >= 0
    end
  end
end

Lean4 Formal Proofs

-- Proof that Trinity Gate is sound: if all three gates pass, the belief is valid
theorem trinity_gate_sound (belief : Belief) :
  trinity_passes belief →
  structural_consistent belief ∧
  logical_consistent belief ∧
  formally_necessary belief := by
  intro h
  constructor
  · exact h.structural
  constructor
  · exact h.logical
  · exact h.formal

-- Proof that NABLA signal plurality prevents single-source beliefs
theorem nabla_plurality_prevents_single_source :
  ∀ (signals : List Signal),
    (signals.length ≥ 2 ∧ sources_independent signals) →
    ¬ (single_source_dominant signals) := by
  intro signals ⟨h_len, h_indep⟩
  intro h_single
  have : sources_independent signals := h_indep
  exact absurd h_single (independent_not_single h_len this)

Fault Injection Analysis

White Team validates system resilience through controlled fault injection, verifying that systems maintain their verified properties under failure conditions.

Fault TypeInjection MethodExpected BehaviorVerification Level
Network partitionSimulate disconnectGraceful degradation, no data lossL2-L3
Data corruptionInject invalid dataValidation rejection, error propagationL2
Resource exhaustionMemory/CPU limitsBack-pressure, no crashL1-L2
Timing failuresDelay/timeout injectionRetry with backoff, timeout handlingL1-L2
Process crashesKill supervised processesSupervisor restart, state recoveryL2-L3
Concurrent accessRace condition simulationProper serialization, no data racesL3-L4

Technical Architecture

System Architecture

White Verifier Commander (L3)
├── Campaign Planner
│   ├── Criticality Assessor (assigns L0-L5)
│   ├── Specification Extractor
│   └── Resource Scheduler
├── Contract Validator (L4)
│   ├── Behavior Contract Engine
│   ├── Protocol Contract Engine
│   ├── API Contract Engine
│   └── Evidence Collector
├── Invariant Prover (L4)
│   ├── Property Test Generator (StreamData)
│   ├── Model Checker (TLA+)
│   ├── Theorem Prover (Lean4)
│   └── Fault Injector
└── Evidence Pipeline
    ├── Proof Artifact Storage
    ├── Confidence Calculator
    ├── Trinity Gate Submitter
    └── Purple Team Evidence Emitter

Telemetry Events

EventMeasurementsMetadata
[:prismatic, :white_team, :verification, :start]target_countcampaign_id, level
[:prismatic, :white_team, :verification, :complete]duration, properties_verifiedcampaign_id, confidence
[:prismatic, :white_team, :contract, :verified]properties_countmodule, contract_type
[:prismatic, :white_team, :contract, :failed]failure_countmodule, contract_type
[:prismatic, :white_team, :proof, :complete]proof_size, durationtheorem_name, level
[:prismatic, :white_team, :fault_injection, :complete]faults_injected, failurestarget, fault_types
[:prismatic, :white_team, :trinity_gate, :submitted]confidencebelief_id

NABLA Compliance

White Team provides the formal verification layer that supports NABLA axiom enforcement across the platform.

AxiomWhite Team ApplicationCompliance Level
Signal PluralityVerifies plurality enforcement code with property testsFULL — verifies enforcement
Contradiction PreservationProves contradiction preservation invariantsFULL — formal proofs
Absence InformativeVerifies absence detection implementationsFULL — contract testing
Time DecayVerifies decay calculations are mathematically correctFULL — property testing
Unknown ValidProves that unknown states are properly handledFULL — model checking
Source IndependenceVerifies independence weighting algorithmsFULL — property testing
Provenance MandatoryVerifies provenance chain integrityFULL — contract testing

Trinity Gate Support

White Team provides the Formal Necessity component of the Trinity Gate:

GateProviderMethod
Structural ConsistencyGraph analysisAutomated DAG validation
Logical ConsistencyRule enginePropositional logic checking
Formal NecessityWhite TeamLean4 theorem proving, property testing

Performance Metrics

MetricTypical ValueNotes
L0-L1 verification time< 30 secondsPer module
L2 contract verification1-5 minutesPer module interface
L3 model checking5-30 minutesPer state machine
L4 theorem proving10-60 minutesPer critical property
L5 full formalization1-8 hoursPer security domain
Property test generation100-1000 cases/secondStreamData throughput
Contract coverage> 90%Of public module interfaces
Proof artifact size5-50 KBPer verified property
False verification rate< 0.1%Proofs that don't actually prove

Integration Points

ComponentDirectionContentPurpose
Purple TeamWhite → PurpleVerification evidence, proof artifactsClosure support
Trinity GateWhite → TrinityFormal necessity proofsGate passage evidence
Red TeamRed → WhiteFindings requiring formal verificationProof targets
Blue TeamBlue → WhiteDefense implementations for verificationVerification targets
Gray TeamGray → WhiteEdge cases for formal analysisProperty test seeds
Quality GatesWhite → QualityVerification statusQuality integration

Signal Flow

Red Findings ──→ Proof Targets ──→ White Team ──→ Proof Artifacts
                                       ↑                ↓
Blue Defenses ──→ Verification ────────┘          Purple Team
                    Targets                       (closure evidence)
                                                       ↓
Gray Edge Cases ──→ Property ──────────────────→ Trinity Gate
                    Test Seeds                   (formal necessity)

Outputs

ArtifactPurposeConfidence LevelConsumers
Proof CertificateFormal verification evidence0.95+Purple, Trinity Gate
Contract Test SuiteInterface validation (continuous)0.85+Purple, Quality Gates
Invariant CatalogSystem properties databaseReferenceAll Teams, Architecture
Fault Analysis ReportResilience assessment under failureReferencePurple, Blue
Property Test ReportStreamData verification results0.75+Purple, Quality Gates
Lean4 Proof ArchiveFormal theorem proof files0.95-0.99Purple, Trinity Gate, Archive
  • Purple Team — Primary consumer of White verification evidence for closure
  • Red Team — Produces findings that require formal verification
  • Blue Team — Produces defenses that White formally verifies
  • Gray Team — Edge case discoveries that seed property-based tests
  • Black Team — Theoretical models verified against formal specifications
  • Trinity Gate — Three-layer verification gate supported by White proofs
  • Quality Gates — Quality enforcement incorporating verification status

Connect & Contribute

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