ISO-ENTROPÍA: Auditor de Resiliencia Autónomo

Inspiration

This project was born out of a brilliant failure.

I was trying to resolve an idea about the axiom of determination, but when evaluating the hypothesis, I ran into a theoretical wall (Cosmic Inflation) and had to shelve the project.

However, I realized that the mathematics we developed to measure chaos in the universe (Entropy and Causal Limits) were perfect for solving a more practical problem: the fragility of Supply Chains.

The hypothesis was: "If the universe collapses without limits, a 'Lean' company without buffers is also mathematically doomed."

I began testing this hypothesis with real business scenarios:

  • A hospital sees 40% surge in emergency demand—can it process that complexity?
  • An e-commerce faces supplier disruption—can decision-making keep pace?
  • A supply chain hits inflation shock—does the organization have enough "capacity" to respond?

The answer was always the same: When environmental chaos exceeds organizational capacity, collapse is not a possibility—it's a mathematical inevitability.


What it does

ISO-ENTROPÍA is a "Preventive Autopsy" simulator.

Instead of predicting profits, it predicts the death of the system. It is an application that models the accumulation of Entropy Debt $$(D_E)$$ where Gemini 3 performs the indications at each moment.

  1. It calculates market uncertainty $$(I)$$ in bits.
  2. It calculates the company's decision-making capacity $$(K)$$ in bits.
  3. If $$I > K$$, the system accumulates invisible debt.
  4. When the debt exceeds the physical threshold $$(\theta_{max})$$, the simulator executes a Hard Stop, showing the exact moment of operational collapse.

It does not generate pretty graphs to please; it generates a red line that is abruptly cut off when the company goes bankrupt.


How we built it

This project was built by an Intelligence Team orchestrated by a human (The Architect/Router):

  • The Architect (Me): Defined the vision, managed the context window to avoid hallucinations, and made the pivot decisions. Strategically guided Gemini 3 Pro to translate theoretical frameworks into functional autonomous agent.

  • Gemini 3 Pro (R&D Director): Derived the Shannon and Ashby equations and translated financial concepts (Working Capital) into units of information (Bits). Validated mathematical rigor: $$H(D,E) \geq H(D) + H(E)$$ (Joint Entropy requirement).

  • Gemini 3 Flash (Builder): Wrote the code for the physics engine (run_simulation()) implementing 500-run Monte Carlo with Gaussian distributions. Generated telemetry and non-linear entropy debt accumulation.

  • Claude (Auditor / Red Team): Subjected the model to rigorous scrutiny. Detected that our initial mathematics was naive (it linearly summed entropies) and required us to implement Joint Entropy for scientific rigor.

Architecture:

  • Frontend: Streamlit (Python UI)
  • LLM: google-genai SDK (Gemini 3 Flash)
  • Physics Engine: NumPy + Monte Carlo (500 runs per iteration)
  • FSM: Finite State Machine (ORIENT → VALIDATE → STRESS → CONCLUDE)
  • Integration: Single-turn Gemini calls respecting 5 RPM quota

Key Numbers:

  • 500 simulations per iteration (±2% precision)
  • 4-5 Gemini API calls per audit
  • ~90 seconds execution time
  • 100% reproducible, peer-auditable

Challenges We Ran Into

1. The Emotional Pivot

Going from the excitement of "thinking I could almost win a Nobel Prize" with the cosmic inflation project to having to start from scratch in Logistics was tough.

Resolution: I realized that supply chain collapse is equally important as cosmic physics—people's livelihoods depend on it.

2. The Auditor's Wall

When Claude rejected the first version of the mathematical model (linear summation of entropies), I was tempted to ignore it. I decided to be honest, accept the mistake, and rewrite the simulator's core to calculate real correlations $$(H(D,E))$$, which made the model more complex but irrefutable.

Resolution: Implemented Joint Entropy for scientific rigor.

3. API Rate Limits (Gemini Free Tier)

Free tier: 20 requests/day. Our auditor: 4-5 calls per audit. Maximum audits: 4 per day.

This forced us to make every call count:

  • Single-turn prompts with full context
  • Pre-calculated parameters (no asking Gemini for grounding)
  • Batch results into one final call

Resolution: Implemented intelligent caching and rate limiter. Constraints paradoxically made the system better—forced us to be surgical with API usage.

4. The Honesty Requirement

Temptation: Ignore Claude's corrections, use simpler math, ship faster.

Reality: If the math is wrong, the predictions are fiction.

Resolution: Accepted the complexity and spent extra time validating that our model is testable against historical bankruptcy data.


What We Learned

1. Efficiency is a Double-Edged Sword

Modern supply chains obsess over minimizing operational capacity K (just-in-time inventory, maximum automation, minimal slack).

Mathematical consequence:

$$\text{Survival Horizon} = \frac{\theta_{max}}{I - K}$$

When you minimize K (maximize efficiency), you minimize survival time.

COVID-19 proved this: Companies with buffers survived. Companies with zero inventory collapsed.

