Skip to content

Read retained properties through git-cas 6.5#762

Merged
flyingrobots merged 5 commits into
mainfrom
v19-retained-property-read
Jul 18, 2026
Merged

Read retained properties through git-cas 6.5#762
flyingrobots merged 5 commits into
mainfrom
v19-retained-property-read

Conversation

@flyingrobots

@flyingrobots flyingrobots commented Jul 18, 2026

Copy link
Copy Markdown
Member

Summary

  • retain independent node/property materialization roots through scoped git-cas workspaces
  • read bundle member references lazily through git-cas 6.5 without recursively hydrating bundle payloads
  • reuse one runtime-owned git-cas cache acquisition for the current coordinate and retire it after in-flight readers finish
  • release local retention resources through idempotent RuntimeHost.close()
  • preserve bounded CBOR, shard-schema, storage-policy, and lifecycle validation on retained reads

Issue

Refs #738.
Refs #739.
Refs #742.

This slice does not close those issues: incremental materialization still needs compatible-predecessor resume, and whole-state compatibility paths still exist.

Test plan

  • npm run typecheck
  • npm run lint
  • npm run lint:md
  • npm run typecheck:surface
  • npm run test:coverage:ci: 586 files passed, 1 skipped; 7,222 tests passed, 2 skipped; 92.90% line coverage
  • focused retained-materialization, storage-contract, and lazy-reference tests: 68 passed
  • independent wet-run determinism executions: 9 tests passed
  • pre-push static and test firewall before merge

ADR checks

  • This PR does not implement ADR 2 without satisfying ADR 3
  • Persisted op formats are unchanged; no ADR 3 readiness issue is required
  • Wire compatibility is unchanged; canonical-only wire behavior is unaffected
  • Patch and checkpoint schema namespaces are unchanged

@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added fast reads for node properties from retained materializations without requiring full state reconstruction.
    • Added support for retaining and promoting property data alongside other materialized graph roots.
    • Added clean runtime shutdown to release local materialization resources safely.
  • Bug Fixes

    • Improved property-shard routing and compatibility with special property names.
    • Added size and structure safeguards to reject malformed or excessively large property data.
    • Strengthened materialization validation and retention handling.
  • Documentation

    • Expanded guidance on retained reads, resource lifecycles, limits, and current limitations.

Walkthrough

Changes

The PR adds exact retained node-property reads using bounded, collision-safe shards; stages trie and property artifacts through git-cas workspaces; migrates materialization descriptors and cache keys to schema v3; and adds lifecycle, validation, pruning, and integration coverage.

Retained property read flow

