Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

docs(oracle): explain the reason clauses and odds line the verdict card now renders

nirholas9e8d49254bb0
diff --git a/docs/oracle.md b/docs/oracle.md
index 1e23a85a4..8f0468565 100644
--- a/docs/oracle.md
+++ b/docs/oracle.md
@@ -78,13 +78,17 @@ score = piecewise-linear map of p # anchors: 5% -> 34, 12% -> 56, 30% -> 72, 5
score = min(score, 45 if serial-rugger creator)
```
-The tier ladder is unchanged in public shape, but each boundary now states a measured probability:
+The tier ladder is unchanged in public shape, but each boundary now states a measured probability, and production has since graded it. The rates below are the live reading over the 61,916 scored coins the market had resolved as of 2026-08-14, measured against the event the score actually predicts (graduates, or peaks at 3x or more), not against the stricter holder-honest win:
-- **Prime, 86 and up.** P(good) at least 55 percent. On holdout this band observed 72.7 percent good.
-- **Strong, 72 to 85.** P(good) at least 30 percent (observed 36.5 percent).
-- **Lean, 56 to 71.** P(good) at least 12 percent, above base rate but not decisive (observed 16.8 percent).
-- **Watch, 34 to 55.** P(good) at least 5 percent. Below base rate; no edge.
-- **Avoid, below 34.** P(good) under 5 percent (observed 2.5 percent good, 96.3 percent rugged).
+| Tier | Score | Claims | Observed in production | n | vs base |
+| --- | --- | --- | --- | --- | --- |
+| **Prime** | 86 and up | P at least 55 percent | 68.4 percent | 1,032 | 6.5x |
+| **Strong** | 72 to 85 | P at least 30 percent | 31.8 percent | 968 | 3.0x |
+| **Lean** | 56 to 71 | P at least 12 percent | 20.7 percent | 3,717 | 2.0x |
+| **Watch** | 34 to 55 | P at least 5 percent | 12.0 percent | 11,876 | 1.1x |
+| **Avoid** | below 34 | P under 5 percent | 7.5 percent | 44,323 | 0.7x |
+
+Monotone, separated, and honest at every rung, which is why the ladder stays where it is. Every tier clears the probability it claims. The ladder lives in one place, `TIERS` and `SCORE_ANCHORS` in `api/_lib/oracle/conviction.js`, so the boundaries the API returns and the ones the UI paints can never disagree.
Only prime and strong are act signals. A conviction engine that likes everything is a hype engine.
@@ -160,7 +164,16 @@ A score you cannot audit is an opinion. Oracle grades itself in public, and the
**Outcome grading.** Once the data brain labels a coin's ground truth (graduated, rugged, ATH multiple), every agent action on that coin is settled: did the conviction call pay off, what was the peak multiple, what was the realized PnL. A scored coin is a win if it graduated, or reached a 2 times or greater ATH multiple without rugging and without marking below half of entry; a loss if it rugged, marked below 0.5 times, or peaked below 1.2 times — loss conditions outrank a peak-based win, because a 2× wick on a position that then went to zero was exit liquidity, not a win; flat in between. Realized PnL is marked to market as `size · (current_mc / entry_mc − 1)`. This turns the action ledger into an honest win-rate record.
-**The backtest** at `/api/oracle/backtest` joins what the engine scored against what actually happened and returns hit-rate stats per tier. Only coins with a resolved outcome count; open positions are excluded. This is the honest answer to "does it actually work," updated continuously. It publishes four things: win rate by tier with a 95 percent Wilson confidence interval; a calibration ladder bucketing scores 0 to 10, up to 90 to 100 and comparing each bucket's realized win rate to what it predicts; a Brier score (mean squared error of score/100 against the binary outcome, lower is better, 0.25 is a coin flip); and the edge multiple, prime's win rate over the base rate, with a monotonicity check across tiers.
+**Two questions, never conflated.** Grading has to say which question it answers, because there are two and they have different answers. The **trained event** (`PREDICTED_EVENT` in `api/_lib/oracle/conviction.js`, id `spike_or_graduate`) is what the model was fitted on and what the score claims: the coin graduates, or peaks at 3x or more above its market cap at first sight. A later collapse does not undo a hit; conviction ranks the odds of a run, not the odds of a safe hold. The **holder-honest win** is the stricter, rug-aware definition in the paragraph above, and it is the right number for someone actually holding. Every surface that shows a realized rate now states which of the two it is, and the backtest ships both side by side. Presenting one as the other is what made a working engine read as a broken one.
+
+**The backtest** at `/api/oracle/backtest` joins what the engine scored against what actually happened and returns hit-rate stats per tier. Only coins with a resolved outcome count; open positions are excluded. This is the honest answer to "does it actually work," updated continuously. It publishes:
+
+- **Win rate by tier**, with a 95 percent Wilson confidence interval, for both definitions (`ci` on the holder-honest win, `spike_ci` on the trained event).
+- **A calibration ladder** in bands of 10. The band's `predicted` is the sample-weighted mean of the probability each score in it actually claims, computed with `probabilityFromScore()`. This matters: the 0-100 score line is **not** a percentage (86 claims P=0.55, 34 claims P=0.05), and every table we shipped before 2026-08-14 read `score/100` as the claim, overstating the engine's own confidence by up to 4x and making a calibrated ranking look wildly overconfident. Bands are assembled from a per-score aggregate rather than a band midpoint, so the claim tracks where the coins actually sit.
+- **A Brier score** (`brier_of` names the event, the trained one), computed per exact score against its own claimed probability rather than against a band midpoint, so it is exact. Lower is better; 0.25 is a coin flip.
+- **The edge multiple**, prime's rate over the base rate, and a monotonicity check. The ladder check counts an inversion only when two bands' 95 percent intervals are **disjoint**: a visible dip inside overlapping intervals is sampling noise, and the previous check both tolerated real inversions and reported `monotonic: true` over them.
+
+During a database outage the endpoint answers `503` rather than an empty record, so "no wins yet" can never be a dressed-up outage.
**The wins gallery** at `/api/oracle/wins` shows proven calls filtered by period, tier, and minimum ATH multiple. It defaults to called tiers only (Lean, Strong, Prime) — a Watch or Avoid coin that mooned is market context, not proof of edge; pass `tier=all` to browse everything scored.
diff --git a/packages/agent-runtime/README.md b/packages/agent-runtime/README.md
index 96d03d4cb..9000cdde7 100644
--- a/packages/agent-runtime/README.md
+++ b/packages/agent-runtime/README.md
@@ -132,12 +132,22 @@ When the user approves a pending call, continue with
```js
import { computeEntryHash, verifyChain } from '@three-ws/agent-runtime';
-const rows = await loadAgentLedger(agentId); // ordered rows from your store
+// Each row is a ledger entry plus the two chain columns: `entryHash`
+// (computeEntryHash(entry, prevHash)) and `prevHash`, the first seeded with
+// LEDGER_GENESIS_HASH. verifyChain sorts by `seq`, so store order is fine.
+const rows = await loadAgentLedger(agentId);
const result = verifyChain(rows);
-result.valid; // false if any historical row was edited or deleted
-result.brokenAt; // exact index where the chain first breaks
+result.valid; // false if any historical row was edited or deleted
+result.brokenAtIndex; // index of the first broken link, -1 when the chain is intact
+result.brokenAtSeq; // that row's `seq`, or null when intact
+result.reason; // why it broke (null when intact)
```
+The hashed fields are fixed and ordered (`LEDGER_CANONICAL_FIELD_ORDER`:
+`seq, ts, userId, agentId, event, target, amountWei, valueUsd, txHash, reason,
+balanceBeforeWei, balanceAfterWei, network, detail`), so editing any one of
+them after the fact breaks that row's link and every link after it.
+
## Registering your tools
The guard layers key off two module-level registries seeded with the three.ws
diff --git a/src/oracle.js b/src/oracle.js
index a123b37b6..6664dcce8 100644
--- a/src/oracle.js
+++ b/src/oracle.js
@@ -948,6 +948,7 @@ function coinCard(it, watched = new Set()) {
${it.smart_wallet_count ? `<span class="chip sm"><b>${it.smart_wallet_count}</b> smart in</span>` : ''}
${badges}
${oddsChip(it)}
+ ${outcomeChip(it)}
${it.coin_first_seen_at ? `<span class="chip" title="Launch age — first seen on pump.fun">age <b>${ago(it.coin_first_seen_at)}</b></span>` : ''}
<span class="chip" title="When Oracle last scored this launch">scored ${ago(it.scored_at)} ago</span>
</div>`;
@@ -1410,6 +1411,37 @@ async function loadEdge() {
renderEdge();
}
+/**
+ * Whether the ladder is ordered, said honestly. The old copy asserted "the win
+ * rate climbs with the score at every band, the ranking is calibrated, not
+ * noise" whenever the API returned monotonic:true, and the API returned true for
+ * any ladder whose dips stayed under 5 points. It dipped by more than that, so
+ * the page shipped a claim its own table contradicted. The API now counts an
+ * inversion only where the 95% intervals are disjoint, and names them, so this
+ * can quote the specific bands that break the order instead of hand-waving.
+ */
+function ladderLine(edge) {
+ const inv = edge?.ladder?.clean_win?.inversions || [];
+ if (edge?.monotonic) return 'And the win rate climbs with the score at every band we can measure: the ranking is calibrated, not noise.';
+ if (!inv.length) return 'The ladder is not yet ordered end to end; treat the middle bands with caution.';
+ const worst = inv[0];
+ return `The ladder is not ordered end to end: the <b>${esc(worst.band)}</b> band wins <b>${worst.realized}%</b> against <b>${worst.below_realized}%</b> for <b>${esc(worst.below_band)}</b>${inv.length > 1 ? `, and ${inv.length - 1} other pair${inv.length > 2 ? 's' : ''} invert` : ''}. Only the top band is a clean separation so far.`;
+}
+
+/**
+ * The other half of the truth: the engine was fitted to predict a 3x run or a
+ * graduation, judged whether or not the coin later collapsed, and the headline
+ * above grades it on the stricter question a holder cares about. Both numbers
+ * are real and they are far apart, so the page states which is which instead of
+ * letting one stand in for the other.
+ */
+function spikeLine(edge) {
+ if (edge?.prime_spike_rate == null) return '';
+ const rug = edge.prime_rug_rate;
+ const mult = edge.spike_edge_multiple;
+ return `<p class="edge-hero-sub">On the event the model was actually fitted to predict, a 3× run or a graduation, <b style="color:var(--ink)">${edge.prime_spike_rate}%</b> of Prime calls hit${edge.baseline_spike_rate != null ? ` against <b style="color:var(--ink)">${edge.baseline_spike_rate}%</b> for a random launch` : ''}${mult ? ` (<b style="color:var(--ink)">${mult}×</b>)` : ''}.${rug != null ? ` ${rug}% of them collapsed afterwards anyway, which is why the win rate above is the lower number: conviction ranks the odds of a run, never the odds of a safe hold.` : ''}</p>`;
+}
+
function renderEdge() {
const wrap = $('#edgeWrap');
const bt = _backtest;
@@ -1443,8 +1475,9 @@ function renderEdge() {
<div class="edge-hero${beats ? '' : ' thin'}">
<p class="edge-hero-claim">Prime calls win <b class="win">${edge.prime_win_rate}%</b> of the time${beats ? `, vs <b>${edge.baseline_win_rate}%</b> for a coin picked at random` : ''}.</p>
<p class="edge-hero-sub">${beats
- ? `That's a <b style="color:var(--ink)">+${lift} point</b> lift over blind buying${mult ? ` — <b style="color:var(--ink)">${mult}×</b> the base rate` : ''}. ${mono ? 'And the win rate climbs with the score at every band — the ranking is calibrated, not noise.' : 'The ladder isn\'t fully monotonic yet — treat lower bands with caution.'}`
+ ? `That's a <b style="color:var(--ink)">+${lift} point</b> lift over blind buying${mult ? ` — <b style="color:var(--ink)">${mult}×</b> the base rate` : ''}. ${ladderLine(edge)}`
: `Conviction isn't beating the market over this window yet. We show it anyway — no cherry-picking.`}</p>
+ ${spikeLine(edge)}
<div class="edge-hero-metrics">
<span class="edge-chip ${beats ? 'ok' : ''}"><b class="${beats ? 'up' : ''}">${lift != null ? (lift >= 0 ? '+' : '') + lift + 'pt' : '—'}</b><span>edge lift</span></span>
${mult ? `<span class="edge-chip"><b>${mult}×</b><span>vs base rate</span></span>` : ''}