sync: cherry-pick citable/stat drift fixes to main#1155
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cherry-pick of the 2 commits merged to dev in #1154:
Run
vercel --prodafter merge to promote.