Skip to content

sync: cherry-pick citable/stat drift fixes to main - #1155

Merged
Flotapponnier merged 2 commits into
mainfrom
sync/citable-stat-drift-main
Jul 13, 2026
Merged

sync: cherry-pick citable/stat drift fixes to main#1155
Flotapponnier merged 2 commits into
mainfrom
sync/citable-stat-drift-main

Conversation

@Flotapponnier

Copy link
Copy Markdown
Collaborator

Cherry-pick of the 2 commits merged to dev in #1154:

  • f6f84b8: fix /api/citable/{date} unit scaling, /api/stat filters, initial draft-asOf null-out
  • 8fceb75: propagate draft-asOf guard to /api/stat, MCP, JSON-LD dateModified via citableAsOf() helper

Run vercel --prod after merge to promote.

Florent Tapponnier added 2 commits July 13, 2026 22:12
1. /api/citable/{date} unit scaling.
Snapshot route emitted `value: 627` for `aggregator-head-lag` while the
live /api/citable emitted `value: 0.63` on the same measurement. The
live route already wraps with valueInDeclaredUnit(raw, b.unit) but the
snapshot route was left with the raw internal-ms value. Wrap the same
way; sub-1 s benches now render in the declared `s` unit on both routes.
2. /api/stat/{slug} silently ignored ?chain= / ?region= / ?kind= / ?venue=.
getBenchmark accepted a filters object but the route never parsed the
URL. A citer asking /api/stat/rpc-capabilities?chain=ethereum got the
cross-chain aggregate. Parse the four dimension params, pass through
to the loader; unknown values fall back to unfiltered inside the
loader. Also widen getBenchmark options type to include kind and
venue — the underlying loadBenchmark already supports both.
3. Draft benches leaked a fake freshness signal.
Draft placeholder set lastRunAt to new Date for type safety
(Benchmark.lastRunAt is non-null), and both citable routes passed it
straight through as asOf. LLM crawlers treating asOf as ground truth
would think a draft bench was measured every minute. Null asOf in the
JSON when status is draft; the internal type stays intact.
…ified
The GEO audit review found the initial fix in commit f6f84b8 only covered
the two /api/citable JSON surfaces, but the same "draft benches spoof
freshness" class of bug lives on three more machine-readable channels
that LLM crawlers also key on:
- /api/stat/{slug} asOf field.
- MCP tool responses (list_benchmarks, get_benchmark, resource template,
and the plain-text "Last sample" line).
- JSON-LD dateModified on the bench page, per-chain sub-page, answer
page and alternatives page — Google, Bing, Perplexity all consume
dateModified as a freshness ranking signal.
Centralize the guard as citableAsOf(b) in @/lib/citation, rewire every
call site. Draft benches now uniformly omit or null the freshness
timestamp; live benches unchanged. On the visible /answers page,
the "Data as of..." line and its <time dateTime> anchor also hide for
drafts rather than displaying the wall-clock placeholder.
Follow-up to PR #1154 (commit f6f84b8) covering the surfaces the review
agent flagged as still spoofing.
@Flotapponnier
Flotapponnier merged commit 3991057 into mainJul 13, 2026
1 check failed
Sign up for freeto 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.

1 participant

@Flotapponnier