codeburn/packages/core
iamtoruk e11c29937c refactor(core): mistral-vibe decode into core with host-side cost resolution (phase 8, judgment tier)
Moves the Mistral Vibe rich decode into @codeburn/core behind the bridge:
discovery, file I/O and pricing stay CLI-side, the pure record decode
(including the even allocation of the session dollar figure and the session
token totals across assistant messages) moves byte-exact into core.

Seam adjudication: the draft brief said the `session_cost > 0` gate should
move into core. It cannot — that gate is the first arm of a three-arm cost
resolution whose last arm consults the generic price table, which is
forbidden in core. The whole resolution therefore stays host-side in
`calculateSessionCost` and core receives a pre-resolved `sessionCost`;
core keeps only the pure allocation arithmetic (allocateInteger /
allocateCost, allocationIndex / assistantOrdinal), unchanged in rounding,
remainder distribution and float operation order. The move is
observationally equivalent: the original resolved the cost once per session
during parse, with no per-call state.

Validator fixes on the draft:
- core dropped the `metadata.session_id || basename(sessionDir)` fallback,
  emitting sessionId '' (and colliding dedup keys `mistral-vibe::<msg>`)
  for sessions whose meta.json omits session_id. The host now passes
  `sessionIdFallback`.
- `toProviderCall` set `turnId: undefined` unconditionally, adding a key
  the original omits entirely on the no-assistant session-level arm.
- the moved comment block described a seam that no longer exists; adjusted
  minimally to describe where the resolution actually lives.

Parity was verified arm-by-arm against the pre-migration decode checked out
in place over a 28-session adversarial fixture matrix (strict equality plus
per-call key-presence), and the adversarial allocation arms (7 over 3,
1 over 3, terminal zero-cost, idx-N keys, basename fallback, float-op order)
are promoted into the bridge and core decode tests with values captured
from the original.
2026-07-26 23:43:45 -07:00
..
schemas feat(core): duplicate-reads, junk-reads, context-bloat detectors over fingerprints (phase 5) 2026-07-26 13:31:26 -07:00
scripts feat(core): observation schema, contracts, fingerprints, guardrail harnesses (phase 2) 2026-07-26 10:43:21 -07:00
src refactor(core): mistral-vibe decode into core with host-side cost resolution (phase 8, judgment tier) 2026-07-26 23:43:45 -07:00
tests refactor(core): mistral-vibe decode into core with host-side cost resolution (phase 8, judgment tier) 2026-07-26 23:43:45 -07:00
package.json refactor(core): mistral-vibe decode into core with host-side cost resolution (phase 8, judgment tier) 2026-07-26 23:43:45 -07:00
README.md chore(workspace): move CLI to packages/cli, add @codeburn/core skeleton (phase 1) 2026-07-26 10:19:33 -07:00
tsconfig.json feat(core): observation schema, contracts, fingerprints, guardrail harnesses (phase 2) 2026-07-26 10:43:21 -07:00
tsup.config.ts refactor(core): mistral-vibe decode into core with host-side cost resolution (phase 8, judgment tier) 2026-07-26 23:43:45 -07:00
vitest.config.ts feat(core): observation schema, contracts, fingerprints, guardrail harnesses (phase 2) 2026-07-26 10:43:21 -07:00

@codeburn/core

Shared, provider-agnostic core for CodeBurn: session parsing, model/pricing resolution, and the cost math that the CLI and the desktop apps all depend on.

Status: skeleton. This package currently exports nothing. It is introduced in Phase 1 of the core extraction (packaging only) and is populated incrementally in later phases as logic is lifted out of packages/cli.