Title: aggregator: a future-dated gatherer read is 'fresh' forever until its date passes — quota-current freshness has no upper bound, so one skewed measuredAt pins a pool's windows for weeks · Issue #1541 · developing-today/code · GitHub
Open Graph Title: aggregator: a future-dated gatherer read is 'fresh' forever until its date passes — quota-current freshness has no upper bound, so one skewed measuredAt pins a pool's windows for weeks · Issue #1541 · developing-today/code
X Title: aggregator: a future-dated gatherer read is 'fresh' forever until its date passes — quota-current freshness has no upper bound, so one skewed measuredAt pins a pool's windows for weeks · Issue #1541 · developing-today/code
Description: aggregator: a future-dated gatherer read is 'fresh' forever until its date passes — quota-current freshness has no upper bound, so one skewed measuredAt pins a pool's windows for weeks Summary entryState in pm-stack/aggregator/src/quota-...
Open Graph Description: aggregator: a future-dated gatherer read is 'fresh' forever until its date passes — quota-current freshness has no upper bound, so one skewed measuredAt pins a pool's windows for weeks Summary entr...
X Description: aggregator: a future-dated gatherer read is 'fresh' forever until its date passes — quota-current freshness has no upper bound, so one skewed measuredAt pins a pool's windows for weeks ...
Opengraph URL: https://github.com/developing-today/code/issues/1541
X: @github
Domain: github.com
IPv4 address: 140.82.112.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"aggregator: a future-dated gatherer read is 'fresh' forever until its date passes — quota-current freshness has no upper bound, so one skewed measuredAt pins a pool's windows for weeks","articleBody":"# aggregator: a future-dated gatherer read is 'fresh' forever until its date passes — quota-current freshness has no upper bound, so one skewed measuredAt pins a pool's windows for weeks\n\n## Summary\n\n`entryState` in pm-stack/aggregator/src/quota-current.ts:56-61 decides whether\na gatherer entry may replace a pool's windows:\n\n```ts\nconst t = Date.parse(entry.measuredAt);\nreturn Number.isFinite(t) && nowMs - t \u003c= QUOTA_CURRENT_FRESH_MS ? \"ok\" : \"stale\";\n```\n\nThe check bounds only the past. A `measuredAt` in the future gives a negative\nage, which is always `\u003c= QUOTA_CURRENT_FRESH_MS` (20 min) — so a read stamped\nan hour, a day, or a month ahead is classified `\"ok\"`, replaces the pool's\nwindows in `overlayQuotaCurrent`, recomputes the pool state and the routing\nchoices (`computeChoices`), and keeps doing so on every render until 20\nminutes after its future date arrives. The newest-entry sort in the overlay\n(`Date.parse(b.measuredAt) - Date.parse(a.measuredAt)`, quota-current.ts:139-141)\nalso makes a future-dated entry win over every genuinely fresh entry for the\nsame service.\n\n## Evidence (verified on main 3b559045, Bun 1.4.2, real quota-current.ts sha256 c528e1e3 on the laptop)\n\nProbe drove the real `overlayQuotaCurrent` with a fixed `now`\n(2026-10-27T07:00:00Z), one pool (weekly window at 68%), and one ok entry\ncarrying a 42% window:\n\n| measuredAt | result |\n|---|---|\n| 5m ago (control) | state healthy, windows replaced (42), freshness ok |\n| 19m ago (control) | healthy, windows replaced, freshness ok |\n| 21m ago (control) | state **stale**, windows kept (68) |\n| **1h in the future** | healthy, windows **replaced (42)**, freshness **ok** |\n| **30d in the future** | healthy, windows **replaced (42)**, freshness **ok** |\n\n`parseQuotaCurrent` (quota-current.ts:41-52) validates only that\n`measuredAt` is a string, so nothing upstream of `entryState` catches this\neither. The existing tests (test/quota-current.test.ts) construct entries\nonly with past offsets (`iso(msAgo)`), so the future case is uncovered.\n\n## Why it matters\n\nThe module's own contract (header, quota-current.ts:7-19) is the dashboard's\ndata-honesty rule for the quota plane: a read past the freshness bound\n\"surfaces as the pool's state (error/stale, with the reason) — never as\nzeros, and the pool's older windows are never silently presented as\ncurrent\". A future stamp defeats that rule in the other direction: one\nclock-skewed or mis-stamped gatherer write (the gatherer runs on a 15-minute\ntick on another host) silently presents its numbers as the freshest truth\nfor as long as the skew lasts — a month in the verified case — and the\nchoices computed from those windows steer real session routing.\n\n## Acceptance criteria\n\n- An entry whose `measuredAt` is more than a small clock-skew tolerance in\n the future (tolerance pinned in triage; it should be minutes, not the\n unbounded current behaviour) is NOT classified fresh-ok: it surfaces as\n stale (or error) with the pool's older windows not replaced.\n- The fresh-ok precedence sort cannot let a future-dated entry outrank a\n genuinely fresh entry for the same service.\n- Regression tests in test/quota-current.test.ts for measuredAt at\n +1h and a far-future date, alongside the existing past-offset controls.\n- No change to the freshness bound or semantics for past-dated reads.\n\n## Notes\n\n- Deliberately not self-solved by the creator lane: the skew tolerance is a\n small policy choice for triage (the gatherer and aggregator run on\n different hosts, so zero tolerance could flap on real skew).\n- Sibling validator, different defect: #1540 (snapshot store records) —\n same app, unrelated module and mechanism.\n","author":{"url":"https://github.com/dezren39","@type":"Person","name":"dezren39"},"datePublished":"2026-10-28T00:52:41Z","url":"https://github.com/developing-today/code/issues/1541"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:d69ecc79-6734-fe2e-8abc-95ba0dfb3452 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9B84:34F10E:806F0C:AB7078:6B062FB8 |
| html-safe-nonce | 8ab3f074578bd0eff7f4c242cc8c1e56f91ac55907bae5b1d2f388dcb0b1f58d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5Qjg0OjM0RjEwRTo4MDZGMEM6QUI3MDc4OjZCMDYyRkI4IiwidmlzaXRvcl9pZCI6Ijg2ODgwODQ1NDc5NDgzOTIzNzYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 781bd864b02cb21d1a5af6a47157e6fd44b056f75d973e2a73dce550a8e02114 |
| hovercard-subject-tag | issue:6070435327 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/developing-today/code/1541/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f5d88e540dafc1ddc521150826fe129c9b9151722ca8808be55baceb7e9aefca/developing-today/code/issues/1541 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f5d88e540dafc1ddc521150826fe129c9b9151722ca8808be55baceb7e9aefca/developing-today/code/issues/1541 |
| og:image:alt | aggregator: a future-dated gatherer read is 'fresh' forever until its date passes — quota-current freshness has no upper bound, so one skewed measuredAt pins a pool's windows for weeks Summary entr... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dezren39 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7f961de5dd5c5d4aca24d33f8b3ffb3fb8b2ef53d0a4f32f01f0a790e512f6d3 |
| turbo-cache-control | no-preview |
| go-import | github.com/developing-today/code git https://github.com/developing-today/code.git |
| octolytics-dimension-user_id | 26439447 |
| octolytics-dimension-user_login | developing-today |
| octolytics-dimension-repository_id | 627308783 |
| octolytics-dimension-repository_nwo | developing-today/code |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 627308783 |
| octolytics-dimension-repository_network_root_nwo | developing-today/code |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 494ea0bb1e0feef734a83e2628697647755e8864 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width