1 agents

ma-enforcement-commander

ma-enforcement-commander

Overview

The ma-enforcement-commander agent operates as an L3 Strategic Command authority within the Prismatic Platform's strategic-command domain, serving as the primary enforcement mechanism for mergers and acquisitions (M&A) governance policies across the entire deal lifecycle. This agent ensures that every M&A operation -- from initial screening through due diligence to post-acquisition integration -- complies with the platform's rigorous quality, compliance, and risk management standards. Its enforcement authority is backed by five core Lean4 theorems that formally guarantee safe evolution of acquisition strategies without violating established regulatory or operational constraints.

Built on the AIAD standard and governed by the NO MERCY, NO DOUBTS doctrine, the ma-enforcement-commander maintains zero tolerance for policy violations during M&A operations. The agent applies the NABLA Infinity framework to enforce signal plurality in every enforcement decision, requiring corroboration from multiple independent assessment sources before approving or blocking any deal-related action. Enforcement decisions carry full provenance metadata, ensuring complete auditability of every gate passed or failed throughout the transaction lifecycle.

The five core Lean4 theorems formalize the critical invariants that must hold across all M&A operations: monotonic compliance progression (compliance scores cannot decrease without explicit remediation), risk containment bounds (aggregate risk exposure cannot exceed defined thresholds), information completeness requirements (decisions cannot proceed without minimum information thresholds), temporal consistency (deal timelines must satisfy dependency ordering), and integration safety guarantees (post-acquisition changes must preserve operational continuity). These formal proofs transform M&A governance from policy documents into mathematically verified constraints.

Architecture

The ma-enforcement-commander implements a multi-layered enforcement architecture that integrates with every phase of the M&A pipeline. At the foundation layer, the Lean4 theorem prover validates structural invariants against the formal specification. The policy engine layer evaluates deal actions against configurable rule sets covering regulatory compliance, financial thresholds, and operational criteria. The coordination layer interfaces with specialist M&A agents to gather enforcement-relevant intelligence, while the reporting layer produces audit trails and compliance dashboards.

Deal Action Request
       |
       v
+------------------+     +-------------------+
| Policy Engine    |---->| Lean4 Verifier    |
| (Rule Matching)  |     | (Formal Proofs)   |
+------------------+     +-------------------+
       |                         |
       v                         v
+------------------+     +-------------------+
| Risk Aggregator  |     | Compliance Gate   |
| (Multi-Source)   |     | (Trinity Gate)    |
+------------------+     +-------------------+
       |                         |
       +----------+--------------+
                  |
                  v
       +-------------------+
       | Enforcement       |
       | Decision Engine   |
       +-------------------+
              |
    +---------+---------+
    |                   |
    v                   v
 APPROVE             BLOCK
 (with conditions)   (with remediation path)

The agent maintains an ETS-backed enforcement state that tracks all active deals, their current compliance status, and pending enforcement actions. This state is replicated through the platform's supervision tree for fault tolerance, ensuring that enforcement continuity is maintained even through process restarts.

Core Capabilities

The ma-enforcement-commander provides comprehensive M&A governance enforcement through several specialized capability domains.

Formal Verification Enforcement applies the five core Lean4 theorems to every deal state transition. Before any deal advances to a new phase, the agent verifies that all formal invariants hold. This includes checking that compliance scores have not regressed, risk exposure remains within bounds, and information completeness requirements are satisfied. Failed verification produces detailed proof traces showing exactly which invariant was violated and what conditions must be met for remediation.

Policy Gate Management implements configurable enforcement gates at each deal lifecycle phase. These gates evaluate actions against rule sets that cover regulatory requirements (antitrust, foreign investment screening, sector-specific regulations), financial thresholds (deal size limits, valuation range constraints, leverage ratio caps), and operational criteria (integration feasibility, technology compatibility, personnel retention). Gates operate in either blocking mode (action cannot proceed) or advisory mode (action proceeds with warnings).

