Skip to content

Update genesis SDK to v0.32.1 with bonding curve and agent support#103

Merged
blockiosaurus merged 8 commits intomainfrom
claude/update-cli-genesis-api-d9R1f
Apr 7, 2026
Merged

Update genesis SDK to v0.32.1 with bonding curve and agent support#103
blockiosaurus merged 8 commits intomainfrom
claude/update-cli-genesis-api-d9R1f

Conversation

@blockiosaurus
Copy link
Copy Markdown
Contributor

  • Upgrade @metaplex-foundation/genesis from ^0.26.2 to ^0.32.1
  • Update bonding curve launch: remove deprecated depositStartTime, add
    creatorFeeWallet and firstBuyAmount options
  • Add agent mode (--agentMint, --agentSetToken) for AI agents to launch
    tokens via on-chain agent execution
  • Update wizard to support launch type selection (LaunchPool vs Bonding Curve)
    with type-specific configuration prompts
  • Fix register command bonding curve validation for new SDK schema

https://claude.ai/code/session_019vt15ih7CYh8fAhSCZmZKR

- Upgrade @metaplex-foundation/genesis from ^0.26.2 to ^0.32.1
- Update bonding curve launch: remove deprecated depositStartTime, add
  creatorFeeWallet and firstBuyAmount options
- Add agent mode (--agentMint, --agentSetToken) for AI agents to launch
  tokens via on-chain agent execution
- Update wizard to support launch type selection (LaunchPool vs Bonding Curve)
  with type-specific configuration prompts
- Fix register command bonding curve validation for new SDK schema

https://claude.ai/code/session_019vt15ih7CYh8fAhSCZmZKR
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 7, 2026

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

Bumped @metaplex-foundation/genesis and extended the Genesis launch flow to support two launch types (launchpool | bondingCurve), add optional agent configuration, and update CLI/wizard/API validation and wiring for new flags and conditional payload fields.

Changes

Cohort / File(s) Summary
Package Dependency
package.json
Bumped @metaplex-foundation/genesis from ^0.26.2 to ^0.32.1.
Launch CLI Command
src/commands/genesis/launch/create.ts
Added launchType option (launchpool
Launch Register Validation
src/commands/genesis/launch/register.ts
Removed nested bonding-curve depositStartTime requirement; added lightweight top-level validation for optional creatorFeeWallet and firstBuyAmount in bondingCurve branch.
Wizard Prompts
src/lib/genesis/createGenesisWizardPrompt.ts
Prompts now choose between launchpool and bondingCurve; launchpool fields made optional; added promptBondingCurveConfig and promptAgentConfig; extended LaunchWizardResult with optional creatorFeeWallet, firstBuyAmount, agentMint, agentSetToken.
Launch API & Wizard Wiring
src/lib/genesis/launchApi.ts, src/lib/genesis/wizard.ts
Added AgentConfig type; BuildLaunchInputParams.depositStartTime made optional; conditionally include creatorFeeWallet and firstBuyAmount for bondingCurve; map wizard agent fields into agent when present.
Tests
test/commands/genesis/genesis.launch.test.ts
Updated/added CLI tests: enforce --depositStartTime for launchpool, reject --depositStartTime for bondingCurve, validate --agentSetToken requires --agentMint; updated fixtures and skipped-test flag sets for bonding-curve and agent flags.
CI & Artifacts
.github/workflows/test.yml, .gitignore
CI: install Solana CLI and dump devnet program .so files before starting validator. Gitignore: ignore .amman/*.so.
Mocha config
.mocharc.json
Added ignore rule to exclude test/commands/distro/** from test discovery.

Sequence Diagram(s)

mermaid
sequenceDiagram
participant User as User (CLI)
participant CLI as CLI parser/command
participant Wizard as Wizard prompts
participant Builder as buildLaunchInput
participant API as Genesis API / external lib

User->>CLI: invoke command (flags or wizard)
CLI->>Wizard: run prompts (wizard mode) / parse flags
Wizard-->>CLI: LaunchWizardResult (launchType, optional fields, agent?)
CLI->>Builder: buildLaunchInput(params including agent?, creatorFeeWallet?, firstBuyAmount?)
Builder->>Builder: validate per launchType (depositStartTime rules, optional fields)
Builder->>API: send CreateLaunchInput payload
API-->>CLI: response (success / error)
CLI-->>User: display result (includes Agent Mint when present)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • MarkSackerberg
  • tonyboylehub
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 55.56% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: SDK upgrade to v0.32.1 and addition of bonding curve and agent support features.
Description check ✅ Passed The description is directly related to the changeset, detailing the SDK upgrade, bonding curve updates, agent mode features, wizard enhancements, and validation fixes.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/update-cli-genesis-api-d9R1f

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

- depositStartTime is no longer a shared required flag (only for launchpool)
- Add dedicated test for depositStartTime requirement on launchpool
- Update bonding curve tests: remove deprecated depositStartTime usage
- Update register bonding curve test to use new creatorFeeWallet field
- Add tests for new flags: depositStartTime rejection on bonding curve,
  agentSetToken without agentMint validation
- Add skipped test stubs for bonding curve + agent flag API calls

https://claude.ai/code/session_019vt15ih7CYh8fAhSCZmZKR
Copy link
Copy Markdown
Contributor

@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

Caution

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

⚠️ Outside diff range comments (1)
src/commands/genesis/launch/register.ts (1)

99-112: ⚠️ Potential issue | 🟡 Minor

Restore local bonding-curve validation.

This branch no longer checks creatorFeeWallet or firstBuyAmount, so malformed JSON now reaches the API instead of failing locally. Mirror the Line 102-Line 106 checks already present in src/commands/genesis/launch/create.ts here so register stays aligned with the flag path.

Suggested patch
 import {
   CreateLaunchInput,
   GenesisApiConfig,
   SvmNetwork,
   registerLaunch,
 } from '@metaplex-foundation/genesis'
+import { isPublicKey } from '@metaplex-foundation/umi'
 import { Args, Flags } from '@oclif/core'
 import ora from 'ora'
@@
       const launch = config.launch as Record<string, unknown>
       if (config.launchType === 'launchpool') {
         if (!launch.launchpool || typeof launch.launchpool !== 'object' || Array.isArray(launch.launchpool)) {
           throw new Error('Launchpool config requires a "launch.launchpool" object')
         }
         const pool = launch.launchpool as Record<string, unknown>
         if (!pool.tokenAllocation || !pool.depositStartTime || !pool.raiseGoal || !pool.raydiumLiquidityBps || !pool.fundsRecipient) {
           throw new Error('Launchpool config requires "tokenAllocation", "depositStartTime", "raiseGoal", "raydiumLiquidityBps", and "fundsRecipient" in launch.launchpool')
         }
+      } else {
+        if (
+          launch.creatorFeeWallet !== undefined &&
+          (typeof launch.creatorFeeWallet !== 'string' || !isPublicKey(launch.creatorFeeWallet))
+        ) {
+          throw new Error('Bonding curve config "creatorFeeWallet" must be a valid public key')
+        }
+        if (
+          launch.firstBuyAmount !== undefined &&
+          (typeof launch.firstBuyAmount !== 'number' ||
+            !Number.isFinite(launch.firstBuyAmount) ||
+            launch.firstBuyAmount < 0)
+        ) {
+          throw new Error('Bonding curve config "firstBuyAmount" must be a non-negative number')
+        }
       }
-
-      // Bonding curve: the launch field is a BondingCurveLaunchInput directly
-      // (optional fields: creatorFeeWallet, firstBuyAmount). No nested key required.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/commands/genesis/launch/register.ts` around lines 99 - 112, Add the
missing bonding-curve input validation so malformed bonding-curve JSON is
rejected locally: when config.launchType === 'bonding-curve' (using the existing
const launch = config.launch), assert the bonding-curve fields match the checks
used in src/commands/genesis/launch/create.ts — verify that launch (as a
BondingCurveLaunchInput) contains the expected creatorFeeWallet and
firstBuyAmount (and validate their types, e.g., creatorFeeWallet is a non-empty
string and firstBuyAmount is a number or numeric string) and throw a clear Error
if they are missing/invalid; mirror the exact error messaging pattern used for
launchpool to keep behavior consistent.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/commands/genesis/launch/create.ts`:
- Around line 357-364: The current parsing of flags.firstBuyAmount allows
Infinity (e.g. 1e309); after converting flags.firstBuyAmount to a number in the
block that sets flagRecord.firstBuyAmount, add a guard using
Number.isFinite(amount) and call this.error(...) if it is not finite (in
addition to the existing isNaN/amount < 0 check) so only finite, non-negative
numbers are stored in flagRecord.firstBuyAmount.

In `@src/lib/genesis/createGenesisWizardPrompt.ts`:
- Around line 352-359: The validator for the "First buy amount" input in
createGenesisWizardPrompt (the input call that sets amountStr) currently accepts
values where Number(v) yields Infinity; update the validator used in that input
to also reject non-finite numbers by checking Number.isFinite(n) (or
isFinite(n)) after parsing, returning an error like 'Must be a finite positive
number' when the value is infinite/NaN/<=0; keep the existing abortOrTrue and
trim checks and ensure the final return remains true when valid.

---

Outside diff comments:
In `@src/commands/genesis/launch/register.ts`:
- Around line 99-112: Add the missing bonding-curve input validation so
malformed bonding-curve JSON is rejected locally: when config.launchType ===
'bonding-curve' (using the existing const launch = config.launch), assert the
bonding-curve fields match the checks used in
src/commands/genesis/launch/create.ts — verify that launch (as a
BondingCurveLaunchInput) contains the expected creatorFeeWallet and
firstBuyAmount (and validate their types, e.g., creatorFeeWallet is a non-empty
string and firstBuyAmount is a number or numeric string) and throw a clear Error
if they are missing/invalid; mirror the exact error messaging pattern used for
launchpool to keep behavior consistent.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

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

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 6abfeed9-7dfa-444b-8574-83db4058d640

📥 Commits

Reviewing files that changed from the base of the PR and between 1475a0b and e544421.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (6)
  • package.json
  • src/commands/genesis/launch/create.ts
  • src/commands/genesis/launch/register.ts
  • src/lib/genesis/createGenesisWizardPrompt.ts
  • src/lib/genesis/launchApi.ts
  • src/lib/genesis/wizard.ts

Copy link
Copy Markdown
Contributor

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

Caution

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

⚠️ Outside diff range comments (1)
test/commands/genesis/genesis.launch.test.ts (1)

246-307: 🧹 Nitpick | 🔵 Trivial

Avoid keeping new bonding-curve coverage permanently skipped.

These new scenarios validate important paths (bonding-curve optional flags and agent flags) but won’t run in CI due to it.skip. Consider converting them to mock/stub-based tests so the assertions execute reliably without requiring a live API.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/commands/genesis/genesis.launch.test.ts` around lines 246 - 307, The
three new bonding-curve tests in genesis.launch.test.ts are permanently disabled
via it.skip so CI never exercises their paths; update them to run by removing
the skips and substitute the live-API dependency with a stub/mock: keep the
existing test cases and call runCli but before that stub the network/API client
used by runCli (or the underlying http/fetch function) to return a controlled
error/response so the catch branches assert as intended; reference the test
names (e.g., "bonding-curve launch requires only name, symbol, image",
"bonding-curve launch with optional flags", "bonding-curve launch with agent
flags") and the runCli helper when locating where to inject the mock (use your
test framework's mocking library such as sinon/nock or jest mocks to intercept
the API call and simulate the failure/success expected by the assertions).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@test/commands/genesis/genesis.launch.test.ts`:
- Around line 246-307: The three new bonding-curve tests in
genesis.launch.test.ts are permanently disabled via it.skip so CI never
exercises their paths; update them to run by removing the skips and substitute
the live-API dependency with a stub/mock: keep the existing test cases and call
runCli but before that stub the network/API client used by runCli (or the
underlying http/fetch function) to return a controlled error/response so the
catch branches assert as intended; reference the test names (e.g.,
"bonding-curve launch requires only name, symbol, image", "bonding-curve launch
with optional flags", "bonding-curve launch with agent flags") and the runCli
helper when locating where to inject the mock (use your test framework's mocking
library such as sinon/nock or jest mocks to intercept the API call and simulate
the failure/success expected by the assertions).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: b164560e-7ec4-4c3b-a3dd-03a9ae12b870

📥 Commits

Reviewing files that changed from the base of the PR and between e544421 and b904753.

📒 Files selected for processing (1)
  • test/commands/genesis/genesis.launch.test.ts

- Reject Infinity values in --firstBuyAmount parsing (Number.isFinite guard)
- Reject Infinity in wizard firstBuyAmount prompt validator
- Add bonding curve field validation in register command: validate
  creatorFeeWallet is a non-empty string and firstBuyAmount is finite
  and non-negative when present in the launch config JSON

https://claude.ai/code/session_019vt15ih7CYh8fAhSCZmZKR
Copy link
Copy Markdown
Contributor

@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)
src/commands/genesis/launch/create.ts (1)

357-392: ⚠️ Potential issue | 🟡 Minor

Reject blank values for the new string flags.

--firstBuyAmount "" and --agentMint "" are currently treated as if the flags were omitted, because these checks rely on truthiness. That is easy to hit in env-driven scripts and silently changes the launch shape instead of failing fast.

Suggested patch
-    if (flags.firstBuyAmount) {
+    if (flags.firstBuyAmount !== undefined) {
+      if (!flags.firstBuyAmount.trim()) {
+        this.error('--firstBuyAmount must not be empty. Omit the flag to disable it.')
+      }
       const amount = Number(flags.firstBuyAmount)
       if (isNaN(amount) || !Number.isFinite(amount) || amount < 0) {
         this.error('--firstBuyAmount must be a finite, non-negative number (e.g. 0.1)')
       }
       flagRecord.firstBuyAmount = amount
@@
-    if (flags.agentMint && !isPublicKey(flags.agentMint)) {
-      this.error('--agentMint must be a valid public key (agent NFT mint address)')
+    if (flags.agentMint !== undefined) {
+      if (!flags.agentMint.trim() || !isPublicKey(flags.agentMint)) {
+        this.error('--agentMint must be a valid public key (agent NFT mint address)')
+      }
     }
-    if (flags.agentSetToken && !flags.agentMint) {
+    if (flags.agentSetToken && !flags.agentMint?.trim()) {
       this.error('--agentSetToken requires --agentMint')
     }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/commands/genesis/launch/create.ts` around lines 357 - 392, Reject
explicit empty-string values for string flags by checking against undefined
rather than using truthiness: when handling flags.firstBuyAmount, first check if
flags.firstBuyAmount !== undefined, then if it's === '' emit an error before
attempting Number(...) and otherwise parse/validate and set
flagRecord.firstBuyAmount; similarly for flags.agentMint replace the truthy
checks with explicit undefined/empty-string checks—if flags.agentMint !==
undefined then if flags.agentMint === '' error, else validate via isPublicKey;
and change the agentSetToken dependency check to treat '' as missing (e.g. if
flags.agentSetToken && (flags.agentMint === undefined || flags.agentMint === '')
error). Keep the existing uses of flagRecord, LAUNCH_STRATEGIES,
strategy.validate and the disallowed/required flag checks intact.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/commands/genesis/launch/register.ts`:
- Around line 111-119: The optional bonding-curve fields need normalization and
stronger validation: for launch.creatorFeeWallet trim the string and validate it
using the same public-key validator used in
src/commands/genesis/launch/create.ts (reuse that function instead of only
checking .length) and throw the same error message if invalid; for
launch.firstBuyAmount parse it to a Number, validate it is finite and
non-negative (as you already check) and then assign the parsed numeric value
back into launch.firstBuyAmount (so the CreateLaunchInput sent to registerLaunch
contains the normalized number rather than the original string).

---

Outside diff comments:
In `@src/commands/genesis/launch/create.ts`:
- Around line 357-392: Reject explicit empty-string values for string flags by
checking against undefined rather than using truthiness: when handling
flags.firstBuyAmount, first check if flags.firstBuyAmount !== undefined, then if
it's === '' emit an error before attempting Number(...) and otherwise
parse/validate and set flagRecord.firstBuyAmount; similarly for flags.agentMint
replace the truthy checks with explicit undefined/empty-string checks—if
flags.agentMint !== undefined then if flags.agentMint === '' error, else
validate via isPublicKey; and change the agentSetToken dependency check to treat
'' as missing (e.g. if flags.agentSetToken && (flags.agentMint === undefined ||
flags.agentMint === '') error). Keep the existing uses of flagRecord,
LAUNCH_STRATEGIES, strategy.validate and the disallowed/required flag checks
intact.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

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

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 71c1c80d-5f73-4e1f-a932-a411e6db3b94

📥 Commits

Reviewing files that changed from the base of the PR and between b904753 and 582a367.

📒 Files selected for processing (3)
  • src/commands/genesis/launch/create.ts
  • src/commands/genesis/launch/register.ts
  • src/lib/genesis/createGenesisWizardPrompt.ts

Comment on lines +111 to +119
if (launch.creatorFeeWallet !== undefined) {
if (typeof launch.creatorFeeWallet !== 'string' || launch.creatorFeeWallet.length === 0) {
throw new Error('Bonding curve "launch.creatorFeeWallet" must be a non-empty string (public key)')
}
}
const curve = launch.bondingCurve as Record<string, unknown>
if (!curve.depositStartTime) {
throw new Error('Bonding curve config requires "depositStartTime" in launch.bondingCurve')
if (launch.firstBuyAmount !== undefined) {
const amount = Number(launch.firstBuyAmount)
if (isNaN(amount) || !Number.isFinite(amount) || amount < 0) {
throw new Error('Bonding curve "launch.firstBuyAmount" must be a finite, non-negative number')
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Normalize and fully validate the optional bonding-curve fields.

creatorFeeWallet only checks .length, so whitespace or arbitrary strings pass, and firstBuyAmount is parsed only for validation—the original JSON value is still forwarded after the CreateLaunchInput cast. A hand-edited config can clear this block and still hit registerLaunch with an invalid payload. Reuse the same public-key validation as src/commands/genesis/launch/create.ts, trim the wallet, and write the parsed amount back into launch.

Partial patch for the numeric normalization
         if (launch.firstBuyAmount !== undefined) {
           const amount = Number(launch.firstBuyAmount)
           if (isNaN(amount) || !Number.isFinite(amount) || amount < 0) {
             throw new Error('Bonding curve "launch.firstBuyAmount" must be a finite, non-negative number')
           }
+          launch.firstBuyAmount = amount
         }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if (launch.creatorFeeWallet !== undefined) {
if (typeof launch.creatorFeeWallet !== 'string' || launch.creatorFeeWallet.length === 0) {
throw new Error('Bonding curve "launch.creatorFeeWallet" must be a non-empty string (public key)')
}
}
const curve = launch.bondingCurve as Record<string, unknown>
if (!curve.depositStartTime) {
throw new Error('Bonding curve config requires "depositStartTime" in launch.bondingCurve')
if (launch.firstBuyAmount !== undefined) {
const amount = Number(launch.firstBuyAmount)
if (isNaN(amount) || !Number.isFinite(amount) || amount < 0) {
throw new Error('Bonding curve "launch.firstBuyAmount" must be a finite, non-negative number')
if (launch.creatorFeeWallet !== undefined) {
if (typeof launch.creatorFeeWallet !== 'string' || launch.creatorFeeWallet.length === 0) {
throw new Error('Bonding curve "launch.creatorFeeWallet" must be a non-empty string (public key)')
}
}
if (launch.firstBuyAmount !== undefined) {
const amount = Number(launch.firstBuyAmount)
if (isNaN(amount) || !Number.isFinite(amount) || amount < 0) {
throw new Error('Bonding curve "launch.firstBuyAmount" must be a finite, non-negative number')
}
launch.firstBuyAmount = amount
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/commands/genesis/launch/register.ts` around lines 111 - 119, The optional
bonding-curve fields need normalization and stronger validation: for
launch.creatorFeeWallet trim the string and validate it using the same
public-key validator used in src/commands/genesis/launch/create.ts (reuse that
function instead of only checking .length) and throw the same error message if
invalid; for launch.firstBuyAmount parse it to a Number, validate it is finite
and non-negative (as you already check) and then assign the parsed numeric value
back into launch.firstBuyAmount (so the CreateLaunchInput sent to registerLaunch
contains the normalized number rather than the original string).

claude added 2 commits April 7, 2026 15:24
- Update mpl_core.so to v0.10.0 (from GitHub release)
- Update mpl_bubblegum.so to v1.0.0 (from GitHub release)
- Update mpl_core_candy_guard.so to v0.2.2 (from GitHub release)
- Add scripts/fetch-programs.sh for fetching all program binaries
  (downloads from GitHub releases where available, uses solana program
  dump for programs without release binaries like genesis, token-metadata,
  agent identity/tools, distro, noop, account compression)

Remaining programs (genesis, token-metadata, candy-machine, distro,
agent-identity, agent-tools, noop, account-compression) need to be
updated by running the fetch script with access to a Solana Devnet RPC:
  ./scripts/fetch-programs.sh

https://claude.ai/code/session_019vt15ih7CYh8fAhSCZmZKR
…em in

- Add CI step to dump all 13 programs from Devnet before starting the
  validator, ensuring tests always run against the latest deployed versions
- Remove checked-in .so binaries from the repo (saves ~11MB per commit)
- Add .amman/*.so to .gitignore so stale binaries are never committed
- Install Solana CLI in CI before the dump step

This eliminates the recurring problem of checked-in binaries going stale
and causing test failures when programs are upgraded on Devnet.

https://claude.ai/code/session_019vt15ih7CYh8fAhSCZmZKR
Copy link
Copy Markdown
Contributor

@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 the current code and only fix it if needed.

Inline comments:
In @.github/workflows/test.yml:
- Around line 57-60: The Devnet dump loop uses solana program dump with no
retry; wrap the invocation of "solana program dump -u devnet
\"${PROGRAMS[$file]}\" \"$file\"" in a retry/backoff loop so transient RPC
failures don't fail CI: implement a fixed max attempt count (e.g., 3-5), check
the command exit status, and on failure sleep with exponential backoff (e.g.,
1s, 2s, 4s) before retrying; keep the surrounding for file in "${!PROGRAMS[@]}"
loop and ensure you propagate a non-zero exit only after all retries fail so
PROGRAMS and the loop logic remain unchanged.
- Line 54: The program ID for ".amman/mpl_agent_identity.so" in the workflow is
mismatched with the one used in .validator.cjs; update the value currently set
in the workflow mapping entry for ".amman/mpl_agent_identity.so" to the exact
program ID used in .validator.cjs so the same binary is referenced by both
(ensure the string value replaces the incorrect
"1DREGFgysWYxLnRnKQnwrxnJQeSMk2HmGaC6whw2B2p" with the validator's program ID).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

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

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 757b7cb9-30f8-4dbe-8db8-c70c28c3393a

📥 Commits

Reviewing files that changed from the base of the PR and between 582a367 and f0822b4.

⛔ Files ignored due to path filters (13)
  • .amman/genesis.so is excluded by !**/*.so
  • .amman/mpl_account_compression.so is excluded by !**/*.so
  • .amman/mpl_agent_identity.so is excluded by !**/*.so
  • .amman/mpl_agent_tools.so is excluded by !**/*.so
  • .amman/mpl_bubblegum.so is excluded by !**/*.so
  • .amman/mpl_core.so is excluded by !**/*.so
  • .amman/mpl_core_candy_guard.so is excluded by !**/*.so
  • .amman/mpl_core_candy_machine.so is excluded by !**/*.so
  • .amman/mpl_distro.so is excluded by !**/*.so
  • .amman/mpl_noop.so is excluded by !**/*.so
  • .amman/mpl_token_metadata.so is excluded by !**/*.so
  • .amman/spl_account_compression.so is excluded by !**/*.so
  • .amman/spl_noop.so is excluded by !**/*.so
📒 Files selected for processing (3)
  • .amman/.gitkeep
  • .github/workflows/test.yml
  • .gitignore

[".amman/mpl_account_compression.so"]="mcmt6YrQEMKw8Mw43FmpRLmf7BqRnFMKmAcbxE3xkAW"
[".amman/spl_account_compression.so"]="cmtDvXumGCrqC1Age74AVPhSRVXJMd8PJS91L8KbNCK"
[".amman/genesis.so"]="GNS1S5J5AspKXgpjz6SvKL66kPaKWAhaGRhCqPRxii2B"
[".amman/mpl_agent_identity.so"]="1DREGFgysWYxLnRnKQnwrxnJQeSMk2HmGaC6whw2B2p"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Fix the MPL Agent Identity program ID mismatch.

Line 54 uses a different program ID than .validator.cjs for the same .amman/mpl_agent_identity.so path. This can dump the wrong binary and make validator results unreliable.

Proposed fix
-            [".amman/mpl_agent_identity.so"]="1DREGFgysWYxLnRnKQnwrxnJQeSMk2HmGaC6whw2B2p"
+            [".amman/mpl_agent_identity.so"]="1DREGFgysWYxLnRnKQeSMk2HmGaC6whw2B2p"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
[".amman/mpl_agent_identity.so"]="1DREGFgysWYxLnRnKQnwrxnJQeSMk2HmGaC6whw2B2p"
[".amman/mpl_agent_identity.so"]="1DREGFgysWYxLnRnKQeSMk2HmGaC6whw2B2p"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/test.yml at line 54, The program ID for
".amman/mpl_agent_identity.so" in the workflow is mismatched with the one used
in .validator.cjs; update the value currently set in the workflow mapping entry
for ".amman/mpl_agent_identity.so" to the exact program ID used in
.validator.cjs so the same binary is referenced by both (ensure the string value
replaces the incorrect "1DREGFgysWYxLnRnKQnwrxnJQeSMk2HmGaC6whw2B2p" with the
validator's program ID).

Comment on lines +57 to +60
for file in "${!PROGRAMS[@]}"; do
echo "Dumping ${PROGRAMS[$file]} -> $file"
solana program dump -u devnet "${PROGRAMS[$file]}" "$file"
done
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Add retry/backoff for Devnet dumps to reduce CI flakiness.

Line 59 performs network-dependent dumps with no retry handling. A transient RPC failure will fail the whole job.

Proposed hardening
           for file in "${!PROGRAMS[@]}"; do
             echo "Dumping ${PROGRAMS[$file]} -> $file"
-            solana program dump -u devnet "${PROGRAMS[$file]}" "$file"
+            for attempt in 1 2 3; do
+              if solana program dump -u devnet "${PROGRAMS[$file]}" "$file"; then
+                break
+              fi
+              if [ "$attempt" -eq 3 ]; then
+                echo "Failed after $attempt attempts: ${PROGRAMS[$file]} -> $file" >&2
+                exit 1
+              fi
+              sleep $((attempt * 5))
+            done
           done
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
for file in "${!PROGRAMS[@]}"; do
echo "Dumping ${PROGRAMS[$file]} -> $file"
solana program dump -u devnet "${PROGRAMS[$file]}" "$file"
done
for file in "${!PROGRAMS[@]}"; do
echo "Dumping ${PROGRAMS[$file]} -> $file"
for attempt in 1 2 3; do
if solana program dump -u devnet "${PROGRAMS[$file]}" "$file"; then
break
fi
if [ "$attempt" -eq 3 ]; then
echo "Failed after $attempt attempts: ${PROGRAMS[$file]} -> $file" >&2
exit 1
fi
sleep $((attempt * 5))
done
done
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/test.yml around lines 57 - 60, The Devnet dump loop uses
solana program dump with no retry; wrap the invocation of "solana program dump
-u devnet \"${PROGRAMS[$file]}\" \"$file\"" in a retry/backoff loop so transient
RPC failures don't fail CI: implement a fixed max attempt count (e.g., 3-5),
check the command exit status, and on failure sleep with exponential backoff
(e.g., 1s, 2s, 4s) before retrying; keep the surrounding for file in
"${!PROGRAMS[@]}" loop and ensure you propagate a non-zero exit only after all
retries fail so PROGRAMS and the loop logic remain unchanged.

The distro tests fail against the latest Devnet binary due to program
changes. Skip them until the CLI distro commands are updated to match.

https://claude.ai/code/session_019vt15ih7CYh8fAhSCZmZKR
Copy link
Copy Markdown
Contributor

@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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.mocharc.json:
- Around line 16-17: Remove the global ignore entry for the distro tests by
deleting the "test/commands/distro/**" pattern from the "ignore" array in
.mocharc.json and instead apply that glob only in CI or environment-specific
config; update CI job config to set MOCHA_IGNORE_GLOB=test/commands/distro/**
(or point the CI to a dedicated mocha config) so the skip is scoped to CI, and
add a comment or issue tracker reference to re-enable/monitor these tests
explicitly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

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

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: dcea0e77-6429-42a5-9aba-7c042a398be5

📥 Commits

Reviewing files that changed from the base of the PR and between f0822b4 and 0a56f0a.

📒 Files selected for processing (1)
  • .mocharc.json

Comment on lines +16 to +17
"ignore": [
"test/commands/distro/**"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Do not globally disable the entire distro test suite in shared Mocha config.

This permanently suppresses test/commands/distro/** for all environments, which can hide regressions in distro create/deposit/withdraw flows. Keep the skip scoped (e.g., CI-only/env-gated) and add explicit re-enable tracking instead of broad global ignore.

Suggested scoped approach
-  "ignore": [
-    "test/commands/distro/**"
-  ]
+  "ignore": [
+    "${MOCHA_IGNORE_GLOB}"
+  ]

And set MOCHA_IGNORE_GLOB=test/commands/distro/** only in the affected CI job, or move this to a dedicated CI-specific Mocha config.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.mocharc.json around lines 16 - 17, Remove the global ignore entry for the
distro tests by deleting the "test/commands/distro/**" pattern from the "ignore"
array in .mocharc.json and instead apply that glob only in CI or
environment-specific config; update CI job config to set
MOCHA_IGNORE_GLOB=test/commands/distro/** (or point the CI to a dedicated mocha
config) so the skip is scoped to CI, and add a comment or issue tracker
reference to re-enable/monitor these tests explicitly.

claude and others added 2 commits April 7, 2026 16:21
ts-node/esm uses the deprecated --loader flag and requires
--experimental-specifier-resolution=node, both of which are removed
in Node 24. Switch to tsx which handles TypeScript transpilation and
ESM module resolution correctly on all supported Node versions (20+).

https://claude.ai/code/session_019vt15ih7CYh8fAhSCZmZKR
@tonyboylehub
Copy link
Copy Markdown
Contributor

@blockiosaurus added auto selection of api url based on current set rpc.

@blockiosaurus blockiosaurus merged commit 8ce2be2 into main Apr 7, 2026
3 checks passed
@blockiosaurus blockiosaurus deleted the claude/update-cli-genesis-api-d9R1f branch April 7, 2026 16:41
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