Repository navigation
docs(llm): record P0.1 Capability Seam status — core delivered, residual tail deferred - #142
Merged
Merged
Conversation
…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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
LlmCapability)LlmClientinterface —src/services/llm/client.ts:69(5 methods:streamMessages/createMessage/createMessageRaw/countTokens/listModels)getAnthropicClient()returnsLlmClient(not concrete) —src/services/api/client.ts:54;createSeamClientbuilds firstParty + fusionMlxclaude.tscallsites:549(verify) +:854(main) consume theLlmClientinterface; SDK removed (div-anthropic)LlmAdapter/registry.ts(getLlmAdapterstatic dispatch byAPIProvider,LLM_ADAPTER_SEAMfeature 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:
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.supportsStreaming/supportsVision/maxInputTokensscattered acrossfusion-mlx-models.ts(MLX-only) +modelCapabilities.ts; noLLM_SETTINGS_NAMESPACEregistry. 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
main37cb441, 469 tests pass.Co-Authored-By: Claude Fable 5 [email protected]