Skip to content

feat: skip # comment lines in cli submit input#578

Open
hardyjosh wants to merge 1 commit into
masterfrom
cli-submit-skip-comments
Open

feat: skip # comment lines in cli submit input#578
hardyjosh wants to merge 1 commit into
masterfrom
cli-submit-skip-comments

Conversation

@hardyjosh

@hardyjosh hardyjosh commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

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:

# approve WETH
0x833589...:0x095ea7b3...
# deploy fixed-limit order
0xe522cB4a...:0xac9650d8...
# emit strategy metadata
0x59401C93...:0x37480e2a...

Piping this directly into stox submit currently fails because parse_stdin_lines treats 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.calldata file with comments.

Solution

Skip any stdin line that starts with # (after trimming) in parse_stdin_lines, alongside the existing blank-line skip. Added unit tests for:

  • #-prefixed lines interleaved with transaction lines
  • Indented # comment lines (whitespace-then-hash)
  • Input containing only comments (returns EmptyInput)

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

  • New Features

    • Input now supports comment lines (lines starting with #) for better organization and documentation.
  • Tests

    • Extended test coverage for comment line handling and mixed input scenarios.

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.

hardyjosh commented Apr 15, 2026

Copy link
Copy Markdown
Contributor Author

How to use the Graphite Merge Queue

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

@coderabbitai

coderabbitai Bot commented Apr 16, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 435bc078-d151-4c09-a482-261dc18e68b0

📥 Commits

Reviewing files that changed from the base of the PR and between df361e1 and 516e198.

📒 Files selected for processing (1)
  • src/cli/submit.rs
📜 Recent review details
🧰 Additional context used
📓 Path-based instructions (1)
**/*.rs

📄 CodeRabbit inference engine (AGENTS.md)

**/*.rs: CRITICAL: Package by Feature, Not by Layer. Organize by business domain, not technical layers. FORBIDDEN catch-all modules: types.rs, error.rs, models.rs, utils.rs, helpers.rs, http.rs, dto.rs, entities.rs, services.rs, domain.rs. CORRECT: position.rs, offchain_order.rs, onchain_trade.rs. Each feature module contains ALL related code.
Each feature module in Rust should be a single file per feature, split into a directory only when business logic boundaries emerge. Shared types import from the owning feature.
Use Event-Driven Architecture: Each trade spawns independent async task for maximum throughput.
Use Comprehensive Error Handling with custom error types (OnChainError, AlpacaBrokerApiError) with proper propagation.
CRITICAL: Onchain Transaction Confirmations. All onchain operations must explicitly wait for the configured number of confirmations before proceeding. Load-balanced RPC providers may route requests to different nodes. Use REQUIRED_CONFIRMATIONS from crate::onchain and call .with_required_confirmations(self.required_confirmations).get_receipt() on all pending transactions. Never use bare .get_receipt().await in production code paths.
CRITICAL: CQRS/Event Sourcing Architecture. NEVER write directly to the events table—no direct INSERTs, no manual sequence numbers, no bypassing CqrsFramework. Always use CqrsFramework::execute() or execute_with_metadata() to emit events through aggregate commands. The framework handles persistence, sequence numbers, and consistency.
CRITICAL: Single CQRS Framework Instance Per Aggregate. Each aggregate must have exactly ONE SqliteCqrs in the server binary, constructed in Conductor::start. Never call sqlite_cqrs() or CqrsFramework::new() elsewhere in the server path. Direct construction is fine in test/CLI/migration code.
CQRS Aggregate Services Pattern: Use cqrs-es Services for side-effects in handle() to ensure atomicity with events. Naming: {Action}er trait → {Domain}Service implements → {Domain}Manager or...

Files:

  • src/cli/submit.rs
🧠 Learnings (24)
📓 Common learnings
Learnt from: 0xgleb
Repo: ST0x-Technology/st0x.liquidity PR: 557
File: .github/workflows/ci.yaml:157-197
Timestamp: 2026-04-09T02:57:01.003Z
Learning: In ST0x-Technology/st0x.liquidity, when PRs are stacked via Graphite, it is acceptable to leave commented-out or placeholder CI job blocks (e.g., a commented-out `deploy` job in `.github/workflows/ci.yaml`) in intermediate stack PRs as a temporary bridge. The block will be activated or cleaned up during rebase/squash when the dependent PR lands. Do NOT flag such commented-out blocks as dead code or drift risk in the context of a stacked PR workflow.
Learnt from: 0xgleb
Repo: ST0x-Technology/st0x.liquidity PR: 521
File: src/conductor/mod.rs:1361-1361
Timestamp: 2026-03-25T11:17:21.693Z
Learning: In ST0x-Technology/st0x.liquidity, PR references (e.g., "pr `#NNN`") inside `#[allow(clippy::*)]` suppression comments are acceptable and intentional when they serve as breadcrumbs pointing to the PR/refactor that will remove the suppression. Do NOT flag such comments as violating the "NEVER reference task numbers in comments" guideline; the policy applies to regular code/logic comments, not lint-suppression rationale comments that link to planned cleanup work.
Learnt from: hardyjosh
Repo: ST0x-Technology/st0x.liquidity PR: 569
File: src/cli/submit.rs:151-166
Timestamp: 2026-04-13T09:51:24.143Z
Learning: In ST0x-Technology/st0x.liquidity, `src/cli/submit.rs`: pipe mode for the `cli submit` command intentionally exhausts stdin via `parse_stdin_lines`, leaving the confirmation prompt at EOF (auto-abort). Pipe mode therefore requires `--yes` (`skip_confirmation = true`) to proceed. Interactive confirmation is by design only for flag mode (`--to`/`--data`). Do NOT re-flag the stdin exhaustion in pipe mode as a bug.
Learnt from: JuaniRios
Repo: ST0x-Technology/st0x.liquidity PR: 347
File: src/cli/trading.rs:93-93
Timestamp: 2026-03-13T11:38:16.290Z
Learning: In `src/cli/trading.rs` (and CLI files under `src/cli/` generally), do not require stdout-based regression tests that solely exercise `format_float` output. `format_float` is a thin delegation to `st0x_float_serde::format_float`, whose formatting behaviour is already covered by the `crates/float-serde` test suite. A CLI-level test for `format_float` output would duplicate float-serde coverage without testing new CLI logic.
Learnt from: CR
Repo: ST0x-Technology/st0x.liquidity PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-20T17:09:47.048Z
Learning: Applies to **/*.rs : DON'T comment when code is self-explanatory, restating what code does, describing function signatures (use doc comments), adding obvious test setup descriptions, or marking code sections that are clear from structure
Learnt from: JuaniRios
Repo: ST0x-Technology/st0x.liquidity PR: 394
File: src/cli/vault.rs:94-94
Timestamp: 2026-03-10T21:07:08.368Z
Learning: In ST0x-Technology/st0x.liquidity, CLI tests (e.g. in src/cli/vault.rs) intentionally assert on meaningful output values (amounts, addresses) rather than exact progress/status message wording. Do not flag missing assertions on CLI progress strings (e.g. "Depositing to vault...") as test coverage gaps — testing ephemeral wording is considered brittle and low-value.
📚 Learning: 2026-04-13T09:51:24.143Z
Learnt from: hardyjosh
Repo: ST0x-Technology/st0x.liquidity PR: 569
File: src/cli/submit.rs:151-166
Timestamp: 2026-04-13T09:51:24.143Z
Learning: In ST0x-Technology/st0x.liquidity, `src/cli/submit.rs`: pipe mode for the `cli submit` command intentionally exhausts stdin via `parse_stdin_lines`, leaving the confirmation prompt at EOF (auto-abort). Pipe mode therefore requires `--yes` (`skip_confirmation = true`) to proceed. Interactive confirmation is by design only for flag mode (`--to`/`--data`). Do NOT re-flag the stdin exhaustion in pipe mode as a bug.

Applied to files:

  • src/cli/submit.rs
📚 Learning: 2026-03-13T11:38:13.780Z
Learnt from: JuaniRios
Repo: ST0x-Technology/st0x.liquidity PR: 347
File: src/cli/trading.rs:93-93
Timestamp: 2026-03-13T11:38:13.780Z
Learning: In Rust CLI code under src/cli (and generally for CLI files in src/cli/), do not create stdout-based regression tests that only exercise format_float output. format_float delegates to st0x_float_serde::format_float, and its formatting behavior is already covered by the crates/float-serde test suite. Avoid CLI-level tests that duplicate float-serde coverage without testing new CLI logic. If testing is necessary, focus on CLI behavior beyond format_float (integration at higher levels) and rely on existing suites for the underlying formatting logic.

Applied to files:

  • src/cli/submit.rs
📚 Learning: 2026-01-20T17:09:47.048Z
Learnt from: CR
Repo: ST0x-Technology/st0x.liquidity PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-20T17:09:47.048Z
Learning: Applies to **/*.rs : Remove comments when refactoring makes them obsolete - update comments when changing the logic they describe

Applied to files:

  • src/cli/submit.rs
📚 Learning: 2026-01-20T17:09:47.048Z
Learnt from: CR
Repo: ST0x-Technology/st0x.liquidity PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-20T17:09:47.048Z
Learning: Applies to **/*.rs : DON'T comment when code is self-explanatory, restating what code does, describing function signatures (use doc comments), adding obvious test setup descriptions, or marking code sections that are clear from structure

Applied to files:

  • src/cli/submit.rs
📚 Learning: 2026-02-17T13:40:34.369Z
Learnt from: CR
Repo: ST0x-Technology/st0x.liquidity PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-17T13:40:34.369Z
Learning: Applies to **/*.rs : All doc comments (//! and ///) must not exceed 100 characters per line. For multi-line #[error] strings, use \ continuation.

Applied to files:

  • src/cli/submit.rs
📚 Learning: 2026-02-14T16:20:35.238Z
Learnt from: 0xgleb
Repo: ST0x-Technology/st0x.liquidity PR: 273
File: AGENTS.md:781-783
Timestamp: 2026-02-14T16:20:35.238Z
Learning: Enforce that all Rust source files (any .rs) keep doc comments (//! and ///) and long strings inside attribute macros (for example #[error(...)]) to 100 characters per line. Use backslash continuation for multi-line strings inside macros. This guideline applies to all Rust files across the repository (/**/*.rs).

Applied to files:

  • src/cli/submit.rs
📚 Learning: 2026-01-29T13:06:05.197Z
Learnt from: 0xgleb
Repo: ST0x-Technology/st0x.liquidity PR: 257
File: src/env.rs:240-245
Timestamp: 2026-01-29T13:06:05.197Z
Learning: Rust logging guideline: Do not log at return sites for functions that return Result. This rule applies to all Rust files (e.g., src/**/*.rs). Specifically, infallible functions (that cannot return an Err) may be considered for logging before an early return, but for fallible functions that return Err, logging at the return site is unnecessary and should be avoided to reduce noise. Prefer contextualizing errors where they are created or transformed, not where they are returned.

Applied to files:

  • src/cli/submit.rs
📚 Learning: 2026-02-11T13:08:14.572Z
Learnt from: 0xgleb
Repo: ST0x-Technology/st0x.liquidity PR: 259
File: AGENTS.md:487-499
Timestamp: 2026-02-11T13:08:14.572Z
Learning: Enforce a three-group Rust import order in all Rust source files (*.rs): 1) external imports from std and external crates, 2) workspace/crates (e.g., other workspace crates), 3) crate-internal imports using crate:: and super::. Separate each group with a blank line, and do not place blank lines inside a group. This pattern supersedes any previous two-group conventions.

Applied to files:

  • src/cli/submit.rs
📚 Learning: 2026-02-11T23:41:19.369Z
Learnt from: 0xgleb
Repo: ST0x-Technology/st0x.liquidity PR: 259
File: src/dashboard/mod.rs:9-10
Timestamp: 2026-02-11T23:41:19.369Z
Learning: In Rust, when using pub use (re-exports), place documentation on the original definition rather than on the re-export site. Rust will carry over docs from the source, and duplicating documentation at re-export sites increases maintenance burden. If module-level context is needed, put it in a module-level doc comment (//!) in the parent module. This guideline should apply to all Rust source files across the repository.

Applied to files:

  • src/cli/submit.rs
📚 Learning: 2026-02-12T08:34:02.773Z
Learnt from: 0xgleb
Repo: ST0x-Technology/st0x.liquidity PR: 273
File: src/offchain_order.rs:149-197
Timestamp: 2026-02-12T08:34:02.773Z
Learning: For Rust source files, forbid function-level imports and require top-of-module imports. The sole exception is importing enum variants inside function bodies to avoid repetitive qualification (e.g., use MyEnum::*; use MyEnum::{A, B, C}). Enum-variant imports should never be at the module level. This guideline applies across all Rust files in the repository (e.g., src/offchain_order.rs).

Applied to files:

  • src/cli/submit.rs
📚 Learning: 2026-02-17T00:52:25.117Z
Learnt from: 0xgleb
Repo: ST0x-Technology/st0x.liquidity PR: 279
File: src/rebalancing/rebalancer.rs:117-226
Timestamp: 2026-02-17T00:52:25.117Z
Learning: In Rust code, avoid using unwrap() after validation to propagate errors cleanly. This guideline does not apply to test code; in #[cfg(test)] modules or test functions, using unwrap() is acceptable and encouraged for test setup, fixtures, and assertion helpers where failures indicate incorrect test data or environment.

Applied to files:

  • src/cli/submit.rs
📚 Learning: 2026-02-17T22:04:31.863Z
Learnt from: JuaniRios
Repo: ST0x-Technology/st0x.liquidity PR: 298
File: src/integration_tests/arbitrage.rs:926-927
Timestamp: 2026-02-17T22:04:31.863Z
Learning: Do not flag or question #[allow(clippy::*)] or #[expect(clippy::*)] attributes during code reviews in Rust code. Maintainers may intentionally suppress lint warnings; treat such attributes as deliberate design choices and avoid override unless there is a clear, documented rationale. Apply this guideline to all Rust files in the repository.

Applied to files:

  • src/cli/submit.rs
📚 Learning: 2026-02-17T23:28:32.566Z
Learnt from: 0xgleb
Repo: ST0x-Technology/st0x.liquidity PR: 241
File: src/equity_redemption.rs:420-429
Timestamp: 2026-02-17T23:28:32.566Z
Learning: In Rust files implementing the EventSourced trait from the event-sorcery crate, returning Ok(None) from evolve() is not silent. The framework converts Ok(None) into LifecycleError::UnexpectedEvent, logs with error!(), and marks the lifecycle as Failed. Do not add manual logging before returning Ok(None) in evolve(); rely on the framework's behavior. Applies to all evolve() implementations for EventSourced.

Applied to files:

  • src/cli/submit.rs
📚 Learning: 2026-02-18T01:28:07.164Z
Learnt from: 0xgleb
Repo: ST0x-Technology/st0x.liquidity PR: 241
File: src/equity_redemption.rs:657-669
Timestamp: 2026-02-18T01:28:07.164Z
Learning: In Rust files, avoid blanket map_err prohibitions, but allow map_err when you enrich errors with call-site context (e.g., captured vars like token addresses, amounts) or when the source error type cannot derive From (e.g., non-serializable types that block using #[from] with thiserror in domain aggregates requiring Serialize/Deserialize). This applies to all Rust source files (any directory).

Applied to files:

  • src/cli/submit.rs
📚 Learning: 2026-02-19T14:16:43.527Z
Learnt from: 0xgleb
Repo: ST0x-Technology/st0x.liquidity PR: 300
File: src/tokenization/alpaca.rs:744-760
Timestamp: 2026-02-19T14:16:43.527Z
Learning: For Rust review, do not suggest reordering imports within the same import group (external, workspace, crate-internal) if cargo fmt already sorts them alphabetically. Cargo fmt will place std imports and others in alphabetical order within their group, so proposals should only target changes not determined by cargo fmt or affect grouping across groups. If in doubt, run cargo fmt to confirm the actual order.

Applied to files:

  • src/cli/submit.rs
📚 Learning: 2026-03-11T17:16:32.916Z
Learnt from: 0xgleb
Repo: ST0x-Technology/st0x.liquidity PR: 393
File: src/dashboard/mod.rs:117-119
Timestamp: 2026-03-11T17:16:32.916Z
Learning: In the ST0x-Technology/st0x.liquidity repository, for Rust test files across the repo, do not suggest proactive code-level fixes (e.g., tuning database pools) to suppress test flakiness. Rely on Nextest to surface flaky tests and address issues at the test level or test infrastructure. This guideline applies to all Rust test files (any .rs under test paths) in the repository.

Applied to files:

  • src/cli/submit.rs
📚 Learning: 2026-03-13T11:06:03.556Z
Learnt from: JuaniRios
Repo: ST0x-Technology/st0x.liquidity PR: 347
File: crates/execution/src/order/mod.rs:5-5
Timestamp: 2026-03-13T11:06:03.556Z
Learning: In ST0x-Technology/st0x.liquidity, ExactDecimal (from crates/exact-decimal) has been removed. The canonical domain numeric type for all financial values (prices, quantities, amounts) is now rain_math_float::Float. Do not suggest using ExactDecimal in any future reviews for this repository. When reviewing Rust code, prefer Float for financial values, remove any ExactDecimal imports/usages, and ensure code paths rely on Float for precision/behavior in monetary computations.

Applied to files:

  • src/cli/submit.rs
📚 Learning: 2026-03-25T11:17:17.707Z
Learnt from: 0xgleb
Repo: ST0x-Technology/st0x.liquidity PR: 521
File: src/conductor/mod.rs:1361-1361
Timestamp: 2026-03-25T11:17:17.707Z
Learning: In Rust files, do not flag comments inside `#[allow(clippy::*)]` (or similar lint-suppression attributes) that intentionally include PR/task references like `pr `#NNN`` as a breadcrumb for planned cleanup. This is acceptable specifically when the reference explains why the suppression exists and indicates it will be removed after the referenced PR/refactor. The exception applies to the lint-suppression rationale comments only; regular code/logic comments should still follow the “never reference task numbers in comments” policy.

Applied to files:

  • src/cli/submit.rs
📚 Learning: 2026-03-04T23:04:37.680Z
Learnt from: JuaniRios
Repo: ST0x-Technology/st0x.liquidity PR: 347
File: src/onchain_trade.rs:272-274
Timestamp: 2026-03-04T23:04:37.680Z
Learning: In Rust test modules under src, when a parsing helper (e.g., fn ed(value: &str) -> ExactDecimal { ExactDecimal::parse(value).unwrap() }) is used at high frequency (10+ call sites in the same file), do not inline it as a one-liner. Keep the helper function to improve readability and reduce duplication; inlining would bloat test code. Apply this guideline to Rust test modules within the src directory (e.g., src/onchain_trade.rs) and similar test-only helpers that are used frequently. If present, document the helper’s purpose and ensure its behavior is clearly visible to maintainers.

Applied to files:

  • src/cli/submit.rs
📚 Learning: 2026-03-04T23:04:39.214Z
Learnt from: JuaniRios
Repo: ST0x-Technology/st0x.liquidity PR: 347
File: src/onchain/io.rs:237-239
Timestamp: 2026-03-04T23:04:39.214Z
Learning: In Rust test modules under src, avoid over-indirection for small helpers. If a helper (e.g., ed(value: &str) -> ExactDecimal) is used many times within the same file (roughly 10+ call sites), keeping the helper improves readability and reduces repetition. The guideline is intended to prevent unnecessary indirection for helpers with very few usages (1–2); apply the same logic to decide when to keep or simplify a helper in test code.

Applied to files:

  • src/cli/submit.rs
📚 Learning: 2026-03-06T10:44:56.373Z
Learnt from: 0xgleb
Repo: ST0x-Technology/st0x.liquidity PR: 355
File: src/cli/vault.rs:116-121
Timestamp: 2026-03-06T10:44:56.373Z
Learning: In Rust CLI command files under src/cli (e.g., vault.rs), using anyhow for error handling is acceptable at the CLI boundary. Do not flag or require typed domain errors (e.g., VaultCliError) in these files. The team intends to extract the CLI into its own crate where anyhow is the sole error mechanism, so reviews of CLI code should not push for typed errors. This pattern applies to all Rust files within src/cli.

Applied to files:

  • src/cli/submit.rs
📚 Learning: 2026-03-10T21:06:58.386Z
Learnt from: JuaniRios
Repo: ST0x-Technology/st0x.liquidity PR: 394
File: src/cli/vault.rs:94-94
Timestamp: 2026-03-10T21:06:58.386Z
Learning: In Rust CLI test files under src/cli (e.g., vault.rs), prefer asserting on meaningful outputs (e.g., amounts, addresses) rather than matching or asserting exact progress/status message wording. Do not treat ephemeral progress strings (like 'Depositing to vault...') as test coverage gaps; such wording is brittle and low-value. Focus tests on verifiable results and state changes that are stable across runs.

Applied to files:

  • src/cli/submit.rs
📚 Learning: 2026-03-13T16:32:06.432Z
Learnt from: 0xgleb
Repo: ST0x-Technology/st0x.liquidity PR: 382
File: crates/finance/src/usdc.rs:26-30
Timestamp: 2026-03-13T16:32:06.432Z
Learning: In ST0x-Technology/st0x.liquidity, unwrap() is forbidden in all production Rust code. This rule applies to all non-test code under src/ and crates/ (excluding #[cfg(test)] modules). Always use explicit error handling with ?, map/and_then, or return Result/Option to callers. No unwraps in production paths.

Applied to files:

  • src/cli/submit.rs
🔇 Additional comments (2)
src/cli/submit.rs (2)

62-62: Comment-line filtering is correctly implemented.

Line 62 cleanly extends existing blank-line handling to skip #-prefixed lines after trimming, which preserves backward compatibility and prevents parse failures for annotated stdin input.


258-288: New parser tests are targeted and sufficient for this change.

These cases validate interleaved comment/data input, leading-whitespace comments, and comment-only input returning SubmitError::EmptyInput, which is exactly the expected behavior for this PR.


Walkthrough

The parse_stdin_lines function in src/cli/submit.rs now skips lines that are empty or begin with # after trimming, instead of only ignoring empty lines. Test coverage was extended to validate comment line handling and comment-only input behavior.

Changes

Cohort / File(s) Summary
CLI Input Parsing
src/cli/submit.rs
Enhanced parse_stdin_lines to skip comment lines (starting with #) in addition to empty lines; expanded tests to verify comment filtering, mixed transaction and comment input, and comment-only input triggering SubmitError::EmptyInput.
🚥 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 'feat: skip # comment lines in cli submit input' directly and clearly describes the main change: modifying parse_stdin_lines to skip lines beginning with '#' in CLI submit input.
Docstring Coverage ✅ Passed Docstring coverage is 83.33% which is sufficient. The required threshold is 80.00%.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cli-submit-skip-comments

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.

@hardyjosh

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Apr 16, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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
> [!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
> [!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.

3 participants