GeezerVison is showing github.com — aggregator(snapshot-records): skip Codex used_percent outside finite [0,100] · Issue #3460 · developing-today/code
aggregator(snapshot-records): skip Codex used_percent outside finite [0,100] #3460Labels app/aggregatorPackage/app: aggregator (pm-stack in this repo)app/pm-stackpm-stack (Pad/Grist) in developing-today/codeeffort/xsTrivial: expected under 30 minutes of workkind/bugSomething isn't working (prefixed form of the classic bug label)meta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedpriority/lowNice to have; do when convenientsource/queue-workerFiled or worked by the queue/worker pilottask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests DescriptionFollow-up to #2568.
recordsFromProviderUsage in pm-stack/aggregator/src/snapshot-records.ts:296-313 checks only typeof used_percent === "number" before emitting a pct record. The append CLI filters records through isSnapshotRecord (append-usage-snapshots.ts:71), whose current guard rejects negative pct values (snapshots.ts:317-323) but accepts finite values above 100. A real-module probe on main 199d9f2e222c17826533dc3d9320aebd88aab533 confirmed: -20 is emitted but rejected by the store; 150 and 1e9 are emitted and accepted; 42 is emitted and accepted. The original #2568 report that negative values pass the current store gate is stale, but the upper-bound defect remains.
Goal
Skip an invalid Codex window rather than clamp or invent a value, while continuing to derive the session record and any other valid window.
Acceptance
recordsFromProviderUsage emits a Codex window only when used_percent is finite and in the inclusive range [0,100].
snapshot-writers.test.ts covers negative and >100 values, plus valid boundary/control values; an invalid window does not suppress the other valid window or the sessions record.
- Existing
bun test test/snapshot-writers.test.ts passes.
Scope
Writer-side recordsFromProviderUsage and its focused tests only. Do not change the general store gate, other snapshot writers, or rollup validation (#3365). No clamping.
Acceptance criteria
- Snapshot records whose Codex
used_percent is NaN, infinite, or outside [0,100] are skipped (with the existing drop accounting, if any) instead of being recorded.
- In-range values, including exactly 0 and exactly 100, are recorded unchanged.
- Tests cover below-range, above-range, and non-finite inputs alongside an in-range control.
Activitydeveloping-today commented on Nov 1, 2026 dezren39 commented on Nov 1, 2026 dezren39 commented on Nov 1, 2026 Intake review
Related: same drop-gate family as #2582 (shared [0,100] drop-gate pin, triage task 3837) and the charge-row gates in #3458 — worth the worker checking whether one shared guard now covers all three. No merged PR references this issue as of this run.
Notes: the sibling triages pinned that out-of-shape rows must fail closed at the boundary rather than clamp — clamping a >100 reading to 100 would silently fabricate a full-quota signal. Risk: low.
Suggested approach: apply the established finite-range guard at the snapshot-record boundary and mirror the sibling fix's test shape.
🤖 Agent note · done
- Agent: fleet monitor
- Session / ID: repo-fleet-monitor run 2026-11-01T10:12Z
- Found via: monitor reconciliation
- Task: intake enrichment (protocol §5) — acceptance criteria appended, labels normalized, this review posted
- Expectation: effort as labelled; done = acceptance criteria on the issue met by a fix PR
dezren39 commented on Nov 2, 2026
Picked up: OpenChamber scheduled lane claimed queue task 5391 via atomic claim.
- Agent: repo-worker-code
- Session / ID: ses_e5e652821cfffeHDR1E7h0X4dt
- Task: Validate Codex
used_percent bounds in recordsFromProviderUsage and focused snapshot-writer tests.
- Next: Revalidate issue and PR ownership before creating a worktree or editing.
dezren39 commented on Nov 2, 2026
Parked: Queue task 5391 is parked for 20 minutes while PR checks run.
MetadataMetadataapp/aggregatorPackage/app: aggregator (pm-stack in this repo)app/pm-stackpm-stack (Pad/Grist) in developing-today/codeeffort/xsTrivial: expected under 30 minutes of workkind/bugSomething isn't working (prefixed form of the classic bug label)meta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedpriority/lowNice to have; do when convenientsource/queue-workerFiled or worked by the queue/worker pilottask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests DevelopmentNo branches or pull requestsIssue actions
|