refactor(core): vscode-cline shared decode into core — cline, ibm-bob, roo-code (phase 8, shared batch S1) - #836
Merged
Conversation
…, roo-code (phase 8, shared batch S1) Cuts the decode shared by the vscode-cline family out of the CLI and into @codeburn/core/providers/vscode-cline. This is the first shared-module batch: one core decoder now backs four provider identities, with the provider name sourced from context.providerId and the per-consumer fallback model passed as a decode knob. - cline, ibm-bob and roo-code become createBridgedProvider specs. Discovery, file I/O and pricing stay CLI-side; vscode-cline-parser.ts keeps the discovery helpers and gains readClineRecords (I/O adapter) plus toClineProviderCall (rich -> ParsedProviderCall, where cost re-enters). - kilo-code.ts is a zero-line diff. Its SQLite arm does not move until batch S2, so createClineParser is retained but reimplemented as a thin adapter over the core decode — I/O and mapping only, no decode logic CLI-side. - Behavior is preserved verbatim, including the dedup burn-through: the key is added to seenKeys before the zero-token skip, so a skipped entry burns its key. Also preserved: the unguarded new Date(entry.ts), the cost != null (not !== undefined) measured-cost test, and project/projectPath written unconditionally so key presence is unchanged. Validator pass over the migration: - Added a permanent key-presence gate to the shared-bridge goldens. toEqual cannot distinguish an absent key from a present-but-undefined one, which hid exactly this class of regression in earlier batches; the goldens now assert costUSD is absent when estimated and that project/projectPath are always present. - Turned the kilo-code .db: dispatch case from a negative-only assertion into a positive one: it now captures and asserts the SQLite arm's open-failure line, proving dispatch reached that arm rather than merely yielding nothing (and keeping the line out of test output). Parity was checked against the pre-migration decoder as oracle over 25 task fixtures per provider, comparing values, key presence, key order, JSON serialization and the resulting seenKeys sets across two dedup passes — exact match for all four consumers and for the retained adapter.
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.
Phase 8 shared-module batch S1 (tracking #809): migrates the shared
vscode-cline-parserdecode into@codeburn/coreasproviders/vscode-cline, converting cline, ibm-bob, roo-code. kilo-code stays at a zero-line diff — it consumes both this module and the sqlite family, so it keeps a thin I/O-onlycreateClineParseradapter until batch S2 converts it fully.Guidance-spec → Kimi two-phase (goldens first: 5 full-object pins captured from the unmodified code, including kilo-code's cline arm and a dedicated dedup burn-through test) → Opus validation. The validator found zero source defects in this draft; its fixes were test-rigor: a permanent key-presence gate on the goldens (
toEqualis blind to absent-vs-undefined keys — the defect class that bit the sqlite batches) and converting the.db:dispatch test from negative-only to positive proof.Independently oracle-verified (f984728 decoder as oracle, 25 fixture tasks per provider, values + recursive key presence + insertion order + seenKeys across two dedup passes): 10/10 exact for all four consumers plus the retained adapter. The tier's #1 risk — dedup key burned BEFORE the zero-token skip — is preserved and pinned.
Gates: core 363/363; CLI suite and root
npm testboth 2368 passed, 5 skipped (delta vs base verified empirically as exactly the new tests);tsc --noEmitclean both packages; discovery blocks byte-identical; no parse-version changes.Batch S2 (opencode-session unification + opencode/kilo-code full conversion) follows on this branch.