Commit Graph

564 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 17df4c8f38 Merge pull request #229 from DeryFerd/ci/enforce-coverage-floors
ci: actually enforce the configured coverage floors
2026-11-16 23:52:21 +08:00
Timo Zhang 7b5ff4df40 Merge pull request #223 from DeryFerd/fix/reporter-control-char-sanitize
fix(ui): strip control characters from artifact-derived report text
2026-11-16 23:51:11 +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
Timo Zhang 78c094dd58 Merge pull request #228 from DeryFerd/ci/pin-node-22-floor
ci: pin the ubuntu Node 22 leg to the declared engines floor
2026-11-16 23:51:02 +08:00
Timo Zhang eaae86765d Merge pull request #230 from qybaihe/fix/esm-import-hoist-honesty
feat(honesty): annotate ESM import-hoist before sidecar/self-seal hooks
2026-11-16 23:50:56 +08:00
qybaihe 883c5bac10 feat(seo): optimize multilingual SERP metadata, Schema.org graph, sitemap & crawl links 2026-11-16 17:47:51 +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
qybaihe b7c92f7987 test(honesty): ESM sidecar hoist side effects vs CJS process-start
Prove that deleting a sidecar after ESM-native entanglement still
prints imported module side effects before integrity binding mismatch,
that a CommonJS require graph does not, and that verifyTarget only
annotates esm-import-hoist-before-hooks for the hoisted ESM case.
Intact artifacts stay functionally equivalent (RESULT 5).
2026-11-16 10:06:03 +08:00
qybaihe f6feeac305 feat(honesty): annotate ESM import-hoist before sidecar/self-seal hooks
ESM static import/export-from bindings are instantiated before any
statement in the entry, including a prepended strip⇒fail IIFE. The
entry body still fail-closes, but imported module side effects already
ran — that is not process-start coverage for the hoisted graph.

Add jsModuleHasHoistedDependencyGraph (ignoring the BLA createRequire
preamble), defenseScore gap esm-import-hoist-before-hooks (soft-cap 93),
and wire it through verifyTarget when sidecar or self-seal is on.
2026-11-16 10:05:59 +08:00
DeryFerd 241b3bef05 ci: pin the ubuntu Node 22 leg to the declared engines floor
package.json requires `^22.23.4 || >=24.0.0` and STATE.md documents the final
gate matrix as Node 22.23.4 plus Node 24.22.1, but the CI matrix asked for the
floating `22` alias, so the leg could silently resolve below the supported
floor and never proved the minimum we declare. Pin it to 22.23.4 and describe
the matrix accurately in STATE.md.
2026-11-16 02:04:52 +07: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 b3eb7db298 ci: actually enforce the configured coverage floors
vitest.config.ts defines statements 85 / branches 76 / functions 94 / lines 85
over src/**, but no job ever passed --coverage, so the floors could not fail a
build. The primary leg (ubuntu, Node 24) now runs the suite with coverage; the
other legs keep the plain run so total CI time stays roughly flat.

Measured on this revision: statements 86.17%, branches 77.81%, functions 94.6%,
lines 86.17% — above every floor. A targeted run against a small subset fails
the thresholds as expected, so the gate is live rather than decorative.
2026-11-16 02:04:11 +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
DeryFerd 9183898f1a fix(ui): strip control characters from artifact-derived report text
Everything the report layer prints about a run comes from the tree it is
protecting, so a file name carrying `ESC]` or a raw C1 control character could
retarget the terminal that reports on it. `sanitizeTerminalText` now lives in
`src/core/terminal-text.ts`, the reporter imports and re-exports it, and every
formatter that renders artifact-derived text uses it — including
`formatPackagingGatesReport`, which is the formatter behind `bla lint` and was
the remaining hole.
2026-11-16 02:04:06 +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).
bla-agents-3.4.1
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 bla-agents-3.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
Dery Ferdika 0c5b7fc5d2 test(agents): guard the AGENTS.md shield inventory against drift (#222)
AGENTS.md is the map an agent reads before touching this repo, and two
bullets had drifted again after the inventory sync in #198: the formats
bullet omitted dex-layout.ts and the deception bullet omitted
hypothesis-revision-decoy.ts.

Name both files and add a guard test that compares each bullet against
its directory, so the next shield lands with its inventory entry.
2026-11-15 20:17:36 +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).
bla-agents-3.3.2
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).
bla-agents-3.3.1
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 f8e5add6e8 feat(seo): add sitemap, robots.txt, llms.txt, canonical/hreflang, OG PNG card & JSON-LD (#216) 2026-11-14 01:34:09 +08:00
4n5rud f44415a04a fix(wasm): keep the section walk defensive on a truncated section header (#215) 2026-11-14 00:29:18 +08:00
Dery Ferdika ff6363d374 feat(cli): add verify-sidecar offline strip-fail command (#207) 2026-11-14 00:25:40 +08:00
Dery Ferdika 035995ca43 feat(cli): expand --self-seal-sibling-glob patterns into protect sibling paths (#206) 2026-11-14 00:16:03 +08:00
Dery Ferdika 9420fed925 refactor(sidecar): share sidecar-part collection across verify* host checks (#211) 2026-11-14 00:15:56 +08:00
Dery Ferdika a11c10f0cd fix(walk): surface bounded-walk read errors through harden discovery reports (#204) 2026-11-14 00:15:51 +08:00
Dery Ferdika f15bfce014 refactor(archive): drop dex/metadata name checks subsumed by endsWith (#213) 2026-11-14 00:14:50 +08:00
Dery Ferdika c7d5c7fa9c test(coverage): add v8 coverage config with baseline thresholds (#210) 2026-11-14 00:14:45 +08:00
Dery Ferdika d9a5a3a6b0 test(shields): add dedicated tarpit and chaff generator suites (#209) 2026-11-14 00:14:39 +08:00
Dery Ferdika a2cac601a0 feat(scripts): add --dry-run preview to sync-site (#208) 2026-11-14 00:14:29 +08:00
Dery Ferdika 77cdd3ba64 chore(release): refuse non-semver package.json versions in sync-version (#205) 2026-11-14 00:14:23 +08:00
Dery Ferdika fe88f3ef78 fix(sidecar): plan coverage from bytes actually bound in all bind* paths (#203) 2026-11-14 00:14:17 +08:00
Dery Ferdika bf121804d7 fix(gates): align panel-derive refuseMessage with record condition and actual blocking (#202) 2026-11-14 00:14:08 +08:00
Timo Zhang de7a325bde feat(shield): parameterized MBA substitutions, multi-round hypothesis decoys & release-hygiene gate (#214) 2026-11-13 22:15:00 +08:00
Timo Zhang 6b67926337 chore(release): bla-agents v3.3.0 (#201) bla-agents-3.3.0 2026-11-13 16:34:27 +08:00
4n5rud 7f98d03c81 fix(doctor): print the real readiness verdict, engine states and issues (#196)
* feat(doctor): probe model/BEAM/EVM shields and surface SQLite for subsystem parity

* fix(doctor): print the real readiness verdict, engine states and issues
2026-11-13 16:27:21 +08:00
4n5rud 4231f4ed2c fix(detector): stop classifying extensionless CRLF text as CPython .pyc (#195) 2026-11-13 16:27:16 +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
Dery Ferdika 92b9bb4cc7 docs(agents): sync AGENTS.md with the real shield inventory (#198)
The guide had drifted from the code: it claimed 19 artifact formats where
detector.ts routes 26 (ArtifactFormat), listed 13 of the 27 files under
src/shields/formats/, omitted weave/, runtime/self-seal.ts and
javascript/node-runtime-carrier.ts, summarised src/engine/ as five files of
23, and listed 7 of the 31 MCP tools.
2026-11-13 16:14:03 +08:00
Dery Ferdika d04a9729c2 fix(benchmark): seed the showcase run so the reported figures are reproducible (#197)
The 14-target showcase called protectTarget() without a seed, so every run
minted a fresh project seed via generateProjectSeed() (crypto.randomBytes) and
emitted different decoys. The aggregate token/cost multiplier therefore changed
run to run (observed 1065.9x-1068.7x on the same commit), which made the
published figures impossible to reproduce or guard.

runShowcaseBenchmark() now takes an optional seed and defaults to a fixed
showcase seed; the CLI passes --seed through, which it previously accepted and
silently ignored.
2026-11-13 16:13:56 +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