Skip to content

Align CLI and MCP with v19 vocabulary - #798

Merged
flyingrobots merged 5 commits into
mainfrom
v19-cli-mcp-vocabulary
Jul 27, 2026
Merged

Align CLI and MCP with v19 vocabulary#798
flyingrobots merged 5 commits into
mainfrom
v19-cli-mcp-vocabulary

Conversation

@flyingrobots

Copy link
Copy Markdown
Member

Replaces the graph-first command surface with the generated v19 CLI/MCP contract, persistent Runtime strand/settlement workflows, and canonical Reading/Receipt rendering. Removes the obsolete CLI implementation, tests, package alias, and current-doc vocabulary.

Validation: IRONCLAD pre-push firewall; 7,043 stable unit tests passed (2 skipped); 65 focused tests and 8 BATS tests passed; all aggregate timeout cases passed in serialized replay; packed and generated-SDK consumer smokes passed.

Closes #794.

@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@flyingrobots, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 3 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 645eb49a-4b29-47dc-8c75-302e3dea3c66

📥 Commits

Reviewing files that changed from the base of the PR and between f72875a and 0e184c2.

📒 Files selected for processing (16)
  • bin/cli/commands/mcp/McpDomainTools.ts
  • bin/cli/commands/mcp/McpRuntimeSession.ts
  • bin/cli/commands/settle.ts
  • bin/cli/shared.ts
  • bin/cli/v19/V19Runtime.ts
  • bin/cli/v19/V19SettlementReview.ts
  • bin/presenters/V19Json.ts
  • bin/presenters/V19ReadingReceipt.ts
  • package.json
  • src/application/Runtime.ts
  • test/unit/application/Runtime.test.ts
  • test/unit/cli/commands/mcp.test.ts
  • test/unit/cli/shared.test.ts
  • test/unit/cli/v19-input-errors.test.ts
  • test/unit/cli/v19-runtime.test.ts
  • test/unit/scripts/node22-ci-command.test.ts
📝 Walkthrough

Walkthrough

This PR aligns the CLI and MCP surfaces with the v19 Runtime/Lane model, adds canonical write/observe/settlement workflows, supports persisted strand reopening, and updates packaging, documentation, diagnostics, and tests.

Changes

v19 public surface alignment

Layer / File(s) Summary
Capability contract and CLI foundation
bin/cli/capabilities/*, bin/cli/infrastructure.ts, bin/cli/shared.ts, bin/cli/commands/registry.ts, bin/git-warp*, package.json
Generated capabilities now drive CLI help, command registration, MCP descriptors, parsing, and JSONL output. Legacy graph-first commands and the warp-graph entrypoint are removed.
CLI workflows and canonical envelopes
bin/cli/commands/{write,observe,fork,settle,receipt,repair,audit}*, bin/cli/v19/*, bin/presenters/*
Adds validated Intent/Observer input, canonical Reading/Receipt envelopes, lane-scoped repair and diagnostics, and settlement preview/apply revalidation.
MCP runtime session and tools
bin/cli/commands/mcp*
Adds serialized runtime sessions, retained receipts/plans, observation cursors, and domain/diagnostic MCP tools.
Persisted strands and draft hydration
src/application/*, src/domain/*, index.ts
Adds Runtime.strand(), persisted draft coordinates and patches, intent hydration, and checkpoint/frontier validation for reopened strands.
Documentation and validation
docs/*, README.md, docker/*, scripts/*, test/*
Updates v19 guidance, container shims, smoke tests, capability checks, hooks, and CLI/MCP/runtime coverage.

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

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant CLI as git-warp
  participant Runtime
  participant Lane
  Client->>CLI: write or observe request
  CLI->>Runtime: open lane
  Runtime->>Lane: write intent or observe
  Lane-->>Runtime: Receipt or Reading stream
  Runtime-->>CLI: canonical envelope
  CLI-->>Client: JSON, JSONL, or human output
Loading

Possibly related issues

Possibly related PRs

Poem

A rabbit hops through lanes anew,
Writes and readings follow through,
Strands reopen, receipts glow,
MCP tools stream what runtimes know. 🐇

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 12.73% 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 summarizes the main change: aligning CLI and MCP to the v19 vocabulary.
Description check ✅ Passed It includes a summary, validation/test notes, and the linked issue reference, though it doesn't use the template headings.
Linked Issues check ✅ Passed The changes match #794 by adding v19 CLI/MCP commands, canonical envelopes, runtime-bound operations, and updated tests/docs.
Out of Scope Changes check ✅ Passed I didn't see clear unrelated changes; the additions, deletions, docs, and test updates all support the v19 CLI/MCP alignment.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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: 17

Caution

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

⚠️ Outside diff range comments (1)
test/unit/cli/doctor.test.ts (1)

70-78: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Update CLI_OPTIONS to the current CliOptions shape.

test/unit/cli/doctor.test.ts still passes legacy graph/ndjson/view fields into handleDoctor, but createDoctorContext resolves the lane via options.lane; with these tests, that value is undefined and resolveGraphName falls back to auto-detecting a single graph. Switch the fixture to lane/strand/jsonl/writerExplicit and type it as CliOptions.

🤖 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/cli/doctor.test.ts` around lines 70 - 78, Update the CLI_OPTIONS
fixture used by the doctor tests to match the current CliOptions shape: replace
legacy graph/ndjson/view fields with lane/strand/jsonl/writerExplicit, set
values consistent with the test expectations, and type the fixture as CliOptions
instead of using any. Ensure handleDoctor receives an explicit lane so
createDoctorContext does not rely on graph auto-detection.
🤖 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/audit.ts`:
- Around line 24-28: Remove the `--writer` argument from the `args` passed to
`handleSubstrateAudit`; `options.writerExplicit` should not cause the CLI
runtime identity to become an audit filter. Preserve the existing audit
invocation and use only an audit-specific filter option when audit filtering is
explicitly requested.

In `@bin/cli/commands/doctor-v19.ts`:
- Around line 22-30: Prevent duplicate repository connections by passing the
already-open Runtime/persistence from withRuntime into handleSubstrateDoctor and
through createDoctorContext, preserving openRequiredLane validation; update
bin/cli/commands/doctor-v19.ts lines 22-30 accordingly. Apply the same change in
bin/cli/commands/audit.ts lines 21-34 by passing the withRuntime-opened
connection into handleSubstrateAudit instead of allowing createPersistence to
reopen it.

In `@bin/cli/commands/mcp/McpDomainTools.ts`:
- Around line 121-130: Update startObservation’s observation handling so it does
not fully materialize the async stream before returning observationId. Replace
the unbounded readings array accumulation with a bounded or lazy retained
transport, while preserving receipt retention and ensuring limit-based
pagination operates on the retained observation data.

In `@bin/cli/commands/observe.ts`:
- Line 82: Wrap the observerFromText call in the observe command with the CLI’s
established usage-error handling, matching the pattern used for write.ts’s
intentFromText parsing. Ensure JSON or zod parsing failures are converted into
the expected usage error instead of escaping unhandled.

In `@bin/cli/commands/receipt.ts`:
- Around line 26-27: Update receipt-file parsing around parseMcpJson and
JSON.parse(text) to catch filesystem and JSON parsing failures, then route them
through the CLI’s usageError convention. Preserve successful parsing behavior
and ensure the resulting usage error includes the underlying failure context.
- Around line 31-42: Replace the manual parsing in receiptInputPath with the
shared parseCommandArgs flow and the receipt command’s zod argument schema,
matching the implementations used by write, observe, fork, and settle. Ensure
both --input <path> and --input=<path> are accepted, while preserving validation
that the command is show and input is required; route invalid arguments through
the shared usage-error formatting.

In `@bin/cli/commands/settle.ts`:
- Around line 133-136: Wrap the plan-file read, JSON parsing, parseMcpJson call,
and reviewedSettlementFromValue processing in the existing usage-error handling
flow for the settle command. Convert filesystem, JSON, and schema validation
failures into usageError responses while preserving the successful reviewed
settlement path.

In `@bin/cli/commands/write.ts`:
- Line 41: Update the write command’s intent handling around intentFromText so
JSON parsing and validation failures are caught and converted to the command
family’s usageError convention before calling lane.write. Preserve successful
intent conversion and writing behavior, and follow the existing usageError
pattern used by related commands.

In `@bin/cli/v19/V19DomainInput.ts`:
- Around line 77-117: Wrap JSON.parse failures in intentFromText and
observerFromText with usageError, and wrap validation failures from
INTENT_SCHEMA.parse and READING_SCHEMA.parse in intentFromValue and
observerFromValue with usageError. Preserve the existing successful parsing and
descriptor dispatch behavior while ensuring malformed CLI input consistently
produces the established usageError failure path.
- Line 1: Normalize all user-input parsing failures to the CLI’s usageError
convention: update intentFromText, observerFromText, intentFromValue, and
observerFromValue to catch JSON.parse and schema-parse errors and rethrow
usageError with the underlying message; update reviewedSettlementFromValue and
receiptResult similarly, and wrap settle’s JSON.parse plus
reviewedSettlementFromValue call in usageError handling. Keep existing
successful parsing behavior unchanged; write and observe are covered through
their helper functions.

In `@bin/cli/v19/V19SettlementReview.ts`:
- Around line 69-77: Update reviewedSettlementFromValue to catch validation
failures from REVIEW_SCHEMA.parse and convert them through the CLI’s usageError
convention, while preserving the existing frozen selector and plan construction
for valid values.
- Around line 28-29: Align PLAN_SCHEMA with the fields enforced by
freezePlanFields and compared in planParts: either add invalidationRule to
SettlementPlanFields and ReviewedSettlement.plan so it is preserved and checked
during apply, or remove it from PLAN_SCHEMA so unsupported values are rejected.

In `@bin/presenters/V19Json.ts`:
- Around line 4-6: Update toMcpJson to pass value directly to parseMcpJson
instead of performing the JSON.stringify/JSON.parse round-trip, preserving
parseMcpJson’s validation and E_V19_JSON_VALUE errors for undefined, functions,
non-finite numbers, and other invalid values.

In `@src/domain/api/IntentRuntime.ts`:
- Around line 46-53: Update isCascadingNodeRemoval so the EdgeRemove operations
preceding the terminal NodeRemove are accepted only when each edge is connected
to the node being removed. Validate both edge endpoints against the terminal
removal’s node identity, and return false for unrelated edge removals so they
are preserved during reopening and join.

In `@src/domain/services/strand/StrandCoordinator.ts`:
- Line 120: Update the StrandCoordinator creation flow wherever
normalized.baseCheckpointSha is used to require a corresponding baseFrontier
whenever a checkpoint is supplied. Reject the input before capturing or
persisting the live frontier, ensuring checkpointSha and baseFrontier are always
provided together and preventing mismatched reopened strand coordinates.

In `@src/domain/WarpWorldline.ts`:
- Around line 49-56: Replace the structural WarpDraftPatchEntry type with a
frozen runtime-backed class that validates patch and sha inputs through its
constructor. Update getStrandOverlayPatches and the LoadDraftPatchEntries
hydration path to instantiate this class for every persisted entry, preserving
the existing public fields and readonly behavior.

In `@test/bats/helpers/setup.bash`:
- Around line 3-17: Update setup_test_repo in test/bats/helpers/setup.bash to
configure CLI with the compiled dist/bin/git-warp.js entrypoint instead of
bin/git-warp.ts. Also update the direct subprocess invocation in
test/bats/v19-cli.bats lines 197-231 to use the same compiled entrypoint; no
other behavior should change.

---

Outside diff comments:
In `@test/unit/cli/doctor.test.ts`:
- Around line 70-78: Update the CLI_OPTIONS fixture used by the doctor tests to
match the current CliOptions shape: replace legacy graph/ndjson/view fields with
lane/strand/jsonl/writerExplicit, set values consistent with the test
expectations, and type the fixture as CliOptions instead of using any. Ensure
handleDoctor receives an explicit lane so createDoctorContext does not rely on
graph auto-detection.
🪄 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 Plus

Run ID: 89b9b0bd-06e4-4c37-b974-fb1c9ce5105a

📥 Commits

Reviewing files that changed from the base of the PR and between 1d2613d and d28f3c6.

⛔ Files ignored due to path filters (2)
  • bin/cli/capabilities/V19CapabilityContract.generated.ts is excluded by !**/*.generated.*
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (171)
  • .github/workflows/ci.yml
  • README.md
  • bin/cli/capabilities/v19-capabilities.json
  • bin/cli/commands/MaterializationRepair.ts
  • bin/cli/commands/audit.ts
  • bin/cli/commands/bisect.ts
  • bin/cli/commands/check.ts
  • bin/cli/commands/checkpoint.ts
  • bin/cli/commands/debug.ts
  • bin/cli/commands/debug/conflicts.ts
  • bin/cli/commands/debug/coordinate.ts
  • bin/cli/commands/debug/provenance.ts
  • bin/cli/commands/debug/receipts.ts
  • bin/cli/commands/debug/shared.ts
  • bin/cli/commands/debug/timeline.ts
  • bin/cli/commands/doctor-v19.ts
  • bin/cli/commands/doctor/checks.ts
  • bin/cli/commands/doctor/checksAux.ts
  • bin/cli/commands/doctor/checksMaterializationCache.ts
  • bin/cli/commands/doctor/codes.ts
  • bin/cli/commands/doctor/index.ts
  • bin/cli/commands/doctor/storageCapabilities.ts
  • bin/cli/commands/fork.ts
  • bin/cli/commands/gc.ts
  • bin/cli/commands/history.ts
  • bin/cli/commands/info.ts
  • bin/cli/commands/install-hooks.ts
  • bin/cli/commands/materialize.ts
  • bin/cli/commands/mcp.ts
  • bin/cli/commands/mcp/McpDiagnosticTools.ts
  • bin/cli/commands/mcp/McpDomainTool.ts
  • bin/cli/commands/mcp/McpDomainTools.ts
  • bin/cli/commands/mcp/McpProtocol.ts
  • bin/cli/commands/mcp/McpRuntimeSession.ts
  • bin/cli/commands/mcp/McpToolCatalog.ts
  • bin/cli/commands/mcp/McpToolInput.ts
  • bin/cli/commands/observe.ts
  • bin/cli/commands/optic.ts
  • bin/cli/commands/patch.ts
  • bin/cli/commands/path.ts
  • bin/cli/commands/query.ts
  • bin/cli/commands/receipt.ts
  • bin/cli/commands/registry.ts
  • bin/cli/commands/reindex.ts
  • bin/cli/commands/repair.ts
  • bin/cli/commands/seek.ts
  • bin/cli/commands/seekCursorHelpers.ts
  • bin/cli/commands/serve.ts
  • bin/cli/commands/settle.ts
  • bin/cli/commands/strand.ts
  • bin/cli/commands/strand/braid.ts
  • bin/cli/commands/strand/compare.ts
  • bin/cli/commands/strand/create.ts
  • bin/cli/commands/strand/drop.ts
  • bin/cli/commands/strand/list.ts
  • bin/cli/commands/strand/materialize.ts
  • bin/cli/commands/strand/show.ts
  • bin/cli/commands/strand/transfer-plan.ts
  • bin/cli/commands/sync.ts
  • bin/cli/commands/tree.ts
  • bin/cli/commands/trust.ts
  • bin/cli/commands/verify-audit.ts
  • bin/cli/commands/verify-index.ts
  • bin/cli/commands/watch.ts
  • bin/cli/commands/write.ts
  • bin/cli/infrastructure.ts
  • bin/cli/schemas.ts
  • bin/cli/shared.ts
  • bin/cli/time-travel-shared.ts
  • bin/cli/types.ts
  • bin/cli/v19/V19DomainInput.ts
  • bin/cli/v19/V19Runtime.ts
  • bin/cli/v19/V19SettlementReview.ts
  • bin/git-warp
  • bin/git-warp.ts
  • bin/presenters/V19Json.ts
  • bin/presenters/V19ReadingReceipt.ts
  • bin/presenters/json.ts
  • docker/Dockerfile.node20
  • docker/Dockerfile.node22
  • docker/Dockerfile.node22-slim
  • docs/TECHNICAL_TEARDOWN.md
  • docs/operations/README.md
  • docs/topics/api/README.md
  • docs/topics/cas-first-memoized-materialization.md
  • docs/topics/cli.md
  • docs/topics/getting-started.md
  • docs/topics/querying.md
  • docs/topics/reference.md
  • docs/topics/strands.md
  • docs/topics/sync.md
  • docs/topics/troubleshooting.md
  • eslint.config.ts
  • index.ts
  • package.json
  • scripts/GenerateV19CapabilityContract.ts
  • scripts/check-source-backed-reference.ts
  • scripts/hooks/post-merge.sh
  • scripts/smoke-generated-sdk.sh
  • scripts/smoke-packed-artifact.sh
  • scripts/source-size-gate.ts
  • src/application/Runtime.ts
  • src/application/RuntimeLaneAdapter.ts
  • src/application/RuntimeStrandLaneBinding.ts
  • src/application/RuntimeStrandLaneOpening.ts
  • src/domain/RuntimeHost.ts
  • src/domain/WarpWorldline.ts
  • src/domain/WarpWorldlineDraftStorage.ts
  • src/domain/api/DraftTimelineRuntime.ts
  • src/domain/api/IntentRuntime.ts
  • src/domain/api/LaneRuntime.ts
  • src/domain/services/controllers/StrandController.ts
  • src/domain/services/strand/StrandCoordinator.ts
  • src/domain/services/strand/StrandDescriptorValidation.ts
  • src/domain/types/StrandDescriptor.ts
  • src/domain/utils/parseStrandBlob.ts
  • src/domain/warp/RuntimeHostProduct.ts
  • test/bats/cli-check.bats
  • test/bats/cli-doctor.bats
  • test/bats/cli-errors.bats
  • test/bats/cli-history.bats
  • test/bats/cli-info.bats
  • test/bats/cli-materialize.bats
  • test/bats/cli-mcp.bats
  • test/bats/cli-multiwriter.bats
  • test/bats/cli-ndjson.bats
  • test/bats/cli-path.bats
  • test/bats/cli-query.bats
  • test/bats/cli-seek.bats
  • test/bats/cli-trust-sync.bats
  • test/bats/cli-trust.bats
  • test/bats/cli-verify-audit.bats
  • test/bats/cli-view-modes.bats
  • test/bats/helpers/append-patch.ts
  • test/bats/helpers/inspect-seek-cursor-expiry.ts
  • test/bats/helpers/seed-audit-graph.ts
  • test/bats/helpers/seed-doctor-graph.ts
  • test/bats/helpers/seed-graph.ts
  • test/bats/helpers/seed-multiwriter.ts
  • test/bats/helpers/seed-rich.ts
  • test/bats/helpers/seed-setup.ts
  • test/bats/helpers/seed-trust-sync.ts
  • test/bats/helpers/seed-trust.ts
  • test/bats/helpers/setup.bash
  • test/bats/v19-cli.bats
  • test/bats/warp-graph-cli.bats
  • test/helpers/SettlementHarness.ts
  • test/integration/application/Runtime.fork.integration.test.ts
  • test/unit/application/Runtime.test.ts
  • test/unit/cli/commands/debug.test.ts
  • test/unit/cli/commands/mcp-lifecycle.test.ts
  • test/unit/cli/commands/mcp.test.ts
  • test/unit/cli/commands/strand.test.ts
  • test/unit/cli/doctor-materialization-cache.test.ts
  • test/unit/cli/doctor.test.ts
  • test/unit/cli/optic.test.ts
  • test/unit/cli/parseArgs.test.ts
  • test/unit/cli/schemas.test.ts
  • test/unit/cli/trust.exitcode.test.ts
  • test/unit/cli/trust.pin.test.ts
  • test/unit/cli/verify-audit.test.ts
  • test/unit/cli/verify-index.test.ts
  • test/unit/domain/DraftTimelineRuntime.test.ts
  • test/unit/domain/IntentRuntime.test.ts
  • test/unit/domain/services/strand/StrandService.test.ts
  • test/unit/scripts/cli-command-registry.test.ts
  • test/unit/scripts/cli-help-shape.test.ts
  • test/unit/scripts/release-artifact-command.test.ts
  • test/unit/scripts/source-size-inventory-command.test.ts
  • test/unit/scripts/v19-public-api-boundary.test.ts
  • tsconfig.src.json
💤 Files with no reviewable changes (78)
  • test/bats/helpers/append-patch.ts
  • test/bats/helpers/seed-doctor-graph.ts
  • test/bats/cli-trust-sync.bats
  • test/bats/cli-path.bats
  • test/bats/helpers/seed-multiwriter.ts
  • bin/cli/commands/strand/drop.ts
  • test/bats/cli-multiwriter.bats
  • bin/cli/commands/strand/show.ts
  • test/unit/cli/optic.test.ts
  • test/bats/cli-query.bats
  • test/unit/cli/trust.exitcode.test.ts
  • bin/cli/commands/gc.ts
  • bin/cli/commands/materialize.ts
  • bin/cli/commands/debug.ts
  • test/bats/helpers/seed-audit-graph.ts
  • test/bats/warp-graph-cli.bats
  • bin/cli/commands/strand/materialize.ts
  • bin/cli/commands/strand/braid.ts
  • test/unit/cli/trust.pin.test.ts
  • test/bats/cli-check.bats
  • test/bats/cli-info.bats
  • test/bats/helpers/inspect-seek-cursor-expiry.ts
  • bin/cli/commands/seekCursorHelpers.ts
  • test/bats/cli-verify-audit.bats
  • test/unit/cli/commands/strand.test.ts
  • test/bats/cli-errors.bats
  • test/bats/cli-mcp.bats
  • test/bats/helpers/seed-trust.ts
  • test/bats/cli-seek.bats
  • bin/cli/commands/path.ts
  • test/unit/cli/commands/debug.test.ts
  • bin/cli/commands/install-hooks.ts
  • bin/cli/commands/reindex.ts
  • test/unit/cli/schemas.test.ts
  • test/bats/cli-materialize.bats
  • test/bats/helpers/seed-rich.ts
  • bin/cli/commands/debug/conflicts.ts
  • bin/cli/commands/strand/list.ts
  • test/bats/cli-doctor.bats
  • bin/cli/commands/trust.ts
  • test/bats/helpers/seed-setup.ts
  • docs/TECHNICAL_TEARDOWN.md
  • bin/cli/commands/bisect.ts
  • bin/cli/commands/strand/create.ts
  • bin/cli/commands/serve.ts
  • bin/cli/commands/debug/timeline.ts
  • bin/cli/commands/seek.ts
  • bin/cli/commands/check.ts
  • test/unit/cli/verify-index.test.ts
  • bin/cli/time-travel-shared.ts
  • bin/cli/commands/history.ts
  • bin/cli/commands/strand.ts
  • test/bats/cli-trust.bats
  • bin/cli/commands/debug/coordinate.ts
  • bin/cli/commands/patch.ts
  • bin/cli/commands/debug/provenance.ts
  • test/bats/helpers/seed-trust-sync.ts
  • bin/cli/commands/checkpoint.ts
  • test/bats/helpers/seed-graph.ts
  • test/bats/cli-view-modes.bats
  • test/bats/cli-history.bats
  • bin/cli/commands/info.ts
  • bin/cli/commands/strand/compare.ts
  • test/bats/cli-ndjson.bats
  • bin/cli/commands/strand/transfer-plan.ts
  • bin/cli/commands/debug/receipts.ts
  • bin/cli/commands/tree.ts
  • bin/cli/commands/sync.ts
  • scripts/source-size-gate.ts
  • bin/cli/commands/query.ts
  • bin/cli/commands/optic.ts
  • bin/cli/commands/watch.ts
  • bin/cli/commands/verify-index.ts
  • test/unit/scripts/source-size-inventory-command.test.ts
  • bin/cli/commands/debug/shared.ts
  • bin/cli/commands/doctor/codes.ts
  • test/unit/cli/doctor-materialization-cache.test.ts
  • bin/cli/schemas.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (4)
  • GitHub Check: test-node (22)
  • GitHub Check: coverage-threshold
  • GitHub Check: v19 base/head performance
  • GitHub Check: preflight
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{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:

  • bin/cli/commands/mcp/McpToolInput.ts
  • bin/cli/commands/doctor-v19.ts
  • bin/cli/commands/mcp/McpDomainTool.ts
  • bin/cli/commands/repair.ts
  • index.ts
  • bin/cli/commands/MaterializationRepair.ts
  • bin/cli/commands/write.ts
  • src/domain/RuntimeHost.ts
  • test/unit/scripts/v19-public-api-boundary.test.ts
  • bin/presenters/json.ts
  • src/application/RuntimeStrandLaneBinding.ts
  • bin/cli/commands/verify-audit.ts
  • test/unit/domain/IntentRuntime.test.ts
  • src/domain/WarpWorldlineDraftStorage.ts
  • test/integration/application/Runtime.fork.integration.test.ts
  • test/unit/cli/commands/mcp-lifecycle.test.ts
  • test/unit/scripts/cli-help-shape.test.ts
  • test/unit/cli/verify-audit.test.ts
  • src/domain/api/LaneRuntime.ts
  • bin/presenters/V19Json.ts
  • bin/cli/commands/audit.ts
  • bin/cli/commands/receipt.ts
  • bin/cli/commands/observe.ts
  • scripts/GenerateV19CapabilityContract.ts
  • bin/cli/commands/mcp/McpDiagnosticTools.ts
  • test/unit/scripts/release-artifact-command.test.ts
  • src/domain/services/strand/StrandDescriptorValidation.ts
  • src/domain/utils/parseStrandBlob.ts
  • bin/cli/commands/doctor/checks.ts
  • src/application/RuntimeStrandLaneOpening.ts
  • bin/cli/v19/V19Runtime.ts
  • scripts/check-source-backed-reference.ts
  • test/unit/domain/services/strand/StrandService.test.ts
  • eslint.config.ts
  • test/helpers/SettlementHarness.ts
  • src/domain/types/StrandDescriptor.ts
  • bin/cli/commands/mcp/McpDomainTools.ts
  • bin/cli/v19/V19SettlementReview.ts
  • bin/cli/commands/settle.ts
  • bin/cli/v19/V19DomainInput.ts
  • src/domain/warp/RuntimeHostProduct.ts
  • bin/cli/commands/mcp/McpToolCatalog.ts
  • src/domain/api/IntentRuntime.ts
  • src/application/Runtime.ts
  • test/unit/domain/DraftTimelineRuntime.test.ts
  • test/unit/scripts/cli-command-registry.test.ts
  • bin/cli/commands/fork.ts
  • bin/presenters/V19ReadingReceipt.ts
  • test/unit/cli/commands/mcp.test.ts
  • src/domain/services/controllers/StrandController.ts
  • bin/cli/commands/doctor/checksAux.ts
  • bin/cli/commands/registry.ts
  • src/domain/services/strand/StrandCoordinator.ts
  • test/unit/application/Runtime.test.ts
  • bin/cli/commands/mcp/McpRuntimeSession.ts
  • bin/cli/commands/doctor/index.ts
  • bin/git-warp.ts
  • bin/cli/commands/doctor/storageCapabilities.ts
  • src/domain/api/DraftTimelineRuntime.ts
  • test/unit/cli/parseArgs.test.ts
  • bin/cli/types.ts
  • test/unit/cli/doctor.test.ts
  • src/application/RuntimeLaneAdapter.ts
  • bin/cli/commands/doctor/checksMaterializationCache.ts
  • bin/cli/commands/mcp/McpProtocol.ts
  • bin/cli/shared.ts
  • bin/cli/infrastructure.ts
  • src/domain/WarpWorldline.ts
  • bin/cli/commands/mcp.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/RuntimeHost.ts
  • src/application/RuntimeStrandLaneBinding.ts
  • src/domain/WarpWorldlineDraftStorage.ts
  • src/domain/api/LaneRuntime.ts
  • src/domain/services/strand/StrandDescriptorValidation.ts
  • src/domain/utils/parseStrandBlob.ts
  • src/application/RuntimeStrandLaneOpening.ts
  • src/domain/types/StrandDescriptor.ts
  • src/domain/warp/RuntimeHostProduct.ts
  • src/domain/api/IntentRuntime.ts
  • src/application/Runtime.ts
  • src/domain/services/controllers/StrandController.ts
  • src/domain/services/strand/StrandCoordinator.ts
  • src/domain/api/DraftTimelineRuntime.ts
  • src/application/RuntimeLaneAdapter.ts
  • src/domain/WarpWorldline.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/RuntimeHost.ts
  • src/domain/WarpWorldlineDraftStorage.ts
  • src/domain/api/LaneRuntime.ts
  • src/domain/services/strand/StrandDescriptorValidation.ts
  • src/domain/utils/parseStrandBlob.ts
  • src/domain/types/StrandDescriptor.ts
  • src/domain/warp/RuntimeHostProduct.ts
  • src/domain/api/IntentRuntime.ts
  • src/domain/services/controllers/StrandController.ts
  • src/domain/services/strand/StrandCoordinator.ts
  • src/domain/api/DraftTimelineRuntime.ts
  • src/domain/WarpWorldline.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/RuntimeHost.ts
  • src/domain/WarpWorldlineDraftStorage.ts
  • src/domain/api/LaneRuntime.ts
  • src/domain/services/strand/StrandDescriptorValidation.ts
  • src/domain/utils/parseStrandBlob.ts
  • src/domain/types/StrandDescriptor.ts
  • src/domain/warp/RuntimeHostProduct.ts
  • src/domain/api/IntentRuntime.ts
  • src/domain/services/controllers/StrandController.ts
  • src/domain/services/strand/StrandCoordinator.ts
  • src/domain/api/DraftTimelineRuntime.ts
  • src/domain/WarpWorldline.ts
🧠 Learnings (1)
📚 Learning: 2026-03-04T12:08:30.347Z
Learnt from: flyingrobots
Repo: git-stunts/git-warp PR: 63
File: package.json:126-126
Timestamp: 2026-03-04T12:08:30.347Z
Learning: Vitest 4 removes vite-node as a dependency and rewrites its pool system. Do not flag the absence of vite-node in package.json or lockfiles as an error for Vitest 4 projects. Use this as a general guideline: if a project uses Vitest 4, missing vite-node is expected and correct; only flag issues if there is evidence the project is not using Vitest 4 or if vite-node is explicitly required by the project.

Applied to files:

  • package.json
🪛 ast-grep (0.44.1)
test/unit/scripts/release-artifact-command.test.ts

[warning] 4: 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 {
spawnSync,
type SpawnSyncOptionsWithStringEncoding,
type SpawnSyncReturns,
} 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/unit/cli/commands/mcp.test.ts

[warning] Importing child_process exposes a command-execution surface; ensure any command/argument built from input is validated, and prefer execFile/spawn with an argument array over exec.
Context: import { execFileSync } from 'node:child_process';
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').

(detect-child-process-typescript)


[warning] Importing child_process exposes a command-execution surface; ensure any command/argument built from input is validated, and prefer execFile/spawn with an argument array over exec.
Context: import { execFileSync } from 'node:child_process';
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').

(detect-child-process-typescript)

🔇 Additional comments (94)
bin/cli/commands/mcp.ts (1)

5-161: LGTM!

bin/cli/commands/mcp/McpDomainTools.ts (1)

1-120: LGTM!

Also applies to: 138-224

bin/cli/commands/mcp/McpProtocol.ts (1)

5-126: LGTM!

bin/cli/commands/mcp/McpRuntimeSession.ts (1)

1-168: LGTM!

bin/cli/commands/mcp/McpToolCatalog.ts (1)

2-64: LGTM!

src/domain/WarpWorldline.ts (1)

26-30: LGTM!

Also applies to: 68-73, 87-94, 115-116, 137-138, 180-200

src/domain/WarpWorldlineDraftStorage.ts (1)

1-54: LGTM!

index.ts (1)

18-18: LGTM!

bin/cli/commands/mcp/McpDiagnosticTools.ts (1)

15-27: LGTM!

Also applies to: 29-100

bin/cli/commands/mcp/McpDomainTool.ts (1)

1-9: LGTM!

bin/cli/commands/mcp/McpToolInput.ts (1)

1-21: LGTM!

src/application/Runtime.ts (1)

37-49: LGTM!

Also applies to: 117-133, 167-183, 210-222

src/application/RuntimeLaneAdapter.ts (1)

3-7: LGTM!

Also applies to: 26-31, 102-105

src/application/RuntimeStrandLaneBinding.ts (1)

34-34: LGTM!

src/application/RuntimeStrandLaneOpening.ts (1)

1-107: LGTM!

src/domain/api/LaneRuntime.ts (1)

9-9: LGTM!

Also applies to: 23-23

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

190-190: LGTM!

src/domain/RuntimeHost.ts (1)

686-687: LGTM!

src/domain/api/DraftTimelineRuntime.ts (1)

2-2: LGTM!

Also applies to: 12-12, 52-58, 105-120, 298-305

src/domain/api/IntentRuntime.ts (1)

2-6: LGTM!

Also applies to: 38-44, 55-112

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

22-22: LGTM!

Also applies to: 39-41, 77-80

src/domain/services/strand/StrandCoordinator.ts (1)

42-42: LGTM!

Also applies to: 355-358

src/domain/services/strand/StrandDescriptorValidation.ts (1)

98-119: LGTM!

src/domain/types/StrandDescriptor.ts (1)

62-62: LGTM!

Also applies to: 99-104

src/domain/utils/parseStrandBlob.ts (1)

111-117: LGTM!

Also applies to: 310-310

bin/cli/commands/write.ts (1)

1-40: LGTM!

Also applies to: 42-48

bin/cli/commands/observe.ts (2)

84-87: 🚀 Performance & Scalability

Confirm observation streams are bounded before fully buffering.

All readings are collected into memory (readings.push(...)) before any output is produced. If lane.observe() can back a large/paged neighborhood query, consider streaming output as readings arrive rather than buffering the full set first.


1-81: LGTM!

Also applies to: 88-118

bin/cli/v19/V19DomainInput.ts (1)

1-76: LGTM!

Also applies to: 118-172

bin/presenters/V19Json.ts (1)

1-3: LGTM!

Also applies to: 8-42

bin/presenters/V19ReadingReceipt.ts (2)

1-38: LGTM!

Also applies to: 52-72, 88-169


39-51: 🎯 Functional Correctness

No change needed for write/settlement receipt evidence.

WriteReceipt.evidence and SettlementReceipt.evidence are required in their option types, so unconditional toMcpJson(receipt.evidence) is safe here; the optional guard is only for observation receipts.

			> Likely an incorrect or invalid review comment.
bin/cli/commands/fork.ts (1)

1-67: LGTM!

bin/cli/commands/settle.ts (1)

1-132: LGTM!

Also applies to: 137-153

bin/cli/v19/V19SettlementReview.ts (2)

1-27: LGTM!

Also applies to: 39-68, 78-104, 117-141


28-38: 🗄️ Data Integrity & Integration

No change needed.

freezeHandle stores sourceFrontier/targetFrontier normalized to { id }, while settle --out writes JSON data via toMcpJson, so preview output round-tripped through settle apply matches this schema.

README.md (1)

140-143: LGTM!

docs/operations/README.md (1)

3-85: LGTM!

docs/topics/api/README.md (1)

148-158: LGTM!

Also applies to: 599-611, 636-639

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

201-206: LGTM!

docs/topics/cli.md (1)

3-146: LGTM!

docs/topics/getting-started.md (1)

1-129: LGTM!

docs/topics/querying.md (1)

16-16: LGTM!

test/helpers/SettlementHarness.ts (1)

119-119: LGTM!

Also applies to: 146-146

test/integration/application/Runtime.fork.integration.test.ts (1)

85-154: LGTM!

test/unit/application/Runtime.test.ts (1)

32-32: LGTM!

Also applies to: 43-51, 121-121, 136-170, 225-225, 243-243

test/unit/scripts/v19-public-api-boundary.test.ts (1)

32-32: LGTM!

docs/topics/reference.md (1)

11-19: LGTM!

Also applies to: 41-74, 205-219

docs/topics/strands.md (1)

3-83: LGTM!

docs/topics/sync.md (1)

3-51: LGTM!

docs/topics/troubleshooting.md (1)

3-102: LGTM!

docker/Dockerfile.node20 (1)

20-29: LGTM!

docker/Dockerfile.node22 (1)

27-29: LGTM!

docker/Dockerfile.node22-slim (1)

22-23: LGTM!

scripts/hooks/post-merge.sh (1)

39-41: LGTM!

scripts/smoke-generated-sdk.sh (1)

50-55: LGTM!

scripts/smoke-packed-artifact.sh (1)

42-46: LGTM!

Also applies to: 59-62

test/bats/helpers/setup.bash (1)

37-53: LGTM!

test/bats/v19-cli.bats (1)

1-196: LGTM!

Also applies to: 261-266

test/unit/cli/commands/mcp-lifecycle.test.ts (1)

37-46: LGTM!

test/unit/cli/commands/mcp.test.ts (2)

1-64: LGTM!


74-293: LGTM!

test/unit/cli/parseArgs.test.ts (1)

1-85: LGTM!

test/unit/cli/verify-audit.test.ts (1)

32-37: LGTM!

test/unit/domain/DraftTimelineRuntime.test.ts (1)

54-54: LGTM!

Also applies to: 82-95

test/unit/domain/IntentRuntime.test.ts (1)

1-117: LGTM!

test/unit/domain/services/strand/StrandService.test.ts (1)

690-690: LGTM!

Also applies to: 707-707, 716-717

test/unit/scripts/cli-command-registry.test.ts (1)

1-91: LGTM!

test/unit/scripts/cli-help-shape.test.ts (1)

3-35: LGTM!

test/unit/scripts/release-artifact-command.test.ts (1)

136-141: LGTM!

.github/workflows/ci.yml (1)

127-128: LGTM!

bin/cli/capabilities/v19-capabilities.json (1)

1-196: LGTM!

bin/cli/commands/registry.ts (1)

3-33: LGTM!

bin/git-warp (1)

10-21: LGTM!

bin/cli/commands/doctor/index.ts (1)

38-53: LGTM!

bin/cli/commands/doctor/storageCapabilities.ts (2)

27-27: LGTM!


56-57: 🩺 Stability & Availability

No remaining repairMaterializationCache imports to address.

scripts/GenerateV19CapabilityContract.ts (1)

84-94: 🗄️ Data Integrity & Integration

No change needed.

check:capabilities invokes this script with --check, and bin/cli/capabilities/V19CapabilityContract.generated.ts is committed in the repository.

bin/git-warp.ts (1)

134-161: 🩺 Stability & Availability

No change needed.

mcp returns payload: undefined, close, and completion, so emitResult skips stdout and the result flows into the long-running command path.

package.json (1)

75-76: LGTM!

bin/cli/infrastructure.ts (1)

107-207: LGTM! The extractBaseArgs/parseArgs rewrite correctly separates global flags from command tokens, handles --flag=value and --, and derives writerExplicit from the raw args rather than the defaulted value.

bin/cli/shared.ts (1)

101-135: LGTM! Lane resolution/existence validation logic is correct and doesn't duplicate listGraphNames calls across branches.

bin/cli/types.ts (1)

7-16: LGTM!

bin/cli/commands/doctor/checksAux.ts (1)

109-138: LGTM!

bin/cli/commands/verify-audit.ts (1)

49-52: LGTM! Consistent rename to options.lane.

bin/cli/v19/V19Runtime.ts (1)

10-37: LGTM!

eslint.config.ts (1)

512-512: LGTM!

tsconfig.src.json (1)

12-12: LGTM!

scripts/check-source-backed-reference.ts (1)

240-240: LGTM!

Also applies to: 278-281

bin/presenters/json.ts (1)

5-5: LGTM!

bin/cli/commands/doctor/checks.ts (1)

155-155: LGTM!

Also applies to: 166-166, 231-231, 256-256

bin/cli/commands/doctor/checksMaterializationCache.ts (1)

122-122: LGTM!

Also applies to: 141-141, 157-157

bin/cli/commands/MaterializationRepair.ts (1)

1-24: LGTM!

bin/cli/commands/repair.ts (1)

1-38: LGTM!

Comment thread bin/cli/commands/audit.ts
Comment thread bin/cli/commands/doctor-v19.ts
Comment thread bin/cli/commands/mcp/McpDomainTools.ts Outdated
Comment thread bin/cli/commands/observe.ts
Comment thread bin/cli/commands/receipt.ts Outdated
Comment thread bin/presenters/V19Json.ts
Comment thread src/domain/api/IntentRuntime.ts
Comment thread src/domain/services/strand/StrandCoordinator.ts
Comment thread src/domain/WarpWorldline.ts
Comment thread test/bats/helpers/setup.bash

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

Caution

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

⚠️ Outside diff range comments (1)
src/application/Runtime.ts (1)

119-128: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Use strand-specific foreign-lane diagnostics.

Line 127 calls the fork-specific ownership guard, so Runtime.strand() rejects a foreign parent with Runtime.fork requires… and E_RUNTIME_FORK_FOREIGN_LANE. Emit a strand-specific message/code (or parameterize the shared guard).

🤖 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/application/Runtime.ts` around lines 119 - 128, Update Runtime.strand()
and its requireOwnedLaneRuntime ownership guard usage so foreign-parent failures
report strand-specific diagnostics, using a strand message and
E_RUNTIME_STRAND_FOREIGN_LANE (or an equivalent parameterized guard) instead of
fork-specific values; leave Runtime.fork() diagnostics unchanged.
🤖 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/McpRuntimeSession.ts`:
- Around line 92-112: Update retainObservation to register the
ObservationTransport and return immediately without calling pullObservation,
always returning the new observationId with terminal false and receiptRef null;
leave the initial stream pull to readObservation.

In `@bin/cli/v19/V19Runtime.ts`:
- Around line 24-29: Update the runtime execution flow around the task call and
runtime.close so failures from both are captured; when task rejects and cleanup
also fails, throw an AggregateError containing both errors, while preserving the
existing single-error behavior when only one operation fails.

In `@bin/presenters/V19Json.ts`:
- Around line 4-5: Update toMcpJson and the related object-handling paths to
accept only objects whose prototype is Object.prototype or null. Reject Date,
Map, class instances, and other non-plain prototypes with E_V19_JSON_VALUE
instead of passing them to parseMcpJson or converting them to {}.

---

Outside diff comments:
In `@src/application/Runtime.ts`:
- Around line 119-128: Update Runtime.strand() and its requireOwnedLaneRuntime
ownership guard usage so foreign-parent failures report strand-specific
diagnostics, using a strand message and E_RUNTIME_STRAND_FOREIGN_LANE (or an
equivalent parameterized guard) instead of fork-specific values; leave
Runtime.fork() diagnostics unchanged.
🪄 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 Plus

Run ID: bfa08077-737f-4184-a823-eafd27b2dad7

📥 Commits

Reviewing files that changed from the base of the PR and between d28f3c6 and f72875a.

📒 Files selected for processing (30)
  • bin/cli/commands/audit.ts
  • bin/cli/commands/doctor-v19.ts
  • bin/cli/commands/doctor/index.ts
  • bin/cli/commands/doctor/storageCapabilities.ts
  • bin/cli/commands/mcp/McpDomainTools.ts
  • bin/cli/commands/mcp/McpRuntimeSession.ts
  • bin/cli/commands/receipt.ts
  • bin/cli/commands/settle.ts
  • bin/cli/commands/verify-audit.ts
  • bin/cli/infrastructure.ts
  • bin/cli/shared.ts
  • bin/cli/v19/V19DomainInput.ts
  • bin/cli/v19/V19Runtime.ts
  • bin/cli/v19/V19SettlementReview.ts
  • bin/presenters/V19Json.ts
  • src/application/Runtime.ts
  • src/application/RuntimeStorageAccess.ts
  • src/domain/WarpDraftPatchEntry.ts
  • src/domain/WarpWorldline.ts
  • src/domain/api/IntentRuntime.ts
  • src/domain/services/strand/StrandCoordinator.ts
  • test/bats/helpers/setup.bash
  • test/bats/v19-cli.bats
  • test/unit/cli/commands/mcp.test.ts
  • test/unit/cli/commands/v19-diagnostics.test.ts
  • test/unit/cli/doctor.test.ts
  • test/unit/cli/v19-input-errors.test.ts
  • test/unit/domain/DraftTimelineRuntime.test.ts
  • test/unit/domain/IntentRuntime.test.ts
  • test/unit/domain/services/strand/StrandService.test.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (5)
  • GitHub Check: coverage-threshold
  • GitHub Check: test-deno
  • GitHub Check: test-node (22)
  • GitHub Check: v19 base/head performance
  • GitHub Check: preflight
🧰 Additional context used
📓 Path-based instructions (4)
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/application/RuntimeStorageAccess.ts
  • src/domain/WarpDraftPatchEntry.ts
  • src/application/Runtime.ts
  • src/domain/services/strand/StrandCoordinator.ts
  • src/domain/WarpWorldline.ts
  • src/domain/api/IntentRuntime.ts
**/*.{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:

  • src/application/RuntimeStorageAccess.ts
  • bin/cli/commands/doctor-v19.ts
  • test/unit/cli/v19-input-errors.test.ts
  • src/domain/WarpDraftPatchEntry.ts
  • test/unit/cli/commands/v19-diagnostics.test.ts
  • bin/cli/v19/V19Runtime.ts
  • test/unit/domain/DraftTimelineRuntime.test.ts
  • bin/cli/commands/verify-audit.ts
  • test/unit/domain/IntentRuntime.test.ts
  • bin/presenters/V19Json.ts
  • src/application/Runtime.ts
  • bin/cli/commands/doctor/storageCapabilities.ts
  • bin/cli/commands/doctor/index.ts
  • bin/cli/commands/audit.ts
  • test/unit/domain/services/strand/StrandService.test.ts
  • bin/cli/commands/receipt.ts
  • src/domain/services/strand/StrandCoordinator.ts
  • test/unit/cli/commands/mcp.test.ts
  • src/domain/WarpWorldline.ts
  • bin/cli/v19/V19DomainInput.ts
  • bin/cli/commands/mcp/McpDomainTools.ts
  • test/unit/cli/doctor.test.ts
  • bin/cli/commands/settle.ts
  • src/domain/api/IntentRuntime.ts
  • bin/cli/v19/V19SettlementReview.ts
  • bin/cli/commands/mcp/McpRuntimeSession.ts
  • bin/cli/infrastructure.ts
  • bin/cli/shared.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/WarpDraftPatchEntry.ts
  • src/domain/services/strand/StrandCoordinator.ts
  • src/domain/WarpWorldline.ts
  • src/domain/api/IntentRuntime.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/WarpDraftPatchEntry.ts
  • src/domain/services/strand/StrandCoordinator.ts
  • src/domain/WarpWorldline.ts
  • src/domain/api/IntentRuntime.ts
🪛 ast-grep (0.44.1)
test/unit/cli/commands/mcp.test.ts

[warning] Importing child_process exposes a command-execution surface; ensure any command/argument built from input is validated, and prefer execFile/spawn with an argument array over exec.
Context: import { execFileSync } from 'node:child_process';
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').

(detect-child-process-typescript)

🔇 Additional comments (31)
bin/cli/infrastructure.ts (1)

3-44: LGTM!

Also applies to: 45-96, 97-126, 127-173, 174-222, 223-267

test/bats/v19-cli.bats (1)

1-12: LGTM!

Also applies to: 13-26, 27-46, 47-70, 72-93, 94-106, 107-196, 197-260, 261-265

bin/cli/commands/audit.ts (1)

1-43: LGTM!

bin/cli/commands/doctor-v19.ts (1)

1-31: LGTM!

bin/cli/commands/doctor/index.ts (1)

10-20: LGTM!

Also applies to: 38-61

bin/cli/commands/doctor/storageCapabilities.ts (1)

10-19: LGTM!

Also applies to: 29-33, 63-63

bin/cli/v19/V19DomainInput.ts (1)

10-27: LGTM!

Also applies to: 29-76, 78-111, 113-146, 148-201

bin/cli/commands/settle.ts (1)

1-46: LGTM!

Also applies to: 47-65, 67-89, 91-113, 115-124, 126-148, 150-162, 164-169

bin/cli/v19/V19Runtime.ts (1)

2-14: LGTM!

Also applies to: 16-23, 32-44

bin/cli/commands/verify-audit.ts (1)

7-11: LGTM!

Also applies to: 53-65

bin/cli/v19/V19SettlementReview.ts (1)

10-10: LGTM!

Also applies to: 18-24, 33-43, 45-72, 74-86, 88-101, 111-130, 133-155

bin/cli/shared.ts (2)

110-121: 🎯 Functional Correctness

Ensure explicit lanes are existence-checked for every caller.

resolveGraphName now returns any non-empty explicit lane without consulting persistence. openGraph adds a separate check, but direct callers such as handleVerifyAudit and doctor context creation use this helper without that validation. If downstream storage services accept unknown timeline names, a typo in --lane can inspect an empty or incorrect target instead of returning a not-found error. Move the check into this helper or add equivalent validation to every direct caller.


3-20: LGTM!

Also applies to: 47-52, 66-80, 127-146, 187-187

bin/cli/commands/mcp/McpDomainTools.ts (1)

111-157: LGTM!

bin/cli/commands/mcp/McpRuntimeSession.ts (1)

7-90: LGTM!

Also applies to: 115-235

bin/cli/commands/receipt.ts (1)

2-59: LGTM!

src/application/RuntimeStorageAccess.ts (1)

1-26: LGTM!

src/application/Runtime.ts (1)

19-67: LGTM!

src/domain/WarpDraftPatchEntry.ts (1)

1-26: LGTM!

src/domain/WarpWorldline.ts (1)

26-33: LGTM!

Also applies to: 112-146, 177-202, 391-401

src/domain/api/IntentRuntime.ts (1)

46-58: LGTM!

src/domain/services/strand/StrandCoordinator.ts (1)

186-195: LGTM!

Also applies to: 360-363, 422-438

test/unit/domain/services/strand/StrandService.test.ts (1)

681-735: LGTM!

test/bats/helpers/setup.bash (1)

3-17: LGTM!

Also applies to: 19-23, 25-31

test/unit/cli/commands/mcp.test.ts (1)

130-172: LGTM!

test/unit/cli/commands/v19-diagnostics.test.ts (1)

1-84: LGTM!

test/unit/cli/doctor.test.ts (2)

11-11: LGTM!

Also applies to: 71-80, 130-130, 190-190, 222-222


203-203: 🚀 Performance & Scalability

Confirm materialization-cache repair coverage isn't lost.

This removes the strict-mode warnings, memory-budget posture, and materialization-cache repair tests. bin/cli/commands/doctor/checksMaterializationCache.ts still exists in this PR's file set, so please confirm equivalent coverage exists in a dedicated test file (e.g., for doctor/checksMaterializationCache.ts) rather than being dropped outright.

test/unit/cli/v19-input-errors.test.ts (1)

1-131: LGTM!

test/unit/domain/DraftTimelineRuntime.test.ts (1)

3-6: LGTM!

Also applies to: 85-98, 129-146

test/unit/domain/IntentRuntime.test.ts (1)

90-100: LGTM!

Comment thread bin/cli/commands/mcp/McpRuntimeSession.ts Outdated
Comment thread bin/cli/v19/V19Runtime.ts
Comment thread bin/presenters/V19Json.ts
@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

Review follow-up: materialization-cache repair coverage remains in test/unit/cli/doctor-materialization-cache.test.ts. Its dedicated live/stale/collectible, structural/missing/malformed/expired, and fail-closed cases pass (3/3); the focused remediation suite also passes 31/31.

@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.

@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 781ee92 into main Jul 27, 2026
19 checks passed
@flyingrobots
flyingrobots deleted the v19-cli-mcp-vocabulary branch July 27, 2026 06:37
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.

Align v19 CLI and MCP capability vocabulary

1 participant