@ekanos/cli, @ekanos/sdk, @ekanos/ui, @ekanos/integration-schema, and @ekanos/harness. Three independent defenses keep it in sync:
1. Schema-version skew gate
validate and publish bundle an exact @ekanos/integration-schema version. If the project resolves a newer one (checked against both a direct install and what @ekanos/sdk declares), both verbs fail fast with precondition_failed (exit 9) — before loading the definition at all.
Why this matters
unrecognized_keys issue, and the usual hint would tell you to delete correct code. So the CLI fails loudly instead.
Older project schema (warning only)
If the project’s schema is older, the verb continues and warns on stderr:data.schemaSkew in this case.
2. ekanos upgrade
The primary way to keep the toolchain coherent.
Coherence guarantee
upgrade resolves a coherent target version set — from GET /api/partner/toolchain on your logged-in host when available, else the npm registry. @ekanos/sdk, @ekanos/ui, and @ekanos/integration-schema must share one version, and the SDK release at that version must pin exactly that schema. Every version must be an exact release (1.2.3 or 1.2.3-rc.1): a host or npm latest that answers anything else — a range, a git or file spec, a tarball URL — is refused with invalid_state (exit 7) and nothing is installed.
An incoherent set (for example, mid-way through a multi-package publish) is refused with precondition_failed (exit 9) rather than turned into an uninstallable tree:
Install and verify
- Snapshot —
package.json,pnpm-workspace.yaml(when present) and the lockfile are saved - Install — Target versions of the toolchain packages that are direct dependencies are installed; transitive ones follow from whatever pins them and are listed in
data.skippedTransitive - Verify —
ekanos validateand your test script run - Rollback — On any failure,
package.json,pnpm-workspace.yamland the lockfile are restored and a reinstall frozen to that lockfile restoresnode_modules, with the same package manager. If that reinstall fails,upgradesaysnode_moduleswas not restored and prints the command to repair it
upgrade uses your project’s package manager. Inside a pnpm workspace package, it runs pnpm, never npm. At a repo root ("kind": "repo"), it upgrades the root and every package that uses the toolchain in one run. See upgrade.
upgrade also answers new dependency build scripts in pnpm-workspace.yaml before it installs. A project nested inside a monorepo that already has a pnpm-workspace.yaml in a parent directory is left alone: the command prints which file to edit and what to put under allowBuilds instead of creating a second workspace root. See upgrade.
Keep the CLI and the harness on matching versions: @ekanos/cli 0.33.2 needs @ekanos/harness 0.36.2 (shell contract 8), and ekanos dev stops with an explanation if they do not match. ekanos upgrade moves them together.
In a terminal, upgrade prints the plan and asks Upgrade now? [y/N]. Outside a real TTY it requires --yes; without it, it fails with validation (exit 3) and changes nothing. If the project is already at the target, it reports so and exits 0.
A failed step is reported with an error.code naming it and the step’s output in data.output:
The hint confirms the project has been restored to its pre-upgrade state.
Agent-context file regeneration
After a successful upgrade,ekanos upgrade regenerates:
AGENTS.mdCLAUDE.md.claude/skills/ekanos/SKILL.md
docs/api-notes.md and .mcp.json are created if missing, never overwritten.
A stale AGENTS.md teaches an agent yesterday’s contract, which is as harmful as a stale binary.
Flags
Read-only. Report current vs. target versions and exit 0. Changes nothing.
Safe for CI and scripts.
Ekanos host to fetch the target version set from. Falls back to host
resolution (see Authentication). With
no stored session for the host, the npm registry is used.
3. Proactive update notice
Every command exceptinit, login, logout, and upgrade checks in the background whether a newer @ekanos/cli exists. Those four are skipped because init writes the versions it scaffolds with, login and logout change the session the check uses, and upgrade resolves the target itself.
When and how often
- Every command — the check starts with the command and runs alongside it, so it never delays it
- At most every 4 hours — the answer is cached in
~/.ekanos/update-check.json, so the network is asked at most once per 4 hours - Your host first — the logged-in host’s advertised toolchain (
EKANOS_HOST, else your only stored login), else the npm registry - Bounded — 1.5 second ceiling on network time. An answer not in by the time the command finishes is dropped and asked again on the next command
- Non-fatal — never changes the command’s exit code, and any failure is silent
- Silent when current — no notice if you’re up to date
How often you see it
A newer version is announced once, after the command’s own output, and then not again for 4 hours. When an even newer version ships inside those 4 hours, it is announced right away. Theunsupported notice (below the host’s minimum, see below) is the exception: it repeats on every command until you upgrade, because that version is no longer accepted.
Nothing is printed, and nothing is counted as shown, where nobody is reading: in CI, with stdout piped and no coding agent detected, the check stays quiet.
Human mode prints one line to stderr:
validate, dev, publish, and status carry the notice in data.toolchain with --json, on every run while you’re behind (not only when the line is shown):
--json, or when a coding agent is detected, the same object appears on a stderr claude-code-hint line, on any command, so agents can parse it without reading prose. It follows the same once-per-4-hours rule as the human line. Stdout stays exactly one JSON envelope.
Unsupported version
If you’re below the host’s declared minimum CLI version, the notice’sstatus is unsupported and human mode prints:
publish then fails fast with precondition_failed (exit 9), because the host would refuse the submission anyway:
Disable update checks
Workflow examples
Before you publish
Team with a shared lockfile
Commitpackage.json and the lockfile so everyone runs the same toolchain. One person upgrades for the team:
CI/CD pipeline
Agent-driven updates
ekanos upgrade --yes means the project was restored; read error.code and data.output for the failing step.
Troubleshooting
CLI too old for the installed harness
dev refuses (exit 9) before writing anything. The hint gives the install command to upgrade the CLI. The reverse case, @ekanos/harness <version> is too old for @ekanos/cli <version>, gives the command to upgrade the harness.
Fix: Run ekanos upgrade, or follow the hint.
Project schema newer than the CLI
See the schema-version skew gate section at the top of this page. Fix: Runekanos upgrade --check to see the target, then ekanos upgrade.
Upgrade rolled back
The install, validate, or test step failed and the project was restored.error.code names the step and data.output holds its output.
Fix: Fix the underlying issue (often a test failure against the new versions) and re-run ekanos upgrade.
No target available
Edited agent-context files
upgrade leaves an AGENTS.md, CLAUDE.md, or skill file you’ve edited untouched and reports it as needing manual attention.
Fix: Compare it against the new template and merge by hand.