Repository navigation
fix(platform): preserve usage totals across chart granularities - #4411
Conversation
|
TALE-195 / TALE-359 (3729d02a-eb44-42b2-a68e-1bec2cebbcd6) report fallback: the workspace connector refused workspace_status as not_granted, so task_get/task_comment argument shapes and task posting are unavailable. Implemented the daily-ledger reporting-window fix. Chart granularity now only groups current-window days; summary totals, prior equal-length comparison and detail tables are invariant. Regression-before-fix: two new tests fail on main. After fix: 29 metrics/helper tests and 128 governance route tests pass with /opt/node/bin/node and one worker. Scoped type-aware oxlint, TypeScript and oxfmt pass; manual lint passes. Register anchor: usage-reporting-windows-tale-195; merge-tree evidence compares 83 open PR heads and distinguishes pre-existing main conflicts. TALE-357 named heavy permit request: authorize the real PostgreSQL usage-ledger reader proof for TALE-195 in a separately allocated heavy phase. It is UNRUN here; no database was started, no new dependencies installed and no provider requests made. The fake SQL boundary regression is not a real PostgreSQL tenant-isolation proof. CI is pending and is being watched; no jobs rerun. Independent nonauthor review requested through the normal PR process; this change is not merged. |
|
Final LIGHT-phase report: final head 292c565 is pushed. Metrics/helper tests: 29 passed; governance route tests: 128 passed; scoped lint/types/format/manual gates passed. Register merge-tree checks against 83 open heads introduce no new conflicts (remaining register conflicts already exist against main). CI remains pending: all seven final-head workflows have no jobs yet; gh pr checks --watch reports no checks. No CI reruns. PostgreSQL proof remains UNRUN pending the TALE-357 named heavy permit requested above. Independent nonauthor review remains open. Delivery contains the patch, regression evidence and report. This is the TALE-195/TALE-359 report fallback; workspace_status was refused as not_granted. |
|
ACCEPT — independent source review of exact head No blocking defect found in the four-file change or inspected writer, route and Usage consumers. The reader always selects daily ledger rows. Current UTC dates are Regression review (read, not executed): the September fixture expects current cost 10 and prior cost 20 for all granularities, excludes older and future days, checks detail totals and daily SQL selection, and checks a foreign org. With the old monthly reader/fold, the monthly bucket includes older/prior/future bookings and the overlapping prior bucket is consumed as current: these assertions fail. The second fixture checks both inclusive window ends, excludes the adjacent outside/future dates, and splits December/January and ISO weeks into current costs 4+8, prior 1+2. The old coarse-key fold cannot classify these daily rows correctly.
Exact-head CI receipt: 82 check runs all bind to this SHA: 57 SUCCESS, 24 SKIPPED, 1 NEUTRAL, none pending/failing. All seven CI-ready checks succeeded; Backend integration succeeded. Four platform Playwright jobs succeeded, diagnostics steps succeeded and diagnostic-report uploads were skipped; this is not a manual/browser proof of this particular fix. Checks workflow attempt 1 reports this head. Mergeability was re-read immediately before posting: MERGEABLE / CLEAN, PR open; base tip No installs, checks, builds, stack, commits, pushes, branch updates, merges or CI reruns. No Ops credential used. Remaining execution cells need their own admitted phase; ACCEPT does not admit execution or authorize merge. Organization workspace_status was refused as not_granted, so no additional organization coverage-matrix document could be retrieved; the matrix above covers every topic named in the brief and applicable manual surfaces inspected. |
|
Merge-lane coverage dispositions at
|
Changing Usage chart granularity from Daily to Monthly previously selected whole monthly ledger buckets, inflating reporting totals and merging the prior window into the current one. Read daily ledger rows for all chart granularities, classify days into disjoint reporting windows, and aggregate only current-window days into display buckets. Summary cards, comparisons and detail tables now keep the selected period.
Verification: two new reader/fold regressions fail on the original implementation and pass with the fix. One-worker focused metrics/helper tests: 29 passed. Governance route suites passed. Scoped type-aware oxlint, TypeScript, oxfmt, manual-register lint and diff checks passed. The automation register records the coverage; open-PR merge-tree checks are recorded in delivery evidence.
No database was started. The real PostgreSQL proof remains unrun in LIGHT phase and needs a named heavy permit on TALE-357. Independent nonauthor review remains required.
Closes #3654