Skip to content

Advance v18 release-candidate evidence#106

Merged
flyingrobots merged 45 commits into
mainfrom
v18-continuum-slices-66-75
May 25, 2026
Merged

Advance v18 release-candidate evidence#106
flyingrobots merged 45 commits into
mainfrom
v18-continuum-slices-66-75

Conversation

@flyingrobots
Copy link
Copy Markdown
Member

@flyingrobots flyingrobots commented May 25, 2026

Summary

  • Add v18 production-runtime scratch replay, v17 wet-run fixture harnessing, zero-mismatch public-read equivalence, and guarded CLI finalization evidence.
  • Add generated Continuum/WARP Optic contract fixture ingestion, graph-model conformance checks, and a warp-ttd generated-family smoke.
  • Retire one raw content/property boundary, tighten the closeout audit, cut the v18 release-candidate evidence packet, and reconcile the backlog ledger.

Release posture

This PR puts v18 in release-candidate evidence posture, not public-release posture. Public release still requires final release-prep gates, package/version/tag work, operator release notes, residual raw content/property risk review, and an explicit guard against claiming end-to-end graph streaming in v18.

Verification

Pre-push IRONCLAD M9 passed:

  • link check
  • lint
  • markdown lint
  • markdown code sample lint
  • typecheck:src
  • typecheck:test
  • typecheck:consumer
  • typecheck:policy
  • typecheck:surface
  • test:local: 521 files / 7120 tests passed

Summary by CodeRabbit

  • New Features

    • Release-candidate evidence packet, guarded CLI finalization via reviewed JSON, and zero‑mismatch wet‑run proof; production‑runtime scratch‑replay conformance, wet‑run harness, deterministic operator reports, and drift checking.
  • Documentation

    • Extensive v18 design/backlog updates: finalization replan, generated‑contract evidence, public‑release blockers, and evidence checklist.
  • Tests

    • New/expanded unit and integration tests covering replay, finalization adapters, wet‑run harness, drift/failure fixtures, and contract smoke checks.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 25, 2026

Warning

Review limit reached

@flyingrobots, we couldn't start this review because you've used your available PR reviews for now.

Your plan includes 1 review of capacity. Refill in 15 minutes and 2 seconds.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

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

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than trial, open-source, and free plans. In all cases, review capacity refills continuously over time.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5df676e1-6b50-44d9-ab74-f1f6433366dc

📥 Commits

Reviewing files that changed from the base of the PR and between 1f1bb0f and c0f27ba.

📒 Files selected for processing (25)
  • CHANGELOG.md
  • docs/BEARING.md
  • docs/design/0237-v18-runtime-boundary-fixture-ingestion/v18-runtime-boundary-fixture-ingestion.md
  • docs/design/0238-v18-graph-model-contract-conformance/v18-graph-model-contract-conformance.md
  • docs/design/0240-v18-generated-contract-evidence-replan/v18-generated-contract-evidence-replan.md
  • scripts/v18.0.0/migrations/graph-model/GraphModelMigrationScratchRuntimeReplayTargets.ts
  • scripts/v18.0.0/migrations/graph-model/GraphModelMigrationScratchRuntimeReplayValidation.ts
  • scripts/v18.0.0/migrations/graph-model/GraphModelMigrationScratchRuntimeReplayer.ts
  • scripts/v18.0.0/migrations/graph-model/V17GoldenFixtureScratchReadingProvider.ts
  • src/domain/migrations/GraphModelMigrationRequiredString.ts
  • src/domain/migrations/GraphModelMigrationRuntimeReplayRequest.ts
  • src/domain/migrations/GraphModelMigrationRuntimeReplayResult.ts
  • src/domain/migrations/V17GoldenGraphFixtureGenesisReading.ts
  • src/infrastructure/adapters/GraphModelMigrationFinalizationRequestJsonAdapter.ts
  • test/unit/domain/migrations/V17GoldenGraphFixtureGenesisReading.test.ts
  • test/unit/infrastructure/adapters/ContinuumArtifactJsonFileAdapter.test.ts
  • test/unit/infrastructure/adapters/GraphModelMigrationFinalizationRequestJsonAdapter.test.ts
  • test/unit/scripts/migrationTestEnvironment.ts
  • test/unit/scripts/v18-graph-model-migration-command-cli.test.ts
  • test/unit/scripts/v18-production-runtime-scratch-replay-provider.test.ts
  • test/unit/scripts/v18-scratch-public-read-builder.test.ts
  • test/unit/scripts/v18-scratch-reading-builder.test.ts
  • test/unit/scripts/v18-scratch-runtime-conformance-provider.test.ts
  • test/unit/scripts/v18-v17-fixture-wet-run-harness.test.ts
  • test/unit/scripts/v18-v17-public-read-legacy-reading-builder.test.ts
📝 Walkthrough

Walkthrough

Adds guarded CLI finalization with reviewed JSON, production-runtime scratch replay and public-read/restored-legacy builders, a v17 wet-run harness/report, generated-contract conformance and warp-ttd smoke, transfer-op retirement, fixture/manifest updates, and many unit tests.

Changes

V18 migration runtime, CLI, and evidence

Layer / File(s) Summary
Docs, release notes, changelog
CHANGELOG.md, docs/**, docs/releases/**, fixtures/v17/...
Adds release-candidate evidence text, many new design docs (production-runtime replay, finalization JSON adapters, guarded finalization, wet-run harness/report, mismatch classification, generated-contract inventory/ingestion), BEARING updates, and fixture manifest updates.
CLI args and entry wiring
scripts/v18.0.0/.../GraphModelMigrationCommandCliArgs.ts, GraphModelMigrationCommandCli.ts
Adds --finalization-request flag, argument parsing, help text, finalization options construction, and wiring into runGraphModelMigrationCommand.
Finalization JSON adapters
src/infrastructure/adapters/GraphModelMigrationFinalizationRequestJsonAdapter.ts
Parses/validates finalization confirmation and request JSON into domain nouns; strict unknown-key and field validation with AdapterValidationError semantics.
Finalization review wrapper
scripts/v18.0.0/.../GraphModelMigrationFinalizationReview.ts, GraphModelMigrationCommand.ts
Compares reviewed finalization request vs observed request evidence; emits E_FINALIZATION_REVIEW_MISMATCH fatal notice when mismatched and merges with safety result.
Runtime replay provider & types
scripts/.../GraphModelMigrationProductionRuntimeReplayProvider.ts, src/domain/migrations/GraphModelMigrationRuntimeReplayRequest.ts, GraphModelMigrationRuntimeReplayResult.ts
Adds provider factory, verify/replay functions, request/result types, mapping to conformance results, and standardized failed/passed mapping including fatal notices.
Scratch runtime replayer
scripts/.../GraphModelMigrationScratchRuntimeReplayer.ts, GraphModelMigrationScratchRuntimeReplayValidation.ts, GraphModelMigrationScratchRuntimeReplayErrors.ts
Implements verified replay into an isolated runtime, deterministic operation application, strict target parsing, temp repo handling, and specific replay error codes.
Scratch public-read builder & provider
scripts/.../GraphModelMigrationScratchPublicReadBuilder.ts, GraphModelMigrationScratchReadingBuilder.ts
Builds GenesisEquivalenceReading from materialized runtime snapshot; new operation-record reader, provider factories, scalar/value validation, content-attachment handling, and error classes.
Restored legacy reading + runtime OID resolver
scripts/.../V17RestoredPublicReadLegacyReadingBuilder.ts
Validates restored writer refs/patch counts, reconstructs legacy reading with runtime-derived content OIDs via a resolver that can use a temporary runtime repo.
Fixture providers, fact key codec, property mappings
scripts/.../V17GoldenFixtureScratchReadingProvider.ts, V17GoldenFixtureScratchFactKeyCodec.ts, V17GoldenGraphFixturePropertyMappings.ts
Providers that attach fixture coverage facts and boundaries, encode/decode public fact keys, and remap property owner ids for edge-derived owners.
Wet-run harness and deterministic report
scripts/.../V17GoldenGraphFixtureWetRunHarness.ts, V17GoldenGraphFixtureWetRunReport.ts
Orchestrates fixture restore → plan → scratch run → optional runtime replay → drift checks; produces deterministic, escaped, single-line reports including runtimeReplay, mismatches, and drift sections.
Contract conformance and warp-ttd smoke
src/domain/continuum/GitWarpGraphModelContractConformance.ts, GitWarpWarpTtdGeneratedFamilySmoke.ts, test fixture JSON
Domain conformance evaluator and smoke fact generator mapping conformance into PRESENT/OBSTRUCTED facts with deterministic payload lines.
transferOps constants and CoordinateFactExport
src/domain/services/transfer/transferOps.ts, src/domain/services/CoordinateFactExport.ts
Adds named transfer operation constants and updates exporter to import/use them; documents retirement of CoordinateFactExport from raw-boundary audit and updates tests.
Tests and fixtures
test/unit/**, test/fixtures/continuum/runtime-boundary-family-generated-artifact.json
Extensive new/updated unit suites covering JSON adapter parsing, runtime replay provider, scratch public-read builder, restored legacy reading, wet-run harness/report, CLI finalization cases, contract conformance and smoke tests, and many fixtures.

Estimated code review effort
🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Poem

A rabbit taps the warp with care,
Replays the scratch through runtime air;
A token glows, the JSON true,
Live refs hold fast — no drift slips through.
Smoke puffs "present", proofs sing, spring! 🐇✨

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch v18-continuum-slices-66-75

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

Caution

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

⚠️ Outside diff range comments (3)
scripts/v18.0.0/migrations/graph-model/GraphModelMigrationCommandCli.ts (2)

1-316: 🛠️ Refactor suggestion | 🟠 Major | 🏗️ Heavy lift

Reduce this CLI script below the script LOC ceiling.

At 316 LOC, this file exceeds the scripts limit. Please split parsing, finalization-option shaping, and execution/reporting into separate modules.

As per coding guidelines: "Maximum file size: 500 LOC (source), 800 LOC (test), 300 LOC (scripts)".

🤖 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 `@scripts/v18.0.0/migrations/graph-model/GraphModelMigrationCommandCli.ts`
around lines 1 - 316, This file is too large for scripts—split parsing,
finalization shaping, and execution/reporting into separate modules: extract
parseGraphModelMigrationCommandCliArgs (and its helper readArgValue,
requireString,
GraphModelMigrationCommandCliArgs/GraphModelMigrationCommandCliArgumentError)
into a new cli-args module and export the parser and types; extract
finalizationOptions (and requireFinalizationString) plus its
GraphModelMigrationFinalizationRequest typing usage into a new
finalization-builder module that exports a function to build the finalization
object and the helper; leave runGraphModelMigrationCommandCli in this file but
refactor it to import parseGraphModelMigrationCommandCliArgs and the
finalization builder and move report-generation and file I/O
(readFile/writeFile, report write) into a small execution/reporting helper
module if desired; ensure all exported functions/classes
(parseGraphModelMigrationCommandCliArgs, finalizationOptions builder,
GraphModelMigrationCommandCliArgs, GraphModelMigrationCommandCliArgumentError,
runGraphModelMigrationCommandCli) keep their names so callers (and tests)
continue to work and update imports accordingly.

157-160: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Update the legacy-flag rejection message to match current behavior.

Now that finalization is supported via --finalization-request, saying finalization is “not supported ... yet” is misleading. Prefer wording that explicitly rejects only legacy flags and points to the request artifact flag.

🤖 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 `@scripts/v18.0.0/migrations/graph-model/GraphModelMigrationCommandCli.ts`
around lines 157 - 160, Replace the misleading rejection message thrown in the
block checking FINALIZATION_FLAGS so it explicitly rejects legacy finalization
flags and points users to the new request flag; modify the
GraphModelMigrationCommandCliArgumentError thrown when (arg !== undefined &&
FINALIZATION_FLAGS.has(arg)) to say something like "legacy finalization flags
are not accepted; use --finalization-request to submit a finalization request"
(referencing FINALIZATION_FLAGS, arg, and
GraphModelMigrationCommandCliArgumentError in your edit).
scripts/v18.0.0/migrations/graph-model/V17GoldenGraphFixtureWetRunHarness.ts (1)

1-585: 🛠️ Refactor suggestion | 🟠 Major | 🏗️ Heavy lift

Split this script file to satisfy script LOC limits.

This script is 585 LOC, which exceeds the repo’s script-size cap and makes this slice harder to maintain and review. Please break it into focused modules (e.g., harness orchestration, drift checks, scratch-boundary mapping, and target-key decoding).

As per coding guidelines: "Maximum file size: 500 LOC (source), 800 LOC (test), 300 LOC (scripts)".

🤖 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 `@scripts/v18.0.0/migrations/graph-model/V17GoldenGraphFixtureWetRunHarness.ts`
around lines 1 - 585, The file exceeds the script LOC cap; split it into focused
modules: keep harness orchestration (exporting runV17GoldenGraphFixtureWetRun,
V17GoldenGraphFixtureWetRunHarnessResult,
V17GoldenGraphFixtureWetRunDriftCheckResult,
V17GoldenGraphFixtureWetRunHarnessError) in one file, move drift-check logic
(checkV17GoldenGraphFixtureWetRunDrift) into a drift module, move
scratch-boundary mapping (requireScratchWriteResult, scratchBoundariesByFactKey,
factKeyForWrittenPatch, factKeyForWrittenPatch helpers like
publicContentFactKey, publicPropertyFactKey) into a scratch-boundary module, and
move target-key decoding/parsings (decodePropertyTargetKey, readLength,
readSizedField, publicPropertyFactKey) into a target-key decoder module; update
imports/exports between these modules and ensure
createV17GoldenFixtureScratchReadingProvider and withFixtureCoverageFacts
reference the relocated helpers, preserving public function/class names and
behavior.
🧹 Nitpick comments (8)
src/domain/migrations/V17GoldenGraphFixtureGenesisReading.ts (1)

83-89: ⚡ Quick win

Clarify error message to reflect multi-colon support.

The implementation uses lastIndexOf(':') to find the separator, which means keys like "owner:sub:property" are valid and will split as "owner:sub\0property". However, the error message states "must use owner:property format", which suggests exactly one colon is required. Consider rewording to something like "must use owner:property format (colons allowed in owner segment)" or "must contain at least one colon not at the boundaries" to better reflect the actual validation logic.

🤖 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/migrations/V17GoldenGraphFixtureGenesisReading.ts` around lines 83
- 89, Update the error message thrown in legacyPropertyKeyFor to accurately
describe the validation (it requires at least one colon not at the boundaries
and allows additional colons in the owner segment); change the WarpError message
from 'property fixture fact key must use owner:property format' to something
like 'property fixture fact key must contain at least one colon not at the
boundaries (colons allowed in owner segment)' so the message matches the
lastIndexOf(':') logic used in legacyPropertyKeyFor.
docs/design/0240-v18-generated-contract-evidence-replan/v18-generated-contract-evidence-replan.md (1)

25-25: 💤 Low value

Consider hyphenating compound adjective.

The phrase "runtime-boundary generated fixture" could be clearer as "runtime-boundary-generated fixture" when the compound modifier precedes the noun.

🤖 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
`@docs/design/0240-v18-generated-contract-evidence-replan/v18-generated-contract-evidence-replan.md`
at line 25, Change the phrase "runtime-boundary generated fixture" to the
hyphenated compound adjective "runtime-boundary-generated fixture" so the
compound modifier correctly precedes the noun; update the string in the docs
line containing that phrase (search for "runtime-boundary generated fixture")
and replace with "runtime-boundary-generated fixture".
test/unit/scripts/v18-v17-public-read-legacy-reading-builder.test.ts (2)

77-83: 💤 Low value

Consider cleanup for temporary test directories.

The restoredFixture helper creates temporary directories but doesn't explicitly clean them up. While test frameworks often handle cleanup, consider verifying that vitest cleans up temp directories or adding explicit cleanup using afterEach or try-finally blocks to prevent accumulation during test runs.

🤖 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/scripts/v18-v17-public-read-legacy-reading-builder.test.ts` around
lines 77 - 83, restoredFixture creates temp directories via
mkdtemp(join(tmpdir(), prefix)) but never cleans them up; modify the test setup
to ensure created targetDirectory is removed after each test (e.g., track
returned targetDirectory paths and call fs.rm/recursive cleanup in an afterEach
hook) or change restoredFixture to return a cleanup callback (or use try/finally
inside tests) so restoreV17GoldenGraphFixture's targetDirectory is explicitly
deleted after use.

85-89: ⚡ Quick win

Extract duplicated test helper to shared utility.

The gitOk helper is duplicated from test/unit/scripts/v18-v17-fixture-wet-run-harness.test.ts (lines 192-196). Consider extracting it to a shared test utilities module to follow DRY principles and ensure consistent Git command handling across migration tests.

♻️ Suggested refactor

Create a shared utilities file (e.g., test/unit/scripts/migration-test-helpers.ts):

import { runMigrationGit } from '../../../scripts/v18.0.0/migrations/graph-model/GitMigrationCommandRunner.ts';
import { expect } from 'vitest';

export async function gitOk(repositoryPath: string, args: readonly string[]): Promise<string> {
  const result = await runMigrationGit(repositoryPath, args, null, { deterministicIdentity: true });
  expect(result.ok()).toBe(true);
  return result.stdout.trim();
}

Then import and use in both test files:

+import { gitOk } from './migration-test-helpers.ts';
-
-async function gitOk(repositoryPath: string, args: readonly string[]): Promise<string> {
-  const result = await runMigrationGit(repositoryPath, args, null, { deterministicIdentity: true });
-  expect(result.ok()).toBe(true);
-  return result.stdout.trim();
-}
🤖 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/scripts/v18-v17-public-read-legacy-reading-builder.test.ts` around
lines 85 - 89, Extract the duplicated gitOk helper into a shared test utility
module and import it in both tests: create a new module exporting async function
gitOk(repositoryPath: string, args: readonly string[]) that calls
runMigrationGit(..., { deterministicIdentity: true }), asserts result.ok() true,
and returns result.stdout.trim(); update the two test files to remove the local
gitOk implementations and import the shared gitOk; ensure you import
runMigrationGit from its current module only in the new helper and update any
relative import paths accordingly.
src/domain/migrations/GraphModelMigrationRuntimeReplayRequest.ts (1)

47-52: ⚡ Quick win

Extract duplicated validation helper.

The requireNonEmptyString helper is duplicated from GraphModelMigrationRuntimeReplayResult.ts (lines 78-83). Consider extracting it to a shared domain utility module (e.g., src/domain/migrations/validationHelpers.ts) to prevent future divergence and improve maintainability.

♻️ Suggested refactor

Create src/domain/migrations/validationHelpers.ts:

import WarpError from '../errors/WarpError.ts';

export function requireNonEmptyString(value: string, name: string): string {
  if (typeof value !== 'string' || value.length === 0) {
    throw new WarpError(`${name} must be a non-empty string`, 'E_VALIDATION');
  }
  return value;
}

Then import and use in both files:

+import { requireNonEmptyString } from './validationHelpers.ts';
 import GraphModelMigrationScratchRef from './GraphModelMigrationScratchRef.ts';
 import WarpError from '../errors/WarpError.ts';
 
 // ... rest of file ...
 
-function requireNonEmptyString(value: string, name: string): string {
-  if (typeof value !== 'string' || value.length === 0) {
-    throw new WarpError(`${name} must be a non-empty string`, 'E_VALIDATION');
-  }
-  return value;
-}

Apply the same change to GraphModelMigrationRuntimeReplayResult.ts.

🤖 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/migrations/GraphModelMigrationRuntimeReplayRequest.ts` around
lines 47 - 52, Extract the duplicated requireNonEmptyString helper into a new
shared module named validationHelpers.ts, export the function there (keeping the
same signature and throwing WarpError with 'E_VALIDATION'), then remove the
duplicate implementations and import requireNonEmptyString into both
GraphModelMigrationRuntimeReplayRequest and
GraphModelMigrationRuntimeReplayResult to use the shared helper; ensure you
import WarpError in the new module or re-export it as needed so the behavior and
error type remain identical.
scripts/v18.0.0/migrations/graph-model/GraphModelMigrationCommand.ts (1)

1-335: ⚖️ Poor tradeoff

Consider splitting this file to meet the 300 LOC guideline for scripts.

The file currently has 335 lines, exceeding the 300 LOC limit for scripts. The review-guard helpers (lines 203-284) could be extracted into a separate module, though this adds some coordination overhead.

As per coding guidelines, scripts should not exceed 300 LOC.

🤖 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 `@scripts/v18.0.0/migrations/graph-model/GraphModelMigrationCommand.ts` around
lines 1 - 335, This file exceeds the 300 LOC guideline—extract the finalization
review / guard helper functions into a new module and import them: move
reviewedSafetyResult, finalizationReviewFatalErrors,
finalizationReviewMismatches, stringMismatch, equivalenceSummaryKey,
runtimeConformanceKey (and the small helper runtimeConformanceFromProvider if
you prefer) into a separate helper module, export them, then replace their local
definitions with imports and keep runFinalization, resolveReadings, and
top-level flow unchanged; ensure exported functions keep the same signatures
(types like GraphModelMigrationFinalizationRequest,
GraphModelMigrationFinalizationSafetyResult, GraphModelMigrationNotice,
GraphModelMigrationScratchWriteResult are imported where needed) and update
calls in this file to use the imported symbols so the script falls under 300
LOC.
docs/design/0231-v18-live-finalization-cli-confirmation/v18-live-finalization-cli-confirmation.md (1)

91-91: ⚡ Quick win

Add a trailing newline at end of file.

Markdown files should end with a newline for POSIX compliance and diff cleanliness.

🤖 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
`@docs/design/0231-v18-live-finalization-cli-confirmation/v18-live-finalization-cli-confirmation.md`
at line 91, Add a single trailing newline character at the end of the markdown
file
docs/design/0231-v18-live-finalization-cli-confirmation/v18-live-finalization-cli-confirmation.md
so the file ends with a newline (POSIX-compliant) to avoid dirty diffs; simply
ensure the last line is terminated with "\n".
docs/design/0228-v18-fixture-lifecycle-and-writer-coverage/v18-fixture-lifecycle-and-writer-coverage.md (1)

54-54: ⚡ Quick win

Add a trailing newline at end of file.

Markdown files should end with a newline for POSIX compliance and diff cleanliness.

🤖 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
`@docs/design/0228-v18-fixture-lifecycle-and-writer-coverage/v18-fixture-lifecycle-and-writer-coverage.md`
at line 54, This markdown file lacks a trailing newline at EOF; open
v18-fixture-lifecycle-and-writer-coverage.md (the document being edited) and add
a single newline character at the end of the file so the file ends with a
trailing newline for POSIX compliance and cleaner diffs.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/BEARING.md`:
- Line 454: Update the three checklist items that read "Inventory current
Wesley/Continuum generated graph contracts" (the repeated checklist entries) to
use consistent hyphenation for the compound modifier—e.g., change to "Inventory
current Wesley/Continuum generated-graph contracts" or rephrase to "Inventory
current Wesley/Continuum graph contracts" so the modifier is clear and
consistent across the occurrences referenced in the diff.

In
`@docs/design/0237-v18-runtime-boundary-fixture-ingestion/v18-runtime-boundary-fixture-ingestion.md`:
- Line 37: The phrase "runtime-boundary generated fixture" should be hyphenated
as "runtime-boundary-generated fixture"; update the instance of
"runtime-boundary generated fixture" in the document (look for that exact phrase
in v18-runtime-boundary-fixture-ingestion.md) so the compound adjective
correctly reads "runtime-boundary-generated fixture".

In `@scripts/v18.0.0/migrations/graph-model/GraphModelMigrationCommandReport.ts`:
- Around line 89-95: The report is using the wrong field for archive evidence:
replace the mistaken uses of finalization.previousLiveHead when rendering
archiveHead and archivePreserved with the correct archive head property
(finalization.archiveHeadName); specifically, change the archiveHead line to use
displayNullable(finalization.archiveHeadName) and make archivePreserved depend
on finalization.archiveHeadName === null ? 'no' : 'yes' within
GraphModelMigrationCommandReport where finalization and displayNullable are
used.

---

Outside diff comments:
In `@scripts/v18.0.0/migrations/graph-model/GraphModelMigrationCommandCli.ts`:
- Around line 1-316: This file is too large for scripts—split parsing,
finalization shaping, and execution/reporting into separate modules: extract
parseGraphModelMigrationCommandCliArgs (and its helper readArgValue,
requireString,
GraphModelMigrationCommandCliArgs/GraphModelMigrationCommandCliArgumentError)
into a new cli-args module and export the parser and types; extract
finalizationOptions (and requireFinalizationString) plus its
GraphModelMigrationFinalizationRequest typing usage into a new
finalization-builder module that exports a function to build the finalization
object and the helper; leave runGraphModelMigrationCommandCli in this file but
refactor it to import parseGraphModelMigrationCommandCliArgs and the
finalization builder and move report-generation and file I/O
(readFile/writeFile, report write) into a small execution/reporting helper
module if desired; ensure all exported functions/classes
(parseGraphModelMigrationCommandCliArgs, finalizationOptions builder,
GraphModelMigrationCommandCliArgs, GraphModelMigrationCommandCliArgumentError,
runGraphModelMigrationCommandCli) keep their names so callers (and tests)
continue to work and update imports accordingly.
- Around line 157-160: Replace the misleading rejection message thrown in the
block checking FINALIZATION_FLAGS so it explicitly rejects legacy finalization
flags and points users to the new request flag; modify the
GraphModelMigrationCommandCliArgumentError thrown when (arg !== undefined &&
FINALIZATION_FLAGS.has(arg)) to say something like "legacy finalization flags
are not accepted; use --finalization-request to submit a finalization request"
(referencing FINALIZATION_FLAGS, arg, and
GraphModelMigrationCommandCliArgumentError in your edit).

In
`@scripts/v18.0.0/migrations/graph-model/V17GoldenGraphFixtureWetRunHarness.ts`:
- Around line 1-585: The file exceeds the script LOC cap; split it into focused
modules: keep harness orchestration (exporting runV17GoldenGraphFixtureWetRun,
V17GoldenGraphFixtureWetRunHarnessResult,
V17GoldenGraphFixtureWetRunDriftCheckResult,
V17GoldenGraphFixtureWetRunHarnessError) in one file, move drift-check logic
(checkV17GoldenGraphFixtureWetRunDrift) into a drift module, move
scratch-boundary mapping (requireScratchWriteResult, scratchBoundariesByFactKey,
factKeyForWrittenPatch, factKeyForWrittenPatch helpers like
publicContentFactKey, publicPropertyFactKey) into a scratch-boundary module, and
move target-key decoding/parsings (decodePropertyTargetKey, readLength,
readSizedField, publicPropertyFactKey) into a target-key decoder module; update
imports/exports between these modules and ensure
createV17GoldenFixtureScratchReadingProvider and withFixtureCoverageFacts
reference the relocated helpers, preserving public function/class names and
behavior.

---

Nitpick comments:
In
`@docs/design/0228-v18-fixture-lifecycle-and-writer-coverage/v18-fixture-lifecycle-and-writer-coverage.md`:
- Line 54: This markdown file lacks a trailing newline at EOF; open
v18-fixture-lifecycle-and-writer-coverage.md (the document being edited) and add
a single newline character at the end of the file so the file ends with a
trailing newline for POSIX compliance and cleaner diffs.

In
`@docs/design/0231-v18-live-finalization-cli-confirmation/v18-live-finalization-cli-confirmation.md`:
- Line 91: Add a single trailing newline character at the end of the markdown
file
docs/design/0231-v18-live-finalization-cli-confirmation/v18-live-finalization-cli-confirmation.md
so the file ends with a newline (POSIX-compliant) to avoid dirty diffs; simply
ensure the last line is terminated with "\n".

In
`@docs/design/0240-v18-generated-contract-evidence-replan/v18-generated-contract-evidence-replan.md`:
- Line 25: Change the phrase "runtime-boundary generated fixture" to the
hyphenated compound adjective "runtime-boundary-generated fixture" so the
compound modifier correctly precedes the noun; update the string in the docs
line containing that phrase (search for "runtime-boundary generated fixture")
and replace with "runtime-boundary-generated fixture".

In `@scripts/v18.0.0/migrations/graph-model/GraphModelMigrationCommand.ts`:
- Around line 1-335: This file exceeds the 300 LOC guideline—extract the
finalization review / guard helper functions into a new module and import them:
move reviewedSafetyResult, finalizationReviewFatalErrors,
finalizationReviewMismatches, stringMismatch, equivalenceSummaryKey,
runtimeConformanceKey (and the small helper runtimeConformanceFromProvider if
you prefer) into a separate helper module, export them, then replace their local
definitions with imports and keep runFinalization, resolveReadings, and
top-level flow unchanged; ensure exported functions keep the same signatures
(types like GraphModelMigrationFinalizationRequest,
GraphModelMigrationFinalizationSafetyResult, GraphModelMigrationNotice,
GraphModelMigrationScratchWriteResult are imported where needed) and update
calls in this file to use the imported symbols so the script falls under 300
LOC.

In `@src/domain/migrations/GraphModelMigrationRuntimeReplayRequest.ts`:
- Around line 47-52: Extract the duplicated requireNonEmptyString helper into a
new shared module named validationHelpers.ts, export the function there (keeping
the same signature and throwing WarpError with 'E_VALIDATION'), then remove the
duplicate implementations and import requireNonEmptyString into both
GraphModelMigrationRuntimeReplayRequest and
GraphModelMigrationRuntimeReplayResult to use the shared helper; ensure you
import WarpError in the new module or re-export it as needed so the behavior and
error type remain identical.

In `@src/domain/migrations/V17GoldenGraphFixtureGenesisReading.ts`:
- Around line 83-89: Update the error message thrown in legacyPropertyKeyFor to
accurately describe the validation (it requires at least one colon not at the
boundaries and allows additional colons in the owner segment); change the
WarpError message from 'property fixture fact key must use owner:property
format' to something like 'property fixture fact key must contain at least one
colon not at the boundaries (colons allowed in owner segment)' so the message
matches the lastIndexOf(':') logic used in legacyPropertyKeyFor.

In `@test/unit/scripts/v18-v17-public-read-legacy-reading-builder.test.ts`:
- Around line 77-83: restoredFixture creates temp directories via
mkdtemp(join(tmpdir(), prefix)) but never cleans them up; modify the test setup
to ensure created targetDirectory is removed after each test (e.g., track
returned targetDirectory paths and call fs.rm/recursive cleanup in an afterEach
hook) or change restoredFixture to return a cleanup callback (or use try/finally
inside tests) so restoreV17GoldenGraphFixture's targetDirectory is explicitly
deleted after use.
- Around line 85-89: Extract the duplicated gitOk helper into a shared test
utility module and import it in both tests: create a new module exporting async
function gitOk(repositoryPath: string, args: readonly string[]) that calls
runMigrationGit(..., { deterministicIdentity: true }), asserts result.ok() true,
and returns result.stdout.trim(); update the two test files to remove the local
gitOk implementations and import the shared gitOk; ensure you import
runMigrationGit from its current module only in the new helper and update any
relative import paths accordingly.
🪄 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: ef243ab4-4da4-4bb3-aba9-47acdb0c3d0e

📥 Commits

Reviewing files that changed from the base of the PR and between d379eb8 and 60d4be6.

📒 Files selected for processing (79)
  • CHANGELOG.md
  • docs/BEARING.md
  • docs/design/0203-v18-content-property-closeout-audit/v18-content-property-closeout-audit.md
  • docs/design/0214-v18-production-runtime-scratch-replay-conformance/v18-production-runtime-scratch-replay-conformance.md
  • docs/design/0215-v18-runtime-scratch-replay-nouns/v18-runtime-scratch-replay-nouns.md
  • docs/design/0216-v18-production-runtime-scratch-replay-provider/v18-production-runtime-scratch-replay-provider.md
  • docs/design/0217-v18-v17-public-read-legacy-reading/v18-v17-public-read-legacy-reading.md
  • docs/design/0218-v18-scratch-public-read-reading/v18-scratch-public-read-reading.md
  • docs/design/0219-v18-v17-fixture-wet-run-harness/v18-v17-fixture-wet-run-harness.md
  • docs/design/0220-v18-wet-run-operator-report/v18-wet-run-operator-report.md
  • docs/design/0221-v18-wet-run-failure-fixtures/v18-wet-run-failure-fixtures.md
  • docs/design/0222-v18-wet-run-drift-checks/v18-wet-run-drift-checks.md
  • docs/design/0223-v18-production-replay-drift-checkup/v18-production-replay-drift-checkup.md
  • docs/design/0224-v18-wet-run-mismatch-classification/v18-wet-run-mismatch-classification.md
  • docs/design/0225-v18-fixture-property-equivalence-values/v18-fixture-property-equivalence-values.md
  • docs/design/0226-v18-fixture-content-runtime-oids/v18-fixture-content-runtime-oids.md
  • docs/design/0227-v18-fixture-edge-endpoint-coverage/v18-fixture-edge-endpoint-coverage.md
  • docs/design/0228-v18-fixture-lifecycle-and-writer-coverage/v18-fixture-lifecycle-and-writer-coverage.md
  • docs/design/0229-v18-zero-mismatch-wet-run-proof/v18-zero-mismatch-wet-run-proof.md
  • docs/design/0230-v18-finalization-replan-after-zero-mismatch/v18-finalization-replan-after-zero-mismatch.md
  • docs/design/0231-v18-live-finalization-cli-confirmation/v18-live-finalization-cli-confirmation.md
  • docs/design/0232-v18-finalization-request-json-adapters/v18-finalization-request-json-adapters.md
  • docs/design/0233-v18-finalization-report-archive-evidence/v18-finalization-report-archive-evidence.md
  • docs/design/0234-v18-guarded-cli-finalization/v18-guarded-cli-finalization.md
  • docs/design/0235-v18-finalization-drift-and-archive-tests/v18-finalization-drift-and-archive-tests.md
  • docs/design/0236-v18-generated-contract-inventory/v18-generated-contract-inventory.md
  • docs/design/0237-v18-runtime-boundary-fixture-ingestion/v18-runtime-boundary-fixture-ingestion.md
  • docs/design/0238-v18-graph-model-contract-conformance/v18-graph-model-contract-conformance.md
  • docs/design/0239-v18-warp-ttd-generated-family-smoke/v18-warp-ttd-generated-family-smoke.md
  • docs/design/0240-v18-generated-contract-evidence-replan/v18-generated-contract-evidence-replan.md
  • docs/design/0241-v18-coordinate-fact-export-raw-boundary-retirement/v18-coordinate-fact-export-raw-boundary-retirement.md
  • docs/design/0242-v18-content-property-retirement-ratchet/v18-content-property-retirement-ratchet.md
  • docs/design/0243-v18-release-candidate-evidence/v18-release-candidate-evidence.md
  • docs/design/0244-v18-backlog-reconciliation/v18-backlog-reconciliation.md
  • docs/method/backlog/README.md
  • docs/method/backlog/bad-code/RELEASE_TRIAGE.md
  • docs/method/backlog/v17.0.0/README.md
  • docs/method/backlog/v18.0.0/INFRA_graph-model-migration-tool.md
  • docs/method/backlog/v18.0.0/PROTO_content-attachment-plane-cutover.md
  • docs/method/backlog/v18.0.0/README.md
  • docs/method/backlog/v18.0.0/RELEASE_v18-public-release-blockers.md
  • docs/method/backlog/v18.0.0/TRUST_genesis-replay-equivalence.md
  • docs/method/backlog/v20.0.0/PERF_end-to-end-graph-streaming.md
  • docs/method/backlog/v20.0.0/README.md
  • docs/releases/v18.0.0-rc/README.md
  • fixtures/v17/graph-model-golden/README.md
  • fixtures/v17/graph-model-golden/manifest.json
  • scripts/v18.0.0/migrations/graph-model/GraphModelMigrationCommand.ts
  • scripts/v18.0.0/migrations/graph-model/GraphModelMigrationCommandCli.ts
  • scripts/v18.0.0/migrations/graph-model/GraphModelMigrationCommandReport.ts
  • scripts/v18.0.0/migrations/graph-model/GraphModelMigrationProductionRuntimeReplayProvider.ts
  • scripts/v18.0.0/migrations/graph-model/GraphModelMigrationScratchPublicReadBuilder.ts
  • scripts/v18.0.0/migrations/graph-model/GraphModelMigrationScratchReadingBuilder.ts
  • scripts/v18.0.0/migrations/graph-model/GraphModelMigrationScratchRuntimeReplayer.ts
  • scripts/v18.0.0/migrations/graph-model/V17GoldenGraphFixtureWetRunHarness.ts
  • scripts/v18.0.0/migrations/graph-model/V17GoldenGraphFixtureWetRunReport.ts
  • scripts/v18.0.0/migrations/graph-model/V17RestoredPublicReadLegacyReadingBuilder.ts
  • src/domain/continuum/GitWarpGraphModelContractConformance.ts
  • src/domain/continuum/GitWarpWarpTtdGeneratedFamilySmoke.ts
  • src/domain/migrations/GraphModelMigrationRuntimeReplayRequest.ts
  • src/domain/migrations/GraphModelMigrationRuntimeReplayResult.ts
  • src/domain/migrations/V17GoldenGraphFixtureGenesisReading.ts
  • src/domain/services/CoordinateFactExport.ts
  • src/domain/services/transfer/transferOps.ts
  • src/infrastructure/adapters/GraphModelMigrationFinalizationRequestJsonAdapter.ts
  • test/fixtures/continuum/runtime-boundary-family-generated-artifact.json
  • test/unit/domain/continuum/GitWarpGraphModelContractConformance.test.ts
  • test/unit/domain/continuum/GitWarpWarpTtdGeneratedFamilySmoke.test.ts
  • test/unit/domain/migrations/GraphModelMigrationRuntimeReplayResult.test.ts
  • test/unit/domain/migrations/V17GoldenGraphFixtureGenesisReading.test.ts
  • test/unit/infrastructure/adapters/ContinuumArtifactJsonFileAdapter.test.ts
  • test/unit/infrastructure/adapters/GraphModelMigrationFinalizationRequestJsonAdapter.test.ts
  • test/unit/scripts/v18-content-property-closeout-audit.test.ts
  • test/unit/scripts/v18-graph-model-migration-command-cli.test.ts
  • test/unit/scripts/v18-migration-command.test.ts
  • test/unit/scripts/v18-production-runtime-scratch-replay-provider.test.ts
  • test/unit/scripts/v18-scratch-public-read-builder.test.ts
  • test/unit/scripts/v18-v17-fixture-wet-run-harness.test.ts
  • test/unit/scripts/v18-v17-public-read-legacy-reading-builder.test.ts

Comment thread docs/BEARING.md Outdated
@flyingrobots
Copy link
Copy Markdown
Member Author

@codex Self-review findings from strict Code Lawyer pass against origin/main...HEAD.

Severity File / Lines Type Finding Mitigation prompt
P2 Major scripts/v18.0.0/migrations/graph-model/GraphModelMigrationCommand.ts:236-283; src/infrastructure/adapters/GraphModelMigrationFinalizationRequestJsonAdapter.ts:129-139 Safety / evidence binding Finalization review mismatch detection compares only summary keys for equivalence and only scratchRef, scratchHead, and status for runtime conformance. The reviewed JSON artifact includes richer evidence such as runtime witness and fatal notices, but those fields are not included in the equality check. A stale or edited artifact with identical counts/status can still pass review. Add a regression test that mutates the reviewed request runtime witness and/or fatal notice payload while preserving status/counts, prove finalization currently proceeds, then extend review comparison to cover every operator-significant evidence field included in the JSON artifact.
P2 Major scripts/v18.0.0/migrations/graph-model/GraphModelMigrationScratchPublicReadBuilder.ts:92-95; fixtures/v17/graph-model-golden/manifest.json:21-57; docs/BEARING.md:67-71 Coverage / compatibility evidence Scratch public-read equivalence skips edge properties entirely. The v18 posture says node and edge property projections exist, but the canonical fixture has no edge-property visible fact and the scratch public-read builder drops edge-owned properties before fact generation. This leaves edge-property migration equivalence unproven. Add an edge-property visible fact to the v17 golden fixture, lower it through the migration path, emit edge-property public facts from scratch public reads, and add a wet-run regression proving zero mismatches for edge properties; otherwise document edge-property wet-run equivalence as out of scope for this PR.
P2 Major scripts/v18.0.0/migrations/graph-model/GraphModelMigrationScratchRuntimeReplayer.ts:92-108; docs/BEARING.md:374-376; docs/BEARING.md:527-529; docs/releases/v18.0.0-rc/README.md:17 Documentation / semantic overclaim Release docs say migrated scratch history is opened through the normal production graph runtime. The implementation reads migration scratch operation records, creates a fresh runtime repo, writes a synthetic patch through the runtime API, and materializes that repo. That proves production write/materialization compatibility for scratch operations, not direct production opening of the scratch ref history. Either implement a direct production-runtime open/read of the migration scratch ref format, or revise BEARING/release text to say scratch operations are replayed through the production runtime write/materialization path. Add a test that pins whichever claim is intended.
P3 Minor scripts/v18.0.0/migrations/graph-model/GraphModelMigrationCommandCli.ts:157-160 CLI polish / operator clarity Legacy finalization flags now throw finalization is not supported by this CLI wrapper yet, but --finalization-request is supported. The message is stale and will mislead operators who supplied the wrong finalization path. Change the error to explain that direct finalization flags are unsupported and that finalization must use --finalization-request <path>. Add a small CLI argument test for one legacy flag.
P4 Nit src/infrastructure/adapters/GraphModelMigrationFinalizationRequestJsonAdapter.ts:100-118 and :129-140 Adapter error consistency Semantic invalid JSON can leak domain constructor errors while parse/type/unknown-key failures are normalized as AdapterValidationError. This makes the adapter boundary less predictable for malformed finalization artifacts. Add adapter tests for impossible semantic combinations, such as equivalence mismatchCount > 0 or runtime status/fatal-error inconsistency, then wrap domain constructor failures as AdapterValidationError with the original code/message preserved as context.

No Markdown lint/style violation was found by git diff --check, and the current PR checks are green. The findings above are release-hardening issues, not mechanical CI failures.

@flyingrobots
Copy link
Copy Markdown
Member Author

@codex Review follow-up landed in fc8e38b1.

Finding Severity Outcome Commit
Finalization review compared only compact equivalence/runtime keys P2 Reviewed finalization artifacts now bind runtime witness and fatal notice evidence, with a regression that blocks mismatched runtime witness artifacts. fc8e38b1
Edge-property wet-run equivalence was unproven P2 Canonical v17 fixture now declares edge-property coverage; scratch replay writes edge properties through the runtime edge-property path; scratch public-read facts include visible edge properties; wet-run counts now prove eight legacy and eight migrated facts. fc8e38b1
Production-runtime replay docs overclaimed direct scratch-history opening P2 BEARING and design docs now state the proven claim: scratch operations replay through the production runtime write/materialization path. fc8e38b1
Legacy finalization flag error was stale P3 CLI now directs operators to --finalization-request <path> and has focused coverage. fc8e38b1
Finalization JSON semantic errors leaked domain validation errors P4 Adapter now wraps domain semantic validation failures as AdapterValidationError; contradictory runtime replay artifacts are covered. fc8e38b1

Verification run locally before push:

  • npm exec vitest run test/unit/infrastructure/adapters/GraphModelMigrationFinalizationRequestJsonAdapter.test.ts test/unit/scripts/v18-graph-model-migration-command-cli.test.ts
  • npm exec vitest run test/unit/scripts/v18-scratch-public-read-builder.test.ts test/unit/scripts/v18-production-runtime-scratch-replay-provider.test.ts test/unit/scripts/v18-v17-fixture-wet-run-harness.test.ts test/unit/domain/migrations/V17GoldenGraphFixtureGenesisReading.test.ts test/unit/scripts/v18-v17-public-read-legacy-reading-builder.test.ts
  • npm run lint
  • npm run lint:md
  • npm run typecheck:src
  • npm run typecheck:test
  • npm run test:local (521 files, 7122 tests)
  • git diff --check

Pre-push IRONCLAD M9 also passed and pushed fc8e38b1 to this PR branch.

@github-actions
Copy link
Copy Markdown

Release Preflight

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

If you tag this commit as v17.0.1, release workflow will publish.

@flyingrobots
Copy link
Copy Markdown
Member Author

@codex Self-review follow-up findings after fc8e38b1. I found the following issues while auditing origin/main...HEAD.

Severity Type Evidence Issue Recommended mitigation prompt
P3 Minor Error taxonomy / regression gap scripts/v18.0.0/migrations/graph-model/GraphModelMigrationScratchRuntimeReplayer.ts:171-176, scripts/v18.0.0/migrations/graph-model/GraphModelMigrationProductionRuntimeReplayProvider.ts:72-79, test/unit/scripts/v18-production-runtime-scratch-replay-provider.test.ts:108-125 Malformed legacy edge-property owner targets can escape as a generic runtime replay failure. applyPropertyOperation checks the legacy edge-property sentinel and calls decodeLegacyEdgePropNode directly; if that decode throws, the provider maps it to E_RUNTIME_REPLAY_FAILED instead of the structured E_RUNTIME_REPLAY_INVALID_OPERATION_TARGET. Existing malformed-target coverage only exercises edge-record, not property-record with a malformed edge-property owner. Add a regression that writes a property-record scratch operation whose length-prefixed owner starts with the legacy edge-property sentinel but does not decode into from/to/label; assert production runtime replay reports E_RUNTIME_REPLAY_INVALID_OPERATION_TARGET; then catch/wrap decodeLegacyEdgePropNode failures in applyPropertyOperation with the existing invalid-target error path.
P3 Minor Repository style policy AGENTS.md:128, scripts/v18.0.0/migrations/graph-model/V17GoldenGraphFixtureWetRunHarness.ts:1, scripts/v18.0.0/migrations/graph-model/GraphModelMigrationCommand.ts:1, scripts/v18.0.0/migrations/graph-model/GraphModelMigrationScratchRuntimeReplayer.ts:1, scripts/v18.0.0/migrations/graph-model/GraphModelMigrationCommandCli.ts:1 Script files exceed the stated 300 LOC cap for bin/scripts: 618, 353, 321, and 315 LOC respectively. The harness in particular concentrates restore, scratch reading, boundary indexing, runtime dry-run, and drift comparison in one file, which makes the migration surface harder to audit. Split the oversized migration scripts into named collaborators with stable concepts, prioritizing V17GoldenGraphFixtureWetRunHarness.ts; preserve current public exports and tests; make no behavior changes beyond extraction.
P4 Nit Fixture robustness / shape inference scripts/v18.0.0/migrations/graph-model/V17GoldenGraphFixtureWetRunHarness.ts:241-281 propertyMappingFromFact infers edge-property ownership by parsing public owner text for -> and :. A future fixture node ID containing those delimiters would be misclassified as an edge owner even if the manifest never declared that edge. Build a declared edge-owner set from V17GoldenEdgeFact or manifest evidence and classify property owners by membership, not string shape alone. Add a fixture-level regression for a node ID containing -> and :.

Local evidence: pre-review worktree was clean, git fetch origin completed, git diff --check origin/main...HEAD is clean, and PR checks are green except CodeRabbit is still pending review.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

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

Inline comments:
In
`@scripts/v18.0.0/migrations/graph-model/GraphModelMigrationScratchRuntimeReplayer.ts`:
- Around line 171-176: The decodeLegacyEdgePropNode call can throw a foreign
error; wrap the decodeLegacyEdgePropNode(property.ownerId) invocation in a
try/catch and, on any failure, throw/raise the standardized replayer error
E_RUNTIME_REPLAY_INVALID_OPERATION_TARGET (preserving/including the original
error message as context) so failures are classified consistently; keep the
existing behavior for non-legacy nodes (isLegacyEdgePropNode) and then call
patch.setEdgeProperty(edge.from, edge.to, edge.label, property.propertyKey,
value) when decode succeeds.

In
`@src/infrastructure/adapters/GraphModelMigrationFinalizationRequestJsonAdapter.ts`:
- Around line 59-64: The JSON parse error for confirmations uses the wrong
context text; update the parsing block inside parseDomainValue for
GraphModelMigrationFinalizationConfirmation so that when calling parseJson(raw)
(and any parse failure) it reports a context-specific message like
"finalizationConfirmation" or "finalization confirmation" instead of the generic
"finalization request JSON". Locate the parseDomainValue call that constructs a
GraphModelMigrationFinalizationConfirmation (which uses parseJson,
requireJsonObject, rejectUnknownKeys, CONFIRMATION_KEYS and readRequiredString
for 'finalizationConfirmation.confirmationToken') and change the error/context
string passed to parseJson or the surrounding parseDomainValue wrapper to
reflect confirmation parsing. Ensure rejectUnknownKeys and error messages
consistently reference 'finalizationConfirmation'.
🪄 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: 2466f1cf-5a7f-4561-8829-ffb12c210272

📥 Commits

Reviewing files that changed from the base of the PR and between 60d4be6 and fc8e38b.

📒 Files selected for processing (21)
  • CHANGELOG.md
  • docs/BEARING.md
  • docs/design/0214-v18-production-runtime-scratch-replay-conformance/v18-production-runtime-scratch-replay-conformance.md
  • docs/design/0228-v18-fixture-lifecycle-and-writer-coverage/v18-fixture-lifecycle-and-writer-coverage.md
  • docs/design/0230-v18-finalization-replan-after-zero-mismatch/v18-finalization-replan-after-zero-mismatch.md
  • fixtures/v17/graph-model-golden/README.md
  • fixtures/v17/graph-model-golden/manifest.json
  • scripts/v18.0.0/migrations/graph-model/GraphModelMigrationCommand.ts
  • scripts/v18.0.0/migrations/graph-model/GraphModelMigrationCommandCli.ts
  • scripts/v18.0.0/migrations/graph-model/GraphModelMigrationScratchPublicReadBuilder.ts
  • scripts/v18.0.0/migrations/graph-model/GraphModelMigrationScratchRuntimeReplayer.ts
  • scripts/v18.0.0/migrations/graph-model/V17GoldenGraphFixtureWetRunHarness.ts
  • src/domain/migrations/GraphModelMigrationRuntimeReplayResult.ts
  • src/infrastructure/adapters/GraphModelMigrationFinalizationRequestJsonAdapter.ts
  • test/unit/domain/migrations/V17GoldenGraphFixtureGenesisReading.test.ts
  • test/unit/infrastructure/adapters/GraphModelMigrationFinalizationRequestJsonAdapter.test.ts
  • test/unit/scripts/v18-graph-model-migration-command-cli.test.ts
  • test/unit/scripts/v18-production-runtime-scratch-replay-provider.test.ts
  • test/unit/scripts/v18-scratch-public-read-builder.test.ts
  • test/unit/scripts/v18-v17-fixture-wet-run-harness.test.ts
  • test/unit/scripts/v18-v17-public-read-legacy-reading-builder.test.ts
✅ Files skipped from review due to trivial changes (6)
  • fixtures/v17/graph-model-golden/README.md
  • fixtures/v17/graph-model-golden/manifest.json
  • docs/design/0228-v18-fixture-lifecycle-and-writer-coverage/v18-fixture-lifecycle-and-writer-coverage.md
  • docs/design/0230-v18-finalization-replan-after-zero-mismatch/v18-finalization-replan-after-zero-mismatch.md
  • docs/design/0214-v18-production-runtime-scratch-replay-conformance/v18-production-runtime-scratch-replay-conformance.md
  • CHANGELOG.md

@flyingrobots
Copy link
Copy Markdown
Member Author

Resolution summary for the self-review findings posted in #106 (comment).

Issue Severity Commit Outcome
Malformed edge-property scratch owner produced generic replay failure evidence P3 35f92128 Added a malformed edge-property owner regression and now preserves E_RUNTIME_REPLAY_INVALID_OPERATION_TARGET.
Fixture property-owner classification used delimiter shape instead of declared edge facts P4 223ff4ed Added a declared-edge mapping seam and regression; delimiter-shaped node owners now remain node owners unless an edge fact declares that owner.
Migration scripts exceeded the 300 LOC script cap P3 1f1bb0f8 Split command finalization review, CLI args, runtime replay validation/errors, fixture property mapping, and fixture scratch fact/reading collaborators; largest migration script is now 296 LOC.

Verification completed locally and in pre-push:

  • npm run lint
  • npm run lint:md
  • npm run typecheck:src
  • npm run typecheck:test
  • npm run test:local -- test/unit/scripts/v18-production-runtime-scratch-replay-provider.test.ts test/unit/scripts/v18-v17-fixture-wet-run-harness.test.ts test/unit/scripts/v18-graph-model-migration-command-cli.test.ts test/unit/scripts/v18-migration-command.test.ts (521 files, 7124 tests)
  • pre-push IRONCLAD M9 (521 files, 7124 tests)
  • git diff --check

✅ Addressed in commits 35f92128, 223ff4ed, and 1f1bb0f8.

@github-actions
Copy link
Copy Markdown

Release Preflight

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

If you tag this commit as v17.0.1, release workflow will publish.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

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

⚠️ Outside diff range comments (1)
scripts/v18.0.0/migrations/graph-model/GraphModelMigrationScratchRuntimeReplayer.ts (1)

94-104: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Validate runtimeRepositoryPath before using it as the runtime repo cwd.

If a caller passes '', this branch skips temp-dir creation and initializes the replay repo in the current working directory instead of an isolated location. That turns a verification path into a write against an unintended repo.

Suggested fix
 export async function replayGraphModelMigrationScratchIntoRuntime(
   options: GraphModelMigrationScratchRuntimeReplayOptions,
 ): Promise<GraphModelMigrationScratchRuntimeReplayOutput> {
   const sourceRepositoryPath = requireGraphModelMigrationRuntimeReplayString(
     options.sourceRepositoryPath,
     'sourceRepositoryPath',
   );
   const request = requireGraphModelMigrationRuntimeReplayRequest(options.request);
-  let runtimeRepositoryPath = options.runtimeRepositoryPath ?? null;
+  let runtimeRepositoryPath = options.runtimeRepositoryPath === null
+    || options.runtimeRepositoryPath === undefined
+    ? null
+    : requireGraphModelMigrationRuntimeReplayString(
+      options.runtimeRepositoryPath,
+      'runtimeRepositoryPath',
+    );
   let shouldCleanup = false;
   if (runtimeRepositoryPath === null) {
     runtimeRepositoryPath = await mkdtemp(join(tmpdir(), 'git-warp-v18-runtime-replay-'));
     shouldCleanup = true;
   }

As per coding guidelines, "Validate at boundaries and constructors; constructors establish invariants and must not perform I/O".

🤖 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
`@scripts/v18.0.0/migrations/graph-model/GraphModelMigrationScratchRuntimeReplayer.ts`
around lines 94 - 104, The code fails to validate runtimeRepositoryPath and
treats an empty string as a valid path, causing repo initialization to run in
CWD; update the initialization so runtimeRepositoryPath is normalized/validated
(e.g., call the same validator used for sourceRepositoryPath or explicitly treat
'' as null) before deciding to create a temp dir: change the
runtimeRepositoryPath assignment (currently using options.runtimeRepositoryPath
?? null) to validate/normalize options.runtimeRepositoryPath (reject empty
string) and only skip mkdtemp when a non-empty, validated path is provided;
refer to the runtimeRepositoryPath and shouldCleanup variables and the
mkdtemp(join(tmpdir(), 'git-warp-v18-runtime-replay-')) call when making the
fix.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@scripts/v18.0.0/migrations/graph-model/V17GoldenFixtureScratchReadingProvider.ts`:
- Around line 87-99: The code uses repeated magic strings for scratch operation
kinds and fact keys (e.g., 'node-record', 'edge-record', 'property',
'content-attachment', 'visibility', 'value', 'payload.oid', 'coverage',
'removed'); replace these literals with named constants (or import existing
domain constants) and update the control flow and factKey calls accordingly —
locate the switch/if block around factKey(...) calls and the thrown
V17GoldenFixtureScratchReadingProviderError in
V17GoldenFixtureScratchReadingProvider.ts and define constants (e.g.,
SCRATCH_KIND_NODE_RECORD, FACT_KEY_VISIBILITY, FACT_KEY_VALUE,
FACT_KEY_PAYLOAD_OID, etc.) then use those constants in the if conditions and in
calls to factKey, publicPropertyFactKey, publicContentFactKey, and anywhere the
other literals (coverage, removed) appear (also apply the same change for the
similar block at lines ~142-157).

---

Outside diff comments:
In
`@scripts/v18.0.0/migrations/graph-model/GraphModelMigrationScratchRuntimeReplayer.ts`:
- Around line 94-104: The code fails to validate runtimeRepositoryPath and
treats an empty string as a valid path, causing repo initialization to run in
CWD; update the initialization so runtimeRepositoryPath is normalized/validated
(e.g., call the same validator used for sourceRepositoryPath or explicitly treat
'' as null) before deciding to create a temp dir: change the
runtimeRepositoryPath assignment (currently using options.runtimeRepositoryPath
?? null) to validate/normalize options.runtimeRepositoryPath (reject empty
string) and only skip mkdtemp when a non-empty, validated path is provided;
refer to the runtimeRepositoryPath and shouldCleanup variables and the
mkdtemp(join(tmpdir(), 'git-warp-v18-runtime-replay-')) call when making the
fix.
🪄 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: fedb3144-a25d-4dd6-b40b-2c0abf8a8995

📥 Commits

Reviewing files that changed from the base of the PR and between fc8e38b and 1f1bb0f.

📒 Files selected for processing (14)
  • CHANGELOG.md
  • scripts/v18.0.0/migrations/graph-model/GraphModelMigrationCommand.ts
  • scripts/v18.0.0/migrations/graph-model/GraphModelMigrationCommandCli.ts
  • scripts/v18.0.0/migrations/graph-model/GraphModelMigrationCommandCliArgs.ts
  • scripts/v18.0.0/migrations/graph-model/GraphModelMigrationFinalizationReview.ts
  • scripts/v18.0.0/migrations/graph-model/GraphModelMigrationScratchRuntimeReplayErrors.ts
  • scripts/v18.0.0/migrations/graph-model/GraphModelMigrationScratchRuntimeReplayValidation.ts
  • scripts/v18.0.0/migrations/graph-model/GraphModelMigrationScratchRuntimeReplayer.ts
  • scripts/v18.0.0/migrations/graph-model/V17GoldenFixtureScratchFactKeyCodec.ts
  • scripts/v18.0.0/migrations/graph-model/V17GoldenFixtureScratchReadingProvider.ts
  • scripts/v18.0.0/migrations/graph-model/V17GoldenGraphFixturePropertyMappings.ts
  • scripts/v18.0.0/migrations/graph-model/V17GoldenGraphFixtureWetRunHarness.ts
  • test/unit/scripts/v18-production-runtime-scratch-replay-provider.test.ts
  • test/unit/scripts/v18-v17-fixture-wet-run-harness.test.ts
✅ Files skipped from review due to trivial changes (1)
  • CHANGELOG.md

Comment thread scripts/v18.0.0/migrations/graph-model/V17GoldenFixtureScratchReadingProvider.ts Outdated
@flyingrobots
Copy link
Copy Markdown
Member Author

@codex Self-audit findings discovered during the final verification pass before pushing the CodeRabbit fixes.

Severity Source Evidence Issue Recommended mitigation prompt
P3 Minor Self scripts/v18.0.0/migrations/graph-model/GraphModelMigrationScratchRuntimeReplayer.ts is now 313 LOC after the validation fixes; AGENTS.md caps bin/scripts at 300 LOC. The runtime replayer slipped back over the repository script-size cap. Extract scratch replay target parsing helpers from GraphModelMigrationScratchRuntimeReplayer.ts into a named collaborator, keep public exports unchanged, and rerun typecheck/tests.
P4 Nit Self docs/design/0240-v18-generated-contract-evidence-replan/v18-generated-contract-evidence-replan.md:25 and test/unit/infrastructure/adapters/ContinuumArtifactJsonFileAdapter.test.ts:351 still say runtime-boundary generated fixture. The compound adjective remains unhyphenated outside the two resolved CodeRabbit thread locations. Replace remaining prose/test-description occurrences with runtime-boundary-generated fixture, preserving behavior.

@flyingrobots
Copy link
Copy Markdown
Member Author

Code Lawyer Activity Summary

Resolved all currently known actionable feedback and the self-audit findings from this pass.

Source Severity File / Area Commit Outcome
CodeRabbit P4 docs/BEARING.md, docs/design/0237-v18-runtime-boundary-fixture-ingestion/... 537ef6b9 Normalized generated-graph and runtime-boundary-generated wording.
CodeRabbit P3 scripts/v18.0.0/migrations/graph-model/GraphModelMigrationScratchRuntimeReplayer.ts 940726c8 Added regression and validation for empty runtimeRepositoryPath; empty paths now fail closed before runtime initialization.
CodeRabbit P3 scripts/v18.0.0/migrations/graph-model/GraphModelMigrationScratchRuntimeReplayer.ts f8662e85 Added regressions and explicit invalid-target handling for empty property owner, property key, and content owner targets.
CodeRabbit P4 src/infrastructure/adapters/GraphModelMigrationFinalizationRequestJsonAdapter.ts 08d9008d Added regression and confirmation-specific invalid JSON parse context.
CodeRabbit P4 scripts/v18.0.0/migrations/graph-model/V17GoldenFixtureScratchReadingProvider.ts 4221947f Replaced repeated operation/fact literals with named constants.
Self-audit P3 scripts/v18.0.0/migrations/graph-model/GraphModelMigrationScratchRuntimeReplayer.ts 947be1e5 Extracted scratch replay target parsing; all migration scripts are now under the 300 LOC cap.
Self-audit P4 docs/design/0238-..., docs/design/0240-..., ContinuumArtifactJsonFileAdapter.test.ts cedf1f04 Removed remaining runtime-boundary generated fixture wording.
False positive P3 GraphModelMigrationCommandReport.ts archive-head evidence discussion reply Replied with evidence and resolved. archiveHead is intentionally rendered from previousLiveHead because the finalizer archives exactly that head; no separate archiveHead field exists.
Docs P4 CHANGELOG.md 8ca2693a Recorded externally visible validation and error-context fixes.

Verification before push:

  • npm run lint
  • npm run lint:md
  • npm run typecheck:src
  • npm run typecheck:test
  • npm run test:local (521 files, 7126 tests)
  • git diff --check
  • script line-cap audit: largest migration script is 281 LOC
  • phrase scan for stale generated graph contracts and runtime-boundary generated fixture: clean
  • pre-push IRONCLAD M9 passed, including full unit suite (521 files, 7126 tests)

All review threads are resolved as of this comment.

@github-actions
Copy link
Copy Markdown

Release Preflight

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

If you tag this commit as v17.0.1, release workflow will publish.

@flyingrobots
Copy link
Copy Markdown
Member Author

Follow-up cleanup landed in c0f27ba8.

Issue Outcome Commit
Runtime replay request/result duplicated local non-empty string validators Added GraphModelMigrationRequiredString and routed both runtime replay domain types through the shared validator. c0f27ba8
V17 fixture property-key validation message implied exactly one colon Reworded the domain error and tightened the unit assertion to match the actual lastIndexOf behavior. c0f27ba8
Migration tests duplicated local gitOk helpers Added shared migrationTestEnvironment.ts and removed the duplicated success helpers from the affected migration tests. c0f27ba8
Public-read and wet-run fixture tests left temp directories behind Added tracked temp-directory cleanup via afterEach for the affected fixture migration tests. c0f27ba8

Verification:

  • npm exec vitest run test/unit/scripts/v18-graph-model-migration-command-cli.test.ts test/unit/scripts/v18-scratch-runtime-conformance-provider.test.ts test/unit/scripts/v18-scratch-public-read-builder.test.ts test/unit/scripts/v18-scratch-reading-builder.test.ts test/unit/scripts/v18-production-runtime-scratch-replay-provider.test.ts test/unit/scripts/v18-v17-public-read-legacy-reading-builder.test.ts test/unit/scripts/v18-v17-fixture-wet-run-harness.test.ts test/unit/domain/migrations/V17GoldenGraphFixtureGenesisReading.test.ts test/unit/domain/migrations/GraphModelMigrationRuntimeReplayResult.test.ts
  • npm run lint
  • npm run lint:md
  • npm run typecheck:src
  • npm run typecheck:test
  • npm run test:local (521 files, 7126 tests)
  • git diff --check
  • pre-push IRONCLAD M9 passed and pushed the branch.

All currently verified review-discovered cleanup items are addressed in this branch update.

@github-actions
Copy link
Copy Markdown

Release Preflight

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

If you tag this commit as v17.0.1, release workflow will publish.

@flyingrobots flyingrobots merged commit 023c7d7 into main May 25, 2026
16 checks passed
@flyingrobots flyingrobots deleted the v18-continuum-slices-66-75 branch May 25, 2026 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant