Tutorials
The tutorial section is at the heart of what Dsh-Go offers. We have designed a progressive path around “building an understanding of the Agent kernel from scratch”, where every step ships with a runnable code example and a source reference.
Core Kernel (Three Steps)
- Event Sourcing — why “recording events instead of state” is more robust
- fold Projection — how state is “derived” from the event log
- Goal State Machine — how an Agent turns a goal into an execution loop with round continuation
Agent Loop
- Turn / Step Dual Loop — how a conversation is structured as nested Turn and Step loops with strict monotonic numbering
- Agent Loop & Runtime — how the Agent drives the loop, manages status, inbox, cancellation, and request-error recovery
Safety & Governance
- Sandbox & Controlled Execution — where can the Agent write? Three sandbox modes, policy resolution, and fail-closed confinement
Extension & Engineering
- Plugin Kernel & Event System — how everything-is-a-plugin lands: a registry, four dispatch modes, and auto cleanup
- Tool Execution Pipeline — the fixed stages of a tool call, three-state decision, and monotonic guard
- Capability Seams & LLM Adapter — Definition / Provider / Consumer and attaching any model
- Bundle & Profile Layering — bundle/profile as Preset composition and layered Settings
- Defensive Patterns & Postmortem — result reporting, cleanup, credentials, and the four-question postmortem
- Context Feeding — instruction discovery, clock context and in-process scheduling
Running It
1# Core kernel tutorial (three steps in one)
2go run ./examples/tutorial
3
4# Sandbox & approval deep-dive
5go run ./examples/sandbox_approvalSource Reference
pkg/session/session.go— the event log and its event vocabulary (including Turn/Step data structures)pkg/session/fold.go— the fold projection function familypkg/goal/goal.go— the Goal state machinepkg/agent/agent.go— the Agent loop driving Turn/Step dual looppkg/sandbox/sandbox.go— three sandbox modes and fail-closed confinementpkg/approval/approval.go— the approval policy (the other safety gate)pkg/registry/registry.go— a freezable capability registrypkg/eventbus/eventbus.go— event bus (emit/bail/serial)pkg/waterfall/waterfall.go— onion-style waterfall chainpkg/tools/— tool pipeline, three-state decision, monotonic guard, layered maskpkg/llm/llm.go— LLMAdapter and StreamChunk protocolpkg/presets/,pkg/settings/— preset composition and layered configpkg/credentials/credentials.go— credential references and minimal exposure
Roadmap
🚀
This project is positioned as a reference implementation and teaching material. More topic-specific tutorials will keep being added here: tool governance, sub-agent orchestration, MCP bridging, cache affinity, and more.