0xAF-Re Architecture Map

A dual-surface RE agent (Terminal TUI + Wails v2 Desktop GUI) with a host-enforced metacognition layer: 34 built-in tools, 30 skills, evidence ledger (ev_NNN), hypothesis stack (H-NNN), /goal task contracts, /cap capability sandbox, 9-phase reverse workflow gates, and encrypted remote SSH execution.

0xAF-Re architecture map Operator terminal connects to the Go host, which routes role prompts through workflow and policy gates to providers and local reverse-engineering tools. A metacognition layer holds the evidence ledger and hypothesis stack beside the agent loop, an evidence arbitrator cross-checks them after every tool result, and an adversarial auditor re-judges the stack from a second model on demand. prompts, slash, queue steer mid-turn tool calls / results stamp ev_NNN stack feeds system prompt persist evidence + hypothesis events to JSONL reads challenges packet verdicts seat results write / network approved exec TUI + Desktop GUI REPL / CLI / Wails v2 /inspect /anti /diff /workflow /phase /queue /goal /cap /audit /remote mid-turn steering & interrupt 0xAF-Re host · Go engine · 34 built-in tools · 30 skills state machine, /goal contracts, /cap sandbox, snapcompact, embedded prompts & skills Prompt + Contract role prompts + --context /goal target hash + gates + ledger & hypothesis digests Agent Loop route role, provider, model elide + snapcompact PNG frames merge tool results into next turn one shared transcript, JSONL-backed 9 Workflow Modes off / auto / specialist caveman isolated packet reverse (9 gated phases) ctf / research / engineering hard verification & audit gates Metacognition & Evidence Loop host state outside the transcript — injected every turn, persisted in evidence-ledger.jsonl Evidence Ledger every tool result becomes ev_NNN 400-char excerpts, error-flagged cited by id, replayed on resume survives context compaction Hypothesis Manager claims are H-NNN rows with confidence challenge halves it; below 0.25 re-check reject/revise cascades to derived rows host-enforced rules, not prompted hopes Evidence Arbitrator host rule engine · after every tool result dangling citation → synthesized + challenged static vs dynamic contradictions become evidence Adversarial Auditor second model · /audit · isolated + tool-free verdict lines AUDIT H· CHALLENGE/SUPPORT objections synthesized as verification records Sandbox + Policy /cap task net & device gate Tier × Mode approval gate workspace & sensitive checks logged ActionRecords 90ms HUD + RE Strip FLOW / TOOLS / PLAN / TELE 9-phase RE HUD (TRI..WRI) shared across TUI & GUI Queue + Editing append work while running edit/cancel before execution expand/collapse task output Provider seats runtime-selectable adapters Planner Codex / GPT Cyber DeepSeek / custom Executor Claude Code / CVP CLI/API providers tool-call capable Researcher Grok / notes / docs background context /planner /executor /researcher /model role model-name Local & remote evidence layer (34 built-in tools + MCP) facts come from pure-Go binary parsers, external RE toolchains, artifact verifiers, and SSH lab hosts before model claims Pure-Go Binary RE inspect, anti, diff, carve, apk Toolchain + SSH r2, Ghidra, JADX, Frida, remote_exec Verify + Emulate verify_artifact, Unicorn, unidbg Durable Memory JSONL, evidence-ledger, /know Legend operator / interface agent runtime / providers metacognition state workflow and local tools policy and approvals context injection / control Design: the model narrates, the host keeps score — evidence and assumptions are first-class state, not transcript lore.

Two faces, one core

Both the terminal REPL and the Wails v2 CRT Desktop GUI drive the exact same core.AgentLoop, 34-tool registry, 9-phase RE HUD, prompt queue, and session JSONL directory.

Metacognition & 9-phase gates

Tool results become ev_NNN ledger records; claims become H-NNN hypotheses. Contradictions halve confidence and cascade; verify_artifact and /audit are hard phase-gate preconditions before writeup.

Three seats + snapcompact

Planner, executor, and researcher seats route independently at runtime, while mechanical elision and optional snapcompact PNG frames keep long binary-analysis sessions inside budget.

Contracts, sandbox & SSH

/goal pins target hashes and acceptance gates; /cap enforces deny-by-default per-task network/device sandboxing ahead of Tier × Mode approvals, across both local tools and encrypted SSH hosts.