What RedFlame does

Investment teams already use AI to summarize diligence and draft investment committee memos. The dangerous gap appears after those materials exist: revised evidence arrives, but old return calculations and investment assertions can quietly survive.

RedFlame treats new evidence like a pull request. It compares the definition, deterministically recompiles only the affected financial path, reruns versioned MOIC and IRR hurdles, marks dependent memo paragraphs stale, and asks a human to Accept, Keep, or Investigate the evidence. Accepting a fact never approves the investment.

The demo follows a PE Associate reviewing a revised seller model in which FY2030 Exit EBITDA changes from $24M to $20M. RedFlame:

  • distinguishes a comparable value change from an ambiguous definition change;
  • calculates Exit EV, Exit Equity, MOIC, and five-year IRR using deterministic decimal arithmetic;
  • reruns only the MOIC and IRR tests affected by Exit EBITDA;
  • reuses the unaffected customer-concentration test and exposes compiler metadata proving it;
  • marks the two dependent IC memo assertions stale;
  • blocks all derived values when metric definitions are not comparable;
  • converts accepted evidence into draft memo revisions while keeping the deal on HOLD;
  • produces a clearly labeled demo-local, unsigned Resolution Receipt.

Why I built it

The target workflow is a PE Associate preparing an IC memo when a revised seller model changes a key assumption. Existing AI workflows can search deal materials, preserve source lineage, update models, and regenerate memos. RedFlame focuses on a narrower control question:

Does the newly accepted evidence invalidate a decision the team previously believed had passed?

The current demo proves this mechanism on a controlled Deal Pack. It does not yet prove market demand, support arbitrary Excel models, or claim measured ROI.

How it was built

  • Next.js 16, React 19, TypeScript, and responsive CSS
  • Zod contracts for trusted fixtures and structured model output
  • decimal.js at precision 28 for deterministic financial calculations
  • An explicit dependency compiler that reports evaluated, reused, and blocked test IDs
  • OpenAI structured output for one bounded semantic-definition classification
  • A fail-closed model boundary: GPT-5.6 never calculates financial values or changes hurdle results
  • Vitest for formulas, domains, semantic policy, state transitions, and API boundaries
  • Playwright for the complete Accept → HOLD → Receipt → Revised Memo → Reset flow
  • Vercel deployment with optional Upstash-backed runtime safeguards

How Codex and GPT-5.6 were used

Codex was the engineering partner across contract design, implementation, test generation, browser QA, build repair, documentation, deployment, and evidence auditing. Browser testing caught a real React effect race that aborted its own semantic request; Codex helped identify the failure, repair it, and add coverage.

GPT-5.6 is intentionally constrained to interpreting ambiguous metric definitions. It returns structured semantic classifications behind strict validation and confidence gates. All financial calculations, dependency propagation, threshold tests, and state transitions remain deterministic code.

The repository includes a detailed CODEX.md mapping engineering tasks to files, commands, outcomes, corrections, and verification evidence.

What was challenging

  1. Drawing a credible boundary between AI understanding and financial judgment.
  2. Making “only affected tests rerun” observable rather than merely visual.
  3. Avoiding demo theater by labeling recorded fixtures and local-only receipts honestly.
  4. Turning a dependency graph into a complete, understandable review workflow.

What is novel

RedFlame combines a complete evidence-to-decision control loop:

candidate evidence
→ semantic comparability
→ calculation dependency propagation
→ executable investment hurdles
→ stale memo assertions
→ human evidence resolution

The novelty is the integrated control loop—not document search, memo generation, lineage, or assumption tracking in isolation.

What's next

  • Validate the workflow with investment professionals
  • Add normalized ingestion and a financial ontology layer
  • Add signed, server-persisted evidence-resolution history
  • Expose the deterministic compiler as an MCP service
  • Extend the graph to leverage, covenants, sensitivities, and full cash-flow IRR

Submission-period disclosure

The repository is a pre-existing public WeKnora fork. The redflame/ application, deterministic compiler, tests, evidence fixtures, UI, documentation, deployment, and demo automation were newly created for OpenAI Build Week on the codex/redflame-decision-ci branch. The existing WeKnora application is not represented as new work and is not required to run the RedFlame demo.

Built With

  • codex
  • decimal.js
  • gpt-5.6
  • next.js
  • openai-responses-api
  • playwright
  • react
  • typescript
  • upstash-redis
  • vercel
  • vitest
  • zod
Share this project:

Updates