Skip to content

app/: set_credit_override admin MCP tool (stacked on #145 and #144) (sc-8900) - #147

Merged
ndbroadbent merged 1 commit into
mainfrom
app-admin-credit-override
Dec 3, 2026
Merged

ndbroadbent merged 1 commit into
mainfrom
app-admin-credit-override

Conversation

@ndbroadbent

@ndbroadbent ndbroadbent commented Dec 3, 2026 •

Copy link
Copy Markdown
Member

Stacked: merge #145 (/mcp/admin) and #144 (credit override) first. This branch is #145 with #144 merged in. Once both are on main, rebase it and its diff is only the last commit: one tool, its test and goldens, and one docs line.

Adds the admin MCP tool set_credit_override, which brief item 4 asks for. It calls #144's domain::credit_overrides::set / clear with Actor::Staff(user).

  • Arguments: org, credits, until (YYYY-MM-DD), label (optional, what customers see), reason, and clear: true (instead of credits and until).
  • The answer is the domain's: {org, override, allowance, was: {allowance, override}}.
  • The domain's refusals (past date, a reason that's too short, credits that don't raise the plan, an unlimited plan, an unknown org) come back as tool errors.
  • Like every admin call it is written to admin_audit, and the domain also writes its own credit_override_audit row (old and new allowance).

Tests: staff_read_and_write_with_a_reason_and_every_call_is_audited now checks:

  • a refusal (credits without until);
  • setting the override (the answer and the credit_override_audit row);
  • clearing it;
  • that all three calls are in admin_audit.

New goldens: set_credit_override*.json, plus tools-list.json with the new tool.

Gates (build box, on this branch with #144 merged): cargo fmt --all --check, cargo clippy --locked --workspace --all-targets -- -D warnings and cargo test --locked --workspace all pass.

VisualCI build: the new and changed mcp_admin JSON goldens, plus whatever #144's build shows.


Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@visualci-com

visualci-com Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

VisualCI

docspring/visualci · build #219 · 341 unchanged · no changes

This PR vs base: nothing since #196, across 3 builds

docspring/visualci · journeys · build #217 · 12 unchanged · no changes

This PR vs base: nothing since #193, across 3 builds

Updated as builds change. Agents can review with VisualCI's MCP tools.

@ndbroadbent
ndbroadbent force-pushed the app-admin-credit-override branch from 65a159c to d944286 Compare December 3, 2026 18:37
@ndbroadbent
ndbroadbent changed the base branch from app-staff-admin-mcp to main December 3, 2026 18:51
Co-authored-by: Claude <noreply@anthropic.com>
@ndbroadbent
ndbroadbent force-pushed the app-admin-credit-override branch from d944286 to 7eadcc2 Compare December 3, 2026 19:39
@ndbroadbent
ndbroadbent merged commit 7c6ca30 into main Dec 3, 2026
14 checks passed
@ndbroadbent
ndbroadbent deleted the app-admin-credit-override branch December 3, 2026 19:52
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