Skip to content

test(diagnostics): 84 invalid programs, 76 rejected by check, and sixteen typechecker fixes - #12

Closed
Immanuel-Fowler wants to merge 3 commits into
test/determinism-tracefrom
test/diagnostics-corpus
Closed

Immanuel-Fowler wants to merge 3 commits into
test/determinism-tracefrom
test/diagnostics-corpus

Conversation

@Immanuel-Fowler

Copy link
Copy Markdown
Owner

Stacked on #11 (test/determinism-trace); merge that first.

What

The diagnostics corpus grows from 30 to 84 invalid programs, across types, events, serverlets of every kind, processes, C, Rust, and WebAssembly sidecars (a 57-byte hand-assembled .wasm fixture included), and module boundaries, with the module fixtures they import beside them under diagnostics/modules/.

The test reports the count. diagnostics_never_leak_rustc now runs each case through orchestrate check first and prints:

diagnostics corpus: 76 of 84 invalid programs rejected by `orchestrate check`; 6 more by the build before Cargo; 0 through Cargo without a rustc error code; 2 reach rustc (all listed in KNOWN_LEAKS.txt); 0 wrongly accepted

It holds the leaks to tests/error_cases/diagnostics/KNOWN_LEAKS.txt in both directions: an unlisted leak fails the test, and a listed case that stops leaking fails it too, so the list is always exactly the truth. benchmarks/diagnostics_coverage.py writes the same classification as CSV, JSON, and Markdown.

Sixteen typechecker fixes, each turning a rustc leak the corpus found into orchestrate check's own error: module and foreign calls with wrong argument types or to functions the module lacks (the error lists what it has); serverlet handler calls with the wrong arity or types, where only the name was checked; duplicate handlers in any serverlet; secret wire types at check time; start X(args); start of a non-process; for over a scalar; ? outside a result-returning function; a piped value of the wrong type; a second orchestrator main; and a sandboxed handler that waits (at build). check also registers Rust sidecar signatures now, as the build always did; without that, the stricter checker would have refused every call into a Rust foreign module or the standard library during a check. Every example still passes check, and the full test suite passes.

What still leaks

Two cases, explained in LIMITATIONS-notes.md: a function whose body can fall off the end without returning (fn_missing_return), and a generic called with conflicting arguments for one type parameter (generic_arg_conflict). Three candidates turned out to be valid programs and are recorded in the notes instead: a Rust keyword as a name, a string reused after a serverlet call, and a task touching shared let, which is fine.

Changelog entries under [Unreleased]. No version bump.

🤖 Generated with Claude Code

Immanuel-Fowler and others added 3 commits September 20, 2026 23:38
… rustc

The diagnostics corpus, grown for the paper, found them: a call into a
module or a foreign function with the wrong argument types, or to a
function the module does not have; a serverlet handler called with the
wrong arity or types, where only the handler's name was checked; a
handler declared twice in any serverlet, not only a landline; a secret
serverlet handler type the wire cannot carry, reported by check rather
than by the child's build; `start X(args)` on a serverlet, which takes
none; `start` of something that is not a process; `for` over a number
or a string; `?` in a function returning neither result nor option; a
piped value of the wrong type; a second `orchestrator main`; and, at
build, a sandboxed handler that waits, which a guest cannot do.

check also registers Rust sidecar signatures now, as the build always
did. Without that the stricter checker would have refused every call
into a Rust foreign module or the standard library during a check.
Every example still passes check and the full suite passes.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ects

The corpus grows from 30 to 84 deliberately wrong programs across
types, events, serverlets of every kind, processes, C, Rust and
WebAssembly sidecars, and module boundaries, with the module fixtures
they import beside them. The test runs each through `orchestrate check`
first and reports the count, 76 of 84, then builds the rest and holds
the ones that reach rustc to KNOWN_LEAKS.txt in both directions, so the
list is always exactly the truth. benchmarks/diagnostics_coverage.py
writes the same classification as CSV, JSON and Markdown.

The old closure_wrong_arity case used arrow syntax the language does
not have and so tested the parser; it is closure_arrow_syntax now, and
closure_wrong_arity calls a real closure with too many arguments.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…e notes

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant