Skip to content

feat(bench): add a git test bed with code-context and branch questions - #293

Draft
tonyketcham wants to merge 2 commits into
claude/agent-memory-context-potency-6sniud-code-refsfrom
claude/agent-memory-context-potency-6sniud-code-bench
Draft

tonyketcham wants to merge 2 commits into
claude/agent-memory-context-potency-6sniud-code-refsfrom
claude/agent-memory-context-potency-6sniud-code-bench

Conversation

@tonyketcham

Copy link
Copy Markdown
Collaborator

Summary of changes

This is layer 13 of a stack. It sits on the --path/--refs PR below it.

It adds the benchmark for Phase 2: whether agents can find the records behind code, and see what other branches propose. It changes benchmark files only.

  1. scripts/build-repo.mjs --out <dir> builds a git repository from the committed 1x graph and spec/repo.mjs. The build is deterministic: fixed dates, seeded ids and a fixed commit author. The repository holds:

    • a small fake codebase for the fictional studio;
    • commits with Proof: trailers;
    • code Citations and implementation notes written through the real Proof writer;
    • four engineers' branches with unmerged records, and draft PRs in .flatbread/proof/prs.json;
    • planned conflicts between branches: two accepted Decisions on one question, one record replaced twice, a record with a different state on two branches, a retraction, and a second compaction.

    The key map is written outside the repository.

  2. Questions. questions/code.json and questions/branch.json have 22 questions each, in opt-in sets. They were written without access to the new reads, and are worded the way an engineer asks, for example "Before I edit …, which live Decision governs …?" or "Does any open branch propose replacing …?".

  3. check.mjs --repo <dir> proves every answer with two new check types:

    • atRef runs any check against the graph as a branch has it.
    • codeAnchor and trailer prove which records govern a piece of code.

    check.mjs still prints ok: 270 questions, 498 records by default, and each new set prints ok: 22 questions.

  4. run.mjs --repo <dir> gives each session its own clone of the test bed, with no key map, spec or questions. In that mode every arm's task text explains the clone and allows read-only git, so the no-brief arm can use git log, git show and git diff too. --prepare-only builds the folders and starts no session.

  5. A new findcode strategy adds two lines to the find text: use --path before opening code, adding --refs all when a file may exist only on a branch, and use --refs all before building on a Decision. Without --repo, every existing text is byte-identical.

Offline check, joining this test bed with the reads below:

Set Evidence in top 5 Answer on the cards
Code context 21 of 22 17 of 19
Branch 17 of 22 14 of 15 (counted on evidence cards only, since every --refs all reply names all branches)

A paid trial of findcode against no-brief comes next, in a results PR.

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • I added doc comments to any new public exports, and inline comments to any hard-to-understand areas
  • My changes generate no new console errors locally
  • If applicable, try to include a test that fails without this PR but passes with it. These are benchmark scripts. check.mjs proves all 44 new answers, two builds give the same commit hashes, and compare.mjs on the full Haiku runs still prints 221.42 against 226.25.

Does this introduce any non-backwards compatible changes?

  • Yes
  • No

Does this include any user config changes?

  • Yes
    • If so, I have updated the relevant areas of documentation
  • No

Generated by Claude Code

Phase 2 of the recall benchmark tests whether agents can find the
records behind code and see what other branches propose.

- `scripts/build-repo.mjs --out <dir>` builds a deterministic git
  repository from the 1x graph and `spec/repo.mjs`. It holds:
  - a small fake codebase for the fictional studio;
  - commits with `Proof:` trailers;
  - code Citations and implementation notes written through the
    Proof writer;
  - four engineers' branches with unmerged records, draft PRs in
    `.flatbread/proof/prs.json`, and planned conflicts between
    branches.
  The key map is written outside the repository.
- `questions/code.json` and `questions/branch.json` add 22 questions
  each. Both are opt-in sets, written without access to the new reads.
- `check.mjs --repo <dir>` proves their answers with two new check
  types: `atRef`, which runs a check on the graph as a branch has it,
  and `codeAnchor`/`trailer`, which prove which records govern code.
- `run.mjs --repo <dir>` gives each session its own clone, with no key
  map, spec or questions. Every arm's task text then explains the
  clone and allows read-only git. `--prepare-only` builds the folders
  and starts no session.
- A new `findcode` strategy adds the `--path` and `--refs` lines to
  the `find` text. Other texts are unchanged without `--repo`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DVVnhYL1Bz7mCfEKDoyLMW
compare.mjs ignored --repo and scored the code and branch sets against
the committed graph, where their records do not exist, so it reported
68 of 88 for a trial that grade.mjs scores at 84. It now loads the test
bed and its key map, as grade.mjs does, and refuses arguments it does
not know instead of dropping them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DVVnhYL1Bz7mCfEKDoyLMW
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants