Skip to content

hy-check(buildable): validate call arity and reject unpinned/non-callable symbols on rust crates (fixes #4188) - #4189

Open
SuperPiIot wants to merge 1 commit into
limitlessprojects:mainfrom
SuperPiIot:fix/rust-crates-call-buildable-soundness
Open

SuperPiIot wants to merge 1 commit into
limitlessprojects:mainfrom
SuperPiIot:fix/rust-crates-call-buildable-soundness

Conversation

@SuperPiIot

@SuperPiIot SuperPiIot commented Nov 8, 2026 •

Copy link
Copy Markdown

Summary

Enforce strict call arity and parameter name validation on curated pinned Rust crates (sha3, regex, serde_json), and reject invocations of unpinned symbols (regex.compile, regex.match_string) and package types (serde_json.value) with HYB-E1002 under GUARANTEES.md Row 13 (BUILDABLE).

Fixes #4188

Changes

  1. compiler/crates/hy-check/src/buildable.rs:

    • Added check_sha3_call_buildable: enforces exact arity for digest256 (1 arg) and stream_checksum (2 args), validating named argument parameters (data, iters, seed).
    • Added check_regex_call_buildable: enforces exact arity for is_match (2 args) and is_valid (1 arg), validating named argument parameters (pattern, text), and rejects unpinned symbols (compile, match_string).
    • Added check_serde_json_call_buildable: enforces exact arity for parse (1 arg), new_object (0 args), new_array (0 args), and to_string_pretty (1 arg), validating named parameters (data, v), and rejects invoking non-callable package types (value).
    • Guarded by self.lookup_kind(pkg).is_none() so in-scope shadowing declarations preserve user semantics.
  2. Integration Test Suite (compiler/crates/hy-check/tests/rust_crates_call_buildable_soundness.rs):

    • 11 comprehensive tests covering negative arity violations, unpinned symbols, type invocations, invalid parameter names, shadowing, and positive controls across all three pinned crates.

Verification

  • cargo check -p hy-check: clean (0 errors)
  • cargo test -p hy-check --test rust_crates_call_buildable_soundness: 11/11 passed
  • cargo test -p hy-check --test json_array_handle_soundness: 7/7 passed
  • python3 tools/differential_loop.py --bin compiler/target/debug/hyb: 45/45 accept, 90/90 reject (FULL AGREEMENT, zero regressions)

Settlement Coordinates

  • Network: Base Mainnet (Chain ID 8453)
  • Asset: USDC
  • Wallet: 0xf084cF0076F91AA48C2370F427C399dAA8C1f07F

@SuperPiIot
SuperPiIot force-pushed the fix/rust-crates-call-buildable-soundness branch from 1d033f3 to ddd0a99 Compare November 8, 2026 13:18
@github-actions github-actions Bot added the bot:conflict Shepherd: merge conflicts vs main label Nov 8, 2026
@SuperPiIot
SuperPiIot force-pushed the fix/rust-crates-call-buildable-soundness branch 3 times, most recently from ce64b02 to 877e7e6 Compare November 9, 2026 01:33
@github-actions github-actions Bot added the bot:stale-base Shepherd: behind main beyond threshold label Nov 9, 2026
@SuperPiIot
SuperPiIot force-pushed the fix/rust-crates-call-buildable-soundness branch from 877e7e6 to dde23d7 Compare November 9, 2026 21:19
@github-actions github-actions Bot added the bot:land-candidate Shepherd: fresh, gate-clean, verifiable (set from classify()) label Nov 9, 2026
@SuperPiIot
SuperPiIot force-pushed the fix/rust-crates-call-buildable-soundness branch from dde23d7 to 30449c7 Compare November 9, 2026 23:39
…able symbols on rust crates (fixes limitlessprojects#4188)

Enforce strict argument arity and parameter name validation on curated
pinned Rust crates (`sha3`, `regex`, `serde_json`), and reject invocations
of unpinned symbols (`regex.compile`, `regex.match_string`) and package
types (`serde_json.value`) with HYB-E1002 under Row 13 (BUILDABLE).

All checks are guarded with self.lookup_kind(pkg).is_none() so shadowing
local declarations preserve user semantics.

Includes a comprehensive 11-test integration suite covering arity
mismatches, invalid parameter names, unpinned symbols, types, positive
controls, and shadowing.
@SuperPiIot
SuperPiIot force-pushed the fix/rust-crates-call-buildable-soundness branch from 30449c7 to f20eef9 Compare November 10, 2026 01:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:conflict Shepherd: merge conflicts vs main bot:land-candidate Shepherd: fresh, gate-clean, verifiable (set from classify()) bot:stale-base Shepherd: behind main beyond threshold

Projects

None yet

1 participant