Title: pm-stack(aggregator): IngestionStore load gates accept impossible/non-ISO gap + checkpoint dates and negative counts · Issue #5232 · developing-today/code · GitHub
Open Graph Title: pm-stack(aggregator): IngestionStore load gates accept impossible/non-ISO gap + checkpoint dates and negative counts · Issue #5232 · developing-today/code
X Title: pm-stack(aggregator): IngestionStore load gates accept impossible/non-ISO gap + checkpoint dates and negative counts · Issue #5232 · developing-today/code
Description: pm-stack(aggregator): IngestionStore load gates accept impossible/non-ISO gap + checkpoint dates and negative counts Evidence pm-stack/aggregator/src/activity.ts (landed today in PR #5141, commit f5c8993; verified at origin/main d0a5b03)...
Open Graph Description: pm-stack(aggregator): IngestionStore load gates accept impossible/non-ISO gap + checkpoint dates and negative counts Evidence pm-stack/aggregator/src/activity.ts (landed today in PR #5141, commit f...
X Description: pm-stack(aggregator): IngestionStore load gates accept impossible/non-ISO gap + checkpoint dates and negative counts Evidence pm-stack/aggregator/src/activity.ts (landed today in PR #5141, commit f...
Opengraph URL: https://github.com/developing-today/code/issues/5232
X: @github
Domain: github.com
IPv4 address: 140.82.112.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"pm-stack(aggregator): IngestionStore load gates accept impossible/non-ISO gap + checkpoint dates and negative counts","articleBody":"# pm-stack(aggregator): IngestionStore load gates accept impossible/non-ISO gap + checkpoint dates and negative counts\n\n## Evidence\n\n`pm-stack/aggregator/src/activity.ts` (landed today in PR #5141, commit f5c8993c0; verified at origin/main d0a5b039c):\n\n- `isGapRecord` (activity.ts:284-295) checks `from`, `to`, and `detectedAt` with `typeof === \"string\"` only.\n- `isCheckpoint` (activity.ts:297-308) checks `lastEventAt` and `updatedAt` with `typeof === \"string\"` only, and `deliveries`/`duplicates` with `Number.isInteger` only — negative counts pass.\n- Neither gate uses the aggregator's standing rule `isIsoDate` (`pm-stack/aggregator/src/validate.ts:116`), which every sibling store gate was moved to for exactly this failure class (e.g. #5078, #5154, #5214).\n\nVerified with a laptop bun probe against `IngestionStore` at d0a5b039c (probe `/tmp/probe-activity.ts` on the laptop, scan worktree `~/git/fleet/scan-2026-11-03-laneA2`):\n\n- A persisted file whose gap has `from: \"2026-02-30T00:00:00.000Z\"`, `to: \"2026-04-31T00:00:00.000Z\"`, `detectedAt: \"March 2, 2026\"`, plus a second gap with `from: \"not-a-date\"`, `to: \"also-bad\"`, loads with **no quarantine** — `gaps()` returns both rows verbatim.\n- A checkpoint with `lastEventAt: \"2026-02-30T00:00:00.000Z\"`, `updatedAt: \"not-a-date\"`, `deliveries: -5`, `duplicates: -2` loads verbatim; after ingesting one real delivery the count is `-4`.\n- Consequences in the store's own arithmetic:\n - `recordGap` merge (activity.ts:515-516): extending the open watchdog gap with a real window ending `2026-03-10` did **not** widen `to`, because the stored Apr-31 rolls to May 1 under `Date.parse` — the recorded gap window silently overstates coverage by ~7 weeks.\n - `ingestSerialized` (activity.ts:499): a real delivery at `2026-02-20` does not advance `lastEventAt`, which stays pinned to the impossible Feb-30 stamp (parsed as Mar 2).\n - `gaps()` sort (activity.ts:414) and `resolveGap` extension (activity.ts:549) compare with `Date.parse`; a `not-a-date` value yields NaN, so ordering is undefined and the window never extends.\n\n## Why it matters\n\nThe ingestion store is the aggregator's dedupe/coverage memory: gap records are rendered as holes in history (\"never as coverage\", per the module header), and checkpoints decide what a restart re-emits. An impossible or non-ISO stamp in the persisted file — a hand edit, a partially corrupted write that stays valid JSON, a future producer formatting loosely — currently passes the load gate that is supposed to quarantine malformed rows, and then silently corrupts gap windows and checkpoint progress instead of failing loudly. The negative-count hole additionally lets delivery accounting go below zero.\n\n## Acceptance criteria\n\n- `isGapRecord` requires `from`, `to`, and `detectedAt` (and `resolvedAt` when present) to satisfy `isIsoDate`; `isCheckpoint` requires `lastEventAt` (when non-null) and `updatedAt` to satisfy `isIsoDate`, and `deliveries`/`duplicates` to be integers `>= 0`.\n- A persisted file violating these gates follows the store's existing malformed-row path (loud quarantine + empty start), consistent with the events store's discipline.\n- Tests in `pm-stack/aggregator/test/activity-3321.test.ts` (or a sibling) cover: impossible date (2026-02-30), non-ISO date (\"March 2, 2026\"), garbage date, and negative counts are each refused/quarantined; a valid file loads unchanged (control).\n- Aggregator test suite and `tsc` stay green.\n","author":{"url":"https://github.com/dezren39","@type":"Person","name":"dezren39"},"datePublished":"2026-11-04T01:29:30Z","url":"https://github.com/developing-today/code/issues/5232"}
| 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:09d1d7c8-33ae-1bfb-afc2-413fdf339bfa |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8E44:392ED4:F23E86:154C612:6B06F606 |
| html-safe-nonce | 2201eff0bcda96462831e4f60f603e1bd336cc1179721606aaee58d37857f2e2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RTQ0OjM5MkVENDpGMjNFODY6MTU0QzYxMjo2QjA2RjYwNiIsInZpc2l0b3JfaWQiOiIzNzAwNTA4NTc4NTA4MjgyOTQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | be94b56ce10c933523cc7e595deef2413738e4143c9b3703b44ec95d75d1fef2 |
| hovercard-subject-tag | issue:6194422793 |
| 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/5232/issue_layout |
| twitter:image | https://opengraph.githubassets.com/eb276b0b10abdd8e640c8fd7ea4884fdb5481ccb0e35bb38bb5fcba00cfe3ffc/developing-today/code/issues/5232 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/eb276b0b10abdd8e640c8fd7ea4884fdb5481ccb0e35bb38bb5fcba00cfe3ffc/developing-today/code/issues/5232 |
| og:image:alt | pm-stack(aggregator): IngestionStore load gates accept impossible/non-ISO gap + checkpoint dates and negative counts Evidence pm-stack/aggregator/src/activity.ts (landed today in PR #5141, commit f... |
| 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 | 518c89df9981b23ef4bf1cf9e25792a20e5884aa6a2efccd817801f8bae3dd64 |
| 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 | 3e66657d0989666cd38e3fb0fbd4e0c116e481e6 |
| 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