Skip to content

Rename gui to builder and strip non-base deployments#9

Open
hardyjosh wants to merge 14 commits into
mainfrom
rename-gui-to-builder
Open

Rename gui to builder and strip non-base deployments#9
hardyjosh wants to merge 14 commits into
mainfrom
rename-gui-to-builder

Conversation

@hardyjosh

@hardyjosh hardyjosh commented Apr 14, 2026

Copy link
Copy Markdown
Contributor

Caution

Depends on rainlanguage/raindex#2551 for the `${path || 'fallback'}` template syntax that the updated strategy descriptions use. Describe output in raindex has unresolved `${…}` placeholders for strategies in this registry until #2551 lands.

Motivation

Several improvements needed for the st0x registry to work well with the new raindex CLI's `--describe`, `--tokens`, and non-interactive modes (rainlanguage/raindex#2544, #2546, #2548, #2549).

Agents running end-to-end tests consistently stumbled on:

  • `gui:` YAML key (needs to be `builder:` on the raindex consolidation branch)
  • Non-base deployments referencing networks not defined in `settings.yaml`, blocking the parser
  • `--tokens` output missing USDC despite every strategy needing it as the counter-token
  • Field names like `${order.inputs.0.token.symbol} per ${order.outputs.0.token.symbol}` rendered as literal placeholders
  • `pyth-pair` field described as if it took a Pyth Hermes feed ID (it doesn't — it's an ASCII-encoded subparser identifier)
  • `select-tokens` descriptions describing mechanics ("pick a token") rather than roles (which vault the token lands in)
  • `grid.rain` using `saturating-sub` (retired in favour of Float negatives + `max(0 sub(...))`)
  • Em-dashes in descriptions rejected by the on-chain parser as `IllegalChar`

Solution

A series of small registry edits on this branch:

  1. Rename `gui:` -> `builder:` across all strategies
  2. Strip non-base deployments from strategies (keep only `base` entries)
  3. Add a top-level `tokens:` map with USDC — merges with `using-tokens-from` in the raindex builder
  4. Add `|| 'Token to Buy'` / `|| 'Token to Sell'` fallbacks to every template placeholder in field and preset names/descriptions
  5. Rewrite `pyth-pair` description to state it is not a Pyth Hermes feed ID
  6. Improve `select-tokens` descriptions in `fixed-limit` and `grid` to describe the role (input vault / output vault)
  7. Replace `saturating-sub` with `max(0 sub(...))` in `grid.rain`
  8. Replace em-dashes with hyphens everywhere the string ends up on chain

Verified end-to-end against the raindex CLI and deployed real transactions (fixed-limit, auction-dca, fixed-spread) on Base.

Grid still fails to parse on Base with the current deployer because the on-chain interpreter is also missing `max-value`; that's a separate interpreter-bump concern, not addressed here.

Checks

  • made this PR as small as possible
  • unit-tested any new functionality
  • linked any relevant issues or PRs
  • included screenshots (if this involves a front-end change)

Summary by CodeRabbit

  • Configuration Updates

    • Added USDC token support for Base network
    • Consolidated all strategies to Base network only (removed Arbitrum and Polygon support)
  • User Interface

    • Enhanced token display with fallback labels when symbol unavailable
    • Updated builder interface for improved clarity

Josh Hardy and others added 6 commits April 12, 2026 19:47
Aligns with the raindex consolidation branch which renamed
the gui: YAML key to builder:.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
st0x.registry only defines base network — remove arbitrum/polygon
entries that reference undefined networks.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
st0x.registry only defines base network. Remove arbitrum/polygon
entries from auction-dca, canary, dynamic-spread, and grid to
prevent deployer-not-found errors when the builder validates
all deployments on load.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Apr 14, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e261fee6-a024-4b44-83fd-6b122a8620fb

📥 Commits

Reviewing files that changed from the base of the PR and between 8939e3f and f55a086.

📒 Files selected for processing (6)
  • registry
  • src/auction-dca.rain
  • src/dynamic-spread.rain
  • src/fixed-limit.rain
  • src/fixed-spread.rain
  • src/grid.rain
✅ Files skipped from review due to trivial changes (1)
  • registry
🚧 Files skipped from review as they are similar to previous changes (3)
  • src/fixed-spread.rain
  • src/dynamic-spread.rain
  • src/fixed-limit.rain

📝 Walkthrough

Walkthrough

Replaced upstream registry commit hash, added a Base-network USDC token entry, consolidated multi-network strategy configs to Base-only, and renamed top-level UI sections from gui to builder across multiple strategy files.

Changes

Cohort / File(s) Summary
Registry
registry, settings.yaml
Updated upstream GitHub commit hash in registry remote URLs from 8cab2802347600e9276709bf0aed91de66666012e4182805abdf546209300cab540d7512b8a4fcf4.
Token config
settings.yaml
Added deployers.tokens.USDC for network base with address 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913, decimals 6, label USD Coin, symbol USDC.
Auction DCA / UI rename / Base-only
src/auction-dca.rain
Removed arbitrum/polygon orders/scenarios/deployments, kept base; renamed top-level guibuilder; updated builder field templates to use token symbol fallbacks; clarified pyth-pair description.
Canary migration to Base
src/canary.rain
Replaced canary-arbitrum entries with base scope for orders/scenarios/deployments/gui; updated raindex-subparser binding address to 0x22839F16281E67E5Fd395fAFd1571e820CbD46cB; renamed builder display name to “Canary on Base.”
Claims / UI rename
src/claims.rain
Renamed top-level guibuilder; preserved deployments and builder metadata unchanged.
Dynamic Spread / UI rename / Base-only
src/dynamic-spread.rain
Removed arbitrum/polygon entries leaving base; renamed guibuilder; updated token-symbol fallbacks and amount descriptions.
Fixed Limit / UI rename / Base-only
src/fixed-limit.rain
Removed non-Base orderbooks/deployers/orders/scenarios/deployments; renamed guibuilder; added token fallback templates and clarified deposit/withdraw descriptions.
Fixed Spread / Pyth description / UI rename
src/fixed-spread.rain
Renamed guibuilder; updated pyth-pair field descriptions to require on-chain subparser identifier (length-prefixed ASCII) and to use presets.
Folio / UI rename
src/folio.rain
Renamed top-level guibuilder; retained Folio logic and internal handlers unchanged.
Grid / Network migration & math tweaks
src/grid.rain
Moved arbitrum/polygon entries to base, updated raindex-subparser address; consolidated GUI to Base; added token-symbol fallbacks; replaced saturating-sub(...) with max(0 sub(...)) and max-value()max-positive-value() for tranche calculations.
Auction-related strategies in registry sources
registry sources for strategies (fixed-limit, auction-dca, grid, dynamic-spread, canary, claims, fixed-spread, folio)
Each strategy source URL updated to the new upstream commit hash e4182805abdf546209300cab540d7512b8a4fcf4.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐰
Hops on Base with a twitch and rhyme,
gui is now builder, snug in time.
Polygon gone, Arbitrum too—
one token (USDC) joins the crew.
I nibble commits and hop anew. 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: renaming gui to builder and removing non-base deployments across all strategies.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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 rename-gui-to-builder
⚔️ Resolve merge conflicts
  • Resolve merge conflict in branch rename-gui-to-builder

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.

Josh Hardy added 6 commits April 14, 2026 19:39
- Add template fallbacks (|| 'Token to Buy' / 'Token to Sell') to all
  field and preset names/descriptions that reference unresolved token
  symbols. Readable in --describe before select-tokens are chosen;
  unchanged at deploy time when tokens are selected.
- Improve select-token role descriptions in fixed-limit and grid to
  describe what the slot means (input vault vs output vault) instead
  of just 'pick a token'.
- Rewrite pyth-pair description to clarify it is not a canonical Pyth
  feed ID from hermes.pyth.network — it is a length-prefixed ASCII
  encoding the on-chain subparser expects. Direct users to the preset
  list.
- grid: replace saturating-sub (retired with Float negative support)
  with max(0 sub(...)).
The on-chain metadata parser rejects non-ASCII characters (em-dash
raises IllegalChar). Replace all — with - in the field and select-token
descriptions so deploy calldata validates on chain.
Josh Hardy added 2 commits April 15, 2026 14:03
The retired max-value word was replaced by max-positive-value in the
current interpreter. Using max-value causes an UnknownWord revert on
Base deployers.
graphite-app Bot pushed a commit to rainlanguage/raindex that referenced this pull request May 11, 2026
## Motivation

Strategy field names and descriptions in `.rain` YAML reference token properties via templates like `\${order.inputs.0.token.symbol} per \${order.outputs.0.token.symbol}`. The webapp resolves these at runtime once tokens have been selected. Any other consumer (notably `--describe`) that renders these strings before a token is picked sees the raw placeholder, which is confusing.

Dropping the placeholder in un-selected contexts would lose the structural information. Hard-coding a substitution in every consumer is brittle and doesn't match webapp semantics.

## Solution

Extend the template syntax with an optional fallback literal:

```
${path}                    — current behaviour
${path || 'fallback'}      — substitute literal when the path resolves to a missing token
${path || "fallback"}      — double quotes also accepted
```

The fallback only kicks in on `PropertyNotFound("token")` (i.e. select-token not yet selected). Other resolution errors still propagate. Templates without `||` behave identically to today — backwards compatible.

The webapp gets no regression: when tokens are selected the left-hand side always resolves and the fallback never fires. `--describe` (and any other "no context" consumer) gets readable output for free once registry strategies adopt fallbacks.

Registry adoption is tracked in ST0x-Technology/st0x.registry#9.

## Checks

- [x] made this PR as small as possible
- [x] unit-tested any new functionality
- [x] linked any relevant issues or PRs
- [ ] included screenshots (if this involves a front-end change)
graphite-app Bot pushed a commit to rainlanguage/raindex that referenced this pull request May 11, 2026
> [!CAUTION]
>
> The registry-side companion work that uses the template-fallback operator (#2551) to produce readable `--describe` output for existing strategies is in ST0x-Technology/st0x.registry#9 — describe works fine without it, but strategy field names will contain raw `${...}` placeholders until that PR lands.

## Motivation

CLI users and AI agents need a way to learn a registry's full configuration without reading the underlying `.rain` YAML files or running the interactive wizard. That discovery loop is currently: `curl` the registry file → resolve the settings URL → `curl` each strategy → parse the YAML by hand. Every agent we tested (6/6) burned 4+ tool calls just discovering token addresses.

## Solution

Add `--describe` — emits a full markdown dump of the registry: every strategy, its deployments, required/optional fields (with presets and defaults), select-tokens, deposits, plus usage documentation and the `address:calldata` output format.

Intended as a self-generating skill. An agent can run once against a registry and have everything it needs to construct non-interactive deploy commands from a natural-language request. Each deployment includes an **Example command** with the exact flags and placeholders pre-filled.

Also bundled in this PR (small polish items):

- Each field tagged `(required)` or `(optional, default: X)` so it is obvious which flags are mandatory
- `strategy-builder` stdout lines are now labelled with `#` comment headers describing what each transaction does (approve / deploy / meta emission). Safe for `cast send` pipelines (with a one-line skip) and for `stox submit` (updated in ST0x-Technology/st0x.liquidity#578)
- Usage section documents the `#` comment convention, the `--tokens` companion, the cast-send pipe idiom (with comment-skip), the units convention (human-readable decimal), and the build-once guidance for running the binary directly without `nix develop` noise

## Checks

- [x] made this PR as small as possible
- [x] unit-tested any new functionality
- [x] linked any relevant issues or PRs
- [ ] included screenshots (if this involves a front-end change)

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

* **New Features**
  * Added `strategy-builder` CLI command with interactive, describe, and tokens modes for deploying order strategies from registry configurations.

* **Bug Fixes**
  * Made token `logoURI` field optional in remote token configurations.

* **Documentation**
  * Updated YAML configuration: replaced `gui:` sections with `builder:` throughout codebase.
  * Renamed public APIs from GUI-centric to builder-centric terminology across CLI, SDK, and UI components.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
graphite-app Bot pushed a commit to rainlanguage/raindex that referenced this pull request May 11, 2026
## Motivation

Strategy field names and descriptions in `.rain` YAML reference token properties via templates like `\${order.inputs.0.token.symbol} per \${order.outputs.0.token.symbol}`. The webapp resolves these at runtime once tokens have been selected. Any other consumer (notably `--describe`) that renders these strings before a token is picked sees the raw placeholder, which is confusing.

Dropping the placeholder in un-selected contexts would lose the structural information. Hard-coding a substitution in every consumer is brittle and doesn't match webapp semantics.

## Solution

Extend the template syntax with an optional fallback literal:

```
${path}                    — current behaviour
${path || 'fallback'}      — substitute literal when the path resolves to a missing token
${path || "fallback"}      — double quotes also accepted
```

The fallback only kicks in on `PropertyNotFound("token")` (i.e. select-token not yet selected). Other resolution errors still propagate. Templates without `||` behave identically to today — backwards compatible.

The webapp gets no regression: when tokens are selected the left-hand side always resolves and the fallback never fires. `--describe` (and any other "no context" consumer) gets readable output for free once registry strategies adopt fallbacks.

Registry adoption is tracked in ST0x-Technology/st0x.registry#9.

## Checks

- [x] made this PR as small as possible
- [x] unit-tested any new functionality
- [x] linked any relevant issues or PRs
- [ ] included screenshots (if this involves a front-end change)
graphite-app Bot pushed a commit to rainlanguage/raindex that referenced this pull request May 11, 2026
> [!CAUTION]
>
> The registry-side companion work that uses the template-fallback operator (#2551) to produce readable `--describe` output for existing strategies is in ST0x-Technology/st0x.registry#9 — describe works fine without it, but strategy field names will contain raw `${...}` placeholders until that PR lands.

## Motivation

CLI users and AI agents need a way to learn a registry's full configuration without reading the underlying `.rain` YAML files or running the interactive wizard. That discovery loop is currently: `curl` the registry file → resolve the settings URL → `curl` each strategy → parse the YAML by hand. Every agent we tested (6/6) burned 4+ tool calls just discovering token addresses.

## Solution

Add `--describe` — emits a full markdown dump of the registry: every strategy, its deployments, required/optional fields (with presets and defaults), select-tokens, deposits, plus usage documentation and the `address:calldata` output format.

Intended as a self-generating skill. An agent can run once against a registry and have everything it needs to construct non-interactive deploy commands from a natural-language request. Each deployment includes an **Example command** with the exact flags and placeholders pre-filled.

Also bundled in this PR (small polish items):

- Each field tagged `(required)` or `(optional, default: X)` so it is obvious which flags are mandatory
- `strategy-builder` stdout lines are now labelled with `#` comment headers describing what each transaction does (approve / deploy / meta emission). Safe for `cast send` pipelines (with a one-line skip) and for `stox submit` (updated in ST0x-Technology/st0x.liquidity#578)
- Usage section documents the `#` comment convention, the `--tokens` companion, the cast-send pipe idiom (with comment-skip), the units convention (human-readable decimal), and the build-once guidance for running the binary directly without `nix develop` noise

## Checks

- [x] made this PR as small as possible
- [x] unit-tested any new functionality
- [x] linked any relevant issues or PRs
- [ ] included screenshots (if this involves a front-end change)

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

* **New Features**
  * Added `strategy-builder` CLI command with interactive, describe, and tokens modes for deploying order strategies from registry configurations.

* **Bug Fixes**
  * Made token `logoURI` field optional in remote token configurations.

* **Documentation**
  * Updated YAML configuration: replaced `gui:` sections with `builder:` throughout codebase.
  * Renamed public APIs from GUI-centric to builder-centric terminology across CLI, SDK, and UI components.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
graphite-app Bot pushed a commit to rainlanguage/raindex that referenced this pull request May 11, 2026
## Motivation

Strategy field names and descriptions in `.rain` YAML reference token properties via templates like `\${order.inputs.0.token.symbol} per \${order.outputs.0.token.symbol}`. The webapp resolves these at runtime once tokens have been selected. Any other consumer (notably `--describe`) that renders these strings before a token is picked sees the raw placeholder, which is confusing.

Dropping the placeholder in un-selected contexts would lose the structural information. Hard-coding a substitution in every consumer is brittle and doesn't match webapp semantics.

## Solution

Extend the template syntax with an optional fallback literal:

```
${path}                    — current behaviour
${path || 'fallback'}      — substitute literal when the path resolves to a missing token
${path || "fallback"}      — double quotes also accepted
```

The fallback only kicks in on `PropertyNotFound("token")` (i.e. select-token not yet selected). Other resolution errors still propagate. Templates without `||` behave identically to today — backwards compatible.

The webapp gets no regression: when tokens are selected the left-hand side always resolves and the fallback never fires. `--describe` (and any other "no context" consumer) gets readable output for free once registry strategies adopt fallbacks.

Registry adoption is tracked in ST0x-Technology/st0x.registry#9.

## Checks

- [x] made this PR as small as possible
- [x] unit-tested any new functionality
- [x] linked any relevant issues or PRs
- [ ] included screenshots (if this involves a front-end change)
graphite-app Bot pushed a commit to rainlanguage/raindex that referenced this pull request May 11, 2026
> [!CAUTION]
>
> The registry-side companion work that uses the template-fallback operator (#2551) to produce readable `--describe` output for existing strategies is in ST0x-Technology/st0x.registry#9 — describe works fine without it, but strategy field names will contain raw `${...}` placeholders until that PR lands.

## Motivation

CLI users and AI agents need a way to learn a registry's full configuration without reading the underlying `.rain` YAML files or running the interactive wizard. That discovery loop is currently: `curl` the registry file → resolve the settings URL → `curl` each strategy → parse the YAML by hand. Every agent we tested (6/6) burned 4+ tool calls just discovering token addresses.

## Solution

Add `--describe` — emits a full markdown dump of the registry: every strategy, its deployments, required/optional fields (with presets and defaults), select-tokens, deposits, plus usage documentation and the `address:calldata` output format.

Intended as a self-generating skill. An agent can run once against a registry and have everything it needs to construct non-interactive deploy commands from a natural-language request. Each deployment includes an **Example command** with the exact flags and placeholders pre-filled.

Also bundled in this PR (small polish items):

- Each field tagged `(required)` or `(optional, default: X)` so it is obvious which flags are mandatory
- `strategy-builder` stdout lines are now labelled with `#` comment headers describing what each transaction does (approve / deploy / meta emission). Safe for `cast send` pipelines (with a one-line skip) and for `stox submit` (updated in ST0x-Technology/st0x.liquidity#578)
- Usage section documents the `#` comment convention, the `--tokens` companion, the cast-send pipe idiom (with comment-skip), the units convention (human-readable decimal), and the build-once guidance for running the binary directly without `nix develop` noise

## Checks

- [x] made this PR as small as possible
- [x] unit-tested any new functionality
- [x] linked any relevant issues or PRs
- [ ] included screenshots (if this involves a front-end change)

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

* **New Features**
  * Added `strategy-builder` CLI command with interactive, describe, and tokens modes for deploying order strategies from registry configurations.

* **Bug Fixes**
  * Made token `logoURI` field optional in remote token configurations.

* **Documentation**
  * Updated YAML configuration: replaced `gui:` sections with `builder:` throughout codebase.
  * Renamed public APIs from GUI-centric to builder-centric terminology across CLI, SDK, and UI components.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
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