Skip to content

Every advisor transport is held to one contract — typed failures, deadlines, cancellation, normalised answers, reported usage, redacted secrets — proven against fakes with no network, model or credential

Whatever an advisor is — an API, a client tool, a local runtime, a mesh peer — talking to

declared statusdeclared status: guaranteed Declared deterministic and blocking, implemented, and naming the behavioural test that is to prove it. Whether a recorded run supports it is the evidence verdict, shown beside it.

recorded evidencerecorded evidence: not run Declared guaranteed, and not supported by a recorded run: the test is named, and no passing run of the current inputs is recorded. how evidence is recorded

node --test scripts/lib/advisors/contract.test.mjs; the case refuses a run of fewer tests than the suite holds.

What it means

Whatever an advisor is — an API, a client tool, a local runtime, a mesh peer — talking to it ends in one of the same results: a normalised answer, or a typed failure (timeout, rate_limited, auth_failed, malformed, empty, unavailable, cancelled, error) with a diagnostic that carries no secret. Provider quirks stop at the adapter.

How it works

scripts/lib/advisors/contract.mjs defines the failure type, the classification of HTTP statuses and process exits, the prompt (evidence, the executor's hypothesis and prior advice marked as opinions), the normalisation of an answer, and consultOne, which runs an adapter under a deadline and a cancellation signal and turns any failure into a result. contract.test.mjs runs every adapter against a fake fetch or a fake process.

How to see it

node --test scripts/lib/advisors/contract.test.mjs

test/cases/731_advisor_transport_contract.sh runs the suite with no credential in the environment.

What it does not cover

It does not prove a live vendor behaves as the fakes do; that is learned at the first consultation and recorded. It does not test a live mesh of two runtimes; the peer adapter is tested against a fake server.

Why it exists

An adapter that throws a vendor's own error into the workflow makes every caller learn that vendor. One contract, tested without the vendor, is what keeps CI free of live models (ADR 0098).

Detail rendered from docs/claims/advisor-transports-share-one-contract.md.

From the statement to the proof

  1. 1 · the public statement

    Every advisor transport is held to one contract — typed failures, deadlines, cancellation, normalised answers, reported usage, redacted secrets — proven against fakes with no network, model or credential

    Made on Reasoning.

  2. 2 · the canonical claim

    advisor-transports-share-one-contractdeclared status: guaranteed in docs/CLAIMS.yaml

    Defined in read it on this site · docs/REASONING.md

  3. 3 · the implementation

    scripts/lib/advisors/contract.mjs

  4. 4 · the test and the scenarios

    Test: test/cases/731_advisor_transport_contract.sh

  5. 5 · the recorded runs

    recorded evidence: not run how evidence is recorded

Verify it yourself

The test runs in a disposable temporary repository and asserts the behaviour, not a string in the source.

from a clone of the repository
bash test/run.sh 731_advisor_transport_contract

Searches the titles and descriptions of every page this site publishes.