Reinjector.Test

loom-sprint-scaffoldtesttypescript
Path: loom-sprint-scaffold/loom/tests/execution/reinjector.test.tsRelative: loom/tests/execution/reinjector.test.tsSubproject: loom-sprint-scaffoldCategory: tests
Lines: 167Bytes: 5,612Imports: 3Exports: 0has tests

Content Preview

  1. /**
  2. * Tests for reinjector (H3.4).
  3. *
  4. * Proves:
  5. * - normalizeObservation truncates content exceeding obs_cap_tokens
  6. * - obs_hash computed from full content, not truncated
  7. * - overflow store is called when content is truncated
  8. * - full_ref is set when store used, absent otherwise
  9. * - makeToolResultEvent has correct shape
  10. */
  11. import { describe, expect, test } from "bun:test";
  12. import {
  13. normalizeObservation,
  14. makeToolResultEvent,
  15. } from "../../src/execution/reinjector";
  16. import type { Overf