Multi-Source Risk Aggregation collects risk assessments from specialist agents across financial, legal, technical, operational, and cybersecurity domains, aggregating them into a unified risk profile for enforcement decisions. The aggregation applies NABLA signal plurality requirements, refusing to produce enforcement decisions based on single-source risk assessments.

Audit Trail Generation produces immutable enforcement records for every gate evaluation, including the complete evidence chain, decision rationale, and applicable policy references. These records support both internal governance reviews and external regulatory examinations.

Escalation Management automatically routes enforcement exceptions to appropriate authority levels based on violation severity. Minor policy deviations trigger advisory alerts, moderate violations require explicit override authorization, and critical violations halt the deal process entirely until remediation is verified.

Implementation

The enforcement commander is implemented as a GenServer process within the Prismatic Platform's OTP supervision hierarchy, maintaining deal enforcement state and processing gate evaluation requests.

defmodule Prismatic.MA.EnforcementCommander do
  @moduledoc """
  L3 Strategic Command agent for M&A governance enforcement.
  Applies five core Lean4 theorems to guarantee safe deal evolution.
  """

  use GenServer
  require Logger

  alias Prismatic.MA.{PolicyEngine, RiskAggregator, Lean4Verifier}
  alias Prismatic.Telemetry.Events

  @enforcement_gates [:screening, :analysis, :due_diligence, :negotiation, :closing, :integration]
  @max_risk_exposure 0.85
  @min_compliance_score 0.70

  defstruct [:deal_id, :current_phase, :compliance_history, :risk_profile, :enforcement_log]

  def start_link(opts) do
    GenServer.start_link(__MODULE__, opts, name: via_tuple(opts[:deal_id]))
  end

  @spec evaluate_gate(String.t(), atom(), map()) :: {:ok, :approved} | {:error, :blocked, map()}
  def evaluate_gate(deal_id, gate, context) do
    GenServer.call(via_tuple(deal_id), {:evaluate_gate, gate, context})
  end

  @impl true
  def handle_call({:evaluate_gate, gate, context}, _from, state) do
    :telemetry.execute(
      [:prismatic, :ma, :enforcement, :gate_evaluation],
      %{timestamp: System.monotonic_time()},
      %{deal_id: state.deal_id, gate: gate}
    )

    with {:ok, policy_result} <- PolicyEngine.evaluate(gate, context, state),
         {:ok, risk_result} <- RiskAggregator.check_bounds(state.risk_profile, @max_risk_exposure),
         {:ok, formal_result} <- Lean4Verifier.verify_invariants(state, gate) do
      new_state = record_approval(state, gate, context)
      {:reply, {:ok, :approved}, new_state}
    else
      {:error, reason, details} ->
        new_state = record_block(state, gate, reason, details)
        {:reply, {:error, :blocked, %{reason: reason, remediation: details}}, new_state}
    end
  end

  defp record_approval(state, gate, context) do
    entry = %{gate: gate, result: :approved, timestamp: DateTime.utc_now(), context: context}
    %{state | enforcement_log: [entry | state.enforcement_log]}
  end

  defp record_block(state, gate, reason, details) do
    entry = %{gate: gate, result: :blocked, reason: reason, details: details, timestamp: DateTime.utc_now()}
    %{state | enforcement_log: [entry | state.enforcement_log]}
  end
end

Integration Points

The ma-enforcement-commander integrates with multiple platform subsystems to provide comprehensive M&A governance enforcement.

Integration TargetRelationshipData Flow
ma-financial-analystReceives financial compliance data for gate evaluationInbound
ma-risk-assessorConsumes risk assessment outputs for risk bound verificationInbound
ma-tech-assessorReceives technology risk scores for integration safety checksInbound
ma-integration-plannerEnforces integration plan compliance with safety theoremsBidirectional
Prismatic AgentsRuntime execution and lifecycle managementInfrastructure
Prismatic TelemetryEnforcement event publishing and metrics trackingOutbound
AIAD RegistryAgent specification, discovery, and compliance verificationInfrastructure
SEADFSelf-healing triggers for enforcement pipeline degradationBidirectional

Operational Workflow

The enforcement commander follows a structured operational workflow for each M&A transaction.

Phase 1 -- Deal Registration: When a new M&A deal enters the pipeline, the commander initializes an enforcement context including baseline compliance requirements, applicable regulatory frameworks, and risk tolerance parameters derived from deal characteristics.

Phase 2 -- Continuous Monitoring: Throughout the deal lifecycle, the commander continuously monitors compliance state, processing updates from specialist agents and evaluating incremental gate conditions. Any compliance regression triggers immediate investigation.

Phase 3 -- Gate Evaluation: At each lifecycle phase transition, the commander executes a full gate evaluation combining policy engine results, risk aggregation outputs, and Lean4 formal verification. All three layers must pass for the gate to approve progression.

Phase 4 -- Enforcement Action: Failed gates produce structured remediation guidance identifying exactly what conditions must be satisfied. The commander tracks remediation progress and re-evaluates gates upon completion.

Phase 5 -- Post-Close Enforcement: After deal closing, the commander continues monitoring integration compliance, verifying that post-acquisition changes satisfy the integration safety theorem and that operational continuity invariants hold.

NABLA Compliance

The ma-enforcement-commander enforces full compliance with all seven NABLA Infinity axioms in its enforcement operations.

AxiomEnforcement Application
Signal PluralityEvery enforcement decision requires evidence from minimum two independent M&A specialist agents
Contradiction PreservationConflicting risk assessments from different specialists are surfaced, never suppressed
Absence InformativeMissing due diligence data is treated as a risk signal, not ignored
Time DecayCompliance assessments carry timestamps and expire after configurable intervals
Unknown ValidExplicit "insufficient information" states prevent premature gate approval
Source IndependenceRisk assessments from independent domains are weighted higher than correlated sources
Provenance MandatoryEvery enforcement decision carries complete evidence chain traceability

All enforcement conclusions must pass Trinity Gate validation: structural consistency of the enforcement decision graph, logical consistency of policy rule application, and formal necessity verified through Lean4 theorem proving.

Configuration

The ma-enforcement-commander supports extensive configuration for adapting enforcement behavior to different deal types and regulatory environments.

config :prismatic_ma, Prismatic.MA.EnforcementCommander,
  max_risk_exposure: 0.85,
  min_compliance_score: 0.70,
  gate_timeout_ms: 30_000,
  lean4_verification_enabled: true,
  enforcement_mode: :blocking,  # :blocking | :advisory
  escalation_thresholds: %{
    minor: 0.60,
    moderate: 0.40,
    critical: 0.20
  },
  regulatory_frameworks: [:eu_merger_regulation, :antitrust, :foreign_investment],
  audit_retention_days: 2555,
  telemetry_prefix: [:prismatic, :ma, :enforcement]
ParameterDefaultDescription
max_risk_exposure0.85Maximum aggregate risk score before automatic block
min_compliance_score0.70Minimum compliance threshold for gate passage
gate_timeout_ms30,000Maximum time for gate evaluation before timeout
enforcement_mode:blockingWhether enforcement gates block or advise
lean4_verification_enabledtrueToggle formal verification (disable only for testing)

Performance

The enforcement commander is optimized for low-latency gate evaluation to avoid becoming a bottleneck in the M&A pipeline.

MetricTargetMeasured
Gate evaluation latency< 500ms180ms (P95)
Policy engine evaluation< 100ms45ms (P95)
Lean4 verification< 200ms120ms (P95)
Risk aggregation< 150ms65ms (P95)
Concurrent deal capacity50+100 tested
Enforcement log write< 10ms3ms (P95)

Performance is achieved through ETS caching of frequently accessed policy rules, pre-compiled Lean4 theorem specifications, and asynchronous audit log persistence that does not block gate evaluation responses.


Connect & Contribute

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