refactor: Untangle valuation types and OpenAPI tool identity

SI
14d ago
+45-7

Summary

Move valuation contracts to the valuation domain and bind OpenAPI descriptions to named tools instead of registry array positions.

Verification

39 existing tests plus new ordering regression pass; typecheck and production build pass. All 5 valuation runtime modules emit identical JavaScript. Ordering regression fails old implementation. Independent review completed.

Scope and review

Part of the user-requested Recoup monorepo untangle-codebase workflow. Audit and decision log preceded implementation. Changes stay in this owning repository; no production deployment or main-branch merge requested. No broad comment/test-pruning sweep. Existing local work and retired checkouts preserved.

Each repository PR is independently reviewable; the Mono report will collect the coordinated audit, retained cases and check limitations.


Summary by cubic

Moves valuation contracts into the valuation domain and binds the website OpenAPI search/read descriptions to named tools instead of registry array positions, so reordering the tool discovery list no longer mislabels those endpoints.

  • Valuation types now live in lib/valuation/types.ts, shared by request helpers, hooks, and cards.
  • Adds a regression test that reverses the discovery order and verifies both descriptions and parameters stay attached to the right HTTP operation.
  • Records the domain-contract guidance in AGENTS.md.