Skip to content

refactor(core): vscode-cline shared decode into core — cline, ibm-bob, roo-code (phase 8, shared batch S1) - #836

Merged
iamtoruk merged 1 commit into
feat/core-extractionfrom
phase8/shared-modules
Jul 27, 2026
Merged

refactor(core): vscode-cline shared decode into core — cline, ibm-bob, roo-code (phase 8, shared batch S1)#836
iamtoruk merged 1 commit into
feat/core-extractionfrom
phase8/shared-modules

Conversation

@iamtoruk

Copy link
Copy Markdown
Member

Phase 8 shared-module batch S1 (tracking #809): migrates the shared vscode-cline-parser decode into @codeburn/core as providers/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-only createClineParser adapter 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 (toEqual is 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 test both 2368 passed, 5 skipped (delta vs base verified empirically as exactly the new tests); tsc --noEmit clean both packages; discovery blocks byte-identical; no parse-version changes.

Batch S2 (opencode-session unification + opencode/kilo-code full conversion) follows on this branch.

…, 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.
@iamtoruk
iamtoruk merged commit 3817289 into feat/core-extraction Jul 27, 2026
4 checks passed
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