Skip to content

Document vaultless vault ID sentinel - #44

Open
findolor wants to merge 1 commit into
mainfrom
vaultless-spec
Open

findolor wants to merge 1 commit into
mainfrom
vaultless-spec

Conversation

@findolor

@findolor findolor commented Jan 20, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

Document the new vault-id: vaultless sentinel for order inputs/outputs in the YAML spec. This enables direct wallet-based trading in V6 orderbook without adding a second vault-related field.

Parent issue: rainlanguage/raindex#2402

Solution

Added documentation to ob-yaml.md for using vaultless as a sentinel value of vault-id:

  • Input/Output fields section: Documents required (token) and optional (vault-id) fields
  • Vaultless mode section: Explains behavior:
    • Vaultless inputs: tokens received go directly to owner's wallet
    • Vaultless outputs: tokens given are pulled from owner's wallet (requires approval)
    • Hybrid orders supported (mix of vaultless and vault-based)
  • Validation rules table: Covers vault-id: vaultless, omitted vault-id, numeric/hex vault IDs, and invalid vault-id: 0
  • Examples: Added vaultless-order and hybrid-order examples using vault-id: vaultless

Checks

By submitting this for review, I'm confirming I've done the following:

  • 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)

fixes #43

Summary by CodeRabbit

  • Documentation
    • Enhanced documentation for front-matter order input/output semantics in vaultless mode, including field definitions and validation rules for vault-id values.
    • Added example orders demonstrating vaultless and hybrid order configurations for reference.

@findolor findolor self-assigned this Jan 20, 2026
@findolor
findolor requested review from 0xgleb and hardyjosh January 20, 2026 08:51
@findolor
findolor removed the request for review from hardyjosh April 15, 2026 06:30
@findolor
findolor requested a review from hardyjosh June 22, 2026 05:18
Document vault-id: vaultless for V6 orderbook wallet-based trading instead of a separate vaultless boolean. Includes field definition, validation rules, and examples for vaultless and hybrid orders.
@coderabbitai

coderabbitai Bot commented Jun 22, 2026 •

Copy link
Copy Markdown

Review Change Stack

Walkthrough

ob-yaml.md is updated to document vaultless mode for order inputs/outputs. A new subsection specifies token (required) and vault-id (optional) fields, defines vault-id: vaultless semantics, and adds a validation rules table. Two new YAML order examples (vaultless-order and hybrid-order) are added to illustrate the feature.

Changes

Vaultless Mode Documentation

Layer / File(s) Summary
Input/Output fields spec and validation rules
ob-yaml.md
Adds an "Input/Output fields" subsection defining required token and optional vault-id per item, describes vault-id: vaultless behavior (owner wallet used directly), and provides a table of valid, invalid, default, and explicit vault-id forms.
vaultless-order and hybrid-order YAML examples
ob-yaml.md
Extends the orders example YAML with vaultless-order (all inputs/outputs set vault-id: vaultless) and hybrid-order (inputs are vaultless; outputs include one vaultless and one explicit vault-id entry).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Document vaultless vault ID sentinel' directly relates to the main change, which documents the vaultless field (implemented as vault-id: vaultless sentinel) in the YAML spec.
Linked Issues check ✅ Passed The PR fully addresses issue #43 requirements: documents vaultless field, defines required/optional fields, explains wallet-direct transaction behavior, covers validation rules, supports hybrid orders, and includes example configurations.
Out of Scope Changes check ✅ Passed All changes to ob-yaml.md directly support documenting the vaultless field for order inputs/outputs as specified in issue #43, with no unrelated modifications detected.
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 vaultless-spec

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.

@findolor findolor changed the title Add vaultless field to order input/output spec Document vaultless vault ID sentinel Jun 22, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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 current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@ob-yaml.md`:
- Around line 332-338: The vaultless-order example has a mismatched
configuration where the input uses vault-id: vaultless but the output uses
vault-id: 1, making it a hybrid order rather than a pure vaultless order as the
name suggests. To align with the PR objectives, change the output section of the
vaultless-order example to use vault-id: vaultless instead of vault-id: 1,
ensuring all inputs and outputs in this example consistently use the vaultless
vault-id.
- Around line 282-305: Replace imperative and descriptive language with RFC 2119
keywords throughout the Input/Output fields, Vaultless mode, and Validation
rules sections to meet specification document standards. In the Input/Output
fields section, change "Required fields:" to "The following fields are
REQUIRED:" and "Optional fields:" to "The following fields are OPTIONAL:". In
the Vaultless mode section, convert statements like "the order uses the owner's
wallet directly" to "the order MUST use the owner's wallet directly" and "Tokens
received are sent directly" to "Tokens received MUST be sent directly". Apply
the same RFC 2119 transformations (MUST, SHOULD, MAY) throughout all behavioral
rules and validation scenarios to ensure unambiguous specification precision.
🪄 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: a622042a-22ea-4e3b-a433-5fde31405eb2

📥 Commits

Reviewing files that changed from the base of the PR and between c9197cc and 863ea49.

📒 Files selected for processing (1)
  • ob-yaml.md

Comment thread ob-yaml.md
Comment on lines +282 to +305
#### Input/Output fields

Required fields:
- `token` (foreign key into the tokens mapping)

Optional fields:
- `vault-id` (vault identifier, generates random if omitted; set to `vaultless` to use the owner wallet directly instead of a vault)

#### Vaultless mode

When `vault-id: vaultless`, the order uses the owner's wallet directly instead of a vault:
- **Vaultless inputs**: Tokens received are sent directly to the owner's wallet
- **Vaultless outputs**: Tokens given are pulled directly from the owner's wallet (requires approval)
- **Hybrid orders**: Each input/output can independently be vaultless or vault-based

##### Validation rules

| Scenario | Result |
|----------|--------|
| `vault-id: vaultless` | Valid - uses wallet directly |
| `vault-id: 0` | Error: "Invalid vault-id value. For vaultless mode use vault-id: vaultless" |
| `vault-id` omitted | Generates random vault ID |
| numeric or hex `vault-id` | Uses the specified vault ID |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Use RFC 2119 language for specification precision.

The specification section (Input/Output fields and Vaultless mode) uses imperative and descriptive language, but as a specification document, it should use RFC 2119 keywords (MUST, SHOULD, MAY) for unambiguous precision. This is required by your coding guidelines for specification documents.

For example:

  • "Required fields:" should be "The following fields are REQUIRED:"
  • Behavioral rules like "When vault-id: vaultless, the order uses..." should state "When vault-id is set to vaultless, the order MUST use..."
  • "Tokens received are sent directly..." should be "Tokens received MUST be sent directly..."

[mandatory_style]

📋 Proposed fix: Apply RFC 2119 language
#### Input/Output fields

-Required fields:
-The `token` field is REQUIRED (foreign key into the tokens mapping)
+**The following field is REQUIRED:**
+- `token` (foreign key into the tokens mapping)

-Optional fields:
-The `vault-id` field is OPTIONAL (vault identifier, generates random if omitted; set to `vaultless` to use the owner wallet directly instead of a vault)
+**The following field is OPTIONAL:**
+- `vault-id` (vault identifier; MUST generate a random ID if omitted; set to `vaultless` to use the owner wallet directly instead of a vault)

#### Vaultless mode

-When `vault-id: vaultless`, the order uses the owner's wallet directly instead of a vault:
-- **Vaultless inputs**: Tokens received are sent directly to the owner's wallet
-- **Vaultless outputs**: Tokens given are pulled directly from the owner's wallet (requires approval)
-- **Hybrid orders**: Each input/output can independently be vaultless or vault-based
+When `vault-id` is set to `vaultless`, the order MUST use the owner's wallet directly instead of a vault:
+- **Vaultless inputs**: Tokens received MUST be sent directly to the owner's wallet
+- **Vaultless outputs**: Tokens given MUST be pulled directly from the owner's wallet (requires approval for the wallet owner)
+- **Hybrid orders**: Each input/output MAY independently use vaultless or vault-based mode
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@ob-yaml.md` around lines 282 - 305, Replace imperative and descriptive
language with RFC 2119 keywords throughout the Input/Output fields, Vaultless
mode, and Validation rules sections to meet specification document standards. In
the Input/Output fields section, change "Required fields:" to "The following
fields are REQUIRED:" and "Optional fields:" to "The following fields are
OPTIONAL:". In the Vaultless mode section, convert statements like "the order
uses the owner's wallet directly" to "the order MUST use the owner's wallet
directly" and "Tokens received are sent directly" to "Tokens received MUST be
sent directly". Apply the same RFC 2119 transformations (MUST, SHOULD, MAY)
throughout all behavioral rules and validation scenarios to ensure unambiguous
specification precision.

Source: Coding guidelines

Comment thread ob-yaml.md
Comment on lines +332 to +338
vaultless-order:
inputs:
- token: eth-weth
vault-id: vaultless
outputs:
- token: eth-usdc
vault-id: 1

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Mismatch between example name and content.

The example named vaultless-order has a vaultless input but a vault-based output (vault-id: 1), making it a hybrid order, not a pure vaultless order. This contradicts the PR objectives which state that vaultless-order should have "all inputs/outputs use vault-id: vaultless".

Consider either:

  1. Rename vaultless-order to better reflect its hybrid nature, or
  2. Create a true vaultless example where all inputs/outputs use vault-id: vaultless

The existing hybrid-order (lines 339–347) correctly demonstrates mixing vaultless and vault-based modes.

🔧 Proposed fix: Create a true vaultless example
  vaultless-order:
    inputs:
      - token: eth-weth
        vault-id: vaultless
    outputs:
      - token: eth-usdc
-       vault-id: 1
+       vault-id: vaultless
  hybrid-order:
    inputs:
      - token: eth-weth
        vault-id: vaultless
    outputs:
      - token: eth-usdc
        vault-id: vaultless
      - token: eth-dai
        vault-id: 0x123
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@ob-yaml.md` around lines 332 - 338, The vaultless-order example has a
mismatched configuration where the input uses vault-id: vaultless but the output
uses vault-id: 1, making it a hybrid order rather than a pure vaultless order as
the name suggests. To align with the PR objectives, change the output section of
the vaultless-order example to use vault-id: vaultless instead of vault-id: 1,
ensuring all inputs and outputs in this example consistently use the vaultless
vault-id.

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.

Add vaultless field to order input/output spec

2 participants