fix(storage): retain trie roots through git-cas#753
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 (18)
💤 Files with no reviewable changes (4)
📜 Recent review details⏰ Context from checks skipped due to timeout. (3)
🧰 Additional context used📓 Path-based instructions (4)**/*.{ts,tsx,js,jsx}📄 CodeRabbit inference engine (AGENTS.md)
Files:
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:
🧠 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) [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 (14)
📝 WalkthroughSummary by CodeRabbit
WalkthroughShadow-trie leaf and branch persistence moved from raw Git blobs and trees to bounded git-cas pages and bundle handles. Runtime wiring, trie contracts, tests, error terminology, and raw Git write ownership checks were updated. ChangesCAS-backed trie storage
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related issues
Possibly related PRs
Sequence Diagram(s)sequenceDiagram
participant TrieCursor
participant GitCasTrieStoreAdapter
participant GitCasFacade
participant ContentAddressableStore
TrieCursor->>GitCasTrieStoreAdapter: Flush trie leaf or branch
GitCasTrieStoreAdapter->>ContentAddressableStore: Store bounded leaf page
GitCasTrieStoreAdapter->>GitCasFacade: Create ordered bundle
GitCasFacade-->>GitCasTrieStoreAdapter: Return bundle handle
TrieCursor->>GitCasTrieStoreAdapter: Read trie root
GitCasTrieStoreAdapter->>GitCasFacade: Resolve bundle members
GitCasTrieStoreAdapter->>ContentAddressableStore: Read leaf page
ContentAddressableStore-->>TrieCursor: Return trie data
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 |
Code Lawyer activity summary
No force, rebase, amend, skipped threshold, or draft-PR operation was used. |
Summary
GitTrieStoreAdapterraw blob/tree implementation withGitCasTrieStoreAdaptergit prune -n --expire=nowRoot cause
The session-backed materializer emitted raw Git blob/tree OIDs from
hash-objectandmktree. Those objects bypassed git-cas retention and could not lawfully populateMaterializationRoots, so successful materialization could leave its trie graph unreachable and prunable.This change makes every successful trie root a git-cas bundle handle. A retained materialization bundle can now establish transitive reachability for branch bundles, leaf bundles, and leaf pages.
Impact
This is an internal storage-composition change. The v19 package root and public subpath declarations are unchanged. Deep internal
GitTrieStoreAdapterimports are intentionally removed.Legacy raw-OID roots are rejected as corrupt roots rather than silently interpreted under the new format. The ordinary warm-resume path is not wired in this PR, so #738 remains open.
Refs #738
Validation
npm run lintnpm run typechecknpm run typecheck:policynpm run typecheck:consumernpm run typecheck:surfacenpm run test:local(6,970 passed, 2 skipped)npx vitest run test/integration --maxWorkers=1(94 passed before the final empty-branch case; that case also passed independently)npm run test:coverage:ci(7,075 passed, 2 skipped; 92.78% lines)npm pack --dry-run --ignore-scripts