From 8d5402a7a6f0b133f96cff6dae219ecd78863a52 Mon Sep 17 00:00:00 2001 From: Chris Phillipson Date: Thu, 30 Jul 2026 19:12:01 -0700 Subject: [PATCH] feat!: remove pre-GA compatibility surfaces Replace the retired dual/provider commands and compatibility state with canonical ak run, ak host, routing, and integrations surfaces. Preserve legacy intent through one-way lossless migration and harden the package and documentation guards. --- MAINTAINER.md | 54 ++-- README.md | 22 +- bin/agentic-kit.mjs | 44 ++-- claude/dual-mode-reference.md | 23 +- claude/providers-reference.md | 16 +- claude/ruflo-opencode-reference.md | 3 +- docs/LIVE-SESSIONS.md | 14 +- docs/PROVIDERS.md | 28 +- docs/TROUBLESHOOTING.md | 4 +- docs/UPGRADING.md | 41 ++- ...001-one-routing-policy-many-projections.md | 8 +- ...-vocabulary-defaults-from-ruv-templates.md | 8 +- .../0003-auto-seed-dual-host-provenance.md | 8 +- docs/adr/0004-escalation-per-projection.md | 9 +- .../0005-dashboard-in-page-routing-reveal.md | 8 +- ...primary-host-and-ambidextrous-mirroring.md | 12 +- ...nance-zero-cost-and-transcript-fidelity.md | 8 +- docs/adr/0012-live-sessions-observability.md | 9 +- ...-capability-driven-integration-adapters.md | 9 +- docs/adr/0017-opencode-host.md | 20 +- .../0018-generalized-host-worker-execution.md | 9 +- docs/adr/0019-escalation-in-ak-run.md | 9 +- docs/adr/0020-ga-stable-surfaces.md | 105 ++++++++ docs/adr/README.md | 40 +-- docs/ddd/README.md | 9 +- docs/ddd/integration-management.md | 14 +- docs/ddd/live-sessions.md | 10 +- docs/ddd/routing-and-orchestration.md | 33 +-- docs/ddd/ubiquitous-language.md | 20 +- package.json | 6 + scripts/build-check.mjs | 29 ++- src/commands/dual.mjs | 218 ---------------- src/commands/run.mjs | 25 +- src/commands/setup.mjs | 28 +- src/commands/status.mjs | 34 +-- src/commands/sync.mjs | 10 +- src/commands/uninstall.mjs | 2 +- src/commands/x/dashboard.mjs | 8 +- src/commands/x/{provider.mjs => host.mjs} | 143 +++++----- src/commands/x/verify.mjs | 2 +- src/lib/adapters/config.mjs | 91 +++++-- src/lib/adapters/migration.mjs | 73 +----- src/lib/adapters/registries.mjs | 13 - src/lib/blocks.mjs | 4 +- src/lib/config.mjs | 148 +++++++++-- src/lib/dashboard-server.mjs | 10 +- src/lib/dashboard/client.mjs | 13 +- src/lib/dashboard/page.mjs | 2 +- src/lib/hosts.mjs | 6 +- src/lib/live/event-schema.mjs | 10 +- src/lib/live/index.mjs | 2 +- src/lib/live/live-sessions-service.mjs | 8 +- src/lib/live/structured-adapter.mjs | 28 -- src/lib/mcp.mjs | 9 +- src/lib/nudge.mjs | 6 +- src/lib/opencode.mjs | 89 ++++--- src/lib/providers.mjs | 173 ++++++------- src/lib/routing-config.mjs | 143 ++++++++++ src/lib/routing.mjs | 148 ++++------- src/lib/usage-index.mjs | 3 - tests/dashboard.test.cjs | 10 +- tests/kit/capability-derived.test.mjs | 24 -- tests/kit/cli-help.test.mjs | 16 +- tests/kit/codex-mcp.test.mjs | 6 +- .../dashboard-integration-identity.test.mjs | 10 +- tests/kit/dashboard-live-source.test.mjs | 4 +- tests/kit/dispatch-surface.test.mjs | 6 +- tests/kit/dual-cli.test.mjs | 89 ------- tests/kit/dual-preflight.test.mjs | 44 ---- tests/kit/ga-surface-guard.test.mjs | 245 ++++++++++++++++++ tests/kit/host-cli-migration.test.mjs | 107 ++++++-- tests/kit/hosts.test.mjs | 4 +- tests/kit/integration-command-facts.test.mjs | 2 +- tests/kit/integration-config.test.mjs | 138 +++++++++- tests/kit/live-adapters.test.mjs | 11 - tests/kit/live-core.test.mjs | 4 + tests/kit/opencode.test.mjs | 92 ++++--- tests/kit/provider-cli.test.mjs | 191 +++++++++----- tests/kit/provider-credentials.test.mjs | 2 +- tests/kit/provider-refresh-cli.test.mjs | 90 +++---- tests/kit/providers.test.mjs | 81 +++--- tests/kit/reverse-bridge.test.mjs | 6 +- tests/kit/routing-config.test.mjs | 212 +++++++++++++++ tests/kit/routing-divergence.test.mjs | 108 ++++---- tests/kit/routing-primary.test.mjs | 20 +- tests/kit/routing-projection.test.mjs | 31 ++- tests/kit/routing.test.mjs | 101 +++----- tests/kit/run-command.test.mjs | 34 +-- tests/kit/setup-command.test.mjs | 10 +- tests/kit/setup-host-flags.test.mjs | 72 +++-- tests/kit/status-command.test.mjs | 20 +- tests/kit/status-viability.test.mjs | 53 ++-- tests/kit/sync-command.test.mjs | 11 +- tests/kit/uninstall-command.test.mjs | 34 ++- tests/kit/usage-index.test.mjs | 3 +- 95 files changed, 2353 insertions(+), 1619 deletions(-) create mode 100644 docs/adr/0020-ga-stable-surfaces.md delete mode 100644 src/commands/dual.mjs rename src/commands/x/{provider.mjs => host.mjs} (88%) create mode 100644 src/lib/routing-config.mjs delete mode 100644 tests/kit/dual-cli.test.mjs delete mode 100644 tests/kit/dual-preflight.test.mjs create mode 100644 tests/kit/ga-surface-guard.test.mjs create mode 100644 tests/kit/routing-config.test.mjs diff --git a/MAINTAINER.md b/MAINTAINER.md index 8a4347e0..77daf5fe 100644 --- a/MAINTAINER.md +++ b/MAINTAINER.md @@ -24,8 +24,11 @@ release this kit. User-facing docs live in [README.md](README.md); this file is ### CLI shape (`bin/agentic-kit.mjs`) -- **Porcelain** (daily): `setup`, `status`, `sync`, `dashboard`, `admin`, `dual`, `uninstall`. Bare `ak` → `status --hint`. (`dashboard` and `admin` are also reachable as `ak x dashboard` / `ak x admin`.) -- **Plumbing** (power users): `ak x daemon-gc | mcp | reference | statusline | verify | improvement-eval`. +- **Porcelain** (daily): `setup`, `status`, `sync`, `dashboard`, `admin`, `usage`, `run`, + `host`, `uninstall`. Bare `ak` → `status --hint`. (`dashboard`, `admin`, and `host` + are also reachable under `ak x`.) +- **Plumbing** (power users): `ak x admin | daemon-gc | dashboard | harvest | host | mcp | + reference | statusline | verify | improvement-eval`. - Each command module exports `options` (a `parseArgs` config) and `run({ flags, positionals, pkgRoot })`. - A best-effort drift nudge runs after non-`sync`, non-`--json` commands. @@ -37,9 +40,9 @@ release this kit. User-facing docs live in [README.md](README.md); this file is bin/agentic-kit.mjs # single entrypoint — arg parse + command dispatch (PORCELAIN/PLUMBING maps) src/ commands/ # porcelain verbs - setup.mjs status.mjs sync.mjs dual.mjs uninstall.mjs + setup.mjs status.mjs sync.mjs run.mjs uninstall.mjs x/ # plumbing verbs - admin.mjs daemon-gc.mjs dashboard.mjs harvest.mjs mcp.mjs provider.mjs reference.mjs statusline.mjs verify.mjs + admin.mjs daemon-gc.mjs dashboard.mjs harvest.mjs host.mjs mcp.mjs reference.mjs statusline.mjs verify.mjs lib/ # the engine — each file is one concern heal.mjs # the mutations sync/setup apply (idempotent, {ok,detail}) natives.mjs # better-sqlite3 / agentdb native detection @@ -62,6 +65,7 @@ src/ admin-model.mjs # PURE admin number model — imports nothing; embedded in the page AND node-tested admin-view.mjs # admin browser controller (embedded into the page; not node-imported) browser.mjs # openInBrowser — shared by dashboard + admin + usage-index.mjs # canonical usage aggregation by host, provider, model, project, and category npx.mjs # stale npx-cache detection/prune mcp.mjs settings.mjs config.mjs paths.mjs statusline.mjs rvf.mjs daemons.mjs exec.mjs output.mjs @@ -80,17 +84,19 @@ docs/ ``` **Published tarball** = the `files` whitelist in `package.json`: -`bin/agentic-kit.mjs`, `src/`, `claude/`, `docs/TROUBLESHOOTING.md`. Nothing else -ships — verify with `npm pack --dry-run` before a release if you touch `files`. - -**Dual-host subsystem** (the `providers`/`routing`/`dual` cluster): one policy in -`kit.json` `providers` is the source of truth — `hosts {claude,codex}` (which are -enabled), `primaryHost` (which leads; default `claude`), and `dualRouting` (the -per-activity host+model map). `routing.mjs` is pure (defaults, `seedDualRouting`, -`swapRoute` for codex-primary mirroring, and the projections to aqe `agentOverrides` -+ the dual-run config); `providers.mjs` does the I/O (host/auth detection, env -wiring, both MCP-bridge directions, aqe router file). Seeded/healed by `setup` + -`sync` + `x provider pick`, surfaced by `status` + `dashboard`. Design records: +`bin/agentic-kit.mjs`, `src/`, `claude/`, `docs/TROUBLESHOOTING.md`, +`docs/CODEX-STATUSLINE.md`, and +`docs/adr/0015-managed-codex-native-statusline.md`. Generated workspace state under +the shipped source trees is explicitly excluded. Nothing else ships — verify with +`npm pack --dry-run` before a release if you touch `files`. + +**Multi-host routing subsystem** (the `providers`/`routing` cluster): durable intent is +split between `integrations.hosts` (which hosts are enabled) and top-level `routing` +(`version`, `primaryHost`, and the per-activity `routes`). `routing.mjs` is pure +(defaults, primary-host mirroring, validation, and projections to AQE +`agentOverrides` and `ak run`); `providers.mjs` does the I/O (host/auth detection, +environment wiring, both MCP-bridge directions, AQE router file). Seeded/healed by +`setup` + `sync` + `x host pick`, surfaced by `status` + `dashboard`. Design records: ADRs [0001–0006](docs/adr/); user guide: `docs/PROVIDERS.md`. **Status-line capability is host-specific.** Claude owns a project-scoped, @@ -190,18 +196,16 @@ Edit a file under `src/`, re-run the CLI, done. ## 4. Testing ```bash -pnpm test # the full gate — exactly what CI runs +pnpm test # coverage-enforced unit + renderer/server suites +pnpm run check # release gate: typecheck, lint, markdown, build/package, tests ``` -That expands to: - -```bash -node --test "tests/kit/*.test.mjs" && node tests/statusline-segments.test.cjs -``` - -- `tests/kit/*.test.mjs` — `node:test` unit suites (blocks, natives, settings-config, versions). **32 tests.** -- `tests/statusline-segments.test.cjs` — statusline footer renderer. **20 tests.** -- **52 total, 0 failures = release-ready.** +- `tests/kit/*.test.mjs` — the broad `node:test` suite, run with 70% line, branch, and + function coverage floors. +- Eight `.cjs` suites exercise statusline rendering, Brain display, AgentDB, + health history, harvest, dashboard, and admin behavior. +- `pnpm run build` validates the CLI load and dry-run package manifest, including + forbidden generated/private paths. Run one suite while iterating: `node --test tests/kit/versions.test.mjs`. diff --git a/README.md b/README.md index 91fd359c..d095b0d0 100644 --- a/README.md +++ b/README.md @@ -37,9 +37,8 @@ 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 an opt-in, explicitly -routable host through `ak run`, but it is never a primary host or AQE provider. Existing -`ak dual` is a deprecated Claude+Codex compatibility interface. Provider, model, and billing claims state -whether they are observed, configured, inferred, or unknown. See +routable host through `ak run`, but it is never a primary host or AQE provider. 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 @@ -73,7 +72,6 @@ ak host manage execution hosts, routing, and provider bindings status | pick | refresh | off ak run execute a host-neutral activity pipeline (including explicit OpenCode routes)