2. AI is a Thinking Partner, Not Just a Tool

I initially treated Gemini like a code generator: "Generate function X."

What actually happened:

  • Gemini Pro suggested mathematical frameworks I hadn't considered
  • Claude found errors in my reasoning and forced corrections
  • Flash optimized implementation while maintaining rigor

This is collaborative reasoning, not automation.

3. Predicting Collapse is Easier Than Predicting Profit

Financial forecasting is uncertain (too many variables).

But organizational collapse is deterministic once you model information flow correctly. If $$I > K$$ persistently, collapse is inevitable—not probable.

This makes the model scientifically stronger.

4. Context Windows are Real Constraints

Managing Gemini's context to prevent hallucinations required:

  • Injecting parameters directly (not asking Gemini to calculate them)
  • Separating concerns (physics engine ≠ narrative generation)
  • Single-turn design (no loops asking for clarification)

This forced clarity that made the system more robust.


Achievements We're Proud Of

  • The Formula $$\theta_{max}$$: I achieved a novel conversion: transforming money and stock into Bits of Information. This allowed me to measure a company's solvency using the same mathematics that measures data transmission:

$$\theta_{max} = \log_2(1 + \text{Stock}) + \log_2(1 + \text{Capital}) + \log_2(1 + \text{Liquidity})$$

  • The Honesty of the Code: I managed to condense all the theory into 349-line agent that is transparent and reproducible. No black boxes.

  • The Resilience of the Team: I transformed a failed theoretical physics project into a viable business tool by being intellectually honest, accepting corrections, and treating AI as a peer rather than a tool.

  • The Scientific Rigor: We forced ourselves to implement Joint Entropy instead of taking shortcuts. This made the model irrefutable.


What's next for Iso-Entropia

Phase 1: Historical Validation (NOW)

Retrospectively audit companies that collapsed during COVID-19:

  • Did our model predict collapse 6-12 weeks in advance?
  • What was the error margin?
  • Can we calibrate $$\theta_{max}$$ against real bankruptcy data?

Phase 2: Real-Time Integration (Q2 2025)

Connect to ERP systems (SAP, Oracle):

  • Live data feeds for I, K, $$D_e$$
  • Dashboard showing days until Hard Stop
  • Real-time alerts: "You have 4 weeks to implement mitigation"

Phase 3: AI-Driven Recommendations (Q3 2025)

Gemini 3 suggests specific actions:

  • "Reduce I by 15%: Negotiate supplier contracts (2 weeks)"
  • "Increase K by 20%: Automate warehouse (6 weeks)"
  • Predictive impact: "If you implement Action 1 now, you gain 12 additional weeks"

Because the difference between a resilient company and a bankrupt one isn't luck—it's entropy management.

Built With

Share this project:

Updates

posted an update

Commits on Jan 17, 2026 78b553f | ca24894 | 97d9ad3

Resumen de la Actualización: En esta versión crítica, hemos eliminado las "ruedas de entrenamiento" del sistema para lograr una verdadera Arquitectura Neuro-Simbólica. Hemos conectado el motor determinista de física (Python) con el motor de razonamiento probabilístico (Gemini 3 Pro) de forma bidireccional y transparente.

Cambios Clave Implementados:

Grounding Físico Real (Adiós al Placebo): Se eliminaron los valores hardcoded de prueba en grounding.py. Ahora, los inputs de la UI (Volatilidad, Rigidez, Colchón) alteran directamente las variables termodinámicas (I, K, θmax) en tiempo real. El "Caos" matemático ahora refleja fielmente el escenario del usuario.

Activación del "Thinking Process" (Caja de Cristal): Habilitamos include_thoughts=True en la configuración del modelo. Innovación: Ahora capturamos y exponemos el "Pensamiento Oculto" de Gemini en la telemetría JSON. Los jueces pueden ver cómo el Agente planea sus experimentos antes de ejecutarlos, demostrando razonamiento genuino y no solo generación de texto.

Traducción Semántica de Negocio: Implementamos una capa de "Prompt Engineering de Traducción" en la fase CONCLUDE. Gemini ya no reporta solo "Bits de Entropía"; traduce dinámicamente esos valores a riesgos operativos tangibles según el contexto del usuario (ej. "Saturación de Urgencias" en lugar de "I=5.0").

⚖️ Recalibración de la Simulación: Ajustamos los valores de Entropía Externa (I) para crear escenarios de "Peligro Inminente" (dramáticos pero salvables) en lugar de "Colapso Instantáneo", permitiendo al Agente demostrar su capacidad de recuperación.

Resultado: Iso-Entropy ha pasado de ser un simulador teórico a un Auditor de Resiliencia Autónomo que entiende la física del negocio y explica su razonamiento paso a paso.

"Con esta actualización, demostramos que la IA no tiene por qué ser una caja negra. Al combinar la precisión de las Leyes de Ashby (Python) con el razonamiento explicable de Gemini 3 Pro, creamos una herramienta en la que los directivos pueden confiar."

Log in or sign up for Devpost to join the conversation.