docs(adr): 0001 — Adapter contract (v1)#267
Merged
EmersonBraun merged 1 commit intomainfrom Apr 14, 2026
Merged
Conversation
Promotes the implicit adapter contract in packages/core/src/types/adapter.ts to a formal, versioned artifact. Defines 10 invariants (A1-A10) that every conformant adapter must satisfy, covering: - Pure factory construction (no work until stream() is called) - Single iteration per StreamSource - Explicit terminal chunks (done | error | caller abort) - Chunk purity for speculative execution and streaming - Tool-call atomicity (deferring partial-args streaming to a future ADR) - Safe abort at any point - No input mutation (required for replay and ensemble adapters) - Error-as-chunk, not throw - Closed-over configuration at construction time Also adds docs/architecture/adrs/README.md with ADR process and index listing the five follow-up contracts tracked in #214. Refs #214
This was referenced Apr 14, 2026
EmersonBraun
added a commit
that referenced
this pull request
Apr 14, 2026
Reframes the README from a generic 'complete toolkit' pitch to an opinionated, honest, story-driven entry point. What's new: - Tagline 'The agent toolkit JavaScript actually deserves' — opinion, not buzzwords - 'Why this exists' section linking to ORIGIN.md and MANIFESTO.md - 'Before and after' section showing the typical cobbled stack vs AgentsKit's two-import equivalent - Honest 'When you should NOT use AgentsKit' section — directs people to single-OpenAI-call, Vercel AI SDK for chat-only, Python frameworks, mature observability platforms, or pre-1.0 caution - Comparison table now includes formal contracts row and edge-readiness - Stability tier column on the ecosystem table - Architecture and contracts section linking the six ADRs - 'For AI agents reading this' section — first-class doc consumers - Status section linking Phase 0 and Master PRDs - agentskit.io as canonical docs URL What's preserved and tightened: - Quickstart in 10 lines (single example, not three competing) - Multi-agent delegation example - Provider swap demonstration - Terminal chat (Ink) callout Aligns with stories #224 (README rewrite) and #16 (honest comparison incl. when NOT to use). Builds on Manifesto + Origin (#265) and the six contract ADRs (#267-#274). Refs #224 #16 #211
6 tasks
EmersonBraun
added a commit
that referenced
this pull request
Apr 15, 2026
Reframes the README from a generic 'complete toolkit' pitch to an opinionated, honest, story-driven entry point. What's new: - Tagline 'The agent toolkit JavaScript actually deserves' — opinion, not buzzwords - 'Why this exists' section linking to ORIGIN.md and MANIFESTO.md - 'Before and after' section showing the typical cobbled stack vs AgentsKit's two-import equivalent - Honest 'When you should NOT use AgentsKit' section — directs people to single-OpenAI-call, Vercel AI SDK for chat-only, Python frameworks, mature observability platforms, or pre-1.0 caution - Comparison table now includes formal contracts row and edge-readiness - Stability tier column on the ecosystem table - Architecture and contracts section linking the six ADRs - 'For AI agents reading this' section — first-class doc consumers - Status section linking Phase 0 and Master PRDs - agentskit.io as canonical docs URL What's preserved and tightened: - Quickstart in 10 lines (single example, not three competing) - Multi-agent delegation example - Provider swap demonstration - Terminal chat (Ink) callout Aligns with stories #224 (README rewrite) and #16 (honest comparison incl. when NOT to use). Builds on Manifesto + Origin (#265) and the six contract ADRs (#267-#274). Refs #224 #16 #211
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
First ADR of Phase 0 — formalizes the Adapter contract that has been implicit in
packages/core/src/types/adapter.ts.What's included
docs/architecture/adrs/0001-adapter-contract.md— the contract itself: 4 types + 10 invariants (A1-A10), stability tier (stable), rationale, consequences, alternatives considered, and open questions.docs/architecture/adrs/README.md— ADR process (what, when, format, index).Why this matters
Before Fase 3 adds 10+ new adapters (Mistral, Cohere, Groq, Bedrock, xAI/Grok, local models via Ollama/llama.cpp, etc.), we need a verifiable contract. Today "plug-and-play" is aspirational. After this ADR:
AdapterContractSuitecan validate any adapter mechanically.Key invariants (the important ones)
createSourcedoes no work untilstream()is called (enables retry/replay)done,error, or caller-initiated abort (no silent endings)stream(), they emit a chunkTrade-offs made explicit
metadatais untyped (Record<string, unknown>) — provider-specific data lives there, consumers must not depend on its shapeFollow-ups (tracked in #214)
Test plan
packages/adapters?Refs #214 #211