Repository navigation
webapi-test 0.7.0.0: what a move's host is told, and what it may say (zenbridge #2715) - #55
Merged
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this is
webapi-test0.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
settleandobservetake aMovePlayed(the move's name, where it was written, its own steps in order). A step is aMoveStep: 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.verdictis given the move, what was observed and every check's record, and answers aMoveVerdict: a reason the move is inconclusive, and evidence. The engine keeps the order:inconclusive, neverpassed.Evidenceis a kind of the host's own, one line, and an optional JSON detail carried as it is. It changes no outcome."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.caseBeginsis called once before the first step of every play: a generated case, a narrowing try, a regression case replayed.What breaks
MoveHost:settleandobservetake the move first, and there are two new fields. Build a host fromdefMoveHostby record update, and a field added later breaks nothing.StepRecordandRunTracegainevidence.newWebApiSessionsCxtreplacesinitWebApiSessionsCxtandtracingCxt.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).movessuite, 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