Skip to content

fix(demographics): retry transient WPP page failures - #7580

Merged
koala73 merged 2 commits into
mainfrom
codex2/fix-demographics-partial-coverage
Sep 3, 2026
Merged

fix(demographics): retry transient WPP page failures#7580
koala73 merged 2 commits into
mainfrom
codex2/fix-demographics-partial-coverage

Conversation

@koala73

@koala73 koala73 commented Sep 3, 2026

Copy link
Copy Markdown
Owner

Why

A transient UN WPP HTTP 502 exhausted the two-attempt page retry contract. The seeder safely retained the last WPP section, but demographicsCapability stayed at COVERAGE_PARTIAL with two of three stages fresh. Seven later read-only WPP stage probes returned HTTP 200 for all ten page requests and passed all five metric floors for 229 countries. This supports an upstream transient, not a schema or coverage change.

Scope

  • Give only WPP page requests four bounded attempts. World Bank and ILOSTAT requests keep their existing retry contract.
  • Include the public upstream URL in an exhausted HTTP error, so a future failure identifies the exact page.
  • Keep stage retention, the completion marker, coverage floors, and health classification unchanged.

Tradeoffs

A persistent WPP failure can now use 1.5 seconds of retry delay instead of 250 milliseconds. This remains inside the existing 45-second stage deadline. The error log includes a public UN query URL and no credential.

Blast Radius

The runtime change affects only the WPP stage of the demographics static-reference seed. The investigation made no Redis write and did not start a production seeder. Production remains partial until one deployed run completes all three source stages.

Verification

  • The regression test failed before the fix because the second 502 ended the WPP stage and the error omitted the page URL.
  • node --test tests/demographics-capability-seed.test.mjs passed 20 tests.
  • npm run test:data passed 29,483 tests with 35 skipped and no failures.
  • npm run lint:boundaries passed.
  • A final read-only live WPP stage probe returned 229 countries. Each of the five required metrics had 229 observations.

Post-Deploy Monitoring & Validation

  • Owner and window: the release operator checks the first seed-bundle-static-ref production run within 30 minutes after it ends.
  • Confirm the service deployment contains this PR merge commit before a manual run. Otherwise, wait for the next scheduled daily tick. Do not loop retries manually.
  • Search Railway logs for Demographics-Capability and demographics:wpp. Healthy evidence is records=229 state=OK with no WPP error.
  • Confirm seed-meta:demographics:capability-complete has the same run timestamp.
  • Query /api/health?compact=1 with a cache-busting parameter. Accept only coverage.status=complete, completedPages=3, failedPages=0, completionRatio=1, and at least 229 records.
  • If WPP still fails, use the newly logged page URL to inspect that request. Keep the retained snapshot, do not repeat the production job, and roll back only if the deployed adapter causes a new failure mode.

Compound Engineering
GPT-5

@vercel

vercel Bot commented Sep 3, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
worldmonitor Ready Ready Preview Sep 3, 2026 4:31am UTC

Request Review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 3, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-03T04:27:58.086972Z 134750c PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@koala73
koala73 merged commit 05eb543 into main Sep 3, 2026
47 of 48 checks passed
@koala73
koala73 deleted the codex2/fix-demographics-partial-coverage branch September 3, 2026 09:59
Sign up for free to 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