Repository navigation
webapi-test 0.4.0.0: a scenario's moves, the prediction, a move judged against what the host observes (zenbridge #2714) - #52
Merged
Conversation
…t, and moves judged against what the host observes (0.4.0.0, zenbridge #2714) A scenario's moves, generic, for the scenario language of zenbridge #2714 (Test.WebApi.Moves, Test.WebApi.Prediction): * A move is written as DL: its things picked by the stage they are predicted at (pickAt), a step that begins it (MoveBegin), its own steps, and a step that ends it (MoveSettle). anyMoves n draws moves one after another, n on average, each by its weight among the moves allowed at that point: quickcheck-dynamic's own weighted choice. Each draw opens with a pick of nothing, so that past a case's size the generator stops instead of running on to the step limit. * ApiState gains the prediction: the things a scenario tracks, each with its track, predicted stage, the moves made on it, the labels its draws gave and its value. A Track declares the stages, the refusal stages and the platform's answers; the first answer whose when holds is taken. A thing at a stage is also recorded under the class track@stage. * A move's end: the host settles what the move caused within the move's budget and observes it (MoveHost, WebApiGlobalStateModel.appMoveHost; defMoveHost settles at once). The property's Judge holds every thing against the observation (its observed stage, the checks at its stage, the checks after the move, the checks across things), and the host's own checks run. A failure names the check and the thing. * A move that does not settle, or cannot be observed, is inconclusive: its case stops and QuickCheck discards it; the trace says why. * Narrowing goes through the program (narrowThroughProgram, for propDL and propDLTraced). quickcheck-dynamic keeps a shorter case's own steps, checked against the program only by Eq (a call's operation and label), so a step under a narrowed pick kept the request it was drawn with. Each shorter case is now made again from its picks, as a regression case is replayed; every pick is offered narrowed (quickcheck-dynamic narrows a run of picks only from its first); a move is kept or dropped whole. * The trace: step kinds begin and settle, StepRecord.inMove and .inconclusive, CheckRecord.subject, CaseOutcome Inconclusive, ReplayOutcome ReplayInconclusive; a case's moves and the move counts list a scenario's moves rather than their steps. * AnyVal moves to Test.WebApi.Val (re-exported as before). * A test suite, moves: two moves against a toy platform that does not acknowledge a replacement 850 (narrowed to two whole moves, the failure named, replayed to the same failure, passing once fixed; inconclusive when nothing settles). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011wn1pGkP2oCTsWbhEafdF2
…ridge #2714)
Move.body gives a MoveBody { values, labels, uses }: the values of the
things it makes, the labels its draws said, and the variables those
values refer to beyond their own (a value the engine cannot look into,
a host's Dhall value, say). The settle step keeps them (MoveEnd.uses),
so narrowing never keeps a move whose things refer to a step it
dropped.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011wn1pGkP2oCTsWbhEafdF2
A host's own step — a partner's document drawn from its spec, enveloped and uploaded — makes several calls as the run's context, so the effect is LookUp -> WebApiSessions apps (Either Text res), was IO. An IO effect lifts with liftIO (the moves suite's toy platform does). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011wn1pGkP2oCTsWbhEafdF2
…714) FreshValue begins a step of its own, so the session's one-token-per-label- per-step cache no longer hands a second draw of the same label the first draw's token. Found on a sandbox: two orders a scenario's move made in one case had one "fresh" PO, and the platform saw the second order as the first one's replacement. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011wn1pGkP2oCTsWbhEafdF2
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.
Zenbridge #2714 (Preflight 3, the scenario language): the generic engine half.
pickAt), a step that begins it and one that settles it;anyMoves ndraws moves by weight among those allowed (quickcheck-dynamic's weighted choice); narrowing keeps or drops whole moves.Judgeholds the prediction against what the host observes (MoveHost: settle within a budget, observe, its own checks). A move that does not settle is inconclusive: the case is discarded and the trace says so.Test:
moves(a toy platform, 15 checks). Integrated and run on a sandbox from zenbridge.🤖 Generated with Claude Code
https://claude.ai/code/session_011wn1pGkP2oCTsWbhEafdF2