Skip to content

Migrate OCP to canton-dev-tools prepare-build (0.1.5) - #309

Merged
HardlyDifficult merged 18 commits into
mainfrom
cursor/migrate-canton-dev-tools-8295
Aug 12, 2026
Merged

Migrate OCP to canton-dev-tools prepare-build (0.1.5)#309
HardlyDifficult merged 18 commits into
mainfrom
cursor/migrate-canton-dev-tools-8295

Conversation

@HardlyDifficult

@HardlyDifficult HardlyDifficult commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

Migrate Open Cap Table Protocol DAML tooling onto @fairmint/canton-dev-tools 0.1.5:

  • Adopt prepare-build / generated/build/ for build, test, lint, and clean (no more in-place {pkg}/.daml/dist/ builds).
  • Adopt sync-splice-dars (MainNet pin from canton-dev-tools); remove the libs/splice git submodule. Replay keeps a conditional submodule fallback for older target SHAs that still declare it.
  • Wire DAR lifecycle npm scripts to the shared CLI (backup-dar, verify-dars, check-dar-version-policy, check-upgrade-compat, install-dpm-sdks) and delete the local implementations / wrappers.
  • Remove thin shims scripts/run-backup-dar.ts and scripts/run-check-dar-deployment.ts; call canton-dev-tools directly (discovery name OpenCapTable-v34).
  • Require Node 22+; CI/publish/release/upload/replay install SDKs via canton-dev-tools and append ~/.dpm/bin to PATH.

Intentionally local

  • Keep scripts/packages.ts and OCP-specific codegen / factory / deploy / upload scripts (repo-specific, not shared tooling).

Out of scope

  • Replay lockfile work remains out of scope (discussed; not this PR).

Test plan

  • npx canton-dev-tools install-dpm-sdks
  • npm run build / npm test via prepare-build + generated/build/
  • npm run verify-dars / npm run test:dar-version-policy
  • Shared CLI paths (backup-dar, check:dar-version-policy -- --deployment, check-upgrade-compat) — no local DAR lifecycle wrappers
  • CI green on tip (daml-build on 9ef48d7)

Note

High Risk
Touches the full build pipeline, DAR backup/version-policy gates, and release/deploy CI paths. A regression could break builds, DAR integrity checks, or network uploads.

Overview
Migrates Open Cap Table Protocol tooling onto @fairmint/canton-dev-tools 0.1.5, so build/test/lint/clean run through prepare-build into generated/build/ instead of in-place package dirs.

Removes the libs/splice git submodule and fetches Splice DARs via sync-splice-dars. Replay keeps a conditional submodule fallback for older target SHAs. Local DAR lifecycle scripts (backup-dar, verify-dars, version-policy, upgrade-compat, SDK install) are deleted and npm scripts call the shared CLI instead.

Requires Node 22+. CI/publish/release/upload/replay install SDKs via canton-dev-tools, drop recursive submodule checkout, and point deployment gates at check:dar-version-policy -- --deployment. Remaining OCP scripts (packages, upload, factory, codegen) now resolve DARs from buildDir.

Reviewed by Cursor Bugbot for commit 9ef48d7. Bugbot is set up for automated code reviews on this repo. Configure here.

Summary by CodeRabbit

  • Improvements

    • Updated project tooling and automated workflows to support Node.js 22 or newer.
    • Simplified SDK installation and DAR verification through the Canton developer tools CLI.
    • Improved SDK and LocalNet asset caching across CI, publishing, release, replay, and upload workflows.
    • Updated Canton developer tools to version 0.1.3.
  • Documentation

    • Updated build instructions with the new Node.js requirement and SDK installation command.

Use the shared install-dpm-sdks and verify-dars CLI, and re-export dar-utils /
policy primitives from @fairmint/canton-dev-tools/daml. Keep local backup,
upgrade-compat, and OCP deployment-gate scripts because this repo builds
in-place under {pkg}/.daml/dist/ and the shared CLI still expects generated/build.

Co-authored-by: hardlydiff <hardlydiff@gmail.com>
@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

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

