Skip to content

feat(compliance): responsible gambling state, flags queue and kyc queue agent tools - #405

Open
mp-blurify wants to merge 3 commits into
feat/agent-read-toolsfrom
feat/agent-compliance-read-tools
Open

mp-blurify wants to merge 3 commits into
feat/agent-read-toolsfrom
feat/agent-compliance-read-tools

Conversation

@mp-blurify

Copy link
Copy Markdown
Collaborator

Summary

  • Add rg.player_state: one player's responsible-gambling standing as RG_STANDING_READER reports it - exclusions in force, open flags, limits with a raise still waiting, and priced money windows.
  • Add rg.flags_queue: the open responsible-gambling flags across all players, counted per type, the oldest by player id.
  • Add kyc.queue: each player's latest KYC verification per tier waiting for a decision or a resubmission, counted per tier, the oldest pending by player id.
  • All three under compliance:view, covered end to end through the MCP kernel, and recorded in ADR-0042.

Why

An operator's assistant answers questions about players and the operation from the read tools an admin holds. Compliance served only kyc.status: "is this player limited or excluded", "what flags wait longest" and "how far behind is KYC review" had no tool. The standing reader already reports a player's RG facts to other modules without free text, so the per-player tool serves it as it is.

Each tool names a player only by player id under playerId, bounds its list (1 to 20, default 10) and returns no free text: no exclusion or decision reason, no flag detail, no document, risk signal or provider reference, no admin.

Alternatives considered

  • Serving the admin RG and KYC screens' list routes as tools: they carry usernames, emails, flag details and decision reasons, and are unbounded.
  • Counting every KYC verification row: a pending attempt a later verification superseded waits for nothing, so the queue reads each player's latest per tier.

Risks

  • rg.player_state resolves the standing reader per call, so a deployment without play eligibility fails that tool's calls rather than the kernel's boot.
  • kyc.queue counts with DISTINCT ON (user_id, tier) over the verifications on every call; the existing index on (user_id, tier, created_at) serves it.

Mateusz Paś and others added 3 commits November 6, 2026 10:40
…ue agent tools

Three read tools under compliance:view for an operator's assistant:

- rg.player_state serves one player's responsible-gambling standing as
  RG_STANDING_READER reports it: restricted, the exclusions in force,
  the self-exclusions on record, the open flags, the limits with a
  raise or removal still waiting, and completed money over 1 to 4
  windows priced into the pivot currency. No reason and no admin. It
  resolves the reader per call, so a kernel built without play
  eligibility still serves the other tools.
- rg.flags_queue counts the active monitoring flags per type and in the
  last 7 days, and lists the oldest (1 to 20) by player id, without the
  flag's detail.
- kyc.queue reads each player's latest verification per tier, counts
  those pending and awaiting a resubmission per tier with the average
  pending wait, and lists the oldest pending (1 to 20) by player id,
  without a decision reason, document or risk signal.

The two queues join the player profile through its read-only schema.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Mateusz Paś <mateusz.pas@studiosoftware.com>
… mcp kernel

The kernel suite expects the three compliance tools and calls each
against seeded rows: exactly the allow-listed keys, the player by player
id, no exclusion or decision reason, flag detail or user id in what is
served, player_not_found for an unknown player, invalid_input for a
limit out of bounds, and forbidden - audited once - for an admin whose
role lacks compliance:view. The transport suite lists them under their
model names.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Mateusz Paś <mateusz.pas@studiosoftware.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Mateusz Paś <mateusz.pas@studiosoftware.com>
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