Skip to content

feat(core): add BEAM benchmark integration to the benchmarks package - #1407

Merged
phernandez merged 1 commit into
mainfrom
1400-beam-benchmark
Aug 31, 2026
Merged

feat(core): add BEAM benchmark integration to the benchmarks package#1407
phernandez merged 1 commit into
mainfrom
1400-beam-benchmark

Conversation

@phernandez

Copy link
Copy Markdown
Member

Why

Second slice of the POSIX tool surface + memory evals tracker (#1398). BEAM (arXiv 2510.27246, ICLR 2026) joins LoCoMo as a second dataset so we can baseline current tools per memory ability — Contradiction Resolution and Temporal Reasoning are the external yardsticks for the SPEC-89/SPEC-82 roadmap (every published system is weakest there; ~60% SOTA per Exabase).

Closes #1400.

What changed

  • datasets/beam.py — path-based dataset adapter for the upstream JSON layout (never vendored; fetch command documented), tier selection (100K/500K; 10M explicitly excluded), knowledge-update record normalization.
  • converters/beam_to_corpus.py — raw transcript-as-notes conversion with anti-leakage stripping of upstream probe-index markers (->> i,j and the real-world ->> 2,N/A variant found in the live 100K data), fail-fast if any marker survives cleaning; sha256-recorded conversion.json. Seam designed so an agent-curated ingestion mode can be added without reshaping the adapter.
  • scoring/beam.py — nugget scoring (upstream judge prompt adapted, provenance cited; 0/0.5/1 per nugget, per-question mean) and Event Ordering (LLM alignment + pure-Python Kendall tau-b, final = tau_norm × f1).
  • Reporting — all ten abilities always shown, per-answer token accounting, macro average beside (never instead of) the per-ability rows; errored cases excluded from means and counted explicitly.
  • CLI — beam run commands consistent with the LoCoMo invocation shape.
  • Provenancedocs/benchmarks.md records exactly what was adapted from mohammadtavakoli78/BEAM (MIT code / CC BY-SA 4.0 data) and every deviation: the injected question input the upstream judge prompt references but never provides, the degenerate-tau NaN→0.0 mapping, the concise-answer/event-ordering interaction caveat, and why scipy/json_repair/the upstream judge model were not reused. Published numbers must note the judge differs from the paper's — absolute comparability to the paper's tables is explicitly disclaimed; the cross-provider comparison under our fairness contract is the product.
  • Housekeeping: pinned the package's ruff lint selection (was implicitly tracking ruff's default, which changed in 0.16) and fixed two pre-existing pyright errors in untouched provider tests that blocked the typecheck gate.

How it was built

Reviewed multi-agent workflow (map package + clone upstream + map ingestion → design → implement → offline fixture tests → verify loop → adversarial review). The review's should-fix — the N/A marker variant leaking through the anti-leakage strip, caught by checking the live upstream data rather than the fixture — was fixed with the widened pattern plus fail-fast, and two documentation-honesty nits (a falsely-justified publicized helper, the "replicated exactly" tau claim) were cleaned up before commit.

Verification

  • uv run ruff check / ruff format --check — clean
  • uv run pyright — 0 errors
  • Full package suite (tests/ + test-int/) — all passing, fully offline (stubbed LLM runners, hand-written miniature BEAM fixture covering Information Extraction, Knowledge Update, and Event Ordering incl. the marker variants)

Notes

  • This PR ships the harness only — no paid benchmark runs. Baseline runs (BM + mem0-local at 100K) are the follow-up once merged, before the SPEC-82/89 work lands.
  • Stacked work: Agent-task eval: rich vs POSIX tool surfaces #1401 (agent-task eval) will branch from this.

🤖 Generated with Claude Code

https://claude.ai/code/session_014pmKq6bqCi6Zp6BTHuZjrp

BEAM (arXiv 2510.27246) joins LoCoMo as a second dataset under the same
provider abstraction and fairness contract: path-based dataset adapter
with tier selection (100K/500K; 10M excluded), raw transcript-as-notes
converter with anti-leakage probe-marker stripping (fail-fast on unknown
variants), nugget scoring (0/0.5/1 judge, per-question mean), event
ordering via LLM alignment + pure-Python Kendall tau-b, per-ability
reporting across all ten abilities with per-answer token accounting, and
CLI wiring. Dataset is never vendored; the fetch command is documented.
Runner provenance (adapted upstream prompts/math and every deviation) is
recorded in docs/benchmarks.md. Tests run fully offline against a
hand-written miniature fixture with stubbed LLM runners.

Also: pin the benchmarks package ruff lint selection (was implicitly
tracking ruff's default, which changed in 0.16), and fix two pre-existing
pyright errors in untouched provider tests that blocked the typecheck
gate.

Closes #1400

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014pmKq6bqCi6Zp6BTHuZjrp
Signed-off-by: phernandez <paul@basicmachines.co>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 31, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-08-31T05:45:26.369807Z aec0ebd PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: aec0ebdc66

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

dataset_id = f"beam-{tier.lower()}"

groups_dir = output_dir / "groups"
groups_dir.mkdir(parents=True, exist_ok=True)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Clear stale group files before reconversion

When convert beam is rerun into an existing output directory after the upstream checkout changes—for example, when a newly added chat_trunecated.json contains fewer sessions—this exist_ok path preserves Markdown files that the new conversion no longer emits. The grouped runner subsequently ingests every remaining document under that group's docs directory, so stale conversations can affect retrieval even though queries.json and conversion.json describe only the current source files. Rebuild the groups tree from an empty or atomic temporary directory, or fail when the output is nonempty.

AGENTS.md reference: benchmarks/AGENTS.md:L8-L11

Useful? React with 👍 / 👎.

"license_note": BEAM_LICENSE_NOTE,
"dataset_root": str(dataset_root),
"converter": {"mode": mode, "max_conversations": max_conversations},
"created_at_utc": utc_now_iso(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep volatile timestamps out of the dataset checksum

When identical BEAM inputs are converted at different times, this timestamp changes conversion.json; the documented run recipe passes that file as --dataset-path, and the retrieval CLI hashes the entire file for manifest.json's dataset checksum. Consequently, two runs over byte-identical source data receive different dataset checksums, defeating checksum-based provenance comparisons. Keep the timestamp outside the checksummed input manifest or derive the dataset checksum only from stable source metadata and per-file hashes.

AGENTS.md reference: benchmarks/AGENTS.md:L89-L94

Useful? React with 👍 / 👎.

@phernandez
phernandez merged commit 54088a1 into main Aug 31, 2026
17 checks passed
@phernandez
phernandez deleted the 1400-beam-benchmark branch August 31, 2026 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant