Skip to content

test(infra): move duration cases to the formatter owner - #134280

Merged
steipete merged 1 commit into
mainfrom
codex/test-maintenance-duration-owner
Aug 31, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/test-maintenance-duration-owner

Conversation

@steipete

Copy link
Copy Markdown
Contributor

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 formatSingleUnitDuration with 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 second integration 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.ts passed all 81 tests before and after.
  • Warning cases move from 16 to 7; formatter cases move from 65 to 74. No case or historical rounding input is discarded.
  • Full changed-file checks, formatting, diff checks, and structured Codex autoreview passed.
  • Source/history inspection confirmed the extracted owner and its actual warning caller. Tests use the installed pretty-ms implementation with its existing verbose/unit-count options.
  • Production +0/-0; tests +22/-36. The deterministic improvement is nine fewer integration setup paths; no CI-wide timing claim is made.

@clawsweeper

clawsweeper Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Aug 31, 2026
@steipete
steipete marked this pull request as ready for review August 31, 2026 16:42
@clawsweeper

clawsweeper Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 31, 2026, 12:50 PM ET / 16:50 UTC.

ClawSweeper review

What this changes

This PR moves nine verbose duration rounding and unit-boundary cases from session-warning integration tests to the shared duration formatter test suite.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

No 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
Reviewed head: 06b919f0b4636cfba77d667154aeba807d451e91

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, behavior-neutral test refactor with preserved coverage and no actionable correctness finding.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored, test-only refactor changes no production behavior; source inspection confirms the moved rows directly exercise the existing formatter owner and retain warning-path wiring coverage.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored, test-only refactor changes no production behavior; source inspection confirms the moved rows directly exercise the existing formatter owner and retain warning-path wiring coverage.
Evidence reviewed 5 items Exact introduced change: The sole-parent PR delta relocates the same three rollover and six unit cases without changing inputs or expected output strings.
Owner and caller boundary: The formatter owns single-unit rounding; the warning caller only embeds its verbose result in warning text.
Integration coverage retained: The warning suite still forces fallback delivery and asserts the complete warning contains the verbose formatted age.
Findings None None.
Security None None.

How this fits together

Session 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
Loading

Before merge

  • Resolve merge risk (P1) - Exact-head checks are still in progress; this is a normal merge gate rather than a defect in the introduced test move.
  • Complete next step (P2) - No repair work is needed; retain this focused maintainer-owned PR for normal exact-head CI and merge handling.
Agent review details

Security

None.

PR surface

Tests -14. Total -14 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 22 36 -14
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 22 36 -14

Review metrics

Metric Value Why it matters
Production versus test delta production +0/-0; tests +22/-36 (net -14) The change removes nine delivery-heavy test rows and adds equivalent direct owner-boundary coverage without changing runtime code.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    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.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best 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.

Labels

Label changes:

  • add P3: This is a low-risk test-maintenance refactor with no production behavior change.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored, test-only refactor changes no production behavior; source inspection confirms the moved rows directly exercise the existing formatter owner and retain warning-path wiring coverage.

Label justifications:

  • P3: This is a low-risk test-maintenance refactor with no production behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored, test-only refactor changes no production behavior; source inspection confirms the moved rows directly exercise the existing formatter owner and retain warning-path wiring coverage.

Evidence

What I checked:

Likely related people:

  • unknown: The blamed commit carries this line unchanged from a recorded parent; no introducing author is attributed. (role: carried-forward source line; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-08-31T16:42:30.644Z sha 06b919f :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 31, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

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.

@steipete
steipete merged commit 43686bc into main Aug 31, 2026
182 checks passed
@steipete
steipete deleted the codex/test-maintenance-duration-owner branch August 31, 2026 16:57
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant