Skip to content

refactor: add shared TTL memo reset registry#1060

Merged
thymikee merged 1 commit into
mainfrom
codex/ttl-memo-reset-registry
Jul 3, 2026
Merged

refactor: add shared TTL memo reset registry#1060
thymikee merged 1 commit into
mainfrom
codex/ttl-memo-reset-registry

Conversation

@thymikee

@thymikee thymikee commented Jul 3, 2026

Copy link
Copy Markdown
Member

Summary

Add a shared TTL memo helper with a process-memo reset registry wired into Vitest setup, so registered process-global memos clear after each unit/provider test by construction.

Migrate the simulator booted memo, daemon device-ready cache, and Apple tool fingerprint cache off ad hoc test reset exports while preserving their cache keys and TTL/process-lifetime behavior.

Add focused coverage for TTL expiry, scheduled expiry, registry-backed cross-test cleanup, and a migrated simulator boot memo leak scenario. Closes #1042.

Touched files: 11.

Validation

Passed: pnpm exec vitest run src/utils/__tests__/ttl-memo.test.ts src/platforms/apple/core/__tests__/simulator-booted-memo.test.ts src/daemon/__tests__/device-ready.test.ts src/platforms/apple/core/__tests__/runner-xctestrun.test.ts --project unit.

Passed: pnpm check:quick.

Passed after building dist: pnpm build, then pnpm test:smoke.

Residual risk: exact pnpm check:unit was run twice but did not pass in this local environment. The failures were nondeterministic across runs, mostly full-suite timeouts or mocked adb/xcrun helper misses in unrelated files; the failed files I reran in isolation passed.

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

Size Report

Metric Base Current Diff
JS raw 1.5 MB 1.5 MB +567 B
JS gzip 483.4 kB 483.6 kB +207 B
npm tarball 585.2 kB 585.4 kB +203 B
npm unpacked 2.1 MB 2.1 MB +567 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 26.2 ms 28.2 ms +2.0 ms
CLI --help 46.7 ms 48.8 ms +2.2 ms

Top changed chunks:

Chunk Raw diff Gzip diff
dist/src/9722.js +615 B +234 B

@thymikee thymikee left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: LGTM. The API is right-sized (lazy expiry on get, opt-in scheduled expiry with unref'd timers — checked, line 55), the vitest global afterEach reset via setupFiles kills the leak class by construction, and the acceptance bar from #1042 is met: zero __reset*ForTests exports remain outside the registry (grepped), and the three named memos migrated. 422 tests across the touched suites + typecheck green locally. This retires the bug class that fired three times last week.

@thymikee

thymikee commented Jul 3, 2026

Copy link
Copy Markdown
Member Author

Review pass: no actionable blockers found. This satisfies #1042 by introducing a shared TTL memo plus a process-level reset registry wired into unit/provider setup, and it migrates the simulator boot memo, device-ready cache, and Apple tool fingerprint cache without changing their production cache keys/TTL behavior. The sequential leak tests cover registry cleanup, and CI is green. I marked this ready-for-human. Residual note: the worker reported local full-suite check:unit flake, but the PR head Unit Tests/Coverage/Integration and smoke jobs are passing in CI.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Jul 3, 2026
@thymikee thymikee merged commit 5e8a90a into main Jul 3, 2026
21 checks passed
@thymikee thymikee deleted the codex/ttl-memo-reset-registry branch July 3, 2026 10:02
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-07-03 10:02 UTC

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

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Shared TTL-memo utility with a test-reset registry for process-global caches

1 participant