Format: Keep a Changelog.
[Unreleased]
[1.0.0] - 2026-11-19
Breaking
- jws —
verify/verifyJwtrefuse a non-canonical base64url part: a length of 1 mod 4, or non-zero unused bits in the last character (RFC 4648 §3.5). Such a part decodes to the same bytes as the canonical spelling, so a token had several accepted spellings. Every conformant encoder writes the canonical form; a token that relied on another spelling now verifies tofalse. - jws —
verify/verifyJwtrequireexpectedAlg(an alg, or a non-empty array of algs) and throw aTypeErrorwithout it, before reading the token: the token header no longer chooses the algorithm (RFC 8725 §3.1; anHS256token MAC-ed with an Ed25519 public key used to verify). Migration: pass the algorithm the key is for,jws.verify(token, key, { expectedAlg: 'EdDSA' }). - zlib, gzip, zip —
unzlibSync/UnzlibStreamcheck the Adler-32,gunzipSync/GunzipStreameach member's CRC-32 and ISIZE,unzipSynceach entry's CRC-32 and size, by default (RFC 1950 §2.3, RFC 1952 §2.3.1, APPNOTE 4.4.7): a corrupted trailer now throws code 16, and a zlib frame too short for a deflate stream and its trailer code 0, where they used to decode. Migration:{ verify: false }keeps the old acceptance. - sanity/base —
applyBase()also blocksRange.prototype.createContextualFragment(it throws'not allowed', asdocument.writedoes):document.createRange().createContextualFragment(html)used to parse markup after the lock (measured in Chromium). The 15-step report is unchanged (theElement.prototypestep covers it). Migration: build nodes with the DOM API ortextContent. - runtime —
list()returns a frozen array of frozen copies of the definitions (eachdependenciesa frozen copy), andcore/modules.jsexports the registry array frozen: an edit throughlist()or apush/spliceon the imported array now throws instead of changing what every importer resolves; a row is no longer===the registered object. Migration: build a new array ([...modules, mine]) and compare rows byname/version. - crypto — the deprecated and always-
falsestubs are removed:aes.bitsliced(useaes.fn, the constant-time path), theaes_ctrmodule (useaes_modes.ctr; the registry has 208 modules),rsa.pkcs1v15Sign/pkcs1v15Verify/pkcs1v15Encrypt/pkcs1v15Decrypt(usepssSign/pssVerify,oaepEncrypt/oaepDecrypt),ed25519.ed448.*,argon2.hashD/hashI(usehash, Argon2id),chacha20.xchacha20, and thewebcryptoDigest.sha1shorthand (digest('SHA-1', data)stays). A call to one now throwsTypeError: … is not a function(orundefinedis read) where it returnedfalse. Migration: the replacements above; a feature probe readstypeof x.name === 'function'. - ml_dsa —
sign/signPhwithoutrndare hedged (32 random bytes, FIPS 204 §3.4): two signatures of one message now differ, where they were byte-identical (the zerornd).hybridSigninherits it; its self-KAT lock is regenerated (keys unchanged). Migration: passnew Uint8Array(32)asrndfor the deterministic mode (KAT vectors). - webcrypto —
generateKeyofwebcryptoAes,webcryptoEcc,webcryptoEd25519,webcryptoHmac,webcryptoRsa,webcryptoX25519andwebcryptoAesKw.generateKekmake the secret or private key non-extractable by default (exportKey/wrapKeyof it now fail); public keys still export. Migration: passextractable: truewhere the key is exported. - uuid —
v4()returns the canonicalxxxxxxxx-xxxx-4xxx-Nxxx-xxxxxxxxxxxxform (36 chars) by default, where it returned 32 hex without dashes, and so doesv1()(xxxxxxxx-xxxx-1xxx-…). Migration:v4(false, false, 'compact')/v1(false, false, 'compact'). - pbkdf2 — a count below 1 (0, a negative,
NaN) returnsfalse: a count of 0 used to derive a key from the PRF's first block without iterating. Migration: a count of at least 1 (the default is 600 000). - ed25519, ml_dsa, slh_dsa (pure tier), hybridSign — one argument order for every signature scheme and tier, the WebCrypto one the wasm and WebCrypto tiers already use:
sign(key, message, …)andverify(key, signature, message, …). Changed:ed25519.verify/verifyPh/verifyCtxwere(publicKey, message, signature, …);ml_dsa<N>andslh_dsa_*sign/signPhwere(message, secretKey, …)andverify/verifyPh(signature, message, publicKey, …). So do thehybridSignvariants'verify, which was(publicKey, message, signature, ctx?)and is(publicKey, signature, message, ctx?). A call in the old order returnsfalse(the lengths do not match) or a wrong verdict, it does not throw. Migration: reorder the arguments. - wasmPbkdf2 —
deriveBits(password, salt, lengthBits, …)takes the length in bits (a positive multiple of 8), aspbkdf2andwebcryptoPbkdf2; it took bytes. Migration: multiply the length by 8 (32 bytes → 256). - deflate, zlib, gzip, zip, lz4, lzw — one typed error convention for the compressors, the brotli one:
e.codeis a string ('EEOF','EBADFORMAT','EMAXOUT','ECHECKSUM','EUNSAFEPATH'…; the table is in each module's page), where the deflate family put a number; the number stays ine.errno. lz4 and lzw errors, which carried no code, now do ('EBADSTREAM','EMAXOUT','EBADARG'). Migration: comparee.codewith the name, or reade.errnofor the number. - parser —
fromHTMLkeeps the boundary space a text node shows beside an inline sibling:or <span>choose a file</span>gives the text"or "(it gave"or", rendered "orchoose a file"). No node is added: whitespace-only nodes (they would render as<span>s), whitespace beside block elements, at a parent's edges and around a leaf's sole text are still dropped. On the site templates of this repository 98 of 147 parse differently, text content only. Migration: none for rendering; a test that pins elm-array text sees the spaces. - lz4 —
Lz4CompressStreamemits a block for every chunk: a chunk that does not compress (12 bytes or less, or incompressible) becomes a block of literals, where it was forwarded raw andLz4DecompressStreamthen mis-decoded it (a wire change). A chunk past the size limit throwsEMAXOUT. - cbor, msgpack, zip —
cbor.decode/msgpack.decodemaps decoded to objects, and theunzipSyncresult, have anullprototype: no key is inherited (toString,hasOwnProperty,constructorare absent unless decoded). Migration:Object.hasOwn(obj, k)instead ofobj.hasOwnProperty(k);toEqualcomparisons are unaffected. - cbor —
decoderefuses the 17 not-well-formed items of RFC 8949 App. F it accepted (a throw): definite strings shorter than their length, two-byte simple values below 32 (f800–f81f), nested indefinite string chunks, and a break (ff) on its own or inside a definite array, map or tag.encodewrites every safe integer as an integer (major 0 / 1), where integers beyond ±2^32 became float64:1e12is1b000000e8d4a51000(9 bytes, as RFC 8949 App. A), and decodes back to the same number (a wire change). Migration: none for well-formed input; a peer that expected the float64 form reads an integer. - cbor, msgpack —
decodestops at a nesting limit,maxDepth(default 512 levels of arrays, maps and CBOR tags): a deeper input throwsnesting deeper than maxDepth, where it recursed until the engine's stack overflowed (a 200 000-deep array is 200 KB of input). Migration:decode(bytes, { maxDepth: n })for deeper data. - url —
parseURL'squeryreads+as a space, asURLSearchParamsand HTML forms do:?q=fw+examplesgives{ q: 'fw examples' }(it gave'fw+examples'), andbuildURL(parseURL(x))writes it%20, keeping the meaning. Migration:parseURL(x, base, { space: 'percent' })for the literal reading;parseQuery's own default is unchanged. - zip — extracted entry names use
/: a\separator (.NET Framework archives) becomes/, as other unzip tools present it, soout['docs/readme.md']where it wasout['docs\\readme.md']. Migration: look names up with/. - crypto, brotli, bitArray, ctr, jws — no API object carries a
_key any more: the_internalhatches ofaes,argon2,brotli,brotliShared,chacha20,cmac,ecc,ed25519,gcm,hybridSign,ml_dsa/ml_kem/slh_dsa(and their variants),random,rsa,rsaKeygen,sha256,sha512andx25519, andml_dsa._ntt/ml_kem._nttand kin, move to the internal slot, a non-enumerable property keyed bySymbol.for('@awacloud/fw/internal'), outside the API (docs/guide/stability.md);ctr._calculate(the same function asencrypt),bitArray._shiftRight/_xor4andjws._b64uEnc/_b64uDecare gone. Migration: base64url throughb64.url.fromBytes/toBytes(which returnsfalsewithout a warning where_b64uDecwarned);ctr.encrypt; a vector test that needs an internal readsapi[Symbol.for('@awacloud/fw/internal')], which carries no semver promise.
Added
- logger —
log.native(on?): the realm'sconsolecalls print as the native console does (in production too) while still recorded;native(false)restores the default. The takeover itself is unchanged. - lz77 —
createScanner(data, opts): the scan, resumable. Eachfill(tokens, max)writes the nextmaxtokens at most in theencodeTokensformat and resumes where it stopped; the fills concatenate to theencodeTokensstream whatevermaxis, a lazy step's match carried across a cut included.encodeTokensis now one fill over the whole input. - sound (new module,
dom/query) — short sound clips in memory:record(streamHandle, { maxMs })with a livelevel(),fromBytes,fromBuffer,trim,normalize,play(clip, { rate, gain, when }),rate(semitones),clip.bytes()(16-bit PCM WAV),disposeAll(). Web Audio + MediaRecorder, main thread only, never touches storage or the network. - x509 (new module,
crypto/utils) — X.509 v3 certificates (RFC 5280) for Ed25519 and ECDSA P-256 keys:create(spec, signer)(self-signed or issued; names, serial, UTCTime / GeneralizedTime validity,basicConstraints,keyUsage,extKeyUsage,subjectAltName, key identifiers),parse(der),verify(der, issuerKey),toPem/fromPem. Read by node'sX509Certificateand openssl; reads openssl's. - createWorker —
revoke: [names]removes ambient globals inside the worker before the user function runs, from every owner on the global's prototype chain (Chrome keepsfetchonWorkerGlobalScope.prototype), and fails closed when a name stays reachable;lockdown: true | { url }runslockdown()in the worker's realm (a module worker importingsanity/lockdown.js). Both run afterworkerFw, so its resolved modules are the grant. Without them nothing changes. - parser —
createCache({ max })andfromHTML(html, { cache }): one parse cache shared by several parser instances (one per route of a site build). It is transparent: a hit returns exactly what a fresh parse on the calling instance would, auto ids minted by that instance's own counter, so sharing it cannot create an id collision; only the parse is saved. - keyformat — RSA keys:
encodeRsaPublicKey/decodeRsaPublicKeyandencodeRsaPrivateKey/decodeRsaPrivateKey(PKCS#1),encodeSpkiRsa/decodeSpkiRsaandencodePkcs8Rsa/decodePkcs8Rsa, on the{ n, e, … }shapesrsaKeygenreturns andrsatakes. The encodings are byte-identical to node's DER; decoding is strict. - hybridSign —
fromComponents(kind, { pq, trad })andtoComponents(kind, bytes)on both variants, for public keys, secret keys and signatures: a composite built from components made elsewhere (an external ML-DSA key, the official LAMPS wire form), or split back. Malformed input isfalse; results are copies. - crypto/wasm —
wasmRuntime.configure({ baseUrl })andload(name, exports, { baseUrl }): the WASM tier fetches its binaries from the directory you name (an absolute URL), for a build that inlines the factory elsewhere, a CDN or a Worker served from another place.configureis the default for every later load, the algorithm wrappers included; it stays open underlockdown(). The default is still this module's own directory, and everyloadstill compiles afresh: under JavaScriptCore,chacha20poly1305.simd.wasmreturns a wrong tag once one compiled module has run it about six times, so no compile memo is kept. - io/compress —
maxOutput(bytes) on every decoder:inflateSync,unzlibSync,gunzipSync(over every member),unzipSync(over every entry),brotliDecompressSync, their async forms and theInflateStream,UnzlibStream,GunzipStream,BrotliDecompressStreamconstructors (the stream's total). One byte more throws code 7 (EMAXOUTin brotli) before the buffer grows past the cap;unzipSyncchecks each declared entry size before allocating it. Absent, nothing changes. The bound a caller needs against a decompression bomb. - sanity/base —
applyBase()reportsfailures: [{ step, target, message }], one entry per slot a step could not harden (a non-configurable property, a frozen namespace);[]on a clean apply.stepskeeps its 15-step order. - fileIntake (
dom/fs) — picker, OS file drop and keyboard-operable dropzone wired to oneonFiles(files, source)callback. - installPrompt (
dom/sw) — thebeforeinstallpromptdeferral (+appinstalled) and the File HandlinglaunchQueueconsumer. - swUpdate (
dom/sw) — the waiting-release update flow: report a waiting release once to a controlled page, check, apply, read the worker version. - precache (
dom/sw) — worker-side release precache with cache-first / network-first strategies and the skip-waiting / version message protocol. - clipboard —
setRich({ html, text })writes one item with atext/htmland atext/plainflavour (strings or promises, written synchronously inside the user gesture), andisSupported()gains therichWriteflag;set,getandshareare unchanged. - sanitize —
sanitizeHtml(html, { allowDataImage: true })keeps adata:image/*URL on<img src>only, the opt-in its comment documented but never honoured;hrefand every othersrcstill dropdata:, and the default is unchanged. - runtime — a module descriptor may declare
type: 'app.<sub>', the namespace for an application's own modules (fw,sd,sde,sdcandlibwere the only accepted prefixes, so an app had to borrow one or omittype). - zlib, gzip, zip —
verify: trueonunzlibSync,gunzipSync,unzipSync, their async twins and theUnzlibStream/GunzipStreamstreams checks the integrity trailer against the decoded bytes (Adler-32; CRC-32 and ISIZE; each zip entry's CRC-32 and size) and throws code 16incorrect data checkon a mismatch; with it, a zlib frame shorter than a deflate stream and its trailer throws code 0unexpected EOFinstead of inflating to an empty array. It is the default;verify: falseskips the check (see Breaking). - exports —
.jstwins./typed.js,./sanity/base.js,./sanity/community.js,./sanity/lockdown.js,./sanity/lockdown-apply.js;typeson every./sanity/*module key;@awacloud/fw/eslintexports thefw/no-factory-capturerule. The README lists the subpaths and which ones need a build in a checkout. - deflate —
inflateSync(data, { onEnd })reports the input bytes a deflate stream used;InflateStreamgainsendedandrest()(the input after the final block). What a container reads on from. - zlib, gzip —
UnzlibStream.flush()/GunzipStream.flush()end a stream that may have no trailer: the last 4 / 8 bytes, held back as a presumed trailer, are decoded and emitted (a truncated PDF FlateDecode stream lost them). - huffman —
kraft(codeLengths)reports an over-subscribed or incomplete code-length set;buildMapis unchanged. - lz4 —
compress(src)andcompress(src, opts)compress the whole ofsrc;compress(src, len, opts)is unchanged. - render —
toHTMLmarks the root(s) of each iterate row withdata-fw-row="<i>", the row's 0-based index, when hydration markers are on (the default). The rows still share theirdata-fw-idvalues, whichUIList.adoptrelies on; the index makes one row addressable ([data-fw-id="app:item"][data-fw-row="2"]).hydrate: falseemits neither. - lzw — an
earlyChangeoption (truewidens the code one code early, the TIFF / PDF/EarlyChange 1rule;falseat2^nentries, the GIF and .Z rule), defaulting tobigEndian, sobigEndian: truealone stays the TIFF / PDF profile andearlyChange: falsewith it reads a PDF/EarlyChange 0stream. - b64 —
url.fromBytes(bytes),url.toBytes(str)andurl.test(str): base64url (RFC 4648 § 5), no padding, with a strict decoder that accepts the canonical unpadded form only (no=, no+//, no length of 1 mod 4, zero unused bits in the last character) and returnsfalseotherwise.jwsencodes and decodes its token parts with it. - API stability — the public surface is written down and frozen by a gate:
docs/guide/stability.mdsays what SemVer covers (everyexportsentry and the names it exports, each registry module's API keys and kinds, the published declarations, the documented behaviour; not the internal slot, the_methods of classes, error message text or bundle internals), the rules from 1.0.0 and the deprecation cycle (a minor deprecates and keeps the old name working for at least one more minor and six months, the next major removes).docs/api/surface.jsonis the snapshot;bun run api:surface:checkprints a classified diff (breaking, additive, internal, types) and fails on drift, andprepackruns it. - docs —
docs/evidence/l4-evidence.md: what backs the L4 criteria (the frozen API, the conformance vectors per standard with the remaining thin spots, the sites that run fw in production). - styleSheet (new module,
dom/rendering) — attaches CSS text to a document as a<style>element (default) or as a constructable stylesheet inadoptedStyleSheets(mode('adopted')), the channel a CSPstyle-srcwithout'unsafe-inline'accepts:attach(css, { id, attrs, nonce, mode, head })returns a handle withset(css)anddetach().
Changed
- ua — detection follows MDN's method:
navigator.userAgentData(UA Client Hints) first, else "Mobi" anywhere in the UA formobile()and a few tokens forplatform(); the two verbatim pattern lists are gone. Results that change: an iPad Safari UA ("Mobile/…") is now mobile; a UA matched only by the old 4-character prefix list (old feature phones, e.g.SAMSUNG-GT-…) is not; Chrome OS reads'linux'(was'unknown'); a Mac UA with more than one touch point (iPadOS desktop mode) reads'ios'; where UA-CH exists its values win over the UA string. TheUaAPIsurface is unchanged. - crypto — a verify or an authenticated decrypt that returns
false(an AEAD tag mismatch, a signature that does not verify, an OAEP or key-unwrap failure) logsCORRUPTat warn level instead ofconsole.error, in the pure, WebCrypto and wasm tiers.console.errorstays for nonce reuse, a dead entropy source,BUGand real faults. A page that correctly rejects a tampered input no longer shows a console error. - jws — a malformed token warns once per call instead of once per part, and a signature that does not verify is reported at warn level instead of
console.error. - keybindings — punctuation keys
Plus,Minus,Equal(and the literal-/=) parse and match onevent.key, Shift ignored;Shift+Plusis refused. - sha256 (and
sha224,hmac,pbkdf2,hkdf,ecc's HMAC-DRBG,jws,totpthrough it) — the compression unrolled on int32 (generated; the schedule in anInt32Array, the registers renamed instead of moved), and bytes onto an empty buffer hashed straight from theUint8Array: 1 MiB 10.7 → 6.4 ms (Bun), 10.5 → 4.6 ms (Node).pbkdf2with its default PRF (HMAC-SHA-256) runs each iteration as two compressions on the key's inner and outer states, without allocation: 10 000 iterations 26.8 → 4.7 ms (Bun), 14.9 → 4.0 ms (Node). Same outputs. - sha3 (SHA3-224/256/384/512, SHAKE128/256, and
ml_kem/ml_dsa/slh_dsathrough them) — Keccak-f[1600] unrolled on int32 locals (generated; no allocation per permutation) and absorption four bytes per word: SHA3-256 of 1 MiB 45 → 12 ms (Bun), 47 → 21 ms (Node). Same outputs. - sha512 (and
sha384,sha512_224,sha512_256,ed25519's hashing) — int32-only rounds (round constants and the message schedule inInt32Arrays, carries from bit operations), and bytes onto an empty buffer hashed straight from theUint8Array: 1 MiB 42 → 14 ms (Bun), 34 → 10.4 ms (Node). Same digests. - blake2b (and
argon2, which hashes with it) — the compression runs on int32 locals with generated inline mixing: 1 MiB 46 → 9.0 ms (Bun), 51 → 6.3 ms (Node). Same outputs. - poly1305, chacha20, chacha20poly1305 —
poly1305no longer usesBigInt: ten 13-bit limbs, products exact in doubles, the block loop unrolled, theh ≥ preduction by mask — no secret-dependent branch, whereBigIntoperations run in value-dependent time.chacha20keeps its state in locals with inline quarter-rounds and XORs whole keystream words. Same outputs (node:crypto's AEAD byte for byte). 1 MiB AEAD encrypt: 43 → 7.9 ms (Bun), 38 → 5.0 ms (Node). - ed25519, x25519 — faster, same outputs: the field multiply and square are unrolled (no allocation; squaring by symmetry), inversion and square root use addition chains,
sign/keyPairmultiply the base point through a constant-time table (signed radix-16 digits, entries chosen by a full scan and masks), andverifymultiplies its public point through a 4-bit window with the dedicated doubling. Bun / Node:sign3.7 → 0.45 ms / 5.7 → 0.32 ms (×8 / ×18),verify5.7 → 1.2 / 10.6 → 0.8 ms (×4.6 / ×13),x25519.scalarMult1.6 → 0.72 / 2.4 → 0.63 ms (×2.2 / ×3.9). The firstkeyPair/signof a factory builds the table (about 4 ms). - brotli (encoder) — incompressible input is stored at once: a sampled entropy test, then a repeat probe over content-defined anchors, before LZ77, the dictionary scan and the entropy coding would spend their time on it (q6 on 256 KiB of uniform bytes: 12.8 → 0.6 ms Bun, 12.0 → 1.1 ms Node; with the dictionary blob loaded 43 → 0.6 / 94 → 1.1 ms). The dictionary scan visits only the prefix groups that can match the input's first byte, behind a Bloom filter per table; LZ77 runs through
encodeTokensinstead of a callback per token; distance codes are computed in O(1). q6 text and json 19-37 % faster. The output is byte-identical at every quality, with and without the dictionary. - brotli (encoder) — repeated distances are coded through the distance cache (RFC 7932 §4: the last four distances and their ±1..3 neighbours, code 0 on implicit-distance insert-and-copy symbols); a code is used only where it saves more than its place in the distance alphabet costs. JSON-like input 2.3-3.7 % smaller at q 1-11, period-structured data ~21 %, source code ~0.5 %; prose unchanged; no input of the bench set larger. Still about 15 % above the reference encoder at q6 on text and 13 % on JSON.
- brotli (decoder) — text-like streams decode about 30 % faster (
node:zlibq6, 120 KiB of text: 2.9 → 2.0 ms Bun, 2.4 → 1.7 ms Node; JSON 9-18 %): a static-dictionary word is copied by a loop instead ofsubarray+set(44 % of a text decode under V8), the literal loop keeps its state and bit position in locals and reads the prefix table inline, insert-and-copy symbols split through tables, and the output is reserved once per meta-block. - brotli (encoder) — smaller output at every quality from 1, still decoded by every Brotli decoder; a consumer that pins encoder bytes sees the change. The built-in dictionary is used from 4-byte words (was 6); a copy whose bytes repeat at a cached distance takes that distance's cache code; q7 now searches deeper than q6 (a 64-candidate chain ended by a 32-byte match; q8-9 64 ended at 64 bytes, q10-11 128). With the dictionary blob, q6 on 256 KiB of English Markdown is 0.6 % smaller (4 % above the reference encoder), q7 3.5 % smaller (1.5 % above); JSON 0.7 % smaller at q6, 2.5 % at q7, 3 % at q11; source 2-3 % at q7. q6 encodes 5-17 % slower; q7 is 20-50 % slower than q6.
- brotli (decoder) — a command's reads (insert-and-copy symbol, length extras, distance symbol and extras) run on a local bit position like the literal loop's, and the dictionary copies left the hot loop:
node:zlibq6 streams decode 11-12 % faster on Bun (text and JSON), unchanged on Node. - hex, b64, crc32 — faster, same outputs.
hex.fromBytesandb64.fromBytes/toBytesuse the platform'sUint8ArraytoHex/toBase64/fromBase64where the realm has them (JavaScriptCore, SpiderMonkey) and JS paths over typed arrays elsewhere (V8). 1 MiB, Bun / Node: hex encode 36 → 0.6 / 42 → 1.2 ms, base64 encode 23 → 0.2 / 16 → 1.1 ms, decode 7 → 0.2 / 13 → 2.0 ms.crc32folds sixteen bytes a step (slicing-by-16): 1.6 → 0.5 / 0.6 ms. Arrays of numbers and malformed base64 give exactly the results they gave (the original decoder still reads every non-canonical input). - deflate (and
zlib,gzip,zip, built on it) — the encoder holds one block of tokens (128 KiB) instead of the whole input's:deflateSyncon N bytes held8 × Nbytes of tokens until it returned (a 32 MiB input peaked at +260 MiB of array buffers, now +60 MiB, mostly the output). The scan skips the match probe when a position's hash bucket is empty or older than the window: on incompressible input about 20 % faster under Bun, a few percent under Node; other inputs unchanged. The output is byte-identical at every level. - aes — the constant-time default
aes.fnis bitsliced: the state as 8 bit-planes, SubBytes as the GF(2^8) inverse on the planes, round keys bitsliced once at schedule time. It is about 20× faster (AES-128-CTR over 64 KiB: 130 ms → 5.5 ms on Bun, 127 → 5.8 ms on Node; AES-256-GCM about 14×), about 11× the T-table path instead of about 270×. Outputs are unchanged (FIPS-197, ACVP AFT / MCT, thettablecross-check). Everything built on it speeds up the same way:aes_modes,random.drbg,adf, pdf's ISO 32000-2 Algorithm 2.B (about 0.7 s → 40 ms a hardening). - component, template, themeTokens — the CSS they inject (scoped component CSS,
template.style, the token variables) goes through the newstyleSheetmodule; nothing changes by default. Afterruntime.resolve('styleSheet').mode('adopted')it is attached as constructable stylesheets, which a CSPstyle-src 'self'accepts where it refuses an inline<style>. Each module takesstyleSheetas its last dependency; a hand-wired factory call without it behaves as before. - crypto — each module whose loops were flattened for speed (
aes,ed25519,x25519,chacha20,poly1305,blake2b,sha3,sha256) keeps its logical implementation in a co-located<module>.reference.js, proven equal to the fast code by a differential test;pbkdf2is covered by a differential test of its two-compression fast path against its general loop (pbkdf2.differential.test.js, no duplicated reference). The references live in the git repository only: they are not in the npm package, its exports or its types. The generated code is regenerated bytools/crypto-gen.js. Seedocs/dev/crypto-references.md.
Fixed
- wasmArgon2 — Argon2id tags are interoperable. The WASM tier's core, built from
@awacloud/fw-wasm-crypto, started the address-word cursor at word 0 in the first segment of pass 0 where RFC 9106 §3.4.1.2 takes wordi mod 128: every parameter set whose segment length (m / (4·p)) is 4 or more gave a tag no other Argon2id implementation reproduces. It now also runsm ≥ 16384KiB and refusesmabove 1 GiB. A tag this tier computed before this release does not verify with it. The pure-JSargon2module does not share the defect: it reproduces the RFC 9106 §5.3 test vector (segment length 8) and gives the same tag as the fixed WASM module on every parameter set measured, segment lengths 2 to 16. - lzw — the default (GIF) profile widened its codes one code early, the TIFF rule, in the encoder and the decoder alike: fw read its own streams, but no real GIF — a GDI+ GIF failed with
EBADSTREAMpast 510 codes — and no GIF decoder read fw's. It now widens at2^nentries, as GIF and.Zdo, checked both ways against GDI+; the TIFF / PDF profile (bigEndian: true) is unchanged. A stream fw wrote LSB-first before this fix is not a GIF stream: read it with{ earlyChange: true }. - docs — the API pages of
ecc,asn1,adf,blake2b,aes_modes,randomandwebcryptoDigestdescribed keys the modules do not have (ecc.secretKey/signat the top level,asn1.encode/decode,adf.transform,blake2b.fn,aes_modes.kwp,random.range, the removedsha1); they now list the real API, with examples that run, and a test keeps every page's key list within the frozen surface. - aes — the key expansion of the constant-time path read the S-box table at indices taken from key bytes (a cache-timing leak of the key, once per scheduled key); its SubWord now goes through the bitsliced core, like the rounds.
- logger — a second fw entry in the same realm (two bundles, a bundle next to the sources, several test files importing fw in one process) no longer throws at import: its logger joins the
consoleproxy the first entry installed — both record the same calls, printing follows the first entry'sENV.DEV— instead of redefining the lockedconsole(TypeError: Attempting to change value of a readonly property., thenCannot access 'fw' before initialization). Aconsoleanother script locked is left alone. The takeover itself is now documented (README Logging andconsole,logger.md): recorded infw.log, printed only in dev, methods not reassignable,--no-logto opt out. - chart — the default ticks are round values (a step of 1, 2, 2.5 or 5 × 10ⁿ) inside the domain, labelled at their step's precision, as the JSDoc promised: they split the 5 %-padded range evenly (842.5, 457.5, 0.2999…, an x axis at −0.25 / 1.13 / 3.88). The plot padding fits the labels: the fixed 40 px clipped a
"1035 ms"label to"035 ms". Andcoloraccepts any CSS colour: area and bar fills appended'33'/'aa'to it, so only a 6-digit hex worked —rgb(...)filled with the previous fill style instead. A hex renders pixel-identical (Chromium). Giventicks/formatare unchanged. - dnd — the default drag preview keeps its source's rendered width and height: appended to
<body>withposition: fixed, the clone took its intrinsic width (a 256 px card was drawn 393 px wide, or narrower and wrapped, depending on its content). And a pointer drag no longer selects the text it crosses:user-selectisnonewhile a drag is active (restored at the end, on cancel and on dispose), and a selection the gesture started is cleared. - hmac — a
Uint8Arraykey is read as its bytes, as documented; its elements were taken as 32-bit words, sonew hmac.fn(bytes)(andhmac.verify(bytes, …)) computed a different MAC than every other HMAC-SHA-256. fw's own callers (jws,totp,ecc,slh_dsa,pbkdf2) convert their keys to bitArrays first and were not affected. - brotli — the encoder could write a stream that decodes to other bytes, in
node:zliband fw alike. Two defects: a literal run longer than 22593 bytes followed by a match was split with a 2-byte copy at distance 1 that was never in the input (any insert length fits one command: insert code 23 reaches 22594 + 2^24 − 1); and the bit writer lost the top bits of fields wider than 17 bits — distance extras past about 512 KiB, the 24 extra bits of insert code 23, MLEN past 2 MiB. An input over about 1 MiB with a far match, or any input holding a long incompressible run before a repeat (two copies of a 30 KB binary, say), was affected; text-like inputs rarely were. - hex docs — the page said
toBytesignores the last character of an odd-length input and decodes an invalid character asNaN; it throws in both cases (hex: odd-length input,hex: invalid character at index N). - docs — the dom index pages described
mediaas "JS media queries"; it is the camera, microphone and screen stream module. - pem docs —
decodereturns{ label, bytes }, not the bytes alone; the crypto/utils index namedpemandbitArrayaskeyformatdependencies (it depends onasn1only). - keyformat docs — the examples called
encodePkcs8Edwardswith an object andOID.Ed25519, passed a PEM string todecodePkcs8Edwards, and promised apublicKeyit does not return; they now match the API ((oid, seed),OID.ED25519,pem.decode(text).bytes). - licence notices —
third-party/carries the notices of the two inlined third-party tables: the WHATWG named character references ofio/text/html-entities(BSD-3-Clause) and the RFC 7932 Brotli dictionaryio/compress/brotli_dict.bin(the IETF Trust's BSD terms, and the MIT notice of google/brotli, where the file was copied from).docs/dev/provenance.mdrecords both origins. - crypto/wasm — the published package carries the 22
.wasmbinaries of the WASM tier, next toruntime.js, with their licence texts (third-party/NOTICE-fw-wasm-crypto.txt, the attribution of the vendored C sources they are built from). Thefileslist left them out, so in an installed package everywasm*module was unavailable (the tier is no-throw:loadreported a failed fetch) and@awacloud/fw/crypto/*.wasmresolved to a missing file. - sha256, sha512 (and
sha224,sha384,sha512_224,sha512_256, built on them) — aUint8Arraypassed tohash()orupdate()is hashed as its bytes. It used to be read as a bitArray of 32-bit words, sosha256.hash(bytes of 'abc')returned a wrong digest instead ofba7816bf…. Strings and bitArrays hash as before. - sanity/base —
[].__proto__readsArray.prototypeagain (the__proto__guard is installed onObject.prototypeonly, the prototype that owns the accessor; it used to shadow the getter on the eight others), andinsertAdjacentHTML(position, html)inserts the text as documented (it became a getter-less accessor, so the call threw aTypeError). The docs now state what the tier does not do: the({}).constructor.constructorescape,Range.prototype.createContextualFragment, thedebuggerstatement. - lockdown — in a browser realm the composed
basetier now applies synchronously, before the intrinsic freeze, so it is in force whenlockdown()returns. It used to run on a later tick, afterMath,JSONandDatewere frozen, and aborted on its first wrapper assignment without a report:Math.random()stayed callable afterlockdown(). A base failure is now reported on the console, andharden()no longer reads the globalReflect, whichbaseblocks. - fileIntake — the type build (
tsconfig.types.json) failed with TS2488 on the picker'sFileListspread; it now usesArray.from(same behaviour, emitted.d.tsunchanged), and an integration test keeps the type build at zero diagnostics. - runtime — the highest registered version follows SemVer 2.0.0 § 11: numeric pre-release identifiers compare numerically (
1.0.0-beta.11over1.0.0-beta.2), a hyphen inside a pre-release is kept (1.0.0-rc-2over1.0.0-rc-1), numeric identifiers sort below alphanumeric ones, a longer identifier set wins a tie, and build metadata is ignored (1.0.5+build.1used to rank below1.0.4). The same order applies inside a worker (runtimeSource). - secPolicy —
isSafeUrl(url, schemes)honours aSetof schemes, as documented; it fell back to the default schemes, sonew Set(['https'])still admittedhttp:,mailto:,tel:andftp:. And a parameter-lessdata:image/<type>,…URL (RFC 2397, e.g. a URL-encoded SVG) is accepted whereverdata:imageis: template and render by default,sanitizeHtml(html, { allowDataImage: true })on<img src>; only the;base64/;utf8spellings passed. - template — a tag outside the context's catalogue (
output, a custom element, ansvg_<name>child) is created and rendered instead of being dropped with its children moved to the context root; blocked tags (script,object,embed,iframe) and invalid names are still not rendered.clearContexton a page context emptiesdocument.bodyand removes the context's own<style>/<script>, instead of removingbodyfrom the document.elm()no longer writes a generatedidinto the caller's node. - parser —
fromHTMLreturns a deep copy of its cachedParseResulton every call, so a caller's mutation no longer reaches the next caller of the same source; two calls no longer return the same object (the JSDoc called it frozen; it was shared and mutable). - keybindings — chords sharing a first key (
Ctrl+K Ctrl+AandCtrl+K Ctrl+H) all complete: a pending chord keeps every candidate and each key narrows the set. Only the highest-priority candidate used to be kept, so the others could never fire. - route —
go(path)to a new hash runs the handlers once: thehashchangeits own assignment causes no longer dispatches a second time (a handler that fetched ran its request twice). Thehashchangelistener now skips an event whose hash equals the last dispatched one, which also ignores late duplicates. - workerPool — aborting an in-flight job always gives its slot a fresh worker. With
respawnOnCrash: falsethe slot kept the terminated worker, so the next job was posted to it and never settled; and an abort on a slotresize()had removed spawned an orphan worker. - worker-helper —
createWorkerwithENV.LOGon and noENV.DEV(documented optional) builds the worker; it threw onENV.DEV.toString(). TheworkerFwexample namesruntime.resolve('processMessage').workerFramework: the descriptor has no such property, so the documented line silently used the default bootstrap. - processRPC —
open(port, { timeout })clamps the timeout to 2^31-1 ms;timeout: Infinity(or any value above the timer range) made every call and the handshake fail at once. - uiSession — a portal renders into a host it owns (
<div data-fw-portal="<name>">appended to its target). On the default target,document.body,portal.clear()emptied the whole page andclosePortal()removedbodyfrom the document; both now act on the host only.prepend(items)(and an item'sprepend: trueinadd) inserts before the target's existing children, in the items' order; it appended. - vite-env — the virtual-module types (
runtime,modules,install) no longer degrade toanywhenvite-env.d.tsis read by path undermoduleResolution: "node": its type queries use relative paths instead of@awacloud/fw/…specifiers, which that resolution cannot follow. - exports —
@awacloud/fw/io/codec/hex(and every extension-lessio,dom,crypto,processsubpath) names the.jsfile; it mapped to a path with no extension, which Node cannot load (bundlers that add extensions hid it). The binary assets keep their own keys (./io/*.bin,./crypto/*.wasm). Co-located*.test.js,*.kat.jsand the markdown sources undersrc/are no longer reachable through the map (the published package never shipped them). - gzip — a file of several members (RFC 1952 § 2.2) decodes to all of them, in order, through
gunzipSyncandGunzipStream. It returned the first member only, or threwoutput exceeds provided buffer(the output was sized from the last member's ISIZE). Trailing zero bytes are ignored, asnode:zlibdoes. - url —
buildURLno longer writes//after a scheme that has no authority:mailto:someone@example.comrebuilt asmailto://someone@example.com. The fallback parser (a realm withoutURL) reads a bracketed IPv6 host:https://[::1]:8080/xgave the host[. - cbor, msgpack, zip — a map key or a zip entry named
__proto__is decoded as an own property; it used to replace the result object's prototype with the decoded value (decode(...).pollutedread through it).zipSyncdropped such an entry the same way.Object.prototypeitself was never written. - gzip, zlib streams — a header split across chunks decodes:
GunzipStreamfailed on any chunking under 10 bytes (it inflated the rest of the header), andUnzlibStreamon a dictionary frame chunked under 6; the header parser now reports a header that runs past the bytes at hand (code 6 whenfinal). - linalg —
mat3.transpose(m, m)(output aliased to the input) transposes in place; it read already-overwritten cells ([1,4,7,4,5,8,7,8,9]for[1..9]). A sweep of the other 30 vector and matrix operations under both aliases found no other case; it is now a test. - utf8 — the fallback encoder (no
TextEncoder) replaces an unpaired high surrogate at the end of a string with U+FFFD, asTextEncoderand the mid-string case do; it emitted the raw surrogate (ED A0 80). - typed —
createRuntime(ns)with a module namespace (import * as ns from '@awacloud/fw/core/modules', i.e.{ default: [...] }) registers the modules; it registered nothing, silently. Arrays, objects of descriptors and such namespaces are accepted, in the code, the docs andtypes/typed.d.ts. - themeTokens — its
<style>element carries the page's<meta name="csp-nonce">nonce, ascomponentandtemplatedo.
[0.1.0] - 2026-09-29
Added
- Module runtime — DI factory container with lifecycle management
(
core/runtime), a structured logger (core/logger), a DOM-ready gate (core/readyState), a Worker-creation helper (core/worker-helper), and the module registry (core/modules). - Typed facade (
@awacloud/fw/typed) — a typed entry point layered over the same runtime for TypeScript consumers. - IO family (
./io/*) — binary reader/writer, codecs (hex, base64, base32, base58, UTF-8, CBOR, MessagePack, CSV, URL, MIME, XML), compression (LZ4, LZW, Huffman, Deflate, gzip, zlib, zip, Brotli), CRC and math utilities, an event bus, timing and rate-limiting, sync primitives (mutex, semaphore, channel, atomics), data structures (LRU cache, heap, ring buffer, trie, B-tree), i18n, text utilities, and linear-algebra/statistics/geometry helpers. - Crypto family (
./crypto/*) — 73 modules: symmetric ciphers (AES, ChaCha20) and modes (CBC, CTR, GCM, CMAC, key wrap, ChaCha20-Poly1305), hashes (SHA-2, SHA-3, BLAKE2b, Poly1305, Argon2), and public-key crypto (RSA, ECC, Ed25519, X25519, ML-KEM, ML-DSA, SLH-DSA, and hybrid constructions), plus supporting utilities (DRBG, bignum, ASN.1, PEM, JWS, UUID, TOTP). - WebCrypto and WASM tiers — opt-in async wrappers over the browser's
crypto.subtle(digest, HMAC, PBKDF2, HKDF, AES, RSA, ECC, Ed25519, X25519) and WASM-SIMD accelerators over@awacloud/fw-wasm-crypto(Argon2, ML-KEM, ML-DSA, SLH-DSA, SHA-3, BLAKE2b, ChaCha20-Poly1305, CMAC, plus a Tier-2 set mirroring the WebCrypto surface). - Process family (
./process/*) — typed cross-context messaging (processMessage), an RPC layer over it (processRPC), and a Worker pool (workerPool). - DOM family (
./dom/*) — rendering (virtual DOM parser/renderer, sanitizer, templating, theming, charting), query helpers (drag-and-drop, DOM utilities, events, gestures, media), storage (IndexedDB,storage, downloads, File System Access, remote store), networking (ajax, WebSocket, SSE, WebRTC,BroadcastChannel), sensors (geolocation, battery, network info), lifecycle (visibility, idle, wake lock), and Service Worker integration (background sync, cache, push, shared worker). - Security lockdown (
./sanity/*) — three composable tiers (base,community,lockdown) hardening the DOM/XSS surface up to SES-grade realm integrity. - Bundler and test-runner integrations (
./vite,./esbuild, …) — first-party plugins for Vite, esbuild, Rollup, Webpack, Bun, Astro, Next.js, Turbopack and NestJS, plus Vitest/Jest compatibility shims. - Prebuilt bundles and types (
dist/build,dist/types,types/) — minified preset bundles (core, minimal, site, SPA, PWA, full) and generated.d.tsdeclarations for the full public surface.
Changed
- Compression primitives rewritten clean-room —
io/compress/huffman,bitstream(RFC 1951 §3.1.1/§3.2.2, RFC 7932) andlz4(LZ4 Block Format) re-implemented from the specifications with byte-identical public APIs except an additive lz4 option (below); the fflate- and node-lz4-derived code is gone;huffman.buildTreeno longer caps frequency sums. Benchmarks in each module's doc page. - Provenance — SJCL-derived crypto files (
aes,sha256,sha512,ecc,bitArray,bn) now state their BSD-2-Clause origin; the public-domain-era wording was withdrawn (seedocs/dev/provenance.md). - lz4 compression modes —
compress(src, len, opts?)andLz4CompressStream(ondata, opts?)takeopts.mode:'speed'(default) or'ratio'(denser output, slower encode); an unknown mode throwsRangeError. The default lz4 output bytes differ from the previous release (never larger on the benchmark corpora);decompressis unchanged.
Fixed
- brotli — the decoder mis-decoded prefix codes longer than 9 bits (a 16-bit peek window), and the encoder could emit an empty trailing command after static-dictionary substitution; realistic inputs now round-trip and interoperate with reference implementations.