Adopt git-cas as the storage composition root#744
Conversation
📝 WalkthroughSummary by CodeRabbit
WalkthroughV19 replaces adapter-facing storage setup with opaque ChangesV19 storage and runtime architecture
Estimated code review effort: 5 (Critical) | ~90+ minutes Possibly related issues
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches📝 Generate docstrings
Comment |
Self-review at
|
Code Lawyer review at
|
Release Preflight
If this PR is from a |
|
CI follow-up: the Deno test harness now composes the required repository-storage boundary from the same plumbing and history adapter, then injects that shared storage into every Local verification after the fix:
|
Release Preflight
If this PR is from a |
Final-head review addendum at
|
There was a problem hiding this comment.
Actionable comments posted: 9
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/infrastructure/adapters/CasBlobAdapter.ts (1)
111-116: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winDuplicate
storeOptstype literal betweenstore()andstoreStream().The same inline type
{ source: AsyncIterable<Uint8Array>; slug: string; filename: string; encryptionKey?: Uint8Array; encryption?: CasStoreEncryptionOptions }is declared twice. Extracting a shared type alias avoids drift if the shape changes.♻️ Proposed extraction
+type CasStoreRequest = { + source: AsyncIterable<Uint8Array>; + slug: string; + filename: string; + encryptionKey?: Uint8Array; + encryption?: CasStoreEncryptionOptions; +}; + export default class CasBlobAdapter extends BlobStoragePort { ... - const storeOpts: { source: AsyncIterable<Uint8Array>; slug: string; filename: string; encryptionKey?: Uint8Array; encryption?: CasStoreEncryptionOptions } = { + const storeOpts: CasStoreRequest = { source, slug: options?.slug ?? `blob-${Date.now().toString(36)}`, filename: 'content', ...this._contentEncryption.toStoreOptions(), };(apply the same substitution in
storeStream)Also applies to: 176-181
🤖 Prompt for 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. In `@src/infrastructure/adapters/CasBlobAdapter.ts` around lines 111 - 116, Extract the duplicated inline `storeOpts` object shape into a shared type alias near the adapter’s other type definitions, then use that alias for `storeOpts` in both `store()` and `storeStream()`. Preserve the existing fields and optional encryption properties exactly.
🤖 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 `@src/application/openWarp.ts`:
- Line 19: Replace the installDefaultRuntimeHostNodePorts() call in openWarp
with runtime-host port injection through the composition boundary. Update the
relevant openWarp parameters and downstream construction to pass
instance-specific ports explicitly, avoiding mutation of shared process-wide
resolvers.
In `@src/domain/warp/RuntimeHostBoot.ts`:
- Around line 147-149: Update the runtime storage assignment in RuntimeHostBoot
so null is treated as absent, preventing this.runtimeStorage from being set to
null. Ensure null follows the configured resolver or triggers the existing
E_RUNTIME_STORAGE_REQUIRED handling, and apply the same correction to the other
runtimeStorage assignment path.
In `@src/domain/warp/RuntimeHostPortResolvers.ts`:
- Around line 15-23: Remove the module-level runtimeHostStorageResolver state
and its setter/getter usage. Update the runtime-host input/composition-root flow
to accept and pass a RuntimeStorageProviderPort explicitly, and make host
creation fail closed when that provider is absent instead of reading ambient
module state; leave the other codec and crypto resolvers unchanged.
In `@src/infrastructure/adapters/GitCasRepositoryAdapter.ts`:
- Around line 101-116: Update _createPatchJournal to replace the positional
false argument passed to createGitCasPatchStorage with a named option or
dedicated helper that explicitly conveys the intended patch-storage behavior,
while preserving the current behavior.
In `@src/infrastructure/adapters/GitCasWarpStateCacheAdapter.ts`:
- Around line 120-125: Update validateSnapshots to validate every map entry
before returning it as Record<string, GitCasStateCacheEntry}: verify each
value’s required fields and runtime types, validate coordinates, retention
values, and timestamps, and require each map key to match its entry’s
snapshotId. Reject malformed entries with CacheError instead of relying on the
type assertion.
- Around line 314-325: Update all three _loadSnapshotState error-handling paths
in src/infrastructure/adapters/GitCasWarpStateCacheAdapter.ts:314-325, 339-350,
and 426-438 to evict snapshots only for confirmed missing or corrupt payload
errors. Preserve encryption-error mapping, let transient
CAS/read/compare-and-swap and lastAccessedAt update failures propagate, and
avoid deleting the cache entry for other errors.
In `@src/infrastructure/adapters/GitTrustChainAdapter.ts`:
- Around line 28-29: Update the CborCodec import used by the
GitTrustChainAdapter so it is a runtime value import, allowing
InstanceType<typeof CborCodec> to resolve correctly; alternatively, replace that
alias with the codec’s direct instance type while preserving the existing
typing.
In `@test/unit/infrastructure/adapters/CasBlobAdapter.test.ts`:
- Around line 200-207: Update CasBlobAdapter.has and its rejection test so only
the CAS’s explicit not-found error resolves to false; rethrow backend,
authorization, integrity, and other errors. Adjust the mocked rejection in the
existing “missing manifest” test to use the repository’s not-found error symbol,
and add coverage confirming non-not-found errors propagate.
In `@test/unit/infrastructure/adapters/GitGraphAdapter.listRefs.test.ts`:
- Around line 3-5: Rename the test file from GitGraphAdapter.listRefs.test.ts to
GitTimelineHistoryAdapter.listRefs.test.ts so it matches the
GitTimelineHistoryAdapter import, describe block, and test subject.
---
Outside diff comments:
In `@src/infrastructure/adapters/CasBlobAdapter.ts`:
- Around line 111-116: Extract the duplicated inline `storeOpts` object shape
into a shared type alias near the adapter’s other type definitions, then use
that alias for `storeOpts` in both `store()` and `storeStream()`. Preserve the
existing fields and optional encryption properties exactly.
🪄 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: 79cfeb6c-a6d9-40e1-8243-9f448a594f41
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (109)
ARCHITECTURE.mdREADME.mdbin/cli/commands/check.tsbin/cli/commands/doctor/checksAux.tsbin/cli/commands/doctor/index.tsbin/cli/commands/doctor/stateCacheCapability.tsbin/cli/commands/doctor/types.tsbin/cli/commands/info.tsbin/cli/commands/install-hooks.tsbin/cli/commands/materialize.tsbin/cli/commands/optic.tsbin/cli/commands/seek.tsbin/cli/commands/trust.tsbin/cli/shared.tsbin/cli/types.tsdocs/ANTI_SLUDGE_POLICY.mddocs/migrations/v19/README.mddocs/topics/api/README.mddocs/topics/cli.mddocs/topics/getting-started.mddocs/topics/querying.mddocs/topics/reference.mdindex.tspackage.jsonscripts/migrations/v17.0.0/fix-imports.tsscripts/smoke-packed-artifact.shscripts/v18.0.0/migrations/graph-model/GraphModelMigrationScratchRuntimeReplayer.tsscripts/v18.0.0/migrations/graph-model/V17RestoredPublicReadLegacyReadingBuilder.tssrc/application/WarpStorage.tssrc/application/WarpStorageRegistry.tssrc/application/openWarp.tssrc/domain/RuntimeHost.tssrc/domain/WarpGraph.tssrc/domain/api/openWarp.tssrc/domain/runtimeHelpers.tssrc/domain/services/controllers/ForkController.tssrc/domain/services/controllers/detachedOpen.tssrc/domain/warp/RuntimeHostBoot.tssrc/domain/warp/RuntimeHostPortResolvers.tssrc/domain/warp/RuntimeHostProduct.tssrc/infrastructure/adapters/CasBlobAdapter.tssrc/infrastructure/adapters/CasSeekCacheAdapter.tssrc/infrastructure/adapters/CasStoreFactory.tssrc/infrastructure/adapters/GitCasRepositoryAdapter.tssrc/infrastructure/adapters/GitCasStateCacheIndex.tssrc/infrastructure/adapters/GitCasStateCacheRootSetCoordinator.tssrc/infrastructure/adapters/GitCasWarpStateCacheAdapter.tssrc/infrastructure/adapters/GitCommitNodeInfoDecoder.tssrc/infrastructure/adapters/GitTimelineHistoryAdapter.tssrc/infrastructure/adapters/GitTrustChainAdapter.tssrc/infrastructure/adapters/InMemoryBlobStorageAdapter.tssrc/infrastructure/adapters/InMemoryGraphAdapter.tssrc/infrastructure/adapters/MemoryRuntimeStorageAdapter.tssrc/infrastructure/adapters/PlumbingHookPathAdapter.tssrc/infrastructure/adapters/adapterValidation.tssrc/infrastructure/adapters/gitCasModule.tssrc/infrastructure/adapters/gitErrorClassification.tssrc/infrastructure/adapters/lazyCasInit.tssrc/ports/GraphPersistencePort.tssrc/ports/RuntimeStorageCapabilityPort.tssrc/ports/RuntimeStorageProviderPort.tsstorage.tstest/bats/helpers/seed-setup.tstest/bats/helpers/seed-trust-sync.tstest/bats/helpers/seed-trust.tstest/benchmark/detachedReadBenchmark.fixture.tstest/conformance/v18FirstUseOpticsHonesty.test.tstest/helpers/WarpGraphTestRepositories.tstest/helpers/runtimeHostCommitMessageCodecSetup.tstest/integration/WarpGraph.integration.test.tstest/integration/api/helpers/setup.tstest/integration/application/GitStorage.integration.test.tstest/integration/infrastructure/adapters/GitCasWarpStateCacheAdapter.retention.integration.test.tstest/runtime/deno/deno.jsontest/runtime/deno/helpers.tstest/type-check/plumbing-declarations.d.tstest/type-check/tsconfig.jsontest/type-check/v19-consumer.tstest/type-check/v19-first-use.tstest/type-check/v19-subpaths.tstest/unit/application/WarpStorageRegistry.test.tstest/unit/cli/doctor.test.tstest/unit/domain/WarpCore.blobAutoConstruct.test.tstest/unit/domain/WarpCore.stateSessionAutoConstruct.test.tstest/unit/domain/WarpFacade.test.tstest/unit/domain/runtimeProductExecutableSurface.test.tstest/unit/domain/services/GitGraphAdapter.stress.test.tstest/unit/domain/services/GitGraphAdapter.test.tstest/unit/domain/services/TreeConstruction.determinism.test.tstest/unit/domain/services/optic/CheckpointTailBasisVerifier.test.tstest/unit/domain/strandAndRuntimeSeams.test.tstest/unit/domain/warp/RuntimeHostPortResolvers.test.tstest/unit/infrastructure/adapters/CasBlobAdapter.test.tstest/unit/infrastructure/adapters/CasSeekCacheAdapter.eviction.test.tstest/unit/infrastructure/adapters/CasSeekCacheAdapter.test.tstest/unit/infrastructure/adapters/GitCasRepositoryAdapter.test.tstest/unit/infrastructure/adapters/GitCasWarpStateCacheAdapter.retention.test.tstest/unit/infrastructure/adapters/GitCasWarpStateCacheAdapter.test.tstest/unit/infrastructure/adapters/GitGraphAdapter.commitNodeWithTree.test.tstest/unit/infrastructure/adapters/GitGraphAdapter.coverage.test.tstest/unit/infrastructure/adapters/GitGraphAdapter.gitCasPersistence.test.tstest/unit/infrastructure/adapters/GitGraphAdapter.listRefs.test.tstest/unit/infrastructure/adapters/GitTrustChainAdapter.test.tstest/unit/infrastructure/adapters/InMemoryBlobStorageAdapter.test.tstest/unit/infrastructure/adapters/PlumbingHookPathAdapter.test.tstest/unit/infrastructure/adapters/lazyCasInit.test.tstest/unit/scripts/non-ts-tail-shape.test.tstest/unit/scripts/v18-v17-public-read-legacy-reading-builder.test.tstest/unit/scripts/v19-public-api-boundary.test.ts
💤 Files with no reviewable changes (7)
- src/ports/RuntimeStorageCapabilityPort.ts
- src/infrastructure/adapters/gitCasModule.ts
- test/unit/infrastructure/adapters/lazyCasInit.test.ts
- src/infrastructure/adapters/CasStoreFactory.ts
- src/infrastructure/adapters/lazyCasInit.ts
- src/domain/api/openWarp.ts
- src/domain/runtimeHelpers.ts
📜 Review details
🧰 Additional context used
📓 Path-based instructions (5)
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/application/WarpStorage.tssrc/application/openWarp.tssrc/infrastructure/adapters/InMemoryGraphAdapter.tssrc/infrastructure/adapters/gitErrorClassification.tssrc/ports/GraphPersistencePort.tssrc/infrastructure/adapters/adapterValidation.tssrc/infrastructure/adapters/GitCommitNodeInfoDecoder.tssrc/ports/RuntimeStorageProviderPort.tssrc/application/WarpStorageRegistry.tssrc/infrastructure/adapters/InMemoryBlobStorageAdapter.tssrc/domain/services/controllers/ForkController.tssrc/infrastructure/adapters/PlumbingHookPathAdapter.tssrc/infrastructure/adapters/MemoryRuntimeStorageAdapter.tssrc/domain/services/controllers/detachedOpen.tssrc/domain/warp/RuntimeHostPortResolvers.tssrc/domain/warp/RuntimeHostProduct.tssrc/domain/WarpGraph.tssrc/domain/RuntimeHost.tssrc/infrastructure/adapters/GitCasRepositoryAdapter.tssrc/infrastructure/adapters/GitCasStateCacheRootSetCoordinator.tssrc/infrastructure/adapters/GitTrustChainAdapter.tssrc/infrastructure/adapters/GitCasStateCacheIndex.tssrc/infrastructure/adapters/CasSeekCacheAdapter.tssrc/infrastructure/adapters/CasBlobAdapter.tssrc/infrastructure/adapters/GitCasWarpStateCacheAdapter.tssrc/domain/warp/RuntimeHostBoot.tssrc/infrastructure/adapters/GitTimelineHistoryAdapter.ts
**/*.{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:
src/application/WarpStorage.tssrc/application/openWarp.tssrc/infrastructure/adapters/InMemoryGraphAdapter.tsbin/cli/commands/optic.tstest/unit/domain/services/TreeConstruction.determinism.test.tssrc/infrastructure/adapters/gitErrorClassification.tstest/unit/infrastructure/adapters/InMemoryBlobStorageAdapter.test.tstest/unit/scripts/non-ts-tail-shape.test.tssrc/ports/GraphPersistencePort.tsbin/cli/types.tsscripts/migrations/v17.0.0/fix-imports.tstest/unit/infrastructure/adapters/GitGraphAdapter.listRefs.test.tsbin/cli/commands/doctor/types.tstest/unit/domain/strandAndRuntimeSeams.test.tstest/type-check/v19-consumer.tstest/helpers/runtimeHostCommitMessageCodecSetup.tstest/type-check/plumbing-declarations.d.tstest/type-check/v19-first-use.tstest/unit/infrastructure/adapters/PlumbingHookPathAdapter.test.tstest/unit/application/WarpStorageRegistry.test.tstest/integration/application/GitStorage.integration.test.tssrc/infrastructure/adapters/adapterValidation.tstest/unit/domain/services/optic/CheckpointTailBasisVerifier.test.tssrc/infrastructure/adapters/GitCommitNodeInfoDecoder.tstest/unit/scripts/v18-v17-public-read-legacy-reading-builder.test.tstest/unit/domain/services/GitGraphAdapter.stress.test.tssrc/ports/RuntimeStorageProviderPort.tsbin/cli/commands/seek.tsbin/cli/commands/doctor/checksAux.tssrc/application/WarpStorageRegistry.tstest/unit/infrastructure/adapters/GitGraphAdapter.coverage.test.tsbin/cli/commands/doctor/stateCacheCapability.tsbin/cli/commands/materialize.tstest/bats/helpers/seed-trust.tstest/bats/helpers/seed-trust-sync.tsbin/cli/commands/doctor/index.tssrc/infrastructure/adapters/InMemoryBlobStorageAdapter.tssrc/domain/services/controllers/ForkController.tstest/unit/infrastructure/adapters/GitCasRepositoryAdapter.test.tsstorage.tsscripts/v18.0.0/migrations/graph-model/GraphModelMigrationScratchRuntimeReplayer.tstest/integration/infrastructure/adapters/GitCasWarpStateCacheAdapter.retention.integration.test.tstest/integration/WarpGraph.integration.test.tsbin/cli/commands/check.tssrc/infrastructure/adapters/PlumbingHookPathAdapter.tstest/helpers/WarpGraphTestRepositories.tssrc/infrastructure/adapters/MemoryRuntimeStorageAdapter.tstest/integration/api/helpers/setup.tstest/unit/infrastructure/adapters/GitGraphAdapter.commitNodeWithTree.test.tsindex.tssrc/domain/services/controllers/detachedOpen.tsbin/cli/commands/info.tstest/unit/domain/runtimeProductExecutableSurface.test.tsbin/cli/commands/install-hooks.tsscripts/v18.0.0/migrations/graph-model/V17RestoredPublicReadLegacyReadingBuilder.tstest/type-check/v19-subpaths.tstest/unit/domain/WarpCore.blobAutoConstruct.test.tstest/unit/domain/services/GitGraphAdapter.test.tstest/bats/helpers/seed-setup.tssrc/domain/warp/RuntimeHostPortResolvers.tstest/unit/infrastructure/adapters/GitGraphAdapter.gitCasPersistence.test.tsbin/cli/commands/trust.tssrc/domain/warp/RuntimeHostProduct.tstest/conformance/v18FirstUseOpticsHonesty.test.tstest/unit/scripts/v19-public-api-boundary.test.tssrc/domain/WarpGraph.tstest/runtime/deno/helpers.tssrc/domain/RuntimeHost.tstest/unit/domain/warp/RuntimeHostPortResolvers.test.tssrc/infrastructure/adapters/GitCasRepositoryAdapter.tssrc/infrastructure/adapters/GitCasStateCacheRootSetCoordinator.tssrc/infrastructure/adapters/GitTrustChainAdapter.tssrc/infrastructure/adapters/GitCasStateCacheIndex.tstest/benchmark/detachedReadBenchmark.fixture.tstest/unit/infrastructure/adapters/GitCasWarpStateCacheAdapter.retention.test.tstest/unit/domain/WarpCore.stateSessionAutoConstruct.test.tstest/unit/infrastructure/adapters/CasSeekCacheAdapter.eviction.test.tstest/unit/cli/doctor.test.tstest/unit/domain/WarpFacade.test.tssrc/infrastructure/adapters/CasSeekCacheAdapter.tsbin/cli/shared.tssrc/infrastructure/adapters/CasBlobAdapter.tstest/unit/infrastructure/adapters/GitCasWarpStateCacheAdapter.test.tstest/unit/infrastructure/adapters/GitTrustChainAdapter.test.tssrc/infrastructure/adapters/GitCasWarpStateCacheAdapter.tssrc/domain/warp/RuntimeHostBoot.tssrc/infrastructure/adapters/GitTimelineHistoryAdapter.tstest/unit/infrastructure/adapters/CasSeekCacheAdapter.test.tstest/unit/infrastructure/adapters/CasBlobAdapter.test.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/GraphPersistencePort.tssrc/ports/RuntimeStorageProviderPort.ts
src/domain/**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
src/domain/**/*.{ts,tsx,js,jsx}: Insrc/domain/**, do not useDate.now(),new Date(),Date(),performance.now(),Math.random(),crypto.randomUUID(),crypto.getRandomValues(),setTimeout,setInterval, rawnew Error(...)/new TypeError(...), or direct imports from Node built-ins; time, entropy, and external capabilities must enter through ports or parameters, and domain errors should extendWarpError.
Construct domain objects only in core when doing so establishes validated runtime truth; do not build infrastructure adapters, host APIs, persistence implementations, wall clocks, or entropy sources inside core.
Prefer discriminated unions and explicit result types instead of boolean-flag bags, and model expected failures as return values rather than exceptions.
src/domain/must not import host APIs or Node-specific globals; hexagonal architecture boundaries are mandatory.
Domain code must not use the wall clock directly; time must enter through a port or parameter.
Files:
src/domain/services/controllers/ForkController.tssrc/domain/services/controllers/detachedOpen.tssrc/domain/warp/RuntimeHostPortResolvers.tssrc/domain/warp/RuntimeHostProduct.tssrc/domain/WarpGraph.tssrc/domain/RuntimeHost.tssrc/domain/warp/RuntimeHostBoot.ts
src/domain/**/!(*.test).{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
Use explicit domain concepts with validated constructors,
Object.freeze, andinstanceofdispatch; domain objects should be runtime-backed nouns, not ad hoc shape bags.
Files:
src/domain/services/controllers/ForkController.tssrc/domain/services/controllers/detachedOpen.tssrc/domain/warp/RuntimeHostPortResolvers.tssrc/domain/warp/RuntimeHostProduct.tssrc/domain/WarpGraph.tssrc/domain/RuntimeHost.tssrc/domain/warp/RuntimeHostBoot.ts
🧠 Learnings (1)
📚 Learning: 2026-03-04T12:08:30.347Z
Learnt from: flyingrobots
Repo: git-stunts/git-warp PR: 63
File: package.json:126-126
Timestamp: 2026-03-04T12:08:30.347Z
Learning: Vitest 4 removes vite-node as a dependency and rewrites its pool system. Do not flag the absence of vite-node in package.json or lockfiles as an error for Vitest 4 projects. Use this as a general guideline: if a project uses Vitest 4, missing vite-node is expected and correct; only flag issues if there is evidence the project is not using Vitest 4 or if vite-node is explicitly required by the project.
Applied to files:
package.json
🪛 ast-grep (0.44.1)
test/unit/scripts/non-ts-tail-shape.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 { execFileSync } from 'node:child_process';
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
(detect-child-process-typescript)
bin/cli/shared.ts
[warning] 183-183: 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)
🔇 Additional comments (108)
ARCHITECTURE.md (1)
13-16: LGTM!Also applies to: 26-43, 62-64, 112-145, 218-220, 246-249
README.md (1)
61-69: LGTM!Also applies to: 401-403
bin/cli/commands/doctor/index.ts (1)
74-80: LGTM!bin/cli/commands/install-hooks.ts (1)
6-6: LGTM!Also applies to: 20-34, 37-63, 116-132
src/domain/WarpGraph.ts (1)
43-43: LGTM!Also applies to: 140-140
src/domain/services/controllers/detachedOpen.ts (1)
19-23: LGTM!Also applies to: 47-47, 65-71
src/ports/RuntimeStorageProviderPort.ts (1)
1-36: LGTM!bin/cli/commands/check.ts (1)
6-6: LGTM!Also applies to: 119-122, 130-130, 139-139
bin/cli/commands/materialize.ts (1)
4-13: LGTM!Also applies to: 48-48, 78-78
bin/cli/commands/optic.ts (1)
65-71: LGTM!bin/cli/commands/trust.ts (1)
56-58: LGTM!bin/cli/shared.ts (1)
7-53: LGTM!Also applies to: 101-117, 181-188, 247-256
docs/topics/api/README.md (1)
69-72: LGTM!Also applies to: 93-97, 394-394, 408-409
docs/topics/cli.md (1)
16-16: LGTM!test/unit/cli/doctor.test.ts (1)
4-8: LGTM!Also applies to: 37-39, 82-108, 126-126, 192-192, 219-219, 266-282, 297-355, 373-382, 391-411, 422-436
bin/cli/commands/doctor/checksAux.ts (1)
90-98: LGTM!bin/cli/commands/doctor/stateCacheCapability.ts (1)
4-5: LGTM!Also applies to: 15-23
bin/cli/commands/doctor/types.ts (1)
10-10: LGTM!Also applies to: 74-74
bin/cli/commands/info.ts (1)
4-4: LGTM!Also applies to: 16-21, 62-65, 83-83, 100-104
bin/cli/commands/seek.ts (1)
251-252: LGTM!bin/cli/types.ts (1)
1-4: LGTM!docs/ANTI_SLUDGE_POLICY.md (1)
66-89: LGTM!docs/migrations/v19/README.md (1)
24-27: LGTM!Also applies to: 42-42, 72-76, 243-249
docs/topics/getting-started.md (1)
9-11: LGTM!Also applies to: 12-25, 150-153
docs/topics/querying.md (1)
24-31: LGTM!docs/topics/reference.md (1)
41-85: LGTM!Also applies to: 95-106
scripts/smoke-packed-artifact.sh (1)
40-65: LGTM!scripts/v18.0.0/migrations/graph-model/GraphModelMigrationScratchRuntimeReplayer.ts (1)
17-18: LGTM!Also applies to: 118-125
src/domain/warp/RuntimeHostProduct.ts (1)
5-5: LGTM!Also applies to: 126-131
test/unit/domain/WarpFacade.test.ts (1)
18-19: LGTM!Also applies to: 138-147, 153-167, 178-186, 209-224, 229-235, 276-283, 348-355, 367-373, 480-487, 502-509
test/unit/domain/runtimeProductExecutableSurface.test.ts (1)
18-25: LGTM!Also applies to: 56-73
index.ts (1)
13-13: LGTM!Also applies to: 28-29
package.json (1)
56-56: LGTM!Also applies to: 120-121
src/application/WarpStorage.ts (1)
1-9: LGTM!src/application/WarpStorageRegistry.ts (1)
1-36: LGTM!src/application/openWarp.ts (1)
37-48: LGTM!test/conformance/v18FirstUseOpticsHonesty.test.ts (1)
5-10: LGTM!Also applies to: 128-136, 155-158, 171-171, 181-182
test/integration/application/GitStorage.integration.test.ts (1)
1-31: LGTM!test/unit/application/WarpStorageRegistry.test.ts (1)
1-40: LGTM!scripts/migrations/v17.0.0/fix-imports.ts (1)
28-28: LGTM!src/infrastructure/adapters/GitCasStateCacheIndex.ts (1)
1-159: LGTM!src/infrastructure/adapters/GitCasStateCacheRootSetCoordinator.ts (1)
14-32: LGTM!Also applies to: 53-53, 143-151, 203-203
src/infrastructure/adapters/GitCasWarpStateCacheAdapter.ts (1)
5-111: LGTM!Also applies to: 128-293, 301-313, 326-338, 351-425, 439-468
test/unit/infrastructure/adapters/CasBlobAdapter.test.ts (1)
15-20: LGTM!Also applies to: 62-177, 188-198, 219-251, 267-648, 657-720
test/unit/infrastructure/adapters/CasSeekCacheAdapter.eviction.test.ts (1)
5-22: LGTM!Also applies to: 63-63, 83-83, 110-110, 133-133, 165-165, 185-185
test/unit/infrastructure/adapters/GitCasWarpStateCacheAdapter.retention.test.ts (1)
67-81: LGTM!Also applies to: 140-140, 163-163, 183-183, 203-203, 231-231, 254-254, 276-276, 309-309, 329-329
test/unit/infrastructure/adapters/GitCasWarpStateCacheAdapter.test.ts (1)
11-11: LGTM!Also applies to: 74-103, 191-191, 212-212, 224-224, 233-233, 279-285, 649-649
scripts/v18.0.0/migrations/graph-model/V17RestoredPublicReadLegacyReadingBuilder.ts (1)
17-21: LGTM!Also applies to: 129-129, 142-155
src/infrastructure/adapters/CasBlobAdapter.ts (2)
76-111: LGTM!Also applies to: 123-130, 133-147, 168-176, 192-198, 211-226, 232-235, 247-247
59-68: 🎯 Functional CorrectnessNo issue in
isLegacyBlobErrorThe fallback only runs forErrorinstances, so the predicate stays sound.> Likely an incorrect or invalid review comment.src/infrastructure/adapters/CasSeekCacheAdapter.ts (1)
21-35: LGTM!Also applies to: 109-129, 218-227, 233-234, 258-258, 278-278, 301-301
src/infrastructure/adapters/GitCasRepositoryAdapter.ts (1)
1-100: LGTM!Also applies to: 117-159
test/integration/infrastructure/adapters/GitCasWarpStateCacheAdapter.retention.integration.test.ts (1)
8-10: LGTM!Also applies to: 90-103
test/unit/infrastructure/adapters/GitCasRepositoryAdapter.test.ts (1)
99-178: LGTM!test/unit/infrastructure/adapters/GitGraphAdapter.coverage.test.ts (1)
7-7: LGTM!Also applies to: 30-33, 770-770
test/unit/infrastructure/adapters/GitGraphAdapter.gitCasPersistence.test.ts (1)
2-2: LGTM!Also applies to: 131-135, 149-149, 162-162, 173-176, 197-197, 209-209, 230-230, 242-242
src/domain/RuntimeHost.ts (1)
65-65: LGTM!Also applies to: 179-180, 254-254, 285-285, 513-514
src/domain/services/controllers/ForkController.ts (1)
28-28: LGTM!Also applies to: 49-49, 160-160
src/domain/warp/RuntimeHostBoot.ts (1)
19-19: LGTM!Also applies to: 35-35, 47-48, 79-80, 110-111, 206-206, 279-279, 318-339, 375-376, 394-394
test/benchmark/detachedReadBenchmark.fixture.ts (1)
6-6: LGTM!Also applies to: 20-26, 92-116, 138-144, 196-202, 222-227
test/integration/WarpGraph.integration.test.ts (1)
6-9: LGTM!Also applies to: 21-25, 34-35
test/unit/domain/WarpCore.stateSessionAutoConstruct.test.ts (1)
5-52: LGTM!Also applies to: 90-108, 110-128
test/unit/scripts/v18-v17-public-read-legacy-reading-builder.test.ts (1)
50-50: LGTM!src/infrastructure/adapters/InMemoryBlobStorageAdapter.ts (1)
8-14: LGTM!src/infrastructure/adapters/MemoryRuntimeStorageAdapter.ts (1)
1-65: LGTM!test/helpers/runtimeHostCommitMessageCodecSetup.ts (1)
2-6: LGTM!test/unit/domain/WarpCore.blobAutoConstruct.test.ts (1)
4-43: LGTM!Also applies to: 46-74, 84-110
test/unit/domain/services/TreeConstruction.determinism.test.ts (1)
13-13: LGTM!test/unit/domain/warp/RuntimeHostPortResolvers.test.ts (1)
11-12: LGTM!Also applies to: 99-109, 123-158
test/unit/infrastructure/adapters/InMemoryBlobStorageAdapter.test.ts (1)
3-3: LGTM!src/infrastructure/adapters/GitCommitNodeInfoDecoder.ts (1)
1-29: LGTM!src/infrastructure/adapters/GitTimelineHistoryAdapter.ts (1)
2-2: LGTM!Also applies to: 47-50, 71-71, 80-135, 137-140, 161-170, 181-181, 192-197, 221-221, 249-253, 266-266, 316-316, 407-414
src/infrastructure/adapters/gitErrorClassification.ts (1)
5-5: LGTM!test/helpers/WarpGraphTestRepositories.ts (1)
5-5: LGTM!Also applies to: 14-14, 37-37
test/unit/domain/services/GitGraphAdapter.stress.test.ts (1)
2-4: LGTM!Also applies to: 24-24, 57-57
test/unit/domain/services/GitGraphAdapter.test.ts (1)
2-2: LGTM!Also applies to: 15-18, 33-33, 103-103, 226-226, 333-333, 417-417, 514-514, 601-601, 662-662
test/unit/domain/services/optic/CheckpointTailBasisVerifier.test.ts (1)
14-14: LGTM!Also applies to: 69-69
test/unit/infrastructure/adapters/GitGraphAdapter.commitNodeWithTree.test.ts (1)
2-4: LGTM!Also applies to: 15-15
src/infrastructure/adapters/GitTrustChainAdapter.ts (1)
44-55: LGTM!Also applies to: 160-172, 190-195, 212-212, 249-250, 315-316
src/infrastructure/adapters/InMemoryGraphAdapter.ts (1)
5-5: LGTM!src/infrastructure/adapters/adapterValidation.ts (1)
4-4: LGTM!src/ports/GraphPersistencePort.ts (1)
16-16: LGTM!test/unit/domain/strandAndRuntimeSeams.test.ts (1)
10-10: LGTM!Also applies to: 169-172
test/unit/infrastructure/adapters/GitTrustChainAdapter.test.ts (1)
2-7: LGTM!Also applies to: 31-50, 78-78, 87-88, 148-152, 176-180, 198-232, 259-259, 287-294, 320-324, 337-353, 365-365
test/unit/scripts/non-ts-tail-shape.test.ts (1)
33-33: LGTM!src/infrastructure/adapters/PlumbingHookPathAdapter.ts (2)
1-1: LGTM!
17-38: LGTM!storage.ts (2)
1-40: LGTM!
43-55: LGTM!test/type-check/plumbing-declarations.d.ts (1)
1-24: LGTM!test/type-check/tsconfig.json (1)
12-12: LGTM!test/type-check/v19-consumer.ts (1)
32-39: LGTM!test/type-check/v19-first-use.ts (1)
9-12: LGTM!test/type-check/v19-subpaths.ts (2)
9-20: LGTM!
29-30: LGTM!test/unit/infrastructure/adapters/PlumbingHookPathAdapter.test.ts (1)
26-26: LGTM!test/bats/helpers/seed-setup.ts (2)
22-51: LGTM!
52-67: 🗄️ Data Integrity & IntegrationNo remaining
plumbingimport from this helper
Alltest/bats/helpersconsumers already importopenGraphorcreateTrustChain;plumbingis only used internally inseed-setup.ts.> Likely an incorrect or invalid review comment.test/bats/helpers/seed-trust-sync.ts (1)
16-16: LGTM!Also applies to: 38-38
test/bats/helpers/seed-trust.ts (1)
15-15: LGTM!Also applies to: 37-37
test/runtime/deno/deno.json (1)
4-5: LGTM!test/runtime/deno/helpers.ts (3)
35-35: 📐 Maintainability & Code Quality | 💤 Low valueStale variable name after adapter rename.
gitGraphAdapterModulenow holds the dynamically-importedGitTimelineHistoryAdaptermodule; the name still reflects the removedGitGraphAdapter.✏️ Proposed rename
- const gitGraphAdapterModule = (await import(join(root, "src/infrastructure/adapters/GitTimelineHistoryAdapter.ts"))).default; + const gitTimelineHistoryAdapterModule = (await import(join(root, "src/infrastructure/adapters/GitTimelineHistoryAdapter.ts"))).default; const gitCasRepositoryAdapterModule = (await import(join(root, "src/infrastructure/adapters/GitCasRepositoryAdapter.ts"))).default; const warpCoreModule = (await import(join(root, "src/domain/WarpCore.ts"))).default; const webCryptoAdapterModule = (await import(join(root, "src/infrastructure/adapters/WebCryptoAdapter.ts"))).default; runtimeDefaultsModule.installDefaultRuntimeHostBrowserPorts(); Plumbing = plumbingModule; - GitTimelineHistoryAdapter = gitGraphAdapterModule; + GitTimelineHistoryAdapter = gitTimelineHistoryAdapterModule;
47-72: LGTM!
13-15: 🩺 Stability & AvailabilityNo change needed for
GitTimelineHistoryAdapter: any; thedeno-lint-ignore no-explicit-anycomment is already in place.> Likely an incorrect or invalid review comment.test/unit/infrastructure/adapters/CasSeekCacheAdapter.test.ts (2)
9-41: LGTM!
186-203: LGTM!Also applies to: 264-285, 469-504, 728-736
test/unit/scripts/v19-public-api-boundary.test.ts (1)
49-49: LGTM!Also applies to: 217-218, 265-270
test/integration/api/helpers/setup.ts (1)
11-12: LGTM!Also applies to: 33-34, 43-59
Final-head self-review at
|
Final-head Code Lawyer review at
|
Release Preflight
If this PR is from a |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/infrastructure/adapters/GitCasWarpStateCacheAdapter.ts (1)
251-270: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick winDon't let
lastAccessedAtbookkeeping failures fail an otherwise-successful cache read.
_loadSnapshotStateawaits the_mutateIndexcall that bumpslastAccessedAtbefore returning the decoded record. If that write fails (e.g., CAS retries exhausted under concurrent writers), the error propagates through_loadTrackedSnapshot— since it isn't one of the 3 evictable codes, it gets rethrown — andgetExact/getBestCompatiblePredecessor/resolveCheckpointHeadfail even though the snapshot state was already successfully restored and decoded. This is a purely cosmetic LRU-heuristic update; it shouldn't gate a successful read.🛡️ Proposed fix: make the lastAccessedAt update best-effort
const buffer = await this._restoreBuffer(cas, restoreOpts); const state = decodeWarpFullState(buffer, this._codec); - await this._mutateIndex((idx) => { - const tracked = idx.snapshots[record.snapshotId]; - if (tracked !== null && tracked !== undefined) { - tracked.lastAccessedAt = new Date().toISOString(); - } - return idx; - }); + try { + await this._mutateIndex((idx) => { + const tracked = idx.snapshots[record.snapshotId]; + if (tracked !== null && tracked !== undefined) { + tracked.lastAccessedAt = new Date().toISOString(); + } + return idx; + }); + } catch { + // lastAccessedAt is a retention heuristic only; a failed bump must not + // fail an already-successful read. + } return { ...record, state };🤖 Prompt for 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. In `@src/infrastructure/adapters/GitCasWarpStateCacheAdapter.ts` around lines 251 - 270, Make the _mutateIndex call in _loadSnapshotState best-effort so failures updating tracked.lastAccessedAt are caught and do not prevent returning the successfully restored and decoded snapshot record. Preserve propagation of errors from manifest reading, buffer restoration, and state decoding.
🤖 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.
Outside diff comments:
In `@src/infrastructure/adapters/GitCasWarpStateCacheAdapter.ts`:
- Around line 251-270: Make the _mutateIndex call in _loadSnapshotState
best-effort so failures updating tracked.lastAccessedAt are caught and do not
prevent returning the successfully restored and decoded snapshot record.
Preserve propagation of errors from manifest reading, buffer restoration, and
state decoding.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: c9076305-8e7c-4465-857f-41631d970dc7
📒 Files selected for processing (106)
src/application/RuntimeHostNodeDefaults.tssrc/application/openWarp.tssrc/domain/WarpGraph.tssrc/domain/warp/RuntimeHostBoot.tssrc/domain/warp/RuntimeHostPortResolvers.tssrc/infrastructure/adapters/CasBlobAdapter.tssrc/infrastructure/adapters/GitCasRepositoryAdapter.tssrc/infrastructure/adapters/GitCasStateCacheIndexCodec.tssrc/infrastructure/adapters/GitCasWarpStateCacheAdapter.tssrc/infrastructure/adapters/TrailerCommitMessageCodecAdapter.tssrc/ports/CommitMessageCodecPort.tstest/conformance/fixtures/V17CheckpointTailOpticGraphFixture.tstest/conformance/post-v17/graphQueryBoundedProvider.blocked.test.tstest/conformance/v18BoundedMemoryLargeGraphGate.test.tstest/conformance/v18CoordinateOpticPublicPath.test.tstest/conformance/v18FirstUseOpticsHonesty.test.tstest/helpers/MemoryRuntimeHost.tstest/unit/domain/WarpApp.facade.test.tstest/unit/domain/WarpCore.apiSurface.test.tstest/unit/domain/WarpCore.blobAutoConstruct.test.tstest/unit/domain/WarpCore.effectPipeline.test.tstest/unit/domain/WarpCore.emit.test.tstest/unit/domain/WarpCore.snapshotHashStability.test.tstest/unit/domain/WarpFacade.test.tstest/unit/domain/WarpGraph.adjacencyCache.test.tstest/unit/domain/WarpGraph.audit.test.tstest/unit/domain/WarpGraph.autoCheckpoint.test.tstest/unit/domain/WarpGraph.autoGC.test.tstest/unit/domain/WarpGraph.autoMaterialize.test.tstest/unit/domain/WarpGraph.autoMaterializeRemove.test.tstest/unit/domain/WarpGraph.backfill.test.tstest/unit/domain/WarpGraph.cascadeDelete.test.tstest/unit/domain/WarpGraph.checkpoint.test.tstest/unit/domain/WarpGraph.checkpointPolicy.test.tstest/unit/domain/WarpGraph.conflicts.test.tstest/unit/domain/WarpGraph.content.test.tstest/unit/domain/WarpGraph.coverageGaps.test.tstest/unit/domain/WarpGraph.deleteGuard.test.tstest/unit/domain/WarpGraph.deleteGuardEnforce.test.tstest/unit/domain/WarpGraph.edgePropVisibility.test.tstest/unit/domain/WarpGraph.edgeProps.test.tstest/unit/domain/WarpGraph.encryption.test.tstest/unit/domain/WarpGraph.errorCodes.test.tstest/unit/domain/WarpGraph.fork.test.tstest/unit/domain/WarpGraph.forkCryptoCodec.test.tstest/unit/domain/WarpGraph.frontierChanged.test.tstest/unit/domain/WarpGraph.invalidation.test.tstest/unit/domain/WarpGraph.lazyMaterialize.test.tstest/unit/domain/WarpGraph.materializeSlice.test.tstest/unit/domain/WarpGraph.noCoordination.test.tstest/unit/domain/WarpGraph.observerBoundary.test.tstest/unit/domain/WarpGraph.patchCount.test.tstest/unit/domain/WarpGraph.patchMany.test.tstest/unit/domain/WarpGraph.patchesFor.test.tstest/unit/domain/WarpGraph.public-sync.test.tstest/unit/domain/WarpGraph.query.test.tstest/unit/domain/WarpGraph.queryBuilder.compass.test.tstest/unit/domain/WarpGraph.queryBuilder.test.tstest/unit/domain/WarpGraph.receipts.test.tstest/unit/domain/WarpGraph.seek.test.tstest/unit/domain/WarpGraph.seekDiff.test.tstest/unit/domain/WarpGraph.serve.test.tstest/unit/domain/WarpGraph.status.test.tstest/unit/domain/WarpGraph.strands.compare.test.tstest/unit/domain/WarpGraph.strands.intents.test.tstest/unit/domain/WarpGraph.strands.test.tstest/unit/domain/WarpGraph.subscribe.test.tstest/unit/domain/WarpGraph.syncAuth.test.tstest/unit/domain/WarpGraph.syncMaterialize.test.tstest/unit/domain/WarpGraph.syncWith.test.tstest/unit/domain/WarpGraph.test.tstest/unit/domain/WarpGraph.traverse.stream.test.tstest/unit/domain/WarpGraph.traverse.test.tstest/unit/domain/WarpGraph.versionVector.test.tstest/unit/domain/WarpGraph.watch.test.tstest/unit/domain/WarpGraph.worldline.test.tstest/unit/domain/WarpGraph.writerApi.test.tstest/unit/domain/WarpGraph.writerInvalidation.test.tstest/unit/domain/WarpWorldline.test.tstest/unit/domain/internalReadingSurface.behavior.test.tstest/unit/domain/runtimeProductExecutableSurface.test.tstest/unit/domain/runtimeReadingBasisErrors.test.tstest/unit/domain/seekCache.test.tstest/unit/domain/services/BisectService.test.tstest/unit/domain/services/Observer.test.tstest/unit/domain/services/TranslationCost.test.tstest/unit/domain/services/WarpMessageCodec.test.tstest/unit/domain/strandAndRuntimeSeams.test.tstest/unit/domain/warp/RuntimeHostPortResolvers.test.tstest/unit/domain/warp/WarpGraphRuntimeBridge.test.tstest/unit/domain/warp/WarpOpenOptions.test.tstest/unit/domain/warp/Writer.sameWriterRace.test.tstest/unit/domain/warp/buildView.test.tstest/unit/domain/worldlineExecutableExamples.test.tstest/unit/domain/worldlineReadExecutablePaths.test.tstest/unit/infrastructure/adapters/CasBlobAdapter.test.tstest/unit/infrastructure/adapters/CborPatchJournalAdapter.test.tstest/unit/infrastructure/adapters/GitCasStateCacheIndexCodec.test.tstest/unit/infrastructure/adapters/GitCasWarpStateCacheAdapter.test.tstest/unit/infrastructure/adapters/GitTimelineHistoryAdapter.listRefs.test.tstest/unit/infrastructure/adapters/InMemoryGraphAdapter.browser.test.tstest/unit/infrastructure/adapters/InMemoryGraphAdapter.integration.test.tstest/unit/scripts/openwarpgraph-composition-root.test.tstest/unit/scripts/openwarpruntime-bridge-closeout.test.tstest/unit/scripts/v19-public-api-boundary.test.tstest/unit/v7-guards.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 (5)
**/*.{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/domain/WarpGraph.checkpointPolicy.test.tstest/unit/domain/WarpGraph.patchMany.test.tstest/unit/domain/warp/WarpGraphRuntimeBridge.test.tstest/unit/domain/WarpApp.facade.test.tstest/unit/domain/WarpGraph.autoMaterialize.test.tstest/unit/domain/WarpGraph.autoMaterializeRemove.test.tstest/unit/domain/WarpGraph.materializeSlice.test.tstest/unit/domain/WarpGraph.cascadeDelete.test.tstest/unit/domain/WarpGraph.adjacencyCache.test.tstest/unit/domain/WarpGraph.patchCount.test.tstest/unit/domain/worldlineReadExecutablePaths.test.tstest/unit/domain/WarpGraph.seek.test.tstest/unit/domain/WarpGraph.edgePropVisibility.test.tstest/unit/domain/services/BisectService.test.tstest/unit/infrastructure/adapters/GitTimelineHistoryAdapter.listRefs.test.tstest/unit/infrastructure/adapters/InMemoryGraphAdapter.integration.test.tstest/unit/domain/WarpGraph.subscribe.test.tstest/unit/domain/WarpGraph.invalidation.test.tstest/unit/domain/WarpGraph.deleteGuardEnforce.test.tstest/unit/domain/WarpGraph.writerApi.test.tstest/unit/domain/warp/buildView.test.tstest/unit/domain/WarpGraph.audit.test.tstest/conformance/post-v17/graphQueryBoundedProvider.blocked.test.tstest/unit/domain/WarpGraph.patchesFor.test.tstest/unit/domain/WarpGraph.strands.compare.test.tstest/unit/domain/WarpGraph.query.test.tstest/unit/domain/WarpCore.apiSurface.test.tssrc/infrastructure/adapters/TrailerCommitMessageCodecAdapter.tstest/unit/domain/WarpGraph.queryBuilder.compass.test.tstest/unit/domain/WarpGraph.status.test.tstest/unit/domain/WarpGraph.lazyMaterialize.test.tstest/unit/v7-guards.test.tstest/unit/domain/services/Observer.test.tstest/conformance/v18BoundedMemoryLargeGraphGate.test.tstest/conformance/fixtures/V17CheckpointTailOpticGraphFixture.tstest/unit/domain/WarpGraph.receipts.test.tstest/unit/domain/WarpGraph.fork.test.tstest/unit/domain/WarpGraph.backfill.test.tstest/unit/domain/seekCache.test.tstest/unit/domain/WarpGraph.writerInvalidation.test.tstest/unit/domain/WarpGraph.syncMaterialize.test.tstest/unit/scripts/openwarpgraph-composition-root.test.tstest/unit/domain/WarpGraph.test.tstest/unit/domain/WarpCore.emit.test.tstest/unit/domain/WarpGraph.noCoordination.test.tstest/unit/domain/WarpGraph.strands.test.tstest/unit/domain/WarpGraph.traverse.test.tstest/unit/domain/WarpGraph.strands.intents.test.tstest/conformance/v18CoordinateOpticPublicPath.test.tstest/unit/domain/WarpGraph.traverse.stream.test.tstest/unit/domain/WarpGraph.deleteGuard.test.tstest/unit/domain/WarpGraph.content.test.tstest/unit/scripts/openwarpruntime-bridge-closeout.test.tstest/unit/infrastructure/adapters/GitCasStateCacheIndexCodec.test.tstest/unit/infrastructure/adapters/CborPatchJournalAdapter.test.tstest/unit/domain/warp/Writer.sameWriterRace.test.tstest/unit/domain/WarpGraph.encryption.test.tstest/unit/domain/WarpGraph.seekDiff.test.tstest/unit/domain/WarpGraph.queryBuilder.test.tstest/unit/domain/WarpGraph.forkCryptoCodec.test.tssrc/ports/CommitMessageCodecPort.tstest/unit/domain/WarpGraph.checkpoint.test.tstest/unit/domain/WarpGraph.edgeProps.test.tstest/unit/domain/WarpCore.snapshotHashStability.test.tstest/unit/domain/WarpGraph.versionVector.test.tstest/unit/domain/runtimeReadingBasisErrors.test.tstest/unit/domain/WarpGraph.syncWith.test.tstest/unit/domain/WarpWorldline.test.tstest/unit/domain/WarpGraph.public-sync.test.tstest/unit/domain/WarpGraph.autoCheckpoint.test.tstest/helpers/MemoryRuntimeHost.tstest/unit/domain/WarpGraph.syncAuth.test.tstest/unit/infrastructure/adapters/InMemoryGraphAdapter.browser.test.tstest/unit/domain/WarpGraph.autoGC.test.tstest/unit/domain/WarpGraph.observerBoundary.test.tstest/unit/domain/WarpCore.effectPipeline.test.tstest/unit/domain/services/TranslationCost.test.tstest/unit/domain/worldlineExecutableExamples.test.tstest/unit/domain/WarpGraph.worldline.test.tstest/unit/domain/WarpGraph.errorCodes.test.tstest/unit/domain/warp/WarpOpenOptions.test.tstest/unit/domain/WarpGraph.coverageGaps.test.tstest/unit/domain/runtimeProductExecutableSurface.test.tstest/unit/domain/WarpGraph.frontierChanged.test.tstest/unit/domain/internalReadingSurface.behavior.test.tstest/unit/domain/WarpGraph.watch.test.tstest/unit/domain/services/WarpMessageCodec.test.tssrc/domain/warp/RuntimeHostPortResolvers.tstest/unit/domain/strandAndRuntimeSeams.test.tssrc/infrastructure/adapters/GitCasStateCacheIndexCodec.tstest/unit/domain/WarpGraph.conflicts.test.tssrc/application/openWarp.tstest/unit/scripts/v19-public-api-boundary.test.tstest/unit/domain/WarpCore.blobAutoConstruct.test.tssrc/application/RuntimeHostNodeDefaults.tstest/unit/domain/warp/RuntimeHostPortResolvers.test.tstest/unit/domain/WarpGraph.serve.test.tstest/conformance/v18FirstUseOpticsHonesty.test.tstest/unit/domain/WarpFacade.test.tssrc/domain/WarpGraph.tssrc/infrastructure/adapters/GitCasRepositoryAdapter.tssrc/infrastructure/adapters/GitCasWarpStateCacheAdapter.tssrc/infrastructure/adapters/CasBlobAdapter.tstest/unit/infrastructure/adapters/GitCasWarpStateCacheAdapter.test.tstest/unit/infrastructure/adapters/CasBlobAdapter.test.tssrc/domain/warp/RuntimeHostBoot.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/TrailerCommitMessageCodecAdapter.tssrc/ports/CommitMessageCodecPort.tssrc/domain/warp/RuntimeHostPortResolvers.tssrc/infrastructure/adapters/GitCasStateCacheIndexCodec.tssrc/application/openWarp.tssrc/application/RuntimeHostNodeDefaults.tssrc/domain/WarpGraph.tssrc/infrastructure/adapters/GitCasRepositoryAdapter.tssrc/infrastructure/adapters/GitCasWarpStateCacheAdapter.tssrc/infrastructure/adapters/CasBlobAdapter.tssrc/domain/warp/RuntimeHostBoot.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/CommitMessageCodecPort.ts
src/domain/**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
src/domain/**/*.{ts,tsx,js,jsx}: Insrc/domain/**, do not useDate.now(),new Date(),Date(),performance.now(),Math.random(),crypto.randomUUID(),crypto.getRandomValues(),setTimeout,setInterval, rawnew Error(...)/new TypeError(...), or direct imports from Node built-ins; time, entropy, and external capabilities must enter through ports or parameters, and domain errors should extendWarpError.
Construct domain objects only in core when doing so establishes validated runtime truth; do not build infrastructure adapters, host APIs, persistence implementations, wall clocks, or entropy sources inside core.
Prefer discriminated unions and explicit result types instead of boolean-flag bags, and model expected failures as return values rather than exceptions.
src/domain/must not import host APIs or Node-specific globals; hexagonal architecture boundaries are mandatory.
Domain code must not use the wall clock directly; time must enter through a port or parameter.
Files:
src/domain/warp/RuntimeHostPortResolvers.tssrc/domain/WarpGraph.tssrc/domain/warp/RuntimeHostBoot.ts
src/domain/**/!(*.test).{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
Use explicit domain concepts with validated constructors,
Object.freeze, andinstanceofdispatch; domain objects should be runtime-backed nouns, not ad hoc shape bags.
Files:
src/domain/warp/RuntimeHostPortResolvers.tssrc/domain/WarpGraph.tssrc/domain/warp/RuntimeHostBoot.ts
🔇 Additional comments (108)
src/application/RuntimeHostNodeDefaults.ts (1)
2-45: LGTM!test/unit/domain/WarpGraph.public-sync.test.ts (1)
2-2: LGTM!test/unit/domain/WarpGraph.query.test.ts (1)
13-13: LGTM!test/unit/domain/WarpGraph.queryBuilder.compass.test.ts (1)
2-2: LGTM!test/unit/domain/WarpGraph.queryBuilder.test.ts (1)
2-2: LGTM!test/unit/domain/WarpGraph.seek.test.ts (1)
2-2: LGTM!test/unit/domain/WarpGraph.seekDiff.test.ts (1)
2-2: LGTM!test/unit/scripts/openwarpruntime-bridge-closeout.test.ts (1)
6-6: LGTM!Also applies to: 50-50
src/application/openWarp.ts (1)
7-7: LGTM!Also applies to: 19-19, 31-34, 41-52
test/conformance/fixtures/V17CheckpointTailOpticGraphFixture.ts (1)
6-6: LGTM!test/conformance/post-v17/graphQueryBoundedProvider.blocked.test.ts (1)
2-2: LGTM!test/conformance/v18BoundedMemoryLargeGraphGate.test.ts (1)
6-6: LGTM!test/conformance/v18CoordinateOpticPublicPath.test.ts (1)
3-6: LGTM!test/conformance/v18FirstUseOpticsHonesty.test.ts (1)
8-8: LGTM!Also applies to: 128-137, 155-158, 171-171, 181-182
test/unit/domain/WarpFacade.test.ts (1)
17-17: LGTM!Also applies to: 139-145, 153-159, 179-184, 209-224, 229-235, 277-283, 349-354, 369-374, 482-487, 505-509
src/domain/WarpGraph.ts (1)
37-45: LGTM!Also applies to: 142-142, 158-159
src/ports/CommitMessageCodecPort.ts (1)
47-58: LGTM!test/unit/domain/services/TranslationCost.test.ts (1)
2-2: LGTM!test/unit/domain/services/WarpMessageCodec.test.ts (1)
884-884: LGTM!test/unit/domain/strandAndRuntimeSeams.test.ts (1)
3-12: LGTM!Also applies to: 51-51, 171-174
test/unit/infrastructure/adapters/InMemoryGraphAdapter.browser.test.ts (1)
4-4: LGTM!test/unit/infrastructure/adapters/InMemoryGraphAdapter.integration.test.ts (1)
3-3: LGTM!test/unit/scripts/openwarpgraph-composition-root.test.ts (1)
5-5: LGTM!src/domain/warp/RuntimeHostBoot.ts (2)
9-10: LGTM!Also applies to: 19-19, 35-35, 47-48, 79-80, 110-111, 147-149, 206-206, 310-336, 391-391
369-385: 🎯 Functional CorrectnessConfirm the
storageServices.trie-absent path. Iftriecan be absent, this branch no longer creates a session opener, so materialization and state reads need another path to handle that case.test/unit/domain/warp/WarpGraphRuntimeBridge.test.ts (1)
3-3: LGTM!Also applies to: 11-16
test/unit/domain/warp/WarpOpenOptions.test.ts (1)
11-11: LGTM!Also applies to: 82-85, 97-100, 111-124
test/unit/domain/warp/Writer.sameWriterRace.test.ts (1)
3-3: LGTM!test/unit/domain/warp/buildView.test.ts (1)
3-3: LGTM!test/unit/domain/worldlineReadExecutablePaths.test.ts (1)
4-7: LGTM!test/unit/infrastructure/adapters/GitTimelineHistoryAdapter.listRefs.test.ts (1)
1-222: LGTM!test/unit/scripts/v19-public-api-boundary.test.ts (1)
49-49: LGTM!Also applies to: 217-218, 264-281
src/domain/warp/RuntimeHostPortResolvers.ts (1)
7-13: LGTM!Also applies to: 85-95
test/unit/domain/WarpGraph.traverse.stream.test.ts (1)
3-3: LGTM!test/unit/domain/WarpGraph.traverse.test.ts (1)
2-2: LGTM!test/unit/domain/WarpGraph.watch.test.ts (1)
2-2: LGTM!test/unit/domain/WarpGraph.writerApi.test.ts (1)
2-2: LGTM!test/unit/domain/WarpGraph.writerInvalidation.test.ts (1)
2-2: LGTM!test/unit/domain/warp/RuntimeHostPortResolvers.test.ts (1)
11-12: LGTM!Also applies to: 99-109, 123-129, 131-144
src/infrastructure/adapters/CasBlobAdapter.ts (1)
16-32: LGTM!Also applies to: 58-70, 87-122, 134-147, 182-190, 206-209, 225-225, 246-249, 261-261
test/unit/domain/WarpGraph.serve.test.ts (1)
2-2: LGTM!Also applies to: 6-22
test/unit/domain/WarpGraph.status.test.ts (1)
2-2: LGTM!test/unit/domain/WarpGraph.subscribe.test.ts (1)
2-2: LGTM!test/unit/domain/WarpGraph.syncAuth.test.ts (1)
2-2: LGTM!test/unit/domain/WarpGraph.syncMaterialize.test.ts (1)
2-2: LGTM!test/unit/domain/WarpGraph.syncWith.test.ts (1)
3-3: LGTM!test/unit/infrastructure/adapters/CasBlobAdapter.test.ts (1)
3-21: LGTM!Also applies to: 22-26, 55-65, 67-186, 188-223, 225-467, 467-536, 536-556, 557-662, 663-704, 705-745, 746-748
src/infrastructure/adapters/GitCasRepositoryAdapter.ts (1)
114-114: LGTM!test/unit/domain/WarpGraph.checkpointPolicy.test.ts (1)
2-2: LGTM!test/unit/domain/WarpGraph.content.test.ts (1)
2-2: LGTM!test/unit/domain/WarpGraph.deleteGuard.test.ts (1)
2-2: LGTM!test/unit/domain/WarpGraph.deleteGuardEnforce.test.ts (1)
2-2: LGTM!test/unit/domain/WarpGraph.edgePropVisibility.test.ts (1)
2-2: LGTM!test/unit/domain/WarpGraph.edgeProps.test.ts (1)
2-2: LGTM!src/infrastructure/adapters/GitCasStateCacheIndexCodec.ts (1)
1-254: LGTM!src/infrastructure/adapters/GitCasWarpStateCacheAdapter.ts (1)
5-52: LGTM! Eviction is now correctly narrowed to confirmed missing/corrupt CAS payload errors, and index reads/writes go through the new typed codec.Also applies to: 63-249, 272-413
test/unit/domain/WarpGraph.lazyMaterialize.test.ts (1)
2-2: LGTM!test/unit/domain/WarpGraph.materializeSlice.test.ts (1)
2-2: LGTM!test/unit/domain/WarpGraph.noCoordination.test.ts (1)
3-3: LGTM!test/unit/domain/WarpGraph.patchCount.test.ts (1)
2-2: LGTM!test/unit/domain/WarpGraph.patchMany.test.ts (1)
2-2: LGTM!test/unit/domain/WarpGraph.patchesFor.test.ts (1)
2-2: LGTM!src/infrastructure/adapters/TrailerCommitMessageCodecAdapter.ts (1)
240-240: LGTM!test/unit/domain/WarpGraph.autoCheckpoint.test.ts (1)
2-2: LGTM!test/unit/domain/WarpGraph.conflicts.test.ts (1)
4-4: LGTM!Also applies to: 139-139
test/unit/domain/WarpGraph.strands.intents.test.ts (1)
5-6: LGTM!Also applies to: 156-156
test/unit/domain/WarpGraph.strands.test.ts (1)
5-5: LGTM!Also applies to: 155-155
test/unit/domain/WarpGraph.worldline.test.ts (1)
5-5: LGTM!Also applies to: 155-155
test/unit/domain/runtimeReadingBasisErrors.test.ts (1)
2-8: LGTM!test/unit/infrastructure/adapters/CborPatchJournalAdapter.test.ts (1)
299-299: LGTM!Also applies to: 317-317
test/helpers/MemoryRuntimeHost.ts (1)
1-59: LGTM!test/unit/domain/WarpApp.facade.test.ts (1)
6-10: LGTM!Also applies to: 47-52
test/unit/domain/WarpCore.apiSurface.test.ts (1)
3-4: LGTM!Also applies to: 16-16
test/unit/domain/WarpCore.snapshotHashStability.test.ts (1)
3-5: LGTM!Also applies to: 183-185
test/unit/domain/WarpGraph.observerBoundary.test.ts (1)
5-5: LGTM!Also applies to: 160-160
test/unit/domain/WarpGraph.strands.compare.test.ts (1)
5-6: LGTM!Also applies to: 153-153
test/unit/domain/internalReadingSurface.behavior.test.ts (1)
5-10: LGTM!Also applies to: 75-75, 97-97
test/unit/v7-guards.test.ts (1)
2-8: LGTM!test/unit/domain/WarpCore.blobAutoConstruct.test.ts (1)
2-19: LGTM!Also applies to: 44-74, 84-110
test/unit/domain/WarpCore.effectPipeline.test.ts (1)
2-11: LGTM!test/unit/domain/WarpCore.emit.test.ts (1)
2-10: LGTM!Also applies to: 179-179
test/unit/domain/WarpGraph.adjacencyCache.test.ts (1)
2-2: LGTM!test/unit/domain/WarpGraph.audit.test.ts (1)
9-9: LGTM!test/unit/domain/WarpGraph.autoGC.test.ts (1)
2-2: LGTM!test/unit/domain/WarpGraph.autoMaterialize.test.ts (1)
2-2: LGTM!test/unit/domain/WarpGraph.autoMaterializeRemove.test.ts (1)
2-2: LGTM!test/unit/domain/WarpGraph.backfill.test.ts (1)
2-2: LGTM!test/unit/domain/WarpGraph.cascadeDelete.test.ts (1)
2-2: LGTM!test/unit/domain/WarpGraph.checkpoint.test.ts (1)
2-2: LGTM!test/unit/domain/WarpGraph.coverageGaps.test.ts (1)
2-2: LGTM!test/unit/domain/WarpGraph.receipts.test.ts (1)
13-13: LGTM!test/unit/domain/WarpGraph.test.ts (1)
2-2: LGTM!test/unit/domain/WarpGraph.versionVector.test.ts (1)
2-2: LGTM!test/unit/domain/WarpGraph.encryption.test.ts (1)
8-8: LGTM!test/unit/domain/WarpGraph.errorCodes.test.ts (1)
2-2: LGTM!test/unit/domain/WarpGraph.fork.test.ts (1)
2-2: LGTM!test/unit/domain/WarpGraph.forkCryptoCodec.test.ts (1)
2-2: LGTM!test/unit/domain/WarpGraph.frontierChanged.test.ts (1)
2-2: LGTM!test/unit/domain/WarpGraph.invalidation.test.ts (1)
2-2: LGTM!test/unit/infrastructure/adapters/GitCasWarpStateCacheAdapter.test.ts (2)
74-159: LGTM!
342-761: LGTM!test/unit/domain/WarpWorldline.test.ts (1)
5-5: LGTM!test/unit/domain/runtimeProductExecutableSurface.test.ts (1)
3-3: LGTM!Also applies to: 18-25, 56-73
test/unit/domain/seekCache.test.ts (1)
2-2: LGTM!test/unit/domain/services/BisectService.test.ts (1)
2-2: LGTM!test/unit/domain/services/Observer.test.ts (1)
2-2: LGTM!test/unit/domain/worldlineExecutableExamples.test.ts (1)
6-12: LGTM!Also applies to: 250-250
test/unit/infrastructure/adapters/GitCasStateCacheIndexCodec.test.ts (1)
1-88: LGTM!
Summary
WarpStoragehandle and supportedGitStorage.open()/MemoryStorage.create()constructorsGitStorage, sharing the same Git plumbing instance with repository toolingAcceptance evidence
The root opener accepts only an opaque storage handle and forwards its hidden history/runtime binding into each timeline. [cite:
src/application/WarpStorage.ts#1-8@310955b27] [cite:src/application/openWarp.ts#11-34@310955b27]GitStorage.open()creates one plumbing instance, oneGitTimelineHistoryAdapter, and oneGitCasRepositoryAdapter;MemoryStorage.create()provides the same opaque application boundary. [cite:storage.ts#18-53@310955b27]The repository adapter creates one CDC git-cas facade and shares it across content, patch, index, state-snapshot, seek-cache, and trust services. [cite:
src/infrastructure/adapters/GitCasRepositoryAdapter.ts#47-86@310955b27] [cite:src/infrastructure/adapters/GitCasRepositoryAdapter.ts#89-157@310955b27]Runtime boot resolves an injected semantic storage provider and consumes its services without importing or constructing concrete storage adapters. [cite:
src/domain/warp/RuntimeHostBoot.ts#310-339@310955b27]The packed-artifact smoke enforces the v19 root/storage values, absence of
openWarpGraph, and working installed hook template. [cite:scripts/smoke-packed-artifact.sh#39-64@310955b27]Related debt closeout
#174 is resolved:
runtimeHelpersno longer imports or constructs blob/index infrastructure, while runtime boot obtains those capabilities from the injected provider. [cite:src/domain/runtimeHelpers.ts#10-38@310955b27] [cite:src/domain/warp/RuntimeHostBoot.ts#314-339@310955b27]#182 is resolved: runtime storage selection is explicit, fails closed when absent, and no longer reflects over persistence or dynamically imports storage adapters. [cite:
src/domain/warp/RuntimeHostPortResolvers.ts#95-108@310955b27] [cite:src/domain/warp/RuntimeHostBoot.ts#314-339@310955b27]Validation
npm run prepacknpm run test:coverage:ci(92.62% lines globally; 100% of changed executable statements)npx vitest run test/integration --maxWorkers=1(98 tests)PATH="$PWD/bin:$PATH" bats test/bats/(110 tests)bash scripts/smoke-packed-artifact.shnpm run lint:quarantine-graduateCloses #735
Closes #174
Closes #182