Skip to content

[Refactor] Separate judgment usage accounting from decision orchestration - #3154

Closed
roomote-roomote[bot] wants to merge 2 commits into
developfrom
feature/separate-judgment-usage-07wtvs38cnch2
Closed

roomote-roomote[bot] wants to merge 2 commits into
developfrom
feature/separate-judgment-usage-07wtvs38cnch2

Conversation

@roomote-roomote

Copy link
Copy Markdown
Contributor

​Created by Roomote. View the task or mention @roomote-roomote for follow-up asks.

Related issue

No linked issue was provided for this internal maintenance work.

Why this PR exists

  • A maintainer explicitly invited this PR in the linked issue or discussion
  • I am a maintainer / this is internal Roomote work

The judgment decision module had grown to own both provider orchestration and ledger accounting. Open PR #3057 also adds screenshot-preparation token reporting in this adapter; this refactor preserves that API work's scope and exposes a typed usage normalizer for reuse rather than changing decision behavior.

What changed

  • Moved provider usage normalization, request outcome classification, event identity, and detached best-effort ledger persistence behind a focused trackJudgmentRequest interface.
  • Kept backend selection, request payloads, answer translation and validation, and primary/shadow dispatch in the decision module; no judgment behavior changes.
  • Moved accounting-focused coverage into a dedicated test file and kept an integration assertion for distinct primary/shadow ledger events.

How it was tested

  • Ran the focused cloud-agents judgment and accounting tests (61 tests passed).
  • Ran the cloud-agents package typecheck and formatting check for the changed TypeScript files.

Checklist

  • The PR title follows the repo convention: [Fix], [Feat], [Improve], [Refactor], [Docs], or [Chore] followed by a user-facing description
  • This PR is small and scoped to one change
  • pnpm lint and pnpm check-types pass locally
  • I added tests or included a clear manual validation note above
  • I removed secrets, tokens, private keys, and customer data from code, logs, and screenshots
  • If this change should appear in the changelog, I ran pnpm changeset

@roomote-community

roomote-community Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

No code issues found. See task

Reviewed 70c75f2

@roomote-roomote
roomote-roomote Bot marked this pull request as ready for review September 23, 2026 06:05
@roomote-roomote roomote-roomote Bot closed this Oct 7, 2026
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