Lab: design a capability seam and provider
Design interface, implementation, and consumer together; an abstract class alone is not a seam
definition + provider + consumerWhen should you add a provider, and when should you design a new seam?
A socket standard is not one socket shell. It defines the electrical interface, manufacturers producing sockets, and appliances consuming them. Without all roles, it has no product meaning.
Mechanism
When a service contract exists, a new provider implements its semantics and registers. A new capability requires a service definition, at least one provider, a consumer, and a clear replacement value.
Provider-specific config stays in the implementation package; consumers depend only on the service. Capability catalogs and module graphs verify there are no unnecessary reverse dependencies.
Prove replacement value
Identify two plausible implementations or one clear deployment boundary.
What extensions must preserve
- Consumers do not import provider packages
- Every implementation can honor interface error semantics
- Provider disposal fully releases SDK, process, or remote resources
The tempting wrong turns
- ×Abstracting prematurely for one implementation
- ×Leaking provider names into agent-loop
- ×Offering an arbitrary protocol escape hatch
h26-build-adapter.ts TypeScriptabstract class WeatherService extends Service {
abstract lookup(input: WeatherQuery, signal?: AbortSignal): Promise<WeatherSnapshot>
}
class HttpWeatherProvider extends WeatherService {
async lookup(input: WeatherQuery, signal?: AbortSignal) {
return normalize(await this.client.fetch(input, { signal }))
}
}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.
docs/capability-seams.mdDefinitions, implementations, consumers, and policy consumers.
docs/cookbook/adding-an-llm-adapter.mdA concrete provider-extension example.
docs/cookbook/adding-a-package.mdPackage boundaries, dependencies, and verification.
Pause for ten seconds before revealing
Why does the LSP seam not expose sendRawRequest()?
A capability still needs human and client surfaces. Next: how Web, CLI, ACP, SDK, and Host share one agent.