Adopt persistent Git object sessions and close them safely#764
Conversation
Self-code review@codex please confirm this review posture.
Reviewed The only golden-value change was independently reproduced under git-cas 6.5.0, 6.5.2, and 6.5.3, then traced to |
|
Warning Review limit reached
Next review available in: 35 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 Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughAdds idempotent Git/CAS storage closure and async disposal, wires cleanup through CLI, migration, fixture, and test boundaries, upgrades git-cas and plumbing, refreshes a manifest golden value, and documents persistent-session behavior and explicit storage shutdown. ChangesStorage lifecycle management
git-cas 6.5.3 adoption
Estimated code review effort: 4 (Complex) | ~45 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 |
Final self-code review@codex please confirm this final review posture for
Evidence
Verification
No unresolved issue remains from the final self-review. |
Release Preflight
If this PR is from a |
There was a problem hiding this comment.
Actionable comments posted: 5
🤖 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
`@scripts/v18.0.0/migrations/graph-model/GraphModelMigrationScratchRuntimeReplayer.ts`:
- Around line 138-147: Aggregate cleanup failures across all three sites instead
of allowing nested finally blocks to mask earlier errors: in
scripts/v18.0.0/migrations/graph-model/GraphModelMigrationScratchRuntimeReplayer.ts
lines 138-147, retain the replay failure and collect runtime storage close,
persistence close, and repository removal failures before throwing an
AggregateError after every cleanup attempt; in test/bats/helpers/seed-setup.ts
lines 66-71, collect failures from both close operations and report them
together; in test/runtime/deno/helpers.ts lines 80-87, collect close and removal
failures and report them together.
In `@src/infrastructure/adapters/GitCasMaterializationStoreAdapter.ts`:
- Line 222: Update GitCasMaterializationStoreAdapter’s materialization entry
points, especially openWorkspace() and retain(), to reject new operations once
close() has started, not only after `#closed` is set. Use the existing close
state/promise to guard these methods before any externally owned CAS writes
occur, while preserving normal behavior before closure begins.
In `@test/integration/api/materialization.retainedResume.test.ts`:
- Around line 34-39: Update the afterEach teardown to use Promise.allSettled for
all providers in providers, ensuring every provider.close() settles before
proceeding. Perform repo?.cleanup() after all closes have settled, then
aggregate and propagate any provider-close failures after cleanup completes.
In
`@test/integration/infrastructure/adapters/GitCasMaterializationStoreAdapter.integration.test.ts`:
- Around line 67-106: Ensure the acquisition created by reopened.acquireExact in
the test is always released, including when assertions or later operations fail.
Move acquisition.release into a finally block that runs before reopened.close,
while preserving the existing nested teardown order and avoiding release when
acquisition was never created.
In `@test/unit/infrastructure/adapters/GitCasRepositoryAdapter.test.ts`:
- Around line 196-201: Remove the direct services.materializations.close() call
from the repository closure test, while retaining the spy setup and repeated
repository.close() calls. Assert that repository.close() itself invokes the
materialization cleanup exactly once.
🪄 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
Run ID: 5d2de608-f9e6-4769-867a-d145b9f6cb1f
📒 Files selected for processing (36)
ARCHITECTURE.mdCHANGELOG.mdREADME.mdbin/cli/shared.tsbin/warp-graph.tsdocs/TECHNICAL_TEARDOWN.mddocs/migrations/v19/README.mddocs/topics/getting-started.mddocs/topics/querying.mddocs/topics/reference.mdscripts/v18.0.0/migrations/graph-model/GraphModelMigrationScratchRuntimeReplayer.tsscripts/v18.0.0/migrations/graph-model/V17RestoredPublicReadLegacyReadingBuilder.tssrc/application/WarpStorage.tssrc/infrastructure/adapters/GitCasMaterializationStoreAdapter.tssrc/infrastructure/adapters/GitCasRepositoryAdapter.tssrc/infrastructure/adapters/GitTimelineHistoryAdapter.tsstorage.tstest/bats/helpers/seed-setup.tstest/bats/helpers/setup.bashtest/helpers/WarpGraphTestRepositories.tstest/integration/WarpGraph.integration.test.tstest/integration/api/checkpoint.test.tstest/integration/api/helpers/setup.tstest/integration/api/materialization.retainedResume.test.tstest/integration/application/GitStorage.integration.test.tstest/integration/domain/orset/trie/TrieCursor.flush.integration.test.tstest/integration/infrastructure/adapters/GitCasMaterializationStoreAdapter.integration.test.tstest/integration/infrastructure/adapters/GitCasTrieStoreAdapter.integration.test.tstest/integration/infrastructure/adapters/GitCasWarpStateCacheAdapter.retention.integration.test.tstest/runtime/deno/helpers.tstest/type-check/v19-consumer.tstest/type-check/v19-first-use.tstest/type-check/v19-subpaths.tstest/unit/application/WarpStorageRegistry.test.tstest/unit/infrastructure/adapters/GitCasRepositoryAdapter.test.tstest/unit/infrastructure/adapters/GitGraphAdapter.gitCasPersistence.test.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (3)
- GitHub Check: test-node (22)
- GitHub Check: preflight
- GitHub Check: coverage-threshold
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{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/integration/application/GitStorage.integration.test.tstest/type-check/v19-subpaths.tstest/integration/api/checkpoint.test.tstest/type-check/v19-consumer.tstest/unit/infrastructure/adapters/GitGraphAdapter.gitCasPersistence.test.tstest/integration/infrastructure/adapters/GitCasTrieStoreAdapter.integration.test.tstest/helpers/WarpGraphTestRepositories.tsscripts/v18.0.0/migrations/graph-model/GraphModelMigrationScratchRuntimeReplayer.tstest/integration/api/helpers/setup.tstest/integration/domain/orset/trie/TrieCursor.flush.integration.test.tstest/unit/application/WarpStorageRegistry.test.tstest/runtime/deno/helpers.tstest/unit/infrastructure/adapters/GitCasRepositoryAdapter.test.tssrc/infrastructure/adapters/GitTimelineHistoryAdapter.tstest/integration/WarpGraph.integration.test.tssrc/application/WarpStorage.tstest/bats/helpers/seed-setup.tstest/type-check/v19-first-use.tsbin/warp-graph.tsbin/cli/shared.tstest/integration/infrastructure/adapters/GitCasWarpStateCacheAdapter.retention.integration.test.tstest/integration/api/materialization.retainedResume.test.tsstorage.tsscripts/v18.0.0/migrations/graph-model/V17RestoredPublicReadLegacyReadingBuilder.tssrc/infrastructure/adapters/GitCasMaterializationStoreAdapter.tstest/integration/infrastructure/adapters/GitCasMaterializationStoreAdapter.integration.test.tssrc/infrastructure/adapters/GitCasRepositoryAdapter.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/infrastructure/adapters/GitTimelineHistoryAdapter.tssrc/application/WarpStorage.tssrc/infrastructure/adapters/GitCasMaterializationStoreAdapter.tssrc/infrastructure/adapters/GitCasRepositoryAdapter.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
🪛 ast-grep (0.44.1)
test/integration/api/materialization.retainedResume.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.
Context: import { execFile } from 'node:child_process';
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
(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.
Context: import { execFile } from 'node:child_process';
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
(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.
Context: import { execFile } from 'node:child_process';
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
(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.
Context: import { execFile } from 'node:child_process';
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
(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.
Context: import { execFile } from 'node:child_process';
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
(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.
Context: import { execFile } from 'node:child_process';
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
(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.
Context: import { execFile } from 'node:child_process';
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
(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.
Context: import { execFile } from 'node:child_process';
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
(detect-child-process-typescript)
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.
Context: import { execFile } from 'node:child_process';
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
(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.
Context: import { execFile } from 'node:child_process';
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
(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.
Context: import { execFile } from 'node:child_process';
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
(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.
Context: import { execFile } from 'node:child_process';
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
(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.
Context: import { execFile } from 'node:child_process';
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
(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.
Context: import { execFile } from 'node:child_process';
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
(detect-child-process-typescript)
🔇 Additional comments (33)
ARCHITECTURE.md (1)
123-125: LGTM!CHANGELOG.md (1)
22-23: LGTM!Also applies to: 55-57, 78-81
README.md (1)
107-112: LGTM!docs/TECHNICAL_TEARDOWN.md (1)
187-190: LGTM!docs/migrations/v19/README.md (1)
88-90: LGTM!docs/topics/getting-started.md (1)
158-164: LGTM!docs/topics/querying.md (1)
117-125: LGTM!docs/topics/reference.md (1)
97-97: LGTM!Also applies to: 195-195
src/application/WarpStorage.ts (1)
1-25: LGTM!storage.ts (1)
16-74: LGTM!test/integration/application/GitStorage.integration.test.ts (1)
20-33: LGTM!test/type-check/v19-consumer.ts (1)
142-143: LGTM!test/type-check/v19-first-use.ts (1)
11-15: LGTM!Also applies to: 37-38
test/type-check/v19-subpaths.ts (1)
34-34: LGTM!src/infrastructure/adapters/GitTimelineHistoryAdapter.ts (1)
104-104: LGTM!Also applies to: 134-142
src/infrastructure/adapters/GitCasMaterializationStoreAdapter.ts (1)
72-96: LGTM!src/infrastructure/adapters/GitCasRepositoryAdapter.ts (1)
33-33: LGTM!Also applies to: 75-119, 207-274
test/helpers/WarpGraphTestRepositories.ts (1)
18-22: LGTM!test/integration/WarpGraph.integration.test.ts (1)
39-47: LGTM!test/integration/domain/orset/trie/TrieCursor.flush.integration.test.ts (1)
52-56: LGTM!test/integration/infrastructure/adapters/GitCasMaterializationStoreAdapter.integration.test.ts (1)
33-45: LGTM!Also applies to: 220-233, 252-289
test/integration/infrastructure/adapters/GitCasTrieStoreAdapter.integration.test.ts (1)
20-24: LGTM!test/integration/infrastructure/adapters/GitCasWarpStateCacheAdapter.retention.integration.test.ts (1)
110-119: LGTM!bin/cli/shared.ts (1)
33-46: LGTM!Also applies to: 51-76
bin/warp-graph.ts (1)
8-8: LGTM!Also applies to: 80-86, 131-141
scripts/v18.0.0/migrations/graph-model/V17RestoredPublicReadLegacyReadingBuilder.ts (1)
131-132: LGTM!Also applies to: 160-161, 181-190
test/bats/helpers/setup.bash (1)
63-91: LGTM!test/integration/api/checkpoint.test.ts (1)
23-35: LGTM!test/integration/api/helpers/setup.ts (1)
69-77: LGTM!test/integration/api/materialization.retainedResume.test.ts (1)
70-70: LGTM!Also applies to: 87-87, 104-104, 124-124, 148-148, 264-294
test/unit/application/WarpStorageRegistry.test.ts (1)
1-1: LGTM!Also applies to: 17-22, 47-57
test/unit/infrastructure/adapters/GitCasRepositoryAdapter.test.ts (1)
119-119: LGTM!Also applies to: 142-142, 202-210
test/unit/infrastructure/adapters/GitGraphAdapter.gitCasPersistence.test.ts (1)
248-258: LGTM!
Release Preflight
If this PR is from a |
Post-review verification@codex please confirm this review posture for
Evidence
Verification
No unresolved issue remains from this self-review. |
Release Preflight
If this PR is from a |
Final self-code review@codex please confirm this review posture for
Verdict
|
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/mcp.ts`:
- Around line 43-57: Attach an error handler to the readline interface created
in the MCP command, ensuring stdin/readline errors are propagated into the
existing completion and close lifecycle rather than becoming unhandled events.
Update the flow around trackMcpLines and the returned close function so storage
and other cleanup still execute when an error occurs.
🪄 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
Run ID: 9e2274c6-652b-48e7-bf46-03fe71554374
📒 Files selected for processing (25)
bin/cli/commands/mcp.tsbin/cli/lifecycle.tsbin/cli/shared.tsbin/warp-graph.tsdocs/topics/reference.mdscripts/v18.0.0/migrations/graph-model/GraphModelMigrationScratchRuntimeReplayer.tsscripts/v18.0.0/migrations/graph-model/V17RestoredPublicReadLegacyReadingBuilder.tssrc/infrastructure/adapters/GitCasMaterializationStoreAdapter.tssrc/infrastructure/adapters/GitCasMaterializationStoreValidation.tssrc/infrastructure/adapters/GitCasMaterializationWorkspace.tssrc/infrastructure/adapters/GitCasMaterializationWorkspaceOwner.tssrc/infrastructure/adapters/OperationCleanup.tstest/bats/cli-mcp.batstest/bats/helpers/seed-setup.tstest/integration/api/materialization.retainedResume.test.tstest/integration/api/querybuilder.test.tstest/integration/infrastructure/adapters/GitCasMaterializationStoreAdapter.integration.test.tstest/runtime/deno/helpers.tstest/unit/application/WarpStorageRegistry.test.tstest/unit/cli/lifecycle.test.tstest/unit/infrastructure/adapters/GitCasMaterializationStoreAdapter.lifecycle.test.tstest/unit/infrastructure/adapters/GitCasMaterializationWorkspaceOwner.test.tstest/unit/infrastructure/adapters/GitCasRepositoryAdapter.test.tstest/unit/infrastructure/adapters/GitGraphAdapter.gitCasPersistence.test.tstest/unit/infrastructure/adapters/OperationCleanup.test.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (3)
- GitHub Check: test-node (22)
- GitHub Check: coverage-threshold
- GitHub Check: preflight
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{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:
bin/cli/lifecycle.tstest/unit/infrastructure/adapters/OperationCleanup.test.tssrc/infrastructure/adapters/OperationCleanup.tstest/unit/infrastructure/adapters/GitGraphAdapter.gitCasPersistence.test.tstest/unit/cli/lifecycle.test.tstest/runtime/deno/helpers.tstest/integration/api/querybuilder.test.tstest/unit/infrastructure/adapters/GitCasRepositoryAdapter.test.tstest/bats/helpers/seed-setup.tstest/unit/infrastructure/adapters/GitCasMaterializationWorkspaceOwner.test.tstest/unit/application/WarpStorageRegistry.test.tssrc/infrastructure/adapters/GitCasMaterializationStoreValidation.tssrc/infrastructure/adapters/GitCasMaterializationWorkspaceOwner.tsscripts/v18.0.0/migrations/graph-model/GraphModelMigrationScratchRuntimeReplayer.tsbin/cli/shared.tssrc/infrastructure/adapters/GitCasMaterializationWorkspace.tstest/unit/infrastructure/adapters/GitCasMaterializationStoreAdapter.lifecycle.test.tsscripts/v18.0.0/migrations/graph-model/V17RestoredPublicReadLegacyReadingBuilder.tsbin/cli/commands/mcp.tstest/integration/infrastructure/adapters/GitCasMaterializationStoreAdapter.integration.test.tstest/integration/api/materialization.retainedResume.test.tsbin/warp-graph.tssrc/infrastructure/adapters/GitCasMaterializationStoreAdapter.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/infrastructure/adapters/OperationCleanup.tssrc/infrastructure/adapters/GitCasMaterializationStoreValidation.tssrc/infrastructure/adapters/GitCasMaterializationWorkspaceOwner.tssrc/infrastructure/adapters/GitCasMaterializationWorkspace.tssrc/infrastructure/adapters/GitCasMaterializationStoreAdapter.ts
🪛 ast-grep (0.44.1)
bin/cli/shared.ts
[warning] 221-221: Filesystem path is not a string literal; a request-/variable-derived path can enable path traversal. Validate and normalize the path before use.
Context: fs.readFileSync(path.join(packageRoot, 'package.json'), 'utf8')
Note: [CWE-22] Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
(detect-non-literal-fs-filename-typescript)
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.
Context: import { execFile } from 'node:child_process';
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
(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.
Context: import { execFile } from 'node:child_process';
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
(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.
Context: import { execFile } from 'node:child_process';
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
(detect-child-process-typescript)
test/integration/api/materialization.retainedResume.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.
Context: import { execFile } from 'node:child_process';
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
(detect-child-process-typescript)
🔇 Additional comments (26)
src/infrastructure/adapters/GitCasMaterializationStoreAdapter.ts (1)
11-14: LGTM!Also applies to: 26-36, 84-86, 113-141, 220-230, 232-246, 306-312, 322-328, 358-363
src/infrastructure/adapters/GitCasMaterializationStoreValidation.ts (1)
1-50: LGTM!src/infrastructure/adapters/GitCasMaterializationWorkspace.ts (1)
44-45: LGTM!Also applies to: 47-51, 64-64, 137-137
src/infrastructure/adapters/GitCasMaterializationWorkspaceOwner.ts (1)
1-92: LGTM!src/infrastructure/adapters/OperationCleanup.ts (1)
1-19: LGTM!docs/topics/reference.md (1)
97-97: LGTM!Also applies to: 195-195
test/bats/helpers/seed-setup.ts (1)
66-81: LGTM!bin/cli/lifecycle.ts (1)
1-22: LGTM!test/unit/cli/lifecycle.test.ts (1)
1-41: LGTM!bin/warp-graph.ts (1)
31-45: LGTM!Also applies to: 86-121, 155-167
scripts/v18.0.0/migrations/graph-model/GraphModelMigrationScratchRuntimeReplayer.ts (1)
109-165: LGTM!scripts/v18.0.0/migrations/graph-model/V17RestoredPublicReadLegacyReadingBuilder.ts (1)
82-105: LGTM!Also applies to: 139-192, 209-247
test/integration/api/materialization.retainedResume.test.ts (1)
35-47: LGTM!Also applies to: 276-291, 320-327
test/integration/infrastructure/adapters/GitCasMaterializationStoreAdapter.integration.test.ts (1)
22-48: LGTM!Also applies to: 70-111
test/runtime/deno/helpers.ts (1)
79-95: LGTM!bin/cli/commands/mcp.ts (2)
1-5: LGTM!Also applies to: 13-17, 24-37, 86-98
59-84: 🗄️ Data Integrity & IntegrationMCP dispatch is read-only
The registered MCP tools only read graph state, andMcpGraphReadSurfaceexposes no mutation methods, so per-line concurrent dispatch here doesn’t create a write race.> Likely an incorrect or invalid review comment.bin/cli/shared.ts (1)
33-46: LGTM!Also applies to: 51-70, 219-224, 229-241
test/bats/cli-mcp.bats (1)
1-56: LGTM!test/integration/api/querybuilder.test.ts (1)
1-20: LGTM!Also applies to: 46-139
test/unit/application/WarpStorageRegistry.test.ts (1)
1-1: LGTM!Also applies to: 17-22, 46-67
test/unit/infrastructure/adapters/GitCasRepositoryAdapter.test.ts (1)
119-119: LGTM!Also applies to: 142-142, 195-218
test/unit/infrastructure/adapters/GitGraphAdapter.gitCasPersistence.test.ts (1)
247-267: LGTM!test/unit/infrastructure/adapters/GitCasMaterializationStoreAdapter.lifecycle.test.ts (1)
1-11: LGTM!Also applies to: 22-128
test/unit/infrastructure/adapters/GitCasMaterializationWorkspaceOwner.test.ts (1)
1-108: LGTM!test/unit/infrastructure/adapters/OperationCleanup.test.ts (1)
1-58: LGTM!
Release Preflight
If this PR is from a |
Summary
@git-stunts/git-cas@6.5.3session coherence with@git-stunts/plumbing@3.2.0GitStorage.close()and async disposal, with explicit ownership for history, internally-created CAS, and materialization leasesMeasured checkpoint
The controlled 128-node retained-materialization comparison reduced process creation from 558 to 401 children (28.1%),
cat-filefrom 80 to 4, andmktreefrom 82 to 1. Median materialization time moved from 14.24 s to 12.72 s.The three downstream registry-artifact runs produced 398 workload Git children, or 401 including repository setup. Their diagnostic wall times were 7.02 s, 7.18 s, and 6.67 s. These downstream timings remain non-gating because that run did not capture process-tree CPU/RSS or reproduce the old timing harness.
Validation
Review posture
The branch has three signed commits and is based directly on current
origin/main. The final code-lawyer pass found and corrected two issues before this update: cleanup could mask CLI binding failure, and canonical examples did not consistently close persistent storage. No unresolved review finding remains.Scope and issues
This consumes the fix for git-stunts/git-cas#94. Compatibility with narrow third-party plumbing fakes is deliberately deferred to git-stunts/git-cas#98 instead of triggering another git-cas release.
This advances #738, #758, and #759, but does not close them: retained RuntimeHost materialization, the bounded-memory contract, and committed CPU/RSS benchmark gates remain separate work.