Problem Statement
The production Polymarket reference collector cannot recover its fresh health record because Gamma returns HTTP 500 for the closed-market discovery request that combines the crypto tag with both end-date bounds. The collector exhausts its bounded HTTP retries, becomes stale, and systemd restarts it. This blocks the immutable baseline Gate and therefore the already-merged async uploader rollout.
Solution
Keep the existing tagged, bounded discovery request as the primary path. If and only if the closed-lane request exhausts its bounded retries with Gamma HTTP 500, retry the same closed date window without tag_id; retain the existing target-market eligibility checks and fail closed on every other error or an unsuccessful fallback.
User Stories
- As the data operator, I want the reference collector to survive Gamma's known closed-lane 500 response so that fresh reference data can resume.
- As a researcher, I want the fallback to retain the configured crypto 5-minute and 15-minute market eligibility rules so that unrelated market data is not admitted.
- As a runtime controller, I want authorization, client, and decoding failures to remain terminal so that a fallback cannot hide an integrity problem.
- As a deployer, I want a deterministic local proof of the primary 500 and fallback success path so that the production Gate remains evidence-driven.
Implementation Decisions
- Keep the current tagged Gamma keyset query unchanged for normal closed-lane discovery.
- Limit fallback activation to the observed exhausted HTTP 500 condition in the closed lane; do not broaden it to 4xx, authentication, timeout, decoding, or completeness failures.
- Preserve both date bounds in the fallback query. Remove only the server-side tag parameter that participates in the failing combination.
- Reuse the existing target-market eligibility rule as the admission boundary after discovery.
- Keep collector configuration, uploader behavior, data retention, and the production Gate contract unchanged.
Testing Decisions
Out of Scope
- Changing Gamma APIs, accepting partial discovery, loosening the stale-health/Gate policy, changing collection symbols or time windows, uploader changes, data deletion, and deploying the fix.
Further Notes
Live ECS readback on 2026-08-03 showed closed=true, tag_id=21, end_date_min, and end_date_max returning 500; open with the same bounds and closed without the tag returned 200. #533 remains the separate runtime-control issue.
Problem Statement
The production Polymarket reference collector cannot recover its fresh health record because Gamma returns HTTP 500 for the closed-market discovery request that combines the crypto tag with both end-date bounds. The collector exhausts its bounded HTTP retries, becomes stale, and systemd restarts it. This blocks the immutable baseline Gate and therefore the already-merged async uploader rollout.
Solution
Keep the existing tagged, bounded discovery request as the primary path. If and only if the closed-lane request exhausts its bounded retries with Gamma HTTP 500, retry the same closed date window without
tag_id; retain the existing target-market eligibility checks and fail closed on every other error or an unsuccessful fallback.User Stories
Implementation Decisions
Testing Decisions
Out of Scope
Further Notes
Live ECS readback on 2026-08-03 showed
closed=true,tag_id=21,end_date_min, andend_date_maxreturning 500; open with the same bounds and closed without the tag returned 200. #533 remains the separate runtime-control issue.