Skip to content

docs(llm): record P0.1 Capability Seam status — core delivered, residual tail deferred - #142

Merged
dahai80 merged 1 commit into
mainfrom
docs/p01-capability-seam-status
Aug 26, 2026
Merged

dahai80 merged 1 commit into
mainfrom
docs/p01-capability-seam-status

Conversation

@dahai80

@dahai80 dahai80 commented Aug 26, 2026

Copy link
Copy Markdown
Owner

Summary

Records the P0.1 Capability Seam (enhance-0819.md:449) status: the core high-leverage seam is already delivered by the div-anthropic work; the spec's own flagged "大重构" tail is deferred as an explicit decision.

Audit

enhance-0819.md P0.1 asks for a Capability Seam (Service Definition + Provider + Consumer) so swapping providers doesn't touch the model-call loop. Current state:

Spec role Status Location
Service Definition (LlmCapability) ✅ landed LlmClient interface — src/services/llm/client.ts:69 (5 methods: streamMessages/createMessage/createMessageRaw/countTokens/listModels)
Provider factory ✅ landed getAnthropicClient() returns LlmClient (not concrete) — src/services/api/client.ts:54; createSeamClient builds firstParty + fusionMlx
Consumer model-call path ✅ neutral claude.ts callsites :549 (verify) + :854 (main) consume the LlmClient interface; SDK removed (div-anthropic)
Deeper adapter layer ✅ exists LlmAdapter/registry.ts (getLlmAdapter static dispatch by APIProvider, LLM_ADAPTER_SEAM feature flag, default off → fallback)

The high-leverage core — swap provider without touching the model-call loop — is delivered.

Residual tail (deferred)

The spec's own risk note ("大重构, 需保 514 测试不回归, 分步: 先接口共存[done], 后去具体 import[remaining]") leaves:

  1. 9 provider-conditional branches in claude.ts — isFusionMlxProvider() (:524), shouldIncludeFirstPartyOnlyBetas() (:303/:476/:1420/:1664), getAPIProvider()==="firstParty" (:1439/:1677/:1681/:1814), isFirstPartyAnthropicBaseUrl() (:1814). These sit in betas / auth-verify / header logic, not the model-call path (which is neutral). Fully purging = sink provider-aware logic into the capability-fact/adapter layer.
  2. Capability facts uncentralized — supportsStreaming/supportsVision/maxInputTokens scattered across fusion-mlx-models.ts (MLX-only) + modelCapabilities.ts; no LLM_SETTINGS_NAMESPACE registry. Spec step "能力事实集中" + "命名空间" not done.

Decision

Forcing this tail now is exactly the speculative large refactor simplicity-first forbids: high-regression surface on the live model path's betas/auth/headers, no concrete failure driving it. Deferred as an explicit decision, not backlog. If revisited, follow the spec's stepwise path: extract a capability-fact single point first, then sink one provider-conditional branch at a time, preserving the 469-test baseline each step.

Verification

Doc-only; no code/build/test impact. Baseline confirmed: clean tree on main 37cb441, 469 tests pass.

Co-Authored-By: Claude Fable 5 [email protected]

…ual tail deferred

enhance-0819.md P0.1 asks for a Capability Seam (Service Definition +
Provider + Consumer) so swapping providers doesn't touch the model-call
loop. Audit of current state:

- Service Definition: LlmClient interface (client.ts:69, 5 methods) = the
  spec's LlmCapability — already landed.
- Provider factory: getAnthropicClient() returns LlmClient (not a concrete
  client); createSeamClient builds firstParty + fusionMlx — already landed.
- Consumer model-call path: claude.ts getAnthropicClient callsites (:549,
  :854) consume the LlmClient interface; SDK removed (div-anthropic) —
  already neutral.
- Deeper adapter layer: LlmAdapter/registry.ts (static dispatch by
  APIProvider, LLM_ADAPTER_SEAM feature flag, default off).

The high-leverage core (swap provider without touching the call loop) is
delivered. The spec's own flagged "大重构" tail remains: 9 provider-
conditional branches in claude.ts (betas/auth/headers, not the call path)
and uncentralized capability facts (fusion-mlx-models.ts + modelCapabilities,
no LLM_SETTINGS_NAMESPACE). Fully purging these is high-regression on the
live model path with no concrete failure driving it — deferred as an
explicit decision, not backlog, with a stepwise path if revisited.

Co-Authored-By: Claude Fable 5 <[email protected]>
@dahai80
dahai80 merged commit 47a1e25 into main Aug 26, 2026
1 check passed
@dahai80
dahai80 deleted the docs/p01-capability-seam-status branch August 26, 2026 06:58
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