Preserve coherent Git object sessions#95
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 (9)
📜 Recent review details⏰ Context from checks skipped due to timeout. (3)
🧰 Additional context used📓 Path-based instructions (2)docs/design/**📄 CodeRabbit inference engine (AGENTS.md)
Files:
CHANGELOG.md📄 CodeRabbit inference engine (AGENTS.md)
Files:
🧠 Learnings (3)📚 Learning: 2026-03-30T19:53:48.000ZApplied to files:
📚 Learning: 2026-02-28T19:21:13.982ZApplied to files:
📚 Learning: 2026-07-13T17:00:46.222ZApplied to files:
🪛 ast-grep (0.44.1)test/integration/git-object-session-coherence.test.js[warning] 6-6: 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) 🔇 Additional comments (9)
📝 WalkthroughSummary by CodeRabbit
WalkthroughGit object session retirement is now selective: ChangesGit object session coherence
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant Adapter as GitPersistenceAdapter
participant CatFile as cat-file session
participant Mktree as mktree session
participant FastImport as fast-import session
Adapter->>CatFile: write object and preserve reader
Adapter->>Mktree: perform loose write and preserve writer
Adapter->>FastImport: execute scoped bulk write
FastImport-->>Adapter: checkpoint and return object IDs
Adapter->>Mktree: retire after possible pack creation
Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install failed: lockfile failed supply-chain policy check. Run Comment |
Self-code review
Reviewed the clean branch against freshly fetched The only finding was two Markdown hard-break trailing spaces in the witness header. Graft reports no exported API changes at implementation commit Verification: @codex please confirm the session-coherence boundary and the documented Graft JSON false positive. |
Summary
cat-file --batch-commandacross successful loose blob, tree, and scoped bulk writes;mktree --batch -zacross loose writes, while retaining the mandatory post-pack retirement boundary;Closes #94.
Root cause
The adapter treated every successful object-database mutation as if it invalidated every typed Git process. Git's lookup behavior is more precise:
cat-filerefreshes packed object state on a later lookup, whilemktreeuses quick lookup and cannot discover a pack created after its object-database snapshot. The previous blanket retirement policy therefore converted persistent protocols back into process-per-object execution.Behavioral boundary
This is one internal session-coherence correction. Individual
writeBlob()calls remain one-shothash-object; scopedfast-importstill checkpoints and closes before OIDs escape; retention, refs, object identity, lifecycle, and the public API are unchanged.[cite:
src/infrastructure/adapters/GitPersistenceAdapter.js#93-175@9208871802a596cbc508be725353532110d40198]The real-Git test forces two packs above
fastimport.unpackLimit, exercises both object formats, and proves one persistent reader plus the required replacementmktreegeneration.[cite:
test/integration/git-object-session-coherence.test.js#24-60@9208871802a596cbc508be725353532110d40198]Measured impact
On the audited temporary 128-node git-warp retained-materialization fixture:
cat-fileprocessesmktreeprocessesProcess topology is the high-confidence result. Timings are local three-run medians, not a cross-platform guarantee. The committed integration count is the durable regression gate.
Verification
pnpm release:verify: 14/14 steps, 6,826 observed tests;git diff --check origin/main...HEAD: pass;none.The host
pnpm test:platformscommand encountered Homebrewmoreutils' incompatibleparallelbefore executing tests. The exact Bats file passed serially across Node, Bun, and Deno; the witness records this harness limitation explicitly.Full evidence:
docs/design/0053-git-object-session-coherence/witness/verification.md.