Mode Registry

loom-sprint-scaffoldsourcetypescript
Path: loom-sprint-scaffold/loom/src/dispatcher/core/mode-registry.tsRelative: loom/src/dispatcher/core/mode-registry.tsSubproject: loom-sprint-scaffoldCategory: other
Lines: 87Bytes: 3,002Imports: 4Exports: 1

Content Preview

  1. /**
  2. * H2.1 — D1-backed mode registry.
  3. *
  4. * selectMode(variety_class) picks the mode with highest success rate for that
  5. * class from the injected RegistryStore. No history → returns highest-capability
  6. * mode with variety_deficit: true; caller widens budgets by deficit_multiplier
  7. * (default 1.5×) and logs a structured deficit record.
  8. */
  9. import type { VarietyClass, ModeRegistryRow } from "../../types";
  10. import type { ModeSelection, RegistryStore } from "./types";
  11. import { createLogger } from