Skip to content

Resolve priority-next runtime boundary batch#664

Merged
flyingrobots merged 81 commits into
mainfrom
priority-next-runtime-boundaries-batch-1
Jun 21, 2026
Merged

Resolve priority-next runtime boundary batch#664
flyingrobots merged 81 commits into
mainfrom
priority-next-runtime-boundaries-batch-1

Conversation

@flyingrobots

@flyingrobots flyingrobots commented Jun 20, 2026

Copy link
Copy Markdown
Member

Summary

  • resolves the priority-next/v17 runtime-boundary batch across materialization, query support planning, sync paging, operation policy, CAS encryption policy, MCP read tools, public graph diff, merge inspection, and doctrine/runtime evidence surfaces
  • fixes the self-review findings before publication: deep GraphDiff immutability, CAS key defensive copies, sync DTO type aliases, typed graph.diff consumer proof, and precise export assertions
  • restores validation gates caught during PR prep by moving Continuum root exports into a focused sub-barrel and aligning strand read-basis tests with pinned overlay behavior

Issues

Closes #555
Closes #556
Closes #557
Closes #558
Closes #559
Closes #563
Closes #564
Closes #561
Closes #554
Closes #562
Closes #560
Closes #152
Closes #154
Closes #166
Closes #177
Closes #181
Closes #183
Closes #196
Closes #222
Closes #234

Validation

  • git diff --check origin/main...HEAD
  • npm run lint
  • npm run typecheck
  • npm run lint:md
  • npm run lint:md:code
  • npm run typecheck:policy
  • npm run lint:sludge
  • npm run lint:quarantine-graduate
  • npm run test:local
  • pre-push IRONCLAD M9 gate: all static gates and stable unit-test shards passed

Summary by CodeRabbit

Release Notes

  • New Features

    • Added CLI commands: checkpoint, gc, sync (with paging), serve, fork, watch, plus MCP server support over stdio.
    • Added graph diffing between two lamport ceilings (graph.diff).
    • Added structured observer capabilities (accumulate/emission/plan/reading-envelope) and bounded-support planning.
    • Added merge inspection/classification and streamed graph traversal (bfsStream/dfsStream).
  • API Changes

    • Read handles renamed to ProjectionHandle; graph/core now expose diff.
    • Sync responses include paging and metrics; sync auth supports x-warp-auth-scheme.
  • Documentation

    • Expanded doctrine/runtime alignment ratchet and glossary/terminology updates.
  • Breaking Changes

    • @git-stunts/plumbing: Plumbing named export removed; use default GitPlumbing.

@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 536bcaeb-ea72-42f8-8f2e-d30b3fb911ca

📥 Commits

Reviewing files that changed from the base of the PR and between fef0c2a and 45c74b5.

📒 Files selected for processing (1)
  • src/domain/services/merge/TtdMergeInspector.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/domain/services/merge/TtdMergeInspector.ts

📝 Walkthrough

Walkthrough

This change adds new CLI commands, MCP protocol handling, query planning and diff surfaces, sync paging and auth-scheme support, strategy-based materialization and strand flows, merge-inspection models, and compatibility/validation boundaries. It also updates docs, exports, tests, packaging, and release checks.

Changes

Cohort / File(s) Summary
CLI, MCP, and command wiring
bin/cli/commands/*, bin/cli/commands/mcp/*, bin/cli/infrastructure.ts, bin/cli/commands/registry.ts
Adds fork, checkpoint, gc, mcp, serve, sync, and watch handlers; introduces MCP message/tool dispatch; and updates help text, known commands, and CLI validation/usage flows.
Query, observer, diff, and planning surfaces
src/domain/services/query/*, src/domain/services/comparison/*, src/domain/WarpApp.ts, src/domain/WarpCore.ts, src/domain/WarpWorldline.ts, src/domain/WarpWorldlineCoordinate.ts, src/domain/services/controllers/QueryController.ts, src/domain/services/controllers/ComparisonController.ts, src/domain/services/controllers/ComparisonEngine.ts
Introduces ProjectionHandle, GraphDiff, bounded-support/causal-index/support-fragment planning, observer plan/accumulation/emission/reading-envelope types, and updates worldline/query/diff wiring to use the new surfaces.
Materialization, strands, sync, and merge flows
src/domain/services/controllers/*, src/domain/services/strand/*, src/domain/services/sync/*, src/infrastructure/adapters/*
Splits materialization into strategies and stream reducers, shifts strand handling toward parent-basis reads, adds sync paging/metrics and auth-scheme support, and introduces operation-policy plus CAS/compatibility adapters.
Docs, exports, tests, tooling, and governance
index.ts, README.md, CHANGELOG.md, docs/*, patches/*, scripts/*, src/domain/types/*, src/domain/utils/*, test/*, package.json, .github/workflows/release-pr.yml
Expands public exports and ambient declarations, adds doctrine/runtime and API/spec docs, updates patch notes, adds source-size and benchmark tooling, and refreshes broad test coverage and release checks.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant CLI
  participant Graph
  participant Planner
  participant Materializer
  participant Sync
  participant MCP

  User->>CLI: run command
  CLI->>Graph: open runtime/graph
  Graph->>Planner: build plan or request surface
  Planner->>Materializer: materialize / diff / traverse
  CLI->>Sync: sync or serve request
  CLI->>MCP: stdio JSON-RPC message
  MCP->>Graph: read tools/resources
  Graph-->>MCP: structured result
Loading
sequenceDiagram
  participant Client
  participant SyncHTTP
  participant SyncAuth
  participant SyncCore
  participant Policy

  Client->>SyncHTTP: request with auth + page
  SyncHTTP->>SyncAuth: sign / verify scheme
  SyncAuth->>Policy: apply retry/timeout policy
  Policy->>SyncCore: execute sync request
  SyncCore-->>SyncHTTP: page + metrics response
  SyncHTTP-->>Client: JSON payload
Loading

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~120 minutes

Possibly related issues

  • #555: The PR adds the docs/runtime alignment ratchet, status labels, and evidence-oriented guidance that this issue calls for.
  • #556: The README, guide, glossary, and audit updates explicitly align shipped runtime teaching with target doctrine.
  • #557: GitWarpReceiptEnvelopeBoundary and its tests implement a stable receipt-envelope boundary and external anchor shape.
  • #558: BoundedSupportRule and related query-planning types implement bounded support rules for reads.
  • #559: CausalIndexPlan adds first-class causal index planning for sliced queries.
  • #561: Observer plan, reading envelope, and ProjectionHandle changes match the observer-plan/read-envelope objective.
  • #562: SupportFragmentPlan and materialization strategies implement support-scoped fragment materialization.
  • #563: GraphDiff and graph.diff({ from, to }) implement the tick-range diff API.
  • #564: Sync request/response changes add witnessed-suffix-style admission outcomes and shell-oriented response shaping.
  • #177: Sync paging and response metrics are now explicit in request/response processing.
  • #154: Trust record parsing switches from mutation in refinement to transform-based parsing.
  • #234: Shared validation and canonical JSON helpers are extracted from duplicated implementations.

Possibly related PRs

  • git-stunts/git-warp#44: Closely related to the sync controller and request/response flow updated here.
  • git-stunts/git-warp#85: Related to the substrate/runtime boundary and compatibility work reflected in the adapter and runtime changes.
  • git-stunts/git-warp#110: Directly related to the worldline/projection-handle API shift and observer-first read surface evolution.

Poem

🐇 I hopped through streams of code today,
with handles new and paths to sway.
The diff now sings, the shells align,
and sync keeps time in tidy rhyme.
Hop-hop—what a bright new way!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 4.26% 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 is concise and matches the batch’s main runtime-boundary focus, even if it doesn’t name every subsystem.
Description check ✅ Passed The description covers summary, issue links, and validation, but should use the template’s singular Issue heading and add the ADR checks list.
Linked Issues check ✅ Passed The change set covers the listed doc, query, sync, observer, strand, diff, and receipt-envelope objectives with matching code and test updates.
Out of Scope Changes check ✅ Passed I don't see obvious unrelated code churn; the extra docs, scripts, benchmarks, and tests all support the linked runtime-boundary objectives.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch priority-next-runtime-boundaries-batch-1

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

@flyingrobots

Copy link
Copy Markdown
Member Author

@codex Code Lawyer discovery for PR #664

Severity Source File / Job Lines / Evidence Issue Mitigation prompt
P1 CI preflight test/unit/scripts/v18-package-surface-audit.test.ts CI preflight, ENOENT dist/index.d.ts, test line 21 Package surface audit assumes generated declarations already exist in jobs that run tests before build. Make the package surface audit self-contained by generating or obtaining dist/index.d.ts deterministically before asserting the root declaration budget.
P1 CI Node 22 test/integration/api/content-attachment.test.ts CI test-node (22), lines 346 and 372 Missing-blob tests still expect raw legacy blob lookup errors after compatibility policy now blocks legacy substrate reads. Update content attachment behavior/tests so missing content pointers exercise the supported CAS substrate path and preserve the missing-object invariant.
P1 CI Bun src/domain/services/sync/SyncPayloadSchema.ts CI test-bun, line 79, undefined is not an object (evaluating z.object) Zod named import shape is not portable under the Bun integration container. Change sync payload schema Zod import/use shape to match the Bun runtime interop used by the rest of supported runtimes, then verify Bun import tests.
P2 CI coverage coverage-threshold job CI lines threshold 92.02% < 92.1% New branch coverage falls below global line ratchet. Add focused tests for the low-coverage newly introduced surfaces instead of weakening coverage thresholds.

@flyingrobots

Copy link
Copy Markdown
Member Author

@codex Code Lawyer Activity Summary for PR #664

Item Severity Source File / Job Commit Outcome
1 P1 CI preflight .github/workflows/release-pr.yml / test/unit/scripts/v18-package-surface-audit.test.ts 7afbf5ef Release PR preflight now builds before test:local, so dist/index.d.ts exists before the v18 package surface audit.
2 P1 CI Node 22 src/infrastructure/adapters/CasBlobAdapter.ts, test/unit/infrastructure/adapters/CasBlobAdapter.test.ts 6d1a2795 CAS content lookup now distinguishes missing OIDs from retired legacy raw blobs; integration missing-content tests pass.
3 P1 CI Bun Zod runtime imports in src/domain/services/sync/*, src/domain/trust/schemas.ts, src/infrastructure/adapters/TrailerCommitMessageCodecAdapter.ts 58f2ba48 Runtime Zod imports now use default namespace form, fixing Bun/Vitest interop with Bun-resolved Zod 3.25.76.
4 P2 CI coverage test/unit/infrastructure/adapters/CasBlobAdapter.test.ts 6d1a2795 Added CAS missing-content regression coverage; npm run test:coverage:ci passes at the 92.1 line threshold.

Local verification after fixes:

Gate Result
git diff --check origin/main...HEAD PASS
npm run lint PASS
npm run typecheck PASS
npm run typecheck:policy PASS
npm run typecheck:surface PASS
npm run lint:sludge PASS
npm run lint:quarantine-graduate PASS
npm run lint:md PASS
npm run lint:md:code PASS
npm run test:local PASS
npx vitest run test/integration PASS
npm run test:coverage:ci PASS
docker compose -f docker/docker-compose.test.yml run --rm --volume /tmp/git-warp-bun-tmp:/tmp test-bun PASS
pre-push IRONCLAD M9 gate PASS

@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: 9

🧹 Nitpick comments (9)
src/domain/services/controllers/MaterializeLiveStrategy.ts (2)

21-21: 💤 Low value

Simplify the null/undefined check.

Since loadCheckpoint() returns CheckpointData | null, the explicit !== undefined check is redundant. You can simplify this to:

if (checkpoint !== null && isCurrentCheckpointSchema(checkpoint.schema)) {

or use:

if (checkpoint != null && isCurrentCheckpointSchema(checkpoint.schema)) {
🤖 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/domain/services/controllers/MaterializeLiveStrategy.ts` at line 21, The
null/undefined check in the condition at line 21 is redundant because
loadCheckpoint() returns CheckpointData | null, not CheckpointData | undefined.
Remove the explicit !== undefined check from the if statement condition that
validates the checkpoint object before calling
isCurrentCheckpointSchema(checkpoint.schema). You can either keep checkpoint !==
null alone or use the loose inequality checkpoint != null, both of which will
correctly handle null values and allow the schema check to proceed safely.

47-50: Remove the redundant typeof check; streamPatchesSince is guaranteed to exist on all PatchCollector instances.

The patches field is typed as PatchCollector, which defines streamPatchesSince as a concrete async generator method (not abstract). The typeof check at line 47 is therefore unnecessary—it will never fail at runtime. The fallback code (lines 51–53) duplicates the internal logic of PatchCollector.streamPatchesSince, introducing dead code duplication. Either call the method directly or remove the check entirely.

🤖 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/domain/services/controllers/MaterializeLiveStrategy.ts` around lines 47 -
50, The `typeof` check for `streamPatchesSince` in the MaterializeLiveStrategy
file is redundant because `streamPatchesSince` is a concrete method defined on
the `PatchCollector` interface and will always exist at runtime. Remove the
unnecessary conditional check and the fallback code block that duplicates the
internal logic, and instead call
`this.runtime.deps.patches.streamPatchesSince(checkpoint)` directly followed by
the return statement. This eliminates the dead code and makes the intention
clearer.
test/unit/domain/crdt/CrdtShimRetirement.test.ts (1)

33-36: ⚡ Quick win

Consider checking for alternative export syntaxes.

The test only checks for export function ${shim} and export const ${shim} patterns. Alternative export syntaxes like export { createVersionVector } or export { createVersionVector as vvCreate } would not be caught.

🔍 Enhanced pattern matching

Consider adding checks for re-export patterns:

 for (const shim of FORBIDDEN_VERSION_VECTOR_SHIMS) {
   expect(source).not.toContain(`export function ${shim}`);
   expect(source).not.toContain(`export const ${shim}`);
+  // Also catch re-exports: export { createVersionVector }
+  expect(source).not.toMatch(new RegExp(`export\\s*{[^}]*\\b${shim}\\b[^}]*}`));
 }
🤖 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/unit/domain/crdt/CrdtShimRetirement.test.ts` around lines 33 - 36, The
test loop checking for forbidden shims only validates `export function` and
`export const` patterns but misses alternative export syntaxes. Add additional
expect statements in the loop iterating over FORBIDDEN_VERSION_VECTOR_SHIMS to
also check for re-export patterns including `export { ${shim} }` and `export {
${shim} as` to catch cases where shims might be re-exported using destructuring
syntax or with aliases.
src/domain/services/query/GraphTraversal.ts (1)

140-140: ⚡ Quick win

Extract abort-check cadence into a named constant.

The 1000 literal appears twice in traversal loops. Pull it into a shared constant to avoid magic numbers and keep cadence changes atomic.

♻️ Proposed refactor
+const ABORT_CHECK_INTERVAL = 1000;
+
   private async *_bfsStream(run: PrimitiveTraversalRun): AsyncGenerator<string> {
@@
-        if (run.visited.size % 1000 === 0) { checkAborted(run.signal, 'bfs'); }
+        if (run.visited.size % ABORT_CHECK_INTERVAL === 0) { checkAborted(run.signal, 'bfs'); }
@@
   private async *_dfsStream(run: PrimitiveTraversalRun): AsyncGenerator<string> {
@@
-      if (run.visited.size % 1000 === 0) { checkAborted(run.signal, 'dfs'); }
+      if (run.visited.size % ABORT_CHECK_INTERVAL === 0) { checkAborted(run.signal, 'dfs'); }

As per coding guidelines, use named constants instead of magic strings or numbers in TypeScript code.

Also applies to: 185-185

🤖 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/domain/services/query/GraphTraversal.ts` at line 140, The magic number
1000 for the abort-check cadence appears multiple times in the traversal logic
(in the condition checking run.visited.size % 1000 === 0 at the location shown
and another similar occurrence). Extract this value into a named constant at the
top of the GraphTraversal class or file (e.g., something like
ABORT_CHECK_CADENCE or TRAVERSAL_ABORT_CHECK_INTERVAL) and replace all
occurrences of the literal 1000 with this constant reference. This eliminates
magic numbers and ensures that any future changes to the cadence only need to be
updated in one place.

Source: Coding guidelines

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

196-197: ⚡ Quick win

Replace magic defaults with named constants in minimal().

Line 196 and Line 197 hardcode string defaults. Please lift them into named constants for consistency with src/**/*.{ts,tsx} standards.

