Registry Updater.Test

loom-sprint-scaffoldtesttypescript
Path: loom-sprint-scaffold/loom/tests/synthesis/registry-updater.test.tsRelative: loom/tests/synthesis/registry-updater.test.tsSubproject: loom-sprint-scaffoldCategory: tests
Lines: 208Bytes: 7,132Imports: 4Exports: 0has tests

Content Preview

  1. /**
  2. * Tests for H5.3 — Registry Updater.
  3. *
  4. * Proves:
  5. * - computeModeStats groups correctly by (model, harnessProfile, varietyClass)
  6. * - Same input → same output (deterministic, byte-equal JSON via statsToDeterministicJson)
  7. * - Hand-computed stats match
  8. * - Empty input → empty output
  9. * - avg_cost_tokens round to integer
  10. */
  11. import { describe, expect, test } from "bun:test";
  12. import {
  13. computeModeStats,
  14. toRegistryUpdates,
  15. runRegistryUpdater,
  16. statsToDeterministicJson,
  17. Mod