Batch page retention in staging workspaces - #100
Conversation
|
Warning Review limit reached
Next review available in: 51 minutes 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: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds ChangesBatched page retention
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Client
participant StagingWorkspace
participant PageService
participant WorkspaceRef
Client->>StagingWorkspace: pages.putBatch(options)
StagingWorkspace->>PageService: stage bounded page batch
PageService-->>StagingWorkspace: ordered pages with handles
StagingWorkspace->>PageService: resolve page handles
StagingWorkspace->>WorkspaceRef: install targets in one generation
WorkspaceRef-->>StagingWorkspace: generation witnesses
StagingWorkspace-->>Client: retained pages
Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@test/unit/domain/services/StagingWorkspace.test.js`:
- Around line 89-93: The staging order assertion must validate results against
independently derived input handles rather than values from the returned staged
array. Update the test around the staged batch assertion to compare each
returned page with the corresponding source page’s handle, ensuring reordered
results such as second-first-second cannot pass.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: ed7959af-093b-4809-8aec-44751e96fe36
📒 Files selected for processing (11)
CHANGELOG.mdREADME.mddocs/API.mddocs/design/0054-batched-page-retention/batched-page-retention.mddocs/design/0054-batched-page-retention/witness/verification.mddocs/design/README.mdindex.d.tssrc/domain/services/StagingWorkspace.jssrc/domain/services/StagingWorkspaceRegistry.jstest/integration/staging-workspace.test.jstest/unit/domain/services/StagingWorkspace.test.js
📜 Review details
🧰 Additional context used
📓 Path-based instructions (3)
docs/design/**
📄 CodeRabbit inference engine (AGENTS.md)
Use
docs/design/directory for durable design contracts and proof plans
Files:
docs/design/README.mddocs/design/0054-batched-page-retention/witness/verification.mddocs/design/0054-batched-page-retention/batched-page-retention.md
CHANGELOG.md
📄 CodeRabbit inference engine (AGENTS.md)
Use
CHANGELOG.mdto record the historical truth of merged behavior
Files:
CHANGELOG.md
README.md
📄 CodeRabbit inference engine (AGENTS.md)
Use
README.mdas the public front door, core value prop, and quick start documentation
Files:
README.md
🧠 Learnings (3)
📚 Learning: 2026-03-30T19:53:48.000Z
Learnt from: flyingrobots
Repo: git-stunts/git-cas PR: 29
File: docs/design/TR-010-planning-index-consistency-review.md:121-131
Timestamp: 2026-03-30T19:53:48.000Z
Learning: In this repo, CHANGELOG.md entries should be user-facing and descriptive (bullet points) rather than cycle-ID headings (e.g., use a phrase like “Planning-index consistency review” instead of a “TR-010 — …” heading). When searching the changelog, don’t rely on grepping for cycle IDs (e.g., “TR-010”) because it may cause false negatives; search for the descriptive keywords/phrases from the bullet entries instead.
Applied to files:
CHANGELOG.md
📚 Learning: 2026-07-13T17:00:46.222Z
Learnt from: flyingrobots
Repo: git-stunts/git-cas PR: 65
File: src/domain/helpers/isCanonicalCollectionKey.js:21-35
Timestamp: 2026-07-13T17:00:46.222Z
Learning: In git-stunts/git-cas, the codebase is intended to run on multiple JavaScript runtimes (Node, Bun, and Deno), not just Node. During code review, don’t suggest replacing existing portable helper logic with newer Node-only built-ins (e.g., Node 20+ APIs like `String.prototype.isWellFormed()`) unless the change preserves Bun/Deno compatibility (via portable/polyfill implementations or safe runtime gating). If a file includes manual implementations (such as `src/domain/helpers/isCanonicalCollectionKey.js`), treat them as intentional to avoid requiring a higher host built-in baseline.
Applied to files:
src/domain/services/StagingWorkspaceRegistry.jssrc/domain/services/StagingWorkspace.js
📚 Learning: 2026-02-28T19:21:13.982Z
Learnt from: flyingrobots
Repo: git-stunts/git-cas PR: 15
File: test/unit/domain/services/CasService.envelope.test.js:326-330
Timestamp: 2026-02-28T19:21:13.982Z
Learning: In fuzz tests for cryptographic operations, use a seeded PRNG (e.g., xorshift32) for control-flow variables such as plaintext size selection and recipient index selection to ensure reproducibility. Continue to use randomBytes() for cryptographic keys and nonces to preserve realistic randomness and avoid security anti-patterns. This guideline applies to test files that perform fuzz testing of crypto logic; implement a consistent seed setup (e.g., fixed seed in test initialization) and document the rationale to enable deterministic replays across runs.
Applied to files:
test/integration/staging-workspace.test.jstest/unit/domain/services/StagingWorkspace.test.js
🔇 Additional comments (11)
docs/design/0054-batched-page-retention/batched-page-retention.md (1)
1-300: LGTM!docs/design/0054-batched-page-retention/witness/verification.md (1)
1-62: LGTM!docs/design/README.md (1)
14-14: LGTM!docs/API.md (1)
1345-1350: LGTM!Also applies to: 1381-1381, 1391-1395
index.d.ts (1)
1640-1642: LGTM!CHANGELOG.md (1)
10-16: LGTM!README.md (1)
151-155: LGTM!src/domain/services/StagingWorkspace.js (1)
64-64: LGTM!Also applies to: 209-269, 575-575
src/domain/services/StagingWorkspaceRegistry.js (1)
27-33: LGTM!Also applies to: 375-378
test/unit/domain/services/StagingWorkspace.test.js (1)
158-196: LGTM!test/integration/staging-workspace.test.js (1)
70-75: LGTM!Also applies to: 117-155, 227-229
Adds
workspace.pages.putBatch()so bounded page groups receive ordered, exact retention witnesses from one workspace generation instead of one growing root-set rewrite per page.The 8,188-page synthetic witness completes in 15.546 seconds with 8.27 MiB of loose scratch objects; the prior per-page path reached only 5,213 pages in 75 minutes and produced about 1.16 GiB.
Validated by all 13 release gates: 6,841 Node/Bun/Deno tests, public type compatibility, examples, lint, build stamp, and npm pack dry-run.
Closes #99.