codeburn/packages/core/tests
iamtoruk 93b4f7707f refactor(core): copilot decode into core (phase 8, sqlite batch 3)
Bridged via a tagged envelope record across the four parse paths
(jsonl / chatsession / jetbrains / otel): readRecords shapes one envelope
per source kind and a single decodeCopilot dispatches on envelope.kind.

The sqlite driver, the three OTel queries, blob reads, git-root probing,
extractBashCommands / extractOtelBashCommands, and the sanctioned
shutdown-site calculateCost residual all stay host-side. The residual
keeps its exact argument order (model, input, 0, cacheWrite, cacheRead, 0),
emits costUSD + costIsEstimated: false with no costBasis key, and carries
its explanatory comment unchanged.

Validator fixes over the draft:
- collectJetBrainsRepoDirCandidates used a [\|"] character class instead
  of the original's (?:\\|") alternation, so a file:// path containing a
  pipe was truncated, its dir never resolved, and the JetBrains project
  fell back to the generic bucket. Restored the alternation.
- the otel arm dropped the subagentTypes key when undefined; the original
  always emits it. Restored so key presence matches byte for byte.
- otel chat-span attributes were looked up with a linear Array.find per
  chat span; replaced with a per-span-id map built in the same pass.

Verified by a differential harness running the pre-migration provider
against the migrated one over 27 scenarios (all eight goldens plus
edge cases), comparing calls, seenKeys, and key presence. The harness is
not committed; the scenarios it proved are now goldens G9-G17.
2026-07-26 21:17:48 -07:00
..
fixtures feat(core): duplicate-reads, junk-reads, context-bloat detectors over fingerprints (phase 5) 2026-07-26 13:31:26 -07:00
harness feat(core): duplicate-reads, junk-reads, context-bloat detectors over fingerprints (phase 5) 2026-07-26 13:31:26 -07:00
providers refactor(core): copilot decode into core (phase 8, sqlite batch 3) 2026-07-26 21:17:48 -07:00
architecture-gate.test.ts refactor(core): copilot decode into core (phase 8, sqlite batch 3) 2026-07-26 21:17:48 -07:00
content-smuggling.test.ts refactor(core): copilot decode into core (phase 8, sqlite batch 3) 2026-07-26 21:17:48 -07:00
detectors.test.ts feat(core): duplicate-reads, junk-reads, context-bloat detectors over fingerprints (phase 5) 2026-07-26 13:31:26 -07:00
diagnostics.test.ts feat(core): observation schema, contracts, fingerprints, guardrail harnesses (phase 2) 2026-07-26 10:43:21 -07:00
finding-no-fix-payload.test.ts test(core+cli): act/apply stays host-derived — advisory findings gated (phase 7) 2026-07-26 14:02:43 -07:00
fingerprint.test.ts feat(core): duplicate-reads, junk-reads, context-bloat detectors over fingerprints (phase 5) 2026-07-26 13:31:26 -07:00
import-smoke.test.ts feat(core): observation schema, contracts, fingerprints, guardrail harnesses (phase 2) 2026-07-26 10:43:21 -07:00
schema-drift.test.ts feat(core): duplicate-reads, junk-reads, context-bloat detectors over fingerprints (phase 5) 2026-07-26 13:31:26 -07:00
schema.test.ts feat(core): duplicate-reads, junk-reads, context-bloat detectors over fingerprints (phase 5) 2026-07-26 13:31:26 -07:00