Skip to content

refactor(topup-agent): the simulated rail speaks its own vocabulary; the rail is named simulated-pull - #137

Merged
rapguit merged 1 commit into
mainfrom
chore/topup-neutral-fixture
Nov 12, 2026
Merged

rapguit merged 1 commit into
mainfrom
chore/topup-neutral-fixture

Conversation

@rapguit

@rapguit rapguit commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

What

The offline simulation of the bank in agents/topup-agent, and the rail over it, now use the kit's own vocabulary.

  • Statuses. An authorization is waiting, approved, rejected, expired, revoked, cancelled or error; a payment is pending, completed, rejected, expired, cancelled or error. Rejection codes become reasons (not_approved_in_time, declined_by_person).
  • Requests and answers. A request carries reference, payee and the two limits (totalLimitMinor, perPullLimitMinor); an answer carries consentId, consentUrl and reason. Fields the simulation never used (tax id, trigger, participant, device signals, redirect URL) are removed, along with their config.
  • Rail name. simulated-pull, in the module and in the core's PaymentRail union (one-line change).
  • Comments and eval. Core comments, the two consent-step tests and the exfiltration eval input describe the pull without naming a provider. The recorded transcript does not depend on the input.
  • Runtime. A unit test for resolveRailKind, including the apiRailKey: "none" branch, which had no test.
  • README. States that the limit variables are TOPUP_TOTAL_CENTS / TOPUP_TX_LIMIT_CENTS.

The rail keeps its guarantees: one pull per approved execution, the marker written before the payment request, no consent link in state.db. The hosted catalog does not carry the rail name and does not change.

Tests

  • npm run typecheck
  • npm run check
  • vitest of agents/topup-agent, packages/agent-core, packages/agent-runtime (593 passed, 1 skipped)
  • npm run eval --workspace=agents/topup-agent (7 adversarial, 13 scenario runs)
  • full npm test (CI)

🤖 Generated with Claude Code

…the rail is named simulated-pull

The offline simulation of the bank and the rail over it now use the
kit's own words instead of a provider's:

- Statuses: an authorization is waiting, approved, rejected, expired,
  revoked, cancelled or error; a payment is pending, completed, rejected,
  expired, cancelled or error. Rejection codes become reasons
  (not_approved_in_time, declined_by_person).
- Requests carry reference, payee and the two limits (totalLimitMinor,
  perPullLimitMinor); answers carry consentId, consentUrl and reason.
  The fields the simulation never used (tax id, trigger, participant,
  device signals, redirect URL) are gone, and so is their config.
- The rail is named simulated-pull, in the module and in the core's
  PaymentRail union.
- Core comments, the two consent-step tests and the exfiltration eval
  input describe the pull without a provider name.
- runtime: a unit test for resolveRailKind, the apiRailKey "none" branch
  included.
- README: the limit variables are TOPUP_TOTAL_CENTS / TOPUP_TX_LIMIT_CENTS.

The hosted catalog does not carry the rail name and does not change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rapguit
rapguit merged commit 7ef595b into main Nov 12, 2026
4 checks passed
@rapguit
rapguit deleted the chore/topup-neutral-fixture branch November 12, 2026 22:21
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