Repository navigation
test(infra): move duration cases to the formatter owner - #134280
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 31, 2026, 12:50 PM ET / 16:50 UTC. ClawSweeper reviewWhat this changesThis PR moves nine verbose duration rounding and unit-boundary cases from session-warning integration tests to the shared duration formatter test suite. Merge readinessNo blocking findings. This is a correct test-owner cleanup that is not yet on current main; its maintainer label keeps it in normal maintainer review rather than an automated close path. Priority: P3 Review scores
Verification
How this fits togetherSession maintenance composes a warning using a shared duration formatter, then delivers or records the warning. The change moves formatter-specific regression coverage to that shared owner while retaining a warning-path wiring assertion. flowchart LR
A[Maintenance policy] --> B[Session warning]
B --> C[Shared duration formatter]
C --> D[Warning text]
E[Formatter regression tests] --> C
F[Warning integration test] --> B
Before merge
Agent review detailsSecurityNone. PR surfaceTests -14. Total -14 across 2 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the nine boundary cases at the formatter owner and retain the focused session-warning assertion that verifies verbose formatting is wired into emitted warning text. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR relocates existing regression coverage and does not report a new user-facing failure. Is this the best way to solve the issue? Yes. The shared formatter owns rounding behavior, while the retained warning test continues to cover its verbose-formatting integration point. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against d01486f283cc. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Maintainer review is complete under the standing instruction to land this test-cleanup batch. The latest ClawSweeper review has no correctness findings or rank-up moves. Its remaining CI condition is resolved: exact-head run 33415600347 passed. This PR is ready for ordinary maintainer landing. All nine duration examples remain at the shared formatter owner, and all seven warning behavior cases retain delivery/config coverage and the complete verbose warning assertion. All 81 tests passed before and after; full changed-file checks and structured Codex autoreview passed. Production +0/-0; tests +22/-36. Proceeding through the native merge workflow. |
|
Merged via squash.
|
What Problem This Solves
Nine duration-formatting regressions still run through session warning delivery, including module resets, environment setup, session fixture generation, and a forced delivery failure for each row. The formatter was extracted into a shared owner, but these tests stayed behind.
Why This Change Was Made
Move all nine rounding and unit-boundary rows to the existing formatter suite and call the real
formatSingleUnitDurationwith verbose output. Keep every historical input and exact expected string.The warning suite retains its seven behavioral cases, including delivery context, duplicate suppression, test-mode suppression, fallback wording, LRU eviction, and changed-context delivery. Its necessary module resets remain. The exact
older than 1 secondintegration assertion still proves the warning uses verbose formatting.User Impact
Avoid nine warning setup/import/delivery paths while keeping the same aggregate regression coverage. Production behavior, formatting, and persistence are unchanged.
Evidence
node scripts/run-vitest.mjs src/infra/session-maintenance-warning.test.ts src/infra/format-time/format-time.test.tspassed all 81 tests before and after.