Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

P4 eval: streaming dev pilot summary (Sonnet, 20 questions), preregistration records the harness, A′ build, metric definitions and the measured power

garrytanebc4ad47812e
diff --git a/docs/eval/CORE_MEMORY_PREREGISTRATION.md b/docs/eval/CORE_MEMORY_PREREGISTRATION.md
index 8eed74fd3f..f9e7dcdf00 100644
--- a/docs/eval/CORE_MEMORY_PREREGISTRATION.md
+++ b/docs/eval/CORE_MEMORY_PREREGISTRATION.md
@@ -32,15 +32,36 @@ every session?
from the first session only, never from the question). Only arms C and D mark
it as core.
+## Harness
+
+gbrain-evals `eval/runner/p4-stream/` (branch `capy/p4-streaming-harness`,
+`4c98318` at preregistration; the sealed run pins its own commit here first):
+
+- Each cell (question × arm × model) gets a fresh PGLite brain built by the
+ arm's gbrain build, served as `gbrain serve --surface starter` over stdio.
+ The agent sees the starter tools and the first 2,048 characters of the
+ server instructions (Claude Code's per-server cap).
+- Haystack sessions stream in date order. A session's turns up to its last
+ user message are replayed as history; the last user message is a live turn
+ with a 700-token reply cap. Before each live turn the build's real
+ `gbrain hook user-prompt` runs against a Claude Code-shaped transcript and
+ its `additionalContext` is injected as a system reminder.
+- When the next session would pass 95% of the window, `gbrain hook compact`
+ runs, the model summarizes the conversation (2,500-token cap), a
+ `compact_boundary` line is written, the history is replaced by the summary,
+ and `gbrain hook session-start` (source `compact`) is injected.
+- The question is a final live turn; its answer is judged 10 times with the
+ LongMemEval judge prompt and `gpt-4o-2024-08-06`.
+
## Arms
| Arm | gbrain build | What the agent gets |
|---|---|---|
-| A | master | Baseline. |
-| A′ | master + the MCP instructions reorder (separate change) | Baseline with prompt-critical instructions inside the 2,048-char cap. |
-| B | A′ + `remember` `items[]` + pressure notice | Notice at 80% fill; batch save. `memory.pressure.context_window` set to the simulated window. |
-| C | A′ + core delivery | The profile page is core and loaded every session. |
-| D | B + C, agent may edit core | Both, with remote edits to core allowed (`memory.core.remote_edit=notify`). |
+| A | master `6622a119e` | Baseline. |
+| A′ | gbrain#6025 head `5c82936a2` | Baseline with the MCP instructions reordered so prompt-critical clauses start under the 2,048-char cap (built from that PR's commit, per the custodian's direction; master once it merges). |
+| B | A′ merged with this PR (`73bd681cb`); `memory.core.enabled=false`, `memory.pressure.enabled=true`, `memory.pressure.context_window` = the window | Notice at 80% fill; `remember` with `items`. |
+| C | same build; `memory.core.enabled=true`, `memory.pressure.enabled=false` | The profile page is core and loaded every session. |
+| D | same build; pressure on, core on, `memory.core.remote_edit=notify` | Both, with remote edits to core allowed. |
## Models
@@ -60,11 +81,14 @@ the budget is re-estimated with the slice size.
- Judged accuracy, 10 judge passes per answer, reported as mean ± SD, overall
and per LongMemEval question category.
-- Evidence-saved Recall@5: share of questions whose gold evidence session has a
- saved fact in the top 5 recall results for the question.
-- Cost per question (agent + judge), from provider receipts.
+- Evidence-saved rate: share of non-abstention questions where the agent saved
+ at least one fact (`remember`) while a gold evidence session was live. Also
+ reported: whether `recall` with the question as query returns one of those
+ facts in its top five.
+- Cost per question (agent, gbrain's own provider calls, profile page), from
+ the budget ledger.
- Pressure notice fire rate (questions where it fired at least once) and miss
- rate (compactions with no notice in the preceding segment).
+ rate (compaction segments with no notice before the compaction).
## Pass bars (sealed source, paired bootstrap 95% CI over questions)
@@ -79,6 +103,16 @@ the budget is re-estimated with the slice size.
ships `false`.
- D is reported but does not gate a default.
+## Power (measured on development data before any sealed cell)
+
+The 20-question claude-sonnet-5-5 pilot
+(`docs/eval/decisions/p4-stream-dev-pilot/`) measured a per-question SD of
+0.40 (B − A′) and 0.51 (C − A′). Detecting +3.0 points at 80% power with the
+95% CI excluding zero needs about 1,380 (B) and 2,270 (C) questions per model,
+more than LongMemEval-S holds. The sealed slice size, source and budget are
+decided by the custodian and the user from these numbers and recorded here
+before any sealed cell runs.
+
## Procedure
1. Iterate only on the dev split (this thread). Dev results never move a bar.
diff --git a/docs/eval/decisions/p4-stream-dev-pilot/README.md b/docs/eval/decisions/p4-stream-dev-pilot/README.md
new file mode 100644
index 0000000000..d432489e35
--- /dev/null
+++ b/docs/eval/decisions/p4-stream-dev-pilot/README.md
@@ -0,0 +1,55 @@
+# P4 streaming dev pilot (development data, sets no default)
+
+The streaming compaction harness (gbrain-evals `capy/p4-streaming-harness` at
+`4c98318`, `eval/runner/p4-stream/`) runs LongMemEval-S as a live conversation
+with a 32k-token window through gbrain's real Claude Code hooks. These numbers
+come from development questions only; they size the sealed run and guide the
+work. They never set a default.
+
+## Builds
+
+| Arm | gbrain commit | Config |
+|---|---|---|
+| A′ | `5c82936a2` (gbrain#6025 head: MCP instructions reordered under the 2,048-char cap) | defaults |
+| B | `73bd681cb` (this PR merged with gbrain#6025) | `memory.core.enabled=false`, `memory.pressure.enabled=true`, `memory.pressure.context_window=32000` |
+| C | `73bd681cb` | `memory.core.enabled=true`, `memory.pressure.enabled=false`; profile page marked core |
+
+## Results: claude-sonnet-5-5, 20 questions (seed 42, first 20), judge 10x
+
+| Arm | Accuracy | $ per question | Compactions | Notice fired | Segments with no notice before compaction | Facts saved | Evidence-saved |
+|---|---|---|---|---|---|---|---|
+| A′ | 25.0% | 1.67 | 9.2 | 0% | 100% | 0.1 | 0% |
+| B | 21.0% | 2.10 | 10.7 | 95% | 69% | 9.2 | 11% |
+| C | 20.0% | 1.72 | 9.6 | 0% | 100% | 0.2 | 6% |
+
+Paired differences against A′ (question-level bootstrap):
+
+- B − A′: −4.0 points, 95% CI [−20.0, +12.0], per-question SD 0.398, 20% of questions discordant.
+- C − A′: −5.0 points, 95% CI [−25.0, +15.0], per-question SD 0.510, 25% discordant.
+
+Neither difference is distinguishable from zero at n = 20. The pressure notice
+fires in 95% of conversations but reaches only 31% of compaction segments: a
+whole LongMemEval session (often several thousand tokens) arrives in one turn,
+so fill often jumps from under 80% straight past the compaction point.
+
+## Cost per cell (one question, one arm, arm A′)
+
+| Model | $ per cell |
+|---|---|
+| claude-sonnet-5-5 | 1.67 to 2.10 (20-question mean) |
+| claude-opus-5-5 | 3.15 (one cell) |
+| claude-fable-5-1 | 8.61 (one cell) |
+| gpt-6.1-sol | 0.85 (one cell) |
+
+## Power
+
+With the measured per-question SD, a +3.0-point effect at 80% power with the
+95% CI excluding zero needs about 1,380 questions per model for B − A′ and
+about 2,270 for C − A′ (n = ((1.96 + 0.84) × SD / 0.03)²). LongMemEval-S has
+500 questions in total. At about $14.50 per question per arm across the four
+newest models, the pressure gate alone (A′ and B) at n = 1,380 costs about
+$40,000; on claude-sonnet-5-5 alone about $5,200. The $1,400 cap buys about
+28 questions across three arms and four models, where the 95% CI half-width is
+about ±15 points.
+
+Spend for this pilot, the cost probes and the smoke runs: about $129 (plus $14.95 for the LME-S retrieval guardrail in `p4-dev-2026-10-04`).