codeburn/packages/core/tests/providers
iamtoruk 4ef24e9fcd refactor(core): tail migrations — hermes, warp, cursor-agent, quickdesk, devin (phase 8, sqlite batch 2)
Move the pure record decode for five sqlite-backed providers into
@codeburn/core, keeping discovery, sqlite I/O, pricing, and bash
base-name extraction CLI-side behind the dual-registry bridge.

sqlite variant: the host opens the database, runs the SQL, textualizes
BLOBs (warp stylized_command, quickdesk content/tool_names), probes
sqlite_master table variants (quickdesk), and re-throws SQLITE_BUSY so a
transient lock on a live database retries instead of being cached as an
empty result (hermes). The core decoders receive already-normalized rows.

Validator fixes over the drafted migration (original behavior is the
authority in every case):

- warp: restored the `run_command` tool-name check as an identity
  comparison. The draft had rewritten it as a bare Record lookup, so
  'constructor'/'toString'/'__proto__' resolved to inherited Object
  members instead of passing through. Added a regression test.
- warp: restored `safeNumber` to the host's semantics (positive finite
  numbers only). The draft's rewrite accepted numeric strings and
  negative values, changing token budgets and dominant-model selection
  for untrusted conversation_data.
- warp: `estimateTokensFromChars` now mirrors the host helper exactly.
- devin: model DISPLAY names move back CLI-side. The draft shipped a
  7-line regex standing in for the host's `getShortModelName`, which
  mis-rendered every non-Claude model id. The decoder now emits the raw
  generation_model / model_name ids and the CLI formats them.
- devin: dropped the added `costBasis: 'measured'`; the pre-migration
  call carried `costUSD` with no basis marker. Golden corrected.
- quickdesk: fixed an inverted source-variant predicate that routed
  `sourceId: 'metrics'` on a sessions.db path (and `sourceId:
  'sessions-db'` on a metrics path) to the wrong parser.
- cursor-agent: the "unrecognized transcript format" warning is now
  re-emitted from the real decode result via a decode wrapper. The draft
  re-derived `recognized` host-side as `hasUser && hasAssistant`, which
  silently dropped the warning whenever a jsonl transcript had both roles
  but produced no turns.
- cursor-agent: restored the per-conversation summary cache, so the
  attribution database is opened once per conversation id, not per source.
- cursor-agent/devin: the session id is derived once, host-side, and
  passed through, removing a second derivation that could disagree with
  the host's on Windows-style paths.
- hermes: `browser_vision` maps to Vision, matching the original table.

Goldens re-verified by running each bridge fixture through the
pre-migration provider implementation: all five reproduce field-for-field.
2026-07-26 20:26:18 -07:00
..
claude-decode.test.ts refactor(core): carve Claude decode into @codeburn/core, CLI parser becomes adapter (phase 3) 2026-07-26 11:39:01 -07:00
codebuff-decode.test.ts refactor(core): tail migrations — codebuff, openclaw (phase 8) 2026-07-26 16:41:33 -07:00
codewhale-decode.test.ts refactor(core): tail migrations — grok, kimi, codewhale (phase 8) 2026-07-26 15:11:38 -07:00
codex-decode.test.ts refactor(core): codex decoder with explicit serializable state, cost leaves the decoder (phase 4) 2026-07-26 12:44:10 -07:00
crush-decode.test.ts refactor(core): tail migrations — crush, zcode, zed, forge, goose (phase 8, sqlite batch 1) 2026-07-26 18:27:44 -07:00
cursor-agent-decode.test.ts refactor(core): tail migrations — hermes, warp, cursor-agent, quickdesk, devin (phase 8, sqlite batch 2) 2026-07-26 20:26:18 -07:00
devin-decode.test.ts refactor(core): tail migrations — hermes, warp, cursor-agent, quickdesk, devin (phase 8, sqlite batch 2) 2026-07-26 20:26:18 -07:00
forge-decode.test.ts refactor(core): tail migrations — crush, zcode, zed, forge, goose (phase 8, sqlite batch 1) 2026-07-26 18:27:44 -07:00
goose-decode.test.ts refactor(core): tail migrations — crush, zcode, zed, forge, goose (phase 8, sqlite batch 1) 2026-07-26 18:27:44 -07:00
grok-decode.test.ts refactor(core): tail migrations — grok, kimi, codewhale (phase 8) 2026-07-26 15:11:38 -07:00
hermes-decode.test.ts refactor(core): tail migrations — hermes, warp, cursor-agent, quickdesk, devin (phase 8, sqlite batch 2) 2026-07-26 20:26:18 -07:00
kimi-decode.test.ts refactor(core): tail migrations — grok, kimi, codewhale (phase 8) 2026-07-26 15:11:38 -07:00
openclaw-decode.test.ts refactor(core): tail migrations — codebuff, openclaw (phase 8) 2026-07-26 16:41:33 -07:00
quickdesk-decode.test.ts refactor(core): tail migrations — hermes, warp, cursor-agent, quickdesk, devin (phase 8, sqlite batch 2) 2026-07-26 20:26:18 -07:00
qwen-decode.test.ts feat(core): dual-registry bridge + qwen exemplar migration (phase 8.1) 2026-07-26 14:26:00 -07:00
warp-decode.test.ts refactor(core): tail migrations — hermes, warp, cursor-agent, quickdesk, devin (phase 8, sqlite batch 2) 2026-07-26 20:26:18 -07:00
zcode-decode.test.ts refactor(core): tail migrations — crush, zcode, zed, forge, goose (phase 8, sqlite batch 1) 2026-07-26 18:27:44 -07:00
zed-decode.test.ts refactor(core): tail migrations — crush, zcode, zed, forge, goose (phase 8, sqlite batch 1) 2026-07-26 18:27:44 -07:00
zerostack-decode.test.ts refactor(core): tail migrations — zerostack, droid, mux, open-design, lingtai-tui (phase 8) 2026-07-26 15:23:09 -07:00