fix(verify): steer T004 to the unglue fix for main-level bindings (ILO-546) - #790
Open
danieljohnmorris wants to merge 5 commits into
Open
fix(verify): steer T004 to the unglue fix for main-level bindings (ILO-546)#790danieljohnmorris wants to merge 5 commits into
danieljohnmorris wants to merge 5 commits into
Conversation
…O-546) When a one-line script glues statements after a fn header with ';', those statements join the fn body (documented script-mode rule) and lose access to top-level bindings. T004 then fired with the ILO-504 lambda advisory, which steers a repairing model toward captures instead of the one-edit fix. Track main's top-level Let names in VerifyContext and, when the undefined name is one of them, name the real fix: put the statement on its own unindented line. Multi-line interleaved decls were never broken (ticket's original diagnosis was wrong); regression tests pin both shapes plus the surviving lambda advisory for genuine capture attempts.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
`prnt fmt2(3.14, 2)` and `prnt at([5 6 7], 1)` failed with ILO-P003 'expected `)`, got `,`': parse_call_arg handled zero-arg `name()` but not the adjacent paren-form arg list, so the arity-driven positional loop parsed the group as a parenthesised expression and died on the comma. User-fn calls were unaffected, which is why it read as a builtin-only bug. Adds the same adjacency branch the statement-head and operand positions already carry, and extends trailing operands inline up to the known arity (ILO-544's `at([5 6 7])1`) rather than via paren_call_atom, which only parse_call_or_atom consumes and would leak into an unrelated atom here.
Eight lint failures had accumulated while the Rust workflow was not running on release branches. Mostly mechanical (identity map, unused bindings, needless refs, useless format!). Two were real: - The 2-arg `rou x digits` verifier arm was unreachable because `rou` also appeared in the 1-arg math-builtin arm, so the digits argument was never type-checked. `rou 3.1 "x"` now reports ILO-T013. - Duplicated min/max and rou branches in the arity-hint chain collapsed into one matches!.
69565d4 made builtin names legal as bindings (they shadow the builtin in value position, call position still dispatches it) but updated no tests, and the Rust workflow was not running on release branches, so the breakage stayed invisible. Five suites asserted the old ILO-P011 rejection: - coverage_parser: the two builtin-binding cases now assert acceptance. - regression_builtin_binding_name: rewritten around the new contract. The original persona bug (use site mis-dispatching to the builtin and reporting a bogus ILO-T006) is still pinned, now by asserting the use site resolves to the local. Adds a case for call position still dispatching the builtin, the half most likely to be broken later. - regression_multi_line_body_span_drift: fixtures used `rev =` purely as an error vehicle for the span assertions; swapped to `fld`, which is still hard-reserved, so the spans are what is under test again. - regression_listlit_builtin_call_hint: fmt2 has gained a known arity, so the list-literal shape parses correctly and ILO-P101 no longer fires for it. Asserts the parse; `fmt` (variadic) still covers P101. - regression_top_level_chain_hint: the map= case now asserts the binding runs and that P102 does not swallow it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
sts=[..];ws=[..];grd a:n>t;..;@s sts{..}) put everything after the fn header into that fn's body, so top-level bindings are genuinely out of scope and ILO-T004 fires - but the old hint appended the ILO-504 enclosing-fn lambda advisory, steering repair models the wrong way. This was grade-calculator's 3/3 failure in the N=5 bench.Companion (separate branch)
Bench harness ILO_SYSTEM prompt no longer instructs 'compact one-liners' - semicolons within bodies only, own-line top-level statements.
Tests
tests/regression_script_scope_hint.rs: glued form gets the new hint (and not the lambda advisory); multi-line interleave, decl-after-statements, multi-decl shapes all run; lambda advisory survives for non-main names.coverage_parser::builtin_as_decl_name,stmt_builtin_let_rejected) - broken by 69565d4 (builtin-shadow feature) before this branch, unrelated.Linear: ILO-546