Reversible clean-root candidate rebuilt from oak/benchmarks main@009dead264ca; original repository retained.

Commit 63fc62c5

63fc62c5679cMergedfrom mrmrs-a60a8c

mrmrs · 13 days ago · 43 files · +21 added · ~22 modified

Description

Benchmark accuracy audit (2026-11-09): fix measurements that were wrong or misleading, and add drift detection so Oak changes can't silently invalidate the suite.

Worker: /Users/mrmrs/o/worker-mrmrs-20261109-bench-audit/benchmarks

Fixes

  • Independent Oak reader qualified through migration 0018 (was 0014). Every Oak store since ~2026-10-31 was refused, so all Oak correctness oracles were unmeasured and 29 instrument tests failed on main.
  • Core-equivalent Oak status uses status --porcelain (matches Git --porcelain=v1). Command semantics 2026-11-09.1.
  • bench summary: subject averages only over cells every subject measured (Oak-only JSON probes skewed Oak's means); Operation Medians print ok/fail counts and list all-failed cells; Oak baseline prefers oak_main (CONTEXT.md).
  • workflow summary: runs whose setup failed now count as failures (they vanished before); integrity-unmeasured runs are their own column; medians, not means.
  • history_archaeology_v2: native oak log --oneline / path / -S, exit 0 required, every answer checked against the fixture history. v1 frozen (its Oak steps ran unfiltered log -v and always passed).
  • Conformance expected failures updated for oak 0.112.0: fb-542/544/545/546 fixed (removed); fb-543 is now a typed refusal at commit. Gate-logic tests replay 0.105 rows against a frozen 0.105 copy.

Drift detection (scripts/oakbench/drift.py, tests/test_drift.py)

  • Every Oak subcommand/flag the suite runs must exist in the Oak under test; duplicated command mappings must agree; reader KNOWN_MAX_MIGRATION must equal Oak's newest migration.
  • devloop preflight: target drift => UNMEASURED (--allow-drift for INFO); baseline CLI gaps are INFO.
  • Steps that pass on both success and failure exit codes must be listed and justified. Known weak oracle flagged: oak sync_push_divergence/error.push_diverged accepts exit 0.

Validation: python3 -m unittest discover -s tests (1478 tests, all pass, 11 skipped); devloop 0.97-vs-main run at results/audit-0.97-vs-main/20261109T074610Z.

Stage 5 containment: Cloudflare agent runner (2026-11-09)

  • cloudflare/agent-runner: a Worker plus a Container that runs one agent campaign per disposable Firecracker container.
    • The agent CLI runs as the unprivileged agent user via the claude-contained wrapper.
    • Egress is limited to api.anthropic.com, using HTTPS interception.
    • A 22-probe containment self-check runs as the agent user before any trial is admitted. Its containment.json ships in every job bundle.
    • Pins Oak 0.112.0 (linux-x86_64 release, by sha256) and claude-code 2.1.321.
  • scripts/cloud_campaign.py: a stdlib driver that submits a job, polls it, downloads the bundle to results/cloud-campaigns// and destroys the container.
  • Accuracy fix: provider API errors from Claude stream-json (auth, rate limit, overload) are now infrastructure errors (provider_api_error:<status>), not task failures. Before this, an invalid key scored as a VCS "Failure". Covered by tests/test_provider_errors.py.
  • config/agent-campaign-pilot-claude.json: 40-trial pilot manifest. Not run yet; it needs a credential.
  • Verified:
    • mock campaign: 4/4 pass, both locally (colima) and on Cloudflare;
    • containment: 22/22 probes on Cloudflare;
    • invalid-key Claude run: reaches the API through interception and gets a 401.
  • Full test suite: 1484 tests, 1 failure in test_agent_native_json_probe under machine load. It passes 4/4 when rerun alone and does not import any changed module.

Cloud runner: credentials and first real trials (2026-11-09)

  • Credentials: the Anthropic key is a Cloudflare Secrets Store binding.
    • The Worker injects it into real jobs and rejects any client-supplied secrets.
    • The driver no longer handles keys.
    • The container scrubs the key value from every returned file (redaction.json). Covered by tests/test_agent_runner_redaction.py.
  • Runner moved to the oak.space account. account_id is pinned in wrangler.jsonc, and the runner token was rotated.
  • Benchmark bug found by the first paid canary:
    • Before: the wide_config_refactor prompt never named the replacement value, but the trusted oracle requires timeout_ms = 3000. Every real agent failed, whatever the VCS.
    • After: the prompt names the value. PROMPT_VERSION is now 2026-11-09.1, and tests/test_task_prompt_oracle_parity.py pins it.
  • Canary results:
    • before the fix: 0/2 for both git and oak, failure config_payload_mismatch;
    • after the fix: git 1/1 and oak 1/1, reported cost $0.093 for both trials.

First real-agent pilot: three more instrument fixes (2026-11-10)

Pilot v1 (40 trials) could not compare Git and Oak. Three harness defects caused it, and none of them was Oak behaviour.

  • Independent Oak reader timed out on large_asset_manifest (10/10 Oak trials unmeasured).
    • Cause: the budget scaled by .oak/oak.db size, but the 64 MiB of assets compresses to a 224 KiB db, while the pure reader re-hashes the full 64 MiB. The fixed 300 s outer oracle limit also cut the reader off.
    • Fix: budget = max(db, worktree payload) bytes; the outer oracle timeout is derived from that budget; the reader takes a recorded --deadline-scale (runner sets 4; READER_VERSION .2; row field oak_reader_deadline_scale).
  • wide_config_refactor comparison REFUSED: Git was verified with the git binary under test, Oak by the independent reader.
    • Fix: the runner image builds a pinned, separately compiled git 2.47.1 as OAK_BENCH_GIT_INSTRUMENT, so both subjects have the independent_committed_tree evidence class.
  • task_total_ms included oracle (instrument) time: 66 s of Oak's large-asset total was our own verification.
    • Fix: the campaign report drops task_total_ms and reports setup_and_agent_ms and oracle_ms separately. Covered in tests/test_summary_accuracy.py.
  • Runner moved to standard-2 (1 vCPU).

Pilot v2 (claude-sonnet-5-5, full-docs, n=10 per cell; $0.89 total; 40/40 measured):

  • Success: git 20/20, oak 20/20.
  • Oak minus git, paired, 95% CI:
    • agent time: +2.6 s [2.0, 3.4] wide_config, +2.8 s [1.9, 3.8] large_asset;
    • output tokens: +211 [177, 243], +152 [114, 192];
    • median +1 turn and +1 tool call.
  • Cause: in 19/20 Oak trials the agent ran oak commit -m ..., was rejected (commits are messageless), then ran oak desc and re-committed. Filed as fb-619.
  • Diagnostic evidence only. One model, two fixed tasks.

Token accounting: campaign reports add output_tokens and context_tokens (uncached + cache read + cache write, adapter-aware so Codex cache reads are not double-counted). reported_tokens keeps its definition but omits Claude's cached context; pilot v2 re-scored: Oak's extra commit turn costs +24k/+37k context tokens per trial (fb-620). Campaign plan documents run cadence (mock per commit, canary+pilot per Oak release). Full suite: 1491 tests OK (11 skipped).

Details

Commit
63fc62c5679c
Parent
a3ea065926c9
Merge parent
f9c9927acebb

.oakignoremodifiedView file

@@ -22,3 +22,5 @@
2222 .env.*
2323 *.local
2424 .claude/
25+node_modules/
26+.wrangler/