You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(eval): commit each published score to the corpus a reader can download (#9811)
Verified live on api.loopover.ai: /v1/public/stats publishes
ai_consensus_defect at decided 460 / confirmed 287, /v1/public/eval-corpus
serves 460 real cases whose checksum re-derives from the downloaded bytes, and
/v1/public/eval-scores serves `{"records":[]}`.
The commitment came only from a persisted calibration.*_backtest_run audit
event. #9639 fixes that writer, but it runs inside a review pass, and hosted
review execution is retired (src/index.ts acks-and-drops review-execution jobs
off the queue), so on loopover.ai the event never exists. The walkthrough tells
an anonymous reader to fetch .records and re-derive recordDigest; they got an
empty array, explained by a doc line attributing it to an empty corpus that
demonstrably is not empty.
Each record now falls back to its OWN rule's published corpus checksum -- the
exact bytes /v1/public/eval-corpus serves, over the same window. That is not the
placeholder commitment #9215 forbids: it is a hash over an artifact the reader
downloads and re-hashes, which is what the `reproducible` tier asserts. A
persisted run still wins where one exists, so self-host is unchanged.
Resolving per rule also fixes a latent bug: one run's checksum was stamped onto
every record, so with more than one published rule every record but one would
have committed to a different rule's cases.
TRUNCATION HAD TO BE MADE DETECTABLE FIRST. PUBLIC_EVAL_CORPUS_MAX_CASES was
5_000 while the corpus is built from a rule-history read that
listAuditEventsByType hard-clamps to 2_000 -- and queryRuleHistory passed no
limit at all, so it took the default of 500. The cap could never bind, and
`truncated` was structurally always false, while /v1/public/stats counts
`decided` with an unbounded SQL COUNT(*). The two surfaces agreed only while the
window stayed under 500 cases; at 460 they were 40 from silently diverging, with
the corpus serving a prefix and reporting completeness. queryRuleHistory now
takes an explicit bound and reports `saturated`, the corpus ORs that into
`truncated`, and a truncated corpus is never published as a commitment -- its
checksum would cover a prefix of the window the score covers.
Closes#9805
0 commit comments