Layer / File(s) Summary
Property read contracts and orchestration
src/domain/RuntimeHost.ts, src/domain/materialization/*, src/domain/services/controllers/*, src/ports/*
Runtime and query layers expose tri-state retained property reads, compare materialization roots, and release acquisitions safely.
Property shard formats and bounded decoding
src/domain/materialization/*, src/domain/services/index/*, src/infrastructure/adapters/*, src/ports/IndexStorePort.ts
Property shards use deterministic routing and schema-v2 entry bags with shard-size, shard-count, chunk, and CBOR structure limits across asset- and page-backed members.
Workspace staging and materialization retention
src/domain/orset/*, src/infrastructure/adapters/GitCasMaterialization*, src/infrastructure/adapters/GitCasTrieStoreAdapter.ts
Trie and property artifacts are staged, checkpointed, promoted, and released through git-cas workspaces; schema-v3 retention preserves legacy anchors until successful promotion.
Validation and integration coverage
test/helpers/*, test/unit/*, test/integration/*
Tests cover exact property reads, malformed shards, staging, pruning, workspace witnesses, cache migration, and acquisition lifecycle behavior.
Documentation and supporting updates
CHANGELOG.md, docs/topics/..., package.json, vitest.config.ts
Documentation, dependency versions, coverage thresholds, and deterministic fixture expectations are updated for the new behavior.

Estimated code review effort: 5 (Critical) | ~120 minutes

Possibly related issues

Possibly related PRs

Poem

A rabbit found shards in a burrow of bytes,
With roots held safe through workspace nights.
CBOR was bounded, each key in its place,
V3 caches hopped through a careful embrace.
“Exact reads!” cried Bunny, ears held high—
No replay, just properties, ready nearby.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 5.22% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: retained property reads through git-cas 6.5.
Description check ✅ Passed The description includes Summary, Issue refs, Test plan, and ADR checks, matching the required template.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown

Release Preflight

  • package version: 18.2.1
  • prerelease: false
  • npm dist-tag on release: latest
  • npm pack dry-run: passed
  • jsr publish dry-run: passed

If this PR is from a release/* branch and merges to main, Main Push Release Branch Check will run final preflight and create v18.2.1. A maintainer who is a JSR @git-stunts scope member must then dispatch the Release workflow manually.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 10

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
test/helpers/MockIndexStorage.ts (1)

48-90: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Return null only for own shard-map entries.

A missing path such as constructor or toString resolves through Object.prototype, so decodeShardAt attempts to decode a non-AssetHandle instead of reporting a missing shard. Check Object.hasOwn() before reading the map.

Proposed fix
   override async readShardHandle(
     indexHandle: BundleHandle,
     path: string,
   ): Promise<AssetHandle | null> {
-    return (this.#indexes.get(indexHandle.toString()) ?? {})[path] ?? null;
+    const shards = this.#indexes.get(indexHandle.toString());
+    return shards !== undefined && Object.hasOwn(shards, path)
+      ? shards[path] ?? null
+      : null;
   }
🤖 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 `@test/helpers/MockIndexStorage.ts` around lines 48 - 90, Update
readShardHandle in MockIndexStorage to return an AssetHandle only when the
requested path is an own property of the shard map, using Object.hasOwn before
accessing the entry; otherwise return null. This ensures decodeShardAt preserves
missing-shard behavior for inherited names such as constructor and toString.
🤖 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 `@docs/topics/cas-first-memoized-materialization.md`:
- Around line 216-222: Update the staged-shard lifecycle description in the
documentation to state that staged pages and bundles are retained immediately as
active workspace roots. Remove the outdated Git unreachable-object grace-period
limitation, concurrent-pruning warning, and git-cas issue 75 reference, while
preserving the surrounding CAS ownership and checkpointing guidance.

In `@package.json`:
- Line 120: Update the Unreleased entry in CHANGELOG.md to state that
`@git-stunts/git-cas` was upgraded to ^6.5.0, matching the dependency version
declared in package.json.

In `@src/domain/services/controllers/MaterializeSessionBridge.ts`:
- Around line 229-238: Update the property-shard encoding/staging flow around
store.writeShards and WarpStream.from<IndexShard> to enforce
MATERIALIZATION_PROPERTY_SHARD_READ_LIMITS before promotion. Apply the
retained-read CBOR structural limits during encoding, while preserving the
existing shard count, byte, and staging constraints.

In `@src/domain/services/index/PropertyIndexBuilder.ts`:
- Around line 22-33: Validate options.schemaVersion in the PropertyIndexBuilder
constructor before assigning _schemaVersion, restricting it to the supported
schema version values and rejecting unsupported runtime numbers. Use a validated
domain representation or constructor for the schema version, while preserving
the default version of 1 when no value is provided.

In `@src/domain/services/index/PropertyIndexReader.ts`:
- Line 19: Remove the duplicate IndexedPropertyBag declaration and update the
remaining alias to use a readonly string index signature, preserving PropValue
as the value type to reflect that decoded bags are frozen.

In `@src/infrastructure/adapters/CborIndexShardWriter.ts`:
- Around line 128-138: Update validatedStaging to verify that value is a
non-null object before accessing stagePage or stageOrderedBundle, while
continuing to accept undefined and valid staging ports. Throw the existing
IndexError with code E_INDEX_INVALID_STORAGE for null, primitives, or objects
missing either operation.

In `@src/infrastructure/adapters/CborIndexStoreAdapter.ts`:
- Around line 275-279: Update the stream-processing loop around
appendBoundedShardChunk to track every yielded chunk, including empty ones, with
a separate chunk-count limit before the empty-chunk early return. Ensure
requireShardChunkCount receives the total number of yielded chunks so an
indefinite stream of empty chunks cannot bypass the availability guard, while
preserving the existing byte-limit accounting.

In `@src/ports/IndexStorePort.ts`:
- Around line 8-21: Update IndexShardWriteOptions to a discriminated union
requiring maxShardBytes whenever memberStorage is 'page', while preserving the
valid 'asset' configuration. Replace the optional fields in
IndexShardDecodeOptions with one optional nested structure-limits object whose
internal fields are all required, matching the adapters’ accepted configurations
and rejecting partial limits at compile time.

In `@test/helpers/InMemoryMaterializationStore.ts`:
- Around line 39-49: Update InMemoryMaterializationStore’s stagePage() and
stageOrderedBundle() methods to check the released state before allocating
handles, and reject staging after the workspace has been released, matching the
production workspace mutability guard. Preserve the existing handle generation
and successful staging behavior when the workspace remains active.

In `@test/unit/scripts/v18-v17-fixture-wet-run-harness.test.ts`:
- Around line 95-105: Update the determinism test around
runV17GoldenGraphFixtureWetRun to create two independent temporary target
directories, execute the harness separately for each, and format each returned
result once with formatV17GoldenGraphFixtureWetRunReport. Compare the two
reports for equality and ensure neither report contains its corresponding target
directory; remove the current same-result double-formatting assertion.

---

Outside diff comments:
In `@test/helpers/MockIndexStorage.ts`:
- Around line 48-90: Update readShardHandle in MockIndexStorage to return an
AssetHandle only when the requested path is an own property of the shard map,
using Object.hasOwn before accessing the entry; otherwise return null. This
ensures decodeShardAt preserves missing-shard behavior for inherited names such
as constructor and toString.
🪄 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: f96e1988-2d7b-4cc8-9fc7-40f58d1c3761

📥 Commits

Reviewing files that changed from the base of the PR and between 7c5e7e2 and 4b47f56.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (65)
  • CHANGELOG.md
  • docs/topics/cas-first-memoized-materialization.md
  • package.json
  • src/domain/RuntimeHost.ts
  • src/domain/materialization/MaterializationPropertyProfile.ts
  • src/domain/materialization/MaterializationRoot.ts
  • src/domain/materialization/MaterializationRoots.ts
  • src/domain/materialization/TrieMaterializationReader.ts
  • src/domain/orset/route/RouteKey.ts
  • src/domain/orset/session/StateSession.ts
  • src/domain/orset/trie/TrieFlusher.ts
  • src/domain/orset/trie/TrieStorePort.ts
  • src/domain/services/controllers/MaterializeController.ts
  • src/domain/services/controllers/MaterializeDeps.ts
  • src/domain/services/controllers/MaterializeLiveStrategy.ts
  • src/domain/services/controllers/MaterializeSessionBridge.ts
  • src/domain/services/controllers/QueryReads.ts
  • src/domain/services/controllers/ReadGraphHost.ts
  • src/domain/services/index/PropertyIndexBuilder.ts
  • src/domain/services/index/PropertyIndexReader.ts
  • src/domain/warp/RuntimeHostBoot.ts
  • src/infrastructure/adapters/BoundedCborValidation.ts
  • src/infrastructure/adapters/CborCheckpointStoreAdapter.ts
  • src/infrastructure/adapters/CborIndexShardWriter.ts
  • src/infrastructure/adapters/CborIndexStoreAdapter.ts
  • src/infrastructure/adapters/GitCasMaterializationBundle.ts
  • src/infrastructure/adapters/GitCasMaterializationDescriptor.ts
  • src/infrastructure/adapters/GitCasMaterializationLease.ts
  • src/infrastructure/adapters/GitCasMaterializationStoreAdapter.ts
  • src/infrastructure/adapters/GitCasMaterializationWorkspace.ts
  • src/infrastructure/adapters/GitCasRepositoryAdapter.ts
  • src/infrastructure/adapters/GitCasTrieStoreAdapter.ts
  • src/infrastructure/adapters/IndexShardEncodeTransform.ts
  • src/infrastructure/adapters/IndexShardLimitValidation.ts
  • src/infrastructure/adapters/PropertyShardEncodedSizeGuard.ts
  • src/ports/ArtifactStagingPort.ts
  • src/ports/IndexStorePort.ts
  • src/ports/MaterializationReadPort.ts
  • src/ports/MaterializationStorePort.ts
  • src/ports/MaterializationWorkspacePort.ts
  • test/helpers/InMemoryGitCasFacade.ts
  • test/helpers/InMemoryMaterializationStore.ts
  • test/helpers/MockIndexStorage.ts
  • test/integration/api/materialization.retainedResume.test.ts
  • test/integration/infrastructure/adapters/GitCasMaterializationStoreAdapter.integration.test.ts
  • test/unit/domain/materialization/MaterializationIdentity.test.ts
  • test/unit/domain/materialization/TrieMaterializationReader.test.ts
  • test/unit/domain/orset/session/StateSession.test.ts
  • test/unit/domain/services/PropertyIndex.test.ts
  • test/unit/domain/services/controllers/MaterializationWorkspaceCleanup.test.ts
  • test/unit/domain/services/controllers/MaterializeController.liveNodeRead.test.ts
  • test/unit/domain/services/controllers/MaterializeController.propertyRootRetention.test.ts
  • test/unit/domain/services/controllers/MaterializeController.stateSession.test.ts
  • test/unit/domain/services/controllers/QueryController.test.ts
  • test/unit/infrastructure/CborIndexStoreAdapter.test.ts
  • test/unit/infrastructure/adapters/CborCheckpointStoreAdapter.test.ts
  • test/unit/infrastructure/adapters/GitCasMaterializationStoreAdapter.lifecycle.test.ts
  • test/unit/infrastructure/adapters/GitCasMaterializationStoreAdapter.test.ts
  • test/unit/infrastructure/adapters/GitCasMaterializationWorkspace.test.ts
  • test/unit/infrastructure/adapters/GitCasRepositoryAdapter.test.ts
  • test/unit/infrastructure/adapters/GitCasTrieStoreAdapter.test.ts
  • test/unit/ports/IndexStorePort.test.ts
  • test/unit/scripts/v18-v17-fixture-wet-run-harness.test.ts
  • test/unit/scripts/v18-v17-public-read-legacy-reading-builder.test.ts
  • vitest.config.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (3)
  • GitHub Check: preflight
  • GitHub Check: coverage-threshold
  • GitHub Check: test-node (22)
🧰 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 from src/infrastructure/** in src/domain/** or src/ports/**; depend on a port instead.
Do not use direct Node built-ins in src/domain/** or src/ports/**; use a port instead.

Files:

  • test/unit/scripts/v18-v17-public-read-legacy-reading-builder.test.ts
  • vitest.config.ts
  • src/domain/orset/route/RouteKey.ts
  • test/unit/infrastructure/adapters/GitCasRepositoryAdapter.test.ts
  • src/ports/MaterializationReadPort.ts
  • test/unit/scripts/v18-v17-fixture-wet-run-harness.test.ts
  • test/unit/domain/services/controllers/MaterializationWorkspaceCleanup.test.ts
  • src/domain/services/controllers/MaterializeDeps.ts
  • src/infrastructure/adapters/GitCasMaterializationLease.ts
  • src/ports/ArtifactStagingPort.ts
  • src/domain/warp/RuntimeHostBoot.ts
  • test/unit/domain/materialization/MaterializationIdentity.test.ts
  • src/infrastructure/adapters/CborCheckpointStoreAdapter.ts
  • src/infrastructure/adapters/PropertyShardEncodedSizeGuard.ts
  • src/ports/MaterializationWorkspacePort.ts
  • src/domain/materialization/MaterializationPropertyProfile.ts
  • src/infrastructure/adapters/IndexShardLimitValidation.ts
  • src/domain/materialization/MaterializationRoot.ts
  • test/helpers/MockIndexStorage.ts
  • src/ports/MaterializationStorePort.ts
  • src/infrastructure/adapters/BoundedCborValidation.ts
  • src/infrastructure/adapters/GitCasRepositoryAdapter.ts
  • src/infrastructure/adapters/GitCasMaterializationDescriptor.ts
  • test/integration/api/materialization.retainedResume.test.ts
  • src/domain/services/controllers/ReadGraphHost.ts
  • test/unit/ports/IndexStorePort.test.ts
  • src/domain/services/index/PropertyIndexBuilder.ts
  • src/infrastructure/adapters/GitCasMaterializationBundle.ts
  • src/domain/orset/session/StateSession.ts
  • test/unit/infrastructure/adapters/GitCasTrieStoreAdapter.test.ts
  • src/domain/orset/trie/TrieStorePort.ts
  • test/unit/infrastructure/adapters/CborCheckpointStoreAdapter.test.ts
  • test/unit/domain/services/controllers/QueryController.test.ts
  • test/unit/domain/orset/session/StateSession.test.ts
  • src/domain/services/controllers/QueryReads.ts
  • src/domain/orset/trie/TrieFlusher.ts
  • src/domain/materialization/MaterializationRoots.ts
  • src/domain/services/controllers/MaterializeLiveStrategy.ts
  • src/infrastructure/adapters/IndexShardEncodeTransform.ts
  • src/ports/IndexStorePort.ts
  • test/unit/domain/services/controllers/MaterializeController.stateSession.test.ts
  • src/domain/materialization/TrieMaterializationReader.ts
  • test/unit/infrastructure/adapters/GitCasMaterializationStoreAdapter.lifecycle.test.ts
  • test/unit/domain/services/PropertyIndex.test.ts
  • test/helpers/InMemoryMaterializationStore.ts
  • src/domain/RuntimeHost.ts
  • src/infrastructure/adapters/CborIndexShardWriter.ts
  • test/unit/domain/services/controllers/MaterializeController.propertyRootRetention.test.ts
  • src/domain/services/controllers/MaterializeController.ts
  • test/unit/domain/services/controllers/MaterializeController.liveNodeRead.test.ts
  • src/domain/services/controllers/MaterializeSessionBridge.ts
  • test/integration/infrastructure/adapters/GitCasMaterializationStoreAdapter.integration.test.ts
  • test/unit/domain/materialization/TrieMaterializationReader.test.ts
  • src/domain/services/index/PropertyIndexReader.ts
  • test/unit/infrastructure/adapters/GitCasMaterializationWorkspace.test.ts
  • src/infrastructure/adapters/GitCasTrieStoreAdapter.ts
  • src/infrastructure/adapters/GitCasMaterializationWorkspace.ts
  • test/helpers/InMemoryGitCasFacade.ts
  • test/unit/infrastructure/adapters/GitCasMaterializationStoreAdapter.test.ts
  • test/unit/infrastructure/CborIndexStoreAdapter.test.ts
  • src/infrastructure/adapters/CborIndexStoreAdapter.ts
  • src/infrastructure/adapters/GitCasMaterializationStoreAdapter.ts
src/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

src/**/*.{ts,tsx,js,jsx}: Do not introduce any, as any, as unknown as, unknown (outside adapters), Record<string, unknown> (outside adapters), *Like placeholder types, JSON.parse/JSON.stringify (outside adapters), fetch (outside adapters), process.env (outside adapters), @ts-ignore, or z.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 create utils.ts, helpers.ts, misc.ts, or common.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 as Uint8Array; Buffer belongs in infrastructure adapters.

