Resume exact materializations from retained git-cas roots#754
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (21)
📜 Recent review details⏰ Context from checks skipped due to timeout. (3)
🧰 Additional context used📓 Path-based instructions (4)src/**/*.{ts,tsx,js,jsx}📄 CodeRabbit inference engine (AGENTS.md)
Files:
src/domain/**/*.{ts,tsx,js,jsx}📄 CodeRabbit inference engine (AGENTS.md)
Files:
src/domain/**/!(*.test).{ts,tsx,js,jsx}📄 CodeRabbit inference engine (AGENTS.md)
Files:
**/*.{ts,tsx,js,jsx}📄 CodeRabbit inference engine (AGENTS.md)
Files:
🧠 Learnings (1)📚 Learning: 2026-03-08T19:50:17.519ZApplied to files:
🪛 ast-grep (0.44.1)test/integration/infrastructure/adapters/GitCasMaterializationStoreAdapter.integration.test.ts[warning] Importing child_process exposes a command-execution surface; ensure any command/argument built from input is validated, and prefer execFile/spawn with an argument array over exec. (detect-child-process-typescript) [warning] Importing child_process exposes a command-execution surface; ensure any command/argument built from input is validated, and prefer execFile/spawn with an argument array over exec. (detect-child-process-typescript) [warning] Importing child_process exposes a command-execution surface; ensure any command/argument built from input is validated, and prefer execFile/spawn with an argument array over exec. (detect-child-process-typescript) 🔇 Additional comments (21)
📝 WalkthroughSummary by CodeRabbit
WalkthroughMaterialization now models root availability explicitly, retains coordinate-keyed descriptors through Git-CAS, and resumes exact cached snapshots by reopening retained roots without patch replay or duplicate snapshot publication. Tests cover partial roots, validation, failure handling, warm reuse, and fresh runtime adapters. ChangesRetained materialization
Estimated code review effort: 4 (Complex) | ~60 minutes Possibly related issues
Possibly related PRs
Sequence Diagram(s)sequenceDiagram
participant MaterializeLiveStrategy
participant MaterializeController
participant MaterializationStorePort
participant StateSession
MaterializeLiveStrategy->>MaterializeController: request exact snapshot resume
MaterializeController->>MaterializationStorePort: findExact(coordinate)
MaterializationStorePort-->>MaterializeController: retained roots
MaterializeController->>StateSession: open session with retained roots
StateSession-->>MaterializeController: projected state
MaterializeController-->>MaterializeLiveStrategy: result without patch replay
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
Comment |
Release Preflight
If this PR is from a |
Summary
retained,empty, orunavailableposture@git-stunts/git-casCacheSetAPIWhy
Issue #738 requires warm materialization to resume from retained handles rather than repeatedly replaying the same causal prefix. The previous session bridge discarded the roots returned by
StateSession.close(); exact snapshot hits therefore had no durable page-root basis to reopen.This slice makes the node/edge trie roots durable and reconnects the exact-hit path to them. It is deliberately a partial delivery for #738, not issue closure.
Source evidence
src/domain/materialization/MaterializationRoot.ts#4-30@b96bd3e7d749ca946a2af7fa9d837cb2e56b8156]src/infrastructure/adapters/GitCasMaterializationDescriptor.ts#12-79@b96bd3e7d749ca946a2af7fa9d837cb2e56b8156]CacheSet; descriptor lane and coordinate mismatches fail closed. [cite:src/infrastructure/adapters/GitCasMaterializationStoreAdapter.ts#87-176@b96bd3e7d749ca946a2af7fa9d837cb2e56b8156]src/domain/services/controllers/MaterializeController.ts#296-353@b96bd3e7d749ca946a2af7fa9d837cb2e56b8156]src/domain/services/controllers/MaterializeSessionBridge.ts#34-90@b96bd3e7d749ca946a2af7fa9d837cb2e56b8156]test/integration/api/materialization.retainedResume.test.ts#27-65@b96bd3e7d749ca946a2af7fa9d837cb2e56b8156]close(). [cite:test/unit/domain/services/controllers/MaterializeController.stateSession.test.ts#197-225@b96bd3e7d749ca946a2af7fa9d837cb2e56b8156]Code Lawyer
lint:cas-invariantsreports zero raw Git object-write violations.reduceSessionBackedState; its only source caller isMaterializeController. The built package-root declaration surface has zero changes or warnings.WarpState, and builds full adjacency. [cite:docs/topics/cas-first-memoized-materialization.md#144-161@b96bd3e7d749ca946a2af7fa9d837cb2e56b8156]Validation
npm run typechecknpm run lint, including source-size and git-cas ownership gatesRemaining #738 work
RuntimeHostRefs #738