Skip to content

feat(option): complete logical Option and no-null RSS boundaries - #38

Merged
fffonion merged 76 commits into
masterfrom
feat/option-unit-boundary
Nov 13, 2026
Merged

fffonion merged 76 commits into
masterfrom
feat/option-unit-boundary

Conversation

@fffonion

@fffonion fffonion commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Introduce distinct logical Option and Unit contracts across host schemas, guest SDK conversions, wire values, no-std and Wasm consumers.
  • Add Option combinators, lexical ?, typed optional projections and omitted-field construction, including named records and callable payloads alongside existing Result propagation.
  • Update HTTP/SSE, IO, SQLite, regex and timer contracts for explicit absence and Unit results; exercise IO/HTTP/SQLite together in one exact-catalog VM.
  • Reject the RSS null literal and enforce typed JSON and dynamic host-output admission boundaries, preserving VM-internal Null and the semantics owned by other frontends.
  • Update REPL/CLI presentation, shipped RSS consumers, language-service fixtures, strict lint consumers and rustdoc links.
  • Correct SQLite transaction-deadline classification for bounded commit lock waits, preserving the configured busy-timeout cap and rollback assertions.

Validation

Local execution evidence is bound to e034f69ac4f6658a48632c350d1e1f61305f8b4f.

  • Default workspace libraries/tests: 3061 passed, 0 failed, 15 ignored; 3076 canonical cases across 87 harnesses.
  • All-feature workspace libraries/tests: 3313 passed, 0 failed, 15 ignored; 3328 canonical cases across 91 harnesses.
  • Exact case reconciliation: the reader-deadline regression passes; only two direct deadline tests were added; all other case identities/states are preserved.
  • Eligible-target strict Clippy under both configurations, formatting and warning-free rustdoc. Five doctest harnesses execute zero business doctests; these are not counted as passing business cases.
  • No-default library tests: 426 passed. No-std tests: 68 passed. Runtime-only check passes. These overlapping configurations are not pooled with workspace totals.
  • Actual CLI/interpreter and VMBC emit/disassemble/reload checks; matching native JIT and fresh-process AOT observations.
  • Actual compiler-only/runtime Wasm build/export probes, private-name refusals and zero external import calls.
  • True PTY observations for all 17 REPL entries; only entry 16 reports the intended unknown-local diagnostic; clean exit.
  • Independent source review of the final SQLite repair: Spec/Quality/R1/R2/R3 pass; nonblocking precision, boundary and coverage notes retained.
  • Native GitHub CI for the exact publication head: push run 43488233945 and PR run 43488585462, all 12 jobs successful. Actual checkout commits and complete-tree equality were verified; native workspace tests use default features, while local all-feature SQLite execution is separately recorded.

Local strict checks select eligible libraries/tests/binaries and do not claim local example/bench or all-target coverage. Cache prewarming is compilation-only and is not counted as business-test execution.

…wire consumers

Add distinct compiler and host Option/Unit schemas, exhaustive constructor and match lowering, Unit facts for empty and no-tail callables, and typed GuestOption conversions. Extend the current VMBC format to version 14 with host schema tags 15/16 and compiler schema tags 19/20, and teach no-std consumers the Option cleanup and nested paths. Cover ordinary, VM-aware and generated host callbacks, resources, Trace JIT, AOT/loaded AOT, nested wire schemas and the actual wasm ABI, with product documentation and macro UI fixtures.
Rust fn() is the same function type as fn() -> (). The shared shape walk and callable label helper now both spell the default return as logical Unit, so GuestOption/GuestResult callable schemas and proc-macro/build descriptors admit no-tail RSS callables. Add generated-host invocation, descriptor equality and typed Store callback coverage for the omitted spelling.
Resolve Option map/and_then/or_else/unwrap_or/unwrap_or_else,
ok_or/ok_or_else and Result ok/err through the existing typed
match lowering. Extend ? to Option-returning callables, keep Result
error exactness, and make RustScript ?. produce a logical Option with
single-layer receiver projection, missing-key/present-None distinction,
Unit payload preservation, and typed resource ownership. Update the
replaced foundation tests and document the delivered behavior.
…ection

