Lasm 0.10.0
A minor release with breaking changes: the last release of Stage 0, which settles Lasm's public API before 1.0. Upgrade with npm install -D @lasm/[email protected]; ^0.9.0 does not pick it up. Every breaking change has a migration note below, under "Breaking changes and migration".
What breaks: Lasm.Fetch and Lasm.KV are deleted, so programs serve HTTP and keep data through each platform's own interface: Node.serve and exportDefault with the web's Request and Response, Lasm.Fastly, Lasm.WASI.Http, and the generated Workers KV, Deno KV and Fastly KV Store bindings (#359, #346). The WASI CGI server mode goes with Lasm.Fetch: --target wasi is for command-line and batch programs, and HTTP on WASI is wasi-http (#359). --target azure is now --target azure-functions and --target gcf is --target cloud-functions (#339). @lasm/cli exports only its public entry points, with the new @lasm/cli/lean (#353). The generated node:sqlite and bun:sqlite statements bind SQL NULL, which changes their parameter shapes (#352).
What's new: constructors for every documented Node class (DatabaseSync.new ":memory:"), Deno KV compiled into the package, one error shape across the CLI's commands (#352, #356, #353). The example apps (Conduit, Folio, Ledger, Porter, Tandem) and every template use only Stage 0's final APIs: no Lasm.Fetch, Lasm.KV or Lasm.RPC, no hand-written binding where a generated one exists (#345, #348, #350, #351, #354, #355).
Every API decision is recorded, with its alternatives, in docs/API_DECISIONS.md and the per-milestone files in docs/api/decisions/.
Breaking changes and migration
Lasm.Fetch is deleted (#359)
Lasm.Fetch,Lasm.Fetch.AssetsandLasm.Fetch.Embedare deleted (API decisions A44–A46, 0.2-1, 0.2-2, 0.2-9). Programs serve HTTP with each platform's own interface: a handler on the web's ownRequestandResponse(Lasm.JS.Web) withNode.serveon Node andexportDefaultelsewhere,Lasm.Fastlyon Fastly Compute andLasm.WASI.Httpon wasi-http.lasm init --template fetchwrites all of these (Main.lean,Export.lean,Fastly.lean,WasiHttp.lean). Migration, part by part:Lasm.FetchReplacement serveon NodeNode.serve { fetch := handle }(import Lasm.JS.Node.Serve), withhandle : Request → Async ResponseonLasm.JS.Web's types:templates/fetch/Main.leanserveon the edge, Bun and DenoexportDefault handle(import Lasm.JS):templates/fetch/Export.leanserveon the function platforms (Lambda, Vercel, Netlify, Azure, Cloud Functions)exportDefault handle, which the generated platform file calls directlyserveon Fastly ComputeLasm.Fastly(HttpReq.bodyDownstreamGet,HttpResp.sendDownstream, …):templates/fetch/Fastly.leanserveon wasi-http (wasmtime serve, Spin)Lasm.WASI.Http:IncomingHandler.serve fun request out => …andrespond out status headers body:templates/fetch/WasiHttp.leanserveas a CGI program (--target wasi, Spin's wagi executor)Removed: --target wasiis for command-line and batch programs. Serve HTTP with--target wasi-httpfetch,get,postLasm.JS.Web.fetchon JavaScript hosts,HttpReq.send(andsendAsync) on Fastly,OutgoingHandler.handleon wasi-httpRequest,Response,Handlerand their helpers (path,segments,queryParam?,header?,Response.json,.text,.redirect, …)The web's own Request/Response(URL.new (← request.url),url.pathname,url.searchParams,(← request.headers).get,Response.new), or an app-local copy of the few helpers an app uses, as the templates'Handler.lean,Fastly.leanandWasiHttp.leandoResponse.streaming,ServeOptions.streamRequestBodyThe platform's streams: a ReadableStreambody on JavaScript hosts,HttpBody.writewith a streamed response on Fastly,OutgoingBody.writeon wasi-httpembed_dir!,AssetsAn app-local copy: templates/fullstack/Embed.lean(embed_dir!) andHttp.lean(Assets.serve)The WASI CGI server mode is removed (A44):
src/wasi/lasm_fetch_wasi.cis deleted, and so is--target fastly's host for Lasm.Fetch (its request, response and dynamic backends). Programs onLasm.FastlyandLasm.WASI.Httplink as before.Removed with it:
examples/fetch(its routes areexamples/fastly's andexamples/wasi-http's),docs/FETCH.md, thefetch-exampletarget-equivalence app, and the native libFuzzer targetslean-fetch-request,wasi-cgiandfastly-host.
Lasm.KV is deleted (#346)
Lasm.KVis deleted (API decision 0.5-18). Use the platform's own store through its generated binding:- Workers KV as a
KVNamespacefield of the Worker's typedEnv(Lasm.JS.Cloudflare.Kv,env.TODOS.get key,env.TODOS.put key (.domString value)); - Deno KV through
Lasm.JS.Deno.Kv(openKv,kv.get #[.domString name, .domString key],kv.set …); - Fastly's KV Store through
Lasm.Fastly.KvStore.
Migration: replace
Lasm.KV.open namewith the store of the platform the program is built for; where a platform has none, keep aStd.HashMapin anIO.Ref. A missing binding now fails loudly instead of falling back to memory.- Workers KV as a
Azure and Google targets are named after the platforms (#339)
--target azureis now--target azure-functions, and--target gcfis now--target cloud-functions(0.7-24), whose default output iscloud-functions/(wasgcf/). The same names apply tolasm package --target,lasm init --deployand thenpm run build:<target>scriptslasm initwrites. The old names are refused with the new one (did you mean --target cloud-functions?). Migration: inpackage.jsonscripts, CI and deploy commands,azure→azure-functions,gcf→cloud-functions, andgcf/→cloud-functions/(for examplegcloud functions deploy … --source cloud-functions).
@lasm/cli exports only its public entry points (#353)
- The wildcard export is gone (0.7-19):
@lasm/cliexports@lasm/cli/vite,@lasm/cli/vite/client,@lasm/cli/package.jsonand the new@lasm/cli/lean, so@lasm/cli/src/…imports no longer resolve.@lasm/cli/lean'slasmLean(source)returns Lasm's ownleanandlake, the Lean version and Lean's library directory, for checking a project's proofs with the Lean the build uses. Migration:import('@lasm/cli/src/managed-lean.mjs')andprovisionLean(file, { modules: 'extended', progress })→import('@lasm/cli/lean')andlasmLean(file, { progress }).
node:sqlite and bun:sqlite bind SQL NULL (#352)
- SQL NULL binds on node:sqlite and bun:sqlite (0.4-45).
StatementSync.all,get,runanditeratetakeArray (Option …)(noneis NULL); Bun'sStatement.all,get,runandvaluestake oneDataper value (stmt.all #[.null, toJS 7]). Migration:stmt.all (namedParameters := …) #[…]isstmt.allWithNamedParameters named #[…](likewiseget,run,iterate, andConsole.log's first argument:logWithData); on Bun,stmt.run #[#[x]]isstmt.run #[x].
New
- Constructors of every documented Node class (0.4-46, #352):
DatabaseSync.new ":memory:",stream.Writable.new,Hash, … (38, from the constructor headings of Node's Markdown docs). - Deno KV ships compiled (0.4-47, #356).
import Lasm.JS.Deno.Kvno longer compiles anything on a program's first build. The rest ofLasm.JS.DenoandLasm.JS.Bunstill compiles on first import.
Changes
- Every command words its errors the same way (0.7-17, #353): an unknown
name is
Unknown <kind> "x" (did you mean …?). Choose one of: …inlasm build,lasm dev,lasm packageandlasm init(lasm dev --target,lasm init --deployandlasm package --targetchanged);lasm init --deploywithout a value says--deploy requires a value;lasm dev Main.txtsaysExpected a Lean source file (Main.lean), not Main.txt, aslasm builddoes. Exit status: 0, 1 for every Lasm error, or the program's own status underlasm run. Migration: none, unless a script matched the old texts. lasm packagenames the closest target for an unknown one, as the other commands do (0.7-24, #339).- The fullstack template's
Deno.leanuses the generated Deno KV binding (Lasm.JS.Deno.Kv:openKv,Kv.get,Kv.set) instead of callingDeno.openKvby hand; the database opens on the first request (#345). zlib.gzip,gzipSyncand the other convenience methods are no longer marked "Node.js 26 and later" (#352).
Example apps
Every example app is on @lasm/cli 0.9.0 and Stage 0's final APIs: no
Lasm.Fetch, Lasm.KV or Lasm.RPC, per-spec Lasm.JS.Web.* imports, and
one entry file per serving model.
- Conduit (#351):
ServerNode.lean(Node.serve),ServerDeno.lean(Deno.serve),ServerBun.lean(Bun.serve),ServerFunction.lean(exportDefault, built withlasm build --target lambda|vercel|netlifyand packaged for Azure and Google; the Lambda container image is the .zip's files on Lambda's base image),ServerWorkers.lean(typedEnvwith D1),ServerDenoDeploy.lean(Deno KV through Lasm.JS.Deno.Kv),ServerVercelEdge.lean,ServerNetlifyEdge.lean,ServerSupabase.lean,ServerFastly.lean(Fastly KV through Lasm.Fastly.KvStore),ServerWasiHttp.lean. SQLite and Web Crypto go through the generated Lasm.JS.Node.Sqlite, Lasm.JS.Bun.Sqlite, Lasm.JS.Cloudflare.D1 and Lasm.JS.Web.Webcrypto; the browser app's commands are data (Frontend/Cmd.lean) performed withCmd.task,fetchandlocalStorage. All 52 propositions (307 theorems) still hold. - Folio (#354): one entry file per serving model, with no runtime
detection: the live preview's server is
PreviewServer.lean(Node.serve),PreviewServerBun.lean(Bun.serve) andPreviewServerDeno.lean(Deno.serve); the site server (Server/Edge.lean) isServerWorkers.lean(the default export, with a typedEnvwhose KV namespacefoliois Lasm.JS.Cloudflare'sKVNamespace),ServerDenoDeploy.lean(the default export on Deno KV through Lasm.JS.Deno.Kv) andServerFastly.lean(Fastly's KV Store through Lasm.Fastly). Each reads its platform's store through the generated binding, and a missing store is an error naming it instead of a store in memory. On Fastly, the pathological input unclosed<!--is no longer skipped: with Lasm's mimalloc build it fits Compute's 128 MB heap (#246). Thefoliocommand and the batch renderer keep their Node, WASI and browser builds. Every proposition still holds. - Ledger (#355): SQLite through the generated bindings
(
Lasm.JS.Node.Sqliteon Node and Deno,Lasm.JS.Bun.Sqliteon Bun,Lasm.JS.Cloudflare.D1on Workers, with a typedEnv); Node serves withNode.serve, Deno withDeno.serve(ServerDeno.lean), Bun withBun.serve; the function platforms runServerFunction.lean, whose handler is published withexportDefault. The page loads withCmd.taskand the generatedfetch. On Workers, the embedded files are served without their Brotli copies (Cloudflare compresses), and commits rely on D1's atomic batch (0.5-8, #349). - Porter (#348):
Server/D1.leanon the generatedD1Database, a typed WorkersEnv(DB,ISSUER,PORTER_CONFIG),Node.serveon Node, andServerExport.lean(exportDefault) for Deno and the function platforms; Web Crypto through the generatedLasm.JS.Web.Webcrypto. - Tandem (#350): SQLite through the generated bindings
(
Lasm.JS.Node.Sqliteon Node and Deno,Lasm.JS.Bun.Sqliteon Bun,Lasm.JS.Cloudflare.D1on Workers with a typedEnvandexportDefault). WebSockets through the generatedDeno.upgradeWebSocketandBun.serve'swebsockethandlers withserver.upgrade; on Node, Tandem's own server is the generatedLasm.JS.Node.Httpwith thewspackage, because Node has no WebSocket server andNode.servehas no upgrade hook yet (0.4-7). The editor's effects are data (Tandem.Ui.Effect), performed withCmd.taskover the generated browser bindings and played by the deterministic simulation in its world.
The hand-written bindings left in the apps bind what 0.9.0 does not
generate: node:sqlite's new DatabaseSync (0.10.0 generates
DatabaseSync.new, #352), Porter's bun:sqlite new Database, Tandem's ws
server and Conduit's @netlify/blobs.
Internals (no change to how programs build or run)
Lasm.Fetch's proved request model moves to the test suite (A45, #359): the path resolution, percent decoding and query helpers, and the theoremsegments_no_dot_segments, are nowverification/cli/Lasm/RequestPath(Lasm.RequestPath), a specification checked byscripts/library-proofs.mjs; its two candidates are evaluated on generated URLs bytest/library-proofs/RequestPath.lean.- Native fuzzing targets the Lasm.JS value codec (#359): the native fuzz
harness has a new target,
lean-js-wire, which fuzzes the Lean half of the Lasm.JS value codec and checks the proved round trip (Lasm.JS.Spec.decode_encode) on every value it reads. - API decisions (docs only): 0.5-8, Ledger's Workers questions: compression is left to Cloudflare and there is no Lasm lock (#349); 0.7-7 and 0.7-16 closed (#357); A55, no WASI reactor build in Stage 0 (#358); Jordan's 2026-11-16 sign-offs (#360).