Inspiration

Limina — The Frankenstein of Scientific Verification: A stitched-together fusion of probabilistic LLM extraction (NVIDIA NIM), a deterministic interval-arithmetic physics engine (Rust), and a real-time procedural 3D WebGL laboratory (Angular 21 + Three.js).

Large Language Models write fluent engineering prose, yet they routinely endorse numbers that violate fundamental laws of nature—claiming heat engines above the Carnot efficiency ceiling, wind turbines past the Betz limit, or applying thermal cycle bounds to fuel cells and solar cells where those assumptions do not hold. Purely statistical models lack compile-time SI dimensional algebra, interval arithmetic over uncertain inputs, and formal tracking of physical assumptions.

We built Limina around one strict architectural firewall: LLMs read prose and propose candidate rules, while deterministic Rust computes every physical bound, dimensional check, and final verdict.


What it does

Limina audits quantitative engineering claims against 35 declarative physical bounds across five domains of physics, visualizes theoretical limit barriers in interactive 3D, compiles user-authored rules from plain English, and lints technical Markdown documents in CI and agent workflows.

How a Claim Flows Through Limina

Paste text or drop an image \(\rightarrow\) Extract quantities & units (NVIDIA NIM) \(\rightarrow\) Evaluate SI bounds (Rust) \(\rightarrow\) Inspect in 3D & export audit report

1. Three Integrated Interfaces

  • Analysis Workbench (Text & Image Claim Auditing):
    • Paste technical prose (up to 5,000 characters) or drop an image (PNG, JPEG, WebP transcribed via /v1/transcribe).
    • Evaluates every extracted claim into one of four deterministic verdicts—COMPATIBLE, CONDITIONAL, IMPOSSIBLE, or INSUFFICIENT_DATA—backed by theoretical ratios, peer-reviewed DOIs, and explicit physical assumptions.
    • Includes per-claim interactive instruments (gauges, Carnot/COP visualizers, curve explorers), a Ctrl+K command palette, and structured PDF report export (pdfmake).

Limina Analysis Workbench — Six-Discipline Claim Audit & Deterministic Verdicts

  • Interactive 3D Physics Laboratory (/laboratory):
    • Dual Visualization Modes: Switch between Physical apparatus—which procedurally assembles one of four generic physical benches (flow, trajectory, wave, or quantum) strictly from parameter units and kinds without hardcoding law names—and Mathematical boundary, mapping 0 parameters to a chamber (/v1/evaluate), 1 parameter to a corridor (/v1/curve), and 2+ parameters to a 30 × 30 3D surface grid (/v1/surface).
    • Live Limit Barrier & Breaking-Point Solver: Drag bench elements directly or edit values and units in real time; crossing a theoretical bound triggers a hatched past-limit overlay and a 3D alert barrier. Clicking Find breaking point (/v1/solve) computes the exact threshold where a system crosses into IMPOSSIBLE.
    • Multi-Law System Stress Test: Load 2 to 4 physical laws simultaneously and sweep a System load slider (20% to 150%) to locate the First breaking limit.

Limina 3D Physics Laboratory — Carnot Mathematical Boundary Surface & Claim Probe

  • Live Law Forge & Markdown Physics Linter CLI (limina check):
    • Describe a new physical constraint in plain English (POST /v1/limits/author) to compile its SI formula and spawn a live 3D bench tagged Draft: written by AI, not validated.
    • Run limina check design-spec.md in local workflows or agent hooks (with --format text or --format json) to audit documents using deterministic exit codes (0 clean, 1 at least one IMPOSSIBLE, 2 execution error).

Limina Live Law Forge — Natural-Language Rule Synthesis

2. Physics Coverage: 35 Bounds Across 5 Domains

