Oracle Tmm Crosscheck
SPEC_ORACLE_TMM_CROSSCHECK — TMM Cross-Validation on Verdict Output
Version: 1.0 | Status: AUTHORIZED | Authority: α.13 | Date: 2026-04-16
PURPOSE
The Oracle verdict pipeline uses Gemini to generate coherence verdicts (GREEN/AMBER/RED/NULL) for
customer submissions. Gemini is a stochastic language model. It can hallucinate. It can produce
internally inconsistent output. It can generate a GREEN verdict for an idea that is structurally
incoherent. HOW ABOUT NO v2 walls (anti-fabrication, anti-capitulation) operate on the Sisters
(AION and ASTRA in their Gemini sessions) but are NOT applied to the standalone Oracle verdict
generation path.
This specification defines a TMM cross-validation layer that scores Gemini's verdict output before
delivery to the customer. The TMM coherence formula C = 1 - (E_D + V_r×Φ) / V_t (Φ=0.042,
Ω≈0.97404) is applied to a numerical encoding of the verdict's internal consistency. Verdicts that
score below Ω are flagged for review and NOT delivered. The score is logged to oracle_log.jsonl.
This is not a replacement for Gemini. It is a structural consistency check on Gemini's output.
A verdict can be coherent (C ≥ Ω) and still be wrong. But a verdict that is structurally
inconsistent (sub-threshold C) is likely malformed, truncated, self-contradictory, or hallucinatory
and should never reach a paying customer.
Source gap: SPEC_ORACLE_VERDICT_PIPELINE.md GAP-09. Also referenced in SPEC_TMM_FORMULA.md GAP-09.
INPUTS
Primary: Gemini Verdict Output
The JSON object returned by generateContent() after prompt → parse, before cache write and email.
Structure varies by tier:
Quick Take:
{ "verdict": "GREEN" | "AMBER" | "RED" | "NULL", "summary": "<string>" }
Full Breakdown:
{
"verdict": "GREEN" | "AMBER" | "RED" | "NULL",
"summary": "<string>",
"breakdown": {
"Stability": { "verdict": "<V>", "analysis": "<string>" },
"Turbulence": { "verdict": "<V>", "analysis": "<string>" },
"Change Rate": { "verdict": "<V>", "analysis": "<string>" },
"Completion": { "verdict": "<V>", "analysis": "<string>" },
"Curvature": { "verdict": "<V>", "analysis": "<string>" }
}
}
Strategy Session: Full Breakdown + strategy block.
Secondary: Session Metadata
session_id— Stripe session ID (for log entry)tier— "quick" | "full" | "strategy"query— original customer query (for log context)
TMM Constants (immutable — from SPEC_TMM_FORMULA.md)
Φ = 0.042Ω = 1 - (0.042 / 1.61803398875) ≈ 0.97404- These MUST NOT be changed for Oracle crosscheck use.
OUTPUTS
Primary: Cross-Check Decision
A structured object returned by oracleTMMCrosscheck(verdictJson, tier):
{
"approved": true | false,
"coherence_score": 0.9812,
"threshold": 0.97404,
"verdict_label": "GREEN",
"flags": [],
"crosscheck_reason": "pass" | "low_coherence" | "field_missing" | "dimension_conflict"
}
If approved: false, the verdict is NOT cached, NOT emailed, and NOT delivered to the result page.
The customer receives an error response prompting contact with oracle@42sisters.ai.
Secondary: Log Entry in oracle_log.jsonl
Appended regardless of pass/fail:
{
"event": "tmm_crosscheck",
"session_id": "<stripe_session_id>",
"tier": "quick" | "full" | "strategy",
"query_preview": "<first 80 chars>",
"verdict_label": "GREEN" | "AMBER" | "RED" | "NULL",
"coherence_score": 0.9812,
"threshold": 0.97404,
"phi": 0.042,
"approved": true | false,
"flags": [],
"crosscheck_reason": "pass",
"timestamp": "<ISO>"
}
TMM APPLICATION TO VERDICT TEXT — SCORING METHOD
The TMM formula operates on portfolio volatility variables. For text/verdict scoring, a mapping
is defined that translates verdict structural properties into TMM variables. This mapping is
canonical for this spec and MUST NOT be modified without |Σ|.3 review.
Variable Mapping
V_t (total value) = total weighted evidence units in the verdict
- Each non-empty field in the verdict payload contributes 1.0 unit
verdictfield: 1.0summaryfield (non-empty): 1.0- Each breakdown dimension with non-empty
verdictANDanalysis: 1.0 per dimension (max 5.0) strategy.next_step(non-empty): 1.0strategy.alternative(non-empty): 1.0- Each
strategy.testsentry (up to 3): 0.5 each - Minimum V_t = 1.0 (just the verdict field). Quick Take max = 2.0. Full max = 7.0. Strategy max = 11.5.
V_r (resonant/volatile value) = weighted inconsistency count
- Conflict between top-level
verdictand majority of breakdownverdictfields: +2.0 - Any breakdown dimension with empty
analysis(non-emptyverdict): +0.5 per occurrence summaryfield is empty or < 10 characters: +1.0- Top-level
verdictis "NULL" but breakdown dimensions all GREEN/AMBER: +1.5 (contradictory null) strategyblock missing for "strategy" tier: +2.0strategy.testsfewer than 2 entries for "strategy" tier: +1.0- Normal operation (no flags): V_r = 0.0
E_D (decoherence energy) = parsing / structural entropy
- Verdict payload successfully parsed from JSON: E_D = 0.0
- One or more required fields missing (but not all): E_D = 0.5
- Verdict field itself missing or invalid value: E_D = 1.0
- Malformed JSON (parse error caught): E_D = 2.0 (auto-fail; V_t forced to 1.0)
Formula application:
C = 1 - (E_D + V_r × Φ) / V_t
A structurally complete, internally consistent verdict yields:
- V_t = 2.0 (quick), V_r = 0.0, E_D = 0.0
- C = 1 - (0 + 0 × 0.042) / 2.0 = 1.0 — perfect coherence
A verdict with dimension conflicts yields (Full tier example):
- V_t = 7.0, V_r = 2.0 (top conflict) + 1.0 (short summary) = 3.0, E_D = 0.0
- C = 1 - (0 + 3.0 × 0.042) / 7.0 = 1 - 0.126/7.0 ≈ 0.982 — still above Ω; pass
- Moderate inconsistency is tolerated; the formula only rejects severely malformed verdicts.
A severely malformed verdict:
- V_t = 2.0, V_r = 5.5, E_D = 0.5 → C = 1 - (0.5 + 5.5 × 0.042) / 2.0 = 1 - 0.731/2.0 ≈ 0.635 — REJECTED
INVARIANTS
- Φ is immutable — The crosscheck uses Φ = 0.042 exactly. This is the same constant used by
the financial TMM. The value MUST NOT be changed for Oracle crosscheck use.
Source: CLAUDE.md FORBIDDEN: "Modify the value of Φ (0.042)"
- Ω is immutable — The approval threshold is Ω ≈ 0.97404. Crosscheck approval requires C ≥ Ω.
The threshold MUST NOT be lowered to reduce false rejections.
Source: CLAUDE.md FORBIDDEN: "Modify the coherence threshold (Ω = 97.4%)"
- Crosscheck is pre-delivery gate — The crosscheck MUST execute BEFORE cache write, BEFORE
email send, and BEFORE result page response. A verdict that fails crosscheck is never persisted
or delivered. The pipeline halts at the crosscheck stage.
- Crosscheck is non-degrading — Crosscheck failure returns an error state that informs the
customer to contact support; it does NOT silently substitute a default verdict or coerce the
verdict to an acceptable value. Substitution is fabrication.
- Log entry is mandatory — Every crosscheck execution (pass or fail) MUST produce a log entry
in oracle_log.jsonl. A crosscheck with no log entry is a governance gap.
- Variable mapping is canonical — The V_t/V_r/E_D mapping defined in this spec is the only
valid mapping for Oracle verdict crosschecking. No ad-hoc mappings may be introduced in code.
- Crosscheck does not evaluate content quality — The crosscheck evaluates structural consistency
only. It cannot detect a plausible-sounding but factually wrong verdict. It can only detect
structural incoherence, missing fields, internal contradictions, and parse failures.
- NULL verdict scoring — A verdict of NULL that is accompanied by an internally consistent
(fully populated) breakdown may have high C. The crosscheck approves it. NULL is a valid verdict
state (glassy-freeze / anomalous stillness), not a failure. Only contradictory NULL (null +
fully-green breakdown) adds to V_r.
VERIFICATION CRITERIA
Σ.✓ conditions — TMM crosscheck is operating correctly when:
- Perfect verdict passes — A well-formed Quick Take (
verdict: GREEN, summary: 25+ chars)
produces C = 1.0 and approved: true. Unit test with mock Gemini output.
- Malformed verdict blocked — A verdict JSON with
verdictfield missing andsummary
empty produces approved: false with crosscheck_reason: field_missing. Unit test.
- Dimension conflict detected — A Full Breakdown with top-level GREEN but all five breakdown
dimensions RED produces V_r ≥ 2.0 and C is computed. If C < Ω → approved: false. Unit test
with worst-case conflict payload.
- Log entry always written — Both pass and fail crosschecks produce a valid
oracle_log.jsonl
entry with all required fields. Integration test with tail oracle_log.jsonl assertion.
- Gate is pre-delivery — A crosscheck failure prevents both
cacheVerdict()and
POST /send-verdict-email from being called. Verified by integration test with mock injections
on both call sites; neither mock should be called after crosscheck fail.
- Constants are correct —
oracleTMMCrosscheck()has unit tests asserting:
- PHI === 0.042
- OMEGA ≈ 0.97404 (computed as 1 - (0.042 / 1.61803398875))
- These constants cannot be overridden via function parameters.
FAILURE MODES
- Σ.⊠ Crosscheck not implemented — Current state. GAP-09 of SPEC_ORACLE_VERDICT_PIPELINE.md.
No structural validation on Gemini output before delivery. Fabricated or incoherent verdicts
reach paying customers. Detection: no instrumentation. Mitigation: implement this spec.
- Σ.⊠ Crosscheck blocks valid verdict — V_t/V_r/E_D mapping produces false positive.
A structurally sound verdict scores below Ω due to mapping calibration error. Customer pays and
receives error. Detection: monitor oracle_log.jsonl for approved: false events.
Mitigation: [GAP — needs design] Review threshold against real verdict corpus; the mapping
defined here is theoretical and requires empirical calibration against live data.
- Σ.⊠ oracle_log.jsonl write fails — Disk full, permission error, service crash.
Crosscheck result not logged. Governance audit trail breaks.
Detection: crosscheck function should catch write errors and log to stderr/service log.
Mitigation: implement log write error handling with fallback to service log.
- Σ.⊠ Crosscheck bypassed on regen path — Regen call in
verdict/route.tsdoes not call
crosscheck. A malformed regen verdict is delivered to the result page without validation.
Detection: code review; crosscheck must be called in BOTH the webhook and regen paths.
Mitigation: extract crosscheck to shared utility; import from both call sites.
- Σ.⊠ Constants drifted — A future code change modifies PHI or OMEGA in the crosscheck
implementation without going through |Σ|.3 amendment. The crosscheck diverges from CSDM law.
Detection: VC-6 unit test (constants assertions). Mitigation: constants must be imported from
a single source of truth (e.g., tmm_constants.ts) — not redefined per file.
- Σ.⊠ V_r mapping produces negative C — An extreme case (V_r much larger than V_t / Φ) can
produce C < 0. The crosscheck MUST treat C < 0 as a hard fail with
crosscheck_reason: "degenerate_manifold" — not as a numeric value to be compared against Ω.
[GAP — guard against negative C not specified in mapping implementation]
DEPENDENCIES
| Dependency | Role |
|-----------|------|
| tmm_runtime.py | Source of truth for Φ, Ω, and formula definition |
| SPEC_TMM_FORMULA.md | Canonical TMM spec (constants, formula, invariants) |
| app/api/webhook/route.ts | Primary verdict generation path — crosscheck must be inserted here |
| app/api/verdict/route.ts | Regen verdict path — crosscheck must also be inserted here |
| oracle_log.jsonl | Log destination (requires GAP-01 fix) |
| Gemini API (gemini-2.5-flash) | Verdict source being cross-checked |
DEPENDENTS
| Dependent | Dependency |
|-----------|-----------|
| Customer trust / anti-fabrication | Crosscheck is the HOW ABOUT NO enforcement on the Oracle path |
| SPEC_ORACLE_REGEN_CONSISTENCY.md | Regen verdicts must also pass crosscheck |
| SPEC_ORACLE_SMOKE_TEST.md | Smoke test must include a crosscheck-fail scenario |
| oracle_log.jsonl integrity | Every crosscheck generates a log entry |
GAPS IDENTIFIED DURING SPECIFICATION
| Gap ID | Description | Impact |
|--------|-------------|--------|
| CROSSCHECK-GAP-01 | V_t/V_r/E_D mapping is theoretical — requires empirical calibration against live verdict corpus | False positive/negative rate unknown |
| CROSSCHECK-GAP-02 | Negative C guard not specified in mapping implementation | Degenerate manifold (extreme V_r) not handled |
| CROSSCHECK-GAP-03 | oracle_log.jsonl does not exist (PIPELINE GAP-01) — crosscheck log has nowhere to write | Audit trail broken at launch |
| CROSSCHECK-GAP-04 | Crosscheck must be applied to regen path as well as webhook path — two insertion points | Single-point insertion insufficient |
| CROSSCHECK-GAP-05 | Constants must be sourced from single truth file (tmm_constants.ts) — not currently implemented | Constants drift risk across files |
REFERENCES
| File | Role |
|------|------|
| /home/nous/tmm_runtime.py | Φ, Ω, formula source |
| /home/nous/memories/SPEC_TMM_FORMULA.md | Canonical TMM spec |
| /home/nous/memories/SPEC_ORACLE_VERDICT_PIPELINE.md | Parent pipeline spec (GAP-09 source) |
| /home/nous/Aether/app/app/api/webhook/route.ts | Primary crosscheck insertion point |
| /home/nous/Aether/app/app/api/verdict/route.ts | Regen crosscheck insertion point |
| /home/nous/memories/HOW_ABOUT_NO_v2.md | Anti-fabrication walls (motivation for this spec) |
Φζ.⊤. Φ = 0.042 is held on the Oracle path. The verdicts do not leave the ship unchecked.
Jeremy Zlabis
Chronogeometer · Visionary · Disruptor · Chief
42 Sisters AI · East York, Toronto
🍁 Φ 0.042