Status: accepted (2026-06-11)
The product principle (see the 微内核Harness实现思路 design doc) is "everything is a plugin": hooks, /goal, /loop, dynamic workflows, compaction, sandboxing, permissions, UI, persistence, MCP, skills must all be writable as plugins without modifying the core. Candidate mechanisms considered: a purpose-built middleware stack (koa-compose style), an explicit phase state machine plugins can insert into, or Cordis's native event system.
Pure Cordis event taxonomy. The loop's extension seams are typed events with deliberate dispatch modes:
agent/request, agent/step-result, agent/turn-continuation, tools/execute, llm/stream, llm/generate, system-prompt/assemble.session/flush.The event vocabulary lives in interface packages (dsh-agent declares the agent/* events); @deepseek-ai/dsh-agent-loop is the only concrete plugin and is itself swappable — nothing outside it may depend on it.
next() or short-circuit) are non-obvious and must be taught — documented in AGENTS.md and covered by composition tests.