From 8923907c18bc10ca626ea09fcd44fa4e5d3c81ad Mon Sep 17 00:00:00 2001 From: Daniil Koryto Date: Tue, 23 Jun 2026 16:16:18 +0300 Subject: [PATCH] fix: allow newer MiMoCode versions Remove the audited-version ceiling so setup accepts any MiMoCode release at or above the supported minimum and relies on runtime verification for compatibility. --- .../skills/coding-prompt-normalizer/SKILL.md | 34 ++++++++------- .../references/repo-context-routing.md | 13 +++--- .../skills/coding-prompt-normalizer/SKILL.md | 34 ++++++++------- .../references/repo-context-routing.md | 13 +++--- AGENTS.md | 15 ++++--- README.md | 6 +-- docs/how-it-works.md | 7 +-- docs/runtime-contract-map.md | 5 ++- docs/specs/mimo-code-setup-prd/spec.md | 29 ++++++------- src/constants/contract.ts | 3 +- src/install/contracts.ts | 5 +-- src/install/contracts/install-state.ts | 2 +- src/install/mimocode.ts | 43 +++---------------- src/install/session.ts | 4 +- src/install/state.ts | 12 ++++-- test/install/managed-config-mutations.test.ts | 2 +- test/install/mimocode.test.ts | 37 ++++------------ test/install/session.test.ts | 4 +- test/package-contract.test.ts | 2 +- test/skills-contract.test.ts | 8 +++- 20 files changed, 122 insertions(+), 156 deletions(-) diff --git a/.agents/skills/coding-prompt-normalizer/SKILL.md b/.agents/skills/coding-prompt-normalizer/SKILL.md index fdc7719..c9a30f4 100644 --- a/.agents/skills/coding-prompt-normalizer/SKILL.md +++ b/.agents/skills/coding-prompt-normalizer/SKILL.md @@ -23,15 +23,16 @@ execution. Be honest about the current state of the repository: -- this repo has a scaffolded `npx @gonkagate/mimo-code-setup` public entrypoint; - the installer runtime is not implemented yet -- `README.md`, `AGENTS.md`, `docs/`, `src/cli.ts`, `src/constants/`, and the - PRD are the main product-contract surfaces today -- the public CLI intentionally reports `not_implemented`; it does not validate - local `mimo`, collect secrets, write config, or verify effective config yet -- `src/install/` does not exist yet unless a later task explicitly creates it -- the current verified MiMoCode baseline is `@mimo-ai/cli` `0.1.0` as of - June 11, 2026 +- this repo has a public `npx @gonkagate/mimo-code-setup` entrypoint wired to + the installer runtime +- `README.md`, `AGENTS.md`, `docs/`, `src/cli.ts`, `src/cli/`, + `src/install/`, `src/constants/`, and the PRD are the main product-contract + surfaces today +- the public CLI validates local `mimo`, collects the GonkaGate key safely, + fetches the live model catalog, writes MiMoCode config, and verifies + effective config when prerequisites pass +- the minimum supported upstream MiMoCode version is `@mimo-ai/cli` `0.1.0`; + newer MiMoCode versions must not be blocked solely because they are newer Do not normalize a prompt into a fake implementation brief for files or behaviors that do not exist unless the user is explicitly asking to create @@ -235,8 +236,8 @@ Do not force all sections when `1-2` focused paragraphs do the job better. checks, or specific workflow checks. Do not default to broad repo-wide validation unless the change is broad. - Do not repeat repo-wide instructions unless they materially affect this task. -- Use the existing `src/` surfaces when they are materially relevant, and do - not mention `src/install/` as existing until the runtime is implemented. +- Use the existing `src/` and `src/install/` surfaces when they are materially + relevant. - When the task touches a mirrored local skill, prefer keeping the `.claude` and `.agents` copies aligned unless the request says otherwise. - Do not propose product changes like `.env` writing, shell profile edits, @@ -269,9 +270,9 @@ exact literal, removing stale Codex-specific wording, and keeping the mirrored `.agents` copy aligned. Relevant repository context -- This repository has a scaffolded `npx @gonkagate/mimo-code-setup` entrypoint - that reports `not_implemented`, so prompt assets should not claim real - runtime behavior before `src/install/` exists. +- This repository has a public `npx @gonkagate/mimo-code-setup` entrypoint + wired to the installer runtime, including safe secret intake, live catalog + fetch, config writes, and effective-config verification. - Local agent-support assets are mirrored under `.claude/skills/` and `.agents/skills/`; changes to one copy should normally be reflected in the other. @@ -318,8 +319,9 @@ Perform a read-only truthfulness review of the current public product docs, with findings first and ordered by severity. Relevant repository context -- This repository does not ship an implemented MiMoCode installer yet, so docs - should distinguish scaffolded behavior from future product plans. +- This repository ships an implemented MiMoCode installer runtime, so docs + should describe implemented behavior accurately instead of scaffold-only + plans. - `README.md` and `docs/how-it-works.md` are the main contract surfaces for the `npx @gonkagate/mimo-code-setup` flow. - `chat_completions` is part of the current transport contract and should be diff --git a/.agents/skills/coding-prompt-normalizer/references/repo-context-routing.md b/.agents/skills/coding-prompt-normalizer/references/repo-context-routing.md index 5c770ad..e48f24f 100644 --- a/.agents/skills/coding-prompt-normalizer/references/repo-context-routing.md +++ b/.agents/skills/coding-prompt-normalizer/references/repo-context-routing.md @@ -11,9 +11,10 @@ points. - The downstream agent already works inside this repository. - Do not explain how to inspect files, edit code, create folders, or run ordinary repo commands. -- `mimo-code-setup` is a TypeScript/Node scaffold for a future installer that - will configure local MiMoCode to use GonkaGate. -- Canonical surfaces today are `src/cli.ts`, `src/constants/`, +- `mimo-code-setup` is a TypeScript/Node installer that configures local + MiMoCode to use GonkaGate. +- Canonical surfaces today are `src/cli.ts`, `src/cli/`, `src/install/`, + `src/constants/`, `README.md`, `AGENTS.md`, `docs/`, `test/package-contract.test.ts`, `test/docs-contract.test.ts`, `test/skills-contract.test.ts`, `scripts/run-tests.mjs`, `.github/workflows/`, `package.json`, @@ -27,8 +28,10 @@ points. Include a repository constraint only when it changes the task: -- the target public UX is `npx @gonkagate/mimo-code-setup`, and the current CLI - intentionally reports `not_implemented` +- the target public UX is `npx @gonkagate/mimo-code-setup`, wired to the + installer runtime +- the minimum supported upstream MiMoCode version is `@mimo-ai/cli` `0.1.0`; + newer MiMoCode versions must not be blocked solely because they are newer - user-level config target is `~/.config/mimocode/mimocode.json` - project activation target is `.mimocode/mimocode.json` - the managed provider key is `provider.gonkagate` diff --git a/.claude/skills/coding-prompt-normalizer/SKILL.md b/.claude/skills/coding-prompt-normalizer/SKILL.md index fdc7719..c9a30f4 100644 --- a/.claude/skills/coding-prompt-normalizer/SKILL.md +++ b/.claude/skills/coding-prompt-normalizer/SKILL.md @@ -23,15 +23,16 @@ execution. Be honest about the current state of the repository: -- this repo has a scaffolded `npx @gonkagate/mimo-code-setup` public entrypoint; - the installer runtime is not implemented yet -- `README.md`, `AGENTS.md`, `docs/`, `src/cli.ts`, `src/constants/`, and the - PRD are the main product-contract surfaces today -- the public CLI intentionally reports `not_implemented`; it does not validate - local `mimo`, collect secrets, write config, or verify effective config yet -- `src/install/` does not exist yet unless a later task explicitly creates it -- the current verified MiMoCode baseline is `@mimo-ai/cli` `0.1.0` as of - June 11, 2026 +- this repo has a public `npx @gonkagate/mimo-code-setup` entrypoint wired to + the installer runtime +- `README.md`, `AGENTS.md`, `docs/`, `src/cli.ts`, `src/cli/`, + `src/install/`, `src/constants/`, and the PRD are the main product-contract + surfaces today +- the public CLI validates local `mimo`, collects the GonkaGate key safely, + fetches the live model catalog, writes MiMoCode config, and verifies + effective config when prerequisites pass +- the minimum supported upstream MiMoCode version is `@mimo-ai/cli` `0.1.0`; + newer MiMoCode versions must not be blocked solely because they are newer Do not normalize a prompt into a fake implementation brief for files or behaviors that do not exist unless the user is explicitly asking to create @@ -235,8 +236,8 @@ Do not force all sections when `1-2` focused paragraphs do the job better. checks, or specific workflow checks. Do not default to broad repo-wide validation unless the change is broad. - Do not repeat repo-wide instructions unless they materially affect this task. -- Use the existing `src/` surfaces when they are materially relevant, and do - not mention `src/install/` as existing until the runtime is implemented. +- Use the existing `src/` and `src/install/` surfaces when they are materially + relevant. - When the task touches a mirrored local skill, prefer keeping the `.claude` and `.agents` copies aligned unless the request says otherwise. - Do not propose product changes like `.env` writing, shell profile edits, @@ -269,9 +270,9 @@ exact literal, removing stale Codex-specific wording, and keeping the mirrored `.agents` copy aligned. Relevant repository context -- This repository has a scaffolded `npx @gonkagate/mimo-code-setup` entrypoint - that reports `not_implemented`, so prompt assets should not claim real - runtime behavior before `src/install/` exists. +- This repository has a public `npx @gonkagate/mimo-code-setup` entrypoint + wired to the installer runtime, including safe secret intake, live catalog + fetch, config writes, and effective-config verification. - Local agent-support assets are mirrored under `.claude/skills/` and `.agents/skills/`; changes to one copy should normally be reflected in the other. @@ -318,8 +319,9 @@ Perform a read-only truthfulness review of the current public product docs, with findings first and ordered by severity. Relevant repository context -- This repository does not ship an implemented MiMoCode installer yet, so docs - should distinguish scaffolded behavior from future product plans. +- This repository ships an implemented MiMoCode installer runtime, so docs + should describe implemented behavior accurately instead of scaffold-only + plans. - `README.md` and `docs/how-it-works.md` are the main contract surfaces for the `npx @gonkagate/mimo-code-setup` flow. - `chat_completions` is part of the current transport contract and should be diff --git a/.claude/skills/coding-prompt-normalizer/references/repo-context-routing.md b/.claude/skills/coding-prompt-normalizer/references/repo-context-routing.md index 5c770ad..e48f24f 100644 --- a/.claude/skills/coding-prompt-normalizer/references/repo-context-routing.md +++ b/.claude/skills/coding-prompt-normalizer/references/repo-context-routing.md @@ -11,9 +11,10 @@ points. - The downstream agent already works inside this repository. - Do not explain how to inspect files, edit code, create folders, or run ordinary repo commands. -- `mimo-code-setup` is a TypeScript/Node scaffold for a future installer that - will configure local MiMoCode to use GonkaGate. -- Canonical surfaces today are `src/cli.ts`, `src/constants/`, +- `mimo-code-setup` is a TypeScript/Node installer that configures local + MiMoCode to use GonkaGate. +- Canonical surfaces today are `src/cli.ts`, `src/cli/`, `src/install/`, + `src/constants/`, `README.md`, `AGENTS.md`, `docs/`, `test/package-contract.test.ts`, `test/docs-contract.test.ts`, `test/skills-contract.test.ts`, `scripts/run-tests.mjs`, `.github/workflows/`, `package.json`, @@ -27,8 +28,10 @@ points. Include a repository constraint only when it changes the task: -- the target public UX is `npx @gonkagate/mimo-code-setup`, and the current CLI - intentionally reports `not_implemented` +- the target public UX is `npx @gonkagate/mimo-code-setup`, wired to the + installer runtime +- the minimum supported upstream MiMoCode version is `@mimo-ai/cli` `0.1.0`; + newer MiMoCode versions must not be blocked solely because they are newer - user-level config target is `~/.config/mimocode/mimocode.json` - project activation target is `.mimocode/mimocode.json` - the managed provider key is `provider.gonkagate` diff --git a/AGENTS.md b/AGENTS.md index 6ec2283..531f86b 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -23,7 +23,7 @@ Current honest state: - package metadata, TypeScript build, CI workflows, release scaffolding, mirrored skills, and contract tests are present - the latest compatibility audit found no hard blocker in official MiMoCode - `@mimo-ai/cli` `0.1.0` for the planned `provider.gonkagate` shape, but + `@mimo-ai/cli` releases for the planned `provider.gonkagate` shape, but runtime implementation must honor MiMoCode-specific config precedence and full-slug model keys - `src/cli.ts` is a thin entrypoint over split CLI seams and now calls the @@ -34,12 +34,12 @@ Current honest state: `GET https://api.gonkagate.com/v1/models`, and writes every returned model into `provider.gonkagate.models` - `moonshotai/kimi-k2.6` has MiMoCode validation proof for the current - `@mimo-ai/cli` `0.1.0` baseline, but the public picker is now backed by the - live GonkaGate model catalog rather than a hardcoded validated allowlist + minimum-supported MiMoCode contract, but the public picker is now backed by + the live GonkaGate model catalog rather than a hardcoded validated allowlist If implementation status, package name, security flow, config locations, -transport contract, or verified MiMoCode baseline changes, this file must be -updated immediately so it stays truthful. +transport contract, or minimum supported MiMoCode version changes, this file +must be updated immediately so it stays truthful. ## Product Goal @@ -77,7 +77,8 @@ change. rename - target CLI: `mimo` - target upstream package: `@mimo-ai/cli` -- current verified MiMoCode baseline: minimum `0.1.0`, audited on 2026-06-11 +- minimum supported MiMoCode version: `0.1.0`; newer versions must not be + blocked solely because they are newer - documented global config example: `~/.config/mimocode/mimocode.json` - actual global config target must be resolved from MiMoCode paths and existing `mimocode.jsonc`, `mimocode.json`, or `config.json` files; create @@ -142,7 +143,7 @@ This repo currently does: - define the product contract for the MiMoCode setup tool - provide npm packaging, CI, release-please, and publish scaffolding - provide a public CLI entrypoint that can configure MiMoCode when the local - `mimo` baseline, secret input, live model-catalog fetch, and + `mimo` minimum-version check, secret input, live model-catalog fetch, and effective-config verification pass - provide docs and tests that protect the current runtime contract - provide mirrored local skills for repo-aware agent work diff --git a/README.md b/README.md index 66ea16b..8de68bc 100644 --- a/README.md +++ b/README.md @@ -98,10 +98,10 @@ You need: - a GonkaGate API key in the usual `gp-...` format from [GonkaGate](https://gonkagate.com/en/register) -Current MiMoCode baseline: +Current MiMoCode compatibility floor: -- minimum verified MiMoCode version: `0.1.0` -- audited upstream package: `@mimo-ai/cli` `0.1.0` as of June 11, 2026 +- minimum supported MiMoCode version: `0.1.0` +- newer MiMoCode versions are allowed and verified by the setup flow itself ## What The Installer Actually Changes diff --git a/docs/how-it-works.md b/docs/how-it-works.md index 0285153..1a38e53 100644 --- a/docs/how-it-works.md +++ b/docs/how-it-works.md @@ -8,8 +8,8 @@ a hardcoded allowlist. ## Planned Flow -1. Validate that the local `mimo` CLI is available and compatible with the - audited MiMoCode baseline. +1. Validate that the local `mimo` CLI is available and not older than the + minimum supported MiMoCode version. 2. Resolve safe config and state paths without mutating shell profiles or `.env` files. 3. Collect a GonkaGate API key through safe inputs only: @@ -24,7 +24,8 @@ a hardcoded allowlist. ## MiMoCode Surfaces -The PRD is based on the MiMoCode upstream contract observed on 2026-06-11: +The PRD is based on the MiMoCode upstream contract observed on 2026-06-11, +with newer MiMoCode versions allowed by default: - CLI command: `mimo` - npm package: `@mimo-ai/cli` diff --git a/docs/runtime-contract-map.md b/docs/runtime-contract-map.md index 862cb0c..d0af337 100644 --- a/docs/runtime-contract-map.md +++ b/docs/runtime-contract-map.md @@ -9,7 +9,8 @@ When setup behavior changes from scaffold-only to implemented runtime behavior, update these surfaces together: - `AGENTS.md` - repository truth, product/security invariants, implementation - status, validation baseline, supported setup behavior, and validation command. + status, minimum MiMoCode version, supported setup behavior, and validation + command. - `README.md` - public status, npm entrypoint, runtime flow, supported flags, config targets, live model-catalog behavior, and local development checks. - `docs/how-it-works.md` - runtime architecture, scope behavior, config-layer @@ -22,7 +23,7 @@ update these surfaces together: to paste raw `mimo --pure debug config` output. - `CHANGELOG.md` - meaningful user-facing runtime changes. - `src/constants/contract.ts` - package identity, public implementation status, - MiMoCode baseline, and live catalog source. + MiMoCode minimum version, and live catalog source. - `src/install/model-catalog.ts` - `/v1/models` fetch and response-shape boundary. - `src/constants/models.ts` - model metadata and validation helper types. diff --git a/docs/specs/mimo-code-setup-prd/spec.md b/docs/specs/mimo-code-setup-prd/spec.md index f76e681..963432c 100644 --- a/docs/specs/mimo-code-setup-prd/spec.md +++ b/docs/specs/mimo-code-setup-prd/spec.md @@ -79,8 +79,8 @@ npx @gonkagate/mimo-code-setup The tool: 1. validates local `mimo` -2. verifies that the installed MiMoCode version is supported or clearly reports - that it is newer than the last audited baseline +2. verifies that the installed MiMoCode version is not older than the minimum + supported version 3. accepts a GonkaGate API key through a masked prompt, `GONKAGATE_API_KEY`, or `--api-key-stdin` 4. calls `GET /v1/models` with that key and offers every returned GonkaGate @@ -162,7 +162,8 @@ Contributor user: - the target CLI is `mimo` - the target package being configured is `@mimo-ai/cli` -- the first audited upstream baseline is `@mimo-ai/cli` `0.1.0` +- the minimum supported upstream version is `@mimo-ai/cli` `0.1.0` +- newer MiMoCode versions must not be blocked solely because they are newer - MiMoCode global config defaults to the XDG config home under `mimocode` - `MIMOCODE_HOME` changes the config, data, state, and cache roots - MiMoCode global config candidates include `mimocode.jsonc`, @@ -214,9 +215,9 @@ Contributor user: The package identity must not change if GonkaGate later migrates from chat-completions compatibility to responses support. -### Verified MiMoCode Baseline +### Minimum Supported MiMoCode Version -The initial verified baseline is: +The minimum supported MiMoCode version is: - `@mimo-ai/cli >= 0.1.0` @@ -224,14 +225,12 @@ Installer behavior: - missing `mimo`: stop with MiMoCode install guidance - version lower than `0.1.0`: stop and request upgrade -- version equal to `0.1.0`: continue -- version newer than `0.1.0`: continue only if the implementation has an - explicit newer-version policy; otherwise report that the version is newer - than the last audited baseline and ask the user to upgrade this setup tool or - continue with a clearly labeled compatibility risk +- version equal to or newer than `0.1.0`: continue +- future MiMoCode versions are validated by the actual setup and effective-config + verification flow, not by a hardcoded audited-version ceiling -The latest audited upstream MiMoCode baseline must be visible in README, -security docs, and the PRD whenever it changes. +The minimum supported MiMoCode version must be visible in README, security docs, +and the PRD whenever it changes. ### Secret Inputs @@ -313,7 +312,7 @@ per-user ACLs rather than claiming portable POSIX `chmod` behavior. - installer version - selected model key - selected scope -- audited MiMoCode baseline +- minimum supported MiMoCode version - selected MiMoCode version - selected transport contract - selected provider package @@ -478,8 +477,8 @@ claims about richer MiMoCode behavior. ### Model Validation Proof A model may be documented as MiMoCode workflow-validated only after end-to-end -verification against the current verified MiMoCode baseline for the workflows -the product claims to support. +verification against a named MiMoCode version for the workflows the product +claims to support. Minimum validation proof for a GonkaGate model includes: diff --git a/src/constants/contract.ts b/src/constants/contract.ts index 117e100..f51d715 100644 --- a/src/constants/contract.ts +++ b/src/constants/contract.ts @@ -8,8 +8,7 @@ export const CONTRACT_METADATA = { publicEntrypoint: "npx @gonkagate/mimo-code-setup", publicState: "Installer runtime fetches the available GonkaGate model catalog from /v1/models after safe API-key intake.", - verifiedMimoCode: { - checkedAt: "2026-06-11", + mimoCode: { minVersion: "0.1.0", packageName: "@mimo-ai/cli", }, diff --git a/src/install/contracts.ts b/src/install/contracts.ts index 87bf444..1d6a0e4 100644 --- a/src/install/contracts.ts +++ b/src/install/contracts.ts @@ -5,10 +5,10 @@ export type InstallerStatus = "success" | "blocked" | "failed"; export type VerificationStatus = "passed" | "blocked" | "failed" | "skipped"; export interface MimoCodeVersionInfo { - auditedBaseline: string; installedVersion: string; + minimumVersion: string; packageName: string; - policy: "audited" | "newer_blocked" | "newer_allowed_with_warning"; + policy: "supported"; } export interface ConfigTargets { @@ -101,7 +101,6 @@ export type InstallerErrorCode = | "mimocode_not_found" | "mimocode_version_unparseable" | "mimocode_version_too_old" - | "mimocode_newer_than_audited" | "unsafe_api_key_flag" | "missing_api_key" | "invalid_api_key" diff --git a/src/install/contracts/install-state.ts b/src/install/contracts/install-state.ts index dcefea5..dcd8a42 100644 --- a/src/install/contracts/install-state.ts +++ b/src/install/contracts/install-state.ts @@ -2,10 +2,10 @@ import type { InstallScope } from "../contracts.js"; import type { CuratedModelTransport } from "../../constants/models.js"; export interface InstallState { - auditedMimoCodeBaseline: string; globalConfigTarget: string; installerVersion: string; lastDurableSetupAt: string; + mimoCodeMinimumVersion: string; mimoCodeVersion: string; previousManagedModelRef?: string; projectConfigTarget?: string; diff --git a/src/install/mimocode.ts b/src/install/mimocode.ts index 0b73ea4..f95db00 100644 --- a/src/install/mimocode.ts +++ b/src/install/mimocode.ts @@ -4,12 +4,6 @@ import type { InstallerErrorCode, MimoCodeVersionInfo } from "./contracts.js"; import type { InstallerDeps } from "./deps.js"; import { InstallerError } from "./errors.js"; -export type NewerMimoCodePolicy = "block" | "allow_with_warning"; - -export interface DetectMimoCodeOptions { - newerVersionPolicy?: NewerMimoCodePolicy; -} - export interface MimoCodeDetection { info: MimoCodeVersionInfo; warnings: readonly string[]; @@ -17,11 +11,10 @@ export interface MimoCodeDetection { export async function detectMimoCode( deps: InstallerDeps, - options: DetectMimoCodeOptions = {}, ): Promise { const result = await runMimoVersion(deps); const installedVersion = parseMimoVersion(result.stdout); - const baseline = CONTRACT_METADATA.verifiedMimoCode.minVersion; + const minVersion = CONTRACT_METADATA.mimoCode.minVersion; if (installedVersion === undefined) { throw createMimoError( @@ -31,42 +24,19 @@ export async function detectMimoCode( ); } - if (semver.lt(installedVersion, baseline)) { + if (semver.lt(installedVersion, minVersion)) { throw createMimoError( "mimocode_version_too_old", - `MiMoCode ${installedVersion} is older than the audited ${baseline} baseline.`, + `MiMoCode ${installedVersion} is older than the supported ${minVersion} minimum.`, ); } - if (semver.gt(installedVersion, baseline)) { - const policy = options.newerVersionPolicy ?? "block"; - - if (policy === "block") { - throw createMimoError( - "mimocode_newer_than_audited", - `MiMoCode ${installedVersion} is newer than the audited ${baseline} baseline.`, - ); - } - - return { - info: { - auditedBaseline: baseline, - installedVersion, - packageName: CONTRACT_METADATA.verifiedMimoCode.packageName, - policy: "newer_allowed_with_warning", - }, - warnings: [ - `MiMoCode ${installedVersion} is newer than the audited ${baseline} baseline.`, - ], - }; - } - return { info: { - auditedBaseline: baseline, installedVersion, - packageName: CONTRACT_METADATA.verifiedMimoCode.packageName, - policy: "audited", + minimumVersion: minVersion, + packageName: CONTRACT_METADATA.mimoCode.packageName, + policy: "supported", }, warnings: [], }; @@ -116,7 +86,6 @@ function createMimoError( | "mimocode_not_found" | "mimocode_version_unparseable" | "mimocode_version_too_old" - | "mimocode_newer_than_audited" >, message: string, detail?: string, diff --git a/src/install/session.ts b/src/install/session.ts index e1c05b8..f3d3ef7 100644 --- a/src/install/session.ts +++ b/src/install/session.ts @@ -51,9 +51,7 @@ export async function runInstallSession( request.cwd === undefined ? deps : { ...deps, cwd: () => request.cwd! }; try { - const mimo = await detectMimoCode(effectiveDeps, { - newerVersionPolicy: "block", - }); + const mimo = await detectMimoCode(effectiveDeps); const paths = await resolveMimoGlobalPaths(effectiveDeps); const target = await selectGlobalConfigTarget( effectiveDeps, diff --git a/src/install/state.ts b/src/install/state.ts index 9472417..79bcc17 100644 --- a/src/install/state.ts +++ b/src/install/state.ts @@ -9,29 +9,33 @@ import type { InstallState } from "./contracts/install-state.js"; export function createInstallState( input: Omit< InstallState, - | "auditedMimoCodeBaseline" | "installerVersion" + | "mimoCodeMinimumVersion" | "providerPackage" | "transport" >, ): InstallState { return { ...input, - auditedMimoCodeBaseline: CONTRACT_METADATA.verifiedMimoCode.minVersion, installerVersion: CONTRACT_METADATA.cliVersion, + mimoCodeMinimumVersion: CONTRACT_METADATA.mimoCode.minVersion, providerPackage: CURRENT_PROVIDER_PACKAGE, transport: CURRENT_TRANSPORT, }; } export function parseInstallState(contents: string): InstallState { - const parsed = JSON.parse(contents) as Partial; + const parsed = JSON.parse(contents) as Partial & { + auditedMimoCodeBaseline?: string; + }; + parsed.mimoCodeMinimumVersion ??= parsed.auditedMimoCodeBaseline; + delete parsed.auditedMimoCodeBaseline; const requiredStrings: readonly (keyof InstallState)[] = [ - "auditedMimoCodeBaseline", "globalConfigTarget", "installerVersion", "lastDurableSetupAt", + "mimoCodeMinimumVersion", "mimoCodeVersion", "providerPackage", "scope", diff --git a/test/install/managed-config-mutations.test.ts b/test/install/managed-config-mutations.test.ts index 923054b..fad7e90 100644 --- a/test/install/managed-config-mutations.test.ts +++ b/test/install/managed-config-mutations.test.ts @@ -17,10 +17,10 @@ test("cleanup removes only installer-owned stale activation while preserving unr const updated = cleanupInstallerOwnedActivation(source, { currentModelKey: "current", installState: { - auditedMimoCodeBaseline: "0.1.0", globalConfigTarget: "/config", installerVersion: "0.1.0", lastDurableSetupAt: "2026-06-11T00:00:00.000Z", + mimoCodeMinimumVersion: "0.1.0", mimoCodeVersion: "0.1.0", previousManagedModelRef: "gonkagate/old", providerPackage: "@ai-sdk/openai-compatible", diff --git a/test/install/mimocode.test.ts b/test/install/mimocode.test.ts index 270fa15..b6e264a 100644 --- a/test/install/mimocode.test.ts +++ b/test/install/mimocode.test.ts @@ -13,7 +13,7 @@ test("parseMimoVersion extracts semver from common --version output", () => { assert.equal(parseMimoVersion("not a version"), undefined); }); -test("detectMimoCode reports missing CLI, unparseable, old, exact, and newer versions", async () => { +test("detectMimoCode reports missing CLI, unparseable, old, and supported versions", async () => { const missing = createTestDeps(); missing.queueCommand({ exitCode: 127, stderr: "not found", stdout: "" }); await assert.rejects( @@ -55,37 +55,18 @@ test("detectMimoCode reports missing CLI, unparseable, old, exact, and newer ver exact.queueCommand({ exitCode: 0, stderr: "", stdout: "mimo 0.1.0\n" }); const exactResult = await detectMimoCode(exact); assert.equal(exactResult.info.installedVersion, "0.1.0"); - assert.equal(exactResult.info.policy, "audited"); + assert.equal(exactResult.info.policy, "supported"); exact.cleanup(); - const newerBlocked = createTestDeps(); - newerBlocked.queueCommand({ + const newer = createTestDeps(); + newer.queueCommand({ exitCode: 0, stderr: "", stdout: "mimo 0.2.0\n", }); - await assert.rejects( - () => detectMimoCode(newerBlocked), - (error) => { - assert.equal( - (error as InstallerError).code, - "mimocode_newer_than_audited", - ); - return true; - }, - ); - newerBlocked.cleanup(); - - const newerAllowed = createTestDeps(); - newerAllowed.queueCommand({ - exitCode: 0, - stderr: "", - stdout: "mimo 0.2.0\n", - }); - const newerAllowedResult = await detectMimoCode(newerAllowed, { - newerVersionPolicy: "allow_with_warning", - }); - assert.equal(newerAllowedResult.info.policy, "newer_allowed_with_warning"); - assert.equal(newerAllowedResult.warnings.length, 1); - newerAllowed.cleanup(); + const newerResult = await detectMimoCode(newer); + assert.equal(newerResult.info.installedVersion, "0.2.0"); + assert.equal(newerResult.info.policy, "supported"); + assert.equal(newerResult.warnings.length, 0); + newer.cleanup(); }); diff --git a/test/install/session.test.ts b/test/install/session.test.ts index e44229f..d13dcfd 100644 --- a/test/install/session.test.ts +++ b/test/install/session.test.ts @@ -70,7 +70,7 @@ function queueSuccessfulCommands( deps: ReturnType, configDir: string, ) { - deps.queueCommand({ exitCode: 0, stderr: "", stdout: "mimo 0.1.0\n" }); + deps.queueCommand({ exitCode: 0, stderr: "", stdout: "mimo 0.1.2\n" }); deps.queueCommand({ exitCode: 0, stderr: "", @@ -85,7 +85,7 @@ function queueSuccessfulLiveCommands( deps: ReturnType, configDir: string, ) { - deps.queueCommand({ exitCode: 0, stderr: "", stdout: "mimo 0.1.0\n" }); + deps.queueCommand({ exitCode: 0, stderr: "", stdout: "mimo 0.1.2\n" }); deps.queueCommand({ exitCode: 0, stderr: "", diff --git a/test/package-contract.test.ts b/test/package-contract.test.ts index 5e9a6f4..189a2e7 100644 --- a/test/package-contract.test.ts +++ b/test/package-contract.test.ts @@ -115,7 +115,7 @@ test("constants pin the planned GonkaGate MiMoCode provider contract", () => { CONTRACT_METADATA.publicEntrypoint, "npx @gonkagate/mimo-code-setup", ); - assert.equal(CONTRACT_METADATA.verifiedMimoCode.packageName, "@mimo-ai/cli"); + assert.equal(CONTRACT_METADATA.mimoCode.packageName, "@mimo-ai/cli"); }); test("curated model registry is present but not falsely validated", () => { diff --git a/test/skills-contract.test.ts b/test/skills-contract.test.ts index 1803378..8a15b2c 100644 --- a/test/skills-contract.test.ts +++ b/test/skills-contract.test.ts @@ -88,10 +88,14 @@ test("the imported skill pack includes MiMoCode-aware high-value entries", () => /--api-key-stdin/, /provider\.gonkagate/, /chat_completions/, - /not implemented yet/, + /src\/install\//, + /installer runtime/, + /minimum supported upstream MiMoCode version/, + /newer MiMoCode versions must not be blocked/, ]); assert.doesNotMatch(codingPromptNormalizer, /codex-setup/); - assert.doesNotMatch(codingPromptNormalizer, /shipped installer runtime/i); + assert.doesNotMatch(codingPromptNormalizer, /not_implemented/); + assert.doesNotMatch(codingPromptNormalizer, /not implemented yet/i); assertMatchesAll(codingPromptRepoRouting, [ /mimo-code-setup/,