Skip to content

Bench: run the receipts and PAST-Bench harnesses against a Postgres memory - #221

Merged
sathish-mg merged 3 commits into
mainfrom
fix/bench-postgres-memory
Sep 9, 2026
Merged

sathish-mg merged 3 commits into
mainfrom
fix/bench-postgres-memory

Conversation

@gokul08-mg

Copy link
Copy Markdown
Contributor

Both harnesses hard-coded a file memory under their work directory, so
the Cloud leg — one provisioned schema, owner role with no CREATE — could
not run them. AREEV_BENCH_DB (or receipts/run.py --db) now names the
memory, file path or DSN, passed to areev.Areev verbatim.

What a schema cannot do is be copied, and the harnesses say so rather
than pretending:

  • evaluate.py: every arm reads the one memory; arm A is a real rollback
    on it, run last. New --append adds arms to an existing trials set.
  • dryrun.sh: on a DSN runs B/B2 (journaling B), then regress, then
    arm A appended — regress needs B journaled and nothing applied survives
    arm A.
  • Snapshots (--snapshot-every/--snapshot-at) and learners.py copies
    are refused on a DSN with a message naming the alternative.
  • run.py refuses a schema that already holds grains, the file rule
    asked of the schema. Loop policy files land in each leg's work dir;
    regress.py --run-config points at the run's config (default: parent
    of its work dir on a DSN).
  • PAST-Bench backend: AREEV_BENCH_DB replaces the derived path; file
    operations on the state root leave a Postgres memory alone.
  • A DSN is printed and recorded (run.config.json → memory) with the
    password redacted.

Verified: the keyless dry run passes on a file (unchanged from baseline)
and on a local Postgres 16 schema — same A0/B/B2/A numbers, same
McNemar verdicts, all regress checks pass, and the DSN memory ends with
no applied lessons.

Closes #200.

…emory

AREEV_BENCH_DB (or receipts/run.py --db) names the memory — a file path or
a postgres://…?schema=… DSN, handed to areev.Areev verbatim — for the
experience/evaluation/regress legs and the PAST-Bench backend, which both
hard-coded a file under their work directory. A schema cannot be copied,
so the harnesses say what they do instead: evaluate.py runs every arm on
the one memory and produces arm A by a real rollback, last; snapshots and
per-pass learner copies are refused; each leg's loop policy lands in its
work dir. dryrun.sh reorders the legs on a DSN (B/B2, regress, then arm A
via the new evaluate.py --append) since that rollback ends the state
regress verifies. A DSN is printed and recorded only redacted. Unset,
the file-backed runs are byte-for-byte unchanged.
@gokul08-mg
gokul08-mg requested a review from a team as a code owner September 9, 2026 04:04
gokul08-mg and others added 2 commits September 9, 2026 09:58
Main landed the governed pass as a journaled `areev run`
(`scripts/bench_run.py`) and moved PAST-Bench's injected prompt into
`prompt.py`, so both files this branch changes were rewritten underneath
it. Three conflicts, resolved onto main's shape:

- `receipts/memory.py`: `learn()` is main's delegation to
  `bench_run.learn`, with this branch's `policy_dir` threaded through it.
- `pastbench/areev_backend.py`: main's text-block injection, with
  `memory_present()` in place of the `db_path.exists()` it reintroduced.
- `CHANGELOG.md`: both Unreleased entries kept.

`bench_run.learn` derived everything from a file path — the journal's
directory, the policy file's, and `agent_db` through `os.path.abspath` —
which is the same hard-coding this branch removed from the two harnesses,
arrived at from a new direction. It now takes `policy_dir` and uses it for
both when the memory is a DSN, passing the DSN through untouched. The
journal stays a local file there on purpose: the Cloud leg's role has no
CREATE for a second schema, and the two-memories separation is about the
writer handle, not the backend.

`BENCH-TEMPLATE.md` and the new `areev-bench/CLAUDE.md` both stated a
harness memory is a file; both now say what a DSN changes.

Verified against the merge: `dryrun.sh` and `dryrun_drift.sh` (the keyless
CI gates) pass unchanged on a file — same A0/B/B2/A numbers, all regress
checks — with the learn passes journaled as runs and `loop-policy.json` in
the leg's work dir; `selftest_run.py` and `parity_check.py` pass;
`check_versions.py` and `repo_stats.py --check` pass.

Claude-Session: https://claude.ai/code/session_016YzyEfdWprezzATrZGNtg8
@sathish-mg
sathish-mg merged commit f2a7b48 into main Sep 9, 2026
19 checks passed
@sathish-mg
sathish-mg deleted the fix/bench-postgres-memory branch September 9, 2026 05:31
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.

areev-bench: let the persistence backends open a Postgres memory, not only a file

2 participants