Record the delivered combinators, lexical Option ? rules, explicit
Result conversions, safe ?. projection states, ownership limits and
remaining no-null boundary work.
Normalize permitted omitted logical Option fields at construction so both
projection and direct field access observe Option::None. Required fields
remain checked and legacy nullable fields keep their existing boundary.
Option and Result method lowering stored the inferred present-key object on the hidden callback/fallback let, so a known named return lost its omitted Option field before normalization. Retain the already validated contextual result/payload/error schema on the hidden argument while preserving actual callback parameters, arity, captures and exact-E checks.
Checkpoint the no-null continuation with a compiler-private map edit so unit inserts stay present, RSS remove returns the updated map, and LRU/collection deletion no longer stores null.
Unaccepted checkpoint for the current JSON/generic delta. Named expansion stops on declaration re-entry, including Option-wrapped parameters, and typed objects drop unknown keys while still requiring declared fields. This is not an isolated map fix and does not accept full G.
Unaccepted G-P checkpoint. print, println, type, and format use the
source-order checked schema instead of the final local slot. This
does not accept full G and does not fix the remaining map/JSON defects.
Restore the id24 non-optional local and declared-return negatives so they exercise the current unit-to-int compile diagnostics.
A same-arity catalog print or println is the selected host call. Language format sugar stays on the intrinsic and on nonmatching overloads.
Sqlite and wasm examples compile in their bundled catalogs. Docs drop stale RSS T? and null callback bodies. Presentation keeps checked source-position schemas.
Option and Result constructors read the captured slot, so the resolver now maps declaration-position outer schemas onto FunctionImpl.capture_copies in both the main typing pass and omitted-field normalization. Nested captures resolve after their owner declarations; later assignments do not replace the captured fact.
An explicit direct import or a single matching wildcard member now selects its host target before language print formatting. A source-defined implementation still wins, and an unmatched wildcard member or non-matching bare catalog arity keeps intrinsic print.
Dynamic host returns are now rejected across every structured expression position, while guest-to-host consumption and the timer callback result exception stay allowed. RustScript source JSON must use the typed route: untyped public decode/encode fail at the call span, inferred concrete encodes are lowered, and nested method callbacks keep natural JSON. Logical presentation and JSON policy now follow actual source ids and function ownership, so plugin frontends keep their legacy nullable and public JSON capabilities.
A canonical host or SDK writer may omit the Null-valued Unit payload. Logical display, declared Option<Unit> field encoding, and REPL formatting now restore Some(()) for that authoritative schema only; tag-only Some under any other payload schema still fails.
The Option reference now states the shipped RustScript policy: explicit null literals and legacy nullable annotations are rejected in source, source JSON calls use the typed route, typed hosts publish GuestOption and Unit, and ambiguous value-position Unit JSON remains rejected. Internal VM and other-frontend legacy contracts are called out separately.
A real dep.rss export carrying a legacy T? return is rejected at its own module parse with the module path, while the same import with a concrete int export compiles and runs.
The lint fixture now uses typed decode and typed encode with the declared Profile schema, preserving the no-unknown-warning oracle without relying on the removed untyped RSS JSON route.
RSS rejects the null literal these VM close tests used only to construct a machine. Use () so the existing pending, permit, reentry and reclaim assertions actually run.
The installed sqlite::close contract returns logical Unit. The exact catalog pin still expected Null while the same test's resolver pin already expected Unit.
RustScript JSON calls require a concrete type argument. Keep the regex match, schema annotation, encode/decode round trip, output and stack oracles, and spell the calls with the current typed form.
A deadline-bounded busy timeout is an integer millisecond wait, so commit
can return SQLITE_BUSY just before the Instant deadline. Keep the 100 ms
deadline, late reader release, rollback, and busy-timeout restoration, and
report that wait as the configured deadline error.
@fffonion
fffonion merged commit 41eb261 into master Nov 13, 2026
12 checks passed
@fffonion
fffonion deleted the feat/option-unit-boundary branch November 13, 2026 19:23
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