Skip to content

Require wire_name to start with an ASCII letter - #4

Merged
vinniefalco merged 1 commit into
cppalliance:masterfrom
vinniefalco:master
Dec 1, 2026
Merged

vinniefalco merged 1 commit into
cppalliance:masterfrom
vinniefalco:master

Conversation

@vinniefalco

@vinniefalco vinniefalco commented Nov 30, 2026 •

Copy link
Copy Markdown
Member

Tightens contract 0.7 wire_name validation to require a leading ASCII letter ([A-Za-z][A-Za-z0-9_-]{0,63}), matching the Engine's ToolSchema alias rule without changing any C ABI struct layout or contract version.

  • Updates is_valid_wire_name and testing::pack::add misuse wording in runvil-plugin-sdk
  • Updates RvToolInfo::wire_name and ToolInfo::wire_name docs and regenerates crates/runvil-plugin-sys/include/runvil_plugin.h
  • Adds regression tests rejecting leading digits, _, and - (0, 0_fetch, _fetch, -fetch)

Note: merge via merge/rebase rather than squash if runvil-harness pins commit 81c8861b9523a8df87f9dbfee95c924061d9bd6f directly.

Summary by CodeRabbit

  • Bug Fixes
    • Tool names beginning with a digit, underscore, or hyphen are now rejected. Names must start with an ASCII letter and may continue with ASCII letters, digits, underscores, or hyphens.
  • Documentation
    • Clarified the allowed format for explicit tool names. Empty names still allow the Host to derive a name.

Tighten contract 0.7 tool wire-name validation so `is_valid_wire_name` requires a leading ASCII letter followed by ASCII letters, digits, `_`, and `-`. Update `RvToolInfo::wire_name` docs, regenerate `runvil_plugin.h` through `cargo xtask header`, and align `testing::pack::add` misuse wording and tests.

- `is_valid_wire_name` in `names.rs` now checks `bytes[0].is_ascii_alphabetic()` before scanning the remaining bytes.
- `testing::fixture::Breach` adds `WireNameLeadingDigit` to pin `0_fetch` rejection in `testing::pack::tests`.
@coderabbitai

coderabbitai Bot commented Nov 30, 2026

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Wire-name validation now requires a non-empty name to start with an ASCII letter. The allowed remaining characters and length limit remain unchanged. Tests, validation errors, and Rust and C documentation reflect the rule.

Changes: Wire-name validation

Layer / File(s) Summary
Validation rule and supporting coverage
crates/runvil-plugin-sdk/src/names.rs, crates/runvil-plugin-sdk/src/testing/*, crates/runvil-plugin-sdk/src/tool.rs, crates/runvil-plugin-sys/include/runvil_plugin.h, crates/runvil-plugin-sys/src/lib.rs
The validator rejects names that do not start with an ASCII letter. Tests cover leading digits, _, and -. The error text and Rust and C documentation state the rule. Empty names still allow the Host to derive the wire name.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: Minimal · up to 81c88

Plugin tool wire names must now start with an ASCII letter, matching the Engine's alias rule. The change is small and covered by tests. No concrete merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "Require wire_name to start with an ASCII letter" matches the main change in the changeset. The PR tightens is_valid_wire_name so a nonempty wire name must begin with an ASCII letter. The …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "Require wire_name to start with an ASCII letter" matches the main change in the changeset. The PR tightens is_valid_wire_name so a nonempty wire name must begin with an ASCII letter. The summaries show matching updates to the validation in pack.rs, the ToolInfo and RvToolInfo docs, the regenerated header, and the regression tests for 0, 0_fetch, _fetch, and -fetch. The title is specific and concise, and it does not need to name every file.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 4e2eded6-f6f8-4b48-a534-fbd84d61462c
Commits

Reviewing files that changed from the base of the PR and between 42c109f and 81c8861.

Files selected for processing: 6

  • crates/runvil-plugin-sdk/src/names.rs
  • crates/runvil-plugin-sdk/src/testing/fixture.rs
  • crates/runvil-plugin-sdk/src/testing/pack.rs
  • crates/runvil-plugin-sdk/src/tool.rs
  • crates/runvil-plugin-sys/include/runvil_plugin.h
  • crates/runvil-plugin-sys/src/lib.rs

Included review availability: This review used your included allowance. 4 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.

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