Architecture
Emitters and hook points
Which emitter of chock compile writes each hook point, and the file chock sync installs for it.
A hook point is where a compiled control runs. The chock compile command hands each policy to one emitter per hook point. Then chock sync installs what the emitters wrote. Each arrow out of chock compile names the hook points that emitter writes, as the engine's compiler maps them.
Diagram
- Engine code
- Generated file
Select a box to read its card below.
Select a box to read its card here.
Components
chock compileEngine codeRuns the emitter for each hook point on a policy, in the engine's order, and writes the output to
.chock/compiled/<id>/<surface>/. The gateway hook point has no emitter. It is modeled for budgets and egress, and nothing is emitted for it.Source: chock/src/chock/compile/compiler.py @ 5a4b6287a46e
Git hook emitter Engine code
Emits git-hook entrypoints from the policy's implementations folder: guards at pre-commit, pre-merge-commit and pre-push. Hard at commit and push.
git commit --no-verifyskips it.Source: chock/src/chock/compile/emitters/git_hook.py @ 5a4b6287a46e
CI emitter Engine code
Emits a CI gate step that re-runs the policy's check over a pull request's commit range: the backstop for a skipped git hook.
Source: chock/src/chock/compile/emitters/ci.py @ 5a4b6287a46e
In-agent emitter Engine code
Hook fragments for every wired vendor. The
pre-tool-usehook point refuses a call before it runs. Thestophook point reads what the turn left in the worktree and earns no coverage word. Theagent-hookshook point is the same deny for Copilot CLI and VS Code agent mode.Source: chock/src/chock/compile/emitters/in_agent.py @ 5a4b6287a46e
Managed settings Engine code
Emits Claude managed-settings.json fragments. There is no installer, so it enforces nothing today.
Source: chock/src/chock/compile/emitters/claude_managed.py @ 5a4b6287a46e
Ambient rule Engine code
Emits the AGENTS.md block the agent is asked to follow. Advisory: it blocks nothing on its own.
Source: chock/src/chock/compile/emitters/ambient.py @ 5a4b6287a46e
MCP gateway Engine code
Emits the gate specs the MCP proxy evaluates per tool call. It governs MCP-routed tool calls only.
Source: chock/src/chock/compile/emitters/mcp_gateway.py @ 5a4b6287a46e
Git hooks Generated file
The chock sync command installs a dispatcher in .git/hooks. It runs every executable script for the event.
Source: chock/src/chock/hooks/data/dispatcher.sh @ 5a4b6287a46e
CI workflow Generated file
With --ci, chock sync writes .github/workflows/chock.yml. Until then ci-gate is compiled and inert, and the coverage report says so.
Source: chock/src/chock/scaffold/install_ci.py @ 5a4b6287a46e
Agent hook files Generated file
The chock sync command writes each wired agent's hook file, in that agent's own format. What happens when a hook cannot run is agentseam's data, listed below.
Agentseam's tier table at the release the engine pins, by fail mode:
- No adapted pre-tool hook (10): Aider (none), Amp (unadapted), GitHub Copilot (Agent Plugins 1.0 marketplace bundle) (unadapted), DeepSeek Harness (dsh) (unadapted), Kilo Code (unadapted), Kiro (unadapted), OpenCode (unadapted), Replit Agent (unadapted), Roo Code (unadapted), Zed (none)
- If the hook fails, the action goes through (14): Antigravity (block+rewrite), Claude Code (block+rewrite), Cline (block), OpenAI Codex CLI (block+rewrite), Devin (block+rewrite), Factory Droid (block), Gemini CLI (block+rewrite), Grok CLI (block), Junie CLI (block+rewrite), Kimi Code CLI (block), OpenHands (block), Tabnine CLI (block+rewrite), GitHub Copilot (VS Code agent mode / CLI) (block+rewrite), Windsurf (Cascade) (block)
- What a failed hook does can be configured (3): Cursor (block+rewrite), goose (block), Mistral Vibe (block+rewrite)
Source: chock/src/chock/hooks/in_agent_install.py @ 5a4b6287a46e
INDEX.md Generated file
The chock sync command compiles every active rule into .agents/policies/INDEX.md. AGENTS.md holds one pointer to it.
Source: chock/src/chock/index/builder.py @ 5a4b6287a46e
Gateway proxy Engine code
A stdio proxy the client launches instead of the real MCP server. It refuses matching
tools/callpayloads. One downstream server per gateway process.Source: chock/src/chock/gateway/proxy.py @ 5a4b6287a46e
Connections
chock compile→ Git hook emitter:git-hookchock compile→ CI emitter:ci-gatechock compile→ In-agent emitter:pre-tool-use, stop, agent-hookschock compile→ Managed settings:managed-settingchock compile→ Ambient rule:ambient-rulechock compile→ MCP gateway:mcp-gateway- Git hook emitter → Git hooks:
chock sync - CI emitter → CI workflow:
chock sync --ci - In-agent emitter → Agent hook files:
chock sync - Ambient rule → INDEX.md:
chock sync - MCP gateway → Gateway proxy:
gateway run
Main path
The flow this diagram is about, in order:
chock compile- In-agent emitter
- Agent hook files
Pinned sources
Every box cites a file at these commits. CI fails the build if a cited path is missing at its commit.
- chock @ 5a4b6287a46e
Built from engine 5a4b6287a46e and catalog 1e60d211c1bb.