Skip to content

fix(audit): close write, verification, and release gaps - #360

Merged
qybaihe merged 10 commits into
mainfrom
audit/project-hardening-readme
Dec 2, 2026
Merged

qybaihe merged 10 commits into
mainfrom
audit/project-hardening-readme

Conversation

@qybaihe

@qybaihe qybaihe commented Dec 2, 2026

Copy link
Copy Markdown
Owner

Why

Goal: make BLA's write receipts, format routing, run identity, release checks, and README match observable behavior.

The audit reproduced silent auxiliary-file overwrites, a false failure for Python-only directories, missed managed PE metadata beyond 4 KiB, non-reproducible no-seed runs, and several stale test/documentation claims.

What changed

  • Confirm and receipt every file written by MCP bla_protect and bla_defend.
  • Select directory verification invariants from detected member formats.
  • Read bounded PE/CLR locations through the open file descriptor.
  • Persist real-run project seeds and include the seed in the one-way run ID.
  • Allow macOS system path aliases during apply staging.
  • Bound run evidence and release checksum reads; write checksums atomically.
  • Execute a hardened browser bundle in a Node-free VM.
  • Run release coverage and package-member gates, and publish the bla-shield alias with integrity retry.
  • Rework the README around dry-run, mirror, apply/test/restore, MCP, bundler scope, and evidence limits.

Scope

Core detector/output paths, harden and verify engines, MCP receipts, release workflow, benchmark reporting, tests, and the root README. No shield intensity defaults or public MCP tool names changed.

Tradeoffs

Real hardenProject calls without an explicit seed now create or update the project config. The release workflow publishes both package names, so a pre-existing alias with different bytes fails rather than being replaced.

Blast Radius

Artifact format detection, apply staging, MCP write confirmations, release publication, and public landing-page claims. Functional behavior is covered by the full suite and a real CLI apply/restore smoke run.

Verification

  • TypeScript typecheck passed.
  • 258 Vitest files passed: 1,753 passed and 11 platform-gated skips.
  • Coverage: 89.45% statements, 82.78% branches, 95.72% functions, and 89.45% lines.
  • All 16 benchmark fixture checks passed.
  • npm tarball check found 260 files and no maps, tests, or tsbuildinfo members.
  • Real CLI dry-run, mirror execution, apply, promoted execution, restore, and restored execution passed.
  • Independent swarm returned PASS on three lanes. Its release lane found two stale assertions, fixed in 26aed3f; a fresh verifier then returned PASS at the final head.

DeryFerd and others added 10 commits December 2, 2026 00:44
The Python weave verifier counted any indented 'name = {}/[]/dict()' as a shared-state carrier, so function-local containers satisfied the shared-state gate. Anchor the pattern at column 0 so locals and class attributes no longer count, and keep module-level containers working.
Python and native weave reports hardcoded syntaxValid: true while only the JavaScript verifier parses source. Leave the optional field unset for formats without a parser so the report no longer claims a check that never ran.
A caller-chosen run summary could be any size, and sha256File loaded whole artifacts into memory. Cap the summary at 8 MiB and hash artifacts in 1 MiB chunks; both behaviours are covered by focused tests.
Hash the packed tarballs in 1 MiB chunks instead of loading them whole, and write the checksum file through a same-directory temp file plus rename so a crash cannot leave a partial SHA256SUMS.txt.
Execute a hardened browser bundle in a vm context with no process/require and assert its original side effect survives, so the guarded runtime-shield path is covered by a real consumer contract.
@qybaihe
qybaihe merged commit 80d2987 into main Dec 2, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants