How utsapoddar/dopa-kernel works
DopaKernel is a semantic controller for AI coding agents: it freezes a goal into verifiable requirements, selects actions from recorded progress, tracks mutation outcomes, and withholds completion until current evidence satisfies the contract. The main route is the decide.py CLI; Claude hooks additionally gate tool mutations and turn completion. The README documents the contract and hook behavior, while sampled source supports the state, policy, verification, and gate connections shown. Other unsampled capabilities are represented only where the README establishes them.
Main entry points: decide.py Controller CLI · model.py Goal State · gate_decide.py Mutation Gate · gate_tests.py Completion Gate
Components 13
Goal Workflow
- Goal Contract
reference/goal-contract.md - Controller CLI
kernel/decide.py
Decision Kernel
- Goal State
kernel/model.py - Action Policy
kernel/policy.py - Evidence Evaluator
kernel/evaluator.py
Claude Hooks
- Mutation Gate
kernel/gate_decide.py - Completion Gate
kernel/gate_tests.py
Agent Guidance
- Claude Adapter
adapters/claude/SKILL.md - Kernel Guidance
SKILL.md
Other components
- User
- Coding Agent
- Claude Code
- Target Workspace
Connections 21
- User → Coding Agent: sets objective
- Coding Agent → Goal Contract: writes contract
- Coding Agent → Controller CLI: runs commands
- Controller CLI → Goal State: starts or updates
- Controller CLI → Action Policy: selects action
- Action Policy → Goal State: reads and saves
- Controller CLI → Evidence Evaluator: verifies or evaluates
- Evidence Evaluator → Target Workspace: runs verifier
- Evidence Evaluator → Goal State: records evidence
- Controller CLI → Target Workspace: records outcome
- Claude Code → Mutation Gate: sends tool event
- Mutation Gate → Goal State: checks goal state
- Mutation Gate → Action Policy: rechecks selection
- Mutation Gate → Claude Code: allows or blocks
- Claude Code → Completion Gate: requests stop
- Completion Gate → Evidence Evaluator: evaluates completion
- Completion Gate → Goal State: checks active goal
- Completion Gate → Claude Code: allows or blocks
- Coding Agent → Claude Adapter: loads guidance
- Claude Adapter → Kernel Guidance: routes to
- Kernel Guidance → Coding Agent: explains workflow