Jadpo is experimental and not ready for production. These docs follow the compiler's main branch as of 29 Nov 2026. What's built · Install 0.6.0
jadpo
ReferenceErrors

ErrorsTools · rule

test.contract_refused

On this page

A contract run sent nothing to the provider's sandbox, because a connection it goes through has nothing set, or nothing valid, for its credential or address, or its environment chooses live.

Area 14, Tools; not declinable; the next step is usually the human's.

Why Jadpo refuses it

jadpo test --kind contract runs the tests that reach a provider against its sandbox: each call a test's fakes: doesn't script goes through the connection, with the credential, environment and address jadpo dev reads, from the environment and then .env.local. It is the run that shows the provider still answers as the package's types say, so it has to reach the real sandbox with a real key.

A connection whose environment chooses live would send the tests' calls to the provider's live API, where a call can cost money or change real data, and a connection with nothing set would send a stand-in key, whose refusal proves nothing. So the run checks every connection it goes through before it sends anything. Jadpo won't choose the environment or set a key for you: which of your accounts at the provider the calls reach is yours to decide.

What it looks like

A courier desk tracks parcels through its own integration with Acme Couriers, and one test reaches it:

config.jadpo:

example
config {    couriers_api_key: Text {        secret: true    }    couriers_environment: ProviderEnvironment {        default: ProviderEnvironment.sandbox    }}

app.jadpo:

example
application {    connections: {        couriers: {            package: AcmeCouriers.v1            domains: [shipping]            credential: config.couriers_api_key            environment: config.couriers_environment        }    }}

domains/shipping/actions/track_parcel.test.jadpo:

example
use shared/providers/acme_courierstest "a parcel's status comes back" {    var lookup: AcmeCouriers.ParcelLookup = AcmeCouriers.ParcelLookup {        parcel_id: "P1"    }    var parcel: AcmeCouriers.Parcel = track_parcel(lookup)    assert parcel.status != ""}

Nothing on this machine sets COURIERS_API_KEY, so the run is refused before anything is sent:

shell
jadpo test --kind contract
jadpo testtests not run: 1 error, 9 files

error couriers has nothing set for the provider's sandbox

reason
A contract run sends its cases' calls through couriers to the provider's sandbox, with the settings jadpo dev reads, and nothing sets COURIERS_API_KEY, so only a stand-in would be sent.
next
Set COURIERS_API_KEY in .env.local, or in the job's environment, for the sandbox, then run it again (human)
rule
test.contract_refused
help
https://jadpo.dev/docs/errors/test.contract_refused

(human) at the end of the next: line tells your coding agent to stop and ask you which fix you want, because the choice is yours to make: it decides which of your accounts at Acme the tests' calls are made with.

A connection whose environment chooses live is refused too, whatever else is set:

shell
printf 'COURIERS_API_KEY=sandbox_key\nCOURIERS_ENVIRONMENT=live\n' > .env.localjadpo test --kind contract
jadpo testtests not run: 1 error, 9 files

error couriers's environment is live

reason
A contract run sends its cases' calls to the provider's sandbox, never its live API, and COURIERS_ENVIRONMENT chooses live.
next
Set COURIERS_ENVIRONMENT to sandbox for the run, then run it again (human)
rule
test.contract_refused
help
https://jadpo.dev/docs/errors/test.contract_refused

How to fix it

If the run should reach Acme's sandbox, set the sandbox's key, and choose the sandbox, where you run it:

shell
jadpo config set couriers_api_keyjadpo test --kind contract

jadpo config set asks for the key without showing what you type and saves it in .env.local, which is never committed. In a scheduled job, give COURIERS_API_KEY from the job's secrets and COURIERS_ENVIRONMENT=sandbox. The test's call then goes to https://sandbox.acme-couriers.example.

If you meant to run the tests without reaching Acme, leave out --kind contract:

shell
jadpo test

Every provider call is then answered by its package's fake, and nothing leaves your machine.

Markdown for agents: /docs/errors/test.contract_refused.md.Built from Jadpo's main branch at commit 9080dc3.