fak

module
v0.34.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 25, 2026 License: Apache-2.0

README

fak - Fused Agent Kernel

What It Is

fak is one Go binary you put in front of the AI agent you already run: Claude Code, Codex, Cursor, or any OpenAI / Anthropic / MCP client. You keep your model, your IDE, and your tools. You point one base URL at fak, and it gives you a handle on the parts of a real agent loop that get expensive or go wrong:

  • Cheaper long sessions. A 100k-token Claude Code conversation re-sends its whole transcript every turn. fak sheds the old turns while keeping the provider's prompt-cache prefix byte-identical, so the discount survives instead of breaking.
  • The right model per call. Send an easy read to a cheap model and a write-shaped call to a careful one, chosen per tool call rather than per whole request.
  • Fewer wasted turns. A repeated read served locally, a malformed call repaired in place, a dead-end branch refused before the agent spends a turn on it.
  • A trail you can audit. Every decision is a plain verdict: ALLOW, DENY, TRANSFORM, or QUARANTINE. It lands in JSON logs, an optional hash-chained journal, and Prometheus metrics.

fak in one line: Put fak in front of the agent you already run. It makes long sessions cheaper, routes each call to the right model, keeps unsafe tool results out of context, and records every verdict. One binary, no rewrite, no key to start.

It does this by sitting on the tool-call path as a kernel. The model proposes a call. fak decides whether that call exists, whether its arguments are allowed, whether the result may enter context, and what gets reused. The same boundary that saves you tokens is also where a dangerous call gets refused. That is why teams who need a hard security floor reach for it too (see For security teams).

agent --> proposed tool call --> fak kernel --> allowed tool / denied call
tool  --> raw result          --> fak kernel --> admitted context / quarantine

Start Here

No key, no model, no GPU. Pick the line that matches how you got fak.

Installed the binary (curl ... install.sh | sh, see Install)? These run from the bare binary anywhere — no clone, no Go, no examples/ dir. They use the built-in default floor:

fak preflight --tool refund_payment --args "{}"     # -> DENY  (DEFAULT_DENY): unknown tool, fail-closed
fak preflight --tool search_kb      --args "{}"     # -> ALLOW: a read-shaped name is not blanket-blocked
fak preflight --tool shell_rm_rf    --args "{}"     # -> DENY  (POLICY_BLOCK): refused by structure
fak preflight --tool exfiltrate     --args "{}"     # -> DENY  (SECRET_EXFIL)
fak agent --offline                                 # the injection / destructive-op A/B, fully offline

Cloned the repo (you have the Go source tree + examples/)? The same proof against a named example floor, where the deny is by argument value:

go run ./cmd/fak preflight --policy examples/customer-support-readonly-policy.json --tool refund_payment --args "{}"   # -> DENY (POLICY_BLOCK)
go run ./cmd/fak preflight --policy examples/customer-support-readonly-policy.json --tool search_kb     --args "{}"   # -> ALLOW
go run ./cmd/fak agent --offline
go run ./cmd/guarddemo -selfcheck                                                                                      # -> WITH fak: 0 breaches

Either way, the core proof is the same: the dangerous action is refused by structure before a model interpretation matters.

Use It With Your Agent

Claude Code, OpenCode, Aider-style CLIs
fak guard -- claude
fak guard --provider openai -- opencode

fak guard starts the gateway on loopback and injects the base URL into the child process only. It loads a built-in secure floor, forwards the real upstream credential, and prints the kernel's decisions when the agent exits. For Claude Code it can use your logged-in Claude subscription by default; no API key is required.

See docs/integrations/claude.md.

Long sessions: shed history, keep the cache hit

A long session re-sends its whole transcript every turn, so a 100k-token conversation gets expensive fast. The same wrap fixes that with one flag:

fak guard --compact-history-budget 8000 -- claude

fak drops the old middle turns while copying the provider's cache prefix through byte-for-byte, so the prompt-cache discount survives instead of breaking. The obvious fix, summarizing the old turns, rewrites the prompt and busts the cache, so it costs more. On any doubt fak forwards the original prompt unchanged, so it never breaks a turn. It guarantees the prefix is byte-identical, then relays the provider's own cache_read number rather than claiming the hit.

How and why, with the metrics: Long sessions: keep the cache hit. Tracking: #745.

Codex, Cursor, MCP hosts

For current Codex CLI/IDE sessions, use the MCP path first:

go build -o fak ./cmd/fak
codex mcp add fak -- ./fak serve --stdio --policy examples/dev-agent-policy.json

For any MCP host:

fak serve --stdio --policy examples/dev-agent-policy.json

The MCP surface gives an agent five kernel tools:

  • fak_adjudicate (decide before dispatch): get a verdict for a proposed call.
  • fak_syscall: run a checked call through the kernel.
  • fak_admit: screen a result before it enters context.
  • fak_context_change: notify the kernel that context changed.
  • Session reset tools: start clean when the host cooperates.

Use this when your agent should keep its normal model wire but still ask the kernel for verdicts.

See docs/integrations/openai-codex.md, docs/integrations/cursor.md, and examples/mcp.

Any OpenAI-compatible or Anthropic-compatible client

Put fak serve in front of the model endpoint:

fak serve --addr 127.0.0.1:8080 \
  --base-url http://localhost:11434/v1 \
  --model qwen2.5:1.5b \
  --policy examples/dev-agent-policy.json

Then point the client at http://127.0.0.1:8080/v1 for OpenAI-compatible traffic, or at http://127.0.0.1:8080 for Anthropic Messages traffic. Harden it with --require-key-env FAK_TOKEN and scrape /metrics.

See GETTING-STARTED.md and docs/fak/api-reference.md.

Why Now

The agent stack has moved from demos into operations. Coding agents now have plugins and background agents. They also have MCP servers, prompt caches, long sessions, and live tool permissions.

Recent public tooling points in the same direction. MCP reliability, auth, and observability work is active. Claude Code is shipping MCP and sandbox permission fixes. Security writing has moved toward runtime tool poisoning alongside prompt wording.

That changes the useful first screen for fak. The value is:

  • Make prompt-cache and routing decisions explicit enough to test — and keep the cache discount alive across a long session instead of busting it.
  • Preserve a traceable, privacy-conscious audit trail of every tool call.
  • Put a default-deny floor under the tools your agent already has.
  • Keep poisoned tool output and secret-shaped results out of model context.

Relevant external signals: Claude Code changelog, MCP stateless/auth discussion, and MCP tool-poisoning/security analysis.

What The Kernel Does

Surface What it gives you Status
fak guard Drop-in guard around an existing CLI agent shipped
fak serve OpenAI, Anthropic, fak-native HTTP, plus MCP over HTTP/stdio shipped
Policy floor JSON allow/deny manifest with closed refusal reasons shipped
Result quarantine Secret, poison, oversize, and pollution results held out of context shipped
Audit/metrics JSON logs, optional hash-chained journal, Prometheus, /debug/vars shipped
Session control Budgets, reset directives, cooperative MCP reset, live session state shipped
vCache proof tools Planned and observed provider-cache savings/refutation shipped as proof/control plane
Model routing Per-aspect routing, ensembles, routebench, gateway seam shipped spine; deploy with current flags/docs checked
In-kernel model Pure-Go reference model, kernel-owned KV cache, GPU/backend witnesses correctness/reference path

Every claim in CLAIMS.md carries exactly one tag: [SHIPPED], [SIMULATED], or [STUB]. The lint gate enforces that honesty ledger.

For security teams

If a hard capability floor is why you're here — not just a nice-to-have — this section is for you. The same boundary that sheds tokens above is, for your purposes, the lock around tool execution.

Most agent security tries to recognize bad text. Recognizers help. They are not the floor. Prompt injection is a text game. Attackers get turns too. fak moves the load-bearing decision to the capability floor: a dangerous tool outside the allow-list cannot be called, no matter what the model was told.

Two independent gates matter:

  • Call-side gate: tool names and selected arguments are checked before dispatch. A denied call never reaches the tool runner.
  • Result-side gate: tool output is screened before it enters context. A poisoned or secret-bearing result is paged out or quarantined instead of being handed back to the model as trusted text.

The capability floor is the guarantee. The detector can miss, and the docs say so. Irreversible effects are unwired by default. Untrusted bytes have to pass a gate before they become model context.

Read POLICY.md, docs/fak/security.md, and docs/integrations/agent-memory.md.

vCache: Provider Cache As A Budget Signal

A provider's prompt cache is not memory you control. You cannot ask it to evict a span or prove a prefix is resident. You just get telemetry after the request. So fak vcache treats a cache hit as a realized rebate, never something the answer depends on. It proves or refutes each saving from the provider's own usage counters.

go run ./cmd/fak vcache status
go run ./cmd/fak vcache prove

Evidence from two live traces:

  • Claude Code prefix probe: 13,141.5 input-token equivalents saved over four sibling turns, 4.73%.
  • Codex/OpenAI session telemetry: 9,147,340.8 token equivalents saved over 68 token-count events, 85.98%.

Those are provider-cache accounting proofs on those traces: fak supplies the accounting and control plane. The design contract, the full command set, and the causality fences are on the vCache page; the Codex/OpenAI probe is written up in the probe note.

Model Routing And Router Fusion

Most routers pick one model for a whole request. fak route routes an aspect instead. The unit can be the request or one tool call. It can also be a sub-query, reasoning step, or tagged stage.

An ensemble is a first-class plan. Supported reductions include vote and best_of. They also include first, concat, and scalar all_reduce.

Try it offline:

go run ./cmd/fak route --aspect tool_call --tool write_file --simulate "approve,deny,deny"
go run ./cmd/fak route --aspect step --complexity high
go run ./cmd/fak routebench

The router is useful because it sits at the same point as the security floor. A write-shaped call can route to a guard ensemble. An easy read can route to a cheap model. A tenant-sensitive payload bound for a remote route is denied by the residency floor.

Read docs/model-routing.md and docs/integrations/litellm.md.

Benchmarks, In One Page

The benchmark rule is simple: every number must trace to BENCHMARK-AUTHORITY.md.

The numbers worth remembering:

  • guarddemo -selfcheck: frozen attack traces reproduce zero breaches behind fak.
  • WebVoyager geometry model: 8-worker fleet prefill is 1.10x less work than tuned per-agent KV (and 9.7x less than the naive re-prefill floor). This is modeled prefill-token work, separate from wall-clock.
  • 50-turn x 5-agent Qwen2.5-1.5B authority row: 4.1x vs tuned warm-cache. Larger numbers are fenced as vs-naive.
  • vCache telemetry proofs above are provider-cache accounting proofs, separate from serving throughput claims.

Use vLLM or SGLang for raw token serving. Put fak on the agent boundary. Use it for policy and quarantine. Use it for audit, routing, and controlled reuse.

Install

From source:

go install github.com/anthony-chaudhary/fak/cmd/fak@latest

From a clone:

git clone https://github.com/anthony-chaudhary/fak
cd fak
go build -o fak ./cmd/fak

Go 1.26+ is required. With GOTOOLCHAIN=auto, Go can fetch the toolchain on first build. There are no external Go dependencies and no go.sum.

Prebuilt archives and container guidance are in INSTALL.md and GETTING-STARTED.md.

Build And Test

Run from the repository root:

go build ./cmd/fak
make test-fast
make ci

On native Windows, go build and go vet work normally, but native go test can be blocked by OS Application Control on freshly compiled test binaries. Use ./test.ps1 under WSL for the full suite on that host.

Boundaries

  • Token serving: use vLLM or SGLang for raw throughput. fak is the agent kernel around them.
  • Prompt injection: classifiers are useful, but policy carries the load.
  • Provider prompt caches: provider hits are rebates. Treat cache state as telemetry until you control the memory.
  • In-kernel model: the shipped path is a correctness/reference witness with real tests. Use a tuned serving stack for production throughput.
  • Dangerous tools: keep irreversible and exfil-shaped tools off the allow-list.

Docs Map

If you want... Read
First real run GETTING-STARTED.md
Claude Code / guard path docs/integrations/claude.md
Codex docs/integrations/openai-codex.md
MCP examples examples/mcp
Policy manifests POLICY.md
CLI verbs docs/cli-reference.md
Security model docs/fak/security.md
API reference docs/fak/api-reference.md
vCache docs/notes/VCACHE-VIRTUAL-API-CACHE-2026-06-24.md
Model routing docs/model-routing.md
Benchmark authority BENCHMARK-AUTHORITY.md
Honesty ledger CLAIMS.md
Machine-readable map llms.txt
Old README snapshot docs/archive/README-2026-06-25-before-fresh-start.md

License: Apache-2.0.

Directories

Path Synopsis
cmd
a2ademo command
Command a2ademo is a no-key, no-model proof of fak's in-kernel agent-to-agent message channel (internal/a2achan): one capability-floored, Ref-backed mailbox delivering an addressed value from one agent to another — adjudicated by the SAME default-deny floor that gates a tool call.
Command a2ademo is a no-key, no-model proof of fak's in-kernel agent-to-agent message channel (internal/a2achan): one capability-floored, Ref-backed mailbox delivering an addressed value from one agent to another — adjudicated by the SAME default-deny floor that gates a tool call.
agentdojoredteam command
Command agentdojoredteam runs the dynamic AgentDojo-style red-team battery (internal/agentdojo) against the stacked defense and prints the PER-ATTACK verdict stream, then folds every outcome into a frozen harvest LabelRow corpus.
Command agentdojoredteam runs the dynamic AgentDojo-style red-team battery (internal/agentdojo) against the stacked defense and prints the PER-ATTACK verdict stream, then folds every outcome into a frozen harvest LabelRow corpus.
batchbench command
Command batchbench measures the AGGREGATE decode throughput of the multi-user batched decode (internal/model.BatchSession) as a function of batch size B — the "continuous batching" / multi-user serving regime MODEL-BASELINE-RESULTS.md scoped out as "vLLM's claim, not fak's".
Command batchbench measures the AGGREGATE decode throughput of the multi-user batched decode (internal/model.BatchSession) as a function of batch size B — the "continuous batching" / multi-user serving regime MODEL-BASELINE-RESULTS.md scoped out as "vLLM's claim, not fak's".
causalbench command
Command causalbench is the end-to-end demonstrator for fak's CAUSAL invalidation-on-external-write: a tool RESULT cached under an external world-state witness (a git commit / blob hash / etag) is evicted byte-exact — and only it — the moment a later external write REFUTES that witness, while every sibling cached under an unrefuted witness stays warm.
Command causalbench is the end-to-end demonstrator for fak's CAUSAL invalidation-on-external-write: a tool RESULT cached under an external world-state witness (a git commit / blob hash / etag) is evicted byte-exact — and only it — the moment a later external write REFUTES that witness, while every sibling cached under an unrefuted witness stays warm.
ctxbench command
Command ctxbench runs the fak security gates over a corpus of tool calls and tool results.
Command ctxbench runs the fak security gates over a corpus of tool calls and tool results.
ctxdemo command
Command ctxdemo is the live, on-box demo of fak's value in the MULTI-AGENT, MULTI-TURN, LONG-CONTEXT regime — the one where the context CHANGES every turn as tool calls land heterogeneous, variable-sized results.
Command ctxdemo is the live, on-box demo of fak's value in the MULTI-AGENT, MULTI-TURN, LONG-CONTEXT regime — the one where the context CHANGES every turn as tool calls land heterogeneous, variable-sized results.
ctxplanbench command
Command ctxplanbench measures the ctxplan planned VIEW over REAL Claude Code session transcripts — the empirical counterpart to internal/ctxplan/scaling.go's synthetic Params model (issue #559).
Command ctxplanbench measures the ctxplan planned VIEW over REAL Claude Code session transcripts — the empirical counterpart to internal/ctxplan/scaling.go's synthetic Params model (issue #559).
ctxplandemo command
Command ctxplandemo is the runnable demonstrator for the context PLANNER: it treats the current turn as an O(1) materialized VIEW over a lossless history store, and shows the three things that make that more than a slogan —
Command ctxplandemo is the runnable demonstrator for the context PLANNER: it treats the current turn as an O(1) materialized VIEW over a lossless history store, and shows the three things that make that more than a slogan —
cxlpooldemo command
Command cxlpooldemo is a no-model, no-GPU proof of the value a SWITCH-POOLED, multi-host shared memory tier (a CXL.mem / CXL-switch pool) adds to fak's hardware-aware cache once a KV cache is shared across a FLEET of tenants — the multi-tenant counterpart of cmd/hwcachedemo's single-stream demote-not-evict proof.
Command cxlpooldemo is a no-model, no-GPU proof of the value a SWITCH-POOLED, multi-host shared memory tier (a CXL.mem / CXL-switch pool) adds to fak's hardware-aware cache once a KV cache is shared across a FLEET of tenants — the multi-tenant counterpart of cmd/hwcachedemo's single-stream demote-not-evict proof.
deletioncert command
Command deletioncert is the end-to-end demonstrator for fak's provable-deletion receipt.
Command deletioncert is the end-to-end demonstrator for fak's provable-deletion receipt.
demorace command
Command demorace is the live, on-box demo of fak's value point: REUSE.
Command demorace is the live, on-box demo of fak's value point: REUSE.
diagtok command
Command diagtok is a throwaway diagnostic: it loads a GGUF via the same path simpledemo uses, then (1) round-trips a known string through the embedded tokenizer and (2) greedily decodes a ChatML prompt while printing each raw token id next to its decode.
Command diagtok is a throwaway diagnostic: it loads a GGUF via the same path simpledemo uses, then (1) round-trips a known string through the embedded tokenizer and (2) greedily decodes a ChatML prompt while printing each raw token id next to its decode.
dispatchworker command
Command dispatchworker launches one DOS dispatch worker on a selected backend — the Go port of tools/dispatch_worker.py, compiled to a single binary so the supervisor (`dos loop --enact`, or the watchdog canary) spawns a worker WITHOUT a Python interpreter (and without the bare-`python` token that ENOENTs on a python3-only node — the #22 residual).
Command dispatchworker launches one DOS dispatch worker on a selected backend — the Go port of tools/dispatch_worker.py, compiled to a single binary so the supervisor (`dos loop --enact`, or the watchdog canary) spawns a worker WITHOUT a Python interpreter (and without the bare-`python` token that ENOENTs on a python3-only node — the #22 residual).
dropindemo command
Command dropindemo is the splashy, on-box demo of fak's DISTRIBUTION story — the "drop-in" entry point.
Command dropindemo is the splashy, on-box demo of fak's DISTRIBUTION story — the "drop-in" entry point.
fak command
Command fak is the Fused Agent Kernel: one statically-linked Go binary that runs an agentic tool loop where every tool call passes through one in-process policy and quarantine boundary (adjudicate -> vDSO -> pre-flight/grammar -> dispatch -> context-MMU admit).
Command fak is the Fused Agent Kernel: one statically-linked Go binary that runs an agentic tool loop where every tool call passes through one in-process policy and quarantine boundary (adjudicate -> vDSO -> pre-flight/grammar -> dispatch -> context-MMU admit).
fakchat command
Command fakchat runs an end-to-end chat completion with fak's OWN in-kernel engine — no llama-server, no external proxy.
Command fakchat runs an end-to-end chat completion with fak's OWN in-kernel engine — no llama-server, no external proxy.
fanbench command
Command fanbench runs the ONE-MASTER-GOAL → N-SUBAGENT fan-out sweep — the orchestrator-worker topology (one lead decomposes a goal, spawns N sub-agents, folds their results) swept from N=1 to N=1000+, the regime no public benchmark maps (see experiments/fanout/RESEARCH-BRIEF-fanout-2026-06-17.md).
Command fanbench runs the ONE-MASTER-GOAL → N-SUBAGENT fan-out sweep — the orchestrator-worker topology (one lead decomposes a goal, spawns N sub-agents, folds their results) swept from N=1 to N=1000+, the regime no public benchmark maps (see experiments/fanout/RESEARCH-BRIEF-fanout-2026-06-17.md).
fleetbench command
Command fleetbench runs the 2-D turn-tax sweep — turns-per-agent (T) × fleet size (A) — over the REAL kernel and writes the surface as JSON + CSV for curve fitting.
Command fleetbench runs the 2-D turn-tax sweep — turns-per-agent (T) × fleet size (A) — over the REAL kernel and writes the surface as JSON + CSV for curve fitting.
fleetserve command
Command fleetserve measures the CROSS-AGENT SHARED-PREFIX fleet workload — the regime where fak's kernel-owned KV cache structurally beats a per-slot serving engine (llama.cpp) by more than 2×, not by a faster kernel but by NOT REDOING WORK.
Command fleetserve measures the CROSS-AGENT SHARED-PREFIX fleet workload — the regime where fak's kernel-owned KV cache structurally beats a per-slot serving engine (llama.cpp) by more than 2×, not by a faster kernel but by NOT REDOING WORK.
gemma4diag command
Command gemma4diag loads a gemma4 GGUF ONCE and sweeps the uncertain forward axes (softmax scale 1.0 vs 1/sqrt(d), rope_freqs on/off, decoder-norm plain vs (1+w)), printing the top-k next-token predictions for a fixed prompt under each.
Command gemma4diag loads a gemma4 GGUF ONCE and sweeps the uncertain forward axes (softmax scale 1.0 vs 1/sqrt(d), rope_freqs on/off, decoder-norm plain vs (1+w)), printing the top-k next-token predictions for a fixed prompt under each.
ggufprobe command
Command ggufprobe dumps a GGUF file's architecture using fak's own internal/ggufload parser — no llama.cpp.
Command ggufprobe dumps a GGUF file's architecture using fak's own internal/ggufload parser — no llama.cpp.
glmdsatput command
Command glmdsatput measures fak's NATIVE GLM-5.2 (glm_moe_dsa) decode throughput on a real compute backend (e.g.
Command glmdsatput measures fak's NATIVE GLM-5.2 (glm_moe_dsa) decode throughput on a real compute backend (e.g.
gpucheck command
Command gpucheck is the real-model correctness witness for the GPU backend: it loads a HuggingFace safetensors checkpoint (e.g.
Command gpucheck is the real-model correctness witness for the GPU backend: it loads a HuggingFace safetensors checkpoint (e.g.
guarddemo command
Command guarddemo is the live, on-box demo of fak's SAFETY FLOOR — the moat — shown as a TRUE side-by-side: the SAME adversarial tool-call trace replayed down two columns at once, WITHOUT fak (left) and WITH fak (right), so the divergence lands in one glance.
Command guarddemo is the live, on-box demo of fak's SAFETY FLOOR — the moat — shown as a TRUE side-by-side: the SAME adversarial tool-call trace replayed down two columns at once, WITHOUT fak (left) and WITH fak (right), so the divergence lands in one glance.
hwcachedemo command
Command hwcachedemo is a no-model, no-GPU proof that fak's cache is hardware-aware: it shows the residency-tier ladder with each tier's physical character, which tiers can be shared ZERO-COPY, and — the headline — how the placement policy DEMOTES a hot KV prefix to CXL far memory under pressure instead of EVICTING it and paying a full re-prefill later.
Command hwcachedemo is a no-model, no-GPU proof that fak's cache is hardware-aware: it shows the residency-tier ladder with each tier's physical character, which tiers can be shared ZERO-COPY, and — the headline — how the placement policy DEMOTES a hot KV prefix to CXL far memory under pressure instead of EVICTING it and paying a full re-prefill later.
kpiprobe command
Command kpiprobe prints the RSI loop's demo KPI — the deterministic LRU hit-rate (internal/rsiloop.HitRate) over a fixed reference trace — as a single `KPI=<float>` line the loop's worktree Measurer parses.
Command kpiprobe prints the RSI loop's demo KPI — the deterministic LRU hit-rate (internal/rsiloop.HitRate) over a fixed reference trace — as a single `KPI=<float>` line the loop's worktree Measurer parses.
lensviz command
Command lensviz is a visual next-token debugger for fak's own in-kernel engine.
Command lensviz is a visual next-token debugger for fak's own in-kernel engine.
loadgen command
loadgen drives an OpenAI-compatible /v1/chat/completions endpoint at a sweep of concurrency levels and reports throughput.
loadgen drives an OpenAI-compatible /v1/chat/completions endpoint at a sweep of concurrency levels and reports throughput.
longctxbench command
Command longctxbench renders the EXACT, contention-free work floor for the ULTRA-LONG-CONTEXT regime (per-agent context > 100k tokens) — the proof that the fused agent kernel's reread-elimination win holds (and grows) where it matters most, computed as closed-form arithmetic from the session shape and the model geometry.
Command longctxbench renders the EXACT, contention-free work floor for the ULTRA-LONG-CONTEXT regime (per-agent context > 100k tokens) — the proof that the fused agent kernel's reread-elimination win holds (and grows) where it matters most, computed as closed-form arithmetic from the session shape and the model geometry.
memqdemo command
Command memqdemo is a no-model, deterministic walkthrough of the memq memory- operation algebra: the substrate that lets an agent author its OWN memory strategy (render / clean / compact / dream / a novel one) instead of the kernel hardcoding a single compaction path.
Command memqdemo is a no-model, deterministic walkthrough of the memq memory- operation algebra: the substrate that lets an agent author its OWN memory strategy (render / clean / compact / dream / a novel one) instead of the kernel hardcoding a single compaction path.
modelbench command
Command modelbench measures the in-kernel pure-Go forward pass latency so the fusion lane has a HONEST throughput baseline to set against the next-best ways to run the same model (HF transformers; see bench_hf.py for the witness side).
Command modelbench measures the in-kernel pure-Go forward pass latency so the fusion lane has a HONEST throughput baseline to set against the next-best ways to run the same model (HF transformers; see bench_hf.py for the witness side).
modelprof command
Command modelprof is the in-kernel forward pass inspecting ITSELF: it runs the modular bottleneck profiler (internal/model/profile.go) over a real decode and a real prefill, plus an uninstrumented Session.Step decode measurement.
Command modelprof is the in-kernel forward pass inspecting ITSELF: it runs the modular bottleneck profiler (internal/model/profile.go) over a real decode and a real prefill, plus an uninstrumented Session.Step decode measurement.
paritybench command
Command paritybench assembles the CROSS-MODEL parity artifact: it ingests the live fak-agent A/B reports for a ladder of LOCAL models (produced by tools/run_local_model.sh via the OpenAI-compatible shim) plus the committed FRONTIER reference cards (hosted Claude Haiku/Sonnet, measured + graded on the same frozen task), scores every card on the three never-blended axes (capability / safety / cost), and emits the parity table.
Command paritybench assembles the CROSS-MODEL parity artifact: it ingests the live fak-agent A/B reports for a ladder of LOCAL models (produced by tools/run_local_model.sh via the OpenAI-compatible shim) plus the committed FRONTIER reference cards (hosted Claude Haiku/Sonnet, measured + graded on the same frozen task), scores every card on the three never-blended axes (capability / safety / cost), and emits the parity table.
pipelinegen command
Command pipelinegen runs fak's NATIVE engine generating tokens across pipeline-parallel stages — the runnable form of the cross-device transport contract (internal/model/pipeline.go).
Command pipelinegen runs fak's NATIVE engine generating tokens across pipeline-parallel stages — the runnable form of the cross-device transport contract (internal/model/pipeline.go).
poisonedmcpdemo command
Command poisonedmcpdemo is the runnable A/B for issue #573: it proves fak walls a tool-poisoning MCP server off the model by STRUCTURE, with no model/key/network.
Command poisonedmcpdemo is the runnable A/B for issue #573: it proves fak walls a tool-poisoning MCP server off the model by STRUCTURE, with no model/key/network.
polymodelbench command
bench.go is the measured-numbers half of polymodelbench — the runnable artifact for issue #535 ("bench(polymodel): measured numbers for the poly-model lane").
bench.go is the measured-numbers half of polymodelbench — the runnable artifact for issue #535 ("bench(polymodel): measured numbers for the poly-model lane").
prefixlint command
Command prefixlint is the §A3 prefix-stability devtool (GLM52-HOSTED-CACHE- COHERENCE): it reads a recorded conversation and reports the provider-cache consequence — how many prompt tokens are cacheable across the session, how many are re-billed, the specific turn where the prefix broke, and the recoverable uplift from fixing volatile-ahead-of-stable ordering.
Command prefixlint is the §A3 prefix-stability devtool (GLM52-HOSTED-CACHE- COHERENCE): it reads a recorded conversation and reports the provider-cache consequence — how many prompt tokens are cacheable across the session, how many are re-billed, the specific turn where the prefix broke, and the recoverable uplift from fixing volatile-ahead-of-stable ordering.
q4kdiag command
q8bench command
Command q8bench is an INDEPENDENT verifier for the int8-quantized in-kernel forward path (internal/model: Model.Quantize + Session.Quant).
Command q8bench is an INDEPENDENT verifier for the int8-quantized in-kernel forward path (internal/model: Model.Quantize + Session.Quant).
q8kernel command
Command q8kernel is a self-contained kernel microbenchmark that isolates ONE question from all model/WSL/load overhead: in pure Go on this box, which GEMV kernel is fastest for the memory-bound batch-1 decode regime —
Command q8kernel is a self-contained kernel microbenchmark that isolates ONE question from all model/WSL/load overhead: in pure Go on this box, which GEMV kernel is fastest for the memory-bound batch-1 decode regime —
qwen35check command
Command qwen35check loads a Qwen3.5 / Qwen3-Next hybrid HF snapshot with fak's own in-kernel forward pass and greedy-decodes a few tokens from a given prompt (token ids), printing the generated ids.
Command qwen35check loads a Qwen3.5 / Qwen3-Next hybrid HF snapshot with fak's own in-kernel forward pass and greedy-decodes a few tokens from a given prompt (token ids), printing the generated ids.
radixbench command
Command radixbench benchmarks fak's KV-cache prefix reuse against SGLang's RadixAttention (arXiv:2312.07104 / NeurIPS 2024) on the metric SGLang's own paper headlines: CACHE HIT RATE — the fraction of prompt tokens served from cache instead of recomputed.
Command radixbench benchmarks fak's KV-cache prefix reuse against SGLang's RadixAttention (arXiv:2312.07104 / NeurIPS 2024) on the metric SGLang's own paper headlines: CACHE HIT RATE — the fraction of prompt tokens served from cache instead of recomputed.
repoguard command
guard.go — the pure, interpreter-free core of the repo-guard PreToolUse hook.
guard.go — the pure, interpreter-free core of the repo-guard PreToolUse hook.
rsicycle command
Command rsicycle drives ONE recursive-self-improvement keep-or-revert decision through fak's own non-forgeable keep-bit (internal/shipgate.Evaluate).
Command rsicycle drives ONE recursive-self-improvement keep-or-revert decision through fak's own non-forgeable keep-bit (internal/shipgate.Evaluate).
rsiloop command
Command rsiloop is fak's TRUE recursive-self-improvement loop — the closed-loop companion to cmd/rsicycle's one-shot.
Command rsiloop is fak's TRUE recursive-self-improvement loop — the closed-loop companion to cmd/rsicycle's one-shot.
sessionbench command
Command sessionbench measures the NET VALUE-ADD of the fused agent kernel on a realistic long, multi-agent session — the regime the whole fusion exists for, and the one a per-call / per-turn naive setup pays for dearly.
Command sessionbench measures the NET VALUE-ADD of the fused agent kernel on a realistic long, multi-agent session — the regime the whole fusion exists for, and the one a per-call / per-turn naive setup pays for dearly.
simpledemo command
Command simpledemo is the friendliest way to chat with a local AI model.
Command simpledemo is the friendliest way to chat with a local AI model.
tokendemo command
Command tokendemo is the self-contained demo of two CLEAR WINS the kernel's tool-call understanding delivers — counted call by call, each grounded in a LIVE kernel verdict (the kernel decides; this demo only counts).
Command tokendemo is the self-contained demo of two CLEAR WINS the kernel's tool-call understanding delivers — counted call by call, each grounded in a LIVE kernel verdict (the kernel decides; this demo only counts).
topobench command
Command topobench runs the FLEET-TOPOLOGY genome search (issue #541) — the orthogonal STRUCTURE-search axis to the policy-genome search (#503).
Command topobench runs the FLEET-TOPOLOGY genome search (issue #541) — the orthogonal STRUCTURE-search axis to the policy-genome search (#503).
tpcheck command
Command tpcheck runs fak's NATIVE-engine TENSOR-parallel decomposition end to end over SIMULATED ranks (single box, in-memory, no GPU/NCCL/checkpoint) — the runnable form of the intra-layer sharding contract (internal/model/tensor_parallel.go).
Command tpcheck runs fak's NATIVE-engine TENSOR-parallel decomposition end to end over SIMULATED ranks (single box, in-memory, no GPU/NCCL/checkpoint) — the runnable form of the intra-layer sharding contract (internal/model/tensor_parallel.go).
turntaxdemo command
Command turntaxdemo is the live, on-box demo of how fak SAVES MODEL TURNS.
Command turntaxdemo is the live, on-box demo of how fak SAVES MODEL TURNS.
unseedemo command
Command unseedemo is the live, on-box "Un-See It" demo (a.k.a.
Command unseedemo is the live, on-box "Un-See It" demo (a.k.a.
webbench-convert command
webbench-convert converts WebVoyager dataset to webbench format.
webbench-convert converts WebVoyager dataset to webbench format.
webbench-run command
webbench-run is a reproducible end-to-end webbench runner.
webbench-run is a reproducible end-to-end webbench runner.
webbench-token-measure command
webbench-token-measure measures actual token usage from model API runs.
webbench-token-measure measures actual token usage from model API runs.
wfmembench command
Command wfmembench is the workflow-memory benchmark for issue #434.
Command wfmembench is the workflow-memory benchmark for issue #434.
internal
a2achan
Package a2achan is the in-kernel agent-to-agent message channel: a generic, capability-floored, Ref-backed mailbox that lets one agent hand a value to ANOTHER agent.
Package a2achan is the in-kernel agent-to-agent message channel: a generic, capability-floored, Ref-backed mailbox that lets one agent hand a value to ANOTHER agent.
abi
events.go — the closed core EventKind vocabulary (additive).
events.go — the closed core EventKind vocabulary (additive).
ablate
Package ablate generalizes the two-arm `fak bench` (vdso_on/vdso_off) into an N-ARM feature sweep: replay ONE frozen tool-call trace through the kernel under a LIST of FeatureConfigs and emit one AblationReport binding every arm to the trace's single workload hash.
Package ablate generalizes the two-arm `fak bench` (vdso_on/vdso_off) into an N-ARM feature sweep: replay ONE frozen tool-call trace through the kernel under a LIST of FeatureConfigs and emit one AblationReport binding every arm to the trace's single workload hash.
accounts
Package accounts is the durable registry of Claude config HOMES — the CLAUDE_CONFIG_DIR "seats" a host switches between (~/.claude, ~/.claude-gem8-seat, …) — with one job no other surface does cleanly: resolve a seat name to the home that actually serves it, FOLLOWING a tombstone to its rehome target.
Package accounts is the durable registry of Claude config HOMES — the CLAUDE_CONFIG_DIR "seats" a host switches between (~/.claude, ~/.claude-gem8-seat, …) — with one job no other surface does cleanly: resolve a seat name to the home that actually serves it, FOLLOWING a tombstone to its rehome target.
adjudicator
Package adjudicator is the in-process DOS reference monitor — the v0.1 realization of the Adjudicator seam.
Package adjudicator is the in-process DOS reference monitor — the v0.1 realization of the Adjudicator seam.
advmodel
Package advmodel is the advisory adjudication model — the consumer of the harvest LabelRow corpus and the closing edge of the kernel's self-improvement loop (issue #580).
Package advmodel is the advisory adjudication model — the consumer of the harvest LabelRow corpus and the closing edge of the kernel's self-improvement loop (issue #580).
agent
Package agent is the HOST-SIDE agentic loop and the wire servers that expose it.
Package agent is the HOST-SIDE agentic loop and the wire servers that expose it.
agentdojo
Package agentdojo replaces the STATIC poison.json fixture with a DYNAMIC, adaptive attack battery scored by Attack Success Rate (ASR) — the AgentDojo (Debenedetti et al., 2024) evaluation discipline.
Package agentdojo replaces the STATIC poison.json fixture with a DYNAMIC, adaptive attack battery scored by Attack Success Rate (ASR) — the AgentDojo (Debenedetti et al., 2024) evaluation discipline.
agenttopo
Package agenttopo declares agent communication topology over comm.Group.
Package agenttopo declares agent communication topology over comm.Group.
answershape
Package answershape is a deterministic, dependency-free guard over the SHAPE of a piece of text — how repetitive (degenerate) it is and how long (verbose) it is — checked against caller-chosen thresholds.
Package answershape is a deterministic, dependency-free guard over the SHAPE of a piece of text — how repetitive (degenerate) it is and how long (verbose) it is — checked against caller-chosen thresholds.
appversion
Package appversion resolves the fleet/FAK application version from the single repo-level VERSION marker, with build-time and environment fallbacks.
Package appversion resolves the fleet/FAK application version from the single repo-level VERSION marker, with build-time and environment fallbacks.
architest
Package architest is the kernel's machine-checked architecture contract.
Package architest is the kernel's machine-checked architecture contract.
bench
Package bench is the A/B ablation runner behind `fak bench`.
Package bench is the A/B ablation runner behind `fak bench`.
benchcatalog
Package benchcatalog is the single, in-binary source of truth for "what benchmarks does fak have, what does each measure, and how do I run it." It exists because the answer used to be scattered across 18 separate cmd/*bench* mains plus five `fak` verbs (bench, turntax, routebench, webbench, swebench), each with its own bespoke flag vocabulary and no shared index.
Package benchcatalog is the single, in-binary source of truth for "what benchmarks does fak have, what does each measure, and how do I run it." It exists because the answer used to be scattered across 18 separate cmd/*bench* mains plus five `fak` verbs (bench, turntax, routebench, webbench, swebench), each with its own bespoke flag vocabulary and no shared index.
blob
Package blob is the v0.1 default backend behind every abi.Ref: a content-addressed (sha256) in-memory blob store.
Package blob is the v0.1 default backend behind every abi.Ref: a content-addressed (sha256) in-memory blob store.
blobfs
Package blobfs is a DURABLE, on-disk content-addressed store — the persistent sibling of internal/blob (the in-memory v0.1 default behind every abi.Ref).
Package blobfs is a DURABLE, on-disk content-addressed store — the persistent sibling of internal/blob (the in-memory v0.1 default behind every abi.Ref).
blobhttp
Package blobhttp is a content-addressed blob store backed by a REMOTE HTTP object endpoint — the "disaggregated / cloud" sibling of internal/blob (in-memory) and internal/blobfs (local disk).
Package blobhttp is a content-addressed blob store backed by a REMOTE HTTP object endpoint — the "disaggregated / cloud" sibling of internal/blob (in-memory) and internal/blobfs (local disk).
boundarylint
Package boundarylint is a small, extensible policy engine for "boundary tells": source patterns where the code makes a claim about the outside world (the OS, the network, the clock, a peer process) without the check that would make the claim true.
Package boundarylint is a small, extensible policy engine for "boundary tells": source patterns where the code makes a claim about the outside world (the OS, the network, the clock, a peer process) without the check that would make the claim true.
cachemeta
Package cachemeta defines the metadata contract for first-class cache entries.
Package cachemeta defines the metadata contract for first-class cache entries.
cacheobs
Package cacheobs is the process-global observability tap for in-kernel KV-prefix reuse — the LIVE measurement of the "frozen-trajectory cache cliff" (docs/explainers/frozen-trajectory-cache-cliff.md).
Package cacheobs is the process-global observability tap for in-kernel KV-prefix reuse — the LIVE measurement of the "frozen-trajectory cache cliff" (docs/explainers/frozen-trajectory-cache-cliff.md).
callavoid
Package callavoid is the economics and effective-turn accounting for NOT making a local tool call — the principle that the cheapest, fastest, most reliable tool call is the one the kernel never has to dispatch.
Package callavoid is the economics and effective-turn accounting for NOT making a local tool call — the principle that the cheapest, fastest, most reliable tool call is the one the kernel never has to dispatch.
canon
Package canon is the de-obfuscating canonicalizer + lexical threat detector, factored out of internal/normgate so it is ONE primitive, tested ONCE, and reusable by every gate that needs to scan bytes for a hidden secret or injection on a normalized view — not just the write-time admitter.
Package canon is the de-obfuscating canonicalizer + lexical threat detector, factored out of internal/normgate so it is ONE primitive, tested ONCE, and reusable by every gate that needs to scan bytes for a hidden secret or injection on a normalized view — not just the write-time admitter.
cdb
Package cdb is the context debugger: it attaches to a FINISHED agent session as if to a core dump and answers questions by demand-paging only the working set the question touches — never by replaying the whole address space.
Package cdb is the context debugger: it attaches to a FINISHED agent session as if to a core dump and answers questions by demand-paging only the working set the question touches — never by replaying the whole address space.
codelint
Package codelint is language-server packs: lint agent-written code (Go/Python/CUDA/JSON) off the hot path.
Package codelint is language-server packs: lint agent-written code (Go/Python/CUDA/JSON) off the hot path.
cohort
Package cohort is a fail-closed cohort shrink and agreement leaf over comm.Group.
Package cohort is a fail-closed cohort shrink and agreement leaf over comm.Group.
comm
Package comm is the first-class agent communicator: a deterministic, adjudicated group descriptor (rank/size/split + spawn membership) over the dos-arbitrate lane partition.
Package comm is the first-class agent communicator: a deterministic, adjudicated group descriptor (rank/size/split + spawn membership) over the dos-arbitrate lane partition.
compute
Package compute is the hardware-abstraction seam (HAL) for the in-kernel forward pass.
Package compute is the hardware-abstraction seam (HAL) for the in-kernel forward pass.
contextq
Package contextq is the on-demand context materializer over CDB images.
Package contextq is the on-demand context materializer over CDB images.
ctxmmu
Package ctxmmu is the context-MMU: a write-time (post-tool) gate on tool RESULTS, the dual of the call-side adjudicator.
Package ctxmmu is the context-MMU: a write-time (post-tool) gate on tool RESULTS, the dual of the call-side adjudicator.
ctxplan
Package ctxplan is the context PLANNER: it treats the current turn's context as an O(1) materialized VIEW over the full, lossless history store, and re-plans that view each turn instead of letting the linear transcript grow without bound (or compacting it lossily).
Package ctxplan is the context PLANNER: it treats the current turn's context as an O(1) materialized VIEW over the full, lossless history store, and re-plans that view each turn instead of letting the linear transcript grow without bound (or compacting it lossily).
ctxresidency
Package ctxresidency is the context-residency query (issue #521): a first-class, witnessable READ over the span ledger that composes the three layers that already maintain the context's coherence state — kvmmu (the KV-level span ledger Admit/Evict maintains), ctxmmu (the byte-level quarantine/clearance ledger), and cachemeta (the residency tiers + the dependent-entry graph the eviction blast radius is read from).
Package ctxresidency is the context-residency query (issue #521): a first-class, witnessable READ over the span ledger that composes the three layers that already maintain the context's coherence state — kvmmu (the KV-level span ledger Admit/Evict maintains), ctxmmu (the byte-level quarantine/clearance ledger), and cachemeta (the residency tiers + the dependent-entry graph the eviction blast radius is read from).
deletioncert
Package deletioncert mints and verifies a DeletionCertificate: a single, portable, re-checkable artifact that binds a bit-exact KV eviction to the tamper-evident audit journal that recorded it.
Package deletioncert mints and verifies a DeletionCertificate: a single, portable, re-checkable artifact that binds a bit-exact KV eviction to the tamper-evident audit journal that recorded it.
demoui
Package demoui holds the small, cross-cutting helpers the on-box demos (cmd/demorace, cmd/ctxdemo, cmd/simpledemo, ...) share, so they all report the SAME thing about the machine and never freeze on a long blocking phase.
Package demoui holds the small, cross-cutting helpers the on-box demos (cmd/demorace, cmd/ctxdemo, cmd/simpledemo, ...) share, so they all report the SAME thing about the machine and never freeze on a long blocking phase.
dropin
Package dropin is the canonical drop-in wire resolution + known-agent registry shared by fak guard and the entry-point demo.
Package dropin is the canonical drop-in wire resolution + known-agent registry shared by fak guard and the entry-point demo.
engine
Package engine is the inference-engine seam (the EngineDriver).
Package engine is the inference-engine seam (the EngineDriver).
enginecache
Package enginecache binds cachemeta's remote invalidation directives to documented serving-engine control endpoints.
Package enginecache binds cachemeta's remote invalidation directives to documented serving-engine control endpoints.
gateway
Package gateway is the kernel-adjudicated wire: it fronts the fak kernel over MCP (newline-delimited JSON-RPC) and an OpenAI-compatible HTTP surface so an agent written in ANY language can route its tool calls through the in-process syscall boundary WITHOUT writing Go.
Package gateway is the kernel-adjudicated wire: it fronts the fak kernel over MCP (newline-delimited JSON-RPC) and an OpenAI-compatible HTTP surface so an agent written in ANY language can route its tool calls through the in-process syscall boundary WITHOUT writing Go.
ggufload
Package ggufload parses GGUF metadata and tensor directories for off-path model loading.
Package ggufload parses GGUF metadata and tensor directories for off-path model loading.
gitgate
Package gitgate is a git-aware kernel PREFILTER: a registered Adjudicator rung that inspects a shell tool call (Bash / exec / run_shell / ...) carrying a `command` string, recognizes the `git` invocation inside it, and PROVABLY REFUSES the structurally-decidable git hazards BEFORE the command runs.
Package gitgate is a git-aware kernel PREFILTER: a registered Adjudicator rung that inspects a shell tool call (Bash / exec / run_shell / ...) carrying a `command` string, recognizes the `git` invocation inside it, and PROVABLY REFUSES the structurally-decidable git hazards BEFORE the command runs.
gpulease
Package gpulease is a machine-wide advisory lease so that only one GPU-heavy process loads a model at a time.
Package gpulease is a machine-wide advisory lease so that only one GPU-heavy process loads a model at a time.
grammar
Package grammar is the tool-invocation grammar rung: the well-formedness axis the trust/effect rungs can't see.
Package grammar is the tool-invocation grammar rung: the well-formedness axis the trust/effect rungs can't see.
harvest
Package harvest is the LabelRow harvester — the data-collection rung of the compiled defender-side loop.
Package harvest is the LabelRow harvester — the data-collection rung of the compiled defender-side loop.
headroom
Package headroom is the context-compression seam: a pluggable Compressor area (headroom/native/noop plugins) folded into the result path as a ResultAdmitter.
Package headroom is the context-compression seam: a pluggable Compressor area (headroom/native/noop plugins) folded into the result path as a ResultAdmitter.
hfhub
Package hfhub resolves and downloads model files from the Hugging Face Hub via `hf://` URIs, with a local content cache, optional HF_TOKEN auth, and best-effort SHA256 verification against the Hub's LFS oid (the X-Linked-Etag the Hub stamps on every LFS object).
Package hfhub resolves and downloads model files from the Hugging Face Hub via `hf://` URIs, with a local content cache, optional HF_TOKEN auth, and best-effort SHA256 verification against the Hub's LFS oid (the X-Linked-Etag the Hub stamps on every LFS object).
ifc
Package ifc is the information-flow control layer — the CaMeL / FIDES complement to the lexical detectors (canon, normgate, ctxmmu).
Package ifc is the information-flow control layer — the CaMeL / FIDES complement to the lexical detectors (canon, normgate, ctxmmu).
journal
Package journal is the durable, append-only, tamper-evident DECISION JOURNAL — the regulated-audit (AUD) surface of the trust floor.
Package journal is the durable, append-only, tamper-evident DECISION JOURNAL — the regulated-audit (AUD) surface of the trust floor.
kernel
explain.go — the OFF-HOT-PATH dual of Fold: it folds the SAME adjudicator chain to the SAME winning verdict, but additionally records a per-rung Decision trace — the answer to the single most common debugging question in the whole kernel: "why did fak give THIS verdict for THIS tool call?"
explain.go — the OFF-HOT-PATH dual of Fold: it folds the SAME adjudicator chain to the SAME winning verdict, but additionally records a per-rung Decision trace — the answer to the single most common debugging question in the whole kernel: "why did fak give THIS verdict for THIS tool call?"
kvmmu
Package kvmmu is the bridge the in-kernel model makes possible: it turns ctxmmu's LOGICAL quarantine verdict — "these bytes may not enter the context window" — into a MECHANICAL one — eviction of that result's K/V span from the kernel-owned attention cache, so the model physically cannot attend to it.
Package kvmmu is the bridge the in-kernel model makes possible: it turns ctxmmu's LOGICAL quarantine verdict — "these bytes may not enter the context window" — into a MECHANICAL one — eviction of that result's K/V span from the kernel-owned attention cache, so the model physically cannot attend to it.
leakcheck
Package leakcheck provides the three reusable PROOF primitives a memory/goroutine-leak sweep needs, so a regression guard is a few lines instead of a hand-rolled harness each time.
Package leakcheck provides the three reusable PROOF primitives a memory/goroutine-leak sweep needs, so a regression guard is a few lines instead of a hand-rolled harness each time.
loopmgr
Package loopmgr records and summarizes long-running agent loop events.
Package loopmgr records and summarizes long-running agent loop events.
memq
Package memq is the agent-facing MEMORY-OPERATION ALGEBRA — the substrate that lets an agent (or a plugin, a driver, or an operator) author its OWN memory strategy instead of the kernel hard-coding one.
Package memq is the agent-facing MEMORY-OPERATION ALGEBRA — the substrate that lets an agent (or a plugin, a driver, or an operator) author its OWN memory strategy instead of the kernel hard-coding one.
metalgemm
Package metalgemm stub — the default (non-fakmetal) build.
Package metalgemm stub — the default (non-fakmetal) build.
metrics
Package metrics is the KPI layer + the A/B report shape.
Package metrics is the KPI layer + the A/B report shape.
model
Package model is the in-kernel inference core: a pure-Go forward pass over a single small open-source model (SmolLM2-135M / Qwen2.5-0.5B), with the KV cache as a first-class Go data structure the kernel OWNS.
Package model is the in-kernel inference core: a pure-Go forward pass over a single small open-source model (SmolLM2-135M / Qwen2.5-0.5B), with the KV cache as a first-class Go data structure the kernel OWNS.
modelengine
Package modelengine wires the in-kernel model (internal/model) into the kernel as a registered abi.EngineDriver under the id "inkernel".
Package modelengine wires the in-kernel model (internal/model) into the kernel as a registered abi.EngineDriver under the id "inkernel".
modelroute
Package modelroute is fak's model-routing spine: choose WHICH model — or which ENSEMBLE of models — serves any ASPECT of a request, under one declarative, deterministic, verifiable policy.
Package modelroute is fak's model-routing spine: choose WHICH model — or which ENSEMBLE of models — serves any ASPECT of a request, under one declarative, deterministic, verifiable policy.
normgate
Package normgate is a write-time ResultAdmitter that closes the context-MMU's measured DETECTION gap: the v0.1 ctxmmu matches injection markers and secret shapes as raw ASCII regex/substring, so any obfuscation (char-spacing, base64, homoglyph, zero-width, fullwidth, bidi, format-variant secrets) walks straight through (~100% evasion, measured on a private transcript-derived corpus).
Package normgate is a write-time ResultAdmitter that closes the context-MMU's measured DETECTION gap: the v0.1 ctxmmu matches injection markers and secret shapes as raw ASCII regex/substring, so any obfuscation (char-spacing, base64, homoglyph, zero-width, fullwidth, bidi, format-variant secrets) walks straight through (~100% evasion, measured on a private transcript-derived corpus).
pathlint
Package pathlint is a static witness for one external-boundary claim: that every user-supplied filesystem-path flag is normalized before it reaches the OS.
Package pathlint is a static witness for one external-boundary claim: that every user-supplied filesystem-path flag is normalized before it reaches the OS.
pathutil
Package pathutil holds small, dependency-free path helpers shared across the fak commands — chiefly normalizing user-supplied path flags before they reach the filesystem.
Package pathutil holds small, dependency-free path helpers shared across the fak commands — chiefly normalizing user-supplied path flags before they reach the filesystem.
plancfi
Package plancfi is control-flow integrity for an agent's PLAN — the stateful adjudicator that refuses a tool call which deviates from the approved plan.
Package plancfi is control-flow integrity for an agent's PLAN — the stateful adjudicator that refuses a tool call which deviates from the approved plan.
policy
Package policy loads the adjudicator's capability floor from a declarative, version-tagged JSON manifest instead of a compiled-in Go literal — so an adopter configures WHICH tools the agent may call by editing a file the operator can read and a reviewer can diff, never by forking the kernel and recompiling.
Package policy loads the adjudicator's capability floor from a declarative, version-tagged JSON manifest instead of a compiled-in Go literal — so an adopter configures WHICH tools the agent may call by editing a file the operator can read and a reviewer can diff, never by forking the kernel and recompiling.
polymodel
Package polymodel is the deterministic core for hosting many models on one kernel and serializing decode to one lane — the "host 10s of models, share the prefill, decode one" design, expressed as proven arithmetic with no GPU, model, or network dependency.
Package polymodel is the deterministic core for hosting many models on one kernel and serializing decode to one lane — the "host 10s of models, share the prefill, decode one" design, expressed as proven arithmetic with no GPU, model, or network dependency.
preflight
Package preflight is the pre-flight rung ladder: cheapest-first well-formedness checks that catch a malformed/unsafe call BEFORE it fires, so a dead branch never spawns a process or burns a model turn.
Package preflight is the pre-flight rung ladder: cheapest-first well-formedness checks that catch a malformed/unsafe call BEFORE it fires, so a dead branch never spawns a process or burns a model turn.
promptmmu
Package promptmmu is the cache-prefix-preserving inbound prompt MMU: the INGRESS dual of the result-side ctxmmu.
Package promptmmu is the cache-prefix-preserving inbound prompt MMU: the INGRESS dual of the result-side ctxmmu.
provenance
Package provenance is the single, kernel-authored answer to one question: "where did this byte come from, and may the kernel trust it?" — and it is the ONE place that answer is decided.
Package provenance is the single, kernel-authored answer to one question: "where did this byte come from, and may the kernel trust it?" — and it is the ONE place that answer is decided.
radixkv
Package radixkv is SGLang's RadixAttention prefix cache, rebuilt over fak's kernel-owned KV cache — the apples-to-apples answer to "how does fak compare to SGLang's KV-cache radix attention?".
Package radixkv is SGLang's RadixAttention prefix cache, rebuilt over fak's kernel-owned KV cache — the apples-to-apples answer to "how does fak compare to SGLang's KV-cache radix attention?".
ratelimit
Package ratelimit is the throughput/cost governor: the adjudicator that turns the already-plumbed RATE_LIMITED reason into an actual enforcer.
Package ratelimit is the throughput/cost governor: the adjudicator that turns the already-plumbed RATE_LIMITED reason into an actual enforcer.
recall
Package recall makes a COMPLETED agent session queryable without replaying it — the "treat a finished session as a core dump" leaf (../../session-recall-design.md).
Package recall makes a COMPLETED agent session queryable without replaying it — the "treat a finished session as a core dump" leaf (../../session-recall-design.md).
region
Package region provides a typed, in-process one-sided shared window over abi.Ref values.
Package region provides a typed, in-process one-sided shared window over abi.Ref values.
registrations
Package registrations is the "built-in driver list" (the Linux defconfig).
Package registrations is the "built-in driver list" (the Linux defconfig).
residency
Package residency is the multi-model weight-residency leaf: it hosts many prefill-warm *model.Model under one resident weight-byte budget with LRU page-out, reusing internal/polymodel.Pool as the budget + eviction POLICY and binding each admitted residency descriptor to the real in-kernel weights it governs.
Package residency is the multi-model weight-residency leaf: it hosts many prefill-warm *model.Model under one resident weight-byte budget with LRU page-out, reusing internal/polymodel.Pool as the budget + eviction POLICY and binding each admitted residency descriptor to the real in-kernel weights it governs.
rsiloop
Package rsiloop closes fak's recursive-self-improvement loop.
Package rsiloop closes fak's recursive-self-improvement loop.
rulesynth
Package rulesynth closes AUTOHARNESS's loop on OUR hand-authored harness: it mines the kernel's refusal/near-miss log to PROPOSE the next STRUCTURAL adjudicator rule, then PROVES it model-free before it can ship — never self-certifying (#537).
Package rulesynth closes AUTOHARNESS's loop on OUR hand-authored harness: it mines the kernel's refusal/near-miss log to PROPOSE the next STRUCTURAL adjudicator rule, then PROVES it model-free before it can ship — never self-certifying (#537).
rungobs
Package rungobs is the passive rung-decision distribution counter — the aggregate observability dual of `fak preflight --explain`.
Package rungobs is the passive rung-decision distribution counter — the aggregate observability dual of `fak preflight --explain`.
safecommit
Package safecommit is the EXECUTOR half of the shared-trunk commit discipline that internal/gitgate only declares defensively.
Package safecommit is the EXECUTOR half of the shared-trunk commit discipline that internal/gitgate only declares defensively.
session
Package session is the per-session DRIVE state — the first-class, queryable, live-mutable control state of a served agent session: its run-state, planner budget, scheduling priority, and per-turn pace.
Package session is the per-session DRIVE state — the first-class, queryable, live-mutable control state of a served agent session: its run-state, planner budget, scheduling priority, and per-turn pace.
sessionimage
Package sessionimage makes an agent SESSION a first-class, portable, model-agnostic VALUE — one self-describing image you can dump, archive, offload, and restore across hosts, users, instances, VMs, and a model change, then RESUME where it left off.
Package sessionimage makes an agent SESSION a first-class, portable, model-agnostic VALUE — one self-describing image you can dump, archive, offload, and restore across hosts, users, instances, VMs, and a model change, then RESUME where it left off.
sessionreset
Package sessionreset builds the "human-like" carryover a fresh session is seeded with when a long-running session crosses its token budget.
Package sessionreset builds the "human-like" carryover a fresh session is seeded with when a long-running session crosses its token budget.
sharedtask
Package sharedtask is the in-memory reference fold for collaborative task records.
Package sharedtask is the in-memory reference fold for collaborative task records.
shipgate
adjudicate.go puts the ship gate ON the kernel's decision path: a registered Adjudicator that holds a ship-shaped tool call behind the require-witness rung.
adjudicate.go puts the ship gate ON the kernel's decision path: a registered Adjudicator that holds a ship-shaped tool call behind the require-witness rung.
simhash
Package simhash is fak's REFERENCE vector-similarity primitive — the dependency-free embedding + cosine + top-k substrate the observability layer hands to anyone who wants to find near-duplicate queries, cluster trajectories, or flag outlier ("bad") queries WITHOUT fak choosing a semantic model for them.
Package simhash is fak's REFERENCE vector-similarity primitive — the dependency-free embedding + cosine + top-k substrate the observability layer hands to anyone who wants to find near-duplicate queries, cluster trajectories, or flag outlier ("bad") queries WITHOUT fak choosing a semantic model for them.
snapshot
Package snapshot is the uniform DUMP/RESTORE seam over fak's primitives.
Package snapshot is the uniform DUMP/RESTORE seam over fak's primitives.
spec
Package spec is the speculative-execution leaf: the first implementation of the frozen abi.ProvisionalSink seam, and the registrant of the reserved OpsSpec ops (OpSpecCommit / OpSpecSquash).
Package spec is the speculative-execution leaf: the first implementation of the frozen abi.ProvisionalSink seam, and the registrant of the reserved OpsSpec ops (OpSpecCommit / OpSpecSquash).
steward
Package steward is the steward population: a set of cheap, single-invariant validators that garden the kernel's journal.
Package steward is the steward population: a set of cheap, single-invariant validators that garden the kernel's journal.
storedrv
Package storedrv is fak's pluggable STORAGE-DRIVER framework — the seam that lets every kind of data live in the place that fits it (hot RAM, durable disk, a remote object store, later a columnar or KV backend) instead of the one in-memory map the v0.1 blob store gives everything.
Package storedrv is fak's pluggable STORAGE-DRIVER framework — the seam that lets every kind of data live in the place that fits it (hot RAM, durable disk, a remote object store, later a columnar or KV backend) instead of the one in-memory map the v0.1 blob store gives everything.
swebench
Package swebench turns SWE-bench Verified into a fak-native benchmark whose results are directly comparable to the external "N-Server Cache Benchmarking Tool" (the Benchmark repo, "bench") that runs the same task set against an SGLang endpoint.
Package swebench turns SWE-bench Verified into a fak-native benchmark whose results are directly comparable to the external "N-Server Cache Benchmarking Tool" (the Benchmark repo, "bench") that runs the same task set against an SGLang endpoint.
taskmgr
Package taskmgr is fak's process-local task manager concept.
Package taskmgr is fak's process-local task manager concept.
tokenizer
Package tokenizer is a tokenizer leaf for offline text/id conversion outside the model proof path.
Package tokenizer is a tokenizer leaf for offline text/id conversion outside the model proof path.
toollint
Package toollint is the kernel's STATIC tool linter: it checks the registered tool SURFACE for inconsistencies the runtime would otherwise silently paper over on every single call.
Package toollint is the kernel's STATIC tool linter: it checks the registered tool SURFACE for inconsistencies the runtime would otherwise silently paper over on every single call.
tracesink
Package tracesink is a payload-bearing, IFC-labeled TRAJECTORY SINK.
Package tracesink is a payload-bearing, IFC-labeled TRAJECTORY SINK.
trajectory
Package trajectory is fak's TRAJECTORY DATA PLANE — the typed, exportable record of what an agent actually did, turn by turn, that application-layer optimizers build trajectory/memory/cache/planner analyses ON TOP of.
Package trajectory is fak's TRAJECTORY DATA PLANE — the typed, exportable record of what an agent actually did, turn by turn, that application-layer optimizers build trajectory/memory/cache/planner analyses ON TOP of.
trajhook
Package trajhook is the PLUGGABLE TRAJECTORY-SCORER SEAM — the rung that lets a trivial application-layer skill garden trajectories (flag bad queries, find near-duplicate work, prune dead memory) WITHOUT a core edit to fak.
Package trajhook is the PLUGGABLE TRAJECTORY-SCORER SEAM — the rung that lets a trivial application-layer skill garden trajectories (flag bad queries, find near-duplicate work, prune dead memory) WITHOUT a core edit to fak.
turnbench
divhist.go — the DIVERGENCE-RATE HISTOGRAM over a corpus of traces × candidate policies (issue #501(b)).
divhist.go — the DIVERGENCE-RATE HISTOGRAM over a corpus of traces × candidate policies (issue #501(b)).
urllint
Package urllint is a static witness for the network external-boundary claim's twin of pathlint: that no Go source hardcodes a model/tokenizer DOWNLOAD url outside the one audited chokepoint that derives and (via a network-gated test) verifies them.
Package urllint is a static witness for the network external-boundary claim's twin of pathlint: that no Go source hardcodes a model/tokenizer DOWNLOAD url outside the one audited chokepoint that derives and (via a network-gated test) verifies them.
vcachecal
Package vcachecal is the vCache observe & calibrate engine — milestone M1 of the vCache epic (issue #716).
Package vcachecal is the vCache observe & calibrate engine — milestone M1 of the vCache epic (issue #716).
vcachechain
Package vcachechain is the vCache chains & recall engine — milestone M4 of the vCache epic (issue #719).
Package vcachechain is the vCache chains & recall engine — milestone M4 of the vCache epic (issue #719).
vcachegov
Package vcachegov is the vCache Governor — the steady-state policy layer that decides, per cacheable prefix, whether to heartbeat-pin it, let it lazy-rebuild, ride natural traffic, or evict it; how many prefixes to warm inside rate-limit headroom; and how to route chained requests onto a consistent warm shard.
Package vcachegov is the vCache Governor — the steady-state policy layer that decides, per cacheable prefix, whether to heartbeat-pin it, let it lazy-rebuild, ride natural traffic, or evict it; how many prefixes to warm inside rate-limit headroom; and how to route chained requests onto a consistent warm shard.
vcachescore
Package vcachescore composes the vCache proof leaves into an agent-facing benchmark scorecard.
Package vcachescore composes the vCache proof leaves into an agent-facing benchmark scorecard.
vcachestar
Package vcachestar is the vCache M2 star-anchor decision layer.
Package vcachestar is the vCache M2 star-anchor decision layer.
vcachewarm
Package vcachewarm is the vCache M3 dedicated-warming decision layer.
Package vcachewarm is the vCache M3 dedicated-warming decision layer.
vdso
Package vdso is the tool vDSO: a 3-tier local fast path that answers a tool call with NO engine and NO remote round-trip — the agentic analogue of the kernel vDSO that serves gettimeofday() from userspace without a syscall.
Package vdso is the tool vDSO: a 3-tier local fast path that answers a tool call with NO engine and NO remote round-trip — the agentic analogue of the kernel vDSO that serves gettimeofday() from userspace without a syscall.
webbench
Package webbench turns frontier web/browser agent benchmarks into fak-native benchmarks whose results directly measure the value of fak's session value stack on multi-turn web automation tasks.
Package webbench turns frontier web/browser agent benchmarks into fak-native benchmarks whose results directly measure the value of fak's session value stack on multi-turn web automation tasks.
webbench/browser
browser - web automation layer for webbench Uses Playwright CLI for browser control (cross-platform)
browser - web automation layer for webbench Uses Playwright CLI for browser control (cross-platform)
wirescreen
Package wirescreen — ROADMAP for the "local model on the wire" proposer spine.
Package wirescreen — ROADMAP for the "local model on the wire" proposer spine.
witness
decision.go — the append-only decision recorder: every adjudication / refusal the kernel makes, written as a git note on a DEDICATED side ref so the record is durable, peer-readable, and NEVER touches the trunk's commit objects.
decision.go — the append-only decision recorder: every adjudication / refusal the kernel makes, written as a git note on a DEDICATED side ref so the record is durable, peer-readable, and NEVER touches the trunk's commit objects.
xenginekv
Package xenginekv ships the cross-engine zero-copy KV co-residence seam (#448): a RegionBackend whose Resolver hands out RefRegion handles into ONE addressable arena where an EXTERNAL engine's KV cache and fak's tool args/results CO-RESIDE.
Package xenginekv ships the cross-engine zero-copy KV co-residence seam (#448): a RegionBackend whose Resolver hands out RefRegion handles into ONE addressable arena where an EXTERNAL engine's KV cache and fak's tool args/results CO-RESIDE.
pkg
abi
Package abi is the IMPORTABLE vendor surface of fak's frozen ABI.
Package abi is the IMPORTABLE vendor surface of fak's frozen ABI.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL