feat: add --describe flag to strategy-builder CLI#2552
feat: add --describe flag to strategy-builder CLI#2552hardyjosh wants to merge 8 commits intotemplate-fallbackfrom
Conversation
Emits a full markdown dump of a registry: strategies, their deployments, fields (with presets and defaults), select-tokens, deposits, plus usage documentation and the address:calldata output format. Intended use: an AI agent or human can run once to learn everything needed to construct a non-interactive deploy command for the registry. The output includes example commands for each deployment with all required flags filled in as placeholders.
Extend the usage section with: - cast send pipe example for signing without the stox CLI - Explicit note that approvals only appear when depositing - Explanation of how to pick token addresses (block explorer / token list) since these are not in the registry itself - Clarification that --owner must be a signing address Goal: minimize the upfront context a calling agent needs before running --describe. Most of what a user would otherwise need to explain in the prompt is now emitted by the tool itself.
Each deployment with select-tokens now includes a code block showing how to fetch the actual valid token addresses for that deployment via raindex strategy-builder --tokens. Avoids inlining hundreds of token entries in describe output.
- Mark each field as (required) or (optional, default: X) - Add a units convention note to the usage section - Add a build-once guidance section (run binary directly, avoid the npm install noise from the nix develop shellHook) - Label calldata stdout lines with # comment headers describing each tx - Update the cast-send pipe example to skip # comment lines and blank lines - Document the # comment convention in the output format section The # comment lines are safe for any submitter that skips lines not matching <address>:<hex> — cast-loop example shows the idiom. The stox submit parser will be updated in a follow-up PR to do the same.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 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 |
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |

Caution
The registry-side companion work that uses the template-fallback operator (#2551) to produce readable
--describeoutput 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
.rainYAML files or running the interactive wizard. That discovery loop is currently:curlthe registry file → resolve the settings URL →curleach 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 theaddress:calldataoutput 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):
(required)or(optional, default: X)so it is obvious which flags are mandatorystrategy-builderstdout lines are now labelled with#comment headers describing what each transaction does (approve / deploy / meta emission). Safe forcast sendpipelines (with a one-line skip) and forstox submit(updated in feat: skip # comment lines in cli submit input ST0x-Technology/st0x.liquidity#578)#comment convention, the--tokenscompanion, the cast-send pipe idiom (with comment-skip), the units convention (human-readable decimal), and the build-once guidance for running the binary directly withoutnix developnoiseChecks
Summary by CodeRabbit
New Features
strategy-builderCLI command with interactive, describe, and tokens modes for deploying order strategies from registry configurations.Bug Fixes
logoURIfield optional in remote token configurations.Documentation
gui:sections withbuilder:throughout codebase.