Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

W7 slice 4: record the gate result (PASS: rho 0.905, set-F1 1.000, exact counts, 8/8 remote probes); design doc for slices 2-4

garrytanb4d8062ee583
diff --git a/docs/designs/FORECAST_JOURNAL.md b/docs/designs/FORECAST_JOURNAL.md
index 733f0c1789..b0419907e0 100644
--- a/docs/designs/FORECAST_JOURNAL.md
+++ b/docs/designs/FORECAST_JOURNAL.md
@@ -1,6 +1,6 @@
# Private forecast journal (wave 4b W7)
-Status: in progress (draft PR). Plan: gbrain-evals `docs/plans/2026-10-07-10x-memory-advantage/PLAN.md`, wave 4, row W7.
+Status: all four slices in #6886. Plan: gbrain-evals `docs/plans/2026-10-07-10x-memory-advantage/PLAN.md`, wave 4, row W7.
W7 makes each prediction in a brain auditable for its owner: what was predicted, when, by when it had to come true, how it was resolved and on what evidence, and how many predictions are still open. It extends `takes_scorecard` and `gbrain takes scorecard` instead of adding a `track_record` op. Everything new is private, which means trusted local only. `takes_scorecard` keeps returning exactly what it returns today to remote callers. Nothing public about real people ships from this wave.
@@ -38,27 +38,57 @@ The three bases:
**What stays the same.** `takes_list` and `takes_scorecard` return byte-identical output, locally and to remote callers, whether or not horizons exist. Tests on PGLite and Postgres check this.
-## Next slices (same PR, before it leaves draft)
-
-1. **Prediction time.** On sources with recording, the time a take was first recorded comes from the belief ledger (the first `take.asserted` event for its claim) and is certified. Elsewhere it falls back to `since_date`, labelled `uncertified` wherever it shows.
-2. **The journal view.** `gbrain takes journal` (trusted local) shows every prediction with:
- - its prediction time and certification;
- - its exact claim;
- - its horizon and basis;
- - its state: open, overdue (past the horizon and unresolved) or resolved;
- - its resolution and provenance: `resolved_by`, `resolved_source`, and the grade verdict when one is cached;
- - the denominator of unresolved predictions.
-3. **`takes_scorecard {group_by}`.** `group_by` is `holder` or `source`. The new fields go only to trusted local callers:
- - Beta-shrunk accuracy;
- - Brier skill score against the holder's base rate;
- - recency decay;
- - citations;
- - `min_n` with a `low_n` flag;
- - cohort uncertainty.
- A remote caller gets today's output byte for byte. A remote caller that passes `group_by` gets a typed refusal, so it is never silently ignored. N6-style probes check both.
-4. **Gate ($0, synthetic).**
- - Synthetic holders of known skill should give Spearman ρ ≥ 0.8 at n ≥ 10. This is a diagnostic.
- - "Who was right about T" is measured as set-F1.
- - Remote probes should show no access to the journal fields and byte-identical existing output.
+## Slice 2: prediction time and the journal
+
+`src/core/forecast-journal.ts` reads every active take that is not a fact as a prediction.
+
+**Prediction time.** The prediction time is when the belief ledger recorded the exact claim (claim, kind and holder) on its page:
+
+- **A take added after its page was created** has a live `take.asserted` event. Its first one gives the time.
+- **A take the page was created with** has no event of its own, because a page creation is one `page.published` snapshot (BELIEF_LEDGER.md section 4). Such a take gets the snapshot's time, but only when the ledger has recorded the source without a stop or restore since then, with no drift mark on the page. Otherwise the take could have been added while the ledger was not recording, so it falls back.
+- **A take whose first event is `take.transferred`** came from another page. It gets no recorded time.
+
+A recorded time is certified only where `coverageAt` certifies that instant, which means a managed source. Every other take shows its `since_date`, labelled `uncertified`. Tests on PGLite and Postgres cover four cases: a managed source (certified), an unmanaged one (recorded, uncertified), a take added later, and a coverage stop. A forced probe fails the stop case when the guard is removed.
+
+**The journal.** `gbrain takes journal` (trusted local) shows each prediction with:
+
+- its time and certification;
+- its claim, holder and weight;
+- its horizon and basis;
+- its state: `resolved`, `overdue`, `open` or `undated`;
+- its resolution: quality, `resolved_by` and `resolved_source`.
+
+It filters by `--holder`, `--about <slug-prefix>`, `--state`, `--since`, `--until` and `--source-id`, and `--limit` caps the list. The totals always count every match, so the unresolved denominator survives any filter on state or limit. A thin client refuses it as host-bound. There is no MCP op. The grade verdict cached by `gbrain takes grades` (W6, #6882) joins the entry once W6 lands.
+
+## Slice 3: `takes_scorecard {group_by}`
+
+With `group_by` set to `holder` or `source`, a trusted local caller gets the plain card unchanged plus two additions.
+
+**`groups`** has one row per group, with:
+
+- `n`, `correct`, `incorrect`, `partial` and `unresolvable`;
+- `accuracy`;
+- `accuracy_shrunk`: a Beta prior of 10 pseudo-observations centred on the pooled accuracy;
+- `accuracy_wilson95`;
+- `accuracy_recent`: weighted by a 365-day half-life since resolution;
+- `brier` and `brier_skill`: skill is measured against the group's own base rate;
+- `citations`: resolutions that name a source;
+- `open`, `overdue`, `undated` and `unresolved`;
+- `low_n`: below `min_n`, which defaults to 10.
+
+**`journal`** holds the journal totals.
+
+A remote caller that passes `group_by` or `min_n` is refused with `scorecard_group_by_local_only`. Without them, its output is what it was. `gbrain takes scorecard --group-by holder|source [--min-n N]` is the CLI form, and thin clients refuse it.
+
+## Slice 4: the $0 gate
+
+`evals/forecast-journal/`: the preregistration was frozen before the scored run. The gate uses 20 seeded cohorts of placeholder holders with known skill, 5,622 predictions in all. It passed:
+
+- median Spearman ρ of 0.905;
+- who-was-right set-F1 of 1.000;
+- exact denominator, `low_n` and labelling counts;
+- 8/8 remote probes.
+
+The details are in that directory's README.
The resolution policy for auto-resolve is out of W7's scope. Garry's decision (2026-10-16) is recorded with the take-grading follow-ups in gbrain-evals: a take whose numeric target was missed is never auto-applied, neither as `partial` nor as `incorrect`. It is held for manual review until the real sample settles which.
diff --git a/evals/forecast-journal/README.md b/evals/forecast-journal/README.md
index c0e1db9097..74e38467dd 100644
--- a/evals/forecast-journal/README.md
+++ b/evals/forecast-journal/README.md
@@ -10,7 +10,22 @@ The preregistration is [`PREREGISTRATION.md`](PREREGISTRATION.md).
## Current result
-Not run yet.
+**PASS.** Measured on 2026-10-17 at gbrain `65ed40ec6` (branch `capy/w7-forecast-journal`), using the instrument and preregistration frozen in that commit. It was one run of all 20 cohorts and 5,622 predictions. It cost $0 and took 7.4 s on in-memory PGLite.
+
+| Criterion | Threshold | Result |
+|---|---|---|
+| Median Spearman ρ, shrunk accuracy vs true skill (12 holders, n ≥ 10) | ≥ 0.80 | **0.905** (18 of 20 cohorts ≥ 0.80; lowest 0.741 and 0.748) |
+| Who-was-right set-F1, macro over 800 topic-cohorts | ≥ 0.95 | **1.000** |
+| Denominator (journal totals; each holder's n, unresolved, overdue, open) | exact | 0 mismatches |
+| `low_n` flags | exact | 0 mismatches |
+| Prediction times labelled `since_date`, uncertified | exact | 0 mismatches |
+| Remote probes | all pass | **8/8** |
+
+The median ρ for raw accuracy is also 0.905, so on these cohorts shrinkage neither helps nor hurts the median rank order. It changes ρ in 13 of 20 cohorts by −0.084 to +0.035. The cohorts with n from 10 to 30 differ less in sample size than a real brain would. Shrinkage matters most for a holder with few resolved predictions, and those holders are flagged `low_n` and kept out of ρ.
+
+The set-F1 of 1.000 and the exact counts are a ceiling. The journal reads the resolutions it was given, so these criteria guard against regressions rather than measure something hard. The ranking criterion is the only one with sampling noise.
+
+The run's `summary.json` and `summary.md` are not committed here. They are mirrored into gbrain-evals when W7 ships.
## What's here