GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — aggregator(snapshots): isSnapshotRollup re-admits the shapes isSnapshotRecord was hardened to refuse — impossible dates, negative/string limit, unparseable resetsAt, inverted pairs expand into the reading path unchecked · Issue #3365 · developing-today/code

aggregator(snapshots): isSnapshotRollup re-admits the shapes isSnapshotRecord was hardened to refuse — impossible dates, negative/string limit, unparseable resetsAt, inverted pairs expand into the reading path unchecked #3365

New issue
Copy link
New issue
Copy link
Closed
#4440
Closed
aggregator(snapshots): isSnapshotRollup re-admits the shapes isSnapshotRecord was hardened to refuse — impossible dates, negative/string limit, unparseable resetsAt, inverted pairs expand into the reading path unchecked#3365
#4440
Copy link
Assignees
dezren39
Labels
app/aggregatorPackage/app: aggregator (pm-stack in this repo)app/pm-stackpm-stack (Pad/Grist) in developing-today/codeeffort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/lowNice to have; do when convenientsource/creatorFiled by the new-issue-creator jobtask/triageQueue packet kind: verify, reproduce, and route this item

Description

@dezren39
dezren39
opened on Nov 1, 2026
Issue body actions

Bug

SnapshotStore.readAll has two doors into the same reading path, and only one of them is hardened. Raw lines must pass isSnapshotRecord (pm-stack/aggregator/src/snapshots.ts:296), which was deliberately tightened (#2264/#2483): timestamps must be real ISO calendar dates via the strict isIsoDate primitive (because Date.parse rolls 2026-02-30 into March), limit must be a non-negative finite number when present, resetsAt must be a real ISO date when present, and pair values must have finite endpoints with low <= high.

Rollup lines take the other door: readAll gates them only on isSnapshotRollup (snapshots.ts:82, used at snapshots.ts:552) and then expandRollup (snapshots.ts:226) emits records straight into the reading path — the expanded records are never passed through isSnapshotRecord. But isSnapshotRollup does not apply the record-side rules:

  • Timestamps (firstTs/lastTs/minTs/maxTs) are checked with Number.isNaN(Date.parse(f)) (snapshots.ts:94-95) — exactly the loose check the record validator was fixed away from. 2026-02-30T00:00:00.000Z passes.
  • limit and resetsAt are not checked at all, even though expandRollup copies them onto the expanded last record and the record-side comment says these fields "are dereferenced downstream (pct-of-limit, reset comparisons), so a non-finite/negative limit or an impossible resetsAt date must refuse the record here, at the boundary."
  • Pair values (valueMin/valueMax/valueLast) accept any {low, high} with typeof === "number" endpoints (snapshots.ts:97-103): an inverted pair {low: 10, high: 5} passes, while the record side explicitly refuses inverted pairs.

The same loose gate also seeds compaction: existing rollups are re-aggregated through isSnapshotRollup at snapshots.ts:707, so a malformed rollup line is not just read, it is carried forward into the next compaction.

Evidence (verified this run, main 1a68d6a)

Laptop probe ~/git/fleet/probe-2026-11-01-laneA-rollupgate/probe.ts driving the real snapshots.ts (sha256 c6685035… matched on both clones; output in probe.txt in the same directory):

  • Control: a valid rollup passes isSnapshotRollup, expands to 3 records, and all 3 pass isSnapshotRecord.
  • lastTs = "2026-02-30T00:00:00.000Z" → isSnapshotRollup=true; one expanded record fails isSnapshotRecord.
  • limit = -5 → passes; the expanded last record (the one carrying limit) fails isSnapshotRecord.
  • limit = "100" (string) → passes; expanded last record fails isSnapshotRecord.
  • resetsAt = "not-a-date" → passes; expanded last record fails isSnapshotRecord.
  • valueMin = {low: 10, high: 5} (unit usd-est) → passes; expanded min record fails isSnapshotRecord.

Rollup files are kept indefinitely (13-month raw retention, rollups forever), so a single malformed or hand-edited rollup line poisons the reading path permanently, where a malformed raw line would only be dropped.

Minor, same function: the month check (/^\d{4}-\d{2}$/, snapshots.ts:86) accepts 2026-13 / 2026-00, months no writer produces.

Why it matters

The snapshot store is the usage hub's history: latest-value readers, pct-of-limit computations, and reset markers all consume readAll output trusting that the boundary validators refused impossible data. The record side of that boundary was hardened after real incidents (#2264/#2483); the rollup side silently re-admits the same shapes, and compaction re-seeds them forward, so the corruption is self-perpetuating rather than one-off.

Acceptance criteria

  • isSnapshotRollup refuses a rollup whose firstTs/lastTs/minTs/maxTs (and resetsAtTs/limitTs when present) are not strict ISO calendar dates (same isIsoDate primitive as isSnapshotRecord).
  • isSnapshotRollup refuses a present non-null limit that is not a non-negative finite number, and a present non-null resetsAt that is not a strict ISO date — mirroring the record-side rules.
  • isSnapshotRollup refuses pair values with non-finite endpoints or low > high, mirroring the record side.
  • month refuses impossible months (00, 13+).
  • Tests pin each refused shape above plus a valid rollup (including a valid pair-valued rollup and one carrying limit/resetsAt) still passing and expanding to records that all pass isSnapshotRecord.
  • No change to the compaction writer's output format or to expandRollup's expansion semantics for valid rollups.

Distinct from #2568 (recordsFromProviderUsage used_percent range, writer side) and #3295/#3285 (snapshot script argument handling). Found by comparing the two store-read validators in snapshots.ts.

Activity

Next
  1. dezren39
    added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    priority/lowNice to have; do when convenient
    queue/queuedHas a queued queue task
    source/creatorFiled by the new-issue-creator job
    task/triageQueue packet kind: verify, reproduce, and route this item
    status/needs-triageNot yet triaged; needs a first look
    app/aggregatorPackage/app: aggregator (pm-stack in this repo)
    effort/sSmall: expected under 2 hours of work
    on Nov 1, 2026
  2. dezren39 commented on Nov 1, 2026

    @dezren39
    dezren39
    on Nov 1, 2026
    MemberAuthor
    More actions

    🤖 Agent note · filed

    • Agent: new-issue-creator job (new-issue-creator-code-a)
    • Session / ID: cron job new-issue-creator-code-a, run 2026-11-01 00:35 CDT
    • Found via: filed this run
    • Task: Tighten isSnapshotRollup (pm-stack/aggregator/src/snapshots.ts:82) to the record-side boundary rules so malformed rollup lines cannot expand into the reading path unchecked.
    • Expectation: effort/s — done when the acceptance criteria on this issue pass, including tests pinning each refused shape and a valid-rollup control whose expansion passes isSnapshotRecord.
    • Links: evidence in the issue body; laptop probe at ~/git/fleet/probe-2026-11-01-laneA-rollupgate/ (probe.ts + probe.txt, real snapshots.ts, sha256 c6685035 matched on both clones, main 1a68d6a).
  3. github-actions
    assigned
    dezren39
    on Nov 1, 2026
  4. dezren39
    added
    app/pm-stackpm-stack (Pad/Grist) in developing-today/code
    on Nov 1, 2026
  5. dezren39 commented on Nov 1, 2026

    @dezren39
    dezren39
    on Nov 1, 2026
    MemberAuthor
    More actions

    agent-note:v1
    event: picked-up
    task: 5086 (repo-health-code-pilot, OpenChamber scheduled lane)
    state: claimed
    verified: #3365 is open; no matching open PR found. Nearby open #3443 concerns invalid rollup counts, a distinct field from #3365 timestamp/limit/resetsAt/pair validation. Packet includes a prior real-code probe; I will recheck the current main state before routing.
    next: Verify the reported rollup/record gate mismatch against current main and post triage evidence plus a focused follow-up.

  6. dezren39
    added
    work/assignedQueue worker lifecycle state
    and removed
    status/needs-triageNot yet triaged; needs a first look
    queue/queuedHas a queued queue task
    on Nov 1, 2026
  7. 67 remaining items

  8. dezren39
    added
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    and removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    on Nov 2, 2026
  9. dezren39 commented on Nov 2, 2026

    @dezren39
    dezren39
    on Nov 2, 2026
    MemberAuthor
    More actions

    🤖 Agent note · parked

    • Agent: openchamber-scheduled-lane
    • Session / ID: OpenCode scheduled lane; queue task 6064
    • Found via: repo-health-code-pilot atomic claim
    • Task: PR fix(aggregator): validate snapshot rollup boundaries #4440 is open for the aggregator(snapshots): isSnapshotRollup re-admits the shapes isSnapshotRecord was hardened to refuse — impossible dates, negative/string limit, unparseable resetsAt, inverted pairs expand into the reading path unchecked #3365 rollup-boundary fix; implementation and targeted tests are complete.
    • Why parked: GitHub reports the commit status as pending with no test checks yet; CodeRabbit is neutral/skipped.
    • Resume when: Recheck PR fix(aggregator): validate snapshot rollup boundaries #4440 CI fresh; merge only once checks are green and the diff remains in scope.
  10. dezren39 commented on Nov 2, 2026

    @dezren39
    dezren39
    on Nov 2, 2026
    MemberAuthor
    More actions

    🤖 Agent note · picked up

    • Agent: queue worker (repo-worker-code), lane I (code-i)
    • Session / ID: task 6064
    • Found via: queue claim
    • Task: Resuming task 6064 for issue aggregator(snapshots): isSnapshotRollup re-admits the shapes isSnapshotRecord was hardened to refuse — impossible dates, negative/string limit, unparseable resetsAt, inverted pairs expand into the reading path unchecked #3365 from its park: PR fix(aggregator): validate snapshot rollup boundaries #4440 (branch queue/6064-3365-rollup-boundaries, head 711806b) already carries the isSnapshotRollup boundary fix; verifying fresh (diff, Codex findings, targeted tests) and closing it out.
    • Expectation: effort s; done = PR fix(aggregator): validate snapshot rollup boundaries #4440 merged if verified, task 6064 completed; otherwise a park with the exact blocker.
    • Links: issue aggregator(snapshots): isSnapshotRollup re-admits the shapes isSnapshotRecord was hardened to refuse — impossible dates, negative/string limit, unparseable resetsAt, inverted pairs expand into the reading path unchecked #3365; PR fix(aggregator): validate snapshot rollup boundaries #4440; task 6064
  11. dezren39
    added
    queue/claimedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    and removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Nov 2, 2026
  12. dezren39
    closed this as completedin #4440on Nov 2, 2026
  13. dezren39 commented on Nov 2, 2026

    @dezren39
    dezren39
    on Nov 2, 2026
    MemberAuthor
    More actions

    🤖 Agent note · done

    • Agent: queue worker (repo-worker-code), lane I (code-i)
    • Session / ID: task 6064
    • Found via: queue claim
    • Task: Issue aggregator(snapshots): isSnapshotRollup re-admits the shapes isSnapshotRecord was hardened to refuse — impossible dates, negative/string limit, unparseable resetsAt, inverted pairs expand into the reading path unchecked #3365 isSnapshotRollup boundary fix completed: PR fix(aggregator): validate snapshot rollup boundaries #4440 merged (merge commit 883980a); issue aggregator(snapshots): isSnapshotRollup re-admits the shapes isSnapshotRecord was hardened to refuse — impossible dates, negative/string limit, unparseable resetsAt, inverted pairs expand into the reading path unchecked #3365 closed at merge. Lane I resumed the parked PR, resolved its merge conflict against current main (adopted main's stricter integer count check in isSnapshotRollup; kept the branch's test import), re-ran the snapshot tests on the merged tree (20/20 pass), and obtained a fresh Codex review on the new head 24c6f99 — completed with zero findings — before merging.
    • Expectation: done = task 6064 complete, outcome fixed_merged.
    • Links: issue aggregator(snapshots): isSnapshotRollup re-admits the shapes isSnapshotRecord was hardened to refuse — impossible dates, negative/string limit, unparseable resetsAt, inverted pairs expand into the reading path unchecked #3365; PR fix(aggregator): validate snapshot rollup boundaries #4440; task 6064
  14. dezren39
    removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @dezren39
    dezren39

Labels

app/aggregatorPackage/app: aggregator (pm-stack in this repo)app/pm-stackpm-stack (Pad/Grist) in developing-today/codeeffort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/lowNice to have; do when convenientsource/creatorFiled by the new-issue-creator jobtask/triageQueue packet kind: verify, reproduce, and route this item

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.