Upgrading from 0.x to 1.0
1.0.0 is v0.64.x plus the soundness fixes made in the release candidates (v1.0.0-rc.1 to rc.3, section 13). Those fixes only reject programs the documented rules already forbade; none changes what an accepted program computes. Anyone upgrading from any 0.x release should run the check-and-fix loop below before publishing or pinning 1.0.0.
Quick Migration Workflow
- Apply compiler quick-fixes (missing
! {Effects}, string++→"${...}",TC_MATCH_002stubs,= {block syntax, missing stdlib imports):ailang check --fix path/to/file.ail - Rewrite the 12 uniquely named stdlib renames (for codebases still using pre-
v0.64.0snake_case names):Updatesed -E -f tools/migrate-stdlib-renames.sed -i.bak path/to/*.ailstd/fs.glob→walkWithSuffix,std/bytes.slice→sliceLen,std/list.member(x, xs)→contains(xs, x)(note swapped argument order), andstd/array.unsafeGet→getby hand. - Check, test, and re-lock the whole package:
ailang check --package .ailang test --package .ailang lock
See the Stability Promise for what is covered across 1.x and what remains Experimental or Internal.
Breaking Changes (v0.58.0 → 1.0.0)
Each entry states what changed, the diagnostic you will see, the mechanical fix, and the version where it landed. For full release notes, see CHANGELOG.md.
1. pure func requires an empty effect row (! {})
- What changed:
puremeans! {}. Declaringpure funcalongside a non-empty or open effect row (! {IO},! {Declassify},! {e}) is a type error, andailang ifacederives"pure"from the checked effect row rather than the keyword. - Diagnostic:
The pure keyword contradicts the declared effect row ! {IO}. Suggested fix: remove pure to keep the effect row, or remove the effects and use ! {} with a pure body. - Mechanical fix: Drop
pureon functions that declare effects (or runailang check --fix, which removes contradictorypurewhen stamping missing effects). - Since:
v0.58.0(#1443).
module docs/upgrade_pure
-- Before (rejected): pure func sanitize(...) -> string<sanitized> ! {Declassify}
-- After: drop `pure` when keeping the effect row
export func sanitize(raw: string<email>) -> string<sanitized> ! {Declassify} = "[sanitized]"
2. Cross-module IFC sink & label enforcement
- What changed: Information-flow control (IFC) sink refinements (
T{not LABEL}) and structural labels inside lists, records, tuples, and ADTs are enforced across module boundaries, and sink constraints travel with function values through aliases, higher-order calls, and wrappers. - Diagnostic:
information-flow violation: value labelled <...> reaches parameter "..." which forbids itorparam_label_cover. - Mechanical fix: Route tainted values through an explicit
! {Declassify}function before passing them to imported sinks, and annotate exported library sink parameters explicitly. - Since:
v0.58.0(#1134).
3. Named tests require bool for non-final bare expressions
- What changed: Every bare expression inside a named
test "..." { ... }block is evaluated as an assertion and must have typebool(non-final expressions were previously ignored). - Diagnostic: Type error expecting
boolon a non-final expression in atestblock. - Mechanical fix: Bind non-boolean setup expressions with
let _ = expr(orlet val = expr). - Since:
v0.58.0(#604).
4. ailang serve requires auth on non-loopback binds (Operators / Internal)
- What changed: Dashboard ingest and server endpoints require authentication tokens (
AILANG_OTLP_INGEST_TOKEN,AILANG_HUB_TOKEN) when bound outside loopback. - Diagnostic: HTTP
401/ startup auth error on non-loopbackailang servebinds without tokens configured. - Mechanical fix: Configure the required bearer tokens in the server environment or bind to loopback only. (
ailang serveis Internal tier.) - Since:
v0.58.0.
5. Nominal type identity & strict type declarations
- What changed: Same-named ADTs and records in different modules are distinct nominal types keyed by canonical module identity; a single-constructor ADT wrapping a record (
type Box = Box({x: int})) is distinct from the bare record (#2239); and types may not shadow built-ins (PAR_TYPE_DECL_BUILTIN) or form direct recursive aliases (TC_TYPE_ALIAS_CYCLE_001). - Diagnostic: Type mismatch between
modA.TandmodB.T,PAR_TYPE_DECL_BUILTIN, orTC_TYPE_ALIAS_CYCLE_001. - Mechanical fix: Import the canonical type declaration from the defining module rather than redeclaring an identical ADT locally; unwrap single-constructor newtype wrappers explicitly when a structural record is expected.
- Since:
v0.60.0–v0.60.4(#2228,#2239).
6. Exhaustive match is required
- What changed: Non-exhaustive
matchexpressions on ADTs, lists,Option,Result, and primitive types are compile-time errors (guarded arms do not count toward coverage). Ambiguous constructor patterns whose type cannot be inferred fail explicitly instead of guessing. - Diagnostic:
TC_MATCH_002: non-exhaustive match on <Type> — no arm matches: <pattern>,TC_MATCH_004(match too large to check), orTC_MATCH_007(untyped constructor pattern). - Mechanical fix: Run
ailang check --fixto insert<pattern> => _?stubs, add the missing arms or a final_ => ...arm, or useunreachable("reason")for impossible branches (stops withRT010if reached). - Since:
v0.60.2–v0.60.6(#2246,#2303).
module docs/upgrade_exhaustive
type Light = Red | Amber | Green
export pure func nextLight(l: Light) -> Light =
match l {
Red => Green,
Amber => Red,
Green => Amber
}
7. Type-checker & module strictness; Go emitter & extern func removed
- What changed:
- Type variables are resolved by lexical scope rather than identifier case (
#2211), signature type variables are rigid (TC_RIGID_001,#2273), and function-literal parameter/return annotations are enforced (#2238). - Named
testbodies andrequires/ensurescontracts are type-checked (#2232,#2248). - Typeclass constraints (
Num,Eq,Ord,Show) cross module boundaries (TC_CONSTRAINT_001,#2290), and pathological type expansions are bounded (TC_TYPE_SIZE_001,TC_TYPE_WORK_001). extern funcdeclarations are rejected (EXT004,#2390), and the Go emitter (ailang compile --emit-go) was removed (#2389) so1.xships two aligned engines: the reference evaluator and--bytecodeVM.
- Type variables are resolved by lexical scope rather than identifier case (
- Diagnostic:
TC_RIGID_001,TC_CONSTRAINT_001,TC_TYPE_SIZE_001,TC_TYPE_WORK_001,EXT004, orailang compileexit 1 pointing toailang run/ailang run --bytecode. - Mechanical fix: Fix ill-typed contracts/tests, add missing
deriving (Eq)for==in contracts, introduce nominaltypewrappers for huge structural types, and migratecompile --emit-gocallers toailang run/--bytecode(or JSON over stdin/stdout via the Go interop guide). - Since:
v0.60.4–v0.60.6.
8. show is total and quotes nested strings
- What changed: Built-in
showno longer truncates long values or omits elements; top-levelshow("abc")returnsabc, while strings inside lists, tuples, records, maps, and constructors are quoted (show(["a", "b"])→["a", "b"]). - Diagnostic: No compile error; runtime display output changes if callers relied on unquoted nested strings or automatic truncation.
- Mechanical fix: Use
std/string.showPreview(val, maxChars)for bounded human-readable log previews. - Since:
v0.60.3(#2229).
9. Stdlib renames removed, Json JInt, and std/ai Message.media
- What changed:
- The 16 legacy
@deprecatedstdlib aliases (deprecated inv0.60.3withTC_DEPRECATED_001) are removed inv0.64.0. std/jsondecodes 64-bit integers asJInt(int)instead ofJNumber(float),decoderejects trailing non-whitespace tokens, andstd/ai.Messagerenamedimages→media(v0.61.0).
- The 16 legacy
- Diagnostic:
IMP010: symbol '...' not exported by 'std/...'naming the replacement;TC_MATCH_005warning onJsonmatches withJNumberand noJInt. - Mechanical fix: Run
sed -E -f tools/migrate-stdlib-renames.sedand updateglob(walkWithSuffix),slice(sliceLen),member(x, xs)(contains(xs, x)),unsafeGet(get) by hand. ForJsonnumbers, match bothJIntandJNumberor usegetInt/getNumber/asNumber. UpdateMessage.imagestoMessage.media. - Since:
v0.60.3(JInt),v0.61.0(Message.media),v0.64.0(16 aliases removed).
10. Verification exit codes & bytecode contract refusal
- What changed:
ailang verify,ailang check --verify, andailang ai-checkexit non-zero when obligations exist and Z3 is missing (unavailable),unproved,inconclusive,error, orcounterexample.ailang run --bytecode --verify-contractsis refused before execution instead of silently skipping runtime checks. - Diagnostic:
CTR004: --verify-contracts is not enforced on the bytecode VM yet(exit 2), or exit 1 fromcheck --verify/verify. - Mechanical fix: Install Z3 (
AILANG_Z3_PATH), pass--allow-inconclusivewhen bounded recursion is expected, or drop--bytecodewhen using--verify-contracts. See Contracts & Verification. - Since:
v0.59.0–v0.61.0.
11. Integer wrap semantics, Z3 overflow caveats, and numeric literal typing
- What changed:
- Runtime
intarithmetic is signed 64-bit two's-complement wrapping (9223372036854775807 + 1 == -9223372036854775808).ailang verifymodelsintas unbounded SMTIntand reportsint_overflowcaveats (use--int-model=int64to treat possible wraps as violations) andfloat_nan_or_infviolations. - Standalone numeric bindings whose integer literal does not appear in a parameter position of the binding's type (
let k = 3) are fixed toint, andlet ... in/ block bindings follow ML's value restriction (#2378).
- Runtime
- Diagnostic: Type mismatch using
k * 0.5onlet k = 3;int_overflowcaveat or violation inailang verify. - Mechanical fix: Write
3.0(orintToFloat(k)) for floats, and boundintinputs inrequireswhen verifying arithmetic with Z3. - Since:
v0.60.6(#2378),v0.61.0(M-VERIFY-NUMERIC-MODEL).
12. Callback effect rows (closed ! {} vs open rows)
- What changed: An unannotated callback type (
T -> U) has an implicitly open effect row that charges callers (including callbacks nested inside lists, tuples, records, orOption). Passing an effectful callback to a pure higher-order function expectingT -> U ! {}(likestd/list.map) is rejected at compile time. - Diagnostic:
Missing effects: IO(or similar effect mismatch) at the call site. - Mechanical fix: Use effect-polymorphic helpers (
mapE,filterE,foldlE,flatMapE,forEachEfromstd/list) for effectful callbacks, or annotate! {Effects}on the caller. - Since:
v0.55.0(#1718,#1826) andv0.61.0.
13. Soundness fixes in the release candidates
Each of these rejects a program that 0.x accepted but the documented rules forbid. Each was run against the downstream compatibility gate before it merged. Full notes: the v1.0.0-rc.1–rc.3 sections of the changelog.
| Diagnostic | What is now rejected | Fix |
|---|---|---|
MOD017 | A top-level expression in a module (any file with an import, function, test or exported type), such as let x = 5 in x or a bare call | Write a module binding without in (let x = 5), or move the expression into a function such as main |
MOD018 | Importing a script, a file whose top level evaluates an expression | Move the script's expression into a function so its top level only declares |
TC_UNBOUND_TYPE_001 | A type name declared nowhere (f(r: Nope)), which used to become an opaque type | Declare it, import it by name, or fix the spelling the message suggests |
TC_AMBIGUOUS_TYPE_001 | A bare type name that two imported modules both supply | Import the one you mean by name (import lib/rec (Hue as RecHue)) |
| type error | A module-level let x: int = "s" or a letrec f: T = … whose annotation was ignored | Fix the annotation or the value. let rate: float = 3 now prints 3.0 |
TC_CONTRACT_002 | An effectful call inside requires/ensures; an effectful match guard in a pure function | Call only pure helpers in contracts (Debug is allowed); declare a guard's effects on its function |
| missing effects | A function passed where a callback's concrete row (g: int -> int ! {IO}) is narrower than the function's own effects, without the caller paying for the difference | Declare the extra effects on the caller |
TC_CALLBACK_ROW_001 | A callback hand-off whose effect row the checker cannot determine: an ! {e} function literal passed to a let-bound applier (let ap = \g. g(41)), or a record or list of closures handed on. This used to crash the checker with an internal invariant; it is a known false rejection when the program is effect-correct | Give the literal a closed row (! {} or ! {IO}) or leave it unannotated, or write the row on the stored arrow type ([float -> float ! {}]) |
TC_TEST_001 / failed test | In a named test, a false check inside a nested block now fails the test, and a discarded non-bool value in one is a type error | Bind values you keep with let; delete dead expressions |
One relaxation: an explicit ailang run --caps <list> narrower than the entrypoint's declared effects now prints a note and runs, failing only at the first ungranted call. --caps auto, [bin] shims, --policy runs and runs with no --caps still refuse up front (E_CAPS_MISSING).
14. What is NOT covered by the 1.x Stability Promise
The 1.x promise covers the Stable language syntax, the 17 Stable stdlib modules, the 19 Stable CLI commands, the package format (ailang.toml, ailang.lock, registry resolution), and the 24 Stable hosted MCP tools. It does not cover:
- Go packages under
internal/(there is no Go library API promise). - Experimental stdlib modules (
std/ai,std/net,std/process,std/stream, etc.), Experimental functions in Stable modules (@experimental), or Experimental CLI commands (fmt,lsp,verify,serve-api,messages). - Internal CLI commands (
eval,chains,coordinator,mission,serve,iface, etc.).
Checklist for Package Authors
- Update
ailangminimum constraint inailang.toml(e.g.ailang = ">=0.64.0"or">=1.0.0"once1.0.0is tagged). - Run
ailang check --package .,ailang test --package ., andailang verify --package .(if using contracts). - Run
ailang lockandailang lock --check. - Add a
## <version>section to your packageCHANGELOG.mdand set[release].kindaccurately (PUB025checks[release].kindagainst measured interface changes). - Run
ailang publish --dry-run, thenailang publish. Dependent packages notified through the upgrade cascade can resolve the new version cleanly once published.