Skip to content

Add audit: stats v4.0 population-regression (map vs stats population parity) - #258

Open
badjoke-lab wants to merge 1 commit into
mainfrom
codex/create-audit-report-for-pr1-vs-main
Open

Add audit: stats v4.0 population-regression (map vs stats population parity)#258
badjoke-lab wants to merge 1 commit into
mainfrom
codex/create-audit-report-for-pr1-vs-main

Conversation

@badjoke-lab

Copy link
Copy Markdown
Owner

Motivation

  • Produce an evidence-based audit that determines which commit/PR changed the population (母集合) behavior between /api/places and /api/stats without modifying code.
  • Verify whether /api/stats aggregations total/breakdown/rankings/chains/matrix all reference the same WHERE/source.
  • Produce a standalone report docs/audits/stats-v4.0-population-regression.audit.md that records findings and the precise commits examined.

Description

  • Added docs/audits/stats-v4.0-population-regression.audit.md that documents the investigation, observed commits, and concrete code locations; no application code was changed.
  • Traced the relevant changes to two observable commits: 366eb16... (PR [Stats v4.0 Parity PR-1] Align stats population with map-displayable places #253) which introduced lib/stats/mapPopulation.ts and unified the map-displayable WHERE via getMapDisplayableWhereClauses / isMapDisplayablePlace, and 2f663dc... (PR Stats v4.0 parity PR-2: align verification breakdown counts and ship donut UI #254) which altered verification aggregation logic (LATERAL/subquery, normalization) and added the breakdown field while retaining the unified WHERE usage.
  • Confirmed that v4 DB-path aggregations use a shared WITH filtered_places AS (...) CTE built from getMapDisplayableWhereClauses, and identified remaining divergence vectors that can cause population mismatches: verification interpretation differences (Map uses LEFT JOIN verifications, Stats uses LEFT JOIN LATERAL with priority), and string-normalization differences for accepted/country/city/category; also documented stats_cache and JSON-fallback as separate sources.

Testing

  • No automated tests were run for this change (this PR only adds an audit document and performs code inspection).

Codex Task

@vercel

vercel Bot commented Feb 24, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cryptopaymap-v2 Ready Ready Preview, Comment Feb 24, 2026 3:59am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant