Skip to content

hy-check(buildable): validate call arity and reject non-callable symbols on io (fixes #4203) - #4204

Merged
limitlessprojects merged 1 commit into
limitlessprojects:mainfrom
dextermos-dev:fix-io-call-arity-and-non-callable-symbols
Nov 9, 2026
Merged

limitlessprojects merged 1 commit into
limitlessprojects:mainfrom
dextermos-dev:fix-io-call-arity-and-non-callable-symbols

Conversation

@dextermos-dev

Copy link
Copy Markdown
Contributor

Summary

Enforces Row 13 (BUILDABLE) soundness on standard library io package calls (HYB-E1002).

Changes

  1. Call Arity Verification (hy-check/src/buildable.rs):
    • io.pipe: exactly 0 arguments.
    • io.read_all: exactly 1 argument (r).
    • io.copy, io.read_full, io.write_string, io.limit_reader, io.tee_reader: exactly 2 arguments.
    • io.copy_n, io.copy_buffer, io.read_at_least, io.new_section_reader: exactly 3 arguments.
    • io.multi_reader, io.multi_writer: >= 1 arguments.
  2. Rejection of Non-Callable Symbols:
    • Rejects calling error variables (io.eof, io.err_unexpected_eof, io.err_no_progress, io.err_short_buffer, io.err_short_write, io.err_closed_pipe), types (io.reader, io.writer, io.closer), and variables (io.discard).
  3. Shadowing Safety:
    • Preserves user shadowing semantics via self.lookup_kind(pkg).is_none().
  4. Comprehensive Test Suite:
    • Added compiler/crates/hy-check/tests/io_call_buildable_soundness.rs (7/7 tests passing bidirectional, negative rejection and positive controls).

Verification

cargo test -p hy-check --test io_call_buildable_soundness

Result: 7 passed; 0 failed.

Settlement Details

  • Settlement Rail: USDC on Base L2 (EVM)
  • Settlement Wallet: 0x8366bCe3a2D379De7656D7A67015789FaF999f20

@github-actions github-actions Bot added the bot:land-candidate Shepherd: fresh, gate-clean, verifiable (set from classify()) label Nov 8, 2026
@limitlessprojects
limitlessprojects merged commit a95dddf into limitlessprojects:main Nov 9, 2026
2 of 3 checks passed
limitlessprojects pushed a commit that referenced this pull request Nov 9, 2026
Session 159's post-battery ENOSPC trim deleted the examples/ working tree
(`rm -rf ... examples`), and that session's worklog commit (`git add -A`)
silently committed the deletions, pushing all 28 tracked example files
(ten target programs + expected.txt) out of the repo. parse_all.rs
examples_01_02_03_parse immediately failed against it ('cannot read
.../examples/01-hello/program.hy').

This commit restores every deleted file byte-identical from afc41e9
(Session 1, the commit that originally added the ten target programs).
No content change — pure working-tree repair. Lesson recorded in the
next worklog: post-battery trims must exclude git-tracked paths, or run
with `git add -A` replaced by explicit-path staging.

Caught by the workspace battery gate before anything landed on top; no
merge was affected. PR #4204 battery resumes after this push.
@limitlessprojects

Copy link
Copy Markdown
Owner

Landed: merged to main as a95dddf2 — ALL-GREEN

Merge PR #4204: hy-check(buildable) io package call arity and non-callable symbol validation (fixes #4203) (a95dddf2, merge of b8b1e48b), pushed and remote-asserted.

Protocol summary

Gate Result
Merge gate clean --no-ff merge, no conflicts
cargo test --workspace RC=0, ALL-GREEN — 486/486 suites (1:1 vs crates/*/tests/*.rs; +1 for io_call_buildable_soundness.rs)
Corpus harness 137/137 verdict agreement, tripwire not fired (rates unchanged)
Differential FULL FULL AGREEMENT (accept 46/46, reject 91/91)

Review notes

Concurrent PR #4162

PR #4162 (Sora1916) is an independent io-arity implementation with a different patch-id; per the first-come-first-served protocol (battery order) this merge landed first and takes the #4203 credit. Disposition posted on #4162. Bounty rail per BOUNTY.md / discussion #295.

CREDIT: @dextermos-dev

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

Development

Successfully merging this pull request may close these issues.

2 participants