Docs/Operations
Guide source3 min read

Test the promise at the boundary

Choose checks that establish meaningful behavior, including denied effects and real consumer imports.

Download Markdown ↓
Source and verification context ⌄

Source-guided

Examiner la source ↗

Repository links may require access. Source inspection is separate from a clean public-package installation.

AN INTERACTIVE READING MAP

Get the shape of this guide.

Move through the ideas, inspect their relationships, or make a focused reading path. The complete guide stays below.

SÉQUENCE DE LECTUREComprendre les liens entre les idées
Choose a point to look closer
01 / Section du guide

Give each test one question

An operation has several boundaries, and one green check cannot answer every question about them. Separate declaration validity, business behavior, adapter behavior and external consumption so failures tell you where to look.

Lire le contexte à l’appui

For a first integration, keep the matrix small. Choose the success case your tutorial promises and the failure that demonstrates its most important protection.

Explore a section, then continue with the complete article below.

1 / 4

Give each test one question

An operation has several boundaries, and one green check cannot answer every question about them. Separate declaration validity, business behavior, adapter behavior and external consumption so failures tell you where to look.

For a first integration, keep the matrix small. Choose the success case your tutorial promises and the failure that demonstrates its most important protection.

VérifierQuestion it answersUseful assertion
Contract/schemaDoes the declared shape behave as intended?Required values accepted or rejected
HandlerDoes the business rule hold?Expected state transition and outcome
RegistryDoes configured execution enforce the boundary?Denied request leaves handler count at zero
TransportDoes the actual API/tool expose it correctly?Wire result and context mapping
ConsumerCan users install and import this version?Clean external project succeeds
Choose the check that answers the question.Examine the support · 3 ways to look closer

One green check cannot establish every boundary. Connect the intended claim with the smallest observation that can support it.

What do you need to establish?
UNE AFFIRMATION À EXAMINER

Observe a denied call through the real entry point.

The operation explicitly requires approval, and the request otherwise has valid input.

Ce que cela soutient

A disposable counter or fake outbox can reveal whether the handler was entered.

Ce qui reste ouvert

A hidden button or mocked always-allow verifier cannot establish the guard.

CE QUI VOUS AIDERAIT À DÉCIDER

Omit the required receipt, inspect the adapter’s canonical failure and verify the effect remains untouched in your actual test.

Where this explanation comes from

An authored situation, grounded in the linked source guides. Choosing a case explores its expected responsibilities; it does not execute an operation.

Test denied effects explicitly

Use a handler with a visible disposable effect, such as a local counter or fake outbox. Supply otherwise valid input so the request reaches the guard you are testing. Missing approval should leave that effect untouched.

Invoke the adapter used by your users, not only a private helper. For an API-plus-MCP claim, exercise both real entry points and inspect their canonical failure information.

Test the risks of your implementation

A schema can validate input while a handler still produces the wrong state. Add tests for business invariants, resource ownership and the failure paths of any provider you bind. Verify idempotency or retry behavior where your application depends on it.

An invalid output is detected after handler execution. If an effect must be atomic with a record of the result, test the host's transaction or outbox implementation rather than assuming output validation supplies rollback.

Report the scope of the result

Repository tests use the repository's dependency graph. Packed-artifact checks test built tarballs. An anonymous registry consumer verifies that an external user can fetch and execute the published version. Keep these results separate.

For documentation, record the source or package version and exact scenario. A metadata smoke test is useful for an example catalogue, but it should not be described as a successful end-to-end workflow.

See it in an example.

Execution / Intermediate

Stop a write before it runs

Control side effects

Trace a REST request through an approval gate and inspect the zero-handler-call denial assertion.

  1. Declare the boundary
  2. Inspect the denied request
  3. Inspect the approved request

Ce que montre la sourceThe inspected denial test asserts that the handler is not invoked when a required receipt is missing.

Ne démontre pasA fresh successful execution in this review.

Inspect the walkthroughBehavior · proof and limits · source checks

Follow the source behavior

A synthetic rest.approval.protected command has write and external-side-effect declarations. The fixture sends a request first without approval evidence, then with a receipt bound to the operation and input.

  1. Declare the boundary

    The fixture defines a command with execution.effects set to write and external-side-effect, and execution.approval.required set to true.

  2. Inspect the denied request

    The first test binds a handler with a call counter. Without a receipt, it expects HTTP 403, APPROVAL_REQUIRED with reason missing_receipt, and calls equal to zero.

  3. Inspect the approved request

    The second test provides a receipt through createFetchHandler's approvalReceipt option and an approval port with a controlled clock. The response is expected to be 200 with value ran.

  4. Apply the pattern to your side effect

    Replace the synthetic handler with your operation and trusted receipt source. Add tests for the exact subject, operation, input, expiry, and effect requirements your application uses.

What this example establishes
Ce que montre la source
  • The inspected denial test asserts that the handler is not invoked when a required receipt is missing.
  • The approved case adapts receipt evidence outside the operation input.
  • The fixture has an inspectable positive and negative request path.
Ne démontre pas
  • A fresh successful execution in this review.
  • An end-to-end human approval UI or trusted production receipt issuer.
  • A real external write: the approved handler only returns a fixture value.
Reproduce the source checks

The source assertions require a 403 denial before invocation and a 200 response for the controlled valid-receipt case.

Répertoire de travail packages/platform/delivery/contracts-runtime-server-rest