Files:

  • src/domain/orset/route/RouteKey.ts
  • src/ports/MaterializationReadPort.ts
  • src/domain/services/controllers/MaterializeDeps.ts
  • src/infrastructure/adapters/GitCasMaterializationLease.ts
  • src/ports/ArtifactStagingPort.ts
  • src/domain/warp/RuntimeHostBoot.ts
  • src/infrastructure/adapters/CborCheckpointStoreAdapter.ts
  • src/infrastructure/adapters/PropertyShardEncodedSizeGuard.ts
  • src/ports/MaterializationWorkspacePort.ts
  • src/domain/materialization/MaterializationPropertyProfile.ts
  • src/infrastructure/adapters/IndexShardLimitValidation.ts
  • src/domain/materialization/MaterializationRoot.ts
  • src/ports/MaterializationStorePort.ts
  • src/infrastructure/adapters/BoundedCborValidation.ts
  • src/infrastructure/adapters/GitCasRepositoryAdapter.ts
  • src/infrastructure/adapters/GitCasMaterializationDescriptor.ts
  • src/domain/services/controllers/ReadGraphHost.ts
  • src/domain/services/index/PropertyIndexBuilder.ts
  • src/infrastructure/adapters/GitCasMaterializationBundle.ts
  • src/domain/orset/session/StateSession.ts
  • src/domain/orset/trie/TrieStorePort.ts
  • src/domain/services/controllers/QueryReads.ts
  • src/domain/orset/trie/TrieFlusher.ts
  • src/domain/materialization/MaterializationRoots.ts
  • src/domain/services/controllers/MaterializeLiveStrategy.ts
  • src/infrastructure/adapters/IndexShardEncodeTransform.ts
  • src/ports/IndexStorePort.ts
  • src/domain/materialization/TrieMaterializationReader.ts
  • src/domain/RuntimeHost.ts
  • src/infrastructure/adapters/CborIndexShardWriter.ts
  • src/domain/services/controllers/MaterializeController.ts
  • src/domain/services/controllers/MaterializeSessionBridge.ts
  • src/domain/services/index/PropertyIndexReader.ts
  • src/infrastructure/adapters/GitCasTrieStoreAdapter.ts
  • src/infrastructure/adapters/GitCasMaterializationWorkspace.ts
  • src/infrastructure/adapters/CborIndexStoreAdapter.ts
  • src/infrastructure/adapters/GitCasMaterializationStoreAdapter.ts
