feat(ir): drop Function.synchronous, add Function.parameters, KindValue::Unit - #46
Merged
Merged
Conversation
…ue::Unit Three of the four core-target-contract IR changes (docs Design 4.4). The fourth -- throws: Vec<String> -> Vec<u16> with schema-global error ordinals -- is its own follow-up. - Function.synchronous removed. It conflated a wire fact (does the call reply), a binding choice (block vs .await) and server config; only the first belongs in the schema and _return already carries it. It was always frozen `true` and read nowhere. - Function.parameters: Vec<FrozenUnit> added, same shape Protocol / Struct already carry -- `@key = value` function annotations (@timeout_ms, @idempotent, ...) as Property { name, expression }. The AST already parsed function annotations; they were dropped at freeze. Open namespace: a consumer acts on the keys it knows. - KindValue::Unit + a `()` type in the grammar. `function commit() -> ();` now freezes as _return: Some(KindValue::Unit) -- a reply that carries no value (an empty ack) -- as distinct from `function commit();`, no `->` at all, which freezes as _return: None (no reply, one-way). Without the variant "ack, no value" was inexpressible. Exhaustive matches updated in diff.rs, validator.rs, kind_search.rs; type_to_string / build_kind_value map the new grammar node. Tests: parser + IR coverage for `-> ()` vs no return. Full core suite green (241 passed).
This was referenced Sep 1, 2026
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.
Three of the four
core ↔ targetIR changes (docs Design §4.4). The fourth —throws: Vec<String>→Vec<u16>with schema-global error ordinals (incl. cross-schemause) — is a separate follow-up PR.Function.synchronousremovedConflated three things — a wire fact (does the call reply), a binding choice (block vs
.await), server scheduling config. Only the first belongs in the schema and_returnalready carries it. It was always frozentrueand read nowhere.Function.parameters: Vec<FrozenUnit>addedSame shape
Protocol/Structalready carry —@key = valuefunction annotations (@timeout_ms,@idempotent, …) frozen asProperty { name, expression }via the existingannotation_units(). The AST already parsed function annotations; they were dropped at freeze. Open namespace — a consumer acts on the keys it knows.KindValue::Unit+ a()type in the grammarfunction commit() -> ();now freezes as_return: Some(KindValue::Unit)— a reply that carries no value (an empty ack) — distinct fromfunction commit();(no->), which freezes as_return: None— no reply at all (one-way). Without the variant, "ack, no value" was inexpressible without inventing an empty struct per call.UnitType(()); parser regenerates at build time, no ambiguity in theTypeposition.type_to_string/build_kind_valuemap it; exhaustiveKindValuematches updated indiff.rs,validator.rs,kind_search.rs.Tests
Parser + IR coverage for
-> ()vs no return (test_protocol_unit_return,test_protocol_unit_return_ir). Full core suite green — 241 passed, 0 failed. No frozen-unit hash goldens broke.Downstream
FrozenUnitshape change → everycomline-<lang>/generation/clithat pinscomline-coreneeds a coordinated rev-bump when this lands (they only pattern-matchFunctionwith.., so it's a rev-bump, not code changes).