Skip to content

refactor: Untangle valuation types and OpenAPI tool identity - #246

Open
sidneyswift wants to merge 2 commits into
mainfrom
codex/untangle-frontend-2026-11-09
Open

sidneyswift wants to merge 2 commits into
mainfrom
codex/untangle-frontend-2026-11-09

Conversation

@sidneyswift

@sidneyswift sidneyswift commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

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.

Written for commit ce787d6. Summary will update on new commits.

View guided diff Turn on auto-fix

@vercel

vercel Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
marketing Ready Ready Preview Nov 9, 2026 4:21am UTC

Request Review

@coderabbitai

coderabbitai Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 79389b63-3d85-4208-ae4c-59c09b1d72b4
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 9 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="tests/openapi-tool-order.test.ts">

<violation number="1" location="tests/openapi-tool-order.test.ts:17">
P2: These assertions do not verify the complete parameter contract, so a regression dropping optional search or read parameters would pass this test. Compare each emitted parameter-name list with all keys from the corresponding tool schema.</violation>
</file>

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread tests/openapi-tool-order.test.ts Outdated
const { paths } = websiteOpenAPI();
expect(paths["/search"].get.description).toBe(searchRecoupTool.description);
expect(paths["/read"].get.description).toBe(readRecoupPageTool.description);
expect(paths["/search"].get.parameters.map(({ name }) => name)).toContain("query");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: These assertions do not verify the complete parameter contract, so a regression dropping optional search or read parameters would pass this test. Compare each emitted parameter-name list with all keys from the corresponding tool schema.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At tests/openapi-tool-order.test.ts, line 17:

<comment>These assertions do not verify the complete parameter contract, so a regression dropping optional search or read parameters would pass this test. Compare each emitted parameter-name list with all keys from the corresponding tool schema.</comment>

<file context>
@@ -0,0 +1,19 @@
+  const { paths } = websiteOpenAPI();
+  expect(paths["/search"].get.description).toBe(searchRecoupTool.description);
+  expect(paths["/read"].get.description).toBe(readRecoupPageTool.description);
+  expect(paths["/search"].get.parameters.map(({ name }) => name)).toContain("query");
+  expect(paths["/read"].get.parameters.map(({ name }) => name)).toContain("id");
+});
</file context>

This branch was successfully deployed

1 active deployment
Preview — ce787d6e Deployed Nov 9, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant