Skip to content

armgit / bla

Public Imported from GitHub
0

๐Ÿ›ก๏ธ BLA (Blind LLM Agents) โ€” Adversarial defense shield that protects binaries, Electron apps, JS bundles, Python, and WebAssembly against AI reverse-engineering agents like REA. Poison -> Exhaust -> Hallucinate.

feat(ui): add formatOneClickDefenseReport CLI output formatter

qybaihe426666eec297
diff --git a/src/ui/reporter.ts b/src/ui/reporter.ts
index 6da9cbf..c70e3d4 100644
--- a/src/ui/reporter.ts
+++ b/src/ui/reporter.ts
@@ -7,6 +7,7 @@ import type {
} from "../core/types.js";
import type { DoctorDiagnosticReport } from "../setup/doctor.js";
import type { SetupRunResult } from "../setup/setup.js";
+import type { OneClickDefenseReport } from "../engine/defender.js";
const ANSI = {
reset: "\x1b[0m",
@@ -224,3 +225,48 @@ export function formatSetupReport(res: SetupRunResult): string {
return lines.join("\n");
}
+
+export function formatOneClickDefenseReport(rep: OneClickDefenseReport): string {
+ const lines: string[] = [
+ formatBanner(),
+ "",
+ `${ANSI.bold}${ANSI.blue}โšก BLA One-Click Counter-REA Defense Hardening Complete!${ANSI.reset}`,
+ "",
+ ` ${ANSI.bold}Input Target:${ANSI.reset} ${rep.inputPath}`,
+ ` ${ANSI.bold}Hardened Output:${ANSI.reset} ${ANSI.cyan}${rep.outputPath}${ANSI.reset}`,
+ ` ${ANSI.bold}Intensity Preset:${ANSI.reset} ${ANSI.magenta}${rep.intensity.toUpperCase()}${ANSI.reset} (Defense Score: ${ANSI.green}${ANSI.bold}${rep.verification.defenseScore}/100${ANSI.reset})`,
+ "",
+ `${ANSI.bold}${ANSI.blue}โ”€โ”€ 5-Stage Automated Counter-REA Pipeline โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€${ANSI.reset}`,
+ ];
+
+ for (const st of rep.stages) {
+ const badge =
+ st.status === "passed"
+ ? `${ANSI.green}โœ“ PASS${ANSI.reset}`
+ : `${ANSI.yellow}! WARN${ANSI.reset}`;
+ lines.push(` [${badge}] ${ANSI.bold}${st.stage}${ANSI.reset}: ${st.headline}`);
+ }
+
+ lines.push(
+ "",
+ `${ANSI.bold}${ANSI.yellow}โ”€โ”€ Resource Exhaustion (่€—ๅฐฝๅฏนๆ–น็ฎ—ๅŠ›ไธŽ้ข„็ฎ—) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€${ANSI.reset}`,
+ ` โ€ข REA Budgets Tripped: ${ANSI.green}${rep.exhaustionSummary.reaBudgetsTripped.join(", ") || "binary-container-limits"}${ANSI.reset}`,
+ ` โ€ข Obligation Ledger Expansion:${rep.exhaustionSummary.obligationLedgerNodesBefore} nodes --> ${ANSI.bold}${rep.exhaustionSummary.obligationLedgerNodesAfter} nodes (${rep.verification.obligationGraphExpansionFactor}x)${ANSI.reset}`,
+ ` โ€ข Token Bankruptcy Factor: ${ANSI.yellow}${ANSI.bold}${rep.exhaustionSummary.tokenAmplificationFactor}x${ANSI.reset} (Attacker API Bill: ${ANSI.yellow}${ANSI.bold}~$${rep.exhaustionSummary.attackerEstimatedBillUsd.toFixed(2)}${ANSI.reset})`,
+ "",
+ `${ANSI.bold}${ANSI.cyan}โ”€โ”€ Model Misjudgment Induction (่ฏฑๅฏผๅคงๆจกๅž‹่ฏฏๅˆค) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€${ANSI.reset}`,
+ ` โ€ข Shadow Logic & Honeypots: ${ANSI.bold}${rep.deceptionSummary.decoyFunctionsInjected}${ANSI.reset} high-salience bait & shadow procedures`,
+ ` โ€ข Tarjan SCC Labyrinth XRefs: ${ANSI.bold}${rep.deceptionSummary.fakeCrossReferencesCreated}${ANSI.reset} mutually-recursive call-graph edges`,
+ ` โ€ข Evidence Contract Lures: ${ANSI.bold}${rep.deceptionSummary.chaffAndEvidenceLuresEmbedded}${ANSI.reset} competing-explanation & enclave manifests`,
+ ` โ€ข Decoy IPC & gRPC Routes: ${ANSI.bold}${rep.deceptionSummary.ipcAmbiguityAndObligationSites}${ANSI.reset} obligation/IPC sites + ${ANSI.bold}${rep.deceptionSummary.decoyRoutesAndGrpcMethods}${ANSI.reset} mirage routes`,
+ );
+
+ if (rep.manifestPath) {
+ lines.push(
+ "",
+ ` ${ANSI.bold}Signed Manifest:${ANSI.reset} ${ANSI.green}${rep.manifestPath}${ANSI.reset}`,
+ );
+ }
+
+ return lines.join("\n");
+}