feat: skip # comment lines in cli submit input#578
Conversation
raindex strategy-builder now prefixes each transaction line with a `#` comment describing what the tx does. Update parse_stdin_lines to skip any line starting with `#` (after trimming whitespace) so the comment-labelled output pipes cleanly through stox submit.
How to use the Graphite Merge QueueAdd the label add-to-gt-merge-queue to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📜 Recent review details🧰 Additional context used📓 Path-based instructions (1)**/*.rs📄 CodeRabbit inference engine (AGENTS.md)
Files:
🧠 Learnings (24)📓 Common learnings📚 Learning: 2026-04-13T09:51:24.143ZApplied to files:
📚 Learning: 2026-03-13T11:38:13.780ZApplied to files:
📚 Learning: 2026-01-20T17:09:47.048ZApplied to files:
📚 Learning: 2026-01-20T17:09:47.048ZApplied to files:
📚 Learning: 2026-02-17T13:40:34.369ZApplied to files:
📚 Learning: 2026-02-14T16:20:35.238ZApplied to files:
📚 Learning: 2026-01-29T13:06:05.197ZApplied to files:
📚 Learning: 2026-02-11T13:08:14.572ZApplied to files:
📚 Learning: 2026-02-11T23:41:19.369ZApplied to files:
📚 Learning: 2026-02-12T08:34:02.773ZApplied to files:
📚 Learning: 2026-02-17T00:52:25.117ZApplied to files:
📚 Learning: 2026-02-17T22:04:31.863ZApplied to files:
📚 Learning: 2026-02-17T23:28:32.566ZApplied to files:
📚 Learning: 2026-02-18T01:28:07.164ZApplied to files:
📚 Learning: 2026-02-19T14:16:43.527ZApplied to files:
📚 Learning: 2026-03-11T17:16:32.916ZApplied to files:
📚 Learning: 2026-03-13T11:06:03.556ZApplied to files:
📚 Learning: 2026-03-25T11:17:17.707ZApplied to files:
📚 Learning: 2026-03-04T23:04:37.680ZApplied to files:
📚 Learning: 2026-03-04T23:04:39.214ZApplied to files:
📚 Learning: 2026-03-06T10:44:56.373ZApplied to files:
📚 Learning: 2026-03-10T21:06:58.386ZApplied to files:
📚 Learning: 2026-03-13T16:32:06.432ZApplied to files:
🔇 Additional comments (2)
WalkthroughThe Changes
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
> [!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 -->
> [!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 -->
> [!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 -->

Note: rainlanguage/raindex#2548 produces the labelled output format that produces the # comment lines this PR now skips.
Motivation
raindex strategy-builder(rainlanguage/raindex#2548) now prefixes each transaction line on stdout with a#comment describing what the tx does:Piping this directly into
stox submitcurrently fails becauseparse_stdin_linestreats a#line as a missing-separator parse error.Motivation (other side)
Same change is friendly to human operators who want to annotate a saved
deploy.calldatafile with comments.Solution
Skip any stdin line that starts with
#(after trimming) inparse_stdin_lines, alongside the existing blank-line skip. Added unit tests for:#-prefixed lines interleaved with transaction lines#comment lines (whitespace-then-hash)EmptyInput)Checks
Summary by CodeRabbit
New Features
#) for better organization and documentation.Tests