Skip to content

webapi-test: regression cases — a narrowed case written out, replayed against the program as it is now (zenbridge #2713) - #51

Merged
mageshb merged 1 commit into
masterfrom
feature/2713-regression-cases
Nov 15, 2026
Merged

mageshb merged 1 commit into
masterfrom
feature/2713-regression-cases

Conversation

@mageshb

@mageshb mageshb commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

This is part of Zenbridge #2713 (Preflight 2: regression cases, with exact replay). It builds on #50's trace.

webapi-test 0.3.0.0

A failing run's narrowed case can be kept and played first by a later run, against the program as it is then.

  • The case (Test.WebApi.Case, format 1, JSON) is quickcheck-dynamic's own test case: its picks and steps, in order.
    • A step the program writes (a rule, a fresh value, glue) is kept by its kind, trail and operation. The replay makes it again from the program.
    • A step drawn by anyActions is kept by its operation, the positions its generation drew, and the earlier steps its request refers to, by path.
    • A fresh value is never kept. It's made again on replay, and every step that shared it shares the new one.
    • The trace's narrowed and first_failure records carry the case.
  • Replay (Test.WebApi.Replay). replayTest walks the program's formula: each quantifier gets the case's next pick, and each step is checked against the case's next move.
    • A case may end before the program does: narrowing cuts a test to a prefix, and the replay stops there.
    • When the program no longer plays the case, the replay says why: a move gone or changed, a pick drawn at another type, or a drawn move the state no longer offers.
    • replayCasesDL plays each case once, before the property draws any of its own, and adds the result to RunTrace.replays: passed, failed at a move, or cant_replay.
  • Recording. propDLTraced records through forAllDLRecorded, which is quickcheck-dynamic's own generation and narrowing with each test handed to the property. That needs runDL, which quickcheck-dynamic doesn't export. This branch pins byteally/quickcheck-dynamic byteally-4.0.1 (4.0.1.1); the upstream PR is Export runDL input-output-hk/quickcheck-dynamic#104.
  • Breaking changes:
    • ApiGenM keeps the positions it draws (runApiGenMDrawing) and can draw them again (runApiGenMRedrawing).
    • WebApiGlobalStateModel gains appRedraw (use noRedraw for a model that never draws).
    • Val gains varLeaves and repointVal, and GValRep gains gTraverseLeaves.

Verified through webapi-test-dhall's parity suite (11 tests) and Zenbridge's suites and gates. On the tbe54 sandbox:

  • the preflight translation suite's narrowed case replays to the same failure, and passes against the fixed suite;
  • the e2e partners suite's first failing case replays to the same failure. That case has 12 drawn moves and 2 position picks; each drawn move is drawn again and sent, and its links resolve to the replay's own steps.

🤖 Generated with Claude Code

https://claude.ai/code/session_011wn1pGkP2oCTsWbhEafdF2

… against the program as it is now (0.3.0.0, zenbridge #2713)

A failing run's narrowed case can now be kept and played first by a
later run (Test.WebApi.Case, Test.WebApi.Replay):

* The case is quickcheck-dynamic's own test case: its picks and steps
  in order. A step the program writes is kept by its kind, trail and
  operation, and the replay makes it again from the program. A drawn
  step (anyActions) is kept by its operation, the positions its
  generation drew (ApiGenM now keeps them) and the earlier steps its
  request refers to, by path (Val.varLeaves). A fresh value is never
  kept: it is made again, and every step that shared it shares the new
  one. The trace's narrowed and first_failure cases hold it as JSON.
* replayTest walks the program's formula, giving each quantifier the
  case's next pick and checking each step against the case's next
  move. A case may end before the program does (narrowing cuts a test
  to a prefix), and the replay stops where it does. When the program
  no longer plays the case, it says why: a move gone or changed, a
  pick of another type, a drawn move the state no longer offers.
  replayCasesDL plays each case once, before the property draws its
  own, into RunTrace.replays (passed / failed at a move / cant_replay).
* propDLTraced records through forAllDLRecorded: quickcheck-dynamic's
  generation and narrowing, with each test handed to the property. It
  needs runDL, which byteally's quickcheck-dynamic fork exports
  (4.0.1.1, pinned here; upstream input-output-hk/quickcheck-dynamic#104).
* WebApiGlobalStateModel gains appRedraw (noRedraw); a drawn action is
  stamped with its operation (stampDrawn).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011wn1pGkP2oCTsWbhEafdF2
@mageshb
mageshb merged commit 7557407 into master Nov 15, 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