Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
docs(eval): P5 preregistration, decision spec and dev results
garrytan78353344a0f3
diff --git a/docs/eval/decisions/p5-dev-2026-10-04/decision.json b/docs/eval/decisions/p5-dev-2026-10-04/decision.jsonnew file mode 100644index 0000000000..7c845adbe6--- /dev/null+++ b/docs/eval/decisions/p5-dev-2026-10-04/decision.json@@ -0,0 +1,112 @@+{+ "schema_version": 1,+ "decision_id": "p5-dev-2026-10-04",+ "plan": "P5",+ "title": "P5 dev comparison",+ "verdict_type": "quality",+ "stage": "dev",+ "candidate": {+ "gbrain": "/workspace/gbrain@b32fdb9d19898044a95ed400e832377fc3d038ed",+ "config": {}+ },+ "baseline": {+ "gbrain": "/workspace/gbrain@6622a119e40ea09a7719233046aca24741863ed2",+ "config": {}+ },+ "sources": [+ {+ "id": "type-accuracy",+ "kind": "category",+ "category": "type-accuracy",+ "script": "eval/runner/type-accuracy.ts",+ "args": [],+ "paid": false,+ "comparisons": [+ {+ "id": "type-match",+ "metric": "anyTypeMatch",+ "gate": "noninferiority",+ "direction": "higher",+ "tolerance": 0.01,+ "cluster_by": "probe_id"+ }+ ],+ "rows_path": "data.rows",+ "id_field": "probe_id"+ },+ {+ "id": "n4-entity-resolution",+ "kind": "category",+ "category": "n4-entity-resolution",+ "script": "eval/runner/n4-entity-resolution.ts",+ "args": [+ "--seed",+ "1"+ ],+ "paid": false,+ "comparisons": [+ {+ "id": "n4-recall",+ "metric": "recall",+ "gate": "noninferiority",+ "direction": "higher",+ "tolerance": 0.01,+ "cluster_by": "family"+ }+ ],+ "rows_path": "data.rows",+ "id_field": "id"+ },+ {+ "id": "lme-s-dev",+ "kind": "memory-qa",+ "benchmark": "lme-s",+ "split": "dev",+ "embed": "real",+ "limit": null,+ "search_pins": {+ "search.mode": "balanced",+ "search.reranker.enabled": "false",+ "search.autocut": "false"+ },+ "top_k": 10,+ "id_field": "id",+ "exclude_when": [+ "abstention=true"+ ],+ "min_clusters": 10,+ "comparisons": [+ {+ "id": "recall-all-5",+ "metric": "recall_all_at_5",+ "gate": "noninferiority",+ "direction": "higher",+ "tolerance": 0.01,+ "cluster_by": "conversation",+ "description": "guardrail: strict recall does not drop by more than one point"+ },+ {+ "id": "ndcg-10",+ "metric": "ndcg_at_10",+ "gate": "exploratory",+ "direction": "higher",+ "cluster_by": "conversation"+ },+ {+ "id": "latency",+ "metric": "latency_ms",+ "gate": "exploratory",+ "direction": "lower",+ "cluster_by": "conversation"+ }+ ],+ "estimate_usd": 24+ }+ ],+ "alpha": 0.05,+ "seed": 42,+ "draws": 10000,+ "budget_usd": 24,+ "created_at": "2026-10-04T19:18:26.123Z",+ "notes": "Human-typable fact/link line grammar, wanted pages, duplicate nudge: typed-edge accuracy and entity resolution; LME-S as a guardrail."+}diff --git a/docs/eval/decisions/p5-dev-2026-10-04/dev-results.md b/docs/eval/decisions/p5-dev-2026-10-04/dev-results.mdnew file mode 100644index 0000000000..cff97b7041--- /dev/null+++ b/docs/eval/decisions/p5-dev-2026-10-04/dev-results.md@@ -0,0 +1,80 @@+# P5 dev results (development data; not eligible to set a default)++Baseline gbrain master 6622a119e; candidate branch `capy/p5-line-grammar-wanted-pages`. H1, H2, H4 and H5a are dev+diagnostics run from scripts against the two builds (the kit has no runners for them yet); the LME-S guardrail runs+through `eval:decide`.++## H1 — link typing on world-v1 (240 pages, 280 gold edges)++| Build | Type accuracy | Any-type accuracy | Strict F1 | Spurious founded / invested_in / advises / works_at |+|---|---|---|---|---|+| baseline | 0.747 | 0.945 | 0.188 | 77 / 95 / 61 / 44 |+| candidate | 0.767 | 0.945 | 0.195 | 67 / 93 / 54 / 42 |++Pages without relation lines extract identically with the grammar on and off (240/240). The gain comes from the+per-edge verb attachment fix; the two reported failure shapes are fixed:++| Shape | baseline | candidate |+|---|---|---|+| "Joined [Acme] as engineer" (timeline line, prose never names Acme) | mentions | works_at |+| "works at [Acme] ... and also advises [Widget]" | Acme advises, Widget advises | Acme works_at, Widget advises |+| "co-founded [Beta] in 2019, and she works at [Acme]" | Beta founded, Acme founded | Beta founded, Acme works_at |++## H2 — relation lines replacing prose (world-v1 variant, dev seeds 1–3)++| Seed | Rendered lines | Baseline typed recall | Candidate typed recall | Decoy types added by the grammar |+|---|---|---|---|---|+| 1 | 57 | 0.947 | 1.000 | 0 |+| 2 | 55 | 0.873 | 1.000 | 0 |+| 3 | 78 | 0.923 | 1.000 | 0 |++When the prose states the relationship, inference already types it (rendered recall 1.0 in both builds with the prose+kept); relation lines matter where they are the only statement.++## H4 — forward references (world-v1, seeded shuffled writes, sweep every 10 pages)++| Seed | Reference edges | Lost, baseline | Lost, candidate | Withheld entities referenced | In `wanted_pages` | Non-entity wanted targets |+|---|---|---|---|---|---|---|+| 1 | 635 / 623 | 306 (48%) | 0 | 29 | 28 (0.97) | 0 |+| 2 | 635 / 623 | 294 (46%) | 0 | 30 | 29 (0.97) | 0 |+| 3 | 635 / 623 | 309 (49%) | 0 | 29 | 29 (1.00) | 0 |++(Reference edge counts differ by build because the candidate's inference fix removes spurious duplicate-typed edges.)+The full world-v1 corpus has 109 linked person/company pages that do not exist; `wanted_pages` lists them.++## H5a — similar-page hint on the N4 entity ledger (dev seed 1)++| Mention family | n | recall@3 |+|---|---|---|+| exact name | 24 | 1.00 |+| exact slug | 26 | 0.92 |+| typo | 15 | 1.00 |+| initials (declared alias) | 14 | 1.00 |+| changed name | 2 | 1.00 |+| handle | 19 | 0.68 |+| nickname | 14 | 0.50 |+| first name only | 9 | 0.00 |+| no-referent (hint rate) | 4 | 0.00 |++Lexically detectable families: 79/81 = 0.975. Nicknames without a declared alias, handles and first names are the+semantic gap (deferred). Seeds 2 and 3 give overall solvable recall@3 0.789 and 0.764, with no hints on no-referent names.++## LME-S guardrail++Running through `eval:decide dev`; the verdict is appended here when both arms finish.++## Harness gaps (requirements on the eval harness)++1. `eval/runner/type-accuracy.ts` ignores `--gbrain` and `--output`: under `eval:decide` both arms measure the pinned+ dependency and no receipt lands in the run directory. It needs overlay import (`importGbrain`) and a receipt at+ `--output` with `data.rows`.+2. `eval/runner/n4-entity-resolution.ts` exits 1 when its own absolute bars fail (both arms fail identically today),+ which the kit records as an arm failure; a dev comparison needs the receipt rows regardless of the absolute verdict.+3. H2: a world-v1 relation-line variant generator with held-out seeds and template families not used in dev.+4. H3: the junk-audit runner (corpus loaders for LongMemEval-S haystacks and LoCoMo transcripts as markdown, a public+ notes vault, two-judge labeling with adjudication).+5. H4: a sequential-write runner (seeded write order, sweep cadence, withheld variant) that reads `wanted_links`, and+ an HTTP-transport arm.+6. H5: a no-referent name set of at least 50 per seed for the false-hint rate, and the "save these notes" agent loop+ recording page creates and edits.+7. H6: the agent-writes-the-brain QA loop with a fair-guidance baseline arm.diff --git a/docs/eval/decisions/p5-dev-2026-10-04/preregistration.md b/docs/eval/decisions/p5-dev-2026-10-04/preregistration.mdnew file mode 100644index 0000000000..32ad6fbc63--- /dev/null+++ b/docs/eval/decisions/p5-dev-2026-10-04/preregistration.md@@ -0,0 +1,69 @@+# P5 preregistration: typed line grammar, wanted pages, similar-page hint++Decision id `p5-dev-2026-10-04`, kit `bun run eval:decide` (gbrain-evals). The candidate SHA in `decision.json` is the+dev-run build; the custodian pins the frozen build at confirmation. Sealed runs are executed by the custodian only.++## Features and the default each verdict decides++| Feature | Config key | Default if the held-out bar passes | If it fails |+|---|---|---|---|+| Wanted pages: unresolved authored links recorded and re-linked when the target appears | `wanted_pages.enabled` | on | off |+| Typed relation lines (`- works_at [[companies/x]]`) | `line_grammar.enabled` | on | off |+| Similar-page hint when a write creates a page | `put_page.similar_pages` | on | off |+| Validity ranges stored on edges (`@effective[start,end)`) | needs the edge-validity schema | measured after it lands | — |++Fact lines (`- [category] claim`) are parsed, linted and reported; they are not projected into `facts`, and no+default rides on them. The per-edge verb attachment fix in link-type inference is a correctness fix covered by the+type-accuracy guardrail (H1).++## Hypotheses, metrics and bars++**H1 — no regression in link typing.** BrainBench `type-accuracy` on world-v1 (240 pages), baseline vs candidate.+Metric: `anyTypeMatch` per gold edge (noninferiority, tolerance 0.01), plus type accuracy and strict F1.+Bar: noninferior; pages without relation lines extract identically with the grammar on and off.++**H2 — written relation types reach the graph.** world-v1 variant: half of the person pages state their outgoing gold+relationships only as relation lines (prose removed), plus decoy lines (prose after the link, two links, multi-word+unquoted type, stoplisted word, machine-written section, undeclared verb). Metrics: typed-edge recall on rendered+lines; decoy lines whose stated type reaches the graph, candidate minus baseline. Bar (held-out generator seed with+templates not used in dev): recall >= 0.98; decoy types added by the grammar = 0.++**H3 — junk stays out.** False-positive audit: grammar lines minted per 1,000 list lines and precision on 300+held-out list lines labeled by two judge models with human adjudication. Corpora: LongMemEval-S haystack sessions as+markdown, LoCoMo transcripts, a permissively licensed public notes vault. Bar: precision >= 0.95; zero lines minted+from timecodes, task markers, citations, dates or machine-written sections. gbrain's own docs and skills,+amara-life-v1, transcript-distill-v1 and world-v1 were read in development and are dev data only.++**H4 — forward references heal.** world-v1 written page by page in a seeded shuffled order with a stale sweep every+10 pages, against an all-at-once import (reference); and a withheld variant with 20% of person/company pages removed.+Metrics: reference edges missing after the sequential import; recall of withheld entities among `wanted_pages`+targets; share of wanted targets that are not entity-shaped. Bar: zero edges lost; recall >= 0.9; non-entity share+<= 10%. An HTTP-transport arm runs once remote link reconciliation writes wanted rows.++**H5 — fewer duplicate pages.** (a) N4 entity ledger: a create titled with each solvable mention and each no-referent+name; metrics: recall@3 of the true page per mention family, and the hint rate on no-referent names. Bar: recall@3 >=+0.9 on lexically detectable families (exact name, exact slug, typo, initials, declared alias, changed name); hint rate+on no-referent names <= 10% (the held-out set needs at least 50 no-referent names). (b) Agent loop, Claude Sonnet 5.5+and GPT-6 sol, "save these notes" tasks with 30% existing entities under variant names and 20% similar-but-different+entities, no tool-result caps: duplicate-page rate down >= 25% relative and wrong-merge rate up <= 1 point.++**H6 — typed lines help answers.** Agents ingest amara-life-v1 conversations and write the brain: arm A is master with+equally good guidance for the existing mechanisms (frontmatter link fields, add_link, the Facts table, remember); arm+B adds the relation-line convention and the feature. 400 sealed paired relational and temporal questions; judge 10x+mean±SD, paired bootstrap 95% CI. Bar: B − A >= +3 points with CI lower bound > 0, no regression > 1 point elsewhere.+`line_grammar.enabled` needs H1, H2, H3 and H6. H6 runs only if H1–H3 pass.++Guardrail: LongMemEval-S retrieval (`lme-s-dev` in `decision.json`), noninferior.++## Budget++Cap $1,300. H1, H2, H4, H5a are deterministic ($0). H3 ≈ $20 in judge labels. H5b ≈ $300. H6 ≈ $700–1,000.+LME-S guardrail ≈ $24 per run.++## Dev disclosures++- Dev seeds used: H2 and H4 generator seeds 1–3 (dev diagnostics, not kit receipts); H5a N4 ledger seeds 1–3. The+ custodian should draw held-out seeds outside {1, 2, 3}.+- Guard tuning used gbrain docs/skills (all of it): categories reject digits and all-caps markers.+- The link-type attachment fix was developed against two failure shapes reported from the edge-validity plan's dev run+ and measured on world-v1 type-accuracy (dev).