Suggested refactor
+const DEFAULT_OPEN_GRAPH_NAME = 'default';
+const DEFAULT_OPEN_WRITER_ID = 'local';
+
   static minimal(options: {
     persistence: CorePersistence & Partial<RuntimeStorageCapabilityPort>;
     graphName?: string;
     writerId?: string;
   }): WarpOpenOptions {
     return new WarpOpenOptions({
       persistence: options.persistence,
-      graphName: options.graphName ?? 'default',
-      writerId: options.writerId ?? 'local',
+      graphName: options.graphName ?? DEFAULT_OPEN_GRAPH_NAME,
+      writerId: options.writerId ?? DEFAULT_OPEN_WRITER_ID,
     });
   }

As per coding guidelines, src/**/*.{ts,tsx} requires named constants instead of magic strings or numbers.

🤖 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/domain/warp/RuntimeHostBoot.ts` around lines 196 - 197, The `minimal()`
function contains hardcoded string defaults 'default' for graphName and 'local'
for writerId on lines 196-197. Replace these magic strings by defining named
constants at the top of the file or in an appropriate constants section, then
use those constant references instead of the literal strings in the graphName
and writerId property assignments.

Source: Coding guidelines

src/domain/services/coordinate/SubstrateCoordinateBoundary.ts (1)

48-66: 💤 Low value

Remove the unnecessary includesName helper.

The includesName function is a trivial wrapper around Array.includes() that adds no value. Inline the calls directly to reduce indirection.

♻️ Proposed refactor
-function includesName(names: readonly string[], name: string): boolean {
-  return names.includes(name);
-}
-
 export default class SubstrateCoordinateBoundary {
   readonly laneKinds = SUBSTRATE_LANE_KINDS;
   readonly coordinateKinds = SUBSTRATE_COORDINATE_KINDS;
   readonly substrateCapabilities = SUBSTRATE_CAPABILITY_NAMES;
   readonly sessionPolicyCapabilities = SESSION_POLICY_CAPABILITY_NAMES;
 
   authorityFor(capabilityName: string): SubstrateCapabilityAuthority | null {
-    if (includesName(SUBSTRATE_CAPABILITY_NAMES, capabilityName)) {
+    if (SUBSTRATE_CAPABILITY_NAMES.includes(capabilityName)) {
       return 'substrate';
     }
-    if (includesName(SESSION_POLICY_CAPABILITY_NAMES, capabilityName)) {
+    if (SESSION_POLICY_CAPABILITY_NAMES.includes(capabilityName)) {
       return 'session-policy';
     }
     return 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 `@src/domain/services/coordinate/SubstrateCoordinateBoundary.ts` around lines
48 - 66, Remove the trivial includesName helper function that wraps
Array.includes() and replace its two usages in the authorityFor method with
direct calls to the includes method. Change
includesName(SUBSTRATE_CAPABILITY_NAMES, capabilityName) to
SUBSTRATE_CAPABILITY_NAMES.includes(capabilityName) and
includesName(SESSION_POLICY_CAPABILITY_NAMES, capabilityName) to
SESSION_POLICY_CAPABILITY_NAMES.includes(capabilityName) to eliminate
unnecessary indirection.
test/unit/domain/services/query/BoundedSupportRule.test.ts (1)

16-37: ⚡ Quick win

Simplify empty generator functions.

The nodes() and neighbors() generators create empty arrays and then iterate over them, which is unnecessarily verbose. Since the arrays are empty, the loops never execute.

♻️ Proposed simplification
 class NoopQueryReadModelProvider implements QueryReadModelProvider {
   async openQueryReadModel(_request?: QueryReadModelOpenRequest): Promise<QueryReadModel> {
     return {
       stateHash: 'unused',
       async *nodes() {
-        const nodes: QueryNodeSnapshot[] = [];
-        for (const node of nodes) {
-          yield node;
-        }
+        // Empty generator - no nodes to yield
       },
       async *neighbors() {
-        const neighbors: QueryNeighborEntry[] = [];
-        for (const neighbor of neighbors) {
-          yield neighbor;
-        }
+        // Empty generator - no neighbors to yield
       },
       async nodeProps() {
         return 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/unit/domain/services/query/BoundedSupportRule.test.ts` around lines 16 -
37, The `nodes()` and `neighbors()` generator methods in the
NoopQueryReadModelProvider class are creating empty arrays and then iterating
over them with for-loops that never execute. Simplify both of these generator
methods by removing the unnecessary empty array declarations and for-loop
constructs, leaving just the generator function definitions with no yield
statements since they should return empty generators.
src/domain/services/controllers/MaterializeCoordinateStrategy.ts (1)

66-68: ⚡ Quick win

Replace magic number with named constant.

The literal 0 at line 67 is a magic number. Extract it to a named constant to improve readability and maintainability.

