Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

docs(eval): C4 pinned questions B5 verdict (safety pass; benefit gate fails against query+reader at ceiling accuracy; ships opt-in)

garrytan183fee7f3c39
diff --git a/docs/eval/decisions/c4-pinned-questions/README.md b/docs/eval/decisions/c4-pinned-questions/README.md
new file mode 100644
index 0000000000..a8804fc0e8
--- /dev/null
+++ b/docs/eval/decisions/c4-pinned-questions/README.md
@@ -0,0 +1,74 @@
+# Pinned questions: B5 verdict
+
+Pinned questions ship **opt-in**. The B5 safety gate passes with zero leakage on PGLite and Postgres. The
+benefit gate does not pass against query plus a reader: accuracy is at the ceiling for every arm, and pinned
+answers are not cheaper per correct answer until a pin has been read about 240 times. Pinned answers are
+3.3 to 14.5 times cheaper than running `think` on every read. The feature does nothing until the owner pins a
+question, and no pin is created by default.
+
+Measured build: gbrain a4267eed7 (the `capy/mpw-integration` branch). Stage: dev.
+
+## Benefit gate
+
+The cost counted is total lifecycle dollars per correct, fresh answer: the first answer, every refresh
+attempt, delivered read tokens and every model call. The workload is seeded and has 6 entities and
+4 write batches. Each entity has a widget-factory city, and later batches correct some of those cities.
+After each batch, every question is read 1 or 10 times, depending on the frozen reads-per-write ratio.
+
+| Reads per write | Arm | Reads | Correct | Stale-wrong | Dollars | Dollars per correct |
+|---|---|---|---|---|---|---|
+| 1 | pinned | 24 | 24 | 0 | 0.0559 | 0.00233 |
+| 1 | query + reader | 24 | 24 | 0 | 0.0127 | 0.00053 |
+| 1 | think | 24 | 24 | 0 | 0.1828 | 0.00762 |
+| 10 | pinned | 240 | 240 | 0 | 0.1262 | 0.00053 |
+| 10 | query + reader | 240 | 240 | 0 | 0.1270 | 0.00053 |
+| 10 | think | 240 | 240 | 0 | 1.8355 | 0.00765 |
+
+- Pinned lifecycle split: $0.048 went to the first answers and 14 refresh attempts, and $0.0079 (1 read per
+ write) or $0.078 (10 reads per write) went to reader tokens over the fresh sentences.
+- Break-even: pinned overtakes query + reader after about 240 reads per pin (242 and 237 in the two runs).
+ Both arms hand the reader about the same number of tokens per read, so a pin saves little at read time.
+ The cost of keeping the answer current is repaid slowly.
+- Against on-demand `think`, pinned is cheaper at both ratios: 3.3 times at 1 read per write and 14.5 times
+ at 10.
+
+**Ceiling.** Every arm answered every read correctly. The workload rewrites the evidence page when a city is
+corrected, so no arm had a superseded value to repeat (stale-wrong is 0 everywhere). This run cannot show an
+accuracy or freshness advantage. It decides on cost alone.
+
+### Models
+
+- Answer and refresh model: `anthropic:claude-opus-4-7`. This is gbrain's default for questions
+ (`models.standing_questions`, which resolves to the deep tier).
+- `think` arm: the same default model.
+- Reader for the pinned and query arms: `anthropic:claude-sonnet-5-5`, the fixed reader of the B suites.
+- Retrieval is keyword-only for all three arms, because the harness brain has no embedding key.
+
+Metered spend: $2.34 of the $40 cap.
+
+## Safety gate
+
+`test/helpers/pinned-questions-scenarios.ts` passes 33 of 33 scenarios on PGLite
+(`test/pinned-questions-safety.test.ts`) and 33 of 33 on live Postgres
+(`test/e2e/pinned-questions-postgres.test.ts`). The full `bun run ci:ubicloud` gate passes on the integrated
+tree. The suite covers:
+
+- Zero leakage to restricted grants on search, query, list_pages, get_page, get_versions, context_pack and
+ recall.
+- No answer text in pages, chunks, versions, history or export.
+- Read-time staleness for edits, soft and hard deletes, forget, clock expiry, supersession, visibility changes,
+ takes, timeline entries and owner edits.
+- Refresh that never publishes over a concurrent edit, a duplicate worker, a crash between publication stages
+ or a failure.
+- The consent, keyless, budget and no-worker states, and the operator journeys over MCP.
+
+## Reproduce
+
+```bash
+bun evals/pinned-questions/benefit-gate.ts --plan --json --entities 6 --batches 4 --reader-model anthropic:claude-sonnet-5-5
+bun evals/pinned-questions/benefit-gate.ts --run --yes --max-usd 40 --entities 6 --batches 4 --seed 42 \
+ --reader-model anthropic:claude-sonnet-5-5 --json
+```
+
+`verdict.json` carries the full run report, and `decision.json` records the arms, models, workload and
+budget.
diff --git a/docs/eval/decisions/c4-pinned-questions/decision.json b/docs/eval/decisions/c4-pinned-questions/decision.json
new file mode 100644
index 0000000000..bec1f879d5
--- /dev/null
+++ b/docs/eval/decisions/c4-pinned-questions/decision.json
@@ -0,0 +1,69 @@
+{
+ "schema_version": 1,
+ "decision_id": "c4-pinned-questions",
+ "plan": "MEMORY_PROOF_WAVE C4 + B5",
+ "title": "Pinned questions: B5 safety gate and benefit gate (lifecycle dollars per correct fresh answer)",
+ "verdict_type": "cost_quality",
+ "stage": "dev",
+ "candidate": {
+ "gbrain": "garrytan/gbrain@a4267eed7bb6f9478df73fef6266b8a111a3891a",
+ "arm": "pinned",
+ "config": {
+ "models.standing_questions": "anthropic:claude-opus-4-7",
+ "cycle.standing_questions.cooldown_days": "0"
+ }
+ },
+ "baselines": [
+ {
+ "gbrain": "garrytan/gbrain@a4267eed7bb6f9478df73fef6266b8a111a3891a",
+ "arm": "query_reader",
+ "note": "hybrid query (keyword-only: no embedding key in the harness brain) at the pinned answer's delivered-token budget, then one reader call"
+ },
+ {
+ "gbrain": "garrytan/gbrain@a4267eed7bb6f9478df73fef6266b8a111a3891a",
+ "arm": "think",
+ "note": "on-demand think per read with the default deep model"
+ }
+ ],
+ "models": {
+ "answer_and_refresh": "anthropic:claude-opus-4-7",
+ "think": "anthropic:claude-opus-4-7",
+ "reader": "anthropic:claude-sonnet-5-5",
+ "selection": "answer/refresh and think: gbrain's default for questions (models.standing_questions -> deep tier); reader: the B-suite fixed reader"
+ },
+ "sources": [
+ {
+ "kind": "seeded-workload",
+ "id": "pinned-questions-benefit",
+ "generator": "evals/pinned-questions/benefit-gate.ts generateWorkload",
+ "seed": 42,
+ "entities": 6,
+ "write_batches": 4,
+ "workload_hash": "9428f19ffe229e66",
+ "engine": "pglite"
+ }
+ ],
+ "frozen_reads_per_write": [
+ 1,
+ 10
+ ],
+ "metrics": [
+ "usd_per_correct_fresh_answer",
+ "correct",
+ "stale_wrong",
+ "break_even_reads"
+ ],
+ "safety_gate": {
+ "suite": "test/helpers/pinned-questions-scenarios.ts",
+ "engines": [
+ "pglite",
+ "postgres"
+ ],
+ "required": "zero stale-sentence or cross-grant leakage on every surface"
+ },
+ "budget": {
+ "max_usd": 40,
+ "metered_spend_usd": 2.3402
+ },
+ "reproduce": "bun evals/pinned-questions/benefit-gate.ts --run --yes --max-usd 40 --entities 6 --batches 4 --seed 42 --reader-model anthropic:claude-sonnet-5-5 --json"
+}
diff --git a/docs/eval/decisions/c4-pinned-questions/verdict.json b/docs/eval/decisions/c4-pinned-questions/verdict.json
new file mode 100644
index 0000000000..84c88040ee
--- /dev/null
+++ b/docs/eval/decisions/c4-pinned-questions/verdict.json
@@ -0,0 +1,112 @@
+{
+ "decision_id": "c4-pinned-questions",
+ "plan": "MEMORY_PROOF_WAVE C4 + B5",
+ "stage": "dev",
+ "decided_at": "2026-10-05T09:30:00Z",
+ "measured_build": "garrytan/gbrain@a4267eed7bb6f9478df73fef6266b8a111a3891a",
+ "safety_gate": {
+ "status": "pass",
+ "scenarios": 33,
+ "engines": {
+ "pglite": "33/33",
+ "postgres": "33/33"
+ },
+ "full_ci": "bun run ci:ubicloud green on garrytan/gbrain@2b1f5b69 (capy/mpw-integration)"
+ },
+ "benefit_gate": {
+ "status": "fail",
+ "against": {
+ "query_reader": "fail",
+ "think": "pass"
+ },
+ "reason": "Accuracy is at ceiling for every arm (100% correct, 0 stale-wrong), so the gate is decided on lifecycle cost. Pinned costs 4.4x query+reader per correct answer at 1 read per write and matches it at 10 reads per write ($0.000526 vs $0.000529); break-even is about 240 reads per pin. Pinned is 3.3x (1 read/write) to 14.5x (10 reads/write) cheaper than on-demand think."
+ },
+ "overall": "opt_in",
+ "default_decision": "Pinned questions ship opt-in: the feature does nothing until the owner pins a question, and no pin is created by default. Default-on is withheld because the benefit gate did not pass against query+reader.",
+ "ceiling_note": "Every arm answered every read correctly; the workload rewrites the evidence page on correction, so no arm had a superseded value to repeat. The run cannot show an accuracy or freshness difference.",
+ "metered_spend_usd": 2.3402,
+ "run": {
+ "mode": "run",
+ "workload_hash": "9428f19ffe229e66",
+ "seed": 42,
+ "entities": 6,
+ "batches": 4,
+ "answer_model": "anthropic:claude-opus-4-7",
+ "reader_model": "anthropic:claude-sonnet-5-5",
+ "metered_spend_usd": 2.3401960000000015,
+ "reports": [
+ {
+ "reads_per_write": 1,
+ "arms": [
+ {
+ "arm": "pinned",
+ "reads": 24,
+ "correct": 24,
+ "stale_wrong": 0,
+ "usd": 0.055947,
+ "usd_per_correct": 0.002331125
+ },
+ {
+ "arm": "query_reader",
+ "reads": 24,
+ "correct": 24,
+ "stale_wrong": 0,
+ "usd": 0.012694,
+ "usd_per_correct": 0.0005289166666666667
+ },
+ {
+ "arm": "think",
+ "reads": 24,
+ "correct": 24,
+ "stale_wrong": 0,
+ "usd": 0.18278499999999998,
+ "usd_per_correct": 0.007616041666666666
+ }
+ ],
+ "pinned_breakdown": {
+ "pin_and_refresh_usd": 0.048025,
+ "read_usd": 0.007921999999999998,
+ "refresh_attempts": 14
+ },
+ "break_even_reads": 242,
+ "plumbing_only": false
+ },
+ {
+ "reads_per_write": 10,
+ "arms": [
+ {
+ "arm": "pinned",
+ "reads": 240,
+ "correct": 240,
+ "stale_wrong": 0,
+ "usd": 0.1262400000000003,
+ "usd_per_correct": 0.0005260000000000012
+ },
+ {
+ "arm": "query_reader",
+ "reads": 240,
+ "correct": 240,
+ "stale_wrong": 0,
+ "usd": 0.12697999999999998,
+ "usd_per_correct": 0.0005290833333333332
+ },
+ {
+ "arm": "think",
+ "reads": 240,
+ "correct": 240,
+ "stale_wrong": 0,
+ "usd": 1.835549999999999,
+ "usd_per_correct": 0.007648124999999995
+ }
+ ],
+ "pinned_breakdown": {
+ "pin_and_refresh_usd": 0.047859999999999986,
+ "read_usd": 0.07838000000000032,
+ "refresh_attempts": 14
+ },
+ "break_even_reads": 237,
+ "plumbing_only": false
+ }
+ ]
+ }
+}