From ced29806bf8a53de016cf1be06b845468c5fa9b1 Mon Sep 17 00:00:00 2001 From: Chris Phillipson Date: Tue, 28 Jul 2026 21:16:56 -0700 Subject: [PATCH 1/6] feat: add capability-driven integration adapters --- README.md | 32 +- bin/agentic-kit.mjs | 15 +- claude/aqe-reference.md | 2 +- claude/dual-mode-reference.md | 6 +- claude/providers-reference.md | 20 +- docs/LOCAL-MODEL-VALIDATION.md | 7 + docs/MANAGED-TOOLS.md | 8 +- docs/PROVIDERS.md | 63 ++- docs/TRANSCRIPTS.md | 36 +- docs/TROUBLESHOOTING.md | 1 + docs/UPGRADING.md | 26 +- docs/USAGE-SCORECARD-METRICS.md | 61 +-- ...-capability-driven-integration-adapters.md | 423 ++++++++++++++++++ docs/adr/README.md | 8 + src/commands/dual.mjs | 6 +- src/commands/setup.mjs | 10 +- src/commands/status.mjs | 11 +- src/commands/sync.mjs | 4 +- src/commands/x/provider.mjs | 27 +- src/commands/x/verify.mjs | 4 +- src/lib/adapters/bindings.mjs | 97 ++++ src/lib/adapters/config.mjs | 50 +++ src/lib/adapters/facts.mjs | 132 ++++++ src/lib/adapters/index.mjs | 8 + src/lib/adapters/lifecycle.mjs | 60 +++ src/lib/adapters/migration.mjs | 56 +++ src/lib/adapters/ownership.mjs | 37 ++ src/lib/adapters/registries.mjs | 267 +++++++++++ src/lib/adapters/schema.mjs | 51 +++ src/lib/config.mjs | 10 +- src/lib/dashboard/client.mjs | 11 +- src/lib/hosts.mjs | 46 +- src/lib/live/event-schema.mjs | 21 +- src/lib/providers.mjs | 80 +++- src/lib/routing.mjs | 5 +- src/lib/usage-index.mjs | 51 ++- src/lib/usage-insights.mjs | 10 +- tests/dashboard.test.cjs | 34 +- .../adapter-lifecycle-conformance.test.mjs | 99 ++++ tests/kit/adapter-registries.test.mjs | 103 +++++ tests/kit/capability-derived.test.mjs | 88 ++++ tests/kit/cli-help.test.mjs | 3 +- tests/kit/dispatch-surface.test.mjs | 2 + tests/kit/helpers/integration-builders.mjs | 84 ++++ tests/kit/helpers/lifecycle-harness.mjs | 65 +++ tests/kit/host-cli-migration.test.mjs | 117 +++++ tests/kit/integration-command-facts.test.mjs | 33 ++ tests/kit/integration-config.test.mjs | 120 +++++ tests/kit/integration-facts.test.mjs | 140 ++++++ tests/kit/live-qe-contract.test.mjs | 3 +- tests/kit/observability-identity.test.mjs | 113 +++++ tests/kit/provider-cli.test.mjs | 24 +- tests/kit/provider-credentials.test.mjs | 35 +- .../provider-proving-integrations.test.mjs | 72 +++ tests/kit/usage-index.test.mjs | 27 +- tests/kit/usage-limit-insights.test.mjs | 2 +- 56 files changed, 2729 insertions(+), 197 deletions(-) create mode 100644 docs/adr/0016-capability-driven-integration-adapters.md create mode 100644 src/lib/adapters/bindings.mjs create mode 100644 src/lib/adapters/config.mjs create mode 100644 src/lib/adapters/facts.mjs create mode 100644 src/lib/adapters/index.mjs create mode 100644 src/lib/adapters/lifecycle.mjs create mode 100644 src/lib/adapters/migration.mjs create mode 100644 src/lib/adapters/ownership.mjs create mode 100644 src/lib/adapters/registries.mjs create mode 100644 src/lib/adapters/schema.mjs create mode 100644 tests/kit/adapter-lifecycle-conformance.test.mjs create mode 100644 tests/kit/adapter-registries.test.mjs create mode 100644 tests/kit/capability-derived.test.mjs create mode 100644 tests/kit/helpers/integration-builders.mjs create mode 100644 tests/kit/helpers/lifecycle-harness.mjs create mode 100644 tests/kit/host-cli-migration.test.mjs create mode 100644 tests/kit/integration-command-facts.test.mjs create mode 100644 tests/kit/integration-config.test.mjs create mode 100644 tests/kit/integration-facts.test.mjs create mode 100644 tests/kit/observability-identity.test.mjs create mode 100644 tests/kit/provider-proving-integrations.test.mjs diff --git a/README.md b/README.md index 1ead549..89c7947 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,21 @@ ak setup --codex # …or bring up Claude + Codex together in one shot - **Honest by construction:** every guard traces to a filed upstream issue, and `ak x verify` proves the paths end-to-end against real CLIs. - Cross-platform, **zero runtime dependencies** (SQLite embedded). +## Hosts, providers, and bindings + +A **host** is the agent CLI driving a session (Claude Code, Codex CLI, or OpenCode). A +**provider** serves inference (Anthropic, OpenAI, OpenRouter, or Ollama). A **projection** is a +native configuration surface, and an **observability source** supplies transcript, usage, quota, +or catalogue evidence. A **binding** connects a host to a provider through a supported projection +and transport. + +Those axes do not imply one another. OpenRouter is a provider behind a host, not another host. +Ollama can have independent bindings through Claude and Codex. OpenCode is a managed host but is +not currently a primary or activity-routing target. Existing `providers.dualRouting` and +`ak dual` remain Claude+Codex host-routing interfaces. Provider, model, and billing claims state +whether they are observed, configured, inferred, or unknown. See +[ADR-0016](docs/adr/0016-capability-driven-integration-adapters.md). + ## Why this exists ruflo promises persistent memory, self-learning, security scanning, and background @@ -51,6 +66,8 @@ ak status read-only dashboard: what's true, what's drifted [--json] [--d ak sync converge to good: upgrade + heal + verify [--dry-run] [--no-upgrade] ak dashboard open the local web dashboard (auto-opens your browser) [--port N] [--no-open] [--live-source 'surface=path'] +ak host manage execution hosts, routing, and provider bindings + status | pick | refresh | off ak dual run a Claude+Codex collaboration swarm (dual-host) run