Every built-in law is stored in data/limits/*.json with its mathematical formula, bounded SI dimension, constraint direction (max, min, or equal), validity domain, peer-reviewed references, and explicit limitations:

Domain Count Representative Governing Equations Bounded SI Units
Mechanics & Relativity 13 \(\Delta v \le v_e \ln\!\left(\frac{\max(m_0, m_f)}{\min(m_0, m_f)}\right)\) m/s, J, W, N, s, dimensionless
Thermodynamics & Info 6 \(\eta \le 1 - \frac{T_c}{T_h}, \qquad E \ge k_B T \ln 2\) dimensionless, W/m², bit/s, J
Electromagnetism & Optics 8 \(F = \frac{\lvert q_1 q_2 \rvert}{4\pi\varepsilon_0 r^2}, \qquad d \ge \frac{\lambda}{2\,\text{NA}}\) N, V, J, m, rad, lm/W
Quantum, Atomic & Nuclear 5 \(\Delta x \ge \frac{\hbar}{2\Delta p}, \qquad Q = \lvert m_i - m_f \rvert c^2\) m, J, dimensionless
Astrophysics & Cosmology 3 \(r_s = \frac{2GM}{c^2}, \qquad H = \sqrt{\frac{8\pi G \rho}{3}}\) W, m, Hz
  • Mechanics & Relativity (13): speed_limit, tsiolkovsky, mass_energy, power_conservation, escape_speed_min, energy_momentum, relativistic_kinetic_energy, time_dilation, length_contraction, newton_gravity, kepler_third, escape_velocity, betz
  • Thermodynamics & Information (6): carnot, cop, stefan_boltzmann, shannon_hartley, landauer, shockley_queisser
  • Electromagnetism & Optics (8): coulomb, faraday_emf, photon_energy, photon_energy_wavelength, lorentz_force, abbe_limit, rayleigh_criterion, luminous_efficacy
  • Quantum, Atomic & Nuclear (5): heisenberg, de_broglie, nuclear_q, hydrogen_levels, radioactive_decay
  • Astrophysics & Cosmology (3): eddington_luminosity, schwarzschild_radius, friedmann_flat

3. Real Production Trace: Catching an Unstated Heat-Engine Assumption

Suppose an engineering draft claims an energy conversion efficiency of \(\eta = 0.90\) operating between \(T_h = 600\text{ K}\) and \(T_c = 300\text{ K}\), without specifying whether the device is a two-reservoir heat engine. Limina computes the Carnot ceiling:

$$ \eta_{\text{Carnot}} = 1 - \frac{T_c}{T_h} = 1 - \frac{300}{600} = 0.50 \qquad \left(\text{Exceedance Ratio} = \frac{0.90}{0.50} = 1.8\times\right) $$

Instead of falsely rejecting a fuel cell or electrochemical system as IMPOSSIBLE, POST /v1/evaluate returns CONDITIONAL with the exact assumption required (using 1e+300 as the sentinel value for an open upper bound when the heat-engine cycle assumption is not stated):

POST /v1/evaluate — Real Production Trace


How we built it

High-Level Architecture

LIMINA — Neuro-Symbolic Chimera Architecture

1. Deterministic Rust Engine (limina-core & limina-dsl)

Our 5-crate Rust 2021 workspace (limina-core, limina-dsl, limina-extract, limina-api, limina-cli) isolates all physical math inside limina-core, which depends solely on thiserror with zero unwrap() calls in library crates:

crates/limina-core/src/ — Dimension, Interval, ParameterEnclosure & Verdict

Why this matters: Every numerical input is wrapped in a finite Interval and tagged with a 7-dimensional SI exponent vector at runtime. At startup, limina-dsl compiles all 35 JSON laws alongside 3 native Rust reference laws (betz, carnot, cop), rejecting dimensional mismatches (DimensionMismatch, DimensionlessArgumentRequired, OddExponentUnderSqrt, TemperatureKindMismatch) before a single user request is served, and lowering equal-direction laws into dual bounds \(F(x) \pm \lvert F(x) \rvert t\).

2. Neuro-Symbolic Extraction & Dual-Model Law Forge (NVIDIA NIM)

Real-Time Claim Verification Pipeline

All LLM interactions sit behind the ExtractionProvider Rust trait (nvidia/nemotron-3.5-lightning-30b-a3b, nvidia/nemotron-3-ultra-550b-a55b, and poolside/laguna-xs-2.1 fallback, guarded by a 15-second timeout and 60-second failure cooldown):

  1. Law Identification: Maps prose or transcribed images to one of the 35 built-in limits.
  2. Dual-Model Law Synthesis (Forge): When no built-in law applies, two independent models compile the user's English sentence into JSON DSL definitions and are cross-checked across 200 fixed-seed samples within a \(10^{-6}\) tolerance (compare.rs). Both models must agree across at least 50 mutually valid samples to earn draft_agreed; otherwise the candidate is quarantined as draft_disputed and emits no verdict.
  3. Parameter Extraction: Extracts numerical values, uncertainties, and units.
  4. Deterministic Evaluation: Hands intervals to limina_core::decide.

Live Law Forge — Safe Natural-Language Compilation

3. Spec-Driven Development & Guardrails with Kiro

We engineered Limina using 146 tracked .kiro/ files (48 specs, 7 steering rules, and 4 automated hooks) to keep generative AI strictly bounded during development:

Kiro Pillar Repository Implementation Concrete Impact on Code Quality
Specs (48) decision-engine (v5 rules P-02, P-03, E-04), two-model-laws, laboratory-3d Linked numbered specification invariants directly to Rust property tests and forbade hardcoded law names in 3D scene builders.
Steering (7) Global (product.md, structure.md, tech.md) + file-scoped (physics-rules.md, testing.md, physics-claims.md, ui-design.md) Enforced SI Kelvin temperatures, banned invented physical constants, and blocked unverified claims in documentation.
Hooks (4) submission-guard.json, core-tests-on-save.json, physics-lint.json, permission-guard.json Automatically ran cargo fmt, clippy, and core tests on .rs saves, and executed limina check whenever Markdown docs were edited.
Property Tests proptest 1.12.0 across 22 Rust test files (differential.rs, never_impossible.rs, rules_props.rs) Verified parity between JSON DSL laws and native Rust references (Betz, Carnot, COP) and proved draft laws never emit IMPOSSIBLE.

4. Frontend (Angular 21.2 + Three.js 0.187.0) & Production Stack

  • Backend & Rate Limiting: Served by Axum 0.8.9 and Tokio 1.54.1 with per-IP rate limiting (15 requests/hour default) on LLM-backed endpoints (/v1/analyze, /v1/limits/author, /v1/transcribe).
  • Interactive 3D Client: Built with Angular 21.2, PrimeNG, Tailwind CSS 4, Three.js 0.187.0 (UnrealBloomPass lighting), a zero-asset Web Audio procedural synthesizer (lab-audio.ts), and automatic WebGL fallback detection.
  • CI/CD & Hosting: GitHub Actions (ci.yml) runs cargo fmt --check, cargo clippy -D warnings, and cargo test --workspace on every push; deploy.yml ships release binaries to our VPS behind Nginx and Cloudflare at https://limina.backnd-api.cloud alongside a multi-stage Dockerfile.

Challenges we ran into

  • Eliminating False IMPOSSIBLE Verdicts on Non-Heat-Engine Systems (6ecc1b0): Carnot's efficiency limit \(\eta \le 1 - \frac{T_c}{T_h}\) initially flagged fuel cells, batteries, and solar cells operating between two temperatures as IMPOSSIBLE. Without touching the frozen limina-core v5 engine, we wrapped Carnot in the API qualification layer (qualified.rs) with an open conversion_process assumption so missing heat-engine context yields CONDITIONAL—locked in by carnot_without_a_stated_heat_engine_is_never_impossible.
  • Quarantining Unvalidated AI-Authored Rules (6ecc1b0): Even when two models agree across 200 samples, an AI-synthesized formula lacks external peer review. We updated compare.rs to require at least 50 mutually valid samples, restricted evaluation strictly to the compared parameter ranges, and wrapped every draft-* law in an open draft_formula assumption (a_draft_law_is_never_impossible).
  • Floating-Point Guard Behavior Near Zero Bounds (regressions.rs): Mutation testing on rules_max surfaced minimal counterexamples near zero bounds (\(10^{-12}\) and \(5.4989 \times 10^{-13}\) against 0), alongside .proptest-regressions pairs such as \((T_h, T_c) = (1.0002965067023164, 1.0)\). We removed absolute zero-guard terms in favor of relative tolerances (Decision D-24) and preserved the counterexamples in regressions.rs.
  • Rendering 35 Diverse Laws in 3D Without Hardcoding Scenes: Instead of building 35 bespoke 3D scenes, we engineered apparatus.ts to assemble four generic physical benches (flow, trajectory, wave, quantum) strictly from parameter units and kinds, while topology.ts maps 0, 1, or 2+ parameters to a chamber, corridor, or 30 × 30 surface grid.

Accomplishments that we're proud of

  • Zero-Hallucination Verdict Guarantee: Enforcing a hard architectural boundary where LLMs parse text and draft candidate rules, while every mathematical bound and verdict is computed deterministically in Rust with zero unwrap() calls in library crates.
  • Differential & Property-Based Proof Suite: Validating engine invariants across 22 Rust test files with proptest 1.12.0, proving numerical parity between declarative JSON DSL laws and native Rust reference implementations of Betz (\(C_p \le \frac{16}{27}\)), Carnot, and COP.
  • First-Class Scientific Transparency: Embedding peer-reviewed DOIs, validity domains, assumption branches (such as Shockley-Queisser single-junction 33.7% vs. multi-junction/concentrated 86.8%), and explicit limitations inside every law file.

What we learned

  • Isolating generative models upstream of an interval-arithmetic symbolic engine turns LLMs into reliable extraction interfaces while making mathematical hallucinations structurally impossible in the verdict layer.
  • Executable Kiro governance—combining file-scoped steering rules, numbered specification invariants (P-02, P-03, E-04), and save hooks (core-tests-on-save, physics-lint)—catches dimensional errors, formatting drift, and unstated assumptions immediately during development.

What's next for Limina

  • Model Context Protocol (limina-mcp) Server: Exposing /v1/evaluate and /v1/limits over MCP so external AI coding assistants and simulation pipelines can verify physical feasibility automatically before generating hardware specs.
  • Persistent Law Registry: Adding database persistence (such as SQLite) beyond in-memory drafts so engineering teams can review, version, and promote domain-validated laws.
  • External Peer Review & Coverage Expansion: Submitting the 35 built-in JSON law definitions for formal domain-expert review and expanding coverage into structural mechanics and fluid dynamics.

Built With

Share this project:

Updates

Submission history