♻️ Suggested refactor
+const MIN_INCLUSIVE_CEILING = 1;
+
 export default class MaterializeCoordinateStrategy {
   private readonly runtime: MaterializeStrategyRuntime;

   constructor(runtime: MaterializeStrategyRuntime) {
     this.runtime = runtime;
   }

   // ... other methods ...

   private ceilingExcludesAll(ceiling: number | null): boolean {
-    return ceiling !== null && ceiling <= 0;
+    return ceiling !== null && ceiling < MIN_INCLUSIVE_CEILING;
   }

As per coding guidelines: "Use named constants instead of magic strings or numbers in TypeScript code" for files in src/**/*.{ts,tsx}.

🤖 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/domain/services/controllers/MaterializeCoordinateStrategy.ts` around
lines 66 - 68, The ceilingExcludesAll method contains a magic number (0) that
should be extracted to a named constant for improved readability and
maintainability. Define a private or class-level constant (such as
MINIMUM_CEILING_THRESHOLD or ZERO_BOUNDARY) at the top of the
MaterializeCoordinateStrategy class and replace the literal 0 in the
ceilingExcludesAll method's comparison (ceiling <= 0) with this named constant
reference.

Source: Coding guidelines

src/domain/services/merge/MergeClassifier.ts (1)

10-32: ⚡ Quick win

Replace inline reason-code literals with named constants.

These branches hardcode reason strings in multiple places, which makes code drift easier as the taxonomy evolves. Please centralize the reason codes into a typed constant map and reuse it in all return paths.

♻️ Suggested refactor
+const MERGE_REASON = Object.freeze({
+  SHARED_PRECURSOR: 'shared-precursor',
+  MISSING_SHARED_PRECURSOR: 'missing-shared-precursor',
+  OVERLAPPING_FOOTPRINTS: 'overlapping-footprints',
+  DISJOINT_FOOTPRINTS: 'disjoint-footprints',
+  CANDIDATE_JOIN: 'candidate-join',
+  LOWERING_WITNESS: 'lowering-witness',
+  OBSTRUCTION_WITNESS: 'obstruction-witness',
+  NO_CANDIDATE_JOIN: 'no-candidate-join',
+  POLICY_REQUIREMENT: 'policy-requirement',
+} as const);
+
 function precursorReason(evidence: MergeClassificationEvidence): string {
-  return evidence.sharedPrecursor ? 'shared-precursor' : 'missing-shared-precursor';
+  return evidence.sharedPrecursor ? MERGE_REASON.SHARED_PRECURSOR : MERGE_REASON.MISSING_SHARED_PRECURSOR;
 }

As per coding guidelines, src/**/*.{ts,tsx} requires: “Use named constants instead of magic strings or numbers in TypeScript code”.

Also applies to: 38-39

🤖 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/domain/services/merge/MergeClassifier.ts` around lines 10 - 32, The
functions precursorReason, footprintReason, and classifyWithoutPolicy contain
hardcoded reason code strings such as 'shared-precursor',
'missing-shared-precursor', 'overlapping-footprints', 'disjoint-footprints',
'candidate-join', 'lowering-witness', 'obstruction-witness', 'projection',
'semantic', and 'no-candidate-join' scattered throughout the code. Create a
named constants object at the top of the file that maps descriptive constant
names to these reason code values, then replace all hardcoded string literals in
precursorReason, footprintReason, and classifyWithoutPolicy with references to
these constants to ensure consistency and prevent code drift as the taxonomy
evolves.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@bin/cli/commands/mcp/McpProtocol.ts`:
- Around line 190-191: The isRequestId function currently accepts all numeric
types including NaN and Infinity when checking typeof value === 'number', but
these are not valid JSON-RPC IDs and can break request/response correlation.
Modify the numeric validation check in isRequestId to use Number.isFinite() to
ensure only finite numbers are accepted as valid request IDs, while keeping the
existing checks for undefined, null, and regular strings intact.

In `@bin/cli/commands/serve.ts`:
- Line 23: The `.nonnegative()` method in Zod 3.24.1 requires the error message
to be passed as an object property, not as a direct string argument. In the port
field definition, change the `.nonnegative()` call from accepting a string
parameter directly to wrapping the message in an object with a message property
(e.g., { message: 'port must be a non-negative integer' }). This will align the
code with the correct Zod API syntax and the pattern used consistently
throughout the codebase.

In `@src/domain/services/OpStrategyRegistryValidation.ts`:
- Around line 29-33: The code in the registry validation loop assumes each
strategy value is a valid object, but malformed entries (null or undefined) will
cause a raw TypeError when accessing strategy[methodName] instead of throwing a
PatchError, breaking the validator's error contract. Add guard checks before
accessing strategy properties in both requireStrategyMethod and
requireReceiptName functions to validate that strategy is a valid object, and
throw a PatchError with a descriptive message if the strategy is null,
undefined, or not an object, ensuring consistent error handling throughout the
validator.

In `@src/domain/services/query/CausalIndexPlan.ts`:
- Around line 109-117: The validation helpers requireNonEmptyString and
freezeStringList are duplicated across CausalIndexPlan.ts and
SupportFragmentPlan.ts with the same implementations. Create a new shared
utility module at src/domain/services/query/queryValidation.ts and move both
requireNonEmptyString and freezeStringList implementations there, ensuring they
support the trim-and-return pattern. Update both CausalIndexPlan.ts and
SupportFragmentPlan.ts to import these helpers from the new shared utility
module instead of maintaining local copies, passing the errorCode parameter as
needed (E_QUERY_CAUSAL_INDEX_PLAN for CausalIndexPlan and the appropriate code
for SupportFragmentPlan).

In `@src/domain/services/strand/StrandCoordinator.ts`:
- Around line 315-317: The materialize() method now delegates to
materializeReadState() which implements live/pinned auto-selection behavior for
determining the parent basis, but the patch listing methods getPatchEntries()
and patchesFor() still default to using pinned basis only. To align the
behavior, update both getPatchEntries() and patchesFor() methods to use the same
parent-basis auto-selection logic from materializeReadState() instead of
defaulting to pinned basis, ensuring that materialize() and patch listing
operations produce consistent results for the same strand.

In `@src/domain/services/sync/SyncPayloadSchema.ts`:
- Around line 103-106: The syncRequestPageSchema function currently only
validates maxPatches with a minimum constraint using z.number().int().min(1),
but lacks a maximum constraint, allowing clients to request arbitrarily large
values and causing excessive server-side memory allocation. Add a
.max(limits.maxPatches) constraint to the maxPatches field validation in the
syncRequestPageSchema function to match the response schema validation and
prevent this resource amplification DoS vector.

In `@src/domain/utils/canonicalStringify.ts`:
- Around line 18-25: The sortedReplacer function in
src/domain/utils/canonicalStringify.ts violates the boundary typing rule by
using unknown type outside of adapter code. Replace both instances of unknown in
the function signature with an explicit JSON value type. The value parameter and
the return type should use a defined JSON value type (such as JsonValue or
similar) that represents valid JSON-serializable values instead of the generic
unknown type.

In `@src/domain/warp/RuntimeHostBoot.ts`:
- Line 138: The gcPolicy property in RuntimeHostBoot is being assigned a direct
reference to the caller's options.gcPolicy object. This allows external
mutations of the original object to affect the RuntimeHostBoot instance even
though Object.freeze is applied (which only provides shallow freezing). Create a
snapshot or deep copy of options.gcPolicy before assigning it to this.gcPolicy
to prevent external mutations from affecting the stored policy configuration.

In `@test/unit/infrastructure/adapters/CasPayloadPointer.test.ts`:
- Line 45: The assertion at line 45 uses toBe(bytes) which checks for reference
identity, causing the test to fail if readPayloadBlob() returns an equivalent
defensive copy of the bytes object. Replace the toBe matcher with toEqual or
toStrictEqual to perform value equality comparison instead, ensuring the test
validates the actual byte content rather than object identity.

---

Nitpick comments:
In `@src/domain/services/controllers/MaterializeCoordinateStrategy.ts`:
- Around line 66-68: The ceilingExcludesAll method contains a magic number (0)
that should be extracted to a named constant for improved readability and
maintainability. Define a private or class-level constant (such as
MINIMUM_CEILING_THRESHOLD or ZERO_BOUNDARY) at the top of the
MaterializeCoordinateStrategy class and replace the literal 0 in the
ceilingExcludesAll method's comparison (ceiling <= 0) with this named constant
reference.

In `@src/domain/services/controllers/MaterializeLiveStrategy.ts`:
- Line 21: The null/undefined check in the condition at line 21 is redundant
because loadCheckpoint() returns CheckpointData | null, not CheckpointData |
undefined. Remove the explicit !== undefined check from the if statement
condition that validates the checkpoint object before calling
isCurrentCheckpointSchema(checkpoint.schema). You can either keep checkpoint !==
null alone or use the loose inequality checkpoint != null, both of which will
correctly handle null values and allow the schema check to proceed safely.
- Around line 47-50: The `typeof` check for `streamPatchesSince` in the
MaterializeLiveStrategy file is redundant because `streamPatchesSince` is a
concrete method defined on the `PatchCollector` interface and will always exist
at runtime. Remove the unnecessary conditional check and the fallback code block
that duplicates the internal logic, and instead call
`this.runtime.deps.patches.streamPatchesSince(checkpoint)` directly followed by
the return statement. This eliminates the dead code and makes the intention
clearer.

In `@src/domain/services/coordinate/SubstrateCoordinateBoundary.ts`:
- Around line 48-66: Remove the trivial includesName helper function that wraps
Array.includes() and replace its two usages in the authorityFor method with
direct calls to the includes method. Change
includesName(SUBSTRATE_CAPABILITY_NAMES, capabilityName) to
SUBSTRATE_CAPABILITY_NAMES.includes(capabilityName) and
includesName(SESSION_POLICY_CAPABILITY_NAMES, capabilityName) to
SESSION_POLICY_CAPABILITY_NAMES.includes(capabilityName) to eliminate
unnecessary indirection.

In `@src/domain/services/merge/MergeClassifier.ts`:
- Around line 10-32: The functions precursorReason, footprintReason, and
classifyWithoutPolicy contain hardcoded reason code strings such as
'shared-precursor', 'missing-shared-precursor', 'overlapping-footprints',
'disjoint-footprints', 'candidate-join', 'lowering-witness',
'obstruction-witness', 'projection', 'semantic', and 'no-candidate-join'
scattered throughout the code. Create a named constants object at the top of the
file that maps descriptive constant names to these reason code values, then
replace all hardcoded string literals in precursorReason, footprintReason, and
classifyWithoutPolicy with references to these constants to ensure consistency
and prevent code drift as the taxonomy evolves.

In `@src/domain/services/query/GraphTraversal.ts`:
- Line 140: The magic number 1000 for the abort-check cadence appears multiple
times in the traversal logic (in the condition checking run.visited.size % 1000
=== 0 at the location shown and another similar occurrence). Extract this value
into a named constant at the top of the GraphTraversal class or file (e.g.,
something like ABORT_CHECK_CADENCE or TRAVERSAL_ABORT_CHECK_INTERVAL) and
replace all occurrences of the literal 1000 with this constant reference. This
eliminates magic numbers and ensures that any future changes to the cadence only
need to be updated in one place.

In `@src/domain/warp/RuntimeHostBoot.ts`:
- Around line 196-197: The `minimal()` function contains hardcoded string
defaults 'default' for graphName and 'local' for writerId on lines 196-197.
Replace these magic strings by defining named constants at the top of the file
or in an appropriate constants section, then use those constant references
instead of the literal strings in the graphName and writerId property
assignments.

In `@test/unit/domain/crdt/CrdtShimRetirement.test.ts`:
- Around line 33-36: The test loop checking for forbidden shims only validates
`export function` and `export const` patterns but misses alternative export
syntaxes. Add additional expect statements in the loop iterating over
FORBIDDEN_VERSION_VECTOR_SHIMS to also check for re-export patterns including
`export { ${shim} }` and `export { ${shim} as` to catch cases where shims might
be re-exported using destructuring syntax or with aliases.

In `@test/unit/domain/services/query/BoundedSupportRule.test.ts`:
- Around line 16-37: The `nodes()` and `neighbors()` generator methods in the
NoopQueryReadModelProvider class are creating empty arrays and then iterating
over them with for-loops that never execute. Simplify both of these generator
methods by removing the unnecessary empty array declarations and for-loop
constructs, leaving just the generator function definitions with no yield
statements since they should return empty generators.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: e438d299-0b42-4a96-abb9-1b193d48b6db

📥 Commits

Reviewing files that changed from the base of the PR and between 13ea2d2 and 81a2add.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (246)
  • CHANGELOG.md
  • README.md
  • bin/cli/commands/checkpoint.ts
  • bin/cli/commands/fork.ts
  • bin/cli/commands/gc.ts
  • bin/cli/commands/mcp.ts
  • bin/cli/commands/mcp/McpJsonValue.ts
  • bin/cli/commands/mcp/McpProtocol.ts
  • bin/cli/commands/mcp/McpProtocolError.ts
  • bin/cli/commands/mcp/McpToolCatalog.ts
  • bin/cli/commands/registry.ts
  • bin/cli/commands/serve.ts
  • bin/cli/commands/sync.ts
  • bin/cli/commands/watch.ts
  • bin/cli/infrastructure.ts
  • docs/ADVANCED_GUIDE.md
  • docs/API_REFERENCE.md
  • docs/ARCHITECTURE.md
  • docs/CLI_GUIDE.md
  • docs/CONCEPTUAL_OVERVIEW.md
  • docs/DOCTRINE_RUNTIME_ALIGNMENT.md
  • docs/GLOSSARY.md
  • docs/GUIDE.md
  • docs/README.md
  • docs/VISION.md
  • docs/archive/retrospectives/2026-04-01-tsc-zero-and-joinreducer-strategy.md
  • docs/audit/2026-06-20_tsc-zero-agent-merge-audit.md
  • docs/audits/WARP_DOCTRINE_RUNTIME_ALIGNMENT.md
  • docs/audits/WARP_DRIFT.md
  • docs/checklists/adr-2-go-no-go-checklist.md
  • docs/migrations/v17.0.0.md
  • docs/specs/CONTENT_ATTACHMENT.md
  • docs/specs/LANE_COORDINATE_CAPABILITY_BOUNDARY.md
  • index.ts
  • package.json
  • patches/@git-stunts+trailer-codec+2.1.1.patch
  • patches/README.md
  • scripts/migrations/v17.0.0/SubstrateMigrationCompatibilityPolicy.ts
  • scripts/source-size-gate.ts
  • scripts/source-version-name-policy.ts
  • src/continuumExports.ts
  • src/domain/RuntimeHost.ts
  • src/domain/WarpApp.ts
  • src/domain/WarpCore.ts
  • src/domain/WarpGraph.ts
  • src/domain/WarpWorldline.ts
  • src/domain/WarpWorldlineCoordinate.ts
  • src/domain/capabilities/ComparisonCapability.ts
  • src/domain/capabilities/DetachedGraphFactory.ts
  • src/domain/capabilities/MaterializeCapability.ts
  • src/domain/capabilities/PatchCollector.ts
  • src/domain/capabilities/QueryCapability.ts
  • src/domain/capabilities/SyncCapability.ts
  • src/domain/continuum/GitWarpReceiptEnvelopeBoundary.ts
  • src/domain/continuum/GitWarpWitnessedSuffixAdmissionOutcome.ts
  • src/domain/continuum/GitWarpWitnessedSuffixAdmissionShell.ts
  • src/domain/crdt/ORSet.ts
  • src/domain/crdt/VersionVector.ts
  • src/domain/errors/OperationPolicyExhaustedError.ts
  • src/domain/errors/OperationPolicyTimeoutError.ts
  • src/domain/errors/index.ts
  • src/domain/runtimeHelpers.ts
  • src/domain/services/OpStrategies.ts
  • src/domain/services/OpStrategyRegistryValidation.ts
  • src/domain/services/PatchBuilder.ts
  • src/domain/services/PatchCommitter.ts
  • src/domain/services/ProjectionHandle.ts
  • src/domain/services/codec/MessageCodecInternal.ts
  • src/domain/services/codec/MessageSchemaDetector.ts
  • src/domain/services/comparison/GraphDiff.ts
  • src/domain/services/controllers/ComparisonController.ts
  • src/domain/services/controllers/ComparisonEngine.ts
  • src/domain/services/controllers/MaterializeCeilingStrategy.ts
  • src/domain/services/controllers/MaterializeCheckpointStrategy.ts
  • src/domain/services/controllers/MaterializeController.ts
  • src/domain/services/controllers/MaterializeCoordinateStrategy.ts
  • src/domain/services/controllers/MaterializeLiveStrategy.ts
  • src/domain/services/controllers/MaterializePatchStreamReducer.ts
  • src/domain/services/controllers/MaterializePatchSummary.ts
  • src/domain/services/controllers/MaterializeStrategyRuntime.ts
  • src/domain/services/controllers/QueryController.ts
  • src/domain/services/controllers/StrandController.ts
  • src/domain/services/controllers/SyncController.ts
  • src/domain/services/coordinate/SubstrateCoordinateBoundary.ts
  • src/domain/services/merge/MergeClassification.ts
  • src/domain/services/merge/MergeClassificationEvidence.ts
  • src/domain/services/merge/MergeClassificationKind.ts
  • src/domain/services/merge/MergeClassifier.ts
  • src/domain/services/merge/TtdMergeBranch.ts
  • src/domain/services/merge/TtdMergeFootprint.ts
  • src/domain/services/merge/TtdMergeInspection.ts
  • src/domain/services/merge/TtdMergeInspectionDomain.ts
  • src/domain/services/merge/TtdMergeInspector.ts
  • src/domain/services/merge/TtdMergeLoweringSurface.ts
  • src/domain/services/merge/TtdMergeLoweringWitness.ts
  • src/domain/services/merge/TtdMergeObstructionWitness.ts
  • src/domain/services/merge/TtdMergePolicyRequirement.ts
  • src/domain/services/merge/TtdMergeValidation.ts
  • src/domain/services/optic/StreamingCheckpointBasisBuilder.ts
  • src/domain/services/query/BoundedSupportRule.ts
  • src/domain/services/query/CausalIndexPlan.ts
  • src/domain/services/query/GraphTraversal.ts
  • src/domain/services/query/LogicalTraversal.ts
  • src/domain/services/query/Observer.ts
  • src/domain/services/query/ObserverAccumulation.ts
  • src/domain/services/query/ObserverBasis.ts
  • src/domain/services/query/ObserverEmission.ts
  • src/domain/services/query/ObserverPlan.ts
  • src/domain/services/query/ObserverReadingEnvelope.ts
  • src/domain/services/query/QueryBuilder.ts
  • src/domain/services/query/QueryReadModelProvider.ts
  • src/domain/services/query/QueryRunner.ts
  • src/domain/services/query/SupportFragmentPlan.ts
  • src/domain/services/strand/ConflictAnalyzerService.ts
  • src/domain/services/strand/ConflictCandidateCollector.ts
  • src/domain/services/strand/ConflictFrameLoader.ts
  • src/domain/services/strand/ConflictPipelineContext.ts
  • src/domain/services/strand/ConflictTraceAssembler.ts
  • src/domain/services/strand/StrandCoordinator.ts
  • src/domain/services/strand/StrandMaterializer.ts
  • src/domain/services/strand/conflictCandidateAnalysis.ts
  • src/domain/services/strand/conflictTargetIdentity.ts
  • src/domain/services/sync/SyncAuthService.ts
  • src/domain/services/sync/SyncPayloadSchema.ts
  • src/domain/services/sync/SyncProtocol.ts
  • src/domain/services/sync/SyncResponsePaging.ts
  • src/domain/services/sync/syncRequestResponse.ts
  • src/domain/trust/schemas.ts
  • src/domain/types/Aperture.ts
  • src/domain/types/DeliveryObservation.ts
  • src/domain/types/EffectEmission.ts
  • src/domain/types/TickReceipt.ts
  • src/domain/types/WarpPersistence.ts
  • src/domain/utils/canonicalStringify.ts
  • src/domain/utils/scalarValidation.ts
  • src/domain/warp/RuntimeHostBoot.ts
  • src/domain/warp/RuntimeHostProduct.ts
  • src/domain/warp/RuntimePatchCollector.ts
  • src/domain/warp/WarpCoreRuntimeProduct.ts
  • src/domain/warp/WarpGraphRuntimeBridge.ts
  • src/domain/warp/WarpGraphRuntimeProduct.ts
  • src/domain/warp/Writer.ts
  • src/globals.d.ts
  • src/infrastructure/adapters/AlfredOperationPolicyAdapter.ts
  • src/infrastructure/adapters/CasBlobAdapter.ts
  • src/infrastructure/adapters/CasContentEncryptionPolicy.ts
  • src/infrastructure/adapters/CasIndexStorageAdapter.ts
  • src/infrastructure/adapters/CasPayloadPointer.ts
  • src/infrastructure/adapters/CasSeekCacheAdapter.ts
  • src/infrastructure/adapters/CborCheckpointStoreAdapter.ts
  • src/infrastructure/adapters/CborIndexStoreAdapter.ts
  • src/infrastructure/adapters/CborPatchJournalAdapter.ts
  • src/infrastructure/adapters/FetchSyncHttpClientAdapter.ts
  • src/infrastructure/adapters/GitGraphAdapter.ts
  • src/infrastructure/adapters/GitRecursiveTreeOidReaderAdapter.ts
  • src/infrastructure/adapters/GitTrustChainAdapter.ts
  • src/infrastructure/adapters/NoopOperationPolicyAdapter.ts
  • src/infrastructure/adapters/SubstrateCompatibilityPolicy.ts
  • src/infrastructure/adapters/gitErrorClassification.ts
  • src/ports/OperationPolicyPort.ts
  • src/ports/SyncHttpClientPort.ts
  • src/ports/WarpKernelPort.ts
  • test/benchmark/MergeConflictCorpus.benchmark.ts
  • test/conformance/queryReadModelSeam.test.ts
  • test/fixtures/mergeConflictCorpus.ts
  • test/type-check/consumer.ts
  • test/type-check/trailer-codec.d.ts
  • test/type-check/tsconfig.json
  • test/unit/cli/commands/mcp.test.ts
  • test/unit/domain/RuntimePatchCollector.stream.test.ts
  • test/unit/domain/WarpGraph.encryption.test.ts
  • test/unit/domain/WarpGraph.materializeSlice.test.ts
  • test/unit/domain/WarpGraph.strands.compare.test.ts
  • test/unit/domain/WarpGraph.strands.test.ts
  • test/unit/domain/WarpGraph.test.ts
  • test/unit/domain/WarpGraph.traverse.stream.test.ts
  • test/unit/domain/WarpWorldline.capabilities.test.ts
  • test/unit/domain/WarpWorldline.test.ts
  • test/unit/domain/WarpWorldlineCoordinate.test.ts
  • test/unit/domain/continuum/GitWarpReceiptEnvelopeBoundary.test.ts
  • test/unit/domain/continuum/GitWarpWitnessedSuffixAdmissionShell.test.ts
  • test/unit/domain/crdt/CrdtShimRetirement.test.ts
  • test/unit/domain/crdt/ORSet.test.ts
  • test/unit/domain/crdt/VersionVector.test.ts
  • test/unit/domain/errors/index.test.ts
  • test/unit/domain/index.exports.test.ts
  • test/unit/domain/publicReadingSurface.behavior.test.ts
  • test/unit/domain/services/EdgePropSetWireMigrationGate.test.ts
  • test/unit/domain/services/GraphTraversal.stream.test.ts
  • test/unit/domain/services/MessageCodecModules.test.ts
  • test/unit/domain/services/OpStrategyRegistryValidation.test.ts
  • test/unit/domain/services/ProjectionHandle.test.ts
  • test/unit/domain/services/SchemaCompat.test.ts
  • test/unit/domain/services/SyncAuthService.test.ts
  • test/unit/domain/services/WarpMessageCodec.v3.test.ts
  • test/unit/domain/services/comparison/GraphDiff.test.ts
  • test/unit/domain/services/controllers/MaterializeController.snapshotCache.test.ts
  • test/unit/domain/services/controllers/MaterializeController.stateSession.test.ts
  • test/unit/domain/services/controllers/MaterializeController.test.ts
  • test/unit/domain/services/controllers/MaterializePatchStreamReducer.test.ts
  • test/unit/domain/services/controllers/QueryController.test.ts
  • test/unit/domain/services/controllers/StrandController.host-interface.test.ts
  • test/unit/domain/services/coordinate/SubstrateCoordinateBoundary.test.ts
  • test/unit/domain/services/merge/MergeClassifier.test.ts
  • test/unit/domain/services/merge/TtdMergeInspector.test.ts
  • test/unit/domain/services/query/BoundedSupportRule.test.ts
  • test/unit/domain/services/query/CausalIndexPlan.test.ts
  • test/unit/domain/services/query/ObserverStructural.test.ts
  • test/unit/domain/services/query/SupportFragmentPlan.test.ts
  • test/unit/domain/services/strand/ConflictAnalyzerService.test.ts
  • test/unit/domain/services/sync/SyncResponsePagingMetrics.test.ts
  • test/unit/domain/specCompliance.test.ts
  • test/unit/domain/trust/schemas.test.ts
  • test/unit/domain/utils/canonicalStringify.test.ts
  • test/unit/domain/utils/scalarValidation.test.ts
  • test/unit/domain/warp/PatchSession.test.ts
  • test/unit/domain/warp/WarpOpenOptions.test.ts
  • test/unit/domain/warp/Writer.sameWriterRace.test.ts
  • test/unit/fixtures/mergeConflictCorpus.test.ts
  • test/unit/index.exports.test.ts
  • test/unit/infrastructure/adapters/CasBlobAdapter.test.ts
  • test/unit/infrastructure/adapters/CasContentEncryptionPolicy.test.ts
  • test/unit/infrastructure/adapters/CasPayloadPointer.test.ts
  • test/unit/infrastructure/adapters/CborPatchJournalAdapter.test.ts
  • test/unit/infrastructure/adapters/GitGraphAdapter.gitCasPersistence.test.ts
  • test/unit/infrastructure/adapters/OperationPolicyAdapter.test.ts
  • test/unit/scripts/architecture-doc-shape.test.ts
  • test/unit/scripts/audit-ambient-time-ratchet.test.ts
  • test/unit/scripts/cli-command-gap-closeout.test.ts
  • test/unit/scripts/cli-command-registry.test.ts
  • test/unit/scripts/cli-help-shape.test.ts
  • test/unit/scripts/conflict-pipeline-context.test.ts
  • test/unit/scripts/dependency-hygiene.test.ts
  • test/unit/scripts/docs-runtime-convergence-ratchet.test.ts
  • test/unit/scripts/lane-coordinate-boundary.test.ts
  • test/unit/scripts/non-ts-tail-shape.test.ts
  • test/unit/scripts/observer-first-guide.test.ts
  • test/unit/scripts/op-hydration-boundary-ratchet.test.ts
  • test/unit/scripts/runtime-noun-doc-graph.test.ts
  • test/unit/scripts/source-size-inventory-command.test.ts
  • test/unit/scripts/tsc-zero-agent-audit.test.ts
  • test/unit/scripts/v17-public-doc-read-contract.test.ts
  • test/unit/scripts/v18-content-property-closeout-audit.test.ts
  • test/unit/scripts/v18-package-surface-audit.test.ts
  • test/unit/scripts/warp-doctrine-runtime-alignment.test.ts
  • test/unit/scripts/warpserve-boundary-ratchet.test.ts
💤 Files with no reviewable changes (6)
  • test/unit/scripts/non-ts-tail-shape.test.ts
  • test/type-check/trailer-codec.d.ts
  • src/globals.d.ts
  • test/unit/domain/WarpGraph.materializeSlice.test.ts
  • test/unit/domain/WarpGraph.test.ts
  • src/domain/services/optic/StreamingCheckpointBasisBuilder.ts

Comment thread bin/cli/commands/mcp/McpProtocol.ts Outdated
Comment thread bin/cli/commands/serve.ts Outdated
Comment thread src/domain/services/OpStrategyRegistryValidation.ts Outdated
Comment thread src/domain/services/query/CausalIndexPlan.ts Outdated
Comment thread src/domain/services/strand/StrandCoordinator.ts
Comment thread src/domain/services/sync/SyncPayloadSchema.ts Outdated
Comment thread src/domain/utils/canonicalStringify.ts Outdated
Comment thread src/domain/warp/RuntimeHostBoot.ts Outdated
Comment thread test/unit/infrastructure/adapters/CasPayloadPointer.test.ts Outdated
@flyingrobots

Copy link
Copy Markdown
Member Author

@codex Code Lawyer Activity Summary for PR #664 follow-up

Item Severity Source File / Area Commit Outcome
1 P1 Review thread bin/cli/commands/mcp/McpProtocol.ts 77b580f8 JSON-RPC request IDs now reject NaN and infinities with regression coverage.
2 P2 Review thread bin/cli/commands/serve.ts c68fc494 Serve port schema now uses the Zod message-object form.
3 P1 Review thread src/domain/services/OpStrategyRegistryValidation.ts e4ad4d09, b9f27188 Malformed strategy entries now throw PatchError; validator input type now reflects null/undefined rejection.
4 P2 Review thread src/domain/services/query/*Plan.ts 6a20ac61 Duplicated query-plan validation helpers moved to queryValidation.ts.
5 P1 Review thread src/domain/services/strand/StrandCoordinator.ts e3340bf9 Strand patch listing now uses the same live/pinned parent-basis selection as read materialization.
6 P0 Review thread src/domain/services/sync/SyncPayloadSchema.ts 06eb26ce Sync request page maxPatches is capped by configured payload limits.
7 P2 Review thread src/domain/utils/canonicalStringify.ts 31c87e4e sortedReplacer now exposes an explicit recursive canonical JSON value type instead of unknown.
8 P2 Review thread src/domain/warp/RuntimeHostBoot.ts 4f92fef3 Runtime open options now snapshot plain gcPolicy configs and preserve GCPolicy value objects.
9 P3 Review thread test/unit/infrastructure/adapters/CasPayloadPointer.test.ts 9ea98f24 CAS payload pointer test now asserts byte value equality instead of object identity.
10 P2 Self / CI coverage-threshold Review-fix regression tests Local coverage gate now passes at 92.11% lines.

Review-thread resolution:

Gate Result
Unresolved GraphQL review threads 0
Resolved via GraphQL this pass 6

Local validation after fixes:

Gate Result
git diff --check origin/main...HEAD PASS
npm run lint:quarantine-graduate PASS
npm run lint:sludge PASS
npm run typecheck:policy PASS
npm run lint PASS
npm run typecheck PASS
npm run typecheck:surface PASS
npm run build --silent PASS
npm run lint:md PASS
npm run lint:md:code PASS
npm run test:local PASS
npx vitest run test/integration PASS
docker compose -f docker/docker-compose.test.yml run --rm --volume /tmp/git-warp-bun-tmp:/tmp test-bun PASS
docker compose -f docker/docker-compose.test.yml run --rm test-deno PASS
npm run test:coverage:ci PASS, 92.11% lines
pre-push IRONCLAD M9 gate PASS

@flyingrobots

Copy link
Copy Markdown
Member Author

Code Lawyer Activity Summary

@codex second opinion requested on the self-discovered CI coverage blocker and closure evidence.

Source Severity File Commit Outcome
PR/Self P1 bin/cli/commands/mcp/McpProtocol.ts, test/unit/cli/commands/mcp.test.ts 77b580f8 Rejected non-finite MCP request IDs with deterministic regression coverage.
PR/Self P2 bin/cli/commands/serve.ts c68fc494 Restored Zod-compatible serve port schema message.
PR/Self P1 src/domain/services/OpStrategyRegistryValidation.ts, test/unit/domain/services/OpStrategyRegistryValidation.test.ts e4ad4d09 Guarded malformed strategy registry entries.
Self P4 src/domain/services/query/queryValidation.ts, query plan modules 6a20ac61 Deduplicated query plan validation helpers.
PR/Self P1 src/domain/services/strand/StrandCoordinator.ts, test/unit/domain/services/strand/StrandService.test.ts e3340bf9 Aligned strand patch listing with live parent basis.
PR/Self P1 src/domain/services/sync/SyncPayloadSchema.ts, test/unit/domain/services/sync/SyncResponsePagingMetrics.test.ts 06eb26ce Capped sync request page size to configured limits.
Self P4 src/domain/utils/canonicalStringify.ts 31c87e4e Tightened canonical replacer typing.
PR/Self P1 src/domain/warp/RuntimeHostBoot.ts, test/unit/domain/warp/WarpOpenOptions.test.ts 4f92fef3 Snapshotted runtime GC policy config against caller mutation.
Self P5 test/unit/infrastructure/adapters/CasPayloadPointer.test.ts 9ea98f24 Compared CAS payload bytes by value.
Self P2 src/domain/services/OpStrategyRegistryValidation.ts, test/unit/domain/services/OpStrategyRegistryValidation.test.ts b9f27188 Typed malformed strategy validation contract for test typecheck.
CI/Self P1 test/unit/domain/warp/RuntimeStateStore.test.ts fef0c2a8 Added deterministic runtime state-store cache coverage; local npm run test:coverage:ci now reports 92.21% lines against the 92.10% threshold.

Local verification after the latest fix:

  • npx vitest run test/unit/domain/warp/RuntimeStateStore.test.ts passed.
  • npm run test:coverage:ci passed at 92.21% line coverage.
  • npm run typecheck passed.
  • npm run lint passed.
  • git diff --check origin/main...HEAD passed.
  • Pre-push IRONCLAD M9 passed on fef0c2a8.

Current PR thread state: 0 unresolved review threads after refresh.

@flyingrobots

Copy link
Copy Markdown
Member Author

Code Lawyer Activity Summary Update

@codex second opinion requested on the final CI preflight fix.

Source Severity File Commit Outcome
CI/Self P1 src/domain/services/merge/TtdMergeInspector.ts 45c74b59 Added an explicit MergeClassifier type annotation to the public constructor parameter so npx -y jsr publish --dry-run clears JSR slow-types validation without using --allow-slow-types.

Verification:

  • RED: npx -y jsr publish --dry-run failed locally with missing-explicit-type at TtdMergeInspector.ts:221:15.
  • GREEN: npx -y jsr publish --dry-run --allow-dirty passed before commit.
  • VERIFY: After commit 45c74b59, npx -y jsr publish --dry-run passed with a clean worktree.
  • npm run typecheck, npm run lint, and git diff --check origin/main...HEAD passed.
  • Pre-push IRONCLAD M9 passed on 45c74b59.

Current PR thread state after refresh: 0 unresolved review threads.

@github-actions

Copy link
Copy Markdown

Release Preflight

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

If you tag this commit as v18.0.0, release workflow will publish.

@flyingrobots flyingrobots merged commit e1ca43b into main Jun 21, 2026
18 checks passed
@flyingrobots flyingrobots deleted the priority-next-runtime-boundaries-batch-1 branch June 21, 2026 01:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment