Stabilize dashboard fixture clock - #2390
Conversation
46fd90c to
4576313
Compare
# Conflicts: # Tests/CodexBarTests/SpendDashboardControllerTests.swift
|
Codex review: needs real behavior proof before merge. Reviewed July 27, 2026, 11:34 PM ET / July 28, 2026, 03:34 UTC. ClawSweeper reviewWhat this changesThis PR routes Spend Dashboard controller test setup through a helper that builds requests with the same fixed clock used by the test fixtures. Merge readiness⛔ Blocked until real behavior proof is added - 4 items remain Keep this PR open for normal review. The proposed change is a focused test-only stabilization with no evident production or security impact, but the PR body only reports validation results rather than including after-fix terminal output or an artifact from the current head. Priority: P3 Review scores
Verification
How this fits togetherSpend Dashboard controller tests load dated usage fixtures and build dashboard requests that filter spend by time window. The request builder feeds the controller state and assertions, so a fixture-aligned clock keeps those tests deterministic without changing production request timing. flowchart LR
A[Dated dashboard fixtures] --> B[Test setup]
B --> C[Fixture-aligned clock]
C --> D[Dashboard request builder]
D --> E[Controller state]
E --> F[Test assertions]
Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep production clocks unchanged and land a narrowly scoped fixture-clock helper only after the contributor adds redacted current-head test output showing the affected controller tests pass and the normal validation status is clear. Do we have a high-confidence way to reproduce the issue? No. The PR describes a clear calendar-dependent fixture failure, but the supplied review evidence does not include a failing or passing terminal transcript that can independently establish the behavior on the current head. Is this the best way to solve the issue? Unclear. A fixture-clock helper is a narrow, maintainable approach if it is confined to fixture-backed tests, but the available evidence is insufficient to independently confirm the final helper implementation and its exact test coverage. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against de3389771177. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Final maintainer verification completed on head
Merged as |
Summary
Stabilize Spend Dashboard controller tests by injecting the same fixed clock used by their fixture snapshots.
Root cause
Several tests used a July 15 fixture while
SpendDashboardSource.makeRequestused the real current date. Once the calendar moved beyond the fixture window, valid fixture spend was filtered out and the assertions saw$0.Change
Verification
xcodebuildmcp swift-package test --package-path /Users/alec/Dev/codexbar-dashboard-ci --filter SpendDashboardControllerTests --parallel false --output text— 24 tests across 3 suites passedswiftformat --lint Tests/CodexBarTests/SpendDashboardControllerTests.swift— cleanswiftlint --strict— 0 violationsmake checkcompletes relevant validation and stops only at the repository's pre-existing Node 25 CommonJS/ESM mismatch indocs/site.js