Skip to content

test(usage): keep saved-history fixtures independent of wall time - #9

Merged
Microck merged 1 commit into
personal-updatesfrom
fix/usage-retention-test-clock
Nov 2, 2026
Merged

Microck merged 1 commit into
personal-updatesfrom
fix/usage-retention-test-clock

Conversation

@Microck

@Microck Microck commented Nov 2, 2026

Copy link
Copy Markdown
Owner

The existing saved-history test started failing on November 2: its transcript mtime is fixed at August 1, now more than 92 days old, while UsageService correctly expires cached entries after 92 days. This is independent of the cleanup repair in #8 and blocks its server test shard.

Use the suite's existing TestClock layer pattern to pin this test to August 2. Keep the original assertions, assert the initial fixture actually yields a bucket, and explicitly advance 93 days to verify expiration still removes saved history. Production retention behavior is unchanged; no timeout, retry, skip or weakened assertion is added.

Evidence: https://github.com/Microck/t3code/actions/runs/41497110733/job/125455766898

Local dependency installation is blocked by pnpm's store-operation lock attempting a read-only path, even with explicit writable store/state/cache directories. Hosted server tests must pass before merge. The change uses TestClock.layer/setTime/adjust already used in the same suite.

Implemented by Verity using OpenAI's coding harness.

@Microck
Microck marked this pull request as ready for review November 2, 2026 18:17
@github-actions github-actions Bot added the vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. label Nov 2, 2026
@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between a1d1875 and 94d8fe1.

Files selected for processing: 1
  • apps/server/src/usage/UsageService.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Walkthrough

The saved-usage test fixes the clock to August 2, 2026, checks that the initial summary has one bucket, and verifies that the bucket and source are missing after 93 days.

Changes: Saved usage retention

Layer / File(s) Summary
Saved usage expiration assertions
apps/server/src/usage/UsageService.test.ts
The test fixes the date, asserts that the initial summary contains one bucket, and checks that the bucket and source are missing after 93 days. It now provides TestClock.layer().

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Other

Suggested reviewers: juliusmarminge

Merge Risk: Minimal · up to 94d8f

This test-only change stabilizes saved-usage retention coverage without altering production behavior or weakening assertions.

Pre-merge checks: Passed 4
Check name Status Explanation
Title check Passed The title clearly identifies the main change: making saved-history test fixtures independent of wall-clock time. It is concise and uses a conventional commit format.
Description check Passed The description clearly explains the failure, the TestClock-based fix, preserved production behavior, added expiration verification, and test limitations. It does not use the template headings or prov…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description clearly explains the failure, the TestClock-based fix, preserved production behavior, added expiration verification, and test limitations. It does not use the template headings or provide an explicit approval link, but the required information is mostly present and the change is focused.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-actions github-actions Bot added the size:S label Nov 2, 2026

Microck commented Nov 2, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

Please verify the fixed-clock retention regression and that production behavior/assertions are preserved.

Microck commented Nov 2, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Action not completed

Review rate limited.


Your included review limit is currently reached under our Fair Usage Limits Policy. This review may still proceed through usage-based billing if eligible. Your next included review will be available in 47 minutes.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-02T18:19:29.887539Z 94d8fe1 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: 94d8fe1926

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

ℹ️ No successful main baseline artifact is available yet. This run establishes the initial measurement.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire — 5.0 KiB — 6.8 KiB ✅
Codex Thread snapshot wire — 3.8 KiB — 4.9 KiB ✅
Codex Live turn WebSocket wire — 1.2 KiB — 2.0 KiB ✅
Codex Live turn WebSocket decoded — 20.9 KiB — 29.3 KiB ✅
Codex Live turn messages — 2 — 8 ✅
Claude Total thread wire — 5.0 KiB — 6.8 KiB ✅
Claude Thread snapshot wire — 3.8 KiB — 4.9 KiB ✅
Claude Live turn WebSocket wire — 1.2 KiB — 2.0 KiB ✅
Claude Live turn WebSocket decoded — 21.2 KiB — 29.3 KiB ✅
Claude Live turn messages — 2 — 8 ✅

Baseline: unavailable · PR result: 94d8fe1 · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 108.5 KiB
  • Claude decoded thread snapshot: 108.8 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

Microck commented Nov 2, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

Retrying after the stated included-review reset. Please review the current unchanged head; hosted CI and Codex review are clean. Do not enable paid usage or alter any review policy.

@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Action performed

Full review finished.

@Microck
Microck merged commit 4dfdc97 into personal-updates Nov 2, 2026
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant