This document defines what is allowed into KelvinClaw core (crates/kelvin-core) and what must stay in extensions/adapters.
Kelvin core exists to provide stable contracts and deterministic orchestration primitives for a minimal "Claw":
- run request/response types
- stream event types
- trait interfaces (
Brain,MemorySearchManager,ModelProvider,Tool,SessionStore,EventSink) - shared errors and compatibility-safe value objects
Core should remain small, readable, and hard to break.
The SDK identity for these contracts is Kelvin Core (see docs/KELVIN_CORE_SDK.md).
A change can enter core only if all checks pass:
- Required everywhere: every Kelvin deployment needs it, independent of provider/vendor/runtime.
- Contract over implementation: it defines behavior boundaries, not a concrete backend.
- Deterministic semantics: behavior is predictable and testable without external services.
- Security baseline: no expanded privilege surface, no implicit filesystem/network access, no secret coupling.
- Dependency discipline: no heavy or provider-specific dependency is introduced.
- Version stability: the API can be maintained under semver without frequent breakage.
If one check fails, the change belongs in a plugin/adapter crate.
- provider-specific clients (LLM SDKs, cloud APIs, vector databases)
- transport implementations (websocket/http servers, gateway protocol wiring)
- persistence engines (sql, redis, object stores) beyond trait contracts
- business/product policy logic that can vary by deployment
- large utility layers that are not required for core contracts
Core dependencies must be:
- broadly trusted and mature
- small in transitive footprint
- runtime-agnostic where possible
Any new dependency must include a short justification in the PR description:
- why core needs it
- what alternatives were rejected
- expected maintenance/security impact
- No
unsafecode in core. - No direct secret loading or credential management in core.
- Validate untrusted input at boundary types where practical.
- Keep error messages useful but avoid leaking sensitive runtime details.
kelvin-core should be treated as the SDK compatibility anchor:
- breaking changes require a major version bump
- additive changes are preferred over mutating existing fields/traits
- deprecated fields/traits should include a transition window and migration notes
Before merging any core change, confirm:
- it passes all hard admission checks
- tests cover expected and error paths
- docs reflect any contract changes
- change does not force plugin authors into unnecessary rewrites