Skip to content

release: v17.0.0 follow-up substrate closeout#85

Merged
flyingrobots merged 6 commits into
mainfrom
release/v17.0.0-followup
May 18, 2026
Merged

release: v17.0.0 follow-up substrate closeout#85
flyingrobots merged 6 commits into
mainfrom
release/v17.0.0-followup

Conversation

@flyingrobots
Copy link
Copy Markdown
Member

@flyingrobots flyingrobots commented May 16, 2026

Summary

This is the tiny v17 closure PR after PR #84 merged. It lands the local substrate/runtime commits that were still ahead of origin/main, so v17 does not split into archaeology about which substrate shape actually shipped.

Included substrate/runtime commits:

  • b99a9b4c fix(checkpoint): preserve legacy blob content anchors
  • b62d51ff chore: upgrade git stunts substrate packages
  • ad673d39 feat: add v16 to v17 upgrade utility
  • cb4c5802 feat: route git graph reads through git-cas streams

Additional CI closure commit:

  • 80a3d19a test: cover git graph object type reads

Deferred from this PR:

  • intent-bound resilience doctrine/design docs
  • footprint resilience doctrine/design docs
  • v18/resilience/architecture follow-up work

Status

v17 PR #84 is merged, but release closeout is blocked on landing these substrate/runtime commits. After this PR lands, validate on main, then tag and publish v17.

Validation

Local branch validation:

  • npm run lint
  • npm run typecheck
  • npx vitest run test/unit/scripts/v16-to-v17-upgrade.test.ts test/unit/infrastructure/adapters/CliJsonFormatterAdapter.test.ts test/unit/domain/services/CheckpointService.test.ts test/unit/domain/services/GitGraphAdapter.test.ts test/unit/infrastructure/adapters/GitGraphAdapter.coverage.test.ts test/unit/infrastructure/adapters/GitGraphAdapter.gitCasPersistence.test.ts test/unit/scripts/uniform-git-cas-closeout.test.ts — 7 files / 191 tests
  • npm run build
  • npm run lint:md
  • npm exec vitest -- run test/unit/infrastructure/adapters/GitGraphAdapter.coverage.test.ts test/unit/infrastructure/adapters/GitGraphAdapter.listRefs.test.ts — 2 files / 98 tests
  • npm run test:coverage:ci — 440 files / 6783 tests, line coverage 91.87% against 91.74% threshold
  • pre-push IRONCLAD M9 gate: static gates plus npm run test:local — 440 files / 6783 tests

GitHub validation is green on PR #85:

  • Check broken links
  • CodeRabbit
  • coverage-threshold
  • preflight
  • test-bun
  • test-deno
  • test-node (22)
  • type-firewall
  • typecheck-test-advisory

Summary by CodeRabbit

Release Notes

  • Documentation

    • Added v17.0.0 migration guide with graph repository upgrade instructions.
    • Updated infrastructure modernization specifications and vault encryption approach documentation.
  • Chores

    • Bumped @git-stunts/alfred, @git-stunts/git-cas, and @git-stunts/plumbing dependencies.
    • Added npm run upgrade command for automated v16→v17 graph repository migration with dry-run support.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 16, 2026

📝 Walkthrough

Walkthrough

This PR modernizes git-warp's adapter layer to use git-cas v6 streaming APIs for graph operations. It extracts blob and tree reading into GitCasGraphReaderAdapter, refactors GitGraphAdapter to delegate, adds content-anchor object-type resolution, introduces a v16→v17 substrate upgrade tool, and updates test infrastructure to handle async plumbing initialization.

Changes

V17 git-cas adapter parity modernization

Layer / File(s) Summary
Documentation & architectural alignment
CHANGELOG.md, docs/method/backlog/up-next/*, docs/method/backlog/v17.0.0/*, docs/migrations/v17.0.0.md, docs/releases/v17.0.0/README.md, docs/specs/CONTENT_ATTACHMENT.md
Backlog, migration guides, release notes, and specs document the v16→v17 transition, git-cas v6 adoption (readBlobStream/iterateTree), vault encryption direction, policy-as-port streaming resilience, and content attachment clarifications for blob vs tree anchors.
Dependency upgrades & build configuration
package.json, test/runtime/deno/deno.json, tsconfig.publish.json
Runtime dependencies (@git-stunts/alfred, @git-stunts/git-cas, @git-stunts/plumbing) are bumped; Deno import-map updated to ^3.0.3; TypeScript publish config expands script glob to include full scripts directory.
Content anchor object-type resolution contracts
src/domain/services/state/checkpointHelpers.ts, src/domain/services/state/checkpointCreate.ts
CheckpointPersistence gains optional readObjectType capability; checkpointHelpers becomes async with injected object-type reader; collectContentAnchorEntries now awaits resolved object type per OID and emits correct git-tree entry format (blob vs tree).
GitCasGraphReaderAdapter & CliJsonFormatterAdapter extraction
src/infrastructure/adapters/GitCasGraphReaderAdapter.ts, src/infrastructure/adapters/CliJsonFormatterAdapter.ts
New GitCasGraphReaderAdapter wraps GitPersistenceAdapter to read CAS blobs via git-cas v6 readBlobStream (buffering to Uint8Array with empty-blob validation) and traverse trees via iterateTree for recursive path-preserving mapping; CliJsonFormatterAdapter formats results as pretty JSON.
GitGraphAdapter: delegation & streaming refactoring
src/infrastructure/adapters/GitGraphAdapter.ts
GitGraphAdapter instantiates GitCasGraphReaderAdapter and delegates readBlob/readTreeOids/readObjectType; blob-content normalization switches to Uint8Array using textEncode; parseContentAnchorObjectType helper validates git object types; readTree batch handling refined to use undefined-based filtering.
V16→V17 substrate upgrade CLI tool
scripts/upgrade-v16-to-v17.ts
New CLI utility parses arguments (--repo, --graph, --dry-run, --json, --help), discovers target graphs from refs or explicit list, runs checkpoint schema upgrades per graph, migrates legacy rebuildable cache refs with dry-run reporting, outputs JSON or human-readable format.
Test infrastructure async plumbing synchronization
test/helpers/WarpGraphTestRepositories.ts, test/integration/**/setup.ts, test/runtime/deno/helpers.ts
Test helpers and integration setup await Plumbing.createDefault() instead of calling it synchronously; TestPlumbing type wrapped in Awaited<>.
GitGraphAdapter streaming behavior & test mocking
test/unit/domain/services/GitGraphAdapter.test.ts, test/unit/infrastructure/adapters/GitGraphAdapter.coverage.test.ts, test/unit/infrastructure/adapters/GitGraphAdapter.listRefs.test.ts
Unit tests introduce streamFromBytes/streamFromText helpers; update readBlob/readTree/readTreeOids mocks to use executeStream with async-iterable returns; add recursive path-preservation and readObjectType coverage; update error-handling expectations.
V16→V17 upgrade tool testing
test/unit/scripts/v16-to-v17-upgrade.test.ts
Test suite verifies CLI argument parsing, dry-run cache-ref reporting without mutation, actual cache-ref deletion with checkpoint preservation, human result formatting, and package.json/tsconfig wiring.
Adapter persistence bridge & memory audit validation
test/unit/infrastructure/adapters/GitGraphAdapter.gitCasPersistence.test.ts, test/unit/scripts/streaming-memory-audit-closeout.test.ts, test/unit/scripts/uniform-git-cas-closeout.test.ts
Adapter tests validate reader-adapter delegation and Uint8Array normalization; memory audit asserts unbounded blob-stream collection; uniform-git-cas closeout confirms upgrade tool wiring and adapter parity completion.
Content anchor integration test coverage
test/unit/domain/services/CheckpointService.anchors.test.ts, test/unit/infrastructure/adapters/CliJsonFormatterAdapter.test.ts
New test suite verifies checkpoint envelope generation correctly embeds blob vs tree entries for legacy raw blobs and CAS trees; CliJsonFormatterAdapter test validates JSON formatting.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • git-stunts/git-warp#68: Main PR refactors GitGraphAdapter blob reads to delegate through GitCasGraphReaderAdapter while explicitly preserving the empty-read vs missing-object distinction via assertEmptyBlobExists, which directly overlaps with PR #68's change to make missing content blob OIDs throw PersistenceError(E_MISSING_OBJECT) instead of returning empty bytes.
  • git-stunts/git-warp#42: The main PR's checkpoint content-anchor logic now resolves each _content_<oid> anchor's git object type (blob vs tree) via a persistence-provided readObjectType, directly aligning with the retrieved PR's content-attachment/checkpoint anchoring that embeds _content_{oid} blob OIDs for GC durability.

Poem

🐰 A streaming rabbit, quick and spry,
Now reads from gas with method dry,
Blobs flow like carrots, trees take shape,
No buffering bloat—the perfect escape!
From v16 chains to modern air,
Git-cas v6, a leap beyond compare! 🥕✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 16.13% 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 'release: v17.0.0 follow-up substrate closeout' clearly and specifically describes the main purpose: landing remaining substrate/runtime commits to complete the v17 release closeout after PR #84.
Description check ✅ Passed The PR description provides comprehensive context: summarizes included substrate commits, explains the closure purpose, lists validation steps, and notes deferred work. It goes beyond the template with detailed information but lacks explicit ADR checks.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch release/v17.0.0-followup

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 and usage tips.

@github-actions
Copy link
Copy Markdown

Release Preflight

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

If you tag this commit as v17.0.0, 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: 2

🧹 Nitpick comments (1)
scripts/upgrade-v16-to-v17.ts (1)

37-47: ⚡ Quick win

Replace positional booleans in V16ToV17UpgradeArgs with a named options object.

The constructor call site passes multiple booleans positionally, which is a boolean trap and easy to misuse.

Suggested refactor
+interface V16ToV17UpgradeArgsOptions {
+  readonly repo: string;
+  readonly graphNames: readonly string[];
+  readonly dryRun: boolean;
+  readonly json: boolean;
+  readonly help: boolean;
+}
+
 export class V16ToV17UpgradeArgs {
-  constructor(
-    readonly repo: string,
-    readonly graphNames: readonly string[],
-    readonly dryRun: boolean,
-    readonly json: boolean,
-    readonly help: boolean,
-  ) {
+  readonly repo: string;
+  readonly graphNames: readonly string[];
+  readonly dryRun: boolean;
+  readonly json: boolean;
+  readonly help: boolean;
+
+  constructor(options: V16ToV17UpgradeArgsOptions) {
+    this.repo = options.repo;
+    this.graphNames = options.graphNames;
+    this.dryRun = options.dryRun;
+    this.json = options.json;
+    this.help = options.help;
     Object.freeze(this);
   }
 }
@@
-  return new V16ToV17UpgradeArgs(repo, graphNames, dryRun, json, help);
+  return new V16ToV17UpgradeArgs({ repo, graphNames, dryRun, json, help });

As per coding guidelines, "Avoid boolean trap parameters; use named option objects or separate methods instead."

Also applies to: 130-130

🤖 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/upgrade-v16-to-v17.ts` around lines 37 - 47, The constructor for
V16ToV17UpgradeArgs exposes multiple positional boolean parameters (dryRun,
json, help) which is a boolean-trap; change the constructor signature to accept
a single options object (e.g., opts: { dryRun?: boolean; json?: boolean; help?:
boolean }) or a typed interface, update properties on the class to read from
that options object, freeze the instance as before, and then update all call
sites (places creating new V16ToV17UpgradeArgs) to pass a single named options
object instead of positional booleans; ensure the class still exposes readonly
repo and graphNames and preserve Object.freeze(this).
🤖 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/upgrade-v16-to-v17.ts`:
- Around line 97-111: The parser accepts next argv tokens that are flags as
values for --repo and --graph; update the parsing around the arg/argv/i handling
so that after reading const value = argv[i + 1] you also reject it if it is
undefined or startsWith('-'), throwing V16ToV17UpgradeArgumentError('--repo
requires a path') or V16ToV17UpgradeArgumentError('--graph requires a graph
name') respectively; ensure you check this for both the repo assignment (repo =
value) and graphNames.push(value) branches so flag-like tokens (e.g.
'--dry-run') are not treated as values.

In `@test/unit/domain/services/CheckpointService.test.ts`:
- Around line 1032-1075: This test adds anchor-focused coverage into an already
oversized test file; extract the it('preserves legacy raw blob content anchors
when creating a checkpoint'...) case into a new dedicated spec (e.g.,
CheckpointService.anchors.test.ts), copy/import the required helpers and mocks
(createCheckpointEnvelope, createEmptyState, makeSequentialOid, makeOid,
encodePropKeyV5, CONTENT_PROPERTY_KEY, createFrontier, updateFrontier,
mockPersistence, crypto) so it is self-contained, keep the same assertions, and
adjust mock setup and imports to match the new file; remove the test from the
original file to keep it under the 800 LOC limit and run the test suite to
ensure imports/mocks are correct.

---

Nitpick comments:
In `@scripts/upgrade-v16-to-v17.ts`:
- Around line 37-47: The constructor for V16ToV17UpgradeArgs exposes multiple
positional boolean parameters (dryRun, json, help) which is a boolean-trap;
change the constructor signature to accept a single options object (e.g., opts:
{ dryRun?: boolean; json?: boolean; help?: boolean }) or a typed interface,
update properties on the class to read from that options object, freeze the
instance as before, and then update all call sites (places creating new
V16ToV17UpgradeArgs) to pass a single named options object instead of positional
booleans; ensure the class still exposes readonly repo and graphNames and
preserve Object.freeze(this).
🪄 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: 98c9c337-fb8a-4805-baa0-76d66379fe35

📥 Commits

Reviewing files that changed from the base of the PR and between bf34135 and 57c6584.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (31)
  • CHANGELOG.md
  • docs/method/backlog/up-next/INFRA_git-cas-vault-encryption.md
  • docs/method/backlog/up-next/INFRA_policy-as-port-streaming-resilience.md
  • docs/method/backlog/v17.0.0/INFRA_git-cas-adapter-parity.md
  • docs/method/backlog/v17.0.0/INFRA_substrate-upgrade-tool.md
  • docs/migrations/v17.0.0.md
  • docs/releases/v17.0.0/README.md
  • docs/specs/CONTENT_ATTACHMENT.md
  • package.json
  • scripts/upgrade-v16-to-v17.ts
  • src/domain/services/state/checkpointCreate.ts
  • src/domain/services/state/checkpointHelpers.ts
  • src/infrastructure/adapters/CliJsonFormatterAdapter.ts
  • src/infrastructure/adapters/GitCasGraphReaderAdapter.ts
  • src/infrastructure/adapters/GitGraphAdapter.ts
  • test/helpers/WarpGraphTestRepositories.ts
  • test/integration/WarpGraph.integration.test.ts
  • test/integration/api/helpers/setup.ts
  • test/integration/domain/orset/trie/TrieCursor.flush.integration.test.ts
  • test/integration/infrastructure/adapters/GitTrieStoreAdapter.integration.test.ts
  • test/runtime/deno/deno.json
  • test/runtime/deno/helpers.ts
  • test/unit/domain/services/CheckpointService.test.ts
  • test/unit/domain/services/GitGraphAdapter.test.ts
  • test/unit/infrastructure/adapters/CliJsonFormatterAdapter.test.ts
  • test/unit/infrastructure/adapters/GitGraphAdapter.coverage.test.ts
  • test/unit/infrastructure/adapters/GitGraphAdapter.gitCasPersistence.test.ts
  • test/unit/scripts/streaming-memory-audit-closeout.test.ts
  • test/unit/scripts/uniform-git-cas-closeout.test.ts
  • test/unit/scripts/v16-to-v17-upgrade.test.ts
  • tsconfig.publish.json

Comment thread scripts/upgrade-v16-to-v17.ts
Comment thread test/unit/domain/services/CheckpointService.test.ts Outdated
@github-actions
Copy link
Copy Markdown

Release Preflight

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

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

@github-actions
Copy link
Copy Markdown

Release Preflight

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

If you tag this commit as v17.0.0, 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.

🧹 Nitpick comments (3)
test/unit/domain/services/CheckpointService.anchors.test.ts (3)

120-122: ⚡ Quick win

Consider making the fallback to 'tree' explicit or failing for unmocked OIDs.

The silent default to 'tree' when an OID is not found could hide incomplete test setup. If a test forgets to call setObjectType for a content anchor, it will silently default to 'tree' rather than failing with a clear error.

🛡️ Option 1: Add comment documenting the default behavior
 async readObjectType(oid: string): Promise<ContentAnchorObjectType> {
+  // Default to 'tree' for unmocked OIDs to match git-cas CAS graph behavior
   return this._objectTypes.get(oid) ?? 'tree';
 }
🛡️ Option 2: Throw error for unmocked OIDs
 async readObjectType(oid: string): Promise<ContentAnchorObjectType> {
-  return this._objectTypes.get(oid) ?? 'tree';
+  const objectType = this._objectTypes.get(oid);
+  if (objectType === undefined) {
+    throw new AnchorCheckpointPersistenceError(`Object type not mocked for OID: ${oid}`);
+  }
+  return objectType;
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/unit/domain/services/CheckpointService.anchors.test.ts` around lines 120
- 122, The test helper currently returns a silent default 'tree' in
readObjectType when an OID is missing; change this so unmocked OIDs fail loudly:
in the method readObjectType use this._objectTypes to check for presence of oid
and if not present throw a descriptive Error (e.g. "unmocked OID <oid> in
readObjectType") instead of returning 'tree'; this will force tests to call
setObjectType for anchors and avoid hidden test setup bugs.

157-163: ⚡ Quick win

Consider using order-independent assertions for better test resilience.

The current assertion expects envelope tree entries in a specific order. If the implementation changes the order (e.g., sorting differently), the test will break even though the functionality is correct.

🧪 Use arrayContaining for order-independent matching
 expect(persistence.envelopeTreeEntries()).toEqual([
-  `100644 blob ${legacyBlobOid}\t_content_${legacyBlobOid}`,
-  `040000 tree ${casTreeOid}\t_content_${casTreeOid}`,
-  expect.stringContaining('\tappliedVV.cbor'),
-  expect.stringContaining('\tfrontier.cbor'),
-  expect.stringContaining('\tstate'),
-]);
+  expect.arrayContaining([
+    `100644 blob ${legacyBlobOid}\t_content_${legacyBlobOid}`,
+    `040000 tree ${casTreeOid}\t_content_${casTreeOid}`,
+    expect.stringContaining('\tappliedVV.cbor'),
+    expect.stringContaining('\tfrontier.cbor'),
+    expect.stringContaining('\tstate'),
+  ])
+);

Alternatively, verify the array length and check each entry individually:

-expect(persistence.envelopeTreeEntries()).toEqual([
-  `100644 blob ${legacyBlobOid}\t_content_${legacyBlobOid}`,
-  `040000 tree ${casTreeOid}\t_content_${casTreeOid}`,
-  expect.stringContaining('\tappliedVV.cbor'),
-  expect.stringContaining('\tfrontier.cbor'),
-  expect.stringContaining('\tstate'),
-]);
+const entries = persistence.envelopeTreeEntries();
+expect(entries).toHaveLength(5);
+expect(entries).toContain(`100644 blob ${legacyBlobOid}\t_content_${legacyBlobOid}`);
+expect(entries).toContain(`040000 tree ${casTreeOid}\t_content_${casTreeOid}`);
+expect(entries.some(e => e.includes('\tappliedVV.cbor'))).toBe(true);
+expect(entries.some(e => e.includes('\tfrontier.cbor'))).toBe(true);
+expect(entries.some(e => e.includes('\tstate'))).toBe(true);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/unit/domain/services/CheckpointService.anchors.test.ts` around lines 157
- 163, Change the brittle ordered assertion over
persistence.envelopeTreeEntries() to an order-independent check: replace the
toEqual([...]) usage with an assertion that uses expect.arrayContaining([...])
(or
expect(persistence.envelopeTreeEntries()).toEqual(expect.arrayContaining([...]))),
and additionally assert the array length if you need to guarantee no extra
entries; keep the same matchers (string literals and
expect.stringContaining('\tappliedVV.cbor'),
expect.stringContaining('\tfrontier.cbor'), expect.stringContaining('\tstate'))
so the test validates presence regardless of order.

50-56: ⚡ Quick win

Document why index [1] retrieves the envelope tree.

The hardcoded index assumes the envelope tree is always the second tree written, but this assumption is implicit. If the write order changes in createCheckpointEnvelope, this test will break silently or return incorrect data.

📝 Add clarifying comment
 envelopeTreeEntries(): readonly string[] {
+  // Index 1: createCheckpointEnvelope writes state tree first (index 0), then envelope tree (index 1)
   const entries = this.writtenTrees[1];
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/unit/domain/services/CheckpointService.anchors.test.ts` around lines 50
- 56, The test currently uses a magic index (this.writtenTrees[1]) in
envelopeTreeEntries to assume the envelope tree is always the second tree
written; add a concise clarifying comment above the envelopeTreeEntries() method
that states why index 1 corresponds to the envelope tree (referencing the write
order established by createCheckpointEnvelope and the structure of
writtenTrees), and consider noting that if createCheckpointEnvelope's write
order changes the test must be updated (or suggest replacing the magic index
with a named constant or a lookup by tree type such as an "ENVELOPE_TREE_INDEX"
or scanning writtenTrees for the envelope tree).
🤖 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.

Nitpick comments:
In `@test/unit/domain/services/CheckpointService.anchors.test.ts`:
- Around line 120-122: The test helper currently returns a silent default 'tree'
in readObjectType when an OID is missing; change this so unmocked OIDs fail
loudly: in the method readObjectType use this._objectTypes to check for presence
of oid and if not present throw a descriptive Error (e.g. "unmocked OID <oid> in
readObjectType") instead of returning 'tree'; this will force tests to call
setObjectType for anchors and avoid hidden test setup bugs.
- Around line 157-163: Change the brittle ordered assertion over
persistence.envelopeTreeEntries() to an order-independent check: replace the
toEqual([...]) usage with an assertion that uses expect.arrayContaining([...])
(or
expect(persistence.envelopeTreeEntries()).toEqual(expect.arrayContaining([...]))),
and additionally assert the array length if you need to guarantee no extra
entries; keep the same matchers (string literals and
expect.stringContaining('\tappliedVV.cbor'),
expect.stringContaining('\tfrontier.cbor'), expect.stringContaining('\tstate'))
so the test validates presence regardless of order.
- Around line 50-56: The test currently uses a magic index
(this.writtenTrees[1]) in envelopeTreeEntries to assume the envelope tree is
always the second tree written; add a concise clarifying comment above the
envelopeTreeEntries() method that states why index 1 corresponds to the envelope
tree (referencing the write order established by createCheckpointEnvelope and
the structure of writtenTrees), and consider noting that if
createCheckpointEnvelope's write order changes the test must be updated (or
suggest replacing the magic index with a named constant or a lookup by tree type
such as an "ENVELOPE_TREE_INDEX" or scanning writtenTrees for the envelope
tree).

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a7080a01-5794-4a2a-822e-478bf993f3d8

📥 Commits

Reviewing files that changed from the base of the PR and between 57c6584 and 2037714.

📒 Files selected for processing (6)
  • CHANGELOG.md
  • scripts/upgrade-v16-to-v17.ts
  • test/unit/domain/services/CheckpointService.anchors.test.ts
  • test/unit/infrastructure/adapters/GitGraphAdapter.coverage.test.ts
  • test/unit/infrastructure/adapters/GitGraphAdapter.listRefs.test.ts
  • test/unit/scripts/v16-to-v17-upgrade.test.ts
✅ Files skipped from review due to trivial changes (1)
  • CHANGELOG.md
🚧 Files skipped from review as they are similar to previous changes (2)
  • test/unit/scripts/v16-to-v17-upgrade.test.ts
  • scripts/upgrade-v16-to-v17.ts

@flyingrobots flyingrobots merged commit d9c0b76 into main May 18, 2026
9 checks passed
@flyingrobots flyingrobots deleted the release/v17.0.0-followup branch May 18, 2026 02:39
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