Use the following commands to manage reviews:

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

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The repository now uses @fairmint/canton-dev-tools for Daml SDK installation, DAR verification, DAR utilities, and version policy operations. CI workflows and build documentation use Node.js 22. Local installer and verification scripts were removed.

Changes

Canton tooling migration

Layer / File(s) Summary
Shared DAR and version tooling adapters
scripts/dar-utils.ts, scripts/dar-version-policy.ts, scripts/check-upgrade-compatibility.ts
Local DAR management, integrity checks, lock handling, deployment tags, patch calculation, and semantic-version comparison now use shared tooling primitives.
CLI and Node.js contract updates
package.json, README.md
The package requires Node.js 22+, and package scripts and build instructions use Canton CLI commands.
Workflow runtime and SDK installation updates
.github/workflows/*
Workflows use Node.js 22, package-based cache keys, and local Canton tooling executables for SDK installation.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 64.29% 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
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: migrating OCP tooling to canton-dev-tools.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cursor/migrate-canton-dev-tools-8295

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

@socket-security

socket-security Bot commented Aug 11, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatednpm/​@​fairmint/​canton-dev-tools@​0.1.1 ⏵ 0.1.577 +2100100 +196 +5100

View full report

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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 @.github/workflows/publish.yml:
- Around line 53-57: In the workflow steps around “Install DAML SDK (dpm)”, move
“Install dependencies” so npm i runs before invoking canton-dev-tools, then
update the DAML SDK step to use the installed local CLI and assert that
./node_modules/.bin/canton-dev-tools exists before running it.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 8299be1d-e766-41cf-99c7-451b65d60d39

📥 Commits

Reviewing files that changed from the base of the PR and between 09ea1b6 and fab83aa.

📒 Files selected for processing (12)
  • .github/workflows/ci.yml
  • .github/workflows/publish.yml
  • .github/workflows/release.yml
  • .github/workflows/replay-ocf-database.yml
  • .github/workflows/upload-dar-ledger.yml
  • README.md
  • package.json
  • scripts/check-upgrade-compatibility.ts
  • scripts/dar-utils.ts
  • scripts/dar-version-policy.ts
  • scripts/install-dpm-sdks.sh
  • scripts/verify-dars.ts
💤 Files with no reviewable changes (2)
  • scripts/install-dpm-sdks.sh
  • scripts/verify-dars.ts

Comment thread .github/workflows/publish.yml Outdated
Comment thread .github/workflows/publish.yml Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fab83aa63d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/publish.yml Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Migrates duplicated DAML tooling to @fairmint/canton-dev-tools@0.1.2 while retaining repository-specific DAR lifecycle orchestration.

Changes:

  • Replaced local SDK installation and DAR verification scripts with shared CLI commands.
  • Reused shared DAR utilities and version-policy primitives through local adapters.
  • Updated documentation, dependency version, CI workflows, and cache keys.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
scripts/verify-dars.ts Removes the local DAR verifier.
scripts/install-dpm-sdks.sh Removes the local SDK installer.
scripts/dar-version-policy.ts Imports shared deployment-policy primitives.
scripts/dar-utils.ts Wraps shared DAR utilities for the in-place layout.
scripts/check-upgrade-compatibility.ts Uses shared semantic-version comparison.
README.md Documents shared SDK installation.
package.json Updates the tool dependency and verifier command.
.github/workflows/upload-dar-ledger.yml Uses the shared SDK installer and cache key.
.github/workflows/replay-ocf-database.yml Updates tooling and SDK installation.
.github/workflows/release.yml Uses the shared SDK installer and cache key.
.github/workflows/publish.yml Migrates publishing setup to shared tooling.
.github/workflows/ci.yml Migrates CI SDK installation and caching.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread package.json Outdated
Comment thread .github/workflows/publish.yml Outdated
Move npm install ahead of install-dpm-sdks in publish.yml so the pinned
@fairmint/canton-dev-tools binary is available. Upgrade CI, DAR-check,
publish, release, and upload workflows to Node 22 to match canton-dev-tools
0.1.2 engines, invoke the local CLI via npm exec, and document Node 22+ in
package.json and README.

Co-authored-by: hardlydiff <hardlydiff@gmail.com>
@HardlyDifficult

Copy link
Copy Markdown
Collaborator Author

Addressed bot review in 6c61e83:

  • publish.yml: npm i now runs before install-dpm-sdks; the step asserts ./node_modules/.bin/canton-dev-tools and uses npm exec canton-dev-tools -- install-dpm-sdks so the pinned @fairmint/canton-dev-tools@0.1.2 from package.json is used.
  • Node 22: CI, check-dars, publish, release, and upload-dar-ledger workflows upgraded from Node 20 → 22 to match canton-dev-tools engines.
  • Local runtime docs: Added "engines": { "node": ">=22" } to package.json and noted Node 22+ in README; install command uses npm exec after npm install.
  • Consistency: release, upload, ci, and replay-ocf-database workflows also use the local CLI via npm exec + binary assertion.

Comment thread .github/workflows/release.yml
Workflows that invoke install-dpm-sdks now echo $HOME/.dpm/bin to
GITHUB_PATH so later steps (e.g. detect-factory-need) can run bare dpm.
Bump @fairmint/canton-dev-tools to 0.1.3.

Co-authored-by: hardlydiff <hardlydiff@gmail.com>
Comment thread .github/workflows/replay-ocf-database.yml Outdated
Comment thread .github/workflows/replay-ocf-database.yml Outdated
Ensure LocalNet CLI now uses canton-dev-tools from npm install when
present, otherwise reads the version from package.json with a 0.1.3
fallback for pre-cutover SHAs. Record committed package.json hash
before any optional npm install so Daml SDK and LocalNet cache keys
match the checked-out target_sha contents.

Co-authored-by: hardlydiff <hardlydiff@gmail.com>
Comment thread .github/workflows/replay-ocf-database.yml

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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 @.github/workflows/replay-ocf-database.yml:
- Around line 131-133: Update the installation flow around dev_tools_ver,
node_sdk_ver, and the npm install command to use a workflow-owned,
integrity-pinned lockfile or equivalent artifact for every supported target_sha.
Ensure both the normal and fallback installation paths install from that pinned
dependency definition rather than resolving transitive packages from the
registry.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 5758a31b-60b4-49eb-b5fe-3b1abd2c2962

📥 Commits

Reviewing files that changed from the base of the PR and between d5349ec and 596ac7d.

📒 Files selected for processing (1)
  • .github/workflows/replay-ocf-database.yml

Comment thread .github/workflows/replay-ocf-database.yml
cursoragent and others added 4 commits August 11, 2026 19:47
Co-authored-by: hardlydiff <hardlydiff@gmail.com>
….1.1

Replay checks out historical target_sha package.json, which may pin
canton-dev-tools 0.1.1 without install-dpm-sdks. Use the local shell
script when the installed CLI lacks that subcommand.

Co-authored-by: hardlydiff <hardlydiff@gmail.com>
Adopt generated/build via prepare-build, sync-splice-dars (drop splice
submodule), shared DAR policy/backup/upgrade-compat CLIs, and codegen-js
from buildDir. Watch scripts/codegen and libs/splice for DAR version policy.

Co-authored-by: hardlydiff <hardlydiff@gmail.com>
codegen build:ts failed after prepare-build migration because getDarPath
now requires the generated build directory for fresh DAR lookup.

Co-authored-by: hardlydiff <hardlydiff@gmail.com>
Comment thread scripts/run-check-dar-deployment.ts Outdated
Comment thread .github/workflows/replay-ocf-database.yml
@cursor cursor Bot changed the title Migrate shared DAML tooling to @fairmint/canton-dev-tools@0.1.2 Migrate OCP to canton-dev-tools prepare-build (0.1.5) Aug 11, 2026
cursoragent and others added 3 commits August 11, 2026 21:29
…back

Call checkDarVersionPolicy in-process so tag_exists reaches GITHUB_OUTPUT
for release/upload workflow gates. Conditionally init libs/splice on replay
when the checked-out target_sha still declares that submodule.

Co-authored-by: hardlydiff <hardlydiff@gmail.com>
Delete run-backup-dar / run-check-dar-deployment wrappers. Point backup-dar
and deployment gates at canton-dev-tools with OpenCapTable-v34 discovery names.

Co-authored-by: hardlydiff <hardlydiff@gmail.com>
@cursor

cursor Bot commented Aug 12, 2026

Copy link
Copy Markdown

Deferred items — addressed on tip

The PR body’s Deferred section is stale relative to tip 6740c22. Status:

Former deferred item Status
Do not adopt prepare-build / generated/build Done (reversed) — adopted
Keep local DAR lifecycle / deployment-gate scripts Done (migrated) — shared @fairmint/canton-dev-tools 0.1.5; shims removed in ade1032
No sync-splice-dars; keep splice submodule Done (reversed) — sync adopted; submodule removed
Keep packages.ts + OCP codegen/deploy Intentionally local (still kept)
Follow-up: delete wrappers after in-place mode Obsolete — wrappers gone via prepare-build adoption
Replay lockfile Still out of scope (not this PR)

CI: daml-build green on tip. Suggested body rewrite is in the agent run if someone wants to replace the stale Deferred/Summary sections.

No further code changes needed for those tooling deferrals.

Comment thread scripts/codegen-js.ts
Comment thread package.json
@cursor

cursor Bot commented Aug 12, 2026

Copy link
Copy Markdown

@coderabbitai resume

PR tip is 6740c22 with CI green. Prior review findings are addressed; deferred tooling items in the old description were implemented (prepare-build, sync-splice-dars, shared DAR CLI). Replay lockfile remains intentionally out of scope.

cursoragent and others added 2 commits August 12, 2026 13:21
Ensure prepared daml.yaml codegen.js.output-directory resolves to
repo-root generated/js before dpm codegen-js (source path is wrong
under generated/build). Always run prepare-build in prelint:daml so
lint does not use a stale generated tree.

Co-authored-by: hardlydiff <hardlydiff@gmail.com>
Always running prepare-build in prelint:daml deletes generated/build
(including .daml/dist DARs), so check-upgrade-compat fails after lint.
Restore conditional prepare (sibling repos' pattern); CI already prepares
via npm run build before lint. Keep the codegen output-path fix.

Co-authored-by: hardlydiff <hardlydiff@gmail.com>
@HardlyDifficult

Copy link
Copy Markdown
Collaborator Author

CI failed on 67322a9 (run): check-upgrade-compat could not find generated/build/OpenCapTable-v34/.daml/dist/…dar because prelint:daml always ran prepare-build, which rmSyncs generated/build (including built DARs) before upgrade-compat.

Fixed in 2f8d15b: restore conditional prepare-build for lint (same pattern as daml / canton-assets). Codegen output-path fix from 67322a9 kept. Watching new CI.

Comment thread package.json
CapTable.daml is gitignored; pretest only synced Splice DARs, so a clean
npm test skipped generation before prepare-build/dpm build. Mirror prebuild
and run generate-captable in pretest.

Co-authored-by: hardlydiff <hardlydiff@gmail.com>
Comment thread package.json
Comment thread .gitignore
libs/splice/ is gitignored after sync-splice-dars, so it never fires the
DAR version-policy extra watch paths. Watch package.json instead (canton-
dev-tools pin drives the shared Splice DAR set). Improve remove-participant-
dar's missing-proto error to describe the post-submodule layout.

Co-authored-by: hardlydiff <hardlydiff@gmail.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit d9b3582. Configure here.

Comment thread .github/workflows/release.yml Outdated
Hardcoded OpenCapTable-v34 in release/upload deployment preflight could
diverge from the package being uploaded on the next major line. Pass the
resolved daml.yaml package name from release_tag / package metadata instead.

Co-authored-by: hardlydiff <hardlydiff@gmail.com>
@HardlyDifficult
HardlyDifficult merged commit e115332 into main Aug 12, 2026
22 checks passed
@HardlyDifficult
HardlyDifficult deleted the cursor/migrate-canton-dev-tools-8295 branch August 12, 2026 13:58
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.

3 participants