Skip to content

test(runtime): delete hand-written conformance replaced by the generated matrix - #1108

Merged
Astro-Han merged 3 commits into
mainfrom
refactor/providers-phase8-dedup
Jul 16, 2026
Merged

Astro-Han merged 3 commits into
mainfrom
refactor/providers-phase8-dedup

Conversation

@Astro-Han

Copy link
Copy Markdown
Contributor

Summary

Part of #860 (Phase 8). Stacked on #1105 (base branch refactor/providers-phase8-closeout): with the three #974 preconditions landed there, this PR deletes the hand-written provider-conformance tests whose every assertion is provably owned by a generated matrix cell, and consolidates the duplicated scripted-HTTP test plumbing.

To make the deletions airtight, the generated wire runners now also assert the request credential on every inference request, keyed off the registry authKind: Bearer for the OpenAI/Cohere wires, x-api-key (or Bearer for auth: 'bearer' adapters) for Anthropic, x-goog-api-key for Google, and no credential header at all for authKind: 'none'. This replaces the per-provider auth-on-POST assertions the deleted tests carried.

Deleted → replaced by

Every deleted test's dimensions are covered by generated cells of its matrix row (all rows verified generated on the relevant dimensions before deletion):

Deleted hand-written test Replaced by
OpenCode Go two-stage tool loop opencode-go row: discovery + openai-chat exact-model-id / tool-loop / reasoning-replay
LocalAI llama.cpp alias + reasoning loop localai row: discovery (auth: 'optional', both credential branches from #1105) + openai-chat wire cells
LM Studio no-auth discovery + loop lm-studio row: discovery (auth: 'none') + openai-chat wire cells with the new no-credential wire assertion
Cerebras discovery + loop cerebras row: generated discovery + openai-chat wire cells
NVIDIA discovery (fallback-models filter) + loop nvidia row: generated discovery with fallback-models decoy + wire cells
SiliconFlow discovery (?sub_type=chat) + tool turn siliconflow row: generated discovery with declared query + wire cells
MiniMax Coding Plan anthropic discovery + tool turn minimax-coding-plan row: generated anthropic discovery (x-api-key) + anthropic-messages wire cells
xAI discovery + loop xai row: generated discovery + wire cells
Together AI discovery + loop togetherai row: generated discovery + wire cells
Mistral discovery (array-or-data) + loop mistral row: generated discovery exercising both payload shapes + wire cells
Tencent TokenHub discovery + reasoning loop tencent-tokenhub row: generated discovery + wire cells incl. reasoning-replay
Xiaomi + Z.AI parametric discovery + loop xiaomi and zai rows: generated discovery + wire cells
Local startJsonServer/readBody/respondJson copy in provider-conformance.test.ts shared conformance-harness.ts (introduced in #1105)

Kept (still the fact authority, with reasons)

  • testConnection probe tests (GitHub Copilot validate/reject, OpenCode per-model protocol probes) — the matrix does not exercise testConnection.
  • OpenCode Zen — owns the models.dev per-model override → Responses routing the matrix's sample-id derivation deliberately avoids.
  • ZenMux non-streamed signed reasoning_details replay — generate-path counterpart of the streamed override binding.
  • Vercel, Ollama Cloud, DeepInfra, Groq, OpenRouter, Cloudflare Workers AI, Tencent Token Plan, Volcengine Ark — assert provider-specific buildProviderOptions request fields (reasoning_effort, thinking) the generated wire never sends; Cloudflare additionally locks the reasoning-source / reasoning_content-absent replay invariant.
  • StepFun direct + Step Plan pairs — reasoning source-field and finish_reason wire quirks plus full plan snapshot lists.
  • Tencent Coding Plan, Volcengine Ark Coding Plan, Tencent Token Plan, StepFun Step Plans — assert full fallback-snapshot list contents; the generated N/A cell asserts only no-network + sample-model inclusion.
  • Hugging Face — asserts the tool-capable survivor's capabilities.functionCalling mapping, which the generated discovery cell does not check.
  • Core tables (STATIC_MODEL_METADATA, CURATED_CATALOG_FALLBACK_MODELS, ANTHROPIC_MODEL_OVERRIDES, CODEX_SUBSCRIPTION_UNSUPPORTED_CHATGPT_MODELS) — audited and kept: they are documented authorities for facts models.dev cannot express (wire thinking controls, curated catalog ordering, access-path allowlists), not superseded parallel tables. normalizeProviderType's codex-subscription persisted-id alias is untouched.

Matrix coverage evidence (Phase 8 acceptance)

  • 52 ready-provider rows × 4 dimensions = 208 cells: 178 generated, 22 justified N/A, 8 override — 0 gaps (gap report green in CI).
  • Overrides (all executable bindings): cohere:discovery, fireworks-ai:discovery, ollama:discovery, github-copilot:{discovery, exact-model-id, tool-loop, reasoning-replay}, zenmux:reasoning-replay.
  • N/A cells: 12 × discovery (declares-static-fallback-model-snapshot) with the enforced no-network reverse assertion (tencent-coding-plan, volcengine-coding-plan, tencent-token-plan, xiaomi-token-plan-{cn,sgp,ams}, stepfun-step-plan, stepfun-ai-step-plan, volcengine-ark, alibaba-coding-plan{-cn,}, alibaba-token-plan{-cn,}, cloudflare-workers-ai) and 10 × reasoning-replay (vendor-sdk-owns-signed-reasoning-replay) (anthropic, kimi-coding-plan, minimax-coding-plan, openai, google, MiniMax, MiniMax-cn, cohere, + subscription overrides handled separately).

Verification

  • npm run typecheck — all workspaces pass.
  • npm run test:scripts — 109/109 pass.
  • Workspace tests: @maka/core 1066 pass, @maka/storage 286 pass (1 skipped), @maka/runtime 1960 pass (7 skipped/todo, 0 fail; net −13 deleted tests), @maka/headless 1022 pass, maka-agent 412 pass, @maka/desktop 2571 pass.
  • npm run check:stale — dist fresh; git diff --check clean.
  • Coverage-equivalence audit: every deleted test was mapped assertion-by-assertion to its generated cell(s) before removal; tests with any unmapped assertion were kept wholesale.

Review focus

  • The buildProviderOptions-driven keeps could later collapse into one dedicated request-field suite, and the full-snapshot-list keeps into a registry snapshot test; both are deliberate non-goals here to keep this PR deletion-only in scope.

…ted matrix

Part of #860 (Phase 8). With the #974 preconditions landed, remove the
hand-written two-stage replay tests whose every assertion is owned by a
generated matrix cell, and strengthen the generated wire to also assert
the per-protocol request credential (Bearer / x-api-key / x-goog-api-key
keyed off the registry authKind, and no credential for authKind none) so
the deleted per-provider auth assertions stay locked.

Deleted (replaced by the named generated cells): OpenCode Go, LocalAI,
LM Studio, Cerebras, NVIDIA, SiliconFlow, MiniMax Coding Plan, xAI,
Together AI, Mistral, Tencent TokenHub, and the Xiaomi + Z.AI pair.

Kept (unique provider contracts): testConnection probes, per-model
override Responses routing (OpenCode Zen), signed reasoning_details
(ZenMux), buildProviderOptions wires (Vercel, Ollama Cloud, DeepInfra,
Groq, OpenRouter, Cloudflare, Tencent Token Plan, Volcengine Ark),
reasoning-source quirks (StepFun), full fallback-snapshot lists
(Tencent/Volcengine/StepFun plans), and Hugging Face capability mapping.

The conformance suite now shares the scripted-HTTP harness instead of
carrying its own copy.
@Astro-Han
Astro-Han force-pushed the refactor/providers-phase8-dedup branch from 94d32ed to ac0eb76 Compare July 16, 2026 10:06
@Astro-Han
Astro-Han changed the base branch from refactor/providers-phase8-closeout to main July 16, 2026 10:06
Accepted findings from the external review:

- P1: wire runs expand optional_api_key into both credential branches
  (configured key must reach the wire; absent key must send no credential
  at all), matching the discovery-side expansion; assertWireCredential
  now also asserts every non-selected credential header (authorization,
  x-api-key, api-key, x-goog-api-key) is absent for all authKinds.
- P2: five declared edge wire samples (opencode-go kimi-k2.7-code,
  localai localai/Qwen3-8B-Instruct-GGUF:Q4_K_M, lm-studio
  lmstudio-community/Qwen3-Coder-30B-A3B-Instruct-GGUF,
  minimax-coding-plan MiniMax-M2.7-highspeed, tencent-tokenhub
  hy3-preview) run end-to-end through the same wire executor
  (exact-model-id + tool-loop) on the per-id resolved wire; the
  declaration lives in the core matrix plan (EDGE_WIRE_SAMPLE_MODEL_IDS
  -> row.edgeWireSamples) so future providers enter by declaration.
- P2: the generic OpenAI wire fixture issues an opaque tool-call id
  (D681PevKs9, no call_ prefix) and both turns assert it is replayed
  verbatim, so id canonicalization regressions cannot pass.
- P2: wire connections carry a sentinel base-URL pathname
  (/contract-base/...) and every protocol runner asserts the final
  request path equals the sentinel prefix plus the protocol suffix,
  proving the runtime preserves configured baseUrl pathnames.

Request-contract violations in wire handlers are recorded and rethrown
after the call so injected regressions fail with the contract message
instead of a destroyed-socket timeout. Each hardening was verified by
injecting the corresponding runtime regression and observing the new
assertion fail by name.
@Astro-Han
Astro-Han merged commit c4fd093 into main Jul 16, 2026
3 checks passed
@Astro-Han
Astro-Han deleted the refactor/providers-phase8-dedup branch July 16, 2026 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant