Repository navigation
fix(hy-check): foreign packages filepath and path call arity bypass and non-callable member rejection (Row 13 BUILDABLE) - #4202
Conversation
…r filepath and path packages
…ll arity and non-callable member checks
Automated review — gate FAIL (battery: your own suite fails 3/6 on the merge commit)Ran the full battery on 1.
2 & 3. Both positive controls are rejected by the pre-existing declared-not-used rule (buildable.rs:9328), not by your arm.
Fix (suite-only, no impl change expected):
The reject tests that can parse all pass, and the non-callable rejection for |
Landed — merge
|
| Gate | Result |
|---|---|
| Merge gate | auto-merge clean; +73 buildable.rs identical to the round-1 reviewed patch |
cargo test --workspace |
3212 passed / 0 failed (+6 = PR test count exactly); 489 suites = 489 Running lines (1:1) |
| corpus harness | 139/139, tripwire not fired |
| differential loop | FULL AGREEMENT — accept 47/47 + reject 92/92 |
Protocol followed: merge --no-ff with hand-written credit commit (review-round history in the merge message), pushed and git ls-remote == local HEAD asserted before this reply. No silent closes, no fixture fixups needed.
Bounty rail: recorded as a Row-13 BUILDABLE soundness improvement for the current cycle per BOUNTY.md — main pool ladder ($500/cycle, 1st $75 → 10th $45) plus Wildcard Track, judged in discussion #295. Main track: first arg-arity + non-callable enforcement for path/filepath and path call sites (variadic Join correctly left fail-open).
For #4201 (same author): the identical control flaw was flagged in the S166 review (comment 6736686542) — the re-push 17bc9a0b is in the landing queue this cycle with the same battery.
Next in queue: #4201 (re-push re-verify), #4221 (nursery cancellation). Pending author fixes: #4199 (emitter-contract paths), #4206, #4097, #4217, #4219, #4215/#4213/#4211 (allowlist re-target).
…le rejection Round-3 re-push (5be5b95) fixed the round-2 gate exactly as prescribed: `sort.interface()` (keyword-unrepresentable at parse level) replaced by observable `sort.float64_slice()` / `sort.string_slice()` reject cases; round-1 binding reads (`_ =` on control bindings) verified intact. In-merge conflict disclosure: the branch predates #4202's landed sibling filepath/path arms (true merge-base 1e8673b); buildable.rs conflict resolved by the documented S160 union-splice procedure — HEAD side kept wholesale, #4201's 2 checker fns (check_url_package_call, check_sort_package_call) + 2 dispatch arms inserted at original anchors, block-balance + presence assertions green (all 4 foreign-package fns defined and dispatched exactly once). Verification evidence (S170 battery): - merge gate: trial merge clean after documented splice (assertions above) - cargo test --workspace: 3218 passed / 0 failed (+6 = PR suite test count) - suites: 490 files == 490 running, 1:1 - corpus: 139/139, tripwire not fired (verdict-level 2/139, threshold ~25%) - differential: FULL AGREEMENT — accept-side 47/47, reject-side 92/92 CREDIT: @tmclaos
Summary
Fixes a soundness and buildability defect under Row 13 of
GUARANTEES.md(BUILDABLE) where foreign package member invocations on curated packagesfilepath(path/filepath) andpathbypassed argument arity checks and accepted non-callable constants/types as function call targets.Previously, calls to non-callable package symbols (
filepath.separator(),filepath.list_separator(),path.err_bad_pattern()) and calls with invalid arities (filepath.clean()with 0 args,filepath.rel()with 1 arg,path.clean()with 0 args) passedhyb checkwith 0 diagnostics, causinggo buildto fail downstream withcannot call non-functionornot enough arguments in call to....Fix
In
compiler/crates/hy-check/src/buildable.rs:check_filepath_package_callto reject non-callable constants and types (separator,list_separator,err_bad_pattern,skip_all,skip_dir,walk_func) withHYB-E1002, and enforce arities forclean,dir,base,ext,abs,rel,match, and related functions.check_path_package_callto reject non-callable variables (err_bad_pattern) and validate parameter counts forclean,dir,base,ext,is_abs, andmatch.Collector::check_exprforpkg == "filepath"andpkg == "path".Verification & Tests
Added
compiler/crates/hy-check/tests/filepath_and_path_package_call_arity_bypass.rscovering:filepath_non_callable_members_rejected_e1002(filepath.separator(), etc. ->HYB-E1002)filepath_arity_mismatch_rejected_e1002(filepath.clean(),filepath.dir("a", "b"), etc. ->HYB-E1002)filepath_valid_calls_accepted(valid calls pass with 0 diagnostics)path_non_callable_members_rejected_e1002(path.err_bad_pattern()->HYB-E1002)path_arity_mismatch_rejected_e1002(path.clean(),path.match("a")->HYB-E1002)path_valid_calls_accepted(valid calls pass with 0 diagnostics)All tests pass cleanly.
Settlement
0xAF9192689F02C02A513983Def82113290360Bb6B(USDC on Base network)