src/domain/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

src/domain/**/*.{ts,tsx,js,jsx}: In src/domain/**, do not use Date.now(), new Date(), Date(), performance.now(), Math.random(), crypto.randomUUID(), crypto.getRandomValues(), setTimeout, setInterval, raw new 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 extend WarpError.
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/orset/route/RouteKey.ts
  • src/domain/services/controllers/MaterializeDeps.ts
  • src/domain/warp/RuntimeHostBoot.ts
  • src/domain/materialization/MaterializationPropertyProfile.ts
  • src/domain/materialization/MaterializationRoot.ts
  • src/domain/services/controllers/ReadGraphHost.ts
  • src/domain/services/index/PropertyIndexBuilder.ts
  • src/domain/orset/session/StateSession.ts
  • src/domain/orset/trie/TrieStorePort.ts
  • src/domain/services/controllers/QueryReads.ts
  • src/domain/orset/trie/TrieFlusher.ts
  • src/domain/materialization/MaterializationRoots.ts
  • src/domain/services/controllers/MaterializeLiveStrategy.ts
  • src/domain/materialization/TrieMaterializationReader.ts
  • src/domain/RuntimeHost.ts
  • src/domain/services/controllers/MaterializeController.ts
  • src/domain/services/controllers/MaterializeSessionBridge.ts
  • src/domain/services/index/PropertyIndexReader.ts
src/domain/**/!(*.test).{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use explicit domain concepts with validated constructors, Object.freeze, and instanceof dispatch; domain objects should be runtime-backed nouns, not ad hoc shape bags.

Files:

  • src/domain/orset/route/RouteKey.ts
  • src/domain/services/controllers/MaterializeDeps.ts
  • src/domain/warp/RuntimeHostBoot.ts
  • src/domain/materialization/MaterializationPropertyProfile.ts
  • src/domain/materialization/MaterializationRoot.ts
  • src/domain/services/controllers/ReadGraphHost.ts
  • src/domain/services/index/PropertyIndexBuilder.ts
  • src/domain/orset/session/StateSession.ts
  • src/domain/orset/trie/TrieStorePort.ts
  • src/domain/services/controllers/QueryReads.ts
  • src/domain/orset/trie/TrieFlusher.ts
  • src/domain/materialization/MaterializationRoots.ts
  • src/domain/services/controllers/MaterializeLiveStrategy.ts
  • src/domain/materialization/TrieMaterializationReader.ts
  • src/domain/RuntimeHost.ts
  • src/domain/services/controllers/MaterializeController.ts
  • src/domain/services/controllers/MaterializeSessionBridge.ts
  • src/domain/services/index/PropertyIndexReader.ts
src/ports/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

In src/ports/**, do not import Node built-ins or src/infrastructure/**; ports must stay abstract and depend only on boundary-safe types.

Files:

  • src/ports/MaterializationReadPort.ts
  • src/ports/ArtifactStagingPort.ts
  • src/ports/MaterializationWorkspacePort.ts
  • src/ports/MaterializationStorePort.ts
  • src/ports/IndexStorePort.ts
🧠 Learnings (2)
📚 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
📚 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)

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)

🔇 Additional comments (65)
src/infrastructure/adapters/CborCheckpointStoreAdapter.ts (1)

51-51: LGTM!

Also applies to: 268-268

test/helpers/InMemoryGitCasFacade.ts (1)

19-31: LGTM!

Also applies to: 56-76, 86-90, 106-110, 122-124, 147-156, 345-349, 442-543, 587-639

test/unit/infrastructure/adapters/CborCheckpointStoreAdapter.test.ts (1)

258-259: LGTM!

Also applies to: 280-282, 304-306

test/unit/infrastructure/adapters/GitCasMaterializationStoreAdapter.lifecycle.test.ts (1)

1-186: LGTM!

test/unit/infrastructure/adapters/GitCasMaterializationStoreAdapter.test.ts (1)

17-17: LGTM!

Also applies to: 30-30, 73-110, 119-136, 148-165, 180-187, 198-198, 326-326, 393-397, 486-497, 527-540, 590-602, 673-692, 705-705

test/unit/infrastructure/adapters/GitCasMaterializationWorkspace.test.ts (1)

1-108: LGTM!

Also applies to: 121-136, 149-160

test/unit/infrastructure/adapters/GitCasRepositoryAdapter.test.ts (1)

133-133: LGTM!

test/unit/ports/IndexStorePort.test.ts (1)

14-17: LGTM!

Also applies to: 29-54

CHANGELOG.md (1)

75-89: LGTM!

docs/topics/cas-first-memoized-materialization.md (1)

105-135: LGTM!

Also applies to: 198-215

test/helpers/InMemoryMaterializationStore.ts (1)

21-21: LGTM!

Also applies to: 160-173

test/integration/api/materialization.retainedResume.test.ts (1)

53-53: LGTM!

Also applies to: 114-160, 236-246

test/unit/domain/orset/session/StateSession.test.ts (1)

466-472: LGTM!

Also applies to: 484-490

test/unit/domain/services/controllers/MaterializationWorkspaceCleanup.test.ts (1)

66-72: LGTM!

test/unit/domain/services/controllers/MaterializeController.liveNodeRead.test.ts (1)

156-234: LGTM!

Also applies to: 237-245, 255-264, 274-309, 341-364

test/unit/domain/services/controllers/MaterializeController.stateSession.test.ts (1)

8-8: LGTM!

Also applies to: 29-29, 59-81, 534-569

test/unit/domain/services/controllers/QueryController.test.ts (1)

122-122: LGTM!

Also applies to: 233-264

test/unit/infrastructure/CborIndexStoreAdapter.test.ts (1)

2-5: LGTM!

Also applies to: 15-36, 57-60, 120-174, 185-190, 193-216, 218-284, 304-324, 326-339, 341-363, 365-391, 393-472, 474-490, 505-546, 567-572

test/unit/infrastructure/adapters/GitCasTrieStoreAdapter.test.ts (1)

2-6: LGTM!

Also applies to: 60-80, 223-224

test/helpers/MockIndexStorage.ts (1)

19-19: LGTM!

test/integration/infrastructure/adapters/GitCasMaterializationStoreAdapter.integration.test.ts (1)

132-160: LGTM!

Also applies to: 163-186

test/unit/domain/materialization/MaterializationIdentity.test.ts (1)

119-128: LGTM!

Also applies to: 175-180

test/unit/domain/materialization/TrieMaterializationReader.test.ts (1)

1-17: LGTM!

Also applies to: 50-142

test/unit/domain/services/PropertyIndex.test.ts (1)

5-9: LGTM!

Also applies to: 38-41, 94-171

test/unit/domain/services/controllers/MaterializeController.propertyRootRetention.test.ts (1)

1-200: LGTM!

src/domain/orset/route/RouteKey.ts (1)

103-104: LGTM!

test/unit/scripts/v18-v17-public-read-legacy-reading-builder.test.ts (1)

52-52: LGTM!

vitest.config.ts (1)

33-33: LGTM!

src/domain/RuntimeHost.ts (1)

71-71: LGTM!

Also applies to: 260-261, 408-408, 430-447

src/domain/materialization/MaterializationRoot.ts (1)

31-39: LGTM!

src/domain/materialization/MaterializationRoots.ts (1)

68-72: LGTM!

src/domain/services/controllers/MaterializeController.ts (1)

39-39: LGTM!

Also applies to: 168-170, 279-285, 348-358, 394-396, 432-434

src/domain/services/controllers/MaterializeLiveStrategy.ts (1)

18-18: LGTM!

Also applies to: 90-108, 390-434

src/domain/services/controllers/QueryReads.ts (1)

136-155: LGTM!

Also applies to: 171-174

src/domain/warp/RuntimeHostBoot.ts (1)

346-363: LGTM!

src/ports/MaterializationStorePort.ts (1)

25-29: LGTM!

src/domain/materialization/MaterializationPropertyProfile.ts (1)

1-43: LGTM!

src/domain/services/index/PropertyIndexBuilder.ts (1)

35-57: LGTM!

src/infrastructure/adapters/IndexShardLimitValidation.ts (1)

1-50: LGTM!

src/domain/services/controllers/MaterializeSessionBridge.ts (2)

9-9: LGTM!

Also applies to: 27-35, 55-56, 74-130, 189-228, 239-267


317-319: 🗄️ Data Integrity & Integration

No issue: this path returns a live WarpState. projectFrameToState can pass frame.prop, frame.observedFrontier, and frame.edgeBirthEvent through directly; ReducerSessionFrame isn’t mutated after projection, and WarpState intentionally stores live collections by reference.

			> Likely an incorrect or invalid review comment.
src/domain/materialization/TrieMaterializationReader.ts (1)

2-16: LGTM!

Also applies to: 25-31, 40-42, 62-88, 134-144

src/domain/services/controllers/MaterializeDeps.ts (1)

5-5: LGTM!

Also applies to: 26-26

src/domain/services/index/PropertyIndexReader.ts (1)

20-266: LGTM!

Also applies to: 313-313, 324-324, 374-377

src/infrastructure/adapters/PropertyShardEncodedSizeGuard.ts (1)

1-98: LGTM!

src/infrastructure/adapters/IndexShardEncodeTransform.ts (1)

10-14: LGTM!

Also applies to: 28-36, 72-78, 95-122

src/infrastructure/adapters/BoundedCborValidation.ts (1)

1-202: LGTM!

src/infrastructure/adapters/CborIndexStoreAdapter.ts (1)

1-9: LGTM!

Also applies to: 21-42, 70-84, 111-114, 141-158, 183-269, 299-370

src/infrastructure/adapters/CborIndexShardWriter.ts (1)

1-127: LGTM!

Also applies to: 142-200

src/ports/ArtifactStagingPort.ts (1)

1-24: LGTM!

src/ports/IndexStorePort.ts (1)

50-57: LGTM!

Also applies to: 80-85, 101-115

src/domain/orset/trie/TrieFlusher.ts (1)

14-14: LGTM!

Also applies to: 24-24, 70-75, 176-176, 195-195

src/domain/services/controllers/ReadGraphHost.ts (1)

11-11: LGTM!

Also applies to: 33-35

src/ports/MaterializationReadPort.ts (1)

2-13: LGTM!

src/domain/orset/session/StateSession.ts (1)

104-109: LGTM!

Also applies to: 444-446

src/domain/orset/trie/TrieStorePort.ts (1)

2-20: LGTM!

Also applies to: 82-82, 91-91

src/infrastructure/adapters/GitCasMaterializationBundle.ts (1)

1-137: LGTM!

src/infrastructure/adapters/GitCasMaterializationDescriptor.ts (1)

12-12: LGTM!

Also applies to: 124-135

src/infrastructure/adapters/GitCasMaterializationLease.ts (1)

1-75: LGTM!

src/infrastructure/adapters/GitCasMaterializationStoreAdapter.ts (2)

8-13: LGTM!

Also applies to: 25-28, 37-63, 72-77, 100-207, 209-232, 238-318, 344-368, 380-385, 396-431, 442-448


233-237: 🩺 Stability & Availability

Keep the existing lease on a miss. null from #openLease means no replacement was opened, so retiring #currentLease here would drop the last valid acquisition unnecessarily.

			> Likely an incorrect or invalid review comment.
src/infrastructure/adapters/GitCasMaterializationWorkspace.ts (1)

3-143: LGTM!

Also applies to: 159-170, 182-268

src/infrastructure/adapters/GitCasRepositoryAdapter.ts (1)

49-53: LGTM!

src/infrastructure/adapters/GitCasTrieStoreAdapter.ts (1)

4-10: LGTM!

Also applies to: 31-31, 54-56, 83-83, 95-123, 134-134, 159-164

src/ports/MaterializationWorkspacePort.ts (1)

5-10: LGTM!

Also applies to: 23-23

Comment thread docs/topics/cas-first-memoized-materialization.md Outdated
Comment thread package.json
Comment thread src/domain/services/controllers/MaterializeSessionBridge.ts
Comment thread src/domain/services/index/PropertyIndexBuilder.ts
Comment thread src/domain/services/index/PropertyIndexReader.ts Outdated
Comment thread src/infrastructure/adapters/CborIndexShardWriter.ts
Comment thread src/infrastructure/adapters/CborIndexStoreAdapter.ts
Comment thread src/ports/IndexStorePort.ts Outdated
Comment thread test/helpers/InMemoryMaterializationStore.ts
Comment thread test/unit/scripts/v18-v17-fixture-wet-run-harness.test.ts Outdated
@github-actions

Copy link
Copy Markdown

Release Preflight

  • package version: 18.2.1
  • prerelease: false
  • npm dist-tag on release: latest
  • npm pack dry-run: passed
  • jsr publish dry-run: passed

If this PR is from a release/* branch and merges to main, Main Push Release Branch Check will run final preflight and create v18.2.1. A maintainer who is a JSR @git-stunts scope member must then dispatch the Release workflow manually.

@flyingrobots

Copy link
Copy Markdown
Member Author

Self-code review: Code Lawyer

@codex please confirm that the review resolutions and remaining risk assessment below are accurate.

Severity Found Resolved Remaining
Critical 1 1 0
Major 4 4 0
Minor 5 5 0
Trivial 1 1 0
Total 11 11 0

All ten inline findings and the outside-diff MockIndexStorage inherited-property defect were verified against current code and fixed. Every inline thread has a commit-specific reply and is resolved.

Structural review with Graft found three branch-level internal breaks: the intentionally changed reduceSessionBackedState signature has exactly one caller and that caller is updated; the removed MaterializationWorkspaceLease and MaterializationWorkspaceLeaseScheduler exports have zero references. The package publication gate reports zero errors and zero warnings, so these do not escape as v19 root API regressions.

Validation on 63ddcf184:

  • pre-push IRONCLAD firewall: all static gates and 570 test files / 7,097 tests passed
  • full coverage: 586 files passed, 1 skipped; 7,222 tests passed, 2 skipped; 92.90% lines
  • source and test typecheck: passed
  • ESLint, test-law, source-size, Markdown, docs topology, links, and CAS ownership gates: passed
  • package publication surface: 0 errors, 0 warnings
  • independent wet-run determinism suite: 9/9 passed

Residual scope is explicit rather than hidden: this PR accelerates exact retained reads, but compatible-predecessor suffix replay remains follow-up work under #738/#739.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/CborIndexStoreAdapter.ts (1)

152-173: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Allow scanShards() to read page-backed members.

writeShards() now accepts memberStorage: 'page', but Line 160 rejects those members through requireAssetMember. Scanning a page-backed bundle therefore throws instead of returning its shards. Route recognized members through readMemberBytes() as decodeShardAt() already does.

Proposed fix
-        const handle = requireAssetMember(
-          member.path,
-          member.handle.kind,
-          member.handle.toString(),
-        );
         const shard = tryClassifyPath(member.path);
         if (shard === null) {
           continue;
         }
-        const bytes = await collectAsyncIterable(adapter._assets.open(handle));
+        const bytes = await readMemberBytes({
+          member,
+          path: member.path,
+          maxBytes: undefined,
+          cas: adapter._cas,
+          assets: adapter._assets,
+        });
         const data = adapter._codec.decode(bytes);
🤖 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/CborIndexStoreAdapter.ts` around lines 152 - 173,
Update scanShards() to read recognized bundle members through readMemberBytes()
instead of requiring requireAssetMember() and opening assets directly, so both
asset-backed and page-backed members are supported. Preserve the existing path
uniqueness check, classification filtering, decoding, and shard yielding
behavior.
🤖 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/CborIndexStoreAdapter.ts`:
- Around line 152-173: Update scanShards() to read recognized bundle members
through readMemberBytes() instead of requiring requireAssetMember() and opening
assets directly, so both asset-backed and page-backed members are supported.
Preserve the existing path uniqueness check, classification filtering, decoding,
and shard yielding behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 34b04ac9-e0d0-4cef-ad16-6c9e98e6f3e1

📥 Commits

Reviewing files that changed from the base of the PR and between 4b47f56 and 63ddcf1.

📒 Files selected for processing (23)
  • CHANGELOG.md
  • docs/topics/cas-first-memoized-materialization.md
  • src/domain/materialization/MaterializationPropertyProfile.ts
  • src/domain/materialization/TrieMaterializationReader.ts
  • src/domain/services/controllers/MaterializeSessionBridge.ts
  • src/domain/services/index/PropertyIndexBuilder.ts
  • src/domain/services/index/PropertyIndexReader.ts
  • src/infrastructure/adapters/CborIndexShardWriter.ts
  • src/infrastructure/adapters/CborIndexStoreAdapter.ts
  • src/infrastructure/adapters/GitCasMaterializationLease.ts
  • src/infrastructure/adapters/IndexShardEncodeTransform.ts
  • src/infrastructure/adapters/IndexShardLimitValidation.ts
  • src/ports/IndexStorePort.ts
  • test/helpers/InMemoryMaterializationStore.ts
  • test/helpers/MockIndexStorage.ts
  • test/integration/infrastructure/adapters/GitCasMaterializationStoreAdapter.integration.test.ts
  • test/unit/domain/materialization/TrieMaterializationReader.test.ts
  • test/unit/domain/services/PropertyIndex.test.ts
  • test/unit/helpers/StorageTestDoubles.test.ts
  • test/unit/infrastructure/CborIndexStoreAdapter.test.ts
  • test/unit/infrastructure/adapters/GitCasMaterializationLease.test.ts
  • test/unit/ports/IndexStorePort.test.ts
  • test/unit/scripts/v18-v17-fixture-wet-run-harness.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 from src/infrastructure/** in src/domain/** or src/ports/**; depend on a port instead.
Do not use direct Node built-ins in src/domain/** or src/ports/**; use a port instead.

Files:

  • test/unit/infrastructure/adapters/GitCasMaterializationLease.test.ts
  • test/unit/helpers/StorageTestDoubles.test.ts
  • src/infrastructure/adapters/GitCasMaterializationLease.ts
  • test/unit/scripts/v18-v17-fixture-wet-run-harness.test.ts
  • test/unit/domain/materialization/TrieMaterializationReader.test.ts
  • src/infrastructure/adapters/IndexShardLimitValidation.ts
  • src/infrastructure/adapters/IndexShardEncodeTransform.ts
  • test/unit/domain/services/PropertyIndex.test.ts
  • test/helpers/MockIndexStorage.ts
  • src/domain/services/index/PropertyIndexBuilder.ts
  • src/domain/materialization/MaterializationPropertyProfile.ts
  • src/ports/IndexStorePort.ts
  • src/domain/materialization/TrieMaterializationReader.ts
  • test/unit/ports/IndexStorePort.test.ts
  • src/domain/services/index/PropertyIndexReader.ts
  • test/integration/infrastructure/adapters/GitCasMaterializationStoreAdapter.integration.test.ts
  • test/helpers/InMemoryMaterializationStore.ts
  • src/domain/services/controllers/MaterializeSessionBridge.ts
  • test/unit/infrastructure/CborIndexStoreAdapter.test.ts
  • src/infrastructure/adapters/CborIndexShardWriter.ts
  • src/infrastructure/adapters/CborIndexStoreAdapter.ts
src/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

src/**/*.{ts,tsx,js,jsx}: Do not introduce any, as any, as unknown as, unknown (outside adapters), Record<string, unknown> (outside adapters), *Like placeholder types, JSON.parse/JSON.stringify (outside adapters), fetch (outside adapters), process.env (outside adapters), @ts-ignore, or z.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 create utils.ts, helpers.ts, misc.ts, or common.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 as Uint8Array; Buffer belongs in infrastructure adapters.

Files:

  • src/infrastructure/adapters/GitCasMaterializationLease.ts
  • src/infrastructure/adapters/IndexShardLimitValidation.ts
  • src/infrastructure/adapters/IndexShardEncodeTransform.ts
  • src/domain/services/index/PropertyIndexBuilder.ts
  • src/domain/materialization/MaterializationPropertyProfile.ts
  • src/ports/IndexStorePort.ts
  • src/domain/materialization/TrieMaterializationReader.ts
  • src/domain/services/index/PropertyIndexReader.ts
  • src/domain/services/controllers/MaterializeSessionBridge.ts
  • src/infrastructure/adapters/CborIndexShardWriter.ts
  • src/infrastructure/adapters/CborIndexStoreAdapter.ts
src/domain/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

src/domain/**/*.{ts,tsx,js,jsx}: In src/domain/**, do not use Date.now(), new Date(), Date(), performance.now(), Math.random(), crypto.randomUUID(), crypto.getRandomValues(), setTimeout, setInterval, raw new 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 extend WarpError.
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/index/PropertyIndexBuilder.ts
  • src/domain/materialization/MaterializationPropertyProfile.ts
  • src/domain/materialization/TrieMaterializationReader.ts
  • src/domain/services/index/PropertyIndexReader.ts
  • src/domain/services/controllers/MaterializeSessionBridge.ts
src/domain/**/!(*.test).{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use explicit domain concepts with validated constructors, Object.freeze, and instanceof dispatch; domain objects should be runtime-backed nouns, not ad hoc shape bags.

Files:

  • src/domain/services/index/PropertyIndexBuilder.ts
  • src/domain/materialization/MaterializationPropertyProfile.ts
  • src/domain/materialization/TrieMaterializationReader.ts
  • src/domain/services/index/PropertyIndexReader.ts
  • src/domain/services/controllers/MaterializeSessionBridge.ts
src/ports/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

In src/ports/**, do not import Node built-ins or src/infrastructure/**; ports must stay abstract and depend only on boundary-safe types.

Files:

  • src/ports/IndexStorePort.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/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)

🔇 Additional comments (24)
CHANGELOG.md (1)

53-53: LGTM!

Also applies to: 75-89

docs/topics/cas-first-memoized-materialization.md (1)

105-135: LGTM!

Also applies to: 198-220

test/helpers/MockIndexStorage.ts (1)

19-19: LGTM!

Also applies to: 48-56, 84-94

test/unit/infrastructure/adapters/GitCasMaterializationLease.test.ts (1)

8-24: LGTM!

Also applies to: 26-37, 39-50, 53-61

test/unit/ports/IndexStorePort.test.ts (1)

7-10: LGTM!

Also applies to: 23-46, 57-70

test/unit/scripts/v18-v17-fixture-wet-run-harness.test.ts (1)

95-111: LGTM!

test/unit/domain/materialization/TrieMaterializationReader.test.ts (1)

1-17: LGTM!

Also applies to: 50-92, 94-112, 114-125, 127-135, 137-147

test/unit/domain/services/PropertyIndex.test.ts (1)

167-180: LGTM!

test/unit/helpers/StorageTestDoubles.test.ts (1)

1-29: LGTM!

test/unit/infrastructure/CborIndexStoreAdapter.test.ts (1)

7-7: LGTM!

Also applies to: 27-27, 108-118, 248-252, 263-267, 307-332, 352-394, 412-416, 435-448, 469-502, 514-533, 624-654

test/integration/infrastructure/adapters/GitCasMaterializationStoreAdapter.integration.test.ts (1)

85-85: LGTM!

Also applies to: 125-130

src/domain/materialization/TrieMaterializationReader.ts (1)

15-15: LGTM!

Also applies to: 25-42, 63-88, 134-144

src/domain/services/controllers/MaterializeSessionBridge.ts (1)

32-32: LGTM!

Also applies to: 55-56, 74-130, 191-269, 318-320

src/domain/materialization/MaterializationPropertyProfile.ts (1)

10-18: LGTM!

src/domain/services/index/PropertyIndexBuilder.ts (1)

12-14: LGTM!

Also applies to: 25-42, 56-60, 69-88

src/domain/services/index/PropertyIndexReader.ts (2)

308-324: LGTM!

Also applies to: 373-374


19-19: 🎯 Functional Correctness

No change needed for IndexedPropertyBag. It is declared only once here, so there’s no duplicate-identifier error.

			> Likely an incorrect or invalid review comment.
src/infrastructure/adapters/IndexShardEncodeTransform.ts (1)

11-19: LGTM!

Also applies to: 33-43, 57-102, 105-130

src/infrastructure/adapters/IndexShardLimitValidation.ts (1)

2-81: LGTM!

src/infrastructure/adapters/CborIndexShardWriter.ts (1)

7-17: LGTM!

Also applies to: 23-29, 51-73, 118-179

src/infrastructure/adapters/CborIndexStoreAdapter.ts (1)

210-243: LGTM!

Also applies to: 269-329

src/ports/IndexStorePort.ts (1)

8-42: LGTM!

Also applies to: 75-78, 102-106, 132-136

test/helpers/InMemoryMaterializationStore.ts (1)

21-68: LGTM!

Also applies to: 170-179

src/infrastructure/adapters/GitCasMaterializationLease.ts (1)

8-71: LGTM!

@github-actions

Copy link
Copy Markdown

Release Preflight

  • package version: 18.2.1
  • prerelease: false
  • npm dist-tag on release: latest
  • npm pack dry-run: passed
  • jsr publish dry-run: passed

If this PR is from a release/* branch and merges to main, Main Push Release Branch Check will run final preflight and create v18.2.1. A maintainer who is a JSR @git-stunts scope member must then dispatch the Release workflow manually.

@flyingrobots
flyingrobots merged commit a12397b into main Jul 18, 2026
17 checks passed
@flyingrobots
flyingrobots deleted the v19-retained-property-read branch July 18, 2026 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant