Delegate materialization cache diagnostics to git-cas - #778
Conversation
|
Warning Review limit reached
Next review available in: 43 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 (2)
📝 WalkthroughWalkthroughThe PR replaces WARP-owned state-cache retention inspection and repair with git-cas materialization-cache diagnostics, updates ChangesMaterialization cache diagnostics
Estimated code review effort: 4 (Complex) | ~60 minutes Possibly related issues
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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 |
Release Preflight
If this PR is from a |
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 `@bin/cli/commands/doctor/checksMaterializationCache.ts`:
- Around line 110-124: Update invalidCacheFinding to return a failing
DoctorFinding whenever inspection.healthy is false, even when inspection.issues
is empty; retain the existing null result for healthy inspections and preserve
the current evidence and message behavior for reported issues. Ensure
materializationCacheFindings cannot fall through to healthyCacheFinding and
report status "ok" for any unhealthy inspection.
🪄 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: e164a5d0-bb2c-465b-a90a-4c3091f2947a
📒 Files selected for processing (42)
CHANGELOG.mdREADME.mdbin/cli/commands/doctor/checksMaterializationCache.tsbin/cli/commands/doctor/checksStateCache.tsbin/cli/commands/doctor/codes.tsbin/cli/commands/doctor/index.tsbin/cli/commands/doctor/stateCacheCapability.tsbin/cli/commands/doctor/storageCapabilities.tsbin/cli/commands/doctor/types.tsbin/cli/schemas.tsdocs/TECHNICAL_TEARDOWN.mddocs/topics/cas-first-memoized-materialization.mddocs/topics/cli.mddocs/topics/getting-started.mdsrc/domain/services/state/WarpStateCacheRepairResult.tssrc/domain/services/state/WarpStateCacheRetentionReport.tssrc/infrastructure/adapters/GitCasMaterializationCacheDiagnosticsAdapter.tssrc/infrastructure/adapters/GitCasRepositoryAdapter.tssrc/infrastructure/adapters/GitCasStateCacheIndex.tssrc/infrastructure/adapters/GitCasStateCacheIndexCodec.tssrc/infrastructure/adapters/GitCasStateCacheRootSetCoordinator.tssrc/infrastructure/adapters/GitCasWarpStateCacheAdapter.tssrc/ports/MaterializationCacheDiagnosticsPort.tssrc/ports/RuntimeStorageProviderPort.tssrc/ports/WarpStateCacheRetentionPort.tstest/bats/cli-doctor.batstest/helpers/InMemoryGitCasFacade.tstest/integration/infrastructure/adapters/GitCasWarpStateCacheAdapter.retention.integration.test.tstest/unit/cli/doctor-materialization-cache.test.tstest/unit/cli/doctor-state-cache-retention.test.tstest/unit/cli/doctor.test.tstest/unit/cli/schemas.test.tstest/unit/domain/services/state/WarpStateCacheRetentionResults.test.tstest/unit/infrastructure/adapters/GitCasMaterializationCacheDiagnosticsAdapter.test.tstest/unit/infrastructure/adapters/GitCasMaterializationReplayBasis.test.tstest/unit/infrastructure/adapters/GitCasRepositoryAdapter.test.tstest/unit/infrastructure/adapters/GitCasStateCacheIndexCodec.test.tstest/unit/infrastructure/adapters/GitCasStateCacheRootSetCoordinator.test.tstest/unit/infrastructure/adapters/GitCasWarpStateCacheAdapter.retention.test.tstest/unit/infrastructure/adapters/GitCasWarpStateCacheAdapter.test.tstest/unit/infrastructure/adapters/GitPlumbingRuntimeAdapter.test.tstest/unit/infrastructure/codecs/WarpStateCborCodec.test.ts
💤 Files with no reviewable changes (16)
- test/unit/infrastructure/adapters/GitCasStateCacheRootSetCoordinator.test.ts
- test/unit/infrastructure/adapters/GitCasWarpStateCacheAdapter.retention.test.ts
- test/unit/infrastructure/adapters/GitCasStateCacheIndexCodec.test.ts
- test/unit/domain/services/state/WarpStateCacheRetentionResults.test.ts
- test/integration/infrastructure/adapters/GitCasWarpStateCacheAdapter.retention.integration.test.ts
- src/infrastructure/adapters/GitCasStateCacheIndexCodec.ts
- bin/cli/commands/doctor/stateCacheCapability.ts
- test/unit/infrastructure/adapters/GitCasWarpStateCacheAdapter.test.ts
- test/unit/cli/doctor-state-cache-retention.test.ts
- src/infrastructure/adapters/GitCasWarpStateCacheAdapter.ts
- src/ports/WarpStateCacheRetentionPort.ts
- src/domain/services/state/WarpStateCacheRetentionReport.ts
- bin/cli/commands/doctor/checksStateCache.ts
- src/infrastructure/adapters/GitCasStateCacheRootSetCoordinator.ts
- src/infrastructure/adapters/GitCasStateCacheIndex.ts
- src/domain/services/state/WarpStateCacheRepairResult.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (2)
- GitHub Check: test-node (22)
- GitHub Check: preflight
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx,js,jsx}: Do not use direct imports fromsrc/infrastructure/**insrc/domain/**orsrc/ports/**; depend on a port instead.
Do not use direct Node built-ins insrc/domain/**orsrc/ports/**; use a port instead.
Files:
test/unit/infrastructure/adapters/GitPlumbingRuntimeAdapter.test.tssrc/ports/MaterializationCacheDiagnosticsPort.tstest/unit/cli/schemas.test.tsbin/cli/commands/doctor/codes.tstest/unit/infrastructure/adapters/GitCasMaterializationReplayBasis.test.tstest/unit/infrastructure/codecs/WarpStateCborCodec.test.tsbin/cli/commands/doctor/types.tsbin/cli/schemas.tstest/unit/cli/doctor-materialization-cache.test.tssrc/ports/RuntimeStorageProviderPort.tssrc/infrastructure/adapters/GitCasMaterializationCacheDiagnosticsAdapter.tsbin/cli/commands/doctor/checksMaterializationCache.tsbin/cli/commands/doctor/storageCapabilities.tstest/unit/infrastructure/adapters/GitCasRepositoryAdapter.test.tstest/helpers/InMemoryGitCasFacade.tsbin/cli/commands/doctor/index.tssrc/infrastructure/adapters/GitCasRepositoryAdapter.tstest/unit/infrastructure/adapters/GitCasMaterializationCacheDiagnosticsAdapter.test.tstest/unit/cli/doctor.test.ts
src/**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
src/**/*.{ts,tsx,js,jsx}: Do not introduceany,as any,as unknown as,unknown(outside adapters),Record<string, unknown>(outside adapters),*Likeplaceholder types,JSON.parse/JSON.stringify(outside adapters),fetch(outside adapters),process.env(outside adapters),@ts-ignore, orz.any()in core code; use validated boundary models and ports instead.
Use constructor-injected ports for external capabilities; do not rely on ambient dependencies for I/O, clocks, persistence, or entropy.
Do not createutils.ts,helpers.ts,misc.ts, orcommon.ts; name files after the actual concept they model.
Prefer one file per class, type, or object; if a file accumulates peer concepts, split it.
Keep helper corridors, fake shape trust, transitional duplication, and compile-time theater out of the codebase; runtime-honest TypeScript must reflect actual behavior.
No enum usage; prefer runtime-backed domain forms and unions.
Do not use boolean trap parameters; prefer named option objects or separate methods.
Avoid magic strings or numbers when a named constant should exist.
Keep domain bytes asUint8Array;Bufferbelongs in infrastructure adapters.
Files:
src/ports/MaterializationCacheDiagnosticsPort.tssrc/ports/RuntimeStorageProviderPort.tssrc/infrastructure/adapters/GitCasMaterializationCacheDiagnosticsAdapter.tssrc/infrastructure/adapters/GitCasRepositoryAdapter.ts
src/ports/**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
In
src/ports/**, do not import Node built-ins orsrc/infrastructure/**; ports must stay abstract and depend only on boundary-safe types.
Files:
src/ports/MaterializationCacheDiagnosticsPort.tssrc/ports/RuntimeStorageProviderPort.ts
🧠 Learnings (1)
📚 Learning: 2026-03-08T19:50:17.519Z
Learnt from: flyingrobots
Repo: git-stunts/git-warp PR: 65
File: CHANGELOG.md:88-88
Timestamp: 2026-03-08T19:50:17.519Z
Learning: Follow the Keep a Changelog convention for CHANGELOG.md. Allow duplicate subheadings across versions (e.g., '### Added', '### Fixed'). Configure markdownlint MD024 with {"siblings_only": true} to avoid cross-version false positives.
Applied to files:
CHANGELOG.md
🔇 Additional comments (28)
CHANGELOG.md (1)
93-96: LGTM!Also applies to: 107-110
README.md (1)
124-126: LGTM!docs/TECHNICAL_TEARDOWN.md (1)
246-247: LGTM!Also applies to: 1663-1664
docs/topics/cas-first-memoized-materialization.md (1)
177-188: LGTM!Also applies to: 192-215
docs/topics/cli.md (1)
42-47: LGTM!docs/topics/getting-started.md (1)
106-106: LGTM!src/ports/MaterializationCacheDiagnosticsPort.ts (1)
1-68: LGTM!src/ports/RuntimeStorageProviderPort.ts (1)
11-11: LGTM!Also applies to: 36-38
src/infrastructure/adapters/GitCasMaterializationCacheDiagnosticsAdapter.ts (2)
86-89: LGTM on the deliberate double-handling of the cache-open promise (silence unhandled-rejection while still awaiting the real promise later).
111-136: 🗄️ Data Integrity & IntegrationNo change needed.
@git-stunts/git-cas@6.5.3definesCacheInspection.stateandCacheInspection.policyseparately, andCacheSet.repair()only acceptsentries, soretained.state.policyis not a hiddenpolicy.limitspayload.> Likely an incorrect or invalid review comment.src/infrastructure/adapters/GitCasRepositoryAdapter.ts (1)
37-39: LGTM!Also applies to: 58-64, 111-139
test/helpers/InMemoryGitCasFacade.ts (1)
356-604: LGTM!test/unit/infrastructure/adapters/GitCasMaterializationCacheDiagnosticsAdapter.test.ts (1)
1-403: LGTM!test/unit/infrastructure/adapters/GitCasRepositoryAdapter.test.ts (1)
104-112: LGTM!Also applies to: 137-137
test/unit/infrastructure/adapters/GitCasMaterializationReplayBasis.test.ts (1)
1-99: LGTM!test/unit/infrastructure/adapters/GitPlumbingRuntimeAdapter.test.ts (1)
1-14: LGTM!test/unit/infrastructure/codecs/WarpStateCborCodec.test.ts (1)
1-135: LGTM!bin/cli/commands/doctor/checksMaterializationCache.ts (2)
1-108: LGTM!
126-159: LGTM!Also applies to: 179-223
bin/cli/commands/doctor/codes.ts (1)
46-53: LGTM!bin/cli/commands/doctor/index.ts (1)
17-28: LGTM!Also applies to: 37-37, 60-96, 105-106, 168-169, 197-202
bin/cli/commands/doctor/storageCapabilities.ts (1)
27-104: LGTM!bin/cli/commands/doctor/types.ts (1)
9-11: LGTM!Also applies to: 70-71
bin/cli/schemas.ts (1)
131-131: LGTM!test/bats/cli-doctor.bats (1)
41-41: LGTM!Also applies to: 58-58
test/unit/cli/doctor-materialization-cache.test.ts (1)
1-147: LGTM!test/unit/cli/doctor.test.ts (1)
9-10: LGTM!Also applies to: 80-94, 239-288
test/unit/cli/schemas.test.ts (1)
66-69: LGTM!
Release Preflight
If this PR is from a |
Summary
CacheSetdoctor, sweep, and repair evidence with WARP lane and coordinate meaning--repair-state-cachewith--repair-materialization-cache, preserving other lanes and never recreating missing bytes or running destructive GCValidation
npm run test:coverage:ci -- --maxWorkers=4: 613 passed, 1 skipped; 7,339 tests passed, 2 skipped; 92.97% lines versus 92.95% requirednpm run lintnpm run lint:mdnpm run lint:docs-topologynpm run lint:md:codenpm run typechecknpm run typecheck:consumernpm run typecheck:surfacenpx vitest run --maxWorkers=4 test/integration: 22 files, 105 testsPATH="$PWD/bin:$PATH" bats test/bats/cli-doctor.bats: 5 testsCloses #741