Reinjector

loom-sprint-scaffoldsourcetypescript
Path: loom-sprint-scaffold/loom/src/execution/reinjector.tsRelative: loom/src/execution/reinjector.tsSubproject: loom-sprint-scaffoldCategory: other
Lines: 98Bytes: 2,802Imports: 3Exports: 3

Content Preview

  1. /**
  2. * H3.4 — Reinjector: normalize observations. Truncate to per-tool obs_cap_tokens
  3. * from the envelope; store full text via injected OverflowStore interface (R2 in
  4. * prod, in-memory in tests) with the ref in the trace.
  5. *
  6. * Append the trace event BEFORE the next model call.
  7. */
  8. import { sha256Hex, newEventId } from "../lib/ids";
  9. import { createLogger } from "../lib/logger";
  10. import type {
  11. ExecutionTraceEvent,
  12. OverflowStore,
  13. Sha256Hex,
  14. ToolResultEntry,
  15. } from "../types/execution";