codeburn/packages/core
iamtoruk 1b17f61f9b feat(core): duplicate-reads, junk-reads, context-bloat detectors over fingerprints (phase 5)
Redesign the three token-waste detectors as pure @codeburn/core detectors that
consume an ObservationEnvelope of fingerprinted resource refs (never raw paths):

- Envelope schema 0.2.0: CallObservation gains optional resourceReads /
  resourceEdits (ResourceRef = {resourceId 16-hex, resourceClass}). claude/codex
  toObservations fingerprint toolSequence file paths into these; raw paths never
  cross the boundary. Keep observation-0.1.0.json frozen; emit 0.2.0.
- Host privacy key (D1): sync keystore under the codeburn config dir, random
  32-byte key generated on first use, stable across runs, never emitted.
- core/detectors: junk-reads, duplicate-reads, context-bloat — pure, zero
  fs/env, each emitting Finding[] with confidence(basis), machine-readable
  evidence, algorithmVersion.
- optimize.ts delegates the three to core, mapping Finding -> WasteFinding;
  display strings, fix payloads and trend stay host-derived.

Numbers parity: all optimize tests pass unchanged; frozen-corpus optimize JSON
(3552 sessions) is byte-identical PRE vs POST.
2026-07-26 13:31:26 -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 feat(core): duplicate-reads, junk-reads, context-bloat detectors over fingerprints (phase 5) 2026-07-26 13:31:26 -07:00
tests feat(core): duplicate-reads, junk-reads, context-bloat detectors over fingerprints (phase 5) 2026-07-26 13:31:26 -07:00
package.json feat(core): duplicate-reads, junk-reads, context-bloat detectors over fingerprints (phase 5) 2026-07-26 13:31:26 -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 feat(core): duplicate-reads, junk-reads, context-bloat detectors over fingerprints (phase 5) 2026-07-26 13:31:26 -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.