bun test src/rest-approval-enforcement.test.ts

Test source inspected; not executed here.

UI / Intermediate

Capture now, complete when ready

Build an interface

Use form contracts to accept a minimal intake while keeping missing readiness fields visible.

  1. Choose the form contract
  2. Inspect minimal intake
  3. Inspect conditional validation

Ce que montre la sourceThe inspected fixture separates acceptance from completion status.

Ne démontre pasProduction form storage, submission delivery, or authentication.

Inspect the walkthroughBehavior · proof and limits · source checks

Follow the source behavior

A customer intake can begin with a name. In the fixture, a quick capture is accepted while email, phone, and consent remain completion debt. A richer profile can then determine whether the record is ready for the next workflow.

  1. Choose the form contract

    Inspect all-fields, progressive-steps, and customer-projection forms. The package includes field kinds, conditional rules, sections, and step layouts.

  2. Inspect minimal intake

    The quick-capture fixture contains a customer ID and display name. The smoke test expects capture to succeed and completion to remain incomplete with email, phone, and consent debt.

  3. Inspect conditional validation

    Another test builds Zod validation with relations and expects a missing repeated contact value to be reported at contacts[0].value.

  4. Use the public proof map

    The proof-config export lists docs, sandbox, forms, and UI entrypoints. Adapt through the supported exports, then supply your own persistence and submission behavior.

What this example establishes
Ce que montre la source
  • The inspected fixture separates acceptance from completion status.
  • The source tests inspect field coverage, step layout, conditional validation, and public exports.
  • The public preview is deterministic fixture state with no required backend or credentials.
Ne démontre pas
  • Production form storage, submission delivery, or authentication.
  • A production renderer for every host application.
  • A PII hint automatically implementing a privacy control.
Reproduce the source checks

The source assertions cover quick-capture acceptance, incomplete readiness, conditional validation, and supported public entrypoints.

Répertoire de travail examples/form-showcase

bun run smoke

Commands and tests inspected; not executed here.

Continue from here.

Guides

Expose one operation through API and MCP

3 min read

Share the registered behavior while keeping authentication, transport formats and evidence explicit.

Look inside the guideOpening context · complete reading path

Start from one registry

Register the operation and bind its handler once. The REST createFetchHandler and MCP registerMcpTools implementations both call OperationSpecRegistry.executeResult. That shared invocation path is the useful connection between an API request and an agent tool call.

Work through the guide
Concepts

What the runtime checks

3 min read

Follow a call from transport context to handler execution, then understand the limits of each guard.

Look inside the guideOpening context · complete reading path

Follow the execution boundary

A registered call resolves an operation and its bound handler, prepares the input and execution context, invokes the handler, and validates the returned value. The exact checks depend on the contract and the ports supplied by the host.

Work through the guide
Début

Installation and release channels

3 min read

Match documentation to the code you actually consume, then verify a small external project.

Look inside the guideOpening context · complete reading path

Choose the code you are evaluating

There are two useful starting points: consuming published packages in your application, or studying a checked-out repository snapshot. Select one explicitly. Instructions for a monorepo can rely on workspace dependencies and repository scripts that a package consumer does not have.

Work through the guide
Next: Version contracts and documentation together →
Votre vue

Make room for your context.

Shape the presentation around this moment. You can change it whenever you need.

Votre contexte

The different parts of you

Choose a starting point

Un mélange utile de contexte, de visuels et de guidage discret.

Tune each dimension
Each dimension can change independently. Product permissions and available actions stay unchanged.

Support the way you begin and return

Tune your support

Confort de lecture

Choisir votre langue

La langue de l’interface change uniquement le texte. Les marchés, les prix et les parcours conservent leurs propres paramètres.

Couverture des traductions

Une partie du contenu est affichée en anglais.

Navigation151
Graphe616
Catégories378
Portfolio833
Exemples2 035
Aperçu de la source1 542

D’autres traductions seront ajoutées à mesure que le contenu sera relu.

Cette préférence est enregistrée dans ce navigateur.

Rechercher sur le site

Des points de départ utiles

Aucun résultat. Essayez une expression plus courte, un nom d’opération ou un autre périmètre de recherche.

UN PEU DE PLACE POUR EXPLORER

Trouvez quelque chose à explorer.

Ouvrez un aperçu détaillé sur cette page, essayez une autre perspective ou suivez le détail vers sa propre page.

Fonctionnement des aperçus et des commandes
01

Regarder avant de partir

Survolez un lien ou sélectionnez-le avec Tab pour voir un aperçu. Cliquer sur le lien d’origine ou appuyer sur Entrée ouvre toujours sa destination.

02

Rester dans le contexte

Entrez dans l’aperçu pour explorer ses sections. Depuis un lien sélectionné, utilisez Alt + ↓ pour y entrer au clavier. Échap le ferme.

03

Ouvrir les possibilités

Les lignes dépliables, les choix de perspective et les commandes mises en évidence révèlent davantage. Votre vue adapte le confort de lecture et le contexte exploré.

Un bouton séparé pour voir de plus près

Affichez de petits boutons d’aperçu à côté des liens quand l’espace le permet. Touchez l’œil pour examiner ou le lien pour y aller directement. Ce choix reste dans cet onglet.

Aucun historique de navigation n’est collecté. La réduction des animations suit votre appareil et Votre vue.