Skip to content

webapi-test 0.7.0.0: what a move's host is told, and what it may say (zenbridge #2715) - #55

Merged
mageshb merged 2 commits into
masterfrom
feature/2715-move-host
Nov 18, 2026
Merged

mageshb merged 2 commits into
masterfrom
feature/2715-move-host

Conversation

@mageshb

@mageshb mageshb commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

What this is

webapi-test 0.7.0.0. A scenario's host (MoveHost) could settle a move, observe, and run checks of its own, and was told nothing about the move it was asked about. This gives it four things, none of which names a host's own ideas (zenbridge #2715, the third MR's engine part).

The four abilities

  1. The host is handed the move as it was played. settle and observe take a MovePlayed (the move's name, where it was written, its own steps in order). A step is a MoveStep: its kind, where it was written, its operation, a call's request as it went out and what the step gave. These are the values the engine held, not the trace's text, so nothing is clipped, masked or rendered. A host reads them by a cast: sentAs @POST @SomeRoute step, answeredAs @SomeAnswer step. No recorder is needed.
  2. The host has its word once the checks have run. verdict is given the move, what was observed and every check's record, and answers a MoveVerdict: a reason the move is inconclusive, and evidence. The engine keeps the order:
    • a check that failed fails the case, and the host's reason stays with the failure;
    • when every check held and the host gave a reason, the move is inconclusive and its case is discarded. Its settle step keeps what its checks left and is marked.
    • A regression case that ends this way on replay reads inconclusive, never passed.
  3. The host attaches evidence to a move. Evidence is a kind of the host's own, one line, and an optional JSON detail carried as it is. It changes no outcome.
    • It is kept on the move's settle step ("evidence" in the step's JSON), so it reaches a sink, the first failure, the narrowed case, a replay and a cut case with the step.
    • A failing move's evidence is listed in the failure's text under its failed checks.
    • The run's trace counts it by kind over the cases that counted, with the first three in full.
    • The record bounds it: a line at 4,000 characters, a detail at 32,768 bytes, 100 items a move.
  4. The host is told that a case begins. caseBegins is called once before the first step of every play: a generated case, a narrowing try, a regression case replayed.

What breaks

  • MoveHost: settle and observe take the move first, and there are two new fields. Build a host from defMoveHost by record update, and a field added later breaks nothing.
  • StepRecord and RunTrace gain evidence.
  • newWebApiSessionsCxt replaces initWebApiSessionsCxt and tracingCxt.

Tests and cost

  • moves: 68 checks, 33 of them new, in four new sections (a move handed to its host; the host's word; evidence; a case's beginning).
  • Each new behaviour was switched off in turn, 14 mutations in all, and each is caught by a check.
  • A run that uses none of this costs what it did: the 0.6.0.0 moves suite, its host ported by two lines, allocates +0.09% at -O0 and -0.11% at -O2 against 0.6.0.0.

The changelog has the detail.

🤖 Generated with Claude Code

mageshb and others added 2 commits November 19, 2026 03:02
…wn steps typed (zenbridge #2715)

- MovePlayed (a move's name, where it was written, its own steps in the
  order they ran) and MoveStep (kind, where written, operation, the request
  as it went out, the value). A step is the values the engine held when it
  ran: nothing rendered, clipped or masked, and no recorder needed. The
  host reads them by a cast to its own types: sentAs, answeredAs.
- MoveHost: settle and observe take the move as it was played, the same
  value each time, so a host keeps nothing between its calls about a move.
  hostChecks is as it was. BREAKING for a host: settle = \_ budget -> ...,
  observe = \_ -> ...; build one from defMoveHost.
- A move's steps are every call (its request as it went out, with its
  fresh values and files as the step made them; an expected refusal hands
  what its caller made of the error), every effect step (no request: the
  engine never holds its input as a value) and every fresh value its body
  ran. Its begin and settle steps, the engine's own steps (a step that
  only moves the model, a context switch, a model's extended action) and
  the steps outside a move are not among them. A step that fails ends its
  case before the settle step, so every step handed over has its value.
- The steps are kept in the case's own context, made for each play of a
  case: newWebApiSessionsCxt (in IO) replaces initWebApiSessionsCxt and
  tracingCxt. A move's begin step opens the cell, its settle step reads it
  to settle and again to observe, then closes it.
- moves: a section with an app of one route. The host is handed each move
  by its name, with its own steps in order and nothing else; a call's
  request and answer are read back by their types; the second move of a
  case has only its own steps; observe gets what settle got; the same with
  a recorder listening and with none.

No version or changelog yet: they go with the rest of this change.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…aches evidence, and is told a case begins (zenbridge #2715)

Three more things a scenario's host could not do, beside the move it is
now handed. None names a host's own ideas.

* verdict: once a move's checks have run, the host is given the move as it
  was played, what was observed and every check's record, and answers a
  reason the move is inconclusive and the evidence it noted (MoveVerdict).
  The engine keeps the order: a check that failed fails the case and the
  host's reason stays with the failure; when every check held and the host
  gave a reason, the move is inconclusive and its case discarded. Its
  settle step keeps what its checks left and is marked. A regression case
  that ends so on replay reads inconclusive, never passed.
* Evidence (a kind of the host's own, one line, an optional JSON detail):
  kept on the move's settle step, listed in a failure's text under the
  failed checks, counted by kind over the cases that counted
  (RunTrace.evidence: cases, moves, the first three in full), and bounded
  (a line at 4,000 characters, a detail at 32,768 bytes, 100 items a
  move). A reason the host gave when a check failed is one more item, of
  the kind "otherwise inconclusive".
* caseBegins: called once before the first step of every play (a
  generated case, a narrowing try, a regression case replayed).

The settle step's postcondition has a path of its own, so no other step
pays for the host's word.

Breaking: MoveHost gains verdict and caseBegins (build a host from
defMoveHost); StepRecord and RunTrace gain evidence.

moves: 68 checks (24 new). Ten mutations of the new code are each
caught. The 0.6.0.0 suite with its host ported by two lines allocates
+0.09% at -O0 and -0.11% at -O2 against 0.6.0.0.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@mageshb
mageshb merged commit fc798f8 into master Nov 18, 2026
0 of 5 checks passed
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