# Changelog All notable changes to **bla-agents** are documented here. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] ### Added - **WASM JS-loader hook ESM auto-wire (`detectWasmJsLoaderCarrier` / `esmStaticImportsAreNodeBuiltinsOnly` / `listStaticEsmModuleSpecifiers`, `src/shields/runtime/sidecar-entangle.ts`; protect + harden post-pass):** Extends the 2026-11-16 Node CJS auto-wire so a same-directory Node.js ESM loader (`.mjs` or ESM `.js`) can also receive the already-landed `generateSidecarWasmLoaderSnippet` hook (`carrier: "module"`, `import { createRequire } from "node:module"` + `import.meta.url`). ESM is admitted only when every static `import` / `export-from` specifier is a Node builtin (`fs`, `node:path`, `node:url`, …), so hoisting cannot run user-module side effects or instantiate WASM before the hook. Known names stay `.*`, `loader.*`, `index.*`; `.cjs` still wins a same-rank tie, then `.js`, then `.mjs`. Browser `fetch`-only loaders, ESM files that statically import user modules or `.wasm`, minified / test files, and already-entangled entries remain untouched. Vector `wasm-sidecar-entangle` is recorded and `wasm-sidecar-host-verify-only` is cleared only when the hook was actually written. Default still OFF via existing `sidecarEntangle`. - **defenseScore honesty:** `jsModuleHasHoistedDependencyGraph` no longer treats Node builtin-only static imports as a user hoisted graph, so a dedicated ESM WASM loader does not get a spurious `esm-import-hoist-before-hooks` soft-cap. User-module `import` / `export-from` (e.g. `./lib.js`) is still flagged. - **`REA_INTERNAL_LIMITS` catalog hygiene:** Inspection / walk ceilings from REA tip `05be423ac` (DWARF units, ELF debug-link, ELF DT_NEEDED, Maven/Gradle metadata, NuGet `.nupkg`, Android OTA / boot image). Honesty catalog only, not densify trip targets. ### Notes - REA tip `05be423ac` (+41 since `26d88826c`): new offline analyzers (Android OTA / boot, Maven POM + Gradle module, NuGet, DWARF compile units, ELF debug-link, ELF dynamic dependencies, CycloneDX Go/Rust projection) plus PE certificate-table alignment padding reject (#11823), HAR body-identity (#11829), and more LimitRef typed refusals. **No new 1:1 trip-able densify constants.** Planting DT_NEEDED / OTA operations / boot ramdisks / Maven dependency rows would break the protected artifact; file-byte and pagination ceilings are admission/walk caps, not plantable budgets. ## [3.4.3] — 2026-11-17 Patch shipping architecture-matched **PE32 (`0x014c`) / ARM64 (`0xaa64`) / ELF32 (`0x03`)** mapped `.enclave` code islands with executable `0x60000020` (`R-X`) flags, intra-island `CALL`/`BL` + PC-relative xref topology, in-bounds `[ImageBase, ImageBase + SizeOfImage)` manifest RVAs, and zero unmapped EOF overlay (Issue #157); structural **anti-marker-spoofing** across 11 artifact formats + SQLite `GENERATED ALWAYS AS` false-positive fix (Issue #155); and **fail-closed GGUF / CLI / MCP / SARIF / runtime hygiene** across 22 merged PRs (`#231`–`#252`). ### Added - **Architecture-Matched Native `.enclave` Islands & ELF32 Mapped `.so` Support (`src/shields/formats/native.ts`, `src/engine/protector.ts`, `src/shields/chaff/chaff-generator.ts`, `src/shields/deception/system-diagnostic-decoy.ts`):** Emits native 32-bit x86 cdecl/stdcall islands (`i686-pc-windows-msvc` PDB) on PE32/ELF32 and AArch64 `bti c` islands (`aarch64-pc-windows-msvc`) on ARM64 PE/ELF, marks `.enclave` `0x60000020` (`R-X`, strict `W^X`), wires intra-island call/data xrefs, samples `SYMBOL_OFFSET_MANIFEST` addresses strictly inside mapped sections, matches Windows/Linux diagnostic catalogs, and omits the unmapped EOF trailer when `.enclave` is mapped. Exports `validateElfLayout` alongside `validateElf64Layout`. - **CLI `--require-artifact` on `verify-manifest` & MCP String/Numeric Bounds (`src/cli.ts`, `src/core/manifest-verify.ts`, `src/mcp/server.ts`):** Fails `verify-manifest` when `--require-artifact` is set and the protected artifact is missing (#245), bounds MCP string argument length (`65,536` chars) and numeric magnitude (`1e9`) (#248), forwards `bla_inspect_release` `max_files` / `max_total_bytes` (#240), and sets `destructiveHint: true` on mutating MCP tools (#241). ### Fixed - **Structural Anti-Marker-Spoofing Across 11 Formats & SQLite Generated-Column Accuracy (`src/engine/auditor.ts`, `src/shields/formats/{firmware-uf2,pcap-capture,erlang-beam,evm-bytecode,gpu-ptx,python,wasm,jvm-bytecode,sqlite}.ts`):** Requires exact container framing, constant-pool/section parsing, and multi-decoy structural counts before reporting `BLA_PROTECTED` or passing `verifyTarget`, and avoids misclassifying ordinary SQLite 3.31+ `GENERATED ALWAYS AS` user columns as protected. - **Fail-Closed GGUF Input & Alignment Bounds (`src/shields/formats/model.ts`, `src/shields/formats/gguf-layout.ts`, `src/setup/doctor.ts`):** `protectGgufBuffer` refuses non-GGUF inputs instead of synthesizing an empty container (#231), bounds `general.alignment <= 1 MiB`, and refuses to truncate tensor data (#232). - **CLI, Lint, Runtime & Terminal/SARIF Hygiene (`src/cli.ts`, `src/mcp/server.ts`, `src/core/{sarif,manifest-signing}.ts`, `src/engine/{harden,packaging-gates,plaintext-secret-lint,panel-derive-abi-lint,wasm-seal-xor-known-plaintext-lint}.ts`, `src/shields/runtime/{self-seal,sidecar-entangle}.ts`, `src/shields/tarpit/tarpit-generator.ts`):** Validates CLI flags ahead of `--mcp` / empty-subcommand early returns (#233), rejects `--manifest*` flags on `protect` (#234), resolves `harden` `.blarc` seeds in project root rather than `/.blarc` (#235), wires `.blarc` `honeySourceMaps` into `protect`/`defend` (#236), escapes chaff in Python docstrings (#237), sanitizes control sequences in `harden` and SARIF outputs (#238, #249), detects escaped plaintext secrets (#239), skips symlinked/hidden dirs in seal-xor walk (#242), redacts operator absolute paths in MCP error messages (#243), preserves external `.deriveLocal` property accesses (#244), enforces valid JS identifiers on `bindingName` overrides (#250), compares pinned SPKI in constant time (#251), and syncs documented format count (`26`) across all 20 READMEs (#246). ## [3.4.2] — 2026-11-16 Patch auto-wiring the optional WASM JS-loader hook into a known, safe Node.js CommonJS loader path (so `wasm-sidecar-entangle` is recorded and `wasm-sidecar-host-verify-only` is cleared only when that hook actually ships), plus `REA_INTERNAL_LIMITS` catalog hygiene for REA's newly advertised SQLite worker heap, and the post-3.4.1 honesty / MCP / CI / bundler work already on main. ### Added - **WASM JS-loader hook auto-wire (`selectNodeWasmJsLoader` / `discoverNodeWasmJsLoader` / `isSafeNodeWasmJsLoader`, `src/shields/runtime/sidecar-entangle.ts`; protect + harden post-pass):** When `sidecarEntangle` is on, `protectTarget` and `hardenProject` now inject the already-landed `generateSidecarWasmLoaderSnippet` hook into a *same-directory Node.js CommonJS* loader that already uses `fs` and `WebAssembly.instantiate` / `compile` / `instantiateStreaming` and mentions the `.wasm` basename (preferred names: `.cjs`/`.js`, `loader.*`, `index.*`; `.cjs` wins a same-rank tie). Browser `fetch`-only loaders, ESM static `import` / `import.meta`, minified / test files, already-entangled self-seal / sidecar-preamble entries, and unranked app files such as `license.cjs` are left untouched. The hook is written before the WASM `bla.sidecar.v1` custom section is planted (and before a JS sidecar preamble), and a new section is planted only when the only JS/Python entry being bound is the dedicated loader itself. Export surface and function bodies stay unchanged. Only then is vector `wasm-sidecar-entangle` recorded and defenseScore gap `wasm-sidecar-host-verify-only` cleared (`wasmSidecarLoaderHookApplied`, also detected by `verifyTarget` via `isWasmSidecarLoaderHookWired`). Default still OFF via existing `sidecarEntangle`. - **defenseScore honesty gap `esm-import-hoist-before-hooks` (soft-cap 93):** ESM static `import` / `export-from` bindings are instantiated before any statement in the entry, including the prepended `sidecarEntangle` / `self-seal` IIFE. The entry body still fail-closes on sidecar strip or hook failure, but imported module side effects already ran — this is not process-start strip⇒fail for the hoisted graph (CJS `require()` after the preamble is unaffected). `jsModuleHasHoistedDependencyGraph` detects the case (ignoring the BLA `createRequire` preamble); `verifyTarget` annotates the gap when sidecar or self-seal is on. Skill B / DESIGN / MCP / CLI wording updated so "full runtime strip⇒fail" is not overclaimed (red 2026-11-16). - **`REA_INTERNAL_LIMITS` catalog hygiene:** `SQLITE_WORKER_HEAP_BYTES` (256 MiB) — newly advertised SQLite owned-worker heap ceiling on REA tip `26d88826c`. Honesty catalog only, not a densify trip target. ### Notes - Also includes the post-3.4.1 main commits already on `de982cb` (MCP in-place overwrite confirmation and argument bounds, `bla lint --sarif`, coverage-floor enforcement, reporter control-character sanitization, bundler unshielded-chunk skip summary, Node 22 engines-floor pin, multilingual SEO). - REA tip `26d88826c` (+208 since `f916b3ecf`): mostly CLI/MCP ownership refactors and projecting existing fixed allowances as typed refusals. **No new 1:1 trip-able densify constants.** Catalogued the SQLite worker heap; evidence format revision 2 and tool-output ceilings are not plantable in a protected program. ## [3.4.1] — 2026-11-15 Patch adding an optional **JS-loader hook** for WASM `bla.sidecar.v1` custom-section verification, plus `REA_INTERNAL_LIMITS` catalog hygiene for REA's new JavaScript member-mutation work allowance. ### Added - **Optional WASM JS-loader hook (`generateSidecarWasmLoaderSnippet` / `prependWasmSidecarLoaderHook` / `entangleWasmLoaderWithSidecars` / `computeWasmSidecarCodeIdentity`, `src/shields/runtime/sidecar-entangle.ts`):** Emits a self-contained host JS snippet that wraps `WebAssembly.instantiate`, `WebAssembly.compile`, and `WebAssembly.instantiateStreaming`. When the instantiated module's code identity (SHA-256 of the binary with `bla.sidecar.v1` stripped) matches a protected module, the hook re-runs the same sidecars-mode digest as `verifyWasmSidecarCustomSection` and fails closed if the custom section is missing or sibling sidecars were stripped/altered. Unrelated WASM modules pass through unchanged. Export surface and function bodies stay intact. Host-opt-in: the hook runs only when the customer prepends or evals the snippet in the loader that actually instantiates the module. Vector `wasm-sidecar-entangle` stays reserved, not recorded; defenseScore gap `wasm-sidecar-host-verify-only` (soft-cap 93) remains until a protect/harden path actually injects the hook. Default still OFF via existing `sidecarEntangle`. - **`REA_INTERNAL_LIMITS` catalog hygiene:** `JAVASCRIPT_MEMBER_MUTATION_ALIAS_STATES` (524,288) / `JAVASCRIPT_MEMBER_MUTATION_ALIAS_STATES_MAX` (8,388,608) — REA #11144 / #11181 recoverable analysis budget (`javascript.member_mutation_alias_states`). Honesty catalog only, not a densify trip target. ### Notes - REA tip `f916b3ecf` (+320 since `1ba93b460`): mostly evidence/contract/limit-ownership refactors, MCP schema annotations, and recoverable budgets (`javascript.member_mutation_alias_states`, `REA_BRIDGE_MAX_REPLY_BYTES`, `REA_CAPTURE_PACKET_JSON_EXPANSION_BYTES`). **No new 1:1 trip-able densify constants.** Catalogued the member-mutation allowance; tool-reply and pcap expansion ceilings are not plantable in a protected program. ## [3.4.0] — 2026-11-16 Minor release shipping **one-way public sidecar seed tags (`scn1-<32hex>`) & zero-prefix JS AST entanglement**, **multi-site `self-seal` non-cancellation & anti-hook parity**, **anti-gaming `bla_verify_weave` closed-loop gates**, **dual-mode MCP `Content-Length`/newline stdio framing + 31-tool MCP annotations + plugin manifests**, **JVM Spec §4.7.1 `BlaEnclaveDelegation` class-attribute emission**, **JSX/TSX/directive-safe `encryptStrings`**, and an automated **5-Layer CI Red-Team Adversarial Regression Gate**. ### Added - **One-Way Public Sidecar Seed Tag (`derivePublicSidecarSeedTag`, `src/shields/runtime/sidecar-entangle.ts`, `src/engine/harden.ts`, `src/engine/protector.ts`):** Derives a one-way `scn1-<32hex>` public binding tag from the private hardening seed across JS/TS, Python, `.pyc`, WASM, ASAR, Bun, SQLite, DEX, GGUF, and Safetensors sidecars so sibling verification stays deterministic with zero cleartext master-seed or `__blaSidecar*` marker leakage. - **MCP Protocol Framing, Tool Annotations, Cancellation & Plugin Manifests (`src/mcp/server.ts`, `.mcp.json`, `.claude-plugin/plugin.json`):** Supports UTF-8 byte-accurate `Content-Length` framing alongside newline-delimited JSON-RPC, attaches MCP `annotations` (`readOnlyHint` / `destructiveHint` / `idempotentHint` / `openWorldHint`) across all 31 tools, honors queued `notifications/cancelled` before `bla_harden` begins, aligns `bla_verify` and `bla_lint*` parameters/status parity with engine & CLI, and ships root `.mcp.json` + `.claude-plugin/plugin.json` kept in version lockstep by `scripts/sync-version.mjs`. - **JVM Spec §4.7.1 Class Attribute Injection & EVM EIP-170 Cap (`src/shields/formats/jvm-bytecode.ts`, `src/shields/formats/evm-bytecode.ts`):** Walks complete `.class` `interfaces[]` / `fields[]` / `methods[]` / `attributes[]` tables to emit a spec-valid `BlaEnclaveDelegation` `attribute_info` (`customAttributesAdded: 1`, zero trailing bytes), and adds `enforceEip170Cap` (24,576-byte runtime code ceiling) + `exceedsEip170Limit` reporting to `protectEvmBytecodeBuffer`. - **5-Layer CI Red-Team Adversarial Regression Gate (`tests/redteam-ci-five-layer-gate.test.ts`):** Automated end-to-end adversarial suite covering AST prefix/manifest stripping + VM equivalence, multi-site `self-seal` 1-byte tamper fail-closed behavior, `verifyWeaveTarget` anti-gaming (`>15` padding functions, `& 0` / `^ self` / `* 0` zero-entropy weaves, indirect boolean gates), `hardenProject` zero seed leakage, JVM §4.7.1 exact-EOF layout, oversized seal fail-closed refusal, WebCrypto AES unwrap lint, and TSX/directive-safe `encryptStrings`. ### Fixed - **Multi-Site `self-seal` XOR Self-Cancellation & Runtime Inspector/Hook Detection (`src/shields/runtime/self-seal.ts`, `src/shields/runtime/runtime-shield.ts`, `src/engine/verifier.ts`):** Prevents even-count interleaved sites from XOR-cancelling the tamper parity bit (`1 ^ 1 === 0`), folds `NODE_OPTIONS` / `process.execArgv` / `node:inspector.url()` and native `Function.prototype.toString` / `fs.readFileSync` identity checks into runtime sealing, and verifies canonical `selfExpected` digests offline inside `verifyTarget`. - **JS AST Shield Template Prefix Scrubbing & Parameter-Entangled Local Seeds (`src/shields/javascript/ast-shield.ts`):** Scrubs generator-specific `obligationFlood_` / `scc_` / `labyrinthDispatch_` / `fridaCaptureSaturator_` / `_shadowVault_` prefixes, eliminates dead `void [...]` manifest statements, builds cyclic cross-call meshes, and mixes plain function parameters into local opaque-predicate seeds against naive constant folding. - **Weave Verifier Anti-Gaming & Fail-Closed `requireAgentWeave` (`src/shields/weave/weave-decoy.ts`, `src/engine/harden.ts`):** Audits all functions (removing the 15-function cap on Check 7), rejects algebraic zero-entropy expressions, traces local-variable boolean returns, extracts Express/Fastify/Electron IPC inline handlers and HTML `