Update Skill B, DESIGN, STATE, CHANGELOG [Unreleased], MCP
sidecar_entangle descriptions, and CLI help so ESM-native preambles
are not described as full process-start strip⇒fail. Keep the
CJS-into-ESM functional-equivalence rule; document the hoist gap.
buildSarifReport already turns audit findings into SARIF 2.1.0, but the
packaging gates — the surface a release pipeline actually blocks on — could only
print text or --json, so their findings never showed up in GitHub code scanning
annotations.
buildPackagingGatesSarif maps each gate to one rule, refusing findings to
error, informational findings to note, and emits paths with forward slashes.
`bla lint --sarif` prints it and keeps the existing exit code (2 on refusal).
With failBuildOnError false (the default) a chunk whose transform throws is
passed through untouched, and the only evidence was a console.warn per chunk
that is easy to lose in a large build log. A partial shield is exactly the kind
of implicit claim the rest of BLA refuses to leave unsaid.
Rollup/Vite and esbuild now print one summary from their build-end hook, and the
webpack plugin prints it at the end of the asset stage, listing every chunk that
shipped unprotected. Default behaviour for successful builds is unchanged (no
summary, same pass-through for bad chunks).
Also corrects the documented Vite option name (`honeySourceMap`, not
`enableHoneySourceMaps`) in the same guide.
validateMcpToolCall checked array items but never their count, and accepted
1.5 for count arguments, so a single tools/call could hand the engine an
unbounded list or a fractional cap. String lists (wasm_preserve_exports,
domains) are now capped at 1024 items and count fields (max_artifacts,
max_files, max_total_bytes, max_targets, offset) declare integer: true, which
the validator enforces with the existing -32602 contract.
Fractional drift thresholds stay accepted: same_threshold / different_threshold
are drift scores, not counts, and rejecting them would refuse a legitimate call.
bla_harden, bla_defend and bla_protect already refuse to rewrite existing files
until confirm_overwrite is true. bla_encrypt_strings and bla_bind_scope instead
wrote in place unconditionally, so an MCP client could clobber a user's
panel.html / license.cjs / entry without a confirmation step.
Both tools now resolve their planned outputs with a zero-write dry run, refuse
with the existing confirmation_required payload, and attach the same
writeReceipt contract once a write actually happens. Dry runs and runs that
write nothing stay confirmation-free.
Cut 3.4.1 for the optional WASM JS-loader sidecarEntangle hook and the
REA #11144 / #11181 catalog hygiene (JavaScript member-mutation work
allowance).
Add generateSidecarWasmLoaderSnippet / prependWasmSidecarLoaderHook /
entangleWasmLoaderWithSidecars / computeWasmSidecarCodeIdentity so a host JS
loader can wrap WebAssembly.instantiate, compile, and instantiateStreaming
and fail closed when a protected module's bla.sidecar.v1 custom section is
stripped or sibling sidecars are altered. Unrelated WASM passes through.
The hook is host-opt-in; wasm-sidecar-entangle stays unrecorded and the
wasm-sidecar-host-verify-only honesty gap remains until a protect/harden
path actually injects the hook. sidecarEntangle stays default OFF.
Catalogue REA #11144 / #11181 javascript.member_mutation_alias_states as
REA_INTERNAL_LIMITS (recoverable budget, not a densify trip target).
Cut 3.3.2 for the SQLite schema-comment sidecarEntangle increment and
the REA #4445 / #9756 catalog hygiene (NativeAOT work-budget scaling
and Android split-fact report allowances).
When sidecarEntangle is opted in, plant an unused bla_sidecar_v1 VIEW
(SELECT '<json>' AS "bla.sidecar.v1" WHERE 0) binding sibling sidecars
(generate/bind/entangle/verifySqliteSidecarSchemaComment). User tables,
rows, query results, WAL/FK, and application_id/user_version stay
unchanged. Host-verify only — do not record sqlite-sidecar-entangle
until a load-time hook lands; defenseScore annotates
sqlite-sidecar-host-verify-only (soft-cap 93). Default remains OFF.
Also catalogues REA #4445 NativeAOT work-budget scaling
(NATIVE_AOT_BASE_WORK_UNITS + 8 units/byte; a relaxation, not a new
densify target) and REA #9756 ANDROID_NATIVE_SPLIT_TYPES / _TYPE_CHARS
(report allowance only).
Cut 3.3.1 for the DEX string-pool sidecarEntangle increment, the
REA #10227 DEX_ARRAY_DIMENSIONS catalog, and the already-landed
post-3.3.0 work (MBA substitutions, hypothesis-revision decoys,
release-hygiene gate, verify-sidecar CLI, technical SEO).
When sidecarEntangle is opted in, plant an unreferenced sort-last
bla.sidecar.v1= binding string in the official DEX string pool
(generate/bind/entangle/verifyDexSidecarStringPoolNote). Existing string
indices and instruction bytes stay unchanged; Adler32/SHA-1 are recomputed;
protectAndroidDexBuffer trailers are preserved. Host-verify only — do not
record dex-sidecar-entangle until a load-time hook lands; defenseScore
annotates dex-sidecar-host-verify-only (soft-cap 93). Default remains OFF.
Also catalogues REA_INTERNAL_LIMITS.DEX_ARRAY_DIMENSIONS = 255 (REA #10227
dexTypes admission). Honesty catalog only; not a densify trip target.
README.md, STATE.md and the localized README each published a different
aggregate (639.5x vs 612.5x) and every per-target row in both benchmark tables
was stale. Refresh both tables and the aggregate line from a live run, and add
a guard that keeps the three surfaces equal and within 10% of the computed
showcase aggregate.
* fix(js): treat top-level await and import.meta as an ES module carrier
A .js entry with module-only syntax but no static import/export (top-level
await, import.meta) was classified as a script carrier. Node evaluates such a
file as an ES module (syntax detection), so with sidecarEntangle the CommonJS
strip=>fail preamble hit an undefined require() and the INTACT protected
artifact died with "integrity binding mismatch".
Use Babel's unambiguous program.sourceType as an additional module signal in
both the shield's effective carrier and detectJsCarrierForSource, so the
existing #162 refusal fires instead of shipping a broken entry.
Red 2026-11-13.
* fix(js): honor package.json "type": "module" before binding a sidecar preamble
A .js entry with no import/export syntax under a "type": "module" package is
still an ES module at runtime. The carrier check only looked at syntax and the
.mjs/.cjs extension, so sidecarEntangle prepended the CommonJS strip=>fail
preamble and the intact hardened entry threw "integrity binding mismatch"
(protect and harden alike; reproduced with `bla harden --sidecar-entangle`).
Add resolveNodePackageModuleType / refineJsCarrierForRuntimePaths (nearest
package.json wins, as in Node) and apply it to the output and input locations
in protectTarget and the harden post-pass, so the #162 refusal fires and the
artifact keeps running. Without sidecarEntangle nothing changes.
Red 2026-11-13.
* docs(mcp,cli): state that sidecar_entangle refuses ES module JS entries
The sidecar_entangle MCP parameter (bla_harden / bla_protect / bla_defend) and the --sidecar-entangle CLI help now say the JS preamble is CommonJS and which entry shapes count as ES modules, so an agent can disable the option or pick a CommonJS entry instead of hitting the refusal blind.
* docs(skill): runtime carrier decides whether a sidecar preamble is safe
Skill B principle (CommonJS preamble on a runtime ES module breaks the intact artifact; refuse instead), design-doc follow-up entry, and CHANGELOG [Unreleased] note for the 2026-11-13 red finding. ESM-native preamble left as TBD.
Extend opt-in sidecarEntangle to GGUF via a bla.sidecar.v1 STRING metadata KV
(generateSidecarGgufMetadataNote / bindGguf / entangleGguf / verifyGguf), with
alignment-safe rebuildGguf so tensor bytes stay bit-exact. Host-verify only
(loaders ignore unknown STRING keys); do not record gguf-sidecar-entangle until
a load-time hook lands; defenseScore gap gguf-sidecar-host-verify-only.
Also fix protectGgufBuffer which previously corrupted tensor data by splicing
KV bytes without re-padding the aligned data section. Default OFF.
* fix(sidecar): do not claim pyc-sidecar-entangle for a host-only trailer
The TYPE_ASCII marshal note is ignored by importlib, so strip or sibling
delete still execute. Recording pyc-sidecar-entangle (and clearing the
strip⇒fail defenseScore gap) was paper coverage. Keep planting the note
and host verifyPycSidecarMarshalNote; annotate pyc-sidecar-host-verify-only
until an import-time hook lands.
* test(sidecar): assert .pyc marshal notes stay host-verify only
protectTarget must not list pyc-sidecar-entangle; importlib still returns
the same RESULT after trailer strip or sidecar delete, while the host
verifier fails closed. defenseScore keeps cap 93 via the new gap when
the host-only note is enabled.
* docs(skill,state): sidecar vectors require a process-start hook
Skill B: only record a countered strip⇒fail sidecar vector when the
entry hook hard-fails at process start or import. Host-only verifiers
(such as verifyPycSidecarMarshalNote) are binding notes, not coverage.
CHANGELOG/STATE/DESIGN record the 2026-11-12 honesty residual.
Complete opt-in ASAR sidecar entanglement with an in-archive Electron main
JS preamble (generateSidecarAsarMainJsPreamble / selectAsarMainJsMember /
entangleAsarMainJsWithSidecars) that re-measures decoy members via
fs-patched readFileSync. Digest labels stay asar-root-relative for parity
with .bla/sidecar.v1.json; protect + harden wire when sidecarEntangle is
on (default OFF). REA +12 since e9b6c87c1 had no new 1:1 densify budgets.
- Replace substring marker checks and hardcoded decoy counts in src/engine/auditor.ts, src/shields/formats/mobile-game.ts, and src/shields/formats/native.ts with structural Babel AST verification and container header/checksum checks across JS/TS, Python, Android DEX (file_size + Adler32), Unity IL2CPP, ZIP/APK, SourceMap, Apple Plist, .NET Managed, JVM .class, and Native binaries.
- Upgrade Windows PE32/PE32+ hardening in src/shields/formats/native.ts to inject a mapped .enclave COFF section (0x40000060) and section-alignment slack with 16-byte aligned x86-64 ABI function islands, MSVC C++ RTTI descriptors, CodeView RSDS PDB debug records, and Win32 Crypto/BCrypt/NCrypt/WinHTTP symbols while updating NumberOfSections, SizeOfImage, and CheckSum (closes#157).
- Remove self-sabotaging decorative-deception-signal and none-client-side-only strings from emitted runtime-shield JS code while preserving TypeScript classification metadata.
- Entangle all injected JS decoy/tarpit functions into the opaque-predicate seedVarName initializer by default so stripping decoys breaks execution without requiring --self-seal.
- Upgrade all 14 showcase benchmark targets in src/engine/benchmark.ts to run real before/after VM execution, SQL query parity, Float32 tensor weight equality, or container payload preservation checks.
Co-Authored-By: Claude Code <noreply@anthropic.com>
Link the official light and dark Star History chart for qybaihe/bla so the image opens the full history page. The chart stays a remote cached SVG, and each translated README gets the same embed with its own alt text.
Co-authored-by: Timo Zhang <qybaihe@gmail.com>
Plant a bla.sidecar.v1 custom-section note with the sidecars-mode binding
digest + path labels (no export/behavior change). Host-side
verifyWasmSidecarCustomSection re-hashes siblings for strip/alter fail.
Wire protectTarget (.wasm) and harden WASM-only post-pass when
sidecarEntangle is on (default OFF). DESIGN/STATE/CHANGELOG updated.
The install guide advertised Node ^22.13.0 while package.json requires ^22.23.4; STATE.md called releases tag-only although the release workflow can publish to npm with provenance; and the README benchmark was a v1.4.0 run on a v2.1.0 project. Refresh the numbers from a local v2.1.0 benchmark (639.5x tokens / 304.4x cost, 14/14 runtime-exact) and align the AGENTS.md engine range.
README still said manifests were unsigned, and the CLI reference omitted --sign-manifest/--manifest-key entirely, so the feature merged in #88 was undiscoverable. Describe the flags, the signature shape, the fail-closed key behavior, and the library verification contract.
Skill section B: entry counts as self-covered only when its runtime check
hard-fails on its own bytes; check integrityCoverageSelfVerified; keep
host-trust values inside covered artifacts. STATE/CHANGELOG/design note
record the 2026-11-05 CrackMe v8 round (NO PRIZE, REA unverified).