Commit Graph

131 Commits

Author SHA1 Message Date
Timo Zhang de982cb7d3 Merge pull request #224 from DeryFerd/fix/mcp-inplace-write-confirmation
fix(mcp): require confirm_overwrite before in-place encrypt-strings and bind-scope runs
2026-11-16 23:52:34 +08:00
Timo Zhang e024bfea3d Merge pull request #225 from DeryFerd/fix/mcp-arg-bounds
fix(mcp): bound string-list arguments and reject fractional count arguments
2026-11-16 23:52:29 +08:00
Timo Zhang afad051f33 Merge pull request #226 from DeryFerd/feat/lint-sarif-output
feat(cli): add --sarif to bla lint for CI code scanning
2026-11-16 23:52:25 +08:00
Timo Zhang d6f04b897d Merge pull request #227 from DeryFerd/feat/bundler-skip-summary
feat(bundler): report chunks that shipped unshielded at build end
2026-11-16 23:51:06 +08:00
qybaihe a89e42ae5b docs(skill,mcp,cli): ESM static imports evaluate before the entry hook
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.
2026-11-16 10:06:03 +08:00
DeryFerd 5261b53f6c feat(cli): add --sarif to bla lint for CI code scanning
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).
2026-11-16 02:04:12 +07:00
DeryFerd c8601ac49d feat(bundler): report chunks that shipped unshielded at build end
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.
2026-11-16 02:04:10 +07:00
DeryFerd 15bb942b39 fix(mcp): bound string-list arguments and reject fractional count arguments
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.
2026-11-16 02:04:08 +07:00
DeryFerd bb52850072 fix(mcp): require confirm_overwrite before in-place encrypt-strings and bind-scope runs
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.
2026-11-16 02:04:07 +07:00
qybaihe 98e01cc47b chore(release): bla-agents v3.4.1
Cut 3.4.1 for the optional WASM JS-loader sidecarEntangle hook and the
REA #11144 / #11181 catalog hygiene (JavaScript member-mutation work
allowance).
2026-11-16 02:10:05 +08:00
qybaihe c677256c0f feat(sidecar): optional WASM JS-loader hook for bla.sidecar.v1 strip⇒fail + REA catalog hygiene
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).
2026-11-16 02:09:38 +08:00
qybaihe 84581b6237 docs(site): update GitHub Trending badge to #5 and polish website UX 2026-11-16 01:13:08 +08:00
qybaihe 7f5faf68da chore(release): bla-agents v3.4.0 2026-11-16 00:25:41 +08:00
qybaihe 081e59c036 feat(shield): harden runtime/AST/weave gates, MCP stdio framing, format shields & 5-layer CI red-team suite 2026-11-16 00:19:12 +08:00
qybaihe b2af7a50f8 chore(release): bla-agents v3.3.2
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).
2026-11-15 02:26:18 +08:00
qybaihe 06f29ce97c feat(sidecar): SQLite schema-comment note strip⇒fail + REA catalog hygiene
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).
2026-11-15 02:26:02 +08:00
qybaihe 53b8aae354 chore(release): bla-agents v3.3.1
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).
2026-11-14 02:28:26 +08:00
qybaihe a0def444b8 feat(sidecar): DEX string-pool note strip⇒fail + REA #10227 dimension catalog
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.
2026-11-14 02:27:34 +08:00
Timo Zhang 6b67926337 chore(release): bla-agents v3.3.0 (#201) 2026-11-13 16:34:27 +08:00
Dery Ferdika 5176026df7 test(docs): guard the published benchmark aggregate against the run (#199)
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.
2026-11-13 16:14:08 +08:00
Timo Zhang b61ff1186c feat(esm,sidecar,doctor): ESM native selfSeal & sidecarEntangle, Safetensors sidecar note, honesty & doctor parity (#200) 2026-11-13 16:12:58 +08:00
Timo Zhang 60c81ad31e fix(js): don't ship a CommonJS sidecar preamble into runtime ES module entries (#193)
* 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.
2026-11-13 11:38:07 +08:00
Dery Ferdika 7a5f71db84 test(docs): guard the benchmark claim in localized READMEs and the site README (#191) 2026-11-13 11:37:57 +08:00
qybaihe f3404be3aa feat(sidecar): GGUF metadata-note strip⇒fail + protectGgufBuffer alignment fix + bla-agents@3.2.6
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.
2026-11-13 02:28:03 +08:00
Dery Ferdika 38b9d650b0 feat(ci): guard against version and public-claim drift (#165) 2026-11-12 15:16:15 +08:00
Timo Zhang 0cd513e08e fix(sidecar): .pyc marshal-note is host-verify only (red 2026-11-12) (#175)
* 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.
2026-11-12 14:57:45 +08:00
qybaihe 9c41bb53b0 feat(sidecar): .pyc marshal-note strip⇒fail + bla-agents@3.2.5
Extend opt-in sidecarEntangle to CPython .pyc via a TYPE_ASCII marshal
trailer (__blaPycSidecarDigest) verified by verifyPycSidecarMarshalNote.
importlib ignores post-root trailers so executed bytecode stays equivalent.
protectTarget + hardenProject .pyc post-pass; vector pyc-sidecar-entangle;
default OFF. Catalog NativeAOT + IL2CPP v108 limits (no new densify trips).
2026-11-12 02:27:34 +08:00
qybaihe 3e53a1e5b6 feat(sidecar): ASAR main JS preamble strip⇒fail + bla-agents@3.2.4
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.
2026-11-11 02:25:01 +08:00
qybaihe 889f7ea5ca feat(v3.2.3): structural AST/container audit, PE .enclave section hardening, default decoy entanglement, and 14/14 benchmark equivalence (closes #157)
- 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>
2026-11-10 17:53:27 +08:00
qybaihe 38d26d5219 feat(sidecar): ASAR archive-note strip⇒fail + bla-agents@3.2.2
Plant in-archive `.bla/sidecar.v1.json` when sidecarEntangle is on, binding
enclave/hardware-tee-bridge.js (protect + harden ASAR post-pass). Host-side
verifyAsarSidecarArchiveNote closes strip/alter. Default remains OFF.
2026-11-10 02:13:49 +08:00
qybaihe ea3d165ee3 chore(release): bla-agents v3.2.1
Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-11-09 14:21:46 +08:00
qybaihe 439d0e5ea2 feat(sidecar): Bun companion strip⇒fail + defenseScore honesty gap
Extend opt-in sidecarEntangle to Bun/EOF-preserved native companions via a
sibling .bla-sidecar.v1.json note (generateSidecarBunCompanionNote /
bindBunSidecarEntanglement / entangleBunEntryWithSidecars /
verifyBunSidecarCompanionNote). protectTarget auto-binds the planted
.bunfs-snapshot without rewriting the byte-exact binary; hardenProject
covers Bun-only trees. Add sidecar-entangle-not-enabled defenseScore
soft-cap (93) with sidecarEntangleEnabled / MCP sidecar_entangle_enabled.
Fix harden sidecar post-pass options.inPlace TypeScript break from #148.
Release bla-agents@3.2.0.
2026-11-09 02:16:14 +08:00
Timo Zhang 8cf27e34cc Merge pull request #143 from qybaihe/cursor/nav-drop-shield-badge-f1b4
fix(website): drop nav shield badge and keep desktop nav on one line
2026-11-08 22:14:44 +08:00
Cursor Agent a0a8d3c596 docs(readme): add a cached Star History chart at the end
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>
2026-11-08 14:05:39 +00:00
qybaihe 0637a52067 docs(readme): redesign English and Chinese READMEs with BLA 3.x closed-loop architecture and CrackMe arena
Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-11-08 22:02:47 +08:00
qybaihe 704bc27a5d chore(release): bla-agents v3.1.1
Release v3.1.1 shipping @babel/* v8.1.0 compatibility, WASM custom-section
sidecar strip⇒fail entanglement (bla.sidecar.v1), multi-language JS/TS,
Python, and Native (C/C++/Rust/Go) weave planner & verifier hardening from
subagent dogfooding, and recursive bla_encrypt_strings discovery. Sync
package/identity/lock/challenge SEAL versions and skill frontmatter; add
docs/releases/v3.1.1.md.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-11-08 16:17:48 +08:00
qybaihe 41345ff3f9 feat(sidecar): WASM custom-section strip⇒fail entanglement
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.
2026-11-08 02:12:29 +08:00
qybaihe 8a7d898239 chore(release): bla-agents v3.1.0
Agent-First Closed-Loop Hardening Engine upgrade: Check 7
(`crown-jewel-entanglement`) + syntax validation (`syntaxValid`) + native
C/C++/Rust/Go source weave verification (`verifyNativeWeaveFile`) in
`bla_verify_weave`, `require_agent_weave` gate across `bla_harden` and
`bla_defend`, `crownJewelCandidates` + `dataFlowEntanglementPlan` in
`bla_weave_plan`, and 6-round Red-Blue adversarial weave validation. Sync
package/identity/lock/challenge SEAL versions and skill frontmatter; add
`docs/releases/v3.1.0.md`.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-11-07 21:33:42 +08:00
qybaihe 8f90e567eb chore(release): bla-agents v3.0.1
Python sidecar strip⇒fail preamble completes the JS+Python entanglement
slice (issue #40). Sync package/identity/lock/challenge SEAL versions and
skill frontmatter; add docs/releases/v3.0.1.md.
2026-11-07 02:29:58 +08:00
qybaihe a46ebc9505 docs(sidecar): mark Python strip⇒fail slice landed; queue WASM
Update DESIGN status, STATE residual, and Unreleased changelog for the
Python preamble follow-up to the JS vertical slice.
2026-11-07 02:14:55 +08:00
qybaihe 2c5ea508cf feat(v3.0.0): Agent-Driven Hardening 3.0, bla_verify_weave, Red-Blue Rounds A-F & CrackMe v9 Sovereign 2026-11-06 17:13:33 +08:00
Timo Zhang 20542f3ffa Merge pull request #105 from DeryFerd/docs/drift-fixes
docs: align Node engine, release model, and benchmark figures with code
2026-11-06 14:56:44 +08:00
Timo Zhang 15eb51fd05 Merge pull request #104 from DeryFerd/docs/manifest-signing
docs: document opt-in ed25519 manifest signing
2026-11-06 14:56:40 +08:00
qybaihe eae28c8b8e docs(sidecar): mark JS strip⇒fail slice landed; queue Python/WASM
STATE #2 and design note updated; CHANGELOG Unreleased entry added.
No version bump (still 2.1.0).
2026-11-06 10:05:21 +08:00
DeryFerd 524b9c1a6d docs: align Node engine, release model, and benchmark figures with code
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.
2026-11-06 02:07:04 +07:00
DeryFerd d3572766a3 docs: document opt-in ed25519 manifest signing
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.
2026-11-06 02:04:37 +07:00
qybaihe 198b2de6e8 test+docs: prove bind-scope honesty and in/out-of-scope behaviour
Unit+MCP tests cover public-only validation, host/date evaluation,
runtime hard-fail out of scope, and packaging-gate refuse. Skill/docs
teach default-OFF public contract usage.
2026-11-05 21:41:42 +08:00
qybaihe 52e63f2f04 test+docs: prove discover paging covers full inventory
Add engine+MCP tests that page a 70-file tree without duplicates or
loss, and teach Skill/CLI docs to follow nextOffset when truncated.
2026-11-05 21:31:04 +08:00
qybaihe db54442770 chore(release): bla-agents v2.1.0
Bump package/identity/lock/SEAL blaVersion + Skill guide to 2.1.0.
CHANGELOG and docs/releases/v2.1.0.md cover post-2.0 absorptions
(#78–#88): polymorph report, string XOR encrypt, integrity coverage,
entry self-digest, CrackMe v8, MCP pin, audit --fail-under, ed25519.
Widen skill metadata version regex to 2.x.y. No npm publish.
2026-11-05 16:27:02 +08:00
qybaihe cd218dcc21 docs(skill+plan): real-not-paper entry self-coverage principle
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).
2026-11-05 10:08:24 +08:00