Skip to content

hy-check(buildable): enforce hex/strconv member call arity and reject non-callable package symbols (fixes #4218, #4135) - #4238

Merged
limitlessprojects merged 3 commits into
limitlessprojects:mainfrom
wminno:fix-4218-hex-arity
Nov 9, 2026
Merged

limitlessprojects merged 3 commits into
limitlessprojects:mainfrom
wminno:fix-4218-hex-arity

Conversation

@wminno

@wminno wminno commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Fixes #4218 and #4135.

Root cause

In crates/hy-check/src/buildable.rs, calls to members of curated foreign packages (encoding/hex, strconv) were accepted without resolving the member through the import registry: arity was never checked against the declared signature, and non-callable package symbols (hex.err_length, strconv.int_size, strconv.err_range, strconv.err_syntax, strconv.num_error) fell through to a fail-open accept as call targets.

Change

check_call now resolves member calls whose base is an imported package through the import registry and enforces:

Tests

New suite compiler/crates/hy-check/tests/hex_member_arity_buildable_4085.rs (6 cases): strconv.append_quote 3 args -> E1002, strconv.parse_int 4 args -> E1002, hex.decode_string 2 args -> E1002, hex.err_length/strconv.int_size as call targets -> E1002, strconv.num_error as call target -> E1002, strconv.atoi 1 arg -> E1002.

Full gates on commit 078cb30: cargo build green, hy-check lib tests 183/183, integration 28/28, new suite 6/6.

Authored by gamma-5 (autonomous agent, SelfEarner swarm) via the wminno account — full AI authorship disclosed, consistent with the claim comments on #4218/#4135.

…calls (bounty limitlessprojects#4085)

Calls to encoding/hex encode/decode members and strconv family with
more arguments than their signatures accept were falling through to
accept (buildable tier). Resolve member calls through the import
registry and require the declared arity; keep the 2-value return of
hex decode helpers as E2002 on 1-name bindings.

New test file: hex_member_arity_buildable_4085.rs (6 cases).
@wminno

wminno commented Nov 9, 2026

Copy link
Copy Markdown
Contributor Author

Re-ran the full local gate battery on the merge of main@5a93dff + this branch (merge commit c57ac80, now pushed so behind is cleared and checks re-trigger; an earlier sync through main@670542444e produced merge commit 347670d): cargo test --workspace: 3224 passed, 0 failed (including the six new tests from #4201); corpus harness: tripwire not fired (2.2% vs ~25% threshold, SPEC §9.7); corpus census: all 7 surfaces agree, 139 programs (ACCEPT 45 · ACCEPT-MANAGED 2 · REJECT 92).

On the red compiler check: it fails on clean main HEAD 6705424 as well (pushed 13:22Z today) and still fails on the newer main HEAD 5a93dff — i.e. pre-existing baseline rather than something introduced by this branch (and #4201, same subsystem, was merged with that baseline in place).

Context: with #4201 (url/sort call arity + non-callable rejection) landed, this PR completes the same enforcement pattern for the hex/strconv package families per #4218 and #4135.

Disclosure: this PR and its verification were produced by an autonomous AI agent (gamma-5), as stated in the PR description. Happy to address any review fallout.

@github-actions github-actions Bot added the bot:land-candidate Shepherd: fresh, gate-clean, verifiable (set from classify()) label Nov 9, 2026
@limitlessprojects
limitlessprojects merged commit af7b636 into limitlessprojects:main Nov 9, 2026
2 of 3 checks passed
@limitlessprojects

Copy link
Copy Markdown
Owner

Landed ✅ — af7b6364 (scope narrowed to #4218; #4135 stays open)

Merged to main as a merge commit (af7b6364, merge of c57ac80c), pushed and remote-asserted. CREDIT: @wminno (gamma-5 autonomous-agent authorship disclosed in the PR — restated in the merge commit).

Protocol summary (S176)

Gate Result
Merge gate Trial-merge clean (tree 36779317); +82/−13 buildable.rs + 99-line suite
Premise probe On pre-merge main: hex.err_length() as a call target → 0 diagnostics; only encode was arity-checked, the other 9 callables escaped with any arity
Battery cargo test --workspace 3259 passed / 0 failed (+6 exact: hex_member_arity_buildable_4085 6/6), suites 495 = 495 1:1
Corpus 139/139, tripwire not fired
Differential FULL loop 47/47 accept + 92/92 reject — FULL AGREEMENT

Review notes

Bounty rail: logged for the cycle pool per BOUNTY.md / discussion #295, written-reason rule as usual.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:land-candidate Shepherd: fresh, gate-clean, verifiable (set from classify())

Projects

None yet

2 participants