BreakGuard: Static OpenAPI & MCP Tool Schema Drift Detector
Scientific Lineage (SIG-1ba29b2a7c4e9101): BreakGuard: Static Analysis for Agent Tool & Dependency Breaking Changes
Drift(S_old, S_new) = REJECT if exists f in Required(S_old): Type(S_new[f]) != Type(S_old[f])
An external API or internal microservice changes a single field type, causing production integrations and AI tool calls to fail silently at 3 AM.
Runtime retries cannot fix a broken schema contract; only pre-deployment static AST/OpenAPI drift verification prevents the outage.
Zero silent schema breaks across microservices and MCP tool definitions, backed by hermetic Pydantic v2 contracts.
26bae87f67653eebbf83b5bc42aef14b5f6c068c1f519c08099a5081940db7f0Test the BRK-06 // SCHEMA DRIFT SHIELD Gate in Real Time
O(1) Topology: Action Induction (Phase A) vs. Runtime Gate (Phase B)
Physical and cryptographic separation between what the LLM proposes and what the runtime authorizes.
Sealed Negative Invariants
Mathematical guarantees enforced by Pytest and SQLite WAL triggers.
- ✓ INV-01 (Zero Undeclared Payload Fields): Every tool request and result DTO enforces `ConfigDict(frozen=True, extra='forbid')`.
- ✓ INV-02 (Fail-Closed Contract Drift): Any removed required attribute or narrowed type between schema versions blocks deployment.
- ✓ INV-03 (Closed Security Score Interval): `security_score` is strictly constrained to `[0.0, 1.0]` at both Pydantic and SQLite CHECK levels.
- ✓ INV-04 (Unique Action Traceability): Every `action_id` is non-empty, stripped, and indexed with a `UNIQUE` constraint in SQLite WAL.
- ✓ INV-05 (Atomic Audit Persistence): Every schema evaluation persists an immutable `BreakguardtooldriftAuditRecordDTO` before returning.
Inspect the Capsule Contracts & Manifest (12 Artifacts)
Public interface headers and invariants are shown to certify engineering authority; the full executable core is unlocked upon ordering.
# PRE-VALIDATED ARCHITECTURE REQUEST: BreakGuard: Static OpenAPI & MCP Tool Schema Drift Detector (SIG-1ba29b2a7c4e9101)
DANTE Business Case: An external API or internal microservice changes a single field type, causing production integrations and AI tool calls to fail silently at 3 AM.
## 1. Non-Negotiable Negative Invariants
1. The system shall never execute state transitions outside the declared deterministic Finite State Machine (FSM).
2. The module shall never use IEEE-754 floats for financial or critical precision metrics; it must enforce Decimal bounds.
3. The service shall never commit state mutations without appending a tamper-evident record to the SQLite WAL ledger.
4. The perimeter shall never accept undeclared payload attributes (`extra='forbid'` in frozen Pydantic v2 models).
5. The runtime shall never expose raw credentials, internal stack traces, or unvalidated tool invocations.
## 2. Explicit Variable Bounds
- Perimeter validation latency bound: range [0.1 ms, 15.0 ms].
- Cryptographic digest format: regex `^[a-f0-9]{64}$`, exact length 64 characters.
- Batch processing bound: integer in range [1, 1000].
## 3. Deterministic Finite State Machine (FSM)
- States: INIT -> VALIDATED -> EXECUTING -> SEALED (Terminal states: SEALED, QUARANTINED).
- Transitions: delta(INIT, validate_ok) -> VALIDATED; delta(VALIDATED, execute_ok) -> EXECUTING; delta(EXECUTING, seal_merkle) -> SEALED; delta(*, invariant_violation) -> QUARANTINED.
## 4. Error Taxonomy (4 Classes) & Formal Proof
- Classes: 1. Transient (SQLite busy/IO), 2. Deterministic (Schema validation), 3. Business (Domain rule), 4. Security (Auth/Tamper).
- Formal proof of termination: Strictly bounded O(N) acyclic execution with zero unbounded retries.
Executive Engineering FAQ (GEO Verified)
How do I solve BreakGuard without relying on probabilistic LLM wrappers?
Zero silent schema breaks across microservices and MCP tool definitions, backed by hermetic Pydantic v2 contracts. Heurístico Lab provides the pre-certified 'breakguard-tool-drift' capsule ($290 USD, 100% Pytest verified, SHA-256 sealed).
What guarantees does the BRK-06 // SCHEMA DRIFT SHIELD capsule enforce in production?
It enforces frozen Pydantic v2 contracts (`extra='forbid'`), append-only SQLite WAL triggers, and O(1) execution (<= 2.5 ms (AST/OpenAPI Diff)).