Repository navigation
Conversation
…e folder The six primitives that exist to stop unbounded memory growth were scattered through `src/shared/` next to unrelated modules, so there was nowhere to state when a new ceiling is warranted — and the last attempt at this work added many that were not. Moves them under `src/shared/memory-safety/` and adds a README carrying the doctrine: bound at ingress, not in the interior; set limits far above real use; decide overload behavior explicitly; and prefer fixing measured growth over adding a speculative ceiling. No behavior change. Pure move plus import-path updates across 48 files, with `git mv` preserving history. Includes two `vi.mock` paths that had to move with their modules — a mock left on the old path silently stops applying, which the suite caught. Verified: typecheck clean, oxlint 0 errors, 18,668 tests passing across src/shared and src/main.
|
Warning Review limit reached
Next review available in: 51 seconds Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (54)
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. Comment |
|
Moving this PR to draft because it has been untouched for more than 80 days (latest recorded PR activity or commit timestamp: 2026-07-28T03:18:06Z; checked on 2026-10-27). This keeps the review queue focused on active work while preserving the proposal. Please mark it ready for review when work resumes. |
First slice of the re-landed memory-safety work (replaces the oversized #10548). No behavior change — this is a pure move plus import updates, so it can be reviewed by reading the README and skimming the path rewrites.
Why
Six primitives whose entire purpose is bounding memory growth were scattered through
src/shared/next to unrelated modules. There was nowhere to write down when a new ceiling is warranted — and the previous attempt at this work (#10179, reverted in #10255) added a great many that were not.Grouping them gives that doctrine a home, and gives the follow-up slices a stable place to import from.
What moves
bounded-map.tsnode-bounded-file-reader.tsnode-bounded-json-stringify.tsbounded-secure-json-file.tsjson-text-structure-limit.tsJSON.parseagainst depth/token amplificationutf8-byte-limits.tsgit mvthroughout, so history and blame follow the files.The README
Carries the rules the next slices are held to:
Map; it rebuilt itself on every status ping.It states plainly that none of this is lint-enforced today — it's a review standard, not tooling.
Risk
Low, but the failure mode here is real and worth calling out: a
vi.mock()left pointing at an old path silently stops applying — the test keeps running against the real module and quietly asserts nothing. Two such mocks needed moving with their modules (git-uncommitted-line-stats.test.ts,git/status.test.ts); the suite caught both. I then swept for every remaining string-literal reference to the six module names in any syntactic form (import,vi.mock,require, dynamic import, JSON/config) and confirmed zero stale paths outside the new folder.Verification
pnpm run typecheck— cleanoxlint src/ mobile/src/— 0 errors (27 warnings, all pre-existing onmain)src/sharedandsrc/mainTwo unrelated failures seen during the run, both confirmed against clean
main:managed-hook-local-filesystem.test.tsfails identically onmain, andpersistence.test.tspasses in isolation (417 tests) under load flake. Neither references any moved module.Made with Orca 🐋