Services and events: separate capability from cooperation
Services answer who can act; events answer when others may participate
service = capability · event = extension pointWhen should you call ctx.fs, and when should you listen to fs/write-intent?
A radiology department is a service with a clear interface and active provider. A pre-op review is an event where multiple specialties participate, observe, or alter a decision.
Mechanism
Services suit capabilities with identity, methods, and replaceable implementations. Events suit cross-cutting policy, observation, and waterfall transformation.
DeepSeek Harness distinguishes durable SessionEvents, live agent/* events, and capability events. Choosing the wrong domain corrupts replay or loses control semantics.
Declare contract
Services define methods; events define payload and dispatch mode.
What extensions must preserve
- Waterfall listeners delegate only by calling next()
- There is one authoritative final fact
- Durable event payloads must be lossless JSON
The tempting wrong turns
- ×Implementing return-value capabilities with broadcast events
- ×Mutating state inside an observation event
- ×Letting observer exceptions escape an authoritative dispatcher
Do not trust the conclusion—verify it
These anchors are pinned to official deepseek-harness@47f9438; account for later breaking changes when reading current upstream.
Pause for ten seconds before revealing
Why is approval a waterfall instead of a broadcast?
Next we add scope: how the same service and event protocol can resolve differently in different agent worlds.