Refund eligibility

Decide whether a refund request is in policy from a sealed charge receipt, a refund request, and a refund policy, emitting only a bounded refund proposal.

You’re reading version sha-ff9efb921994. Go to the current version

Overview

Decide whether a requested refund is allowed by a sealed charge receipt and a simple policy. The skill reads a charge receipt summary, a refund request, and a policy, then emits a bounded refund_proposal only when the request is clearly eligible. It never performs the reversal, calls a payment rail, signs a money movement, or mutates external state.

SKILL.md

Refund Eligibility

Decide whether a requested refund is allowed by a sealed charge receipt and a simple policy. The skill reads a charge receipt summary, a refund request, and a policy, then emits a bounded refund_proposal only when the request is clearly eligible. It never performs the reversal, calls a payment rail, signs a money movement, or mutates external state.

When to use this skill

Use it before invoking a refund execution skill when support or finance needs a checkable decision packet. The packet explains the eligibility verdict, the remaining refundable amount, the idempotency key that a refund catalog skill can consume, and the exact reason when the request is refused.

When not to use this skill

Do not use it to move money, repair a receipt, override a policy, or invent a charge. If the receipt is unsealed, ambiguous, missing currency or amount, or outside the supported policy shape, the skill escalates instead of guessing.

Procedure

  1. Require charge_receipt, refund_request, and policy.
  2. Accept only charge receipts that expose schema: runx.receipt.v1 and state: sealed.
  3. Extract a charge reference from id, receipt_ref, or charge_ref.
  4. Extract the original amount, already refunded amount, currency, and charge timestamp from explicit fields.
  5. Require refund_request.amount to be positive and in the same units as the charge.
  6. Compute the policy cap as amount * policy.max_pct / 100, then subtract any already refunded amount.
  7. Require the request to be inside policy.window_days, measured from the charge timestamp to refund_request.requested_at, policy.now, or the current time.
  8. Return decision.eligible: true plus refund_proposal only when every gate passes.
  9. Return decision.eligible: false plus escalation and no proposal when a gate fails or the evidence is ambiguous.

Output

The runner emits runx.refund_eligibility.v1 with:

  • summary: short human-readable decision summary.
  • decision: { eligible, reason }.
  • refund_proposal: { amount, currency, charge_ref, idempotency_key, effect } only when eligible.
  • refundable: original amount, already refunded amount, policy cap, and remaining refundable amount.
  • escalation: human review lane and evidence gaps when not eligible or ambiguous.

Example

bash
runx skill ./skills/refund-eligibility \
  --input-json charge_receipt='{"schema":"runx.receipt.v1","id":"runx:receipt:charge-demo","state":"sealed","amount":10000,"currency":"USD","charged_at":"2026-06-01T00:00:00Z","refunded_amount":1000}' \
  --input-json refund_request='{"amount":2500,"reason":"duplicate charge","requested_at":"2026-06-10T00:00:00Z"}' \
  --input-json policy='{"max_pct":50,"window_days":30}' \
  --json

Inputs

  • charge_receipt (required): sealed runx.receipt.v1 charge receipt or receipt summary with amount, currency, and charge time.
  • refund_request (required): object with amount, reason, and optional requested_at.
  • policy (required): object with max_pct, window_days, and optional now.

Published execution profile

The execution profile published with sha-ff9efb921994, shown as its exact bytes.

Runner
  • decide
Profile digestsha256:95a39d750fe7f17be839986649d2a3c91ae91d4eec5d474e64d1a1fdf8fa5ada
skill: refund-eligibility
version: 0.1.1
catalog:
  kind: skill
  audience: public
  visibility: public
  role: canonical
  category: payments
runners:
  decide:
    default: true
    inputs:
      charge_receipt:
        type: json
        required: true
        description: Sealed charge receipt or receipt summary.
      refund_request:
        type: json
        required: true
        description: Requested refund amount, reason, and optional request time.
      policy:
        type: json
        required: true
        description: Refund policy with max_pct, window_days, and optional now.
    steps:
      - id: decide
        tool:
          command: node
          args:
            - run.mjs
        inputs:
          charge_receipt: $input.charge_receipt
          refund_request: $input.refund_request
          policy: $input.policy
        artifacts:
          wrap_as: refund_eligibility_decision
harness:
  cases:
    - name: in-policy-partial-refund-yields-proposal
      inputs:
        charge_receipt:
          schema: runx.receipt.v1
          id: runx:receipt:charge-demo-001
          state: sealed
          amount: 10000
          currency: USD
          charged_at: 2026-06-01T00:00:00Z
          refunded_amount: 1000
        refund_request:
          amount: 2500
          reason: duplicate charge
          requested_at: 2026-06-10T00:00:00Z
        policy:
          max_pct: 50
          window_days: 30
      expect:
        status: sealed
        receipt:
          schema: runx.receipt.v1
      operator_journeys:
        - mode: standalone
          confusors:
            - refund
            - dispute-respond
          request: Decide whether this refund request is in policy.
          expected_outcome: Return only a bounded refund proposal from the charge receipt, request and policy.
        - mode: composed
          request: Continue this refund-eligibility work from evidence already gathered upstream.
          expected_outcome: Return only a bounded refund proposal from the charge receipt, request and policy.
          prior_evidence:
            - The sealed charge receipt and refund request already supplied.
          must_not_repeat:
            - Do not issue the refund.
    - name: excessive-amount-is-refused
      inputs:
        charge_receipt:
          schema: runx.receipt.v1
          id: runx:receipt:charge-demo-002
          state: sealed
          amount: 10000
          currency: USD
          charged_at: 2026-06-01T00:00:00Z
          refunded_amount: 1000
        refund_request:
          amount: 9000
          reason: buyer changed mind
          requested_at: 2026-06-10T00:00:00Z
        policy:
          max_pct: 50
          window_days: 30
      expect:
        status: failure
        receipt:
          schema: runx.receipt.v1
    - name: unsealed-charge-escalates
      inputs:
        charge_receipt:
          schema: runx.receipt.v1
          id: runx:receipt:charge-demo-003
          state: open
          amount: 4000
          currency: USD
          charged_at: 2026-06-01T00:00:00Z
        refund_request:
          amount: 1000
          reason: goodwill
          requested_at: 2026-06-03T00:00:00Z
        policy:
          max_pct: 50
          window_days: 30
      expect:
        status: failure
        receipt:
          schema: runx.receipt.v1

Published package and test evidence.

This exact version passed its recorded harness run: 3 checks passed · 0 failed.

Test result

Harness resultPassed
Tested versionsha-ff9efb921994
Recorded result3 checks passed · 0 failed
Result sourceReported by the publisher (runx_registry_publish)
Suiterunx-harness
Test recorded
Declared cases3
Test recordOpen the recorded run
Inspect receipt referencessha256:173ec4009e346c33e5d03d987cd52bdcca9a37232f44db8af1e6c7159cc88444sha256:061781008d553c400314070f3f98c93ebc8acfa96b75ebec3e6aa3a2f3512ceesha256:8e0bdac02fabf6e39ac28729d983fa274dacf698f9b47f23247f40204613288d

Package identity

Published revisionsha-ff9efb921994
Content digestsha256:ff9efb921994ce2cb7fdb2628b5eb2baf046e3fcd1bd170a5379a96a5fcfa103
SKILL.md digestsha256:0c883cd3e66a76aa7c01cfc30b0b589eabb5e5cae42aa79c29ae41fbf6315cdb
Execution profile digestsha256:95a39d750fe7f17be839986649d2a3c91ae91d4eec5d474e64d1a1fdf8fa5ada
Publisher identityUnverified publisher · zdfgu113
Trust tierCommunityPublished through the registry without publisher verification. This tier is not a code assessment.
Attestations
  • Publisher · Declaredzdfgu113 · 17 Oct 2026
Source provenanceNot published with this version

Version history

  1. sha-ff9efb921994ViewingContent digest sha256:ff9efb921994ce2cb7fdb2628b5eb2baf046e3fcd1bd170a5379a96a5fcfa103
  2. sha-3ec97836dafbContent digest sha256:3ec97836dafb774d9aa2b1839005b495297522990e981953ce4318e861ce506d
  3. sha-24b11619c2e4Content digest sha256:24b11619c2e4c841acab737975ea0782fc7153651d6cd5ebce85e673599f3a2d
  4. sha-c8bbdcf97796Content digest sha256:c8bbdcf977960eb09c22d8bf30433bf73e7dcc10997f75af15bdd6d878b0ce85