Skip to content

feat(benchmark): leaderboard artifacts as spec-conformant EvalScoreRecords (#9265) - #9602

Merged
JSONbored merged 2 commits into
mainfrom
feat/benchmark-eval-records-9265
Jul 29, 2026
Merged

feat(benchmark): leaderboard artifacts as spec-conformant EvalScoreRecords (#9265)#9602
JSONbored merged 2 commits into
mainfrom
feat/benchmark-eval-records-9265

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Stacked on #9600 (stack #9601): #9595#9598#9599#9600 → this.

What

#9216 requirement 5 is explicit that leaderboard artifacts are exactly the eval-interface's consumable score records — no parallel format. So this emits EvalScoreRecords with workUnit.kind === "benchmark_run" through the same contentDigest path the outcome_confirmed_precision records already use, and derives the board from those records and nothing else.

That last point is the structural one: there is no second query path from the scorer to the board. A number on the leaderboard is, by construction, a field of a record a third party can fetch, re-derive and digest-verify — so the published board and the consumable feed cannot disagree, because they're the same data read twice.

Two policies enforced here rather than left to a caller's discipline

Held-out cadence (#9263 decision 2). The emitter is the last point before a number becomes public, so it's where cadence is enforced. A held-out record is simply not built while the window is open — not built-and-filtered, not built-with-a-flag — so there is no in-memory held-out record for a downstream bug to serialize. The regression test probes this with the would-be record's own digest, a 64-hex value unique to that exact content, because my first attempt used the held-out precision as the probe and it was 0 — a substring of almost any JSON, so it passed for the wrong reason.

Trust tier from the actual execution. attested requires a real envelope; absent one the tier is reproducible, never optimistically upgraded. The record type's discriminated union already makes "attested without an envelope" unrepresentable, and the tier sits inside the digest preimage, so a tier claim can't be edited after issuance (asserted: the two tiers produce different digests for otherwise-identical content).

Score mapping and ranking

The score block maps the multi-class report onto the spec's fixed fields without inventing any: precision/recall are #9262's macro headline, decided/abstained/coverage come from the report's own coverage block, and confirmed is the count of decided units the agent got right. Ranking is macro precision descending with null last (unmeasurable is not zero, and sorting it as 0 would invent a claim), ties broken by coverage descending then by the earlier issuedAt. Immutability is respected rather than worked around: several records for one subject resolve to the latest issuedAt, because a corrected score is a new record, never a mutation.

Tests (14, 100% of branches)

Spec conformance including an exact top-level key set (no extra fields); full commitments block with no placeholders; the score mapping; the decided-nothing null arms; both trust tiers with distinct digests; the not-built-while-open regression; publication at close and on a cadence boundary but not a day either side; the ranking comparator across every arm (null-vs-null falling through to coverage, the ?? -1 fallback from both argument positions, the earlier-claim tiebreak, order-independence); the corrected-score regression; cross-benchmark and cross-kind exclusion; and the empty set.

Also registers the module in check-dead-source-files' staged-ahead allowlist — the emitter lands before its serving route (#9216's endpoint sub-issue) and before #9264 supplies the envelopes its attested tier consumes, so the checker's flag was correct and the entry names both, as the checker itself instructs.

Closes #9265

@loopover-orb

loopover-orb Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Important

🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨

⏳ LoopOver is waiting…

LoopOver has seen this pull request and is waiting on CI checks to finish before reviewing it. This comment will update once the review runs.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed · 🟨 Waiting

@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@JSONbored JSONbored self-assigned this Jul 28, 2026
@JSONbored
JSONbored force-pushed the feat/benchmark-eval-records-9265 branch from a1bc65b to 14e8444 Compare July 28, 2026 21:53
@JSONbored
JSONbored force-pushed the feat/benchmark-eval-records-9265 branch from 14e8444 to b767cc7 Compare July 28, 2026 21:54
@codecov

codecov Bot commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.10%. Comparing base (9942512) to head (35bf2be).
⚠️ Report is 3 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #9602   +/-   ##
=======================================
  Coverage   90.10%   90.10%           
=======================================
  Files         890      891    +1     
  Lines      112223   112251   +28     
  Branches    26610    26621   +11     
=======================================
+ Hits       101120   101148   +28     
  Misses       9773     9773           
  Partials     1330     1330           
Flag Coverage Δ
backend 95.52% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/review/benchmark-eval-records.ts 100.00% <100.00%> (ø)

loopover-orb[bot]
loopover-orb Bot previously approved these changes Jul 28, 2026

@loopover-orb loopover-orb Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LoopOver approves — the gate is satisfied and CI is green.

@JSONbored
JSONbored force-pushed the feat/benchmark-eval-records-9265 branch from b767cc7 to d8ee995 Compare July 28, 2026 22:56
@loopover-orb
loopover-orb Bot dismissed their stale review July 28, 2026 23:11

LoopOver retracted this approval — a newer commit no longer qualifies.

@loopover-orb loopover-orb Bot added the manual-review Gittensor contributor context label Jul 28, 2026
@JSONbored
JSONbored force-pushed the feat/benchmark-eval-records-9265 branch from d8ee995 to d914bc2 Compare July 28, 2026 23:17
@JSONbored
JSONbored force-pushed the feat/benchmark-eval-records-9265 branch from d914bc2 to 704dc0e Compare July 29, 2026 00:01
Base automatically changed from feat/benchmark-anti-overfit-9263 to main July 29, 2026 01:39
…cords (#9265)

#9216 requirement 5 is explicit that leaderboard artifacts are EXACTLY the
eval-interface's consumable score records, so this emits EvalScoreRecords
with workUnit.kind === "benchmark_run" through the same digest path the
outcome_confirmed_precision records already use, and derives the board
from those records and nothing else.

That last point is the structural one: there is no second query path from
the scorer to the board. A number on the leaderboard is by construction a
field of a record a third party can fetch, re-derive and digest-verify, so
the published board and the consumable feed cannot disagree -- they are
the same data read twice.

Two policies are enforced here rather than left to a caller's discipline:

- HELD-OUT CADENCE (#9263 decision 2). The emitter is the last point
  before a number becomes public, so it is where cadence is enforced. A
  held-out record is simply NOT BUILT while the window is open -- not
  built-and-filtered, not built-with-a-flag -- so no in-memory held-out
  record exists for a downstream bug to serialize. Probed in the tests by
  the would-be record's own digest, which cannot pass by coincidence the
  way a bare number could.
- TRUST TIER FROM THE ACTUAL EXECUTION. `attested` requires a real
  envelope; absent one the tier is `reproducible`, never optimistically
  upgraded. The record type's discriminated union makes "attested without
  an envelope" unrepresentable, and the tier is inside the digest
  preimage, so a tier claim cannot be edited after issuance.

The score block maps the multi-class report onto the spec's fixed fields
without inventing any: precision/recall are #9262's macro headline,
coverage comes from the report's own block, and `confirmed` is the count
of decided units the agent got right. Ranking is macro precision
descending with null LAST (unmeasurable is not zero), ties broken by
coverage then by the earlier claim; a corrected score is a new record with
a later issuedAt and the latest wins, never a mutation.

Closes #9265
…d of its serving route

check-dead-source-files correctly flagged src/review/benchmark-eval-records.ts:
#9265 lands the emitter and leaderboard derivation, while the route that
serves benchmark_run records is #9216's own endpoint sub-issue and the
attestation envelopes its 'attested' tier consumes come from #9264. The
allowlist entry names both, per the checker's own instruction.
@JSONbored
JSONbored force-pushed the feat/benchmark-eval-records-9265 branch from 704dc0e to 35bf2be Compare July 29, 2026 01:39
@JSONbored
JSONbored merged commit d5a4210 into main Jul 29, 2026
2 checks passed
@JSONbored
JSONbored deleted the feat/benchmark-eval-records-9265 branch July 29, 2026 01:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

manual-review Gittensor contributor context

Projects

None yet

Development

Successfully merging this pull request may close these issues.

benchmark: leaderboard artifacts as spec-conformant EvalScoreRecords

1 participant