Repository navigation
Design verona regions
Design issue: #30 — the ruling that binds.
STATUS: STAGES S0–G LANDED (G 989d7182a1); the model loop is CLOSED at core-m3w-fa25 (red team AR clean); specs/model-*.md follow fa25 (c7e1f48a38); compiler agreement is open, tracked on #235, #243, #244, #245, #246, #232, #233 and the issues filed from N5; remaining: closing items, then Release
Maxon's safety work has failed twice on edge cases:
- The inferred write and provenance machinery (StorageProvenance.maxon at 11,234 lines, EffectSummary, the parameter-mutation masks, the E3078/E3159/E3188/E3138 checks at send) took 13 review rounds and opened new holes each round.
- The Pony-style declared capability design was sound in capmodel but needed 11–16k markers. It was cancelled on 2026-10-24.
The root cause in both was that capabilities sat on bindings, and let was forced to mean deep immutability.
Every unannotated position then needed whole-program provenance.
The goal is a sound model built from Project Verona: the Reggio static region type system (OOPSLA'23, arxiv 2309.02983) and behaviour-oriented concurrency (BoC, OOPSLA'23), with Maxon's services kept as the surface. Single-threaded code needs no markers.
This revision folds in two rounds of independent reviews (soundness, implementation feasibility, consistency; then a second soundness red team and an accuracy review); "Review findings" at the end maps each finding to where it is answered.
-
letmeans "cannot be reassigned" only. Deep immutability becomesimmutable(frozen). Onlyimmutablecan be image data. This reversesproject_a_let_is_immutable_at_every_depthandproject_a_let_is_image_data. -
Static Reggio types, with no run-time safety checks. Every rule is a compile-time error. Reggio's one dynamic check (entering a region that is already open) is made static by two rules: opening, swapping, sending or freezing a region needs a writable reference to what holds it (everything outside an open block is read-only, so an open region cannot be reached again), and no other coroutine runs while a region is open: inside a
modifyblock (or one-call open) every wait on another party (ruling 5's list, message-reply awaits included), every coroutineawait, everyacquire, and every call whose inferred may-wait or may-yield bit is set are refused; and while the block is open the runtime does not switch to a sibling coroutine of the same green thread (I/O such asprintor a file read simply blocks the strand for the block). Releases never yield (destructors close OS handles synchronously). The runtime open bit is not needed. -
The actor model stays.
spawn, services andexportmessages remain the surface. Each service is implemented as a Verona cown whose state is a closed region; each message is a behaviour on that one cown. -
Parameter capabilities are inferred, with no marker. Each unmarked parameter (and an omitted receiver) is a capability variable κ, and the body is checked once against it under Reggio's rule that assignment needs equal capabilities. The body's uses decide one of three outcomes:
- any capability (mutable, read-only or immutable argument): the body only reads it during the call;
-
mutable only: the body writes through it, opens/swaps/freezes/merges an
isolatedvalue reached from it, passes it or a field of it by reference (amutablevalue-type,isolatedoruniqueparameter) or to a mutable-only parameter, stores it, captures it, or hands it to a callee whose parameter is mutable-only; -
immutable only: the body passes it to an
immutableparameter, a message argument of immutable type, calls animmutable selfmethod or requirement on it, or stores it into frozen data.
A capture's capability is written, never inferred (user, 2026-10-29): a closure that needs a captured parameter frozen (to call an
immutable selfmethod on it, say) captures a parameter declaredimmutable.A body that needs both mutable and immutable is refused. A result reached from a parameter takes that argument's capability only if every return path fits it; a path returning a fresh value, a module
letor another parameter's data fixes κ instead (or is refused). These are per-parameter and per-function facts, computed as one joint least fixpoint over the call graph's strongly connected components. Interface requirements and function-type parameters are not inferred across the program: they are read-only unless declaredmutable self/mutable T(ruling 19). Reggio has no read-only supertype ("If a mut and paused could alias, the immutability of the latter would be weakened to read-only"), so an any-capability parameter is a capability parameter: one capability per call, checked once, compiled once (counts are routed at run time by box kind). There is noanykeyword.Maxon's current read-only binding keyword is removed (its uses become
let). -
No waiting while holding. Code that holds services (a message body, an
acquireblock) may not wait on another party: noawaitof a message reply or of a promise of unknown origin, noacquire, no send with a nonzerosendTimeout:(ForeverMsor finite), noshutdownthat waits, no latch, registry ordefault-key wait, and noasyncof — orawaitof — a coroutine that may do any of these. Request/response from inside a service becomes "send, and handle the reply in another message". This is BoC's own rule, and it makes deadlock impossible by construction. -
The may-wait and may-yield facts are inferred, with no marker (no function colouring). One bit each per function over the call graph, computed from the conservative side (a function in a recursive group is assumed to wait until shown otherwise). May wait: the function waits on another party (ruling 5's list) or calls one that may. May yield: the function awaits a coroutine, or calls one that may yield or may wait. I/O is neither: it parks the green thread, never switching it to a sibling coroutine inside a block.
-
Coroutines share the caller's region, under structured rules.
asyncmay take mutable arguments. Such a promise is tied: it lives only in a local (no field or container holds it), cannot be returned, captured or sent, and is drained by an unconditional consumingawaitbefore the function returns; passing it to a parameter the callee keeps counts as storing it and is refused. Every path out of the function, athrow, an earlyreturnand a propagatingtryincluded, must firstawaitor.cancel()each tied promise still live there, or it is a compile error; there is no implicit join (user, 2026-11-03)..cancel()on a tied promise stops the coroutine starting any new far-end wait and then waits for it to finish, discarding its result, so no tied coroutine outlives its caller. Every promise held in a local, tied or not, is must-use (user, 2026-11-03: forgetting one is a logic error). On every path it is awaited, cancelled, stored, returned or passed on. Dropping it at scope exit, overwriting it, or discarding it with_ =is a compile error. The one exception is a service message's reply discarded with_ =(_ = try h.say("a")), which is an explicit fire-and-forget: the message is still delivered (user, 2026-11-03);_ = async f()stays refused. A promise inside a container or field is still cancelled with its container at run time. Anasyncgiven data opened by amodifyblock is refused. Inside amodifyblock and inside anacquireblock,async, a coroutineawaitand any call whose may-yield bit is set are refused: code that holds a region open or holds services neither waits nor yields. HoldResolution keeps holds across every call that may yield. Anacquireparks only the coroutine that makes it, not its whole green thread. -
The receiver's capability may be declared as a first parameter where inference cannot express it:
function submitTo(immutable self, …)exists only on frozen values. Omitted, the receiver is inferred (ruling 4). A name is never overloaded (ruling 31), so a method exists once, whatever itsselfcapability. -
pausedis never written. The compiler infers it inside amodifyoracquireblock; read-only parameters accept it; diagnostics say "read-only while '' is open". -
The block that opens an isolated value for changes is
modify x 'label' … end 'label'(Reggio'senter). Inside,x(a local, parameter or field path) keeps its name and is writable; everything else is read-only except block locals, new objects and outer value-typedvars. There is no second name. Only the region's contents are writable: the slot holdingxcannot be reassigned or passed by reference inside its own block. Any call that passes anisolatedvalue in an unmarked position — as receiver or as argument — opens it for that call expression: every other argument must be a value,immutableor a movedisolated, twoisolatedvalues in one such call are refused, and the result leaving the call must be a value,immutableor a freshisolated(soself.index.first().text = "x"is refused; write it insidemodify). Likewise any statement that reads or writes through an un-openedisolatedvalue (lines.count(),job.number = 4,let n = job.number) opens it for that one statement under the same rules: oneisolatedroot per statement, nothing but values,immutableand freshisolateddata leaves it, and outer data is read-only in it. For aniforwhilethe open covers the condition alone; aforormatchover the value opens it for the whole statement, because its head lends the value's parts to the body. -
An element of a container of
isolatedvalues is reached only inside a block.modify jobs.get(0) 'l' … end 'l', a one-call open, or aforover the container lends the element for that span, and the container is read-only for the span; a barelet j = jobs.get(0)is anisolatedread without a block.remove,popandswaptake an element out. Amatchon a union with anisolatedpayload lends the payload within the arm as an un-openedisolatedvalue: it is opened like anisolatedlocal, never moved or assigned, and taken out only byswap. (Ruling 43: for unique, non-isolated elements the container stays read-only for the span as a rule about the container alone; no window opens.) -
Atomic updates across services: the
acquireblock (Verona'swhen, renamed):acquire a, b 'move' … end 'move' otherwise 'stopped' … end 'stopped'takes both services at once and runs the block on the caller's green thread. It is an ordinary block:returnleaves the enclosing function and releases the services. -
Inside an
acquire, one service is writable at a time (Reggio's window of mutability; supersedes "all at once"). All named services are held for the whole block, so the block is atomic; a method call on one service's state opens that one for the call, and amodifyblock opens one for several statements. A statement that would store one service's data into another's is a local type error. No check crosses a function call. Two names in oneacquiremay be the same service at run time (it is taken once), so states of the same type are treated as possibly the same object: holds are kept across a write to either. Acquired state names (and a message'sself) cannot be moved, swapped, frozen, merged or sent. -
Re-acquiring a service is refused at compile time. Any
acquiremay wait, and code holding services may not call anything that may wait, so a nestedacquireis refused whatever service it names. -
Parameters are
letunless markedmutable(user, 2026-10-31). An unmarked parameter cannot be reassigned:position = position + 1is a compile error naming the fix (mark itmutable, or bind a localvar). A value-type (numbers,bool, enums,String),isolatedoruniqueparameter markedmutablebefore its type is passed by reference:function skipSpaces(bytes ByteArray, position mutable BytePosition)advances the caller's variable.mutableis write access to what the caller passed: for a value type, anisolatedor auniquevalue, the caller's variable itself (none of them has aliases, so assigning the parameter writes the caller's storage and nothing diverges); for a plain record, the object's contents. Nothing is inferred: only the marker makes a parameter by reference (Verona has no by-reference parameters, andinoutwas declined). The caller passes avaror a writable field or element (not alet, a literal or an expression); arguments that overlap a by-reference one are E3186. A function type or interface requirement spells it the same way (typealias Step = function(mutable Count)), and a closure or conformer converts only if its markers match exactly. A plain (aliasable) record parameter is never rebound (r = Row.create()would point the caller's variable at another object while other holders keep the old one):mutableon it is the write-through capability (ruling 19). On a value oruniquetype,mutableis legal only on a parameter or a function-type parameter (the exception to ruling 29's refusal of capability words on value types). A generic body never reassigns amutable Tparameter: T may be a plain record, and the body is checked against T's bound only (user, 2026-10-31). -
Spelling: Reggio's
immisimmutableandisoisisolated. A capability is a prefix word on the type, read like an adjective:var index as isolated WordIndex,lines isolated LineArray,returns isolated LineArray,Array with immutable Job,Map with (String, isolated Job),value as immutable Point, on a local that is a region of its ownlet chunk = LineArray.create() as isolated LineArray(ruling 17), and on the receiverfunction submitTo(immutable self, …). No colon is involved, so the parser's "name followed by:" scanners (argument labels, struct-literal fields, map keys) are unaffected. The new words are contextual, likemodule: recognized only where the grammar expects them (a capability word before a type;modify/acquireat the start of a statement;freeze/merge/swapbefore an operand;is uniqueafter a type name), so today's namesMachinePin.acquire()(stdlib/Scheduler.maxon:124),swap(i, j)(stdlib/helpers/sort/smallSort.maxon:22),IrModule.merge(maxon-bin/Compiler/IR/IrModule.maxon:780) and locals namedmutableoruniquekeep working. S0 surveys every collision and lists any that cannot stay. -
Instances are mutable by default, as in Verona.
T.create(…)used as an ordinary value is mutable in the current region; a value becomes immutable only throughfreeze(or by being a modulelet). Types carry no capability. -
New regions are inferred, with no marker at the creation site (Pony's automatic recovery). An expression whose result capability is mutable and whose inputs are all clean cannot point back into the current region, so its result is usable as
isolated:let pinned = freeze Point.create(2.0, y: 3.0),Self{index: WordIndex.create()}. Clean inputs are values,immutabledata and movedisolateddata — not a by-reference argument, not a value of an unbounded type parameter, not a promise whose payload is not sendable, and not the result of a runtime or external function that may return cached data (each such function is audited and declared). A generatedclone()is clean only when it deep-copies everything: a type with a closure field is not cloneable, and anisolatedfield is cloned by opening it into a fresh region. Recovery happens at that one expression, where anisolatedposition asks for it (a field, argument, send, return,freeze). A local bound to such an expression is ordinary mutable data unless it is declaredas isolated T(ruling 15); a declared one is linear (ruling 27). Nothing tracks a local's isolation through the function. -
type X is uniquefor values that must never be copied or aliased. Records alias freely inside a region under this design, so a type for which a second reference or a copy would be a disaster declares it. A unique value is never cloned or aliased:let b = amoves it (E3102 after), storing it moves it, an argument lends it for the call (a callee that stores the parameter takes it instead, inferred like the read-only bit, and the caller's variable is moved), reading it from a container names its slot, as today (docs/LANGUAGE_REFERENCE.md:5025-5030): consuming the read moves it out of the slot. It crosses threads by move. A type with a unique field is unique too (inferred) and gets no generatedclone(). Declare it only where cloning or aliasing would be disastrous: stdlib'sPromise(awaiting consumes it, so it is never lent) and every OS-handle type (closing is a write the handle's other holders would not see, so a handle is neither frozen nor shared; user, 2026-10-30) are unique, and so, by the field rule, is every type that holds one. A type that owns an OS handle held as a plain integer declaresis unique(StreamingSubprocess, whosehandlebecomes private, andSharedSegment); a handle the system closes (DebugHandle,SampledThread.handle) is not an owner and stays plain (user, 2026-10-30). Service handles are not OS handles: they stay shareable. An OS handle, like a promise, belongs to no region (user, 2026-10-30): a record or region may hold it, it crosses amodifyoracquirewindow, a send may move an outside one out of a window, and closing one there writes no region. A unique value read from a slot and lent to a call is a one-call open of that slot, exactly as anisolatedargument is (ruling 10): every other argument is a value,immutableor moved, and the slot is resolved after the other arguments run, sog(r, y: r.file)is refused whatevergdoes withr(user, 2026-10-30). Every one-call open, unique orisolated, follows one order: the receiver and the other arguments run first, in source order; then the opened path (holder, index and condition) is evaluated and opened, last (sample 12); any other operand that moves a local the opened path reads is E3102 (user, 2026-10-30). A kept argument moves its local where that argument runs, so any operand run after it that reads or swaps the local is E3102, for calls, constructors, union literals, sends and spawns alike (user, 2026-10-30). Two element steps may name the same element unless both indexes are different literals, and are the same element when both are onelet; aforbinding is its array's path plus some element (user, 2026-10-30). Inside its own window a unique target is never bound, kept or stored (it has one name); a non-unique target may be aliased by block locals that never leave the window (user, 2026-10-30). A type that reaches a thread-bound OS handle (MachinePin, andDebuggeeorSamplerwhere bound to a thread) is neversendable, transitively asuniqueis, so no region holding one crosses threads (today's E3138; user, 2026-10-30). Service handles stay shareable. -
Interface requirements and function types are read-only, and never wait or yield, by default. A requirement whose conformers write the receiver declares
mutable self; a function type whose callee writes a parameter declaresmutable T(typealias RowEdit = function(mutable Row)); a function type whose closures write what they captured is amutable function(…)(typealias Tallier = mutable function(Row)), and a value of it cannot be called through frozen or read-only data. A closure or conformer converts only if its inferred class for each unmarked parameter (andself, and its captures) is exactly "any capability", it may neither wait nor yield (S0 hole G2: a yielding closure called inside amodifyblock deadlocks under ruling 2's guard), and a result reached from a read-only parameter does not stand in for a plain mutable result (it is refused for a function type; through an interface, the result takes the interface value's capability). Comparators, hashers and describers need nothing. Every fact stays local to a declaration, so separately compiled libraries stay sound. A by-reference parameter is spelledmutablethere too (ruling 14), and a closure or conformer converts only if its markers match exactly. -
Pending operands are protected (S0 hole G1). Because records alias freely, a value already evaluated for one operand must survive the operands after it:
-
held at run time: a field read used as a constructor, union-literal, send,
spawnorasyncargument is held across every later operand that may run user code, and amatchsubject is held across arms that write back (HoldResolution gains these holds; today it holds only arguments of user-function calls); -
refused at compile time: a local read by one operand and passed to a
mutableby-reference parameter (ruling 14) anywhere else in the same statement (new P2(x, put(x))). E3186 covers every operand of the statement, not only the arguments of one call, because a hold cannot protect a value its by-reference cell overwrites. The same holds for a by-reference field path (new P2(h.f, put(h.f))), and a by-reference field path's holder is kept alive across the call so another root cannot free it.
-
held at run time: a field read used as a constructor, union-literal, send,
-
isolatedas a type argument is opt-in (red teams 5 and 6). A generic acceptsisolated Tonly if it declareswhere T is isolated; its body is then checked with every storedTread as a lend (reached only inside a block, taken out only byswap/pop/remove). stdlib'sArray,ListandMapdeclare it; user generics opt in.clone()of aTyields a fresh mutable value, never animmutable T; a generic is cloneable only for type arguments that are. -
Rules settled by the red teams (rounds 5 and 6):
-
awaitapplies to a local, or to aswap/pop/removeresult; awaiting a promise still in a field or slot is refused. The result ofawaittakes the result capability theasynccall computed (a coroutine returning its argument returns it with that argument's capability). - An
asynccall never takes anisolatedvalue in an unmarked position. A tied promise's.cancel()is a wait (ruling 7): a tiedasyncsets the caller's may-yield bit. - In
modify jobs.get(i), the index is a literal or aletand is evaluated once; inside, the opened element is reached only by that path. -
isolatedvalues cannot be tuple elements. A type with auniquefield cannot be frozen; every alias-making read of a unique value (field read,cond, tuple read, a method returningself) consumes it. A match expression and atry … otherwise <value>merge are conds here; an arm that is a slot read or a lent unique is refused at the merge (E3214; ruling 47). - A
mutable isolated T(ormutableunique-type) parameter is by reference: its argument must be anisolated(or unique) local, re-isolated after the call. -
condover twoisolatedlocals consumes both;condover two promises takes the stronger origin (may-wait if either is). - Inside
acquire a, bwith possibly-same states, a held read-only operand of one state while another is opened in the same statement is accepted (holds keep it alive). - Runtime obligation: a promise cell is resolved atomically when a sendable promise crosses threads. A
sendablebound takes a value, a service handle, or animmutabletype that is notuniqueand whose graph the share walk accepts; a function type, an interface type and a promise never meet it (ruling of 2026-11-16 on #30). A value here is a scalar, String, Character, cstring, or an aggregate that is not unique and owes no drop (a payload-free or word-sized union, a record, instance or tuple packed in a word); any aggregate that owns a counted box is written immutable until #104. An interface-typed slot in the argument's graph is judged where the value is shared (E3171, ruling 46), not at the bound. At a spawn, a bounded position is reported once, as E3215. A type-parameter argument, or an argument that mentions one, meets a bound only when the enclosing type's own bounds prove it; neither bound proves the other; E3215 in the declaration (#30, ruling of 2026-11-17). An instance aspawninfers over the enclosing type's parameters is refused earlier, as E2015, until #242, which owes the E3215 at that site. An alias over an associated type in an interface extension is each conformer's alias, judged from that conformer's binding; an interface with no conformer declares none.
-
-
Rules settled by the reggio2 fix round:
- A
mutable isolated T(ormutableunique-type) parameter may be opened, swapped or replaced in the callee, but never moved out or aliased (otherwise the caller's variable names a region another thread owns). - A module-
letinitializer calls nothing (ruling 30). - Sample 11's
Pooldeclares both bounds (where T is sendableandwhere T is isolated), soPool.handle with isolated Jobstays legal under ruling 22. - The model's interpretations I19–I31 (
capmodel/reggio/REPORT2.txt) are adopted unless the user overrides one.
- A
-
Rules settled by red teams 7 and 8:
-
where T is isolatedadmits bothisolatedanduniquetype arguments (both are owned, move-only values): a storedTread is a lend, taken out only byswap/pop/remove. A generic without the bound cannot be instantiated with auniquetype. stdlibArray,ListandMapdeclare it, so arrays of promises work. A function type and a plain aggregate with no unique part never meet it; the values it takes are the sendable bound's value list. In a generic declaration, an aggregate overTmeets it only when it isuniquewhateverTis (#30, ruling of 2026-11-17). - A module
letof auniquetype is refused (modulelets are frozen, so it would be aliased). - An acquired service's state, or anything reached from it, cannot be an
asyncargument. - A
uniquetype whose method keeps its receiver cannot satisfy amutable selfinterface requirement. - Passing the same
uniquelocal twice in one call is E3102. - The model's interpretations I32–I47 (
capmodel/reggio/REPORT3.txt) are adopted unless the user overrides one. (Ruling 42: the one-call shapebx.eat(v)withvan un-opened isolated local into a parameter the callee owns is a moved isolated beside the opened receiver and merges into it; an outervaris assigned inside a window only when it holds a value type, isolated, unique and linear variables included.) (Ruling 42: "stores" means the value escapes the call; a rename to a local that dies in the callee is not a keep.) (Ruling 44: a unique argument, lent or kept, is a clean input only when its type is closed.) (Ruling 45:modifytakes a local, parameter or field path; on a temporary it is refused with the no-holder refusal, E3199.)
-
-
Rules settled by red teams 9 and 10:
- A
uniquevalue converts to an interface type only if the interface is declaredis unique; values of such an interface are moved and lent like any unique value. - A record result reached through a frozen interface or function value is read-only (paused), never
immutable: the conformer may have returned a fresh mutable object. - The array a
fordrains is read-only in the loop body. - An explicit iterator over an
isolatedpath needs a block;iterover a container of unique values is refused (forlends instead). -
get(a, i)evaluates the index before reading the array (values first, sample 12). - Capabilities inside type constructors (promise payloads, array elements, generic arguments, function parameters and results) are compared at every conversion.
- Inside a
modifyoracquireblock, a record result through an interface or function value is read-only (the conformer may return its own data); to store it there, the requirement or function type declaresreturns isolated T. - The model's interpretations I48–I57 (
capmodel/reggio/REPORT4.txt) are adopted unless the user overrides one.
- A
-
The core (user, 2026-10-27). Every rule is one typing rule per expression form, decided from types already in hand; there is no dataflow analysis of where a value came from (capmodel
core,capmodel/reggio/REPORTCORE.txt):-
Capabilities are part of every reference's static type, and every flow compares them: store, assignment,
argument, by-reference argument, return, send and
condjoin, including the capabilities inside type constructors (array elements, promise payloads and origins, generic arguments, function parameters and results, tuple items, an iterator's array). A variable's capability is fixed at its binding. -
isolatedanduniqueare linear. Every use of anisolatedlocal or parameter moves it except opening it (modify, a one-call open, a one-statement open);let b = amoves anisolateda. -
An
isolatedvalue comes from three places only: an expression whose inputs are all clean (ruling 17), recovered at that one expression where anisolatedposition asks for it; aswap,poporremoveout of anisolatedslot; a parameter, result, field or local declaredisolated(ruling 15). Anisolatedtemporary handed to an unmarked parameter is merged there. Rulings 36 and 41 add a bounded fourth: an owned linear parameter or consuming receiver of a closed type. -
The window rule (ruling 10) holds for
modify, the one-call open, the one-statement open, aforormatcharm that binds anisolatedelement or payload, and anacquireblock (ruling 43: a lend of a unique, non-isolated payload or element is not a window). -
acquireadds nothing beyond ruling 12. Each acquired state is anisolatedregion held in place; one is open at a time; a call that only reads a state opens nothing and its result is read-only; a region moves between states only by aswapout and a store orisolatedargument into another state while that one is open. - Results are typed (ruling 4): fixed, or "the capability of parameter p".
-
Capabilities are part of every reference's static type, and every flow compares them: store, assignment,
argument, by-reference argument, return, send and
-
Every promise cell resolves atomically (a release/acquire on resolution), regardless of whether it crosses threads.
-
Rules the core keeps from the earlier rounds:
- A message or factory parameter is never by reference.
- A frozen and a mutable value joined by a
condare read-only afterwards. -
otherwiseruns instead of theacquirebody, from the entry state. - A
tryhandler sees every move made anywhere in its body. - A rebound name's old variable is dead from the rebinding; a rebinding never reuses a slot a coroutine holds by reference.
- Block locals inside a window may point into the open region; they never leave it.
- The variable rooting an open path, a lend or a matched union keeps its value inside the window or arm: it is
not reassigned, rebound, swapped or passed by reference there (ruling 45: in a window, a lending
forbody, or an arm that binds a payload). - A result through an interface or function value never adapts and is never fresh.
- A generic conformer is checked per instantiation, where it converts.
- Dropping a tied promise before its consuming
awaitis refused: reassigning it, a swap or pop whose result is not kept in a local that is drained like any tied promise, a by-reference callee that reassigns it, acondthat selects one of two. A conditionalawait(in onecondarm or one branch) does not drain it. A promise argument always moves (ruling 18: a promise is never lent), so a tied one passed to any parameter is kept by the callee and refused. - Names never collide: duplicate fields, parameters, methods, messages, union cases, module
lets and type names, a type parameter named like a declared type, and a parameter namedselfare refused. - A module
let's value is known at compile time (ruling 30). - A parameter's capability joined with frozen data by a
condis refused; joined with mutable data it makes the parameter mutable-only. Avarbound to a parameter's data and later assigned frozen data makes the parameter immutable-only: the variable's capability is fixed at its binding (user, 2026-10-29). ATparameter is pinned the same way. Acondof a parameter's data and frozen data is judged against the parameter's final class, so statement order does not matter: immutable-only gives frozen data, mutable-only gives read-only data, undecided is refused; theconditself pins nothing, though assigning its value to avarbound to the parameter pins it as any assignment does. A frozen-onlyTparameter may be passed to aTposition that only reads it, as a record parameter may. - Every use of an unmarked parameter is judged against its final class (user, 2026-10-29): the body is
checked treating the parameter as frozen, each use adds a requirement (mutable for a write, store or
capture; frozen for an
immutableparameter, animmutable selfcall or a send; none for a read), and the class is decided at the end. A frozen use inside amodifywindow therefore pins the parameter immutable-only in any statement order: a window restricts only mutable outside data. A use refused only because the promise of anasyncon the parameter's data is tied pins the parameter immutable-only the same way; thatasync's tiedness and may-yield bit follow the parameter's final class (user, 2026-10-29). - Code after a call that never returns normally is still checked, as in Go.
- A bare
returnin a function, method or message that declares a result is refused, as in Go (user, 2026-10-29). - A message that throws fails its reply: the
awaitof it throws, as a coroutine's does (user, 2026-10-29). - A bare
yieldinside a window is refused. - A
uniquevalue may be sent to a parameter of its ownuniquetype or to anisolatedone. Unique values stay unique inside unions, closure captures,forandmatchbindings andmutable Tparameters; a callee that awaits or stores auniqueparameter consumes the caller's argument. - The one-open-per-statement rule counts services, not names, and a read-only call opens nothing; two states
opened in one statement are refused,
condarms included. - A store into an acquired state's plain field needs that state open; storing an
isolatedvalue into an open state'sisolatedslot is a move (b.item = o). -
freezeapplies to a local or aswapresult, never to a field in place. - A
forover a plain array that the loop pushes to or pops from is accepted; the iterator holds its buffer and re-checks the count. - Inside
acquire a, bwith possibly-same states, a read-only local taken from one state while another is opened is accepted, as for held operands (ruling 23). -
spawnjoins the factory's may-wait and may-yield bits into the spawner's. - A by-reference argument is a flow in both directions: every component of the variable's type is compared both ways, and a promise's origin and payload freshness, which no declared type carries, are taken as unknown after the call. A tuple or an iterator meets only its own kind.
- A variable passed by reference to
asyncis lent to the coroutine until its promise is drained, like a move that ends at the drain. - A by-reference cell write is a store: a pending operand read from a field or element is held until its statement ends, across every later operand that may write a by-reference field or element cell, directly or in a callee or coroutine (ruling 21's holds; HoldResolution keeps these holds).
- A result declared
returns mutable Treturns mutable data of the caller's region, in every function, closure and conformer: frozen data, read-only data and a parameter's data are refused there. Through an interface or function value it stays writable whatever the value's capability. An unmarked result adapts (ruling 4). - A
uniquetype is neversendable: whether a unique value can be sent depends on the value, not its type. A generic boundwhere T is sendabletakesisolated Tok, never a plain uniqueTok. - Every
matchsubject is held at run time for the whole match (the hold follows the value, ruling 50), temporaries included (acond, a call or aninvokeresult; ruling 21's holds). The locals acondsubject reads are guarded inside the arms like the variable rooting a matched union. - The roots of a cond match subject, or of a path over one (
cond(c, h, g).u), are holders in every arm, binding or not, when the matched union has a unique or isolated payload: read-only, and not reassigned, swapped, moved, passed by reference or passed to a callee that writes them; over a plain-payload union the roots only stay put (not reassigned, swapped, moved or passed by reference) and their fields stay writable. Bind the subject to a local, or match under each branch of the condition (ruling 48). - Inside
acquire,modify t.ion anisolatedfield of a statetnot yet open openstfor the block as the one open state; onlyt.i's region is writable. The one-statement and one-call opens (t.i.n = 4,t.i.bump()) do the same, as one-statementmodifyblocks (ruling 10). - A
swap, store or push whose new value moves the destination's own root is refused. - A function-type position over a type parameter lends its argument unless written
isolated T(function(isolated T) returns T), which moves it: a closure may then keep or return it at every instantiation, and every caller hands over anisolatedvalue (a unique value only when it is also isolated: fresh, or declaredas isolated). - A closure written inside a generic body is checked once, there (user, 2026-10-28): one that keeps or
returns its unmarked parameter of an unbounded
Tis refused at every instantiation,intincluded; writefunction(isolated T)to keep or return it. Asendable- orisolated-boundedTis never a plain record, so its closures are not refused for it. - A named callee's
Tparameter lends auniqueorisolatedargument when the callee neither keeps nor returns it, at direct calls and through conformers alike (user, 2026-10-28; ruling 18). A lentisolatedargument is a one-call open under the window rule, whether or not the call is its last use. - A conformer whose result's join holds a parameter other than
self, or a record parameter beside aTparameter, is refused where it converts, whatever the parameters are named (user, 2026-10-28). - A
condof two coroutines' promises has both coroutines as its origin and waits if either may. A variable's origin is fixed at its binding: a promise of a different set of coroutines is not assigned to it (user, 2026-10-28). - Where a requirement says
returns mutable, a conformer's result that adapts to its receiver or a parameter, or is declaredimmutable self, is refused at the instantiation; whatever the result's type mentions, its capability word is compared (user, 2026-10-28). - A capability word (
mutable,immutable,isolated) written directly on a value, handle or promise type is refused, exceptmutableon a parameter or function-type parameter of a value oruniquetype (ruling 14). Substituted through a type parameter, any capability word over a value, handle or promise type means that type as itself, in every position: a value copies, a service handle shares, a promise or OS handle moves (user, 2026-10-30). Auniquetype (a promise, an OS handle, or a type holding one) is neverimmutable, so a type parameter written underimmutableis not instantiated at one. A generic body is checked against T's bound only, so in it animmutable Torisolated Tis sendable only when T is boundedsendable; a result read through a receiver adapts to the receiver's capability whatever word it carries (user, 2026-10-30). A message or factory parameter or reply over a type parameter needswhere T is sendable(sample 11), refused at the declaration, and so does a field of a service with no factory (its fields are the factory's parameters);int,Stringand service handles satisfy the bound, and no other bound is added (user, 2026-10-30). -
let _ = ediscards the value; discarding a tied promise is a drop. - An
acquireblock neither yields nor waits (user, 2026-10-28):async, a coroutineawaitand a may-yield call are refused inside it, as insidemodify. Start coroutines before the block, await them there, and pass their results in. - A message body may start and await coroutines (user, 2026-10-28): it holds its own service across the yield, its coroutines follow the ordinary tied-promise rules, and none of them may wait (ruling 5).
- A
uniquevalue is never cloned, through any path (ruling 18); a type is unique when any type it reaches, through any cycle of types, holds a unique field. - A closure never reassigns a variable it captured,
mutable functionincluded: a capture is the closure's own copy. It writes through a captured record instead. - Only a written
immutable selfmakes a method's receiver frozen for a requirement (user, 2026-10-29): inference does not reach into a conversion. - The inferred facts never depend on declaration order (user, 2026-10-29): each pass visits the call graph's
strongly connected components callees first, with no pass limit; each pass recomputes every signature's
result from scratch; module-
lettypes are part of the same fixpoint. A result not yet inferred stays unknown through every rule built from it (no refusal, no fact). Facts are learnt only from results settled under the facts already held, then the results are recomputed (user, 2026-10-29).
-
A module
let's value is known at compile time (user, 2026-10-28). Its initializer is a literal, a string, an enum case, a constant arithmetic expression, a reference to another moduleletor a field of one, a tuple, acondwhose condition is constant (only the arm it selects is a dependency), a closure that captures nothing, or a record or array literal built from these (Self{…}-style, allowed at module scope as the one exception to E3076). It calls no function (cloneincluded;freezeis redundant and refused), so nothing runs beforemain: every moduleletisimmutableimage data, one copy shared by every function and thread, neverisolatedand never rebuilt per use;.clone()gives a mutable copy (user, 2026-10-28). A cycle between modulelets is refused; their declaration order does not matter. A name read inside a closure's body is not a dependency: the body runs after every moduleletexists. A handle, a promise, a closure capturing anything, or aSharedValuecannot be a modulelet. -
No overloading, as in Go (user, 2026-10-28). A function name is declared once per scope, and a method name once per type; methods of one name on different types are separate methods. No declaration differs from another by parameter types, arity, labels or
selfcapability: a second one is refused. A call binds the one declaration its name and receiver type name, so every analysis (capability classes, may-wait) reads that declaration. A conformer implements a requirement with its one method of that name. The short form of a long call gets its own name (sort/sortBy). A field and a method of one type do not share a name (user, 2026-10-29), and neither do astaticand an instance method (user, 2026-10-31). Top-level names are scoped by directory, as Go's package block: every type, enum, union, interface, typealias, moduleletand function, private or exported, generic or not, is declared once per directory in one namespace (type Pointandfunction Pointin one directory collide); different directories are separate scopes; locals and parameters keep block scope and may shadow a top-level name (user, 2026-10-31). A program's own function may shadow a standard-library function of the same name: they are different scopes, as in Go. An extension, the program's or a library's, may add new members to a type but never redeclare one the type, the library or another extension already gives it (user, 2026-10-31). -
A consumed linear or Reply-holding union hands over its isolated payload as an owned value (user, 2026-11-13). When
matchconsumes such a union, the union is dead and keeps no alias to the payload, so no match window opens for the payload: it may go anywhere a linear, isolated or Reply value may, under the ordinary rules for wherever the match sits. Model rule set core-m3w-fa11. -
Nested matches over one payload, and four refusals made exact (user, 2026-11-13, review AF). A match nested in an arm of a lending match on the same union lends the payload twice, read-only, and is sound: the oracle's allowance counts the enclosing match windows, and no checker rule is added. The nested lend applies to lending matches only, never under a consuming match (rulings 32, 40). Four refusals of programs the oracle runs clean are relaxed:
- W1: a message body may match its own linear-union or Reply-union message parameter.
- W2: an owned arm may reassign the variable it matched once the payload is consumed. A loop may refill it the same way when every path to the back edge refills it.
- W3: a linear union held in an
isolatedvariable may be matched. - W4: a variable holding a linear union's non-linear case owes nothing; overwriting it is no drop. Vacancy joins by intersection across branches, loops and try handlers. Model rule set core-m3w-fa12.
-
The implicit merge, the matched unique, and recovery on first read (user, 2026-11-14, review AG).
- When an isolated union is consumed by
match, every payload is a fresh owned value, plain ones included. Storing one, or anything it reaches, into an open window's region merges its region in, asmergewould. - A unique matched variable is not moved or copied inside its own lent arm (ruling 29).
- The model's oracle also runs every failed send's hand-back handler (the forced-failure oracle), and every gate runs under both oracles.
- I1: a match inside a
trywhose handler can never run is no drop. - I2: a
varunion reassigned in a try body and in its handler is accepted; the handler starts with the locals vacant at every throw point. - I3: a fresh, never-aliased plain local is recovered into an isolated position (a parameter, slot,
declaration,
freezeormerge) on its first read, and that read moves it. A local read before, re-read in a loop, or given a second name is not recovered. - I4: the lone plain payload of an owned isolated union is recovered the same way. I3 counts a local's reads, which amends the "nothing tracks a local's isolation" sentence of ruling 17 and the "no dataflow analysis" clause of ruling 27 for that one fact. Model rule set core-m3w-fa13.
- When an isolated union is consumed by
-
Send, spawn and coroutine start are throw points for the model's liveness (review AH, 2026-11-15). Review AH found no checker hole in fa13 and one oracle defect: a statement holding a send, a spawn or an
asyncstart was not a throw point, so a failed send's handler was never judged under the forced-failure oracle. The oracle counts them. -
The model follows the compiler where the compiler is sound (user, 2026-11-15). These refusals of the model are made exact, each behind its own switch:
- A
spawnwhose factory cannot throw is no throw point. One whose factory may throw still is. - A message parameter is an owned value. A unique message parameter stored into service state, and a
consumed linear receiver sent, are sound (ruling 42: an
isolatedmessage or factory parameter reaches a plain slot only throughmerge). An owned linear value is isolated where it goes on only when its type is closed (ruling 41). - A
varlinear moved into a send whose hand-back is consumed and refilled in a loop is accepted. - Vacancy is exact: a variable that never holds a linear value on a path owes nothing there. Model rule set core-m3w-fa14 (capmodel 6c881bc, REPORTFA14), which also carries ruling 35's throw points, ruling 38's lend, and RECOV-SWAP: swapping a local that a recovery moved is E3102 (an fa13 hole of I3/I4 found by its gadget g113; the compiler already refuses it). 0 holes under both oracles. Amendment to rulings 17 and 27: within one function body the checker keeps two flow facts, and nothing else about where a value came from. (a) For a plain local, whether its value is a clean one (a declaration's or an assignment's) that at most one read has taken a reference out of since; a join takes the more-read side, and the first read of such a value into an isolated position (an isolated declaration, parameter, slot or send) recovers the local, which is then moved. (b) For a union variable, vacancy: it holds a non-linear case of a linear union on every path, and then owes nothing. Neither fact crosses a call or a function boundary, refines a type or survives an alias, a swap, a capture or a keeping use; every other question about where a value came from stays unanalysed.
- A
-
A vacant linear-union variable owes nothing, so passing it twice is no move (user, 2026-11-15). It holds a payload-free case and owns nothing, which is consistent with ruling 33's W4.
-
A read-only lend of the matched variable inside its own arm is legal (2026-11-15). Rulings 29 and 34 name everything the arm forbids for the variable rooting a matched union with a unique payload: it is not reassigned, rebound, swapped, passed by reference, moved or copied there. Lending it to a call that only reads it does none of these and makes no second owner, so it is accepted:
match slot { case have(t) { peek(slot) } }. Whether a call is such a lend is decided by the rules that govern every lend: one that keeps its argument, and a send or a spawn, move it and stay refused. The model's F2 refuses the moves and the copies, not the read. (Ruling 42 extends this to a lend to a callee that writes through it and keeps nothing, when the statement names no binding of the arm.) -
A match over a plain union lends its payloads; only a linear union hands them over (2026-11-16). A payload bound from an
isolatedslot of a union held in a plainlet, avar, a parameter, a field or an element is lent to its arm, opened there under the window rule (ruling 27), and never goes where an ownedisolatedvalue is wanted:let u = Mx.m1(rb)thenmatch u { m1(o) then takeB(o) }, withtakeB(b isolated Bx), is refused (E3198, the model's C-LEND), for aletas for avaror a parameter. A plain union is ordinary region data and aliases freely (let v = u, a call that keeps it, a call that returns it), so its name being dead after the match does not make the union dead. Ruling 32's argument holds only because a linear or Reply-holding union is never aliased. Whether a frame is the sole owner of a union's box is an ownership-layer fact: it decides whether the bind moves or retains a reference, and says nothing about the payload's region. Ruled out: any owned hand-over inferred from how a plain union was built or used. A match's mode is decided by the subject's type and capability alone, and ruling 27's list of where anisolatedvalue comes from gains no entry. Unchanged: rulings 32-34, and whether a binding match consumes aletunion's name at the ownership layer. A non-linear union held in anisolatedvariable is ruling 40. Breaking change,Fix:open the payload in the arm, or keep the union in anisolatedvariable and match it there (ruling 40); Maxon has novarpayload slot. (Ruling 45 replaces the "Unchanged" line on the ownership-layer consume: a lending match never consumes its subject.) -
A bare match on an un-opened isolated variable moves the union and hands its payloads over as owned (user, 2026-11-16). A bare
matchwhose subject is an un-openedisolatedlocal,isolatedparameter or message parameter holding any union consumes the variable (a later read is E3102); every payload is a fresh owned value, and ruling 34's merge and I4 apply. Inside the variable's ownmodifyblock it is open region data, so the match lends (ruling 39). A union in anisolatedfield or element is a slot, never consumed, and stays under ruling 20. Ruling 32's argument holds because anisolatedvariable is linear (ruling 27), so the consumed union has no alias; the mode is still decided by the subject's capability alone. Amends rulings 10 and 20 for this holder and extends ruling 32. Owed before the compiler changes: a switch in a rule set after fa14; 0 counterexamples under both oracles on every corpus, red-team suite and the self-tests, plus a 20k all-gadget campaign; a new gadget over non-linear unions in isolated locals, parameters and message parameters, matched bare, in their ownmodify, in another window, in a loop and atry, as acondsubject, nested, with ruling 38's lend (refused for a consumed subject), and with the payload stored, sent, frozen, merged and passed twice; a mutation gate (consume off, the oracle reports the hole); a verdict diff against fa14; a fresh red-team round. The compiler already takes the owned path for this holder; what changes is that inside the variable's ownmodifythe match lends. Model rule set core-m3w-fa15 (capmodel 3dfb24c, REPORTFA15, switch ISO-VAR-CONSUME): 0 holes under both oracles on its hand corpus and gadget, and the mutation gate finds the hole with the consume off. Run scoped to ruling 40 at the user's direction; the full corpora ran on fa14. Consequence: a match nested in an arm of a match on the same isolated variable now reads a moved variable (E3102), so ruling 33's nested lend no longer covers this holder (114 corpus programs). This is intended (user, 2026-11-16): the author uses the outer arm's binding, or matches inside the variable's ownmodify, where both matches lend; a nested match after the arm reassigns the variable (W2) is clean. An isolated payload keeps the scrutinee variable's standing against every open window (ruling 41). (Ruling 45: the subject is an un-openedisolatedvariable or temporary, and it is moved at the head whether or not an arm binds.) -
A linear value is isolated only when its type is closed, and an owned payload keeps the standing of the variable it was matched out of (user, 2026-11-16, red team AI).
-
Part 1 (H1). An owned parameter of a linear type, or a
consuming selfreceiver, goes where anisolatedvalue goes (anisolatedparameter, declaration, slot or result, a send,merge) only when its type is closed: every field and payload in its closure is a value, declaredimmutableorisolated, a service handle, a region-less handle ruling 17 counts as clean, or auniqueor linear type that is itself closed. A plain record, array or union, a function value, an interface value or a type parameter is a plain part. An owned linear value of a type that is not closed is ordinary data of its region: matched, finalized, or moved to another plain linear position; anisolatedposition refuses it with the recovery refusal, naming the plain part. One predicate per type decides it, and every door that treats a linear value as its whole region asks it (linear parameter, consuming receiver, linear message parameter; ruling 44 adds the clean-call door). A failed send's hand-back is anisolatedbinding whatever its closure (ruling 45). Why: linearity makes the box unique, not the region closed; a builder may go on naming a plain part (let b = Bx(1); let m = Mp.m1(b); relay(m); b.n = 5). Ruled out: a fresh or isolated payload required at construction; refusing such a type's declaration; windows on every access. A message parameter stays owned because every send checks its argument as a closed region. An owned local of a closed type is the same (ruling 49). -
Part 2 (H3). The payload a consuming match (rulings 32, 40) binds from an
isolatedslot is owned and keeps the standing of the variable it was matched out of. Declared outside the innermost open window, it is an outer isolated value there and is not opened (nomodify, one-call or one-statement open; C-HOLDER, E3199), but still goes where anisolatedvalue goes. The standing is transitive through a payload's payloads; the bare match inside the window stays accepted; plain payloads stay under ruling 34. In general no binding declared inside a window makes an older region a window local: a move into a new local, anisolatedcall result the value was moved into, a hand-back, a match payload. Why: ruling 40's "fresh owned value" means no alias, not born in the window. Ruled out: refusing the bare match in a window; merging the payload into the window at the bind. - Both parts only refuse. Model round 18 (core-m3w-fa16) carries both with H2's may-throw oracle fix, the
fix round's light gates in full under both oracles, a gadget per part, a mutation gate, a verdict diff
against fa15, and a fresh red-team round. A refusing compiler change may land once fa16's gates are at
0 holes. Breaking for source compiled today: H1's
Fix:declare the plain partisolated, or consume the value where it is; H3'sFix:mergethe payload, hand it to anisolatedparameter, or match outside the window. - Model rule set core-m3w-fa16 (capmodel 2fccd44, REPORTFA16; switches LIN-CLOSED and PAYLOAD-STANDING):
0 holes under both oracles on hand_ai7, its hand corpora and gadgets g118/g119; each switch off
reports H1/H3; nothing moves from refused to accepted. Gates narrowed to ruling 41 at the user's
direction. PAYLOAD-STANDING also closes rename-door holes that predate ruling 40 (
let p as isolated = oor an isolated-returning call inside a window, thenmodify p), and refuses opening an I4-recovered plain payload inside another window.
-
Part 1 (H1). An owned parameter of a linear type, or a
-
Six model/compiler disagreements settled, each by the one fact that decides it (user, 2026-11-16).
- A callee keeps a unique parameter only when the value escapes the call: a store into a field, element
or container, a record or union literal (even a local one), a capture, a return, a send or spawn, an
awaitor other consume, or a keeping parameter, judged through every name the callee gives it. A rename (let u = t,var u = t, chains) whose names all die in the callee moves nothing in the caller. Model follows the compiler; it accepts more, so a model switch, gadget, both oracles and a mutation gate. - In its own arm, the matched variable of a union with a unique payload may be lent to a callee that writes through it, when the callee keeps nothing and the statement names no binding of the arm. Every move, copy, keep, send, spawn, reassignment, swap and by-reference pass stays refused; an isolated-payload arm stays a window. Extends ruling 38; accepts more (model switch, gadget, mutation gate).
- A parameter declared
isolatedreaches a plain slot only throughmerge, whoever declares it (function, method, message, factory); E3196 stands. A message or factory parameter of a unique or linear type with no capability word is owned plain data, and storing it is a move. Narrows fa14's MSG-OWNED to ruling 36's wording. With ruling 41, an owned unique or linear parameter goes on to anisolatedposition only when its type is closed. - Inside a window an outer
varis assigned only when it holds a value type (E3204 for records, unions, and isolated, unique or linear variables). Ruling 10 as written; the model follows. - A
mutableparameter of a linear type is by reference by the marker alone, and the callee never moves the value out (E3224). Rulings 14 and 24; the model follows. - SPAWN-NOTHROW with a linear factory argument, REFILL-FRESH through a loop header (one fact, one join),
and VACANT-COPY into a callee that sends are compiler work as ruled (36, 37), each passing the one
crossing check: a value crosses a thread only as the whole of its region (a fresh expression, a
declared-
isolatedvariable, or an owned unique or linear value of a closed type). LIN-PARAM-OWNED lands in ruling 41's closed form once fa16 is at 0 holes. Confirmed:bx.eat(v)(isolated receiver,van un-opened isolated local, a parameter the callee owns) is allowed by ruling 10. Still refused: a non-linear isolated value into an unmarked parameter, a plain linear local beside the opened receiver, and the call inside a window. Model rule set core-m3w-fa17 (capmodel 44a87d5, REPORTFA17; switches RENAME-DIES, ARM-WRITE-LEND, ISO-PARAM-MERGE, OUTER-VAL-ONLY, LIN-MUT-BYREF): 0 holes under both oracles on its hand corpus and gadgets g120/g121; gates narrowed to ruling 42. Assigning between parameter-class locals now moves the value, closing an fa16 hole (var u = t2; u = t; h.k = u). A swap out of, or a by-reference pass of, a renamed local counts as a keep. Item 2's arm-binding exclusion carries the compiler's E3102 but closes no hole the model can see (with it off, the oracle runs the five programs clean). Addendum (user, 2026-11-16): (i) item 4 refuses every outervarthat does not hold a value type (ruling 14's list: numbers,bool, enums,String),immutable, handle and promise variables included; relaxing it is Backlog #127. (ii) Inside a window an outer non-valuevaris not assigned, not swapped, and not passed by reference to a parameter that may replace it: one rule for every rebinding. (iii) In item 1 a swap out of a renamed local and a by-reference pass of one are keeps, and "bound" reads "bound or assigned" (var u = t2; u = t; h.k = ukeepst). Item 2's arm-binding exclusion (E3102) stays on ruling 18's ground (g(r, y: r.file)): a callee cannot know two parameters reach one unique value. Model rule set core-m3w-fa18 (capmodel f36d82d, REPORTFA18): red team AJ (0c6729a) found that a by-reference isolated parameter could be opened inside another object's window; under ruling 41's general rule it is the caller's variable and an outer root in every window of its callee (BYREF-STANDING, C-HOLDER; the compiler had the same hole, E3199 now). The addendum's swap rule is OUTER-SWAP (C-OUTER). Both only refuse; 0 holes under both oracles.
- A callee keeps a unique parameter only when the value escapes the call: a store into a field, element
or container, a record or union literal (even a local one), a capture, a return, a send or spawn, an
-
A lend of a unique payload or element is not a region window; it pauses only its holder (user, 2026-11-16). A
matcharm that lends a unique payload, and aforbody that lends unique elements, open no window when the payload or element is notisolated: outer data stays writable (have(t) then o.n = 5, and a call that writes it). The holder is protected by the rules that name it: the matched variable is not reassigned, rebound, swapped, moved, copied, kept or passed by reference in its arm (rulings 29, 34, 38) and is lent to a writer only as ruling 42 item 2 allows; the container aforlends from is read-only for the whole body, directly and through any callee that needs it writable (rulings 20, 26). The binding is a lent unique value, never kept, stored, moved or sent; its plain parts are ordinary data of the current region. Anisolatedpayload or element still opens a window, and a unique lend nested in a real window keeps that window's rules. Why: a window guards a region boundary, and a non-isolated unique value lives in the current region; the path from the root to the lent value has one name. Ruled out: a full window for such arms; any relaxation of the holder's rules (ruling 42 item 2 stays limited tomatcharms). Consequence: a plain part of a lent unique value may be stored in outer data, which is safe across threads only because of the crossing check (rulings 29, 41, 42; #119). Model: switches for the arm and theforbody, narrow round. The compiler already accepts these; the language reference states the rule with or after the #119 fix. -
A unique argument is a clean input only when its type is closed; reading a plain part out of a lent unique value is not a keep (user, 2026-11-16).
- LEND-CLOSED: a unique argument, lent or kept, is a clean input of a call (ruling 17) only when its type
is closed (ruling 41 part 1's predicate). A call given a unique argument whose type has a plain part is
not a clean call, and its result does not go where an
isolatedvalue is wanted (E3200, the model's C-RECOVER). Evidence:fn stash(t Tq) returns Ko { let o = Ko(Bx(0)); o.keep = t.b; return o }, thenlet k as isolated = stash(q); send k; q.b.n = 3was a region-edge in fa18. Amends ruling 17's clean inputs and extends ruling 41's doors; it only refuses. - Ruling 42 item 1 judges the unique value itself: a plain part read out of a lent unique parameter
(
t.b) is ordinary region data, and storing or returning it is not a keep (a unique part cannot be read out, E3214). Sostashlendsq:let o = stash(q); q.b.n = 3is accepted, andlet k as isolated = stash(q)is refused by point 1. - In a lend from a field path (
match h.u,for t in h.xs) the whole roothis the holder: read-only for the lend, and not passed to a callee that writes it. Ruling 42 item 2's writing lend is of the matched union itself, never of the record that holds it. A path over a cond has every arm's roots as holders, in a for and in every arm of a match (ruling 48). Addendum (user, 2026-11-16): point 3's holder is read-only only where something is lent: in amatcharm that binds a payload (decided per arm; an arm that binds nothing, or names a payload case without binding it, lends nothing) and in a lendingforbody. Corrected (user, 2026-11-16): an arm that binds no payload opens no window whatever the payload's capability; an arm that binds anisolatedpayload is a window (ruling 27's bullet reads "aforormatcharm that binds anisolatedelement or payload"). Point 1's closed unique argument is a clean input only outside a window: not when read from a slot, not an acquired state or reached from one, and not inside an open window (modify,acquire, a one-call or one-statement open, an isolated-payload arm), since a callee may move its isolated or unique parts into a result that would then leave the window.
- LEND-CLOSED: a unique argument, lent or kept, is a clean input of a call (ruling 17) only when its type
is closed (ruling 41 part 1's predicate). A call given a unique argument whose type has a plain part is
not a clean call, and its result does not go where an
-
The fa22 regeneration's six families, and six places the compiler comes to the rulings (user, 2026-11-16). Four decisions each get one point in the compiler: (A) does a match consume or lend, (B) is a variable a guarded root, (C) do two operands of a statement reach one unique value, (D) what standing and capability a new binding takes from the value moved into it.
- In a lending
matchthe matched variable is guarded only in an arm that binds a payload, whatever the payloads; an arm that binds nothing may reassign, swap, pass by reference, move or copy it (amends ruling 29's root guard; model round fa23) (ruling 49: no arm lets the root cross a thread; under ruling 50's call rule). A cond subject's locals stay put in every arm (fa23 refuses what fa22's ARM-BINDS-HOLDER had relaxed) (ruling 48: every arm; the whole root read-only when the union has a unique or isolated payload). - Ruling 40 covers every un-opened
isolatedsubject holding a union, named or not: a variable, an isolated call result, aswap/pop/removeresult, anas isolatedexpression, acondof such values (which moves every isolated variable it names); the temporary takes the oldest standing of what moved into it.match job.stateand a fresh plain temporary still lend (fa23). - Such a bare match moves its subject at the head whether or not an arm binds; a read in any arm or after is E3102 (the compiler comes to ruling 40).
- A lending match never consumes its subject at any layer: only a linear or Reply-holding union or an
un-opened isolated subject is consumed; a plain union and an isolated variable inside its own
modifystay readable. Where the match is the last use the bind still moves (no emitted-code change). - A message or factory parameter with no capability word goes on to an
isolatedposition only when its type is closed (fa23 switch). A failed send's hand-back is anisolatedbinding whatever its closure (maintainer, 2026-11-16), on condition that no plain part read out of it outlives the statement and it is not handed on afterwards; ruling 41 part 1 loses the hand-back door. A bare match on a message parameter with no capability word consumes it, closed or not (ruling 40). - Ruling 42 item 2's exclusion applies when an arm binding's name occurs anywhere in the statement: a bare name, a field or element path root, a receiver, a nested call's argument, a captured name (ruling 18).
- The compiler comes to the rulings, none relaxed: the root consumed inside its own
modify(rulings 10, 29),modifyon a temporary (E3199), a container reassigned inside aforthat lends from it (rulings 20, 26, 43), a unique slot path beside its root in one call (ruling 18), outer linear data consumed inside a window (rulings 10, 42), standing laundered through a union or record literal (ruling 41 part 2). Four compiler defects are confirmed, each bounded by what fa22 accepts: a loop refill of a consumed isolated union variable when every path to the back edge refills it (W2); I4 for parameters and unique payloads;r.fin()afterg(r)withr mutable Rl; a field write counted as a fresh-local read. Model rule set core-m3w-fa23 (capmodel fbcbf1b, REPORTFA23; switches ARM-NOBIND, ISO-TEMP-CONSUME, MSG-CLOSED, HANDBACK-ISO with its condition): 0 holes under both oracles on its hand corpus (169) and three 2,000-program gadgets; each acceptance's guard switched off is caught by the oracle. Red team AN (capmodel 8fcc2b6) found H-AN1 and B-AN1 (a cond inside a field path had no roots); core-m3w-fa24 (capmodel a47457d; COND-PATH-ROOTS and the every-arm guard) closes both with 0 holes; red team AO (capmodel 3d1ac7d) found no hole: core-m3w-fa24 was then the final rule set. An oracle defect (a handler's binding was never ended in the last-use flow) was repaired as O-HANDLERBINDS. Model rule set core-m3w-fa19 (capmodel 02684ae, REPORTFA19) carries ruling 43 and LEND-CLOSED; red team AL (a3c85c3) found acondof unique locals getting past LEND-CLOSED (the compiler refuses it), repaired in fa20. core-m3w-fa20 (capmodel afe717b, REPORTFA20; LEND-CLOSED-COND looks through acond's arms, LEND-CLOSED-KEPT applies point 1 to kept arguments) has 0 holes under both oracles. Red team AM (f6d14f8) found NO hole and no checker bug in fa20: the review loop is closed under the S0 stop rule. Its one conformance gap (two clean-result doors, anasyncstart and a consuming receiver, skipped LEND-CLOSED with no damage, since either needs the variable's moving first read) is core-m3w-fa21 (capmodel e4dc2d6, LEND-CLOSED-DOORS), which only refuses. The model's final rule set is core-m3w-fa21. (Ruling 44: in a lend from a field path the whole root is the holder; LEND-CLOSED is the crossing check this ruling relies on.)
- In a lending
-
A cond subject's roots, found by one structural walk, are holders in every arm (user, 2026-11-16).
- A subject's roots come from one structural walk: a field or element path takes its base's roots; a cond takes
every arm's roots, at any depth (
cond(a, cond(b, h, g), k).u.v, an element path over a cond); a match expression and atry … otherwise <value>merge count as a cond (ruling 47); a call takes the roots of every argument that can reach its result, the receiver included, and a result declared fresh takes none (ruling 50). - In a match or lending
forwhose subject is a cond or a path over one, every root is a holder in every arm, binding or not, when the matched union has a unique or isolated payload: read-only, and not reassigned, swapped, moved, passed by reference or passed to a callee that writes it (ruling 44 point 3 without its addendum); over a plain-payload union the roots only stay put and their fields stay writable. Every arm is judged as a binding arm of the bare form.h.n = 5in a non-binding arm ofmatch cond(c, h, g).uis refused, and accepted undermatch h.u, by design. - This is the root guard only: an arm is a window only when it binds an isolated payload (ruling 27).
- No narrowing to a guard of rebinding only: where a unique or isolated payload can be lent, a root is either a read-only holder or unguarded, and callee writes are per parameter. Model rule set core-m3w-fa24 (capmodel a47457d).
- A subject's roots come from one structural walk: a field or element path takes its base's roots; a cond takes
every arm's roots, at any depth (
-
A held match subject does not cross; an owned local of a closed type is the whole of its region; the arms of a value merge are alternatives (user, 2026-11-17).
- Inside any arm of a lending
match, binding or not and whatever the payloads, every held value (ruling 50) is not the whole of its region: not a send argument, aspawnfactory argument, a reply or any otherisolatedposition, and not a clean input of a call (ruling 44 point 1). A binding the root is moved into inside the arm takes the hold with it until the match ends, at the point that gives a binding its standing (ruling 41 part 2). In a non-binding armtry s.take(u)andspawn Sk.create(u)are E3214, ands.take(idUT(u))is E3200 at the crossing. 45.1's in-thread uses are unchanged. Why: ruling 21 holds the subject across its arms at run time, so a value the sender's match still holds would be reached from two threads. Send before or after thematch. Not decided: letting the root cross from a non-binding arm. - An owned local of a
uniqueor linear type whose type is closed (ruling 41 part 1's predicate) goes where anisolatedvalue goes, with no freshness asked: the frame's own local (not a lent parameter, aforor arm binding, or a slot read), not held (point 1, or a lendingforover it), under the existing window rules (45.7; ruling 44's addendum point 2). The use moves it. Why: a closed type has no plain part, so nothing outside the value names any part of it. Ruled out: freshness oras isolatedfor a unique local to cross; a second predicate at any one door. Model switch OWNED-LOCAL in core-m3w-fa25; no door that refuses today accepts before fa25 is clean. - The arms of a ternary, a
matchexpression and atry … otherwise <value>are alternatives: a linear or unique variable named in several arms is moved once, and the merge moves every such variable any arm names (rulings 23, 45.2).(u if c else u)movesu. Model switch MERGE-ARMS-ALT in core-m3w-fa25. A linear variable moves in its arm under theifrule: every path through the merge moves the same linear variables, whatever the arm's form, so(r.me() if c else r)is accepted andtry make() otherwise ais E3223 ona. The join's roster and the transparent lend (R-c) are for unique values that are not linear; a lent linear merge is a temporary that owns the value. The model's R-LIN-COND lift is widened under #257 (#30, readings R-e to R-g). - Confirmed: ruling 29's stay-put guard binds the root in every arm that binds a payload, plain union included; standing through a union or record literal is 45.7 as written; ruling 42 item 5 covers every consume by the owner after a by-reference pass. Amends ruling 41 part 1; extends rulings 21, 42 item 6, 44 point 1, 45.1 and 47. core-m3w-fa25 (capmodel b97f552) is the final rule set: OWNED-LOCAL, MERGE-ARMS-ALT, HELD-TAKEN-OUT and HELD-CALLEE at 0 holes; red team AP found H-AP1 (ruling 50), AQ a checker bug in the window-shadow identity (fixed, 6b8b5fe), and AR found no hole.
- Inside any arm of a lending
-
The hold of a lending match follows the value, in the frame and through a call (user, 2026-11-17).
- Inside any arm, a value is held when it may be, or may contain, what the match read at its head: a root of the
subject (ruling 48's walk, where a call takes the roots of every argument that can reach its result, the
receiver included, and a result declared fresh takes none:
match a.get(0)rootsa); a binding or holder a held value is moved or stored into (49.1); anything taken out of, or reachable from, a held value (swapon a slot under it,pop,remove,removeFirst,take, and any call a held argument can reach). One predicate. - A held value is not the whole of its region: 49.1's refusals apply to every held value, and 49.2's "not held"
reads this predicate. In a non-binding arm,
swap h.u with vanda.pop()stay legal (45.1) and yield held values; handing one to a send, aspawn, a reply or anisolatedposition is refused. - A call takes a held value only when nothing of it can leave the call except through its result: a per-parameter
fact of the callee, point 1's predicate run over its body with that parameter held. The value leaves when the
callee hands it, or anything taken out of it, to a crossing door or
isolatedposition; stores it outside the parameter's own graph; throws it; lends it to a coroutine; or passes it to a parameter that lets it leave. Returning it is not leaving. A callee with no summary (a function value, an interface method, an opaque body) lets it leave unless the parameter isimmutable. The same for amutableby-reference parameter, a receiver and a plain parameter. - Binding arms and
condsubjects are unchanged (rulings 29, 43, 48); they apply to the roots point 1 adds. Why: a callee is checked alone and cannot see its caller's match. Fix: take the value out, or call the function, before or after thematch. Ruled out: refusing every by-reference pass of a root; a per-local "touched while held" fact; withdrawing 49.2 inside every arm; library methods as primitives. Not decided: ending the run-time hold at the entry of an arm that binds nothing. Amends 45.1; extends rulings 21, 44 point 1, 48 and 49.1. Model switches HELD-TAKEN-OUT and HELD-CALLEE in core-m3w-fa25. The compiler: #235. H1 readings (#30, H-1 to H-7): a value that existed before the expression being resolved began is a root, except along the holder chain: a value read out of a field is part of its holder whenever it was read, for the root walk and for a store into a holder alike (H-10). Every isolated position asks the hold through one check: an isolated declaration, parameter and return, a swap replacement, a store into an isolated slot, an assignment to an isolated variable, and merge; freeze is exempt (H-11). A name that outlives its statement and may be part of another binding's graph either leaves that binding unable to cross, is refused at its binding (E3214), or lives inside a window that nothing held enters (match xon a cell-residentxroots the cell;match self.frootsself); a value's hold is decided when it is minted; "a result declared fresh takes none" means the callee declaresreturns isolated, and only for the root walk: forward, every non-value result takes the hold of a held argument that can reach it; a closure takes the hold of what it captures; anisolatedparameter or return is judged at the isolated-position door, the spawn and reply doors only an unmarked one; a holder takes the hold only from a store the frame makes, and a store through a call is point 3's (H-8).
The interpretations and open questions of the earlier rounds' reports (I19–I90, H9–H27) no longer bind; what the core still needs of them is a rule above.
S0 stop rule (user): red-team rounds continue, one fresh red team per round, until a round finds no hole of any kind (checker bugs included); then the user re-approves spellings and counts and stage A starts. Fix rounds run light gates (every corpus and red-team suite, self-tests, one 20k campaign with all gadgets); the full battery (5×20k, 100k, interleaving sweep, mutation gate, oracle-mutation table) runs once, on the round that comes back clean, before S0 closes.
- Inside any arm, a value is held when it may be, or may contain, what the match read at its head: a root of the
subject (ruling 48's walk, where a call takes the roots of every argument that can reach its result, the
receiver included, and a result declared fresh takes none:
The standing criteria still apply, in order: soundness (non-negotiable), then the fewest annotations, and every check local. The exceptions are call-graph facts the user chose over markers: the may-wait and may-yield bits (ruling 6), parameter and result capabilities (ruling 4). Each is a small fact per function or parameter, conservative where a callee is unknown, never inferred across interface or function-type boundaries (ruling 19), with no tracking of what points to what. Parameter-capability inference is the closest relative of the write inference that failed before, so S0 models it and the red teams attack it first. Breaking changes are made freely. The executable model must report 0 counterexamples, confirmed by independent red teams, before any compiler work begins.
New words: isolated, immutable, mutable (on a value-type, isolated or unique parameter or function-type parameter, and on interface requirements and function types), modify,
freeze, swap, merge, acquire, is unique, is sendable, and a self parameter with a capability. Everything else is today's Maxon
(docs/WRITING_MAXON_CODE.md). "E-new" marks a diagnostic the design adds; its number is assigned at
implementation. Samples marked fragment use types from an earlier sample or from the named file. Comments in
the samples are for this plan only.
Three rules change how ordinary code reads:
-
E3077 asks for
leton any local that is never reassigned, including one whose array is pushed to. Today such a local must bevar. A parameter isletunless markedmutable, and passing avarto amutableparameter counts as reassigning it (ruling 14). -
Records alias freely inside a region.
let b = ano longer movesa, and a closure shares what it captures; both are counted references in one region. E3102 (use after move) stays forisolatedvalues,uniquevalues and sends. - Struct literals stay legal only inside their own type (E3076), so every sample builds through a factory.
typealias Tally = int(0 to u64.max)
typealias Column = function(Counts) returns Tally
typealias ColumnArray = Array with Column
type Counts
export var lines = 0 as Tally
export var words = 0 as Tally
static function create(lines Tally, words Tally) returns Self
return Self{lines: lines, words: words}
end 'create'
end 'Counts'
type Report
let columns as ColumnArray
static function create() returns Self
return Self{columns: ColumnArray.create()}
end 'create'
function addColumn(column Column)
self.columns.push(column)
end 'addColumn'
function render(counts Counts) returns String
let row = StringBuilder.create()
for column in self.columns 'eachColumn'
row.append("{column(counts):8}")
end 'eachColumn'
return row.build()
end 'render'
end 'Report'
function main() returns ExitCode
let report = Report.create()
report.addColumn(function(counts Counts) gives counts.lines)
report.addColumn(function(counts Counts) gives counts.words)
print("{report.render(Counts.create(3, words: 12))}\n")
return 0
end 'main'
-
self.columns.push(column)writes through aletfield. Today that is E3159; after, it is legal: the field is never reassigned, and the array it holds may change. -
let reportandlet roware written through (addColumn,append). Today both must bevar. - Adding
report = Report.create()tomainis refused, as today. Today's wording ("cannot assign to immutable variable: 'report'") is reworded, because "immutable" now means frozen: "'report' is a let and cannot be reassigned".
A program that never shares data between threads, never freezes anything and never builds a separate region writes no capability words at all.
typealias Coord = float(f64.min to f64.max)
typealias FieldNumber = int(0 to 1024)
type Point
export var x as Coord
export var y as Coord
static function create(x Coord, y Coord) returns Self
return Self{x: x, y: y}
end 'create'
end 'Point'
function plot(p Point) returns String
return "({p.x}, {p.y})"
end 'plot'
type Settings
export var field as FieldNumber
export var numeric as bool
static function create(field FieldNumber, numeric bool) returns Self
return Self{field: field, numeric: numeric}
end 'create'
end 'Settings'
let origin = Point{x: 0.0, y: 0.0}
let standard = Settings{field: 0, numeric: false}
function adjusted(numeric bool) returns Settings
let mine = standard.clone()
mine.numeric = numeric
return mine
end 'adjusted'
function broken(numeric bool)
standard.numeric = numeric
end 'broken'
function main() returns ExitCode
let cursor = Point.create(0.0, y: 0.0)
cursor.x = 1.0
let pinned = freeze Point.create(2.0, y: 3.0)
print("{plot(origin)} {plot(pinned)} {cursor.x} {adjusted(true).numeric}\n")
return 0
end 'main'
-
A type carries no capability, as in Verona.
cursoris a mutablePoint;pinnedandoriginare frozen ones. Creating a value makes it mutable in the current region.freeze Point.create(2.0, y: 3.0)needs noisolated: the call's inputs are plain numbers, so its result cannot point into the current region and is a region of its own, whichfreezeturns immutable (ruling 17).freeze cursoris refused:cursorwas written as an ordinary mutable value, so it is part of this region ("'cursor' is used as mutable at line 3; freeze a copy:freeze cursor.clone()").plotonly readsp, so it takescursor,pinnedandoriginalike (ruling 4). A use that keeps or shares the value beyond the call saysp immutable Point: a message parameter, a field of frozen data. -
Module
lets are known at compile time (ruling 30). An initializer is built from literals, constants and record literals, never a call, sostandardisimmutable Settingsimage data and nothing runs beforemain. A record literal is allowed at module scope although E3076 refuses one elsewhere outside its type. -
clone()reads its receiver (inferred read-only) and returns a fresh, mutable copy in the current region. -
brokenis E-new: "cannot write 'numeric' through 'standard', which is immutable".
An unmarked parameter or receiver that the function only reads accepts a mutable, read-only (inside a block) or immutable argument. One the function writes accepts only a mutable argument; one it sends or freezes accepts only an immutable one. Nothing in the source says which; hover shows it (ruling 4).
A method may still declare self as its first parameter with a capability, for the cases inference cannot
express: function submitTo(immutable self, …) exists only on frozen values. self is never written at the
call (table.count()), and the first argument after it stays positional.
| Receiver | Callable on | Inside the body |
|---|---|---|
| (omitted), never written | a mutable, read-only or immutable receiver |
self is read-only; a result reached from self takes the receiver's capability |
| (omitted), written | a mutable receiver |
self is writable |
| (omitted), sent or stored as frozen data | an immutable receiver |
self may be shared |
immutable self |
a frozen receiver only |
self may be sent, stored anywhere, or shared |
typealias RowArray = Array with Row
type Row
export var text as String
static function create(text String) returns Self
return Self{text: text}
end 'create'
end 'Row'
type Table
var rows as RowArray
static function create() returns Self
return Self{rows: RowArray.create()}
end 'create'
function count() returns Count
return self.rows.count()
end 'count'
function first() returns Row
return try self.rows.get(0) otherwise panic("first: called only after add")
end 'first'
function add(row Row)
self.rows.push(row)
end 'add'
function submitTo(immutable self, auditor Auditor.handle)
try auditor.check(self) otherwise ignore
end 'submitTo'
end 'Table'
type Auditor
static function create() returns Self
return Self{}
end 'create'
export function check(table immutable Table)
print("audited {table.count()} rows\n")
end 'check'
end 'Auditor'
function describe(table Table) returns String
return "{table.count()} rows"
end 'describe'
function stamp(table Table)
table.add(Row.create("stamped"))
end 'stamp'
function main() returns ExitCode
let live = Table.create()
live.add(Row.create("a"))
let frozen = freeze Table.create()
print("{describe(live)} {describe(frozen)}\n")
stamp(live)
let mine = live.first()
mine.text = "b"
print("{live.first().text}\n")
frozen.submitTo(spawn Auditor.create())
return 0
end 'main'
-
Inferred, per parameter.
count,firstanddescribeonly read their table, so they acceptliveandfrozenalike.addwritesself, andstamppassestabletoadd, so both take only a mutable table. The function is still checked once and compiled once. -
How it is inferred: each unmarked parameter is a capability variable, and the body is checked against it
with Reggio's "assignment needs equal capabilities". Writing through it, opening an
isolatedvalue inside it, passing it (or a field of it) to a mutable-only parameter, storing it or capturing it makes it mutable-only. Passing it to animmutableparameter or sending it makes it immutable-only. Only reading it leaves it open to any capability (ruling 4). -
Results adapt, inferred. A result reached from a parameter (here
self, throughself.rows.get(0), whose result comes from its receiver) takes that argument's capability, because every return path comes fromself.live.first()is a writableRow, the same rowliveholds, so the program's second line isb;frozen.first()isimmutable Row. A function with one path returningRow.create("x")and another returningt.first()does not adapt: its result is mutable, sotis fixed to mutable-only. If a result comes from two parameters, their arguments must have the same capability at the call;pick(mutRow, b: frozenRow)is E-new ("'pick' returns 'a' or 'b'; they must both be mutable or both immutable here"). -
immutable selfmethods exist only on frozen values.submitTosendsselfwith no move and no copy. A method name is declared once per type (ruling 31), so there is no secondsubmitTofor mutable tables. Interface requirements are read-only unless declaredmutable self(ruling 19), and an interface value carries its capability. -
Errors:
-
frozen.add(Row.create("x"))is E-new: "'add' writes its receiver (line 2:self.rows.push(row)); 'frozen' is immutable". -
function relay(t Table, auditor Auditor.handle)that callsauditor.check(t)makestimmutable-only, sorelay(live, auditor: a)is E-new: "'relay' sends 't' to a service ('check' takes immutable Table); 'live' is mutable. Freeze it first". -
stamp(frozen)is E-new: "'stamp' writes 'table' (it calls 'add', which writes its receiver); 'frozen' is immutable". -
live.submitTo(…)is E-new: "'submitTo' is declaredimmutable self; 'live' is mutable. Freeze it first".
-
-
No markers for readers. stdlib's
Array,Map,SetandStringreaders need none, including the ones that return an element. -
immutableon a parameter means the function keeps or shares it (sends it, stores it in frozen data). It accepts only frozen values: a mutable one could change while another thread reads it. A parameter the function only uses during the call is left unmarked and accepts anything it does not write.
typealias LineNumber = int(1 to u32.max)
typealias DeclarationMap = Map with (String, Declaration)
typealias DeclarationArray = Array with Declaration
type Declaration
export var name as String
export var line as LineNumber
static function create(name String, line LineNumber) returns Self
return Self{name: name, line: line}
end 'create'
end 'Declaration'
type IndexBuilder
var byName as DeclarationMap
static function create() returns Self
return Self{byName: DeclarationMap.create()}
end 'create'
function add(declaration Declaration)
self.byName.upsert(declaration.name, value: declaration)
end 'add'
function lineOf(name String) returns LineNumber
let found = try self.byName.get(name) otherwise panic("lineOf: every name was added")
return found.line
end 'lineOf'
end 'IndexBuilder'
typealias SettledIndex = immutable IndexBuilder
function buildIndex(declarations DeclarationArray) returns SettledIndex
let builder = IndexBuilder.create() as isolated IndexBuilder
modify builder 'fill'
for declaration in declarations 'eachDeclaration'
builder.add(declaration.clone())
end 'eachDeclaration'
end 'fill'
return freeze builder
end 'buildIndex'
-
The index fills a region of its own.
as isolated IndexBuilderdeclares thatbuilderis a region of its own (ruling 15); the initializer's inputs are clean, so it is accepted (ruling 17). Without the declarationbuilderis ordinary mutable data, andmodify builderandfreeze builderare refused. Inside themodifyblock,declarationsis read-only, so each element is copied intobuilder's region withclone(). -
freeze builderturns the whole region immutable, and the result is shared freely asSettledIndex. For a local,freeze,swapand a send consume the binding (readingbuilderafterwards is E3102); the writable-holder rule applies to fields and elements. -
One type, both phases.
lineOfnever writesself, so it works while the index is built and after it is frozen;add(mutableself) is refused on the frozen one. A typealias names the frozen form. -
Alternative: a record that is filled and then published, like the compiler's
SettledDeclarations(SignatureIndex.maxon:17169), keeps the builder in anisolatedfield and the result in animmutableone:self.published = freeze swap self.settled with IndexBuilder.create(). Anisolatedfield never holds frozen data, so there is no in-place freeze of a field.
typealias Tally = int(0 to u64.max)
typealias WordCounts = Map with (String, Tally)
typealias WordArray = Array with String
type WordIndex
var counts as WordCounts
static function create() returns Self
return Self{counts: WordCounts.create()}
end 'create'
function add(word String)
let seen = try self.counts.get(word) otherwise 0
self.counts.upsert(word, value: seen + 1)
end 'add'
function absorb(other WordIndex)
for (word, seen) in other.counts 'eachWord'
let mine = try self.counts.get(word) otherwise 0
self.counts.upsert(word, value: mine + seen)
end 'eachWord'
end 'absorb'
end 'WordIndex'
type Indexer
var index as isolated WordIndex
var filesSeen = 0 as Tally
static function create() returns Self
return Self{index: WordIndex.create()}
end 'create'
function addWords(words WordArray)
modify self.index 'fill'
for word in words 'eachWord'
self.index.add(word)
end 'eachWord'
end 'fill'
self.filesSeen = self.filesSeen + 1
end 'addWords'
function addWord(word String)
self.index.add(word)
end 'addWord'
function takeIndex() returns isolated WordIndex
return swap self.index with WordIndex.create()
end 'takeIndex'
end 'Indexer'
-
var index as isolated WordIndexis a separate region theIndexerowns and can hand off whole.var index as WordIndexvar index as isolated WordIndexwhere the index lives in the Indexer's region, like any fieldin a sealed region of its own changing it self.index.add(word)the same for one call; modify self.indexfor several statementsstoring outside objects into it allowed values and copies only handing it to another service or freezing it alone a deep copy ( self.index.clone()), O(size)swapit out, O(1), no copyMark a field
isolatedonly when that part is handed off or frozen on its own (a batch a service ships, thepagesaDocumentsends to aPrinterin sample 8, an index built and then published). Most fields need nothing. -
New regions are inferred.
WordIndex.create()stored into theisolatedfield needs no marker: a call whose inputs are all values,immutableor movedisolateddata cannot point back into the current region, so its result is a region of its own (ruling 17). -
modify x 'label' … end 'label'opens anisolatedlocal, parameter or field. Inside,xkeeps its name and is writable (the checker tracks the change, as it tracks moves), soself.indexis writable while everything else outside (the rest ofself,words) is read-only.forover the read-onlywordsuses the array's read-only iterator; eachStringis a value, so it crosses in. -
One call opens it implicitly.
self.index.add(word)inaddWordis a one-statementmodifyblock around that call. -
swaptakes the whole region out in O(1). -
Nothing mutable leaves a block. A value leaving a
modifyblock (or an implicit one-call open) by any exit — the end,return,throw,break— must be a value,immutableor a freshisolated. -
What a
modifyblock may change:Writable inside the block Read-only inside the block the modified value and everything it reaches objects from outside the block ( words, the rest ofself)objects created inside the block (they join the region once stored into it) locals declared inside the block outer vars holding values (numbers,bool,String)outer vars holding records (cannot be reassigned)Outside data goes in as a value or a copy (
clone()), so the region never points out and can still be frozen or sent in O(1) afterwards. -
No other coroutine runs inside, and nothing inside waits on another party. A
modifyblock (or one-call open) may notawaita coroutine or a message reply,acquire, or call anything that may wait or may yield; while it is open the green thread does not switch to a sibling coroutine. I/O such asprintjust blocks the strand. -
Errors (all compile-time):
-
self.index.absorb(spare)withsparea mutableWordIndexfrom outside is E-new: "'spare' is mutable outside 'index'; a call into an isolated region takes values, immutable or isolated". - Inside
'fill',self.takeIndex()is E-new: "'takeIndex' needs a writable receiver; 'self' is read-only while 'fill' is open". The same rule refuses reopening, sending or freezingself.indexthere.
-
Services are written as today (spawn, export messages, try … otherwise, sendTimeout:, shutdown).
What crosses changes: a message argument or reply is isolated (moved, O(1), no run-time walk), immutable, a value,
or a handle.
msort's sortedChunks, today (examples/msort.maxon:524-532). Each line is cloned so the chunk has one
owner, and the runtime walks the chunk at the send to check it (exit 96 if not):
var chunk = LineArray.create()
chunk.reserve(share)
for position in first upto stop 'eachLine'
let line = try lines.get(position) otherwise panic("sortedChunks: every position lies inside the input")
chunk.push(line.clone())
end 'eachLine'
replies.push(try sorter.sortLines(chunk) otherwise panic("sortedChunks: a fresh sorter refuses its only chunk"))
After (fragment of msort). The chunk is built in its own region and moved. There is no clone (String
is a value) and no walk:
let chunk = LineArray.create() as isolated LineArray
modify chunk 'fill'
chunk.reserve(share)
for position in first upto stop 'eachLine'
chunk.push(try lines.get(position) otherwise panic("sortedChunks: every position lies inside the input"))
end 'eachLine'
end 'fill'
replies.push(try sorter.sortLines(chunk) otherwise panic("sortedChunks: a fresh sorter refuses its only chunk"))
Reading chunk after the send is E3102: it moved. The spawn at msort.maxon:513 becomes
spawn Sorter.create(freeze settings.clone()): settings.clone() is already a fresh region (ruling 17), and the
freeze is there because Sorter.settings is typed immutable SortSettings, so every sorter can share it.
The service side (examples/msort.maxon:419-443):
type Sorter
var settings as immutable SortSettings
static function create(settings immutable SortSettings) returns Self
return Self{settings: settings}
end 'create'
export function sortLines(lines isolated LineArray) returns isolated LineArray
modify lines 'read'
let rows = rowsFrom(lines, maker: self.settings.keyMaker())
rows.sort(self.settings.comparator())
let sorted = LineArray.create() as isolated LineArray
modify sorted 'write'
sorted.reserve(rows.count())
for row in rows 'eachRow'
sorted.push(row.text)
end 'eachRow'
end 'write'
return sorted
end 'read'
end 'sortLines'
end 'Sorter'
-
settingsis frozen, andkeyMaker()andcomparator()only read it (inferred), returning fresh values. The closures they build capture nothing (function(left Row, right Row) gives left.key.compare(right.key)). -
What needs a marker. A message parameter or reply of a record type says
isolatedorimmutable. Values (numbers,String, enums) and handles need nothing. -
A record sent without
isolated(fragment, against a messageexport function rankRows(rows isolated RowArray) returns isolated RowArray):let rows = RowArray.create() rows.push(current) let ranked = try sorter.rankRows(rows) otherwise panic("rankRows: refused") print("{ranked.count()}\n")rowsis ordinary mutable data of this region, so the send is E-new: "'rankRows' takes isolated RowArray; 'rows' is mutable. Declare itas isolated RowArray, or sendrows.clone()". Declaring it is not enough here:rows.push(current)then opensrowsfor that call, andcurrentis a mutableRowof this region, so the push is E-new: "a call into isolated 'rows' takes values, immutable or isolated; 'current' is mutable. Pushcurrent.clone()".
typealias Money = int(i64.min to i64.max)
typealias EntryArray = Array with Money
type Account
var balance as Money
var history as EntryArray
static function create(opening Money) returns Self
return Self{balance: opening, history: EntryArray.create()}
end 'create'
function canPay(amount Money) returns bool
return self.balance >= amount
end 'canPay'
function change(by Money)
self.balance = self.balance + by
self.history.push(by)
end 'change'
function entries() returns EntryArray
return self.history
end 'entries'
function replaceHistory(entries EntryArray)
self.history = entries
end 'replaceHistory'
export function balanceNow() returns Money
return self.balance
end 'balanceNow'
end 'Account'
function transfer(source Account.handle, target Account.handle, amount Money) returns bool
acquire source, target 'move'
if not source.canPay(amount) 'short'
return false
end 'short'
source.change(-amount)
target.change(amount)
end 'move' otherwise 'stopped'
return false
end 'stopped'
return true
end 'transfer'
function main() returns ExitCode
let a = spawn Account.create(100)
let b = spawn Account.create(0)
let moved = transfer(a, target: b, amount: 30)
let left = try await a.balanceNow() otherwise 0
print("{moved} {left}\n")
return 0
end 'main'
-
acquire source, target 'move' … end 'move'takes both services at once and runs the block. Inside,sourceandtargetname the services' state (Account), not the handles. No message to either runs until the block ends, so the program printstrue 70: no message can see the money in flight. -
One writable at a time. Both states start read-only inside the block.
source.change(-amount)openssourcefor that call, thentarget.change(amount)openstarget. Several statements on one service usemodify source 'debit' … end 'debit'. The block is still atomic, because it holds both services throughout. -
It is an ordinary block. It runs on the caller's green thread; the calling coroutine parks until both services are free, and the thread's other coroutines keep running meanwhile.
return,break,continueandthrowleave it as they leave any block, and every service is released on the way out;return falsereturns fromtransfer. A value leaving it must be a value,immutableor a freshisolated, so nothing mutable from a service outlives the hold. -
transferis an ordinary function.let moved = transfer(a, target: b, amount: 30)waits for its result;async transfer(…)runs it as a coroutine. -
otherwisehandles a stopped service. With(e)it binds which handle stopped. Anacquiredoes not take mailbox capacity, so it has nomailboxFullcase. -
What the block may use from outside: values and frozen data, read or passed in; a
varof a value type, assigned; anisolated, moved in. Outside mutable data is read-only inside. -
Ordered with messages; deadlock-free. A message sent to
abefore the block starts runs before it. Anacquiretakes every service it names at once, and code that holds services never waits (sample 9). -
Names. Inside, each name means its service's state. A handle reached through an expression is bound with
letfirst (let source = self.left). -
The same service named twice is taken once. Since two names may then be one object, states of the same type are treated as possibly the same: holds are kept across a write to either.
-
The states cannot leave.
freeze source,merge source, swapping it, or passing it to anisolatedparameter is refused: the service keeps its state. -
Layout.
otherwisefollowsendon the same line, aselsedoes. -
No mixing between services (fragment of a function over two
Accounthandles):acquire first, second 'mix' first.replaceHistory(second.entries()) end 'mix' otherwise 'stopped' return false end 'stopped'E-new: "'second.entries()' is read-only while 'first' is open; pass a copy:
first.replaceHistory(second.entries().clone())". Whilefirstis open,secondis read-only, and read-only (Accepted spelling, model fa5 Z3:historyCopy()returnsisolated EntryArray,replaceHistory(entries isolated EntryArray)storesmerge entries, and the copy is bound first:let copy = second.historyCopy()thenfirst.replaceHistory(copy); the inline forms are E3201.) data cannot be stored into writable state. The copy goes inline because aclone()is a fresh region only at its own expression: bound first to a local, it is ordinary mutable data of the block, which a call openingfirstrefuses. The check is local to this statement.
typealias Tally = int(0 to u64.max)
typealias PathArray = Array with immutable FilePath
typealias LinesPromise = Promise with StringArray
typealias LinesPromiseArray = Array with LinesPromise
type RunSummary
export var filesRead = 0 as Tally
static function create() returns Self
return Self{}
end 'create'
end 'RunSummary'
function readLines(path FilePath) returns StringArray
let text = try File.readText(path) otherwise return StringArray.create()
return text.split("\n")
end 'readLines'
function countLines(path FilePath, summary RunSummary) returns Count
let lines = readLines(path)
summary.filesRead = summary.filesRead + 1
return lines.count()
end 'countLines'
function readAll(paths PathArray, summary RunSummary) returns StringArray
let reads = LinesPromiseArray.create()
for path in paths 'startReads'
reads.push(async readLines(path))
end 'startReads'
let lines = StringArray.create()
for pending in reads 'finishReads'
lines.append(await pending)
summary.filesRead = summary.filesRead + 1
end 'finishReads'
return lines
end 'readAll'
function countBoth(first FilePath, second FilePath, summary RunSummary) returns Count
let one = async countLines(first, summary: summary)
let two = async countLines(second, summary: summary)
return await one + await two
end 'countBoth'
-
Untied promises go anywhere a value goes.
readAll's paths areimmutable, soasync readLines(path)takes only frozen data and its promise is not tied: it sits in the arrayreads, and the reads overlap. Each awaited result is a fresh region, written intolinesas plain data. -
Sharing is legal, in locals.
countBothshares the mutablesummarywith both coroutines. Each promise holdssummary, so it is tied: it lives only in a local (never in a field or a container), cannot be returned, captured or sent, and is drained by an unconditional consumingawaitbefore the function returns. Every other exit (athrow, an earlyreturn, a propagatingtry) first awaits or.cancel()s each tied promise explicitly, or it does not compile; cancelling a tied promise waits for its coroutine to stop. Anasynccall, a coroutineawaitor a may-yield call inside amodifyoracquireblock is refused. -
A container of tied promises is an error.
reads.push(async countLines(path, summary: summary))is E-new: "this promise holds 'summary', which is mutable in the caller's region; a container cannot hold it. Await it in a local, or pass frozen orisolateddata". -
Returning one is an error (fragment):
typealias TextPromise = Promise with String function describeLater(table Table) returns TextPromise return async describe(table) end 'describeLater'E-new: "this promise holds 'table', which is mutable in the caller's region; await it in this function, or pass an
isolatedor frozen table so the promise may leave". -
Awaiting a coroutine inside an open region is refused at compile time. (
printinsideprintPages'smodifyblock is fine: while a block is open the green thread does not switch to a sibling coroutine, so I/O just blocks the strand.)typealias PageArray = Array with Page type Page export var text as String static function create(text String) returns Self return Self{text: text} end 'create' end 'Page' type Printer static function create() returns Self return Self{} end 'create' export function printPages(pages isolated PageArray) modify pages 'show' for page in pages 'eachPage' print("{page.text}\n") end 'eachPage' end 'show' end 'printPages' end 'Printer' type Document var pages as isolated PageArray static function create() returns Self return Self{pages: PageArray.create()} end 'create' function takePages() returns isolated PageArray return swap self.pages with PageArray.create() end 'takePages' function editWhilePrinting(printer Printer.handle) let printing = async sendPages(self, printer: printer) modify self.pages 'edit' self.pages.push(Page.create("late edit")) await printing end 'edit' end 'editWhilePrinting' end 'Document' function sendPages(doc Document, printer Printer.handle) let pages = doc.takePages() try printer.printPages(pages) otherwise ignore end 'sendPages'A coroutine starts running at its caller's next wait. If the
awaitwere allowed,sendPageswould run there and swapself.pagesout from under the open block. Theawaitis E-new: "cannot wait inside 'edit'; another coroutine could run while 'pages' is open. Await before or after the block". Movingawait printingafterend 'edit'compiles: the edit finishes, thensendPagestakes the pages. -
Unrestricted promises. A promise whose arguments are all
isolated,immutable, values or handles is not tied. It may be stored or returned as today, and sent if its payload type is sendable — unless its function may wait (sample 9), in which case it may be kept in locals, returned and awaited, but not stored or passed. A message's reply promise may be stored (msort'sreplies); awaiting it, or any promise whose origin the function cannot see, counts as a wait for ruling 5.
Fragment, using Account, EntryArray, Money and transfer from sample 7:
type Ledger
var entries as EntryArray
var reviewer as Reviewer.handle
static function create(reviewer Reviewer.handle) returns Self
return Self{entries: EntryArray.create(), reviewer: reviewer}
end 'create'
export function record(amount Money, a Account.handle, b Account.handle)
self.entries.push(amount)
_ = transfer(a, target: b, amount: amount)
end 'record'
export function audit()
let verdict = try await self.reviewer.verdict() otherwise false
print("{verdict}\n")
end 'audit'
export function requestAudit(me Ledger.handle)
try self.reviewer.verdictTo(me) otherwise ignore
end 'requestAudit'
export function verdictArrived(verdict bool)
print("{verdict}\n")
end 'verdictArrived'
end 'Ledger'
type Reviewer
static function create() returns Self
return Self{}
end 'create'
export function verdict() returns bool
return true
end 'verdict'
export function verdictTo(ledger Ledger.handle)
try ledger.verdictArrived(true) otherwise ignore
end 'verdictTo'
end 'Reviewer'
function main() returns ExitCode
let reviewer = spawn Reviewer.create()
let ledger = spawn Ledger.create(reviewer)
let fine = try await reviewer.verdict() otherwise false
try ledger.requestAudit(ledger) otherwise ignore
print("{fine}\n")
return 0
end 'main'
-
No marker. The compiler works out which functions may wait on another party: one containing an
acquireblock, anawaitof a message reply, a send with a nonzero timeout or a latch wait; one calling a function that may wait; one awaiting a promise from such a function.transfermay wait. -
Refused: waiting while holding. A message body holds its own service; an
acquireblock holds what it names.-
Ledger.recordis E-new: "the message 'record' may wait ('transfer' acquires source and target at line 2) while holding its own service". -
Ledger.auditis E-new: "the message 'audit' awaits a reply from 'reviewer' while holding its own service; send the request with this service's handle and handle the reply in another message".
-
-
The request/response shape inside services is
requestAudit→verdictTo→verdictArrived: each step is a message, and none waits. The ledger passes its own handle (me, here frommain) so the answer comes back as a message. A message may also send to its own service to continue later (try me.requestAudit(me) otherwise ignore), which this design allows (today E3136 makes a self-send unspellable). -
Not holding, waiting is fine.
mainholds nothing, so it awaits a reply as today. -
What the inference assumes. Function types and interface requirements never wait: a closure or a
conformer that may wait is refused where it is converted to one, so a call through a function or interface
value never needs whole-program knowledge. A promise from a function that may wait can be kept in locals,
returned and awaited, but not stored in a field or container or passed as an argument, so its await is always
visible; starting one with
asyncin holding code is itself a wait. I/O andsleepare not waits on another party; a send with a nonzerosendTimeout:is one (user, 2026-11-02): holding code sends with the default timeout 0 and handlesmailboxFull.
typealias BytePosition = int(0 to u64.max) implements ElementIndex
function skipSpaces(bytes ByteArray, position mutable BytePosition)
while position < bytes.count() 'skip'
let b = try bytes.get(position) otherwise panic("skipSpaces: position is below count()")
if b != 0x20 'found'
return
end 'found'
position = position + 1
end 'skip'
end 'skipSpaces'
function firstWord(bytes ByteArray) returns BytePosition
var at = 0 as BytePosition
skipSpaces(bytes, position: at)
return at
end 'firstWord'
-
mutablebefore a value type is write access to the caller's variable (ruling 14, user, 2026-10-31).skipSpacesassignsposition, andfirstWord'satis updated. Only the marker makes a parameter by reference; nothing is inferred. -
An unmarked parameter is
let. Writingposition = position + 1in a function that declaresposition BytePositionis E-new: "'position' is a parameter and cannot be reassigned; mark itmutable, or bind a localvar". -
At the call the argument must be a
var(or a writable field or element), not alet, a literal or an expression; passing avarcounts as reassigning it for E3077. Arguments that overlap a by-reference one are E3186. The same marker on anisolatedoruniqueparameter (function refill(batch mutable isolated LineArray)) takes anisolatedor unique local, which the callee may open, swap or replace. -
Inside a block a by-reference argument must be writable there: an outer
varpassed to amutableparameter inside amodifyoracquireblock must hold a value type, as for any assignment to it there. -
Across
async, a by-reference argument is a mutable argument, so the promise is tied (sample 8), and the variable is lent to the coroutine until the promise is awaited: the caller cannot read, write or pass it in between. -
A function type or interface requirement spells it the same way (
typealias Step = function(mutable Count)); a closure or conformer converts only if its markers match exactly.
typealias JobNumber = int(0 to u64.max)
type Job
export var number as JobNumber
static function create(number JobNumber) returns Self
return Self{number: number}
end 'create'
end 'Job'
type Pool uses T where T is sendable and T is isolated
typealias Waiting = Array with T
var waiting as Waiting
static function create() returns Self
return Self{waiting: Waiting.create()}
end 'create'
export function submit(item T)
self.waiting.push(item)
end 'submit'
end 'Pool'
type Stack uses T
typealias Items = Array with T
var items as Items
static function create() returns Self
return Self{items: Items.create()}
end 'create'
function push(item T)
self.items.push(item)
end 'push'
end 'Stack'
typealias JobPoolHandle = Pool.handle with isolated Job
typealias JobStack = Stack with Job
typealias FrozenJobStack = Stack with immutable Job
function queueJobs(pool JobPoolHandle, count JobNumber)
for number in 1 to count 'eachJob'
try pool.submit(Job.create(number)) otherwise ignore
end 'eachJob'
end 'queueJobs'
function stacks() returns (JobStack, FrozenJobStack)
let mine = JobStack.create()
mine.push(Job.create(1))
let shared = FrozenJobStack.create()
shared.push(freeze Job.create(2))
return (mine, shared)
end 'stacks'
-
where T is sendable: a service overTmust be able to send everyT.Pool with Jobis E-new: "'Job' is not sendable; useisolated Joborimmutable Job". -
An unbounded
Ttakes any capability, fixed whereTis fixed:JobStackholds mutable jobs in the current region,FrozenJobStackholds frozen ones that may be shared. -
Generic bodies are checked once against
Twith only its bound's capabilities (an unboundedTis treated as possiblyimmutable: readable, not writable, not sendable), so errors stay at the declaration. This includes a bound at a nested position:Pool with TmeetsPool's bound only whenT's own bounds prove it. Storing aTneeds the destination to holdTat the same capability, whichself.itemsdoes, sopushaccepts whatever capabilityTis fixed to. A value of an unboundedTis never a clean input for ruling 17.
typealias Tally = int(0 to u64.max)
type Stage
export var total = 0 as Tally
static function create() returns Self
return Self{}
end 'create'
end 'Stage'
type Pipeline
var current as Stage
static function create() returns Self
return Self{current: Stage.create()}
end 'create'
function advance() returns Tally
self.current = Stage.create()
return 1
end 'advance'
function step()
self.current.total = self.advance()
end 'step'
end 'Pipeline'
-
Assignments: the right-hand side runs first, then the target path is resolved. Today the old
currentgets the total; after, the new one does (as in Pony and Swift). -
Calls: the arguments run first, then the receiver path is resolved and any region on it opened, so
self.index.add(next())cannot open a regionnext()swapped away. -
A silent breaking change. It gets a RELEASE_NOTES entry, and
scripts/fixpoint.shguards the compiler's own source.
Fragment (LoweredUnit, SourceFile and lowerInto stand for compiler types):
typealias LoweredPromise = Promise with isolated LoweredUnit
typealias LoweredPromiseArray = Array with LoweredPromise
typealias SourceFileArray = Array with immutable SourceFile
type Lowerer
static function create() returns Self
return Self{}
end 'create'
export function lower(file immutable SourceFile, index SettledIndex) returns isolated LoweredUnit
let unit = LoweredUnit.create(file.path) as isolated LoweredUnit
modify unit 'lower'
lowerInto(unit, file: file, index: index)
end 'lower'
return unit
end 'lower'
end 'Lowerer'
function lowerAll(files SourceFileArray, index SettledIndex, lowerer Lowerer.handle) returns LoweredPromiseArray
let replies = LoweredPromiseArray.create()
for file in files 'eachFile'
replies.push(try lowerer.lower(file, index: index) otherwise panic("lowerAll: a running lowerer refuses"))
end 'eachFile'
return replies
end 'lowerAll'
-
What crosses.
immutable SourceFileandSettledIndex(animmutablealias, sample 4) cross with no copy and are readable inside themodifyblock. - Sharing the index is free. Today the same send runs a share walk over the whole index.
S0's survey of the tree (compiler, stdlib, examples, runtime; HEAD 30cd53666a): COUNTED is an exact count, ESTIMATED an enumeration of sites with judgement per site.
| Marker | Where | Count (compiler + stdlib) |
|---|---|---|
immutable before a type |
shared message and factory positions, fields that hold frozen data, type arguments | 25–90 (estimated) |
isolated before a type |
handed-off message and factory positions (38, counted), promise aliases, builders, fields, locals | 45–65 (estimated) |
modify, freeze, swap, merge
|
worker pools, publishes, hand-offs, region filling | 25–45 (estimated) |
mutable self / mutable T / mutable function
|
requirements and function types whose callee writes (ruling 19) | 25–35 (estimated) |
mutable before a value-type, isolated or unique parameter |
parameters the function writes through to the caller's variable (ruling 14) | 3 in the tree (counted) |
acquire |
blocks that update several services atomically | 0 (counted) |
is unique |
stdlib's Promise; the OS-handle builtins (__ManagedFile, __ManagedDirectory, __ManagedSocket, __ManagedPages, __ManagedHandle, __ManagedPin) by rule; the raw-integer owners StreamingSubprocess and SharedSegment
|
3 written (counted); 58 types unique by inference (29 stdlib, 29 compiler, all in Debug/, Profile/, Mcp/, Testing/; counted) |
Against 11–16k for the cancelled Pony design. Not markers, but churn: E3077 flips 9,830 of 12,101 var locals
to let (estimated ±1%); 1,060 uses of the read-only binding keyword (view) become let; 24 overload groups
(17 stdlib, 7 compiler) and 92 field/method name pairs are renamed (ruling 31); 55 module and 5 static lets
built by a call go (ruling 30); 167 spec files declare a module var (873 declarations). No existing name
collides with a contextual word, provided the parser decides mutable bool (a named parameter or payload) by
token count, and reads freeze, merge or swap as the operator only when no ., = or adjacent (
follows it.
The capability is a prefix word on the type (ruling 15): p immutable Table, returns isolated Job, Array with isolated Job,
var settings as immutable SortSettings. The receiver's capability is an optional first parameter (ruling 8).
| Reggio | Maxon | Meaning |
|---|---|---|
| mut | unmarked | a reference into the open region |
| iso | isolated |
the unique reference to a closed region's entry |
| imm | immutable |
frozen, outside every region, shareable, atomic count |
| paused | never written; inferred inside modify/acquire blocks |
readable, not writable, not sendable |
| tmp | never written | inferred for objects local to a block |
| — | unmarked parameter (inferred: any / mutable-only / immutable-only) | a capability variable checked once against its body; an any-capability parameter is fixed to one capability per call; a result whose every path comes from it takes its capability |
Assignment requires equal capabilities, as in Reggio. An any-capability parameter does not relax this: one call fixes one capability.
-
Interface requirements and function types are read-only and never wait unless declared otherwise
(
mutable self,mutable T; ruling 19); conformers and closures are checked against them where they convert. -
Values outside the capability system: numbers,
booland enums.Stringis a copy-on-write value type with a sticky-shared buffer count: plain while it is 1, flipped to atomic SHARED at the first alias, by a freeze walk, or at a send. AStringparameter is aletvalue unless markedmutable(ruling 14): a mutating method on an unmarked one is refused (mark itmutable, or bind a localvarcopy). -
Mutable in the open region: every parameter, receiver, field, payload, return, type argument and capture,
unless marked. A local takes its initializer's capability. Records alias freely inside a region (no move on
let b = a). -
Closures are objects in the capability system. Captures are the closure's fields: a closure is mutable in
the region of what it captures, and
immutableonly if every capture is. A mutable capture returned as a plain record result adapts through the closure value, as a conformer'sselfdoes: mutable through a mutable value, read-only through a read-only or frozen one; a frozen capture stays frozen. Whether a closure writes its captures is recorded on its type: a plain function type promises it does not; amutable function(…)may, and cannot be called throughimmutableor read-only data (ruling 19). A function value is never a "value" for theisolatedfactory,acquireor message rules. -
Defaults spelled out: a send's
sendTimeout:defaults to 0, so a send to a full mailbox fails at once (docs/LANGUAGE_REFERENCE.md:5252-5254) and a self-send cannot block; an interface-typed field is cloneable only if every conformer is, as today (docs/LANGUAGE_REFERENCE.md:5996-6001);Map,SetandListiterators hold their storage across anawaitas array iterators do. -
Settled details: an
isolatedlocal passed to an unmarked parameter is lent for the call (a one-call open); anasynccall never takes one there (ruling 23); an any-capability parameter converted to an interface value adapts like a result; when one of several acquired services has stopped, none is granted andotherwiseruns. -
Module scope: a module
let's value is known at compile time (ruling 30): literals, constants and record or array literals of them, no calls, so every moduleletisimmutableimage data and no initializer runs beforemain. The 55 module and 5 staticlets built by a factory call (mostly shared empty sentinels stored into fields) are deleted, and each use allocates a fresh value instead, as Go does (user, 2026-10-30). A modulevaris refused: none in the compiler, stdlib or examples, but 165 spec files declare one and are rewritten, anddocs/WRITING_MAXON_CODE.md:1155-1156changes. -
Types carry no capability (as in Verona): a value is created mutable in the current region, or as a new
region when built from clean inputs (ruling 17), and becomes immutable only through
freezeor by being a modulelet. -
is unique(ruling 18): never copied or aliased; moves onlet, store and send; lent to a call. -
Message parameters and replies of record type are
isolatedorimmutable. -
Generic bodies are checked once against
Twith only its bound's capabilities. -
Removed: the current read-only binding keyword, and the
keep,readonlyandreturns readonlyqualifiers with their codes (E2076, E3189). Today'ssolequalifier is replaced byisolated.
-
New regions are recovered at the expression (ruling 17) from clean inputs, where an
isolatedposition asks for one; a local isisolatedonly when declaredas isolated T, and is then linear (ruling 27). -
modify x 'l' … end 'l'opens anisolatedlocal, parameter or field of writable data; inside,xis the writable region under its own name (no second name, no rename), and only its contents are writable (the slot holdingxis not reassigned inside). Everything outside is read-only inside, except block locals, new objects and outer value-typedvars. No coroutineawaitoracquireinside; while the block is open the runtime does not switch to a sibling coroutine of the same green thread. -
One-call and one-statement opens: a method call on an
isolatedvalue (including inside anacquire, and on a region nested in an open one), and any statement that reads or writes through one, is a one-statementmodifyblock around that statement (ruling 10). -
Containers of
isolatedvalues: reading an element lends it (it cannot be sent or swapped through that read);remove,poporswaptake it out;forover such a container yields lent elements. -
swap, a send of anisolatedandfreezeneed a writable reference to what holds it. -
Exits: a value leaving a
modifyblock by any exit must be a value,immutableor a freshisolated. -
freeze x(isolated→immutable) reuses the share walk, marks every box SHARED and flips string buffers (ruling 46: in a program that lowers a service start; a value crosses strands only through a service, so in a program with no service startfreeze,SharedValue.publishand a registration mark the concrete records they walk, a conformer held at an interface type keeps a plain count, and E3171 is judged for promises only).merge x(isolated→ mut) moves the region into the open one.swap path with vreturns the oldisolated. - Viewpoint adaptation follows Reggio's Table 2 (a mutable field read through immutable is immutable; through read-only, read-only).
-
Reference counts: region boxes COUNTED (plain);
immutableboxes SHARED (atomic); constantimmutableIMMORTAL. The routing exists (maxon-bin/Compiler/Runtime/MmRuntime.maxon:193-221,:2292-2330). The plain-count invariant becomes: a COUNTED box is in one region, a region is open in at most one window, and anisolatedcrosses threads only through a release/acquire edge (a send, a cown hand-off, a promise result). The send share walks and the__sole_<T>exit-96 walk are deleted. A green thread and itsasynccoroutines are one strand and only a service start makes another (ruling 46), so with no service start a plain count is exact; the compiler asserts at the service-start door that the program was counted as spawning. - E4014 (no type cycles) stays.
Coroutines of one green thread may share the caller's region (ruling 7). They never run at the same instant; the hazards are interleaving at a wait.
-
Tied promises: an
asyncwith any mutable argument returns a tied promise. It lives only in a local (no field or container holds it) and cannot be returned, captured or sent. It is drained by an unconditional consumingawait; every other exit awaits or cancels it explicitly (a compile error otherwise), and a tied.cancel()waits for the coroutine to stop.async, a coroutineawaitand a may-yield call are refused inside amodifyoracquireblock. Local checks. -
No other coroutine runs while a region is open. Inside a
modifyblock (or one-call open) a coroutineawaitand anacquireare refused, and while the block is open the runtime does not switch to a sibling coroutine of the same green thread: I/O blocks the strand instead. Releases never yield (destructors close OS handles synchronously), so a drop inside a block cannot switch either. -
Iterators stay memory-safe across awaits outside blocks: an array iterator holds its buffer and re-checks
the count, so a coroutine that clears the array at an
awaitmid-loop cannot cause a stale read. -
Open regions cannot be reached again. Opening,
swap, sending andfreezeneed a writable reference to what holds the region. Inside an open block everything outside is read-only, so the open region (and its holder) cannot be reopened, swapped out, sent or frozen; only regions nested inside the open one can be opened, and regions form a tree. -
Holds across yields: HoldResolution never elides a hold whose span contains an
await, a park, or a call that may yield. - A coroutine starts at its caller's next wait.
-
H1: values first, then targets and receivers (sample 12); an
isolatedhop requires a block. -
Pending operands (ruling 21): constructor, union-literal, send,
spawnandasyncarguments read from fields are held across later operands that may run user code;matchsubjects across write-back arms. - H2: O2-WB: count the new value, store it, then release the old one.
-
H3: a local reference into an
isolatedregion exists only inside a block, where no other coroutine runs, so the send H3 needs cannot run then; holds across calls that may yield cover the lingering count.
-
A service is a cown.
spawn Type.factory()builds the state as anisolatedregion and wraps it in a cown; the handle is the cown reference and is sendable. Anexportmessage is a behaviour on that one cown. Messages from one sender keep their order. -
Arguments and replies must be sendable (
isolatedmoved,immutable, a value or a handle). One local capability check replaces E3138/E3137/E3135/E3191. -
A message may send to its own service (E3136, which today makes a self-send unspellable, is lifted for it): with no waiting while holding, a send to oneself cannot deadlock, and it is how a service continues a request/response.
-
An
acquireblock (acquire a, b 'l' … end 'l' otherwise 'h' … end 'h') is a BoC behaviour whose body runs inline on the caller's green thread:- it enqueues on every named cown at once (two-phase, address order; duplicates collapsed) and parks the coroutine (not its whole green thread) until all are granted; the hand-off is the release/acquire edge for the states' plain counts;
- states of the same type may be the same service, so holds are kept across a write to either; state names cannot be moved, swapped, frozen, merged or sent;
- inside, every named state is read-only until opened; a method call on one opens it for the call, a
modifyblock for several statements; one is writable at a time (ruling 12); - outside mutable data is read-only inside; value-typed
vars may be assigned;isolatedvalues may be moved in; - every exit releases every cown; a leaving value must be a value,
immutableor a freshisolated; - it is ordered with each service's messages by BoC's spawn order;
- it takes no mailbox capacity; a stopped service runs
otherwise; - any
acquireinside code that holds services is refused (ruling 13); - a dropped promise of a coroutine waiting for a grant leaves the queue; one inside the body runs it to the end.
-
No waiting while holding (rulings 5, 6). The compiler computes a "may wait" bit per function, as the least fixpoint over the call graph's strongly connected components:
- a function may wait if it contains an
acquireblock, anawaitof a message reply or of a promise whose origin it cannot see, a send with a nonzerosendTimeout:, ashutdownthat waits, a latch, registry ordefault-key wait, anasyncof a may-wait function, or an await of a may-wait promise, or calls a function that may wait; - a may-wait promise comes from
asyncof a function that may wait, or from a call returning one; it may live in locals, be returned and be awaited, but not be stored in a field or container or passed as an argument; - function types and interface requirements never wait: a closure or conformer that may wait is refused where it is converted to one (ruling 19), so no fact depends on the whole program;
- an
acquireblock's body and a message body may not wait; the refusal prints the chain; - I/O and
sleepare not waits on another party; a send with any nonzerosendTimeout:is (user, 2026-11-02): two holding services stalled on each other's full mailboxes would otherwise deadlock until the timeout and then fail by timing.
E3139 (await cycles between services) and
ServiceCallCycleCheck.maxonare deleted in stage F, when this rule arrives: no holder awaits. - a function may wait if it contains an
-
Mailboxes stay for messages.
spawn(capacity:),sendTimeout:,mailboxFull/serviceStoppedandshutdownkeep their meaning; the capacity counts messages queued on the cown. -
Runtime:
CownRuntime(3–5k lines, replacingMailboxRuntime1,437 +ServiceLoop679 +ServiceRegistryRuntime511 lines):- each cown has an MCS-style
lastslot; a behaviour is enqueued in two phases in address order, with an atomic predecessor count; - a message behaviour runs on a pooled green thread on the GMP scheduler; an
acquireblock's behaviour resumes its parked caller; - cowns are released when the body ends.
A service's state moves between green threads, which rewrites the "one owning green thread" invariant (
MmRuntime.maxon:2316-2330), therefcount-torturecontrol, and whattests/debug,tests/dapanddebug_gtshow as a service's thread. Only the context switch is per target; park and queue logic is shared; wasm32-wasi answersspawnandacquirewith E3104 throughTargetFacilities, whilefreezeand the stickyStringcount work there. - each cown has an MCS-style
-
What stays: services,
spawn,exportmessages anddefaultservice keys.SharedValue with Tremains the atomic cell forimmutableor value T (over a type parameter, only one boundedsendable: E3171 at a nestedtypealias X = SharedValue with Twithoutwhere T is sendable, E3215 per instantiation; the cell then behaves as the cell over the concrete argument; an inner alias shadows a same-named file-scope alias at every door (type position, static call, from), local to its type);stdlib/OwnerLatch.maxonkeeps working, and its wait counts as a wait.
Hovering a variable, parameter, field or self in VS Code shows its capability at that point:
words — a parameter of 'addWords'
WordArray — read-only while 'fill' is open (mutable outside it)
let frozen — a local that is never reassigned
immutable Table — frozen: read-only, shareable with other threads
table — a parameter of 'describe'
Table, any capability (only read) — called here with: mutable (main:5, live), immutable (main:5, frozen)
-
Where it comes from. Today's hover (
maxon-bin/Compiler/Lsp/LspHover.maxon) infers types from tokens. The checker records, for every binding read, its span and capability (with the open block's label). The LSP project check (LspProjectChecker,LspProjectCheck.maxon:26;docs/CLI_REFERENCE.md:2339-2345) keeps the table per document version, sent asisolated. Hover reads it and falls back to the token heuristics when the latest check is stale or failed. -
Also shown: whether an
isolatedvalue has moved ("moved at line 12"); that a tied promise must be drained; aselfparameter's capability; and, on a function name, whether it may wait, with the chain ("may wait: calls 'transfer', which acquires at line 2").
-
Where capabilities live: a per-value capability column on
IrFunctionbeside the existing tag and name columns, and on parameters inSignatureIndex; not aMaxonTypearm (IR/Maxon/MaxonDialect.maxon:118,export union MaxonType, is interned and matched everywhere). Flow facts (read-only inside a block, movedisolated) sit beside move tracking (MoveSlots.maxon). Checking happens where it does today (Parser,SemanticCheck,Queries). -
Scaling: every new check is per expression or per function, plus the call-graph facts (may-wait,
may-yield, parameter and result capabilities) computed together as one joint least fixpoint
over strongly connected components. The parameter-capability fact extends the parameter-write pass that already
exists (
SemanticCheck.buildParamMutationSummary,:1759, which computeswrittenParamMaskandwritesThroughParamMask; by-reference parameters come from the declaredmutablemarkers, not from inference) with the three-state capability and a per-function "result comes from parameters …" mask. Facts never cross interface or function-type boundaries (ruling 19), so the library cache stays valid. Each stage records arun_scale_testreading. - Runtime and external functions that may return cached records are audited and declared non-fresh for ruling 17; any whose behaviour on its arguments is not known counts as writing every non-value argument.
-
HoldResolution is re-validated in S0 now that
letis not deep andlet b = aaliases; it keeps holds across calls that may yield and across writes to a possibly-same acquired state. -
Deletion coupling:
-
keep the by-reference machinery, driven by the
mutablemarker (ruling 14):ParameterCell.maxon,ArgumentOverlapCheck.maxon(E3186),Parser.byRefArgumentValue(Parser.maxon:96985),Parser.declarationByRefConvention(:96961; it reads the marker),SemanticCheck.buildParamMutationSummary(:1759), thewrittenParamMask/reassignedParamMaskcolumns, andLiteralArgPromotion; -
stage A deletes the inference of by-reference parameters: the token sweep's reassign and forward facts,
closeByRefForwarding, the name-keyed targets, and the inferred function-value and witness masks with their adapters wherever a marker makes them unnecessary (a function type or requirement spells the marker, so a conversion compares markers); -
the kept by-reference pass is seeded from
StorageProvenance:buildParamMutationSummary(… provenanceWrites: provenance.receiverWrites …)(SemanticCheck.maxon:78, consumed at:1782-1785) takes its "written through an alias" seeds from there. Before E2 deletesStorageProvenance, the capability checker supplies those seeds itself (writes through a parameter's aliases are capability facts it already computes), and a spec pins each seed kind; - move
SummaryCallDispatch.instanceIdOfValue(used byParser,LowerMaxonToStd) andReadOnlyRootKind(declared inDeepLet.maxon:6; used byIrFunction,MaxonDialect,Project,Parser) before deleting their files; - E3077's main door is already in
Parser(Parser.maxon:33948); onlyStorageProvenance's one emission moves; E3186 reads the declared markers; - bump the library cache format (
LibraryCacheFormat,LibraryCacheStore.maxon:2); -
HoldResolutionalready treatsawaitas loud (:147,:162);modifyopen andacquirejoin that class.
-
keep the by-reference machinery, driven by the
- Spec re-pins: E3078 appears in 33 spec files (327 occurrences) and E3159 in 42 (288).
Files deleted: StorageProvenance.maxon, DeepLet.maxon, CallbackFlow.maxon,
ServiceGlobalAccessCheck.maxon, ServiceCallCycleCheck.maxon, SummaryCallDispatch.maxon, MailboxRuntime.maxon,
ServiceLoop.maxon, ServiceRegistryRuntime.maxon (after their survivors move). ServiceCompanions.maxon and
ServiceProgramSurvey.maxon are rewritten onto the cown runtime.
Code deleted inside other files: the write facts in EffectSummary (E3064 stays); the
SignatureIndex provenance and send-door columns and their cache codecs (the by-reference columns stay); the read-only binding keyword; the keep/readonly qualifiers.
Error codes deleted: E2076 and E3189 in B1; E3143 in C; E3078, E3159, E3188, E3187, E3135, E3137, E3138, E3140, E3163 and E3191 in E2; E3139 in F when its replacement arrives (S0 confirms each one's meaning before deletion). The local sendability check covers E3140's reply case.
Error codes kept: E3102 (now for isolated, unique values and sends), E3100, E3141 (generalized from
promises to every unique type: copied, cloned or aliased; PromiseType.maxon's copy rules become the
general unique rules), E3142, E4014, E3057, E3059, E3134, E3136
(minus the self-send case), E3164, E3190, E3192; E3077 (a local check that a var is reassigned); E3186
(by-reference overlap over the declared mutable markers).
New compile-time checks:
- a capability mismatch; an argument whose capability a parameter's inferred use refuses (naming the use)
- a body that needs a parameter both mutable and immutable; a result whose return paths disagree with its adapted capability
- a conformer or closure that writes or may wait against a read-only, non-waiting requirement or function type
- an
isolatedread without a block orswap - opening, swapping, sending or freezing an
isolatedwithout a writable reference to what holds it - reassigning an unmarked parameter (the error names the fix: mark it
mutable, or bind a localvar; ruling 14) - a
mutablevalue-type,isolatedoruniqueparameter given alet, a literal or an expression (anisolatedor unique one also needs anisolatedor unique local), or a closure or conformer whosemutablemarkers differ from its function type's or requirement's - reassigning or passing by reference the slot of a value being modified, inside its own block
- moving, swapping, freezing, merging or sending an acquired state or a message's
self - inside a
modifyblock or one-call open: any wait on another party, a coroutineawait, anacquire, or a call that may wait or may yield - a call passing two
isolatedvalues in unmarked positions, or anisolatedvalue beside a mutable argument - an element of a container of
isolatedvalues (or anisolatedunion payload) reached outside a block - a
mutable functionvalue called through frozen or read-only data - a tied promise passed to a parameter the callee keeps
- an
asyncgiven data opened by amodifyblock - a module
letinitializer that acquires - a second declaration of a function name in one scope, or of a method name in one type (ruling 31)
- a write through read-only or
immutabledata - a mutable value leaving a
modifyoracquireblock - an
isolatedfactory given mutable data - a closure captured into a capability its captures do not allow
- a tied value (or an alias of one) stored, returned, captured or sent
- an
acquireblock writing a non-value outervar, or storing outer mutable data into a state - a store from one acquired service's data into another's
- a message body or
acquireblock that may wait (with the chain) - a may-wait promise stored in a field or container or passed as an argument
- an
acquireinside code that holds services (anyacquiremay wait) - a module
var - a message parameter or reply of record type without
isolatedorimmutable - a capability bound violated; a conformer's
selfcapability differing from its requirement's
New runtime checks: none. Every safety rule is a compile-time error (ruling 2).
Proposed during stage B; none binds until reggio.py models it with 0 counterexamples in the campaigns and
a fresh red team. Each amends ruling 4 (and sample 3's "does not adapt" sentence).
- M1 — a result's capability comes only from its source parameters. At a call, the result capability is computed from the arguments at the parameters some return path comes from, never from the other arguments. A per-function bit records whether some return path is not a parameter's data (fresh, local, another source). All source arguments mutable → mutable; all immutable and no other path → immutable; all immutable with another path → read-only; any read-only → read-only; mixed → refused (as today). A mixed return no longer pins its parameter mutable-only.
-
M2 — a join with local data does not pin. A
condortry … otherwisejoining a parameter's data with fresh or local mutable data yields a value judged by M1's rule against the parameter's final class (undecided → read-only); writes through it pin the parameter mutable-only. A join with frozen data stays refused (ruling 29). Call results are settled after parsing (user, 2026-11-02): a call result whose callee's source mask is not yet known is undecided, tied to the callee and its arguments; the sends, stores and writes that need a capability of it are recorded and judged once every mask is known, as parameter classes are. -
M3 — a non-escaping holder does not pin. A record built from a parameter's data that is never
returned, stored, captured, sent or passed to a keeping parameter takes the parameter's capability for
the parameter's data it holds: a write reaching the parameter's data (
reader.bytes.set(…)) pins the parameter mutable-only; a write to the holder's own fields (reader.position = …) pins nothing, since the holder is a fresh record (user, 2026-11-02). A returned holder follows M1; a literal init (Self{managed: managed}) is such a returned holder. -
M4 — storing a
uniqueorisolatedparameter is a move, not a write: it pins no capability class and needs nomutablemarker (ruling 18's "a callee that stores the parameter takes it").
Model result (capmodel REPORTM.txt, 2026-11-03), and the user's decisions:
-
M1 and M2: 0 counterexamples as written. ADOPTED, with M1's added row: when the source is the caller's own undecided parameter, the result is read-only if that parameter's final class is immutable or undecided, and mutable if it is mutable-only.
-
M4 as written: UNSOUND, because it drops the check that a kept unique argument is movable. ADOPTED as M4-ARG: the parameter is unpinned, but at a keeping position the ARGUMENT must be mutable data of the caller (a move); a capability variable forwarded by a keeping caller needs nothing.
-
M3 as written: UNSOUND in two ways. A callee that writes through the holder writes frozen data, and a window's read-only data gets into a fresh record. Clean repairs are M3-ESCAPE (passing the holder to any parameter its callee needs mutable-only counts as escaping) and M3-NORO (a parameter a record is built from takes no read-only argument). ADOPTED (user, 2026-11-03) as the finer M3 plus M3-NORO (capmodel
REPORTM2.txt; 0 holes on every final gate). The finer rule: passing the holder to a callee escapes, and pins the source parameter, only when the callee's writes reach the held parameter's data, or when it stores, captures or returns the holder. Four refinements make it sound:- Reach is a per-class fact. It is recorded for any write that is not a bare write to the parameter's own field: through an alias read back out of the holder, through a derived value, or through a var that may hold the parameter.
- A swap or pop out of a holder's field counts as reaching; what comes out is mixed data of the held classes.
- The fact is transitive through a bare pass-on, and a callee that returns the parameter escapes.
- A
mutable selfmethod is judged by its own facts. Interface requirements, genericTpositions, function-value calls andmutable-marked parameters are conservative and always escape.
The model also fixed M2's join: a mixed variable joined with immutable data is read-only data.
-
M1, M2, M4-ARG and M3 bind on landing only after a fresh red team of the whole set finds nothing.
-
Gate met for M1, M2 and M4-ARG (2026-11-04). The
core-nom3battery had 0 holes (REPORTM4.txt), and red team N round 2 was clean outsideacquire(REPORTRTN2.txt). They land with stage B. M3 lands next, after its own clean red-team round. Theacquirehole is recorded under stage F. M3 lands in E1 (user, 2026-11-08): without it a frozenListcannot be iterated or cloned onceList.first/lastadapt to their receiver (closing a module-letList hole), and no iterator over a frozen user collection compiles. Gate: red team Q against M3 (REPORTRTQ.txt) finds nothing; then the checker implements M3 and the List arms carry their receiver's sources. Q found 3 holes (M3Q repairs), R found 2 more (M3R;REPORTRTR.txt), red team S runs on core-m3r. Closures that build from captures (user, 2026-11-08), Verona's way: a closure is an object whose captures are fields and whose body is checked once against itsselfcapability; a closure whose body builds a mutable record from (or otherwise reaches into a record with) its captures needs a mutableself— it is amutable function, converts only to amutable function(…)type, and ruling 19 refuses calling it through read-only (paused, frozen) data. This replaces the model's blanket M3R-CAPTURES refusal; model switch M3V + a red team confirm it. A closure that WRITES its captures is inferred the same way (user, 2026-11-09; switch M3W). Gate met (2026-11-09): red team S found the iterator-capture hole (M3S-ITERCAP repair); V (M3V) and T (core-m3w = M3Q + M3R − CAPTURES + M3V + M3S + M3W + M5) found NO HOLE (REPORTRTV.txt,REPORTRTT.txt). The compiler implements core-m3w. -
M5 — ruling 21's by-reference overlap counts only operands evaluated BEFORE the write (user, 2026-11-05, under model check). E3186 refuses a local read by an operand evaluated before the by-reference call that writes it. That includes a ternary condition that wraps the call, at any group depth, because the condition runs first. An operand evaluated after the call reads the new value, needs no hold, and is accepted (
print("{a.equals(b, tolerance: slack)} {slack}")). Field-path operands follow the same rule, compared by value. M5 binds on landing only after the model (pending-operand gadgets, values-first order) and a fresh red-team round find nothing. Gate met (2026-11-05):core-nom3m5is clean on the battery (REPORTM5.txt), and red team P was clean (REPORTRTP.txt). M5 lands with stage B. The red team left two checks for the compiler: E3186 must cover a closure or function value'smutable(by-reference) parameters at aninvoke, which the model cannot witness, and a field-path cell read through aforbinding (for e in a P2(e.b, put(e.b))). Scope (user, 2026-11-06): E3186 is per ROOT BINDING, as the model's R21-BYREF is. It counts reads of the cell's own root variable and that variable's field paths, but not other names of the same record (aview, a movedvar). Those names are pending operands, and ruling 21's runtime holds already keep them alive. Tracking which record an alias names would be the provenance dataflow ruling 27 forbids. Write-based lend (user, 2026-11-06): E3186 follows the model's R21-BYREF. A by-reference argument lends its cell only if the callee writes the parameter, directly or by forwarding it to a by-reference parameter that is written (a per-parameter fact over the call graph, computed as a least fixpoint).look(s, b: s)is accepted whenlook'sa mutable Stringis never written. Calls through an interface requirement or function value count everymutableposition as written (ruling 19: no fact crosses those boundaries). Ruling 14's marker still decides that the parameter is by reference.
Each stage lands through /land as one commit with its own documentation (AGENTS.md: docs in the same commit),
its own RELEASE_NOTES entry where Maxon source breaks, a run_scale_test reading, and the seed gate respected.
Emitted-runtime stages need two self-compiles, an x64 and an arm64 arm, and a wasm E3104 path where the feature
cannot run there.
-
S0 — executable model, capmodel rev7 "reggio".
-
Rules: a new
reggio.pyin the capmodel repository (capmodel, local only); it reusesinterp.pyand its oracle. -
The oracle adds: region ids, a window per behaviour and coroutines interleaving in the caller's window;
the static open-region rules (writable holder; no coroutine switch while a block is open); tied values,
consuming drains and joins on exit; holds across yields; the BoC two-phase scheduler with mailbox capacity
and coroutine-level parking; the three count kinds and the sticky
Stringcount; freeze; values-first evaluation and O2-WB; the three-state parameter capability and result capabilities; clean inputs for ruling 17; the may-wait and may-yield bits; one-writable-at-a-time insideacquirewith possibly-same states; closures as objects;is unique; read-only, non-waiting function types and interface requirements. - Detectors: a non-entry edge between regions, a write through read-only or frozen data, change under an iterator across an await, data race, use-after-free, plain count stepped by two threads, deadlock (including services and messages).
-
Features covered: every sample in this plan, inferred read-only parameters and adapting results,
immutable selfmethods, build-then-freeze,isolatedfields, unions withisolatedpayloads,Array with isolated T, generics with capability bounds, interfaces carrying capabilities, closures, coroutines and tied promises, multi-serviceacquire, self-sends, modulelet,SharedValue,mutableby-reference parameters, releases inside blocks (which never yield), containers ofisolatedvalues. -
Corpus: the 314 earlier attacks, H1–H3, every finding of the four plan reviews, the sound controls, and
compiler idioms (pool dispatch, index build-then-freeze,
SettledDeclarations,SpecWorkerPool's drain). - Gates: five 20k campaigns plus one 100k; the mutation gate on every rule; two or more independent red teams until 0 counterexamples; H1–H3 probed against the HEAD compiler (real ones fixed now).
- Survey: collisions of the new contextual words with existing names; markers, build-then-freeze candidates, and every compiler and stdlib message body that awaits a reply or acquires today (each needs the request/response rewrite in stage F).
- Then: the user re-approves the spellings and counts before stage A.
-
Rules: a new
-
A — evaluation order and declared by-reference parameters. Values-first evaluation; O2-WB; parameters are
letunless markedmutable(ruling 14): reassigning an unmarked one is a compile error, and the inference of by-reference parameters is deleted (the 3 tree sites that reassign a parameter mark itmutable; theRELEASE_NOTES.mdentry'sFix:is "mark the parametermutable"). Overloading removed (ruling 31): about 36 same-name groups in stdlib and the compiler are renamed. Independent of the new meaning oflet;fixpoint.shguards the order change. The parse/resolve split (each file parsed once, the parser only collects, resolution after parsing) is designed inparse-resolve-split.md(user, 2026-10-31) and DEFERRED (user, 2026-11-01): B1 follows A directly. Stage A landed as b61c3e3c95. -
B1 — capability syntax and checker. The contextual words;
isolated/immutablebefore types;selfparameters;mutable self/mutable T/mutable function;modify/freeze/swap/merge;is uniquewith stdlib'sPromisedeclared unique (stdlib/Builtins.maxon:112; its rules match today's promise rules, so it lands before E2 makes ordinary records alias). The checker runs withletstill deep-immutable (the old analyses enforce it), so it only tightens. Today'ssole/keep/readonlyqualifiers retire here with their codes (E2076, E3189); the read-only binding keyword goes in E1–E2. Seed: stdlib and compiler source use the new words before any release knows them, so B1 ships a seed shim (scripts/seed-shim/, the same many-declarations case as the existing0001-withdraw-the-stdlib-module-tier…patch). The argument-vs- inferred-capability check runs after parsing (inQueries.maxon), because a parameter's class is known only once the whole call graph is parsed. -
B2 — runtime. The freeze walk, sticky
Stringcounts, the strand guard (a flag read by the scheduler's__gt_strand_next,maxon-bin/Compiler/Runtime/GtRuntime.maxon:466, so a parked strand with a block open does not switch to a sibling coroutine), and synchronous destructors (probably already true:ConsoleRuntimehas no park; S0 confirms which park kinds a block can reach). Emitted runtime: two self-compiles and the wasm path. -
B3 — the inferred bits. May-wait, may-yield, the three-state parameter class and result capabilities, added to
buildParamMutationSummary(SemanticCheck.maxon:1759) as more per-function masks over the same call-graph edges; HoldResolution keeps holds across calls that may yield. Then freeze a new seed (scripts/freeze-seed.sh). -
B1–B3 also carry (user, 2026-11-02, after the stage-B soundness audit):
- the audit's accepted-unsafe gaps, each fixed to its ruling as written:
- a nested
modifykeeps every enclosing window's root open (ruling 2, 10); - results through interface and function values adapt, or are read-only, never fresh (rulings 19, 26, 29);
- ruling 17's audit list of runtime and external functions;
- a direct send with a nonzero timeout inside a window is refused;
-
immutable Tparameters are argument-checked; - indirect calls feed may-yield;
- spawn factories are capability-checked;
- a captured parameter pins mutable-only (ruling 4);
- a nested
- the B-era rulings that no stage named:
- tied promises (rulings 7, 23, 29);
- pending-operand holds (ruling 21);
- the sticky
Stringcount; - ruling 17's by-reference and promise clauses;
- ruling 26's result,
foranditerrules; - the callee side of ruling 24.
The may-wait seed gaps (unknown-origin awaits,
shutdown, latch, registry and default-key waits) stay with stage F.
- the audit's accepted-unsafe gaps, each fixed to its ruling as written:
-
C — services on cowns.
CownRuntimereplaces the mailbox runtime (only the context switch is per target:Targets/X64/X64GtRuntime.maxon:200,Targets/Arm64/Arm64GtRuntime.maxon:130; park and queue logic is shared). Modulevaris refused here, with the 165 spec files that declare one rewritten and E3143 deleted. Noacquireyet. Stage C decisions (user, 2026-11-06), after the scout (scratchpadstageC-scout.md):-
A promise in a service's state is refused. A field of a service type (reached from its state) may not
hold a promise; a message body awaits or cancels its coroutines before it returns. The ~10 specs that keep
a coroutine's promise across messages become refusals (RELEASE_NOTES
Fix:). This keeps every promise on the strand that owns its coroutine, since each message may run on a different pooled green thread. -
static varis refused too, with the same diagnostic as a modulevar(both are globals every thread shares); the 112static vardeclarations in specs are rewritten with the 912 module-varlines. - A pooled runner drains the cown: when a cown has work, one pooled green thread takes it, runs its queued messages in order (a bounded batch), then releases it.
-
The front-end ABI is renamed to cown names (
__svc_spawn,__mbox_*→ names that say cown), touching Parser, SignatureIndex and TargetFacilities. -
The two-phase, address-ordered multi-cown enqueue is built in C (user, 2026-11-06), with its atomic
predecessor count, exercised by a runtime torture until
acquireuses it in F. - A module or
staticvaris a syntax error (AGENTS.md: a removed spelling gets the parser's generic error); the release note'sFix:names the rewrite. E3143 and E3165 are deleted. The promise-in-state refusal takes the next free code after stage B's E3196–E3215. Design: scratchpadstageC-design.md.
-
A promise in a service's state is refused. A field of a service type (reached from its state) may not
hold a promise; a message body awaits or cancels its coroutines before it returns. The ~10 specs that keep
a coroutine's promise across messages become refusals (RELEASE_NOTES
-
After G, before the release (user, 2026-11-06): the model corpus becomes spec cases. S0's attack corpus (the
314 attacks, H1–H3, every red-team finding) is ported into spec cases pinned to capmodel
core-nom3m5's verdict, so CI checks the compiler against the model on every run. It runs with the review and fix pass that follows the last stage (ledger:verona-ledger.md). -
D also turns region tracking on everywhere (stage B finding, 2026-11-04). In stage B the capability checker
runs only where
Parser.regionTracking()is true: stdlib source, any program that declares a region word, a file whose tokens spell region surface (asynccounts), or a draining loop. Every other program relies on the old deep-letanalyses. Round 30 found that tracking the compiler's own program raises about 10 E3208 refusals in compiler code, which ruling 19 says must be fixed: McpServerToolWithin(×6),ShadowRespellingsOf,ClassificationPrinterandLeftoverKeyOf(×2). D fixes them and removes the gate. -
D — region checks,
letread as mutable. The capability checker runs beside the old checks without treatingletas read-only; message parameters must beisolated/immutable; markers in the compiler (SettledDeclarationsasfreeze swapof anisolatedfield into animmutableone;SpecWorkerPool's stored drain promises restructured;FrontEndPool'sadoptcloning from animmutablebaseline; msort and examples). Stage D decisions (user, 2026-11-06), after the scout (scratchpadstageD-design.md):- The
isolated/immutablerule for record-typed values crossing into a service covers message parameters, replies AND factory parameters (E3217, reported at thespawn). - The
SettledDeclarationsfreeze swaprefactor and theSpecWorkerPooldrain-promise restructuring are dropped from D (nothing forces them) and revisited at E2. - Seed: build a seed locally (
scripts/freeze-seed.shon the B/C tree) that should equal what CI's freeze produces, and use it for D's seed chain; D's compiler source may then use the region words without new shims. - No multi-root windows (Reggio opens one region at a time; the user will not go beyond Verona). The compiler's
FrontEndWorker/StdPassWorker replies use per-unit workspaces: the scratch and costs a reply needs live in the
unit's own isolated region, as BackendWorker does; measured with
run_scale_test. The parse writes the index, and a per-file index copy cost +13–26% allocations / +3–11% CPU, so (user, 2026-11-06) D builds a parse-local overlay: workers keep one shared read-only index and the parse writes only into an overlay in the unit's region. After the whole plan, judge the overlay on its measured cost and complexity: the parse/resolve split (parse-resolve-split.md) would replace it, and is done only if the overlay turns out not to be good enough. - stdlib's HttpServer keeps its per-connection ConnectionWorker service; its E3217 (and ~35 http-server cases) stay red until stage F's coroutine-per-connection rewrite.
- The
-
E1 — accept the new
let.letbecomes reassignment-only; the read-only binding keyword is accepted aslet; old E3077 counting stays. Freeze a seed. Stage E1 decisions (user, 2026-11-07), after the scout (scratchpadstageE1-design.md):-
viewis a pure synonym ofletfrom E1 (the parser maps it tolet; its machinery goes dead; E2 rewrites the spelling and deletes the dead code). -
let b = akeeps moving a record local through E1 and E2; alias-instead-of-move is its own change after E2, before G. - E2013 reads "'x' is a let and cannot be reassigned", with a field form ("'f' is a let field and cannot be
reassigned"); loop variables,
matchpayloads and tuple elements use "is a let"; parameters keep their messages. - "Every field
let" makes an immutable aggregate only structurally: every fieldletAND every field type a value or an immutable aggregate (the emitted share walk reads it, so E1 takes two self-compiles). - Coordinator defaults (plan-following): a
letblame becomesrebindOnly, neverunblamed(write facts stay recorded; aletstill cannot reach amutableby-reference parameter, re-coded E3159→E2013); modulelets stay deep until E2 (ruling 30); E3077 newly firing gets a tree sweep and an Unreleased entry; cache format bump; seed frozen byci.ymlfreeze_seeddispatch after landing. -
Module-
letsentinels go in E1 (user, 2026-11-07): once aletfield reads back writable, a moduleletstored into a field could be written through. E1 therefore brings E2's sweep forward: every module and staticletbuilt by a call is deleted and each use allocates a fresh value; storing module-letdata into a mutable place stays refused, so E1 is sound at its commit. -
Module-
letdata isimmutable, and its holders say so (user, 2026-11-07): the ~940 byte-string name constants (let X = b"…") are image data stored into fields and arrays typed plainByteArray(Token.value,NameRoster'sreadonly ByteArrayelements). E1 types module-letdataimmutablein the region checker (ruling 30) and spells the holdersimmutable ByteArray/Array with immutable ByteArray; names built at run time are frozen where they enter such a holder.run_scale_testmeasures the atomic-count cost. Not only module scope (user, 2026-11-07): everyletwhose initializer is a compile-time constant (ruling 30's forms: a literal,b"…", a constant record/array/tuple literal, another constantlet) isimmutableby default — a local,staticor fieldletalike — since its value is image data. Ruling 1 stands (user, 2026-11-07), after weighing "everyletimmutable" and aconstkeyword against Verona/Pony:letmeans not reassigned; only constantlets areimmutableby inference; holders spellimmutable(one typealias for the compiler's name type keeps the sweep small). After the names scout (user, 2026-11-07; scratchpadstageE1-immutable-names-design.md): every inline byte literalb"…"isimmutableimage data like a constantlet(no allocation per use;var x = b"…"then written is refused, RELEASE_NOTESFix:); Map keys and Set elements areimmutableslots (stdlib Map/Set declare them so; inserting a key takes immutable data or freezes). No name typealias (E2015 refuses one over a generic instance, and it would not shrink the diff): holders spellimmutable ByteArray,NameRosterbecomesArray with immutable ByteArray. The lexer holds its sourceimmutableand freezes each name slice;run_scale_testmeasures the atomic-count cost on lex/parse. -
Value-like records (user, 2026-11-07): a record type whose every field is
letand a value type (or itself value-like) —FilePath,LogLevel,LimbSlots— counts as a value for capabilities (ruling 29 extended):immutable/isolatedover it mean the type itself, it needs nofreezeto enter an immutable slot, and a send shares it like aString(crossing threads it still goes through the share walk / an atomic count, so a plain count is never stepped by two threads). This holds in a tuple element too:(immutable P, W)is the type(P, W)(#98 rule 6). Precisely (#98 rule 7): a value type is a type naming no record, a byte record, or an immutable aggregate, which is a record whose every field is alet, or a union, where every field or payload is a value type, another immutable aggregate, or a slot declaredimmutable; aPromisetoo. A service handle and aSharedValueare not values. Model-check note owed to the after-plan review. - Mixed-source results are read-only (user, 2026-11-07): an unmarked result whose return paths mix frozen data (including the function's own frozen data, e.g. a SharedValue-held base) with mutable data is read-only (paused) for the caller, extending M1's "all immutable with another path → read-only" to internal frozen sources (instead of E3209). Model-check note owed to the after-plan review.
-
-
Stage E2 decisions (user, 2026-11-10; scout scratchpad
stageE2-design.md): all 14 scout recommendations — strict E3077 (moved-out vars included); SummaryCallDispatch gutted toCallResolution.maxon; E3159's by-reference refusals → E2013; KEEP E3140 (until F) and E3187; E3135's promise/function-value/opaque-T arms stay refused as E3217-family; call-built module lets → per-call functions + a call-free module-letrule (one new code); retirereadonly;let b = astays a move; delete the sole walk + exit 96 only (share walk stays forfreeze); keyword-blind checker; SettledDeclarations / SpecWorkerPool refactors stay dropped; new rules fold into existing codes; alias-write seeds fromParamSources. Sticky counts land in E2 (user, 2026-11-11): deleting the sole walk exposed that B2's stickyStringcount was never built; E2 implements it (String buffers and OS-handle boxes flip to atomic SHARED at first alias, freeze or send). Exit 96 stays for the share walkfreezeuses. E3220 = a call in a module/staticletinitializer. A unique value passed toasyncis lent until drained (user, 2026-11-11), local or parameter alike, by the same mechanism as a by-reference argument (ruling 29): the caller cannot read, close or pass it until the promise is awaited or cancelled. A server is stopped by.cancel()on its serving promise, not by a concurrentclose(). -
E2 — flip and delete. LANDED 2026-11-11 as f9536894c4 + seed pin 77a5ff8b84.
var→letand the read-only binding keyword→letacross the tree; the new E3077; modulelets known at compile time (ruling 30), the factory-built sentinels deleted and allocated fresh at each use; every analysis, code and walk in "Deleted" goes except E3139 andServiceCallCycleCheck.maxon, which stay until F; specs re-pinned; cache format bumped. -
F — OPEN HOLE TO DECIDE AND MODEL FIRST (red team N, 2026-11-04; capmodel
REPORTRTN.txt,redteamN/hole1min.txt):acquire s { let m = s.r s.r.b = 1 return m.b }is accepted.mis a read-only view of the state's data, and the one-statement open then writes it, which breaks the paused-view rule. The pre-amendment model has the same hole, and M1 widens it topick(s.r, 0). There are two candidate repairs: (a) a read of a closed state's field is a one-statement open, and itsletresult must be able to leave it; (b) opening a state is refused while a read-only local taken from it is live. The user decides before F begins, and the chosen rule passes the model and a fresh red team first. Chosen (user, 2026-11-11): (a). Reading a closed acquired state's field is a one-statement open; its result follows the window rule (only a value,immutableor a freshisolatedoutlives the statement), solet m = s.rof a record field is refused (read the field needed, or.clone()). Model it on core-m3w, then a fresh red team. Extended (user, 2026-11-11), after soundness review W: a call that reads a closed acquired state (s.peekR()returningself.r) is the same one-statement open, so its result must be a value,immutableor fresh to outlive the statement; ruling 27's "a call that only reads a state opens nothing" is amended accordingly. Stage F decisions (user, 2026-11-11; scout scratchpad stageF-design.md): D1–D16 adopted as recommended (Log/TraceCapture send with timeout 0 to a large-capacity handler,errordoes not await, panic/exit flush; sample 7's fix is a method returning a copy; factory bodies are holders; the may-wait-promise storage rule is dropped; one new code E3221 for a message or factory body that may wait; a cancelled parked acquirer is released without running the body; the strand guard covers the block; interface handles refused inacquire; stopped = closed at enqueue or freed at grant; a literalsendTimeout: 0is not a wait;(e)is the stopped name's 0-based position; LSP checks single-flight per root; torture at scale). Ruling 19a (user): a requirement or function type whose conformers may wait declares a trailingwaitseffect clause, placed likethrows(function handle(exchange HttpExchange) throws HttpServerError waits,typealias Job = function(Row) waits; order:returns,throws,waits; likethrows, it states what a call MAY do — the language reference says so once for every effect clause); a call through it is a wait and a yield from the declaration alone, refused in message, factory,acquire,modifyand one-call opens; any conformer converts to awaitsposition, awaitsvalue never converts to an unmarked one; service interfaces andexportmessages may not use it. A behaviour on no cowns (user, Go's goroutine model): a task with its own green thread, sendable arguments, holding nothing, so it may wait; its promise is storable and awaiting it is a wait;servespawns one per connection (multi-core, handlers may wait). 19a and the no-cown task are model-checked before they land. Task semantics (model round 4, capmodel REPORTFA3W; user 2026-11-12): starting a task is a send-like non-wait (a holder may start one, not await it); arguments sendable; the promise is storable; dropping it cancels the task cooperatively at its next wait; no detached tasks. T1 (user): a task promise may not cross into a message argument or a service's state, so no task-to-task await cycle can form (costs the acceptor idiom). Model round 5 adds T1 and closes red team X's X1 (a statement that opens one acquired state and reads another is two states in one statement, ruling 29). Task type (user, 2026-11-12): a task's promise has its own stdlib generic typeTask with T(task f(x)starts it — a contextual word likeasync, user 2026-11-12 — and yields it); aPromiseconverts to aTaskat an outermost flow, never the reverse; no message argument, factory parameter, service state, generic argument or interface-implementing record may contain aTaskat any depth (T1-CROSS, capmodel core-m3w-fa3w2, REPORTFA3W2). Reply promises stay ordinaryPromises. The LSP project check becomes a task (its own strand, may wait), replacing the coroutine that starved the session loop. SUPERSEDED (user, 2026-11-12): no task concept and nowaitsmarker — "this is why we have services". Ruling 19a, the no-cown task, T1 and the Task type are withdrawn. Request/response from a handler uses continuations (Verona/Pony): a handler sends its request with its own handle and the reply arrives as another message; ruling 5 holds unchanged,HttpHandler.handlestays non-waiting. X1 (one acquired state per statement) and repair (a) stand. Signal: withdrawn (user, 2026-11-12). No Signal primitive. Checker as a service (user, 2026-11-12, supersedes the on-demand coroutine): the LSP checker and resolver are services. The compile driver uses continuations at its two pool joins (FrontEndPool, StdPassPool): the pools take a reply-to handle and sendbatchDoneinstead of being awaited, and the driver is a service with phase states. The CLI compile runs the same driver service, with main awaiting its final reply, so there is one driver. Superseding is a SharedValue generation read; single-flight comes from the mailbox order; the cooperative yields and the poll go. Relay reload via LSP file watching (user, 2026-11-12): LspRelay's 500 ms slot poll goes. The server registersworkspace/didChangeWatchedFilesfor the slot path, and a change event re-attaches the binary (run buildrenames atomically, so the two-poll settle goes too). A client without dynamic watcher registration gets no hot reload, and the relay says so once in its log. Lands with the checker-as-service round. HttpResponder (user, 2026-11-12): a handler that must consult a service answers through a continuation.exchange.respondLater()returns a unique, sendableHttpResponderholding the ConnectionWorker's handle; any service that holds it callsresponder.respond(response), a send with timeout 0 (not a wait), and the worker writes the response.HttpResponderis MUST-USE like a promise (ruling 7): on every path, throws and early returns included, it is answered or passed on, and a failed send hands it back inotherwise. A holder that crashes or is shut down drops it, and that case answers 500 through a service-release hook (the worker's last handle dropped runs its release, which answers 500): a new concept, designed, model-checked and spelling-approved before it lands. Finalizers and linear types (user, 2026-11-12; supersedes the release hook and the 500-on-crash answer): adestruct selfstatement ends a value's life; any function containing it is a FINALIZER and takesconsuming self(the call moves the receiver). A type with at least one finalizer is LINEAR and implicitly unique (so is any type holding one, by the field rule): on every path, throws and early returns included, each value is consumed by exactly one finalizer call or moved on, or it is a compile error. Any type may declare finalizers. A linear value lives only in locals, parameters and message arguments, never in a field, container, closure capture or service state, so no run-time drop exists and no finalizer is chosen by the runtime. A failed send hands a linear argument back inotherwise. HttpResponder'srespond/respondWithare its finalizers; a service consulting others carries the responder in each continuation message. Model-checked before it lands. Deferred reply (user, 2026-11-12): any message may answer later:reply.later()inside a message body yields a unique, sendableReply with T(T the message's reply type), and the caller's ordinaryawaitresolves when some service callsreply.answer(value)(a send with timeout 0, not a wait). A Reply may be stored in service state while continuations run; dropping it fails the caller's await withserviceStopped, as a stopped service's reply does today. This lets non-service callers (main, the LSP session, spec and MCP workers) await a service chain's result: the CLI compile and the project resolver run on the one driver service. Model-checked (liveness of a stored, never-answered Reply; deadlock with ruling 5) before it lands. Service handle cycles (user, 2026-11-12): E4014 extends to handles: a service type's state may not reach a handle to its own type, directly, through other service types, or through an interface's conformers (a cown refcount cycle never frees and the leak gate exits 101). It over-approximates as E4014 does; the cure is passing the handle per message (continuations) or distinct types. Model fa6 (capmodel 7a654c9, REPORTFA6; user 2026-11-12): 0 holes. Added by the model and adopted: R-DEFER-HOLD (a Reply never leaves holding code: no message reply, promise payload,asyncargument,acquireexit or function result to a non-holder; without it a Reply returned to main deadlocks), no linear value live across any wait, a linear record field refused (only union payloads inherit linearity), a linear argument always moves, a try handler sees every move;asyncwith a linear argument stays refused (user). A stored-forever Reply is a liveness hang, not a hole. Review AB runs on fa6. Round 6h decisions (user, 2026-11-13): library tokens and parses are a FROZEN shared cache (one immutable copy per process, each owner keeps a mutable memo for project files only); a hardware fault drains queued Log records synchronously (no park, no service) before dying; a stdlibSlot with Treplaces the array-of-one idiom. Cooperative cancellation (user, 2026-11-13; Go's model): no coroutine is ever torn down mid-frame. Cancelling (.cancel()or dropping the promise) marks it:sleepreturns early, I/O and waits fail with a cancelled error, and the coroutine runs to completion through its own code paths, whose throw paths already consume every linear value (L3). Landing (user, 2026-11-13): stage F lands once its landing gates pass; model review AE's holes H1–H4 (handle cycle through a generic at a type parameter; match windows over linear or Reply unions with an isolated payload; a match or for over a read-only scrutinee) are fixed in the model (fa10) and the compiler as the immediate next landing, and the review loop continues. H2 by owned move (user, 2026-11-13): a linear or Reply-holding union consumed bymatchyields its isolated payload as a fresh owned value (the union is dead, no alias), so no match window opens for an owned payload; the model (fa11) is aligned to the compiler. Review AF (user, 2026-11-13): F1 (a match nested in an arm of a match on the same union, two read-only lends of one payload) is sound: the oracle's allowance counts enclosing match windows, no checker rule. The wrong refusals W1-W4 are relaxed: a message may match its own linear or Reply union parameter (W1); an owned arm may reassign its matched variable once the payload is consumed (W2); a linear union in an isolated variable may be matched (W3); overwriting a linear union variable that holds a non-linear case is not a drop (W4). Model fa12, then a fresh review; the compiler follows. Review AG (user, 2026-11-14): F1 (a plain payload of an owned isolated union stored into an open window) is an implicit merge: a consumed isolated union's payloads are all fresh owned values, and storing one into an open region merges its dissolved region. F2 (a unique matched variable moved or copied in its own lent arm) is refused, per ruling 29. AG's forced-failure oracle (hand-back handlers exercised) joins the standing gates. I1-I4 are relaxed: a match in a try whose handler cannot run is not a drop (I1); a var union reassigned in a try body and its handler (I2); a fresh unaliased plain local recovered into an isolated declaration (I3); a plain owned payload stored where an isolated payload may go (I4). Model fa13, then a fresh review. -
F — the
acquireblock. LANDED 2026-11-13 as 0a5202d2b6 + seed pin a5fae8e0b5.acquire, one-writable-at-a-time, the may-wait bit, no waiting while holding, self-sends, E3139 andServiceCallCycleCheck.maxondeleted. S0's survey found no message body that awaits directly; two wait through a whole in-process compile (LspProjectChecker.check,LspProjectCheck.maxon:38;LspProjectResolver.resolve,LspArrivals.maxon:40). They become coroutines of the LSP session loop, holding no service, and "still wanted" (requireStillWanted,Project.maxon:13000) becomes aSharedValueread instead of a message round trip, as Go would use an atomic or a context (user, 2026-10-30).HttpServerserves each connection with a coroutine, not a service message, so a handler may await services; the shared handler isimmutableand mutable state lives in a service it calls (Go's net/http; user, 2026-10-30).Log.errorsends withForeverMsand awaits (stdlib/Log.maxon:314-320), so a message body that logs an error would wait (none does today); howLog.errorchanges is decided in F. - G — hover. The per-read capability table and the hover text.
- Release.
After approval, the plan file is renamed verona-regions.md. Memory is updated: the cancelled-Pony memory gets
these rulings and the two reversed let memories are marked superseded.
- S0: campaigns and red-team reports with 0 counterexamples and every mutation killed.
- Every sample in this plan becomes spec cases, with its output or E-new pinned, in the stage that introduces its feature. A sample that shows both a working program and a refused function becomes two cases: the program, and each refused function as its own case.
-
Per stage: spec cases RED-then-GREEN through
mcp__maxon__run_spec_test, filtered; one self-compile (two when the stage changes emitted runtime);scripts/fixpoint.sh; the seed chain (seed → C1 → C2); the wasm lane;run_scale_test; CI on every target after push. -
End to end:
- H1/H2/H3 repros and
evidence/promiserecover2.maxonrefused at compile time or correct at run time; - each review finding's program (see below) refused or correct;
-
acquireordering against messages, and the may-wait refusal with its chain; - the leak gate (exit 101/75) clean;
- LSP tests pin the hover text for a binding outside a block, inside one, frozen, an inferred read-only parameter, and moved.
- H1/H2/H3 repros and
-
Docs: each stage updates its own sources (
docs/LANGUAGE_REFERENCE.md,docs/MEMORY_MANAGEMENT.md,docs/WRITING_MAXON_CODE.md, the registry text,docs/CLI_REFERENCE.mdfor hover) and regenerates the site. Indocs/WRITING_MAXON_CODE.mdthese change: line 383 (E3077's definition), 428 (let x = 42 // immutable), 440 ("Usevarfor any variable you call mutating methods on"), 1155-1156 (modulevar), 1183-1200 (the Memory Model section) and 1255 (Style: "varonly where … mutated"). - Documentation is tested by a reader. After the docs for a stage land, a fresh agent that has read only the published pages (not this plan, not the compiler) writes a set of programs using the stage's features — including ones it expects to be refused — and predicts each outcome. Every wrong prediction is a docs defect, fixed in the same stage.
The model is new to most readers (Verona's regions are research), so the site needs an explanation, not only a
reference. Generated pages are never edited directly: each comes from a docs/ source or the error registry,
and node website/scripts/sync-docs.mjs regenerates them (website/MAINTAINING.md, "Content sync"); a new
language page means a new ## section in docs/LANGUAGE_REFERENCE.md, an entry in the script's SOURCES map,
and the page file with its front matter.
| Page | Source | What it holds | Stage |
|---|---|---|---|
new language/regions ("Regions and capabilities") |
new ## Regions and Capabilities in docs/LANGUAGE_REFERENCE.md
|
The explainer: what a region is (one entry, nothing points in, with a diagram of the current region, a separate region and frozen data), why it makes sends and freezing O(1) and counts plain; the current region; isolated and immutable; modify and what it may change; freeze; inferred parameter capabilities and adapting results; inferred new regions; when to mark a field isolated; is unique; mutable self / mutable T on interfaces and function types; what hover shows. Every example is a spec case. |
B1, extended in D–E2 |
language/memory-model |
## Memory Model |
Rewritten: let means "not reassigned"; records alias inside a region; the three count kinds; module lets known at compile time (image data); what replaced deep let. |
E1–E2 |
language/variables |
its ## section |
let / var under the new meaning; E3077's new rule. |
E1–E2 |
language/async (services, coroutines) |
the concurrency sections | Services on cowns; what crosses a message; the acquire block with the transfer example; one writable at a time; no waiting while holding and the request/response pattern; coroutines sharing data, tied promises, no coroutine waits inside modify. |
C, F |
language/functions |
its section |
let parameters unless marked mutable (a mutable value-type, isolated or unique parameter is by reference), read-only parameters, immutable self. |
A, B1 |
cli/error-codes |
ErrorCodeRegistry.maxon doc comments |
Every new code: what it means, a refused example and its fix. Deleted codes removed. | every stage |
cli/editor |
docs/CLI_REFERENCE.md, Editor Support |
The capability hover. | G |
best-practices/writing-maxon-code (also the MCP instructions) |
docs/WRITING_MAXON_CODE.md |
The rules an AI author needs: when to write isolated/immutable, modify, acquire; the common refusals and their fixes; the Memory Model section rewritten. |
every stage |
getting-started/tour |
tour.mdx (hand-written) |
A short step: build a batch, send it to a service, move money between two services with acquire. |
F |
release-notes |
RELEASE_NOTES.md |
Each stage's breaking changes with their Fix: lines. |
every stage |
| new blog post at the release |
website/src/content/docs/blog/ (hand-written) |
Why Maxon moved to regions: the two failed approaches, what Verona contributed, what code looks like now, the migration. | Release |
docs/internals/ shared page |
new docs/internals/regions.md
|
For compiler contributors: where capabilities live, the inferred bits, how modify and acquire are checked. |
B1, F |
| Finding | Answer |
|---|---|
| Soundness C1: a message awaiting a reply deadlocks against a multi-service acquire | Rulings 5, 6: no waiting while holding; E3139 deleted |
| C2: a tied promise outlives the block that opened its data | Tied values drain before that block ends |
| C3: who "already holds" a service | Ruling 13: any nested acquire refused at compile time |
| C4: closures outside the capability system | Closures are objects; captures are fields |
H1: is immutable (dropped) built from mutable fields |
is immutable dropped (types carry no capability, as in Verona) |
| H2: H1 through receivers and the one-call open | Arguments first, then receiver path and open |
| H3: one-way region tags | Ruling 12: one writable at a time; no tags |
H4: escape from a block by return/throw
|
Leaving values must be values, immutable or fresh isolated
|
| H5: the same service twice | Duplicates collapsed |
| M1: adapting-result arguments, overloads, interfaces | One capability per call; interface requirements read-only unless declared mutable self (ruling 19); interface values carry their capability |
| M2: H3 needs a "may yield" fact | Second inferred bit for HoldResolution |
| M3: nested open regions at freeze/send | Static: freeze/send need a writable holder; no sibling coroutine runs while a block is open |
| M4: mailbox room and cancellation |
acquire takes no capacity; dropped waiters leave the queue |
| M5: change under an iterator across an await | No coroutine await inside a modify block; iterators hold their storage elsewhere |
| Feasibility: S1 runtime-only stage | Folded into B and C |
| Feasibility: S4b not seed-clean | Split into E1 / E2 around a seed freeze |
| Feasibility: deletion coupling | "Implementation notes" |
| Feasibility: per-call check copies superlinear | Gone (ruling 12); read-only parameters compiled once |
| Feasibility: docs in a separate S5 | Each stage's docs in its own commit |
| Consistency: stale wording, sample errors | Rewritten throughout |
| Round 2 C1: a read-only parameter sent or stored as frozen | Ruling 4: three-state capability variable (any / mutable-only / immutable-only) |
| Round 2 C2: a result claiming the wrong capability; by-reference reassignment | Ruling 4: every return path must fit; ruling 14: a by-reference parameter is declared mutable, never inferred |
Round 2 C3: "fresh" results that are not fresh (immutable results, unbounded T, clone with closures or isolated fields, await, runtime caches) |
Ruling 17: result must be mutable; clean inputs defined; audited runtime functions |
| Round 2 C4: holding code starting a coroutine that waits | Rulings 5, 6: async of a may-wait function is a wait |
| Round 2 H1: missing writes (opening, by-reference fields, string fields, externs) | Covered by the capability variable; externs conservative |
| Round 2 H2: whole-program facts vs separate compilation | Ruling 19: requirements and function types read-only and non-waiting unless declared |
| Round 2 H3: aliases of isolated locals | Rulings 17, 27: an isolated local is declared and linear |
| Round 2 H4: releases yielding inside a block | Destructors synchronous; no sibling-coroutine switch while a block is open |
| Round 2 H5: duplicate services at run time | States of the same type treated as possibly the same; holds kept |
| Round 2 H6: tied containers, throw paths | Consuming drains, aliases tied, join on any other exit |
Round 2 H7: isolated in containers; stealing acquired states |
Lent element reads; acquired states and a message's self cannot be moved |
| Round 2 M1–M7 | Equal-capability stores; no overloading (ruling 31); joint fixpoint; coroutine-level parking; iterators hold their buffer; only contents writable in modify; may-wait list completed |
| Accuracy review: blocking sample errors, E3139 staging, citations | Samples 4, 6, 8, 10, 13 fixed; E3139 kept until F; citations corrected |
Fable 1: reply await inside modify while a sibling is granted a service |
Ruling 2: every wait on another party, and every may-wait call, refused inside a block |
| Fable 2: a callee that awaits a coroutine, called inside a block | Ruling 6 defines may-yield; such calls refused inside a block |
| Fable 3: adapting results escaping through function types and interfaces | Ruling 19: refused for function types; through an interface the result takes the value's capability |
| Fable 4: closures writing their captures through frozen data | Ruling 19: mutable function(…); plain function types promise no capture writes |
Fable 5: a lent isolated element surviving pop/send |
Ruling 20: elements reached only inside a block; container read-only for the span |
| Fable 6: a tied promise taken by a callee | Ruling 7: passing it to a keeping parameter counts as storing it |
Fable 7: an isolated argument beside mutable arguments |
Ruling 10: any call with an isolated argument opens it; other arguments must be values, immutable or moved |
| Fable 8: conversion checked "writes" only | Ruling 19: conversion needs the "any capability" class exactly |
| Fable 9–10: default send timeout; cloning an interface-typed field | Design "Defaults spelled out" |
Fable feasibility: stage B too large, seed shim, StorageProvenance seeding the parameter-write pass, module var staging, word collisions |
B split into B1–B3 with a seed shim; seed coupling in Implementation notes; module var and E3143 in C; contextual words and an S0 collision survey |
| S0 G1: pending operands freed by later operands (constructor/match subjects; by-reference reassignment) | Ruling 21: runtime holds; E3186 over every operand of the statement |
| S0 G2: yielding closures or conformers called inside a block | Ruling 19: function types and requirements never yield |
S0 results (capmodel reggio, capmodel/reggio/REPORT.md): with rulings 19 and 21 as now
written, 0 counterexamples in five 20k campaigns, one 100k campaign and the interleaving sweep; 25 of 25
idioms accepted; 38 of 46 mutants killed, 8 argued equivalent. The model's 18 interpretations of ambiguous
rules are listed in the report and are adopted unless the user overrides one. Not yet modelled: generics,
SharedValue, latches, shutdown/otherwise, cancellation, per-target behaviour.