Bench: everything the grader needs, seed tables, raw files split out

#3

All the data to run and grade the benchmark is now here; the code repo (c2a-bench/Context2Agent-Benchmark) holds only code and scripts/fetch_bench.py, which rebuilds every task file from this dataset.

  • cases.json: each ticket has grading, the grader's fields not already in its other columns.
  • seed/.json: the records the graded tickets run against, one row per record, shown as 19 viewer tables.
  • grader/: rules, facts and fact tags per stage, Rincomplete's unknown.json, and format.json.
  • stages//raw.json: each doc's exact file, moved out of docs.json (Skyway stage 0 docs.json: 85 MB -> 40 MB for the website).
  • Checked: fetch_bench.py output is byte-identical to the original task folders (74,705 checks), and the grader's fixture checks pass on every stage. All 36 viewer tables load.

MuhammadOwais786 changed pull request status to open
observeai org
β€’
edited 4 days ago

Review of this PR (read from inventory.json and the redwood-inference files; Skyway files and fetch_bench.py not read). Main finding: several things are stored more than once. Proposed changes below.

Before (this PR): 160 files, 103 MB (main was 68 files, 99 MB)

<domain>/
β”œβ”€β”€ task.json Β· architectures.json
β”œβ”€β”€ grader/
β”‚   β”œβ”€β”€ rules.json facts.json fact_tags.json format.json     stage 0
β”‚   └── stages/stage1..5/{rules,facts}.json                  stages 1–5
β”œβ”€β”€ seed/<table>.json
└── stages/<n>/
    β”œβ”€β”€ docs.json  raw.json  changes.json
    β”œβ”€β”€ cases.json  train.json  examples.json  instruction.json

After (proposed)

<domain>/
β”œβ”€β”€ task.json Β· architectures.json
β”œβ”€β”€ train.json                     once per domain
β”œβ”€β”€ format.json                    order, indent, key order of every rebuilt file
β”œβ”€β”€ seed/<table>.json              non-empty tables only
└── stages/<n>/                    same numbering everywhere
    β”œβ”€β”€ docs.json                  every original field + text, stored once
    β”œβ”€β”€ changes.json
    β”œβ”€β”€ rules.json  facts.json     delta per stage
    β”œβ”€β”€ test.json                  was cases.json; rule and fact ids; customer-fact tags kept here only
    └── instruction.json

What is duplicated today

  • train.json is identical in every stage of a domain, and is the same 18 tickets as examples.json.
  • Support-agent-knowledge cases.json is identical in stages 0, 1, 3 and 4.
  • Doc text is in both docs.json and raw.json (51 MB). The repo grew 99 β†’ 103 MB even though docs.json shrank.
  • Rule text is in cases.json, grader/rules.json, grader/stages/*/rules.json and changes.json. Stage 1 rules repeat 17 of stage 0's 20 unchanged.
  • Customer-fact annotations are in cases.json, facts.json and fact_tags.json. facts.json is generated from the other two.
  • Six empty [] files (and 60-byte empty changes.json at stage 0).

Changes

# Change Removes Needs
1 docs.json keeps all original fields; drop raw.json. fetch_bench.py writes doc files from it using format.json raw.json (51 MB), doc text copies format.json extended with per-doc key order and indent. Verify with the existing byte-identical check
2 train.json once per domain; delete examples.json 5 + 7 per-stage copies README configs point to the one path; fetch_bench.py rebuilds the old examples.json shape
3 One cases.json for support-agent-knowledge if stages stay identical 3 copies (1 MB) Configs share a data_files path
4 Rules once, as a delta per stage; cases.json and changes.json carry ids 3 of 4 copies of rule text fetch_bench.py merges stages 0..n, as the site does for docs
5 Drop fact_tags.json; keep decisive / why / decides in cases.json 1 of 3 fact copies build_facts.py reads cases.json
6 Move grader/ into stages/<n>/; same numbering (no stage1 vs 1) the stage-0 special case path updates in code repo
7 Don't store empty tables or empty changes.json 7 files fetch_bench.py creates empty tables
8 Rename cases.json β†’ test.json, pairing with train.json the naming mismatch README configs: paths, fetch_bench.py, viewer loaders, format.json keys; runs pinned at a5a6c6c still use cases.json, so the viewer reads both or the runs are re-pinned. Do it in the same change as the rest

Optional, for the website: Skyway stage 0 docs.json is 39.6 MB and is nearly all of the site's load. Make it an index (metadata + text hash) and load text on demand from sharded files, as the runs PR does with content/texts/.

Not checked: whether all docs round-trip byte-for-byte from docs.json + format.json, whether the grader depends on case order, whether redwood-inference and support-agent-knowledge seed tables overlap, and the 36 viewer tables.

Thanks, all 8 are in (commit 84fa92f): 109 MB β†’ 55 MB, 161 β†’ 122 files.

<domain>/
β”œβ”€β”€ task.json            stages[].files (what each stage folder has), tests_from (packs sharing tickets)
β”œβ”€β”€ architectures.json   skyway-air
β”œβ”€β”€ format.json          how fetch_bench.py writes every file back, byte for byte
β”œβ”€β”€ train.json           practice tickets, once (train split of every stage)
β”œβ”€β”€ train_seed/<table>.json
β”œβ”€β”€ seed/<table>.json    non-empty only
└── stages/<n>/
    β”œβ”€β”€ docs.json        each doc's original fields (`file`), born, edited
    β”œβ”€β”€ changes.json     only when something changed; rule_changes = id, status, what (+ diff)
    β”œβ”€β”€ rules.json  facts.json   new or changed at this stage
    β”œβ”€β”€ test.json        rules as ids + the facts they need
    └── instruction.json

Differences from the proposal:

  • 2: Redwood adds practice tickets at stages 4 and 5, so train.json has a stage column (first stage the builder has it). The practice tickets' sample records (Skyway adds some at stages 3–4 with no new ticket) are in train_seed/.
  • To share one train.json across the stage configs, test rows also have stage, grading is JSON text, and practice rows' tags are empty (their values are in grading). Without that the viewer can't align the splits.
  • 5: fact_tags.json is rebuilt from the tickets' facts; one Skyway ticket lists them in another order, kept in format.json.

Checks:

  • Docs round-trip from docs.json + format.json: yes, all of them. Only one practice file (SAK examples/seed/api_keys.json, hand-formatted) is kept as text in format.json. fetch_bench.py filled from this commit gives task folders byte-identical to the originals (all 12,861 files).
  • Grader and case order: order is kept. format.json stores each grader file's ticket order, so tests/cases.json comes back identical.
  • Redwood / SAK seed overlap: small. Tickets 0 shared (48 same id, different content), customers 9 of 15, api_keys 12 of 14, requests 1 of 3. SAK's whole seed is 44 KB, so I kept them separate.
  • Viewer tables: 17 now (the seed tables were taken out earlier); all load with train + test.
aashsach-oai changed pull request status to merged

Sign up or log in to comment