codeburn/packages/core
iamtoruk b504838309 refactor(core): codex decoder with explicit serializable state, cost leaves the decoder (phase 4)
Carve the Codex decoder into @codeburn/core/providers/codex as a pure function
over supplied rollout records with EXPLICIT, JSON-serializable state
(CodexDecodeState): the running cumulative token counters, fork-replay cutoff,
mid-turn accumulators, id/turn bookkeeping, and the cross-file dedup memory
(seenKeys). Decoding a corpus in one pass equals decoding it in any number of
passes when the state threads between them (the resume invariant).

Cost leaves the decoder: the rich calls are cost-free and the CLI prices them
through the established estimated-cost seam (costBasis: 'estimated'), retiring
both Phase-0 residual calculateCost sites. The CLI codex provider is now
discovery + file streaming + cache I/O + pricing.

codex-results cache bumped to v8 (one deliberate bump): it persists the decoder
end-state blob + a byte offset + host-priced calls, so a grown rollout resumes
from the stored state and decodes only the appended bytes. Lossless — rollout
files are durable, so the one-time re-derive rebuilds identical data.

Adds a codex path to the content-smuggling guardrail and the import-smoke
subpath set. Byte-parity verified against a frozen 826-file corpus (codex-only
and all-providers, rel_tol 1e-9); perf within ±1.5% cold / ±0.5% warm.
2026-07-26 12:44:10 -07:00
..
schemas feat(core): observation schema, contracts, fingerprints, guardrail harnesses (phase 2) 2026-07-26 10:43:21 -07:00
scripts feat(core): observation schema, contracts, fingerprints, guardrail harnesses (phase 2) 2026-07-26 10:43:21 -07:00
src refactor(core): codex decoder with explicit serializable state, cost leaves the decoder (phase 4) 2026-07-26 12:44:10 -07:00
tests refactor(core): codex decoder with explicit serializable state, cost leaves the decoder (phase 4) 2026-07-26 12:44:10 -07:00
package.json refactor(core): codex decoder with explicit serializable state, cost leaves the decoder (phase 4) 2026-07-26 12:44:10 -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): codex decoder with explicit serializable state, cost leaves the decoder (phase 4) 2026-07-26 12:44:10 -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.