Skip to content

webapi-test 0.6.0.0: a recorder's sink, each step as its checks have run and each case's close (zenbridge #2741) - #54

Merged
mageshb merged 1 commit into
masterfrom
feature/2741-run-sink
Nov 18, 2026
Merged

mageshb merged 1 commit into
masterfrom
feature/2741-run-sink

Conversation

@mageshb

@mageshb mageshb commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

webapi-test 0.6.0.0, for zenbridge #2741 (a Preflight run followed while it plays): a recorder hands what it records to a sink, as it happens.

A recorder's sink (newRecorderTo, TraceEvent).

  • StepEnded phase step: each step once, when it is final.
  • CaseEnded phase close: a play closed, after its last step. CaseClose has its outcome, the step it failed at or reached, why, its moves and the labels that held. A case QuickCheck discards closes too.
  • Phase tells a replayed regression case, a generated case and a narrowing try apart.
  • A recorder without a sink records as before.

A step is final as soon as its checks have run.

  • The problem: a step's record was final only when the next step was pushed or its case closed. A move's own step would have reached a reader only after the move's settle step, which can wait minutes.
  • The fix: the state model seals a step (sealStep) after its postcondition, or after its inconclusive mark, and the sink is handed it then.
  • The rest: a step whose checks never ran (it failed, or its case was cut) is handed over as its case closes.

The sink is called on the case's thread, with asynchronous exceptions masked.

  • An event is handed over whole or not at all, so a cut can't lose a step or hand it twice.
  • It must neither block nor throw: it puts the event on a queue. webapi-test-dhall's run does that.

A regression case cut while it replays is recorded (breaking: ReplayOutcome gains ReplayCut).

  • replayCasesDL marks the replay it is in (beginReplay).
  • closeCut notes it among the replays as cut, with the steps it had made, and RunTrace.cut holds it (replay k).

A regression case is replayed once. A replay QuickCheck discarded (a move that did not settle) was played again, up to ten times, though it is the same case each time.

Also: reached says where a case that stopped while it was open got to (its last step, and the move it was in).

Tests: moves 35/35 (23 before), adding:

  • every step once and in order, each play closed after its last step;
  • a step handed over as its checks left it, and a move's own step before its settle step begins;
  • the first failing case, the narrowing tries and the narrowed case as the trace has them;
  • a replayed case by its phase;
  • a cut case's steps, then its close.

Cost without a sink: the suite's old sections allocate 0.28% more (-O0).

🤖 Generated with Claude Code

…run and each case's close (zenbridge #2741)

- A recorder hands what it records to a sink as it happens (newRecorderTo,
  TraceEvent): StepEnded, a step once it is final, and CaseEnded, a play's
  close after its last step (CaseClose: outcome, the step it failed at or
  reached, why, its moves, its labels). Phase tells a replayed regression
  case, a generated case and a narrowing try apart.
- A step is final as soon as its checks have run: the state model seals it
  (sealStep) after its postcondition, or after its inconclusive mark, so a
  move's own step is handed over before its settle step begins, not when
  the next step is pushed. A step whose checks never ran (it failed, its
  case was cut) is handed over as its case closes.
- The sink is called on the case's thread with asynchronous exceptions
  masked: an event is handed over whole or not at all. It must neither
  block nor throw. A recorder without a sink records as before.
- A regression case cut while it replays is recorded: ReplayOutcome gains
  ReplayCut, replayCasesDL marks the replay it is in (beginReplay), closeCut
  notes it among the replays and RunTrace.cut holds it.
- A regression case is replayed once: a replay QuickCheck discarded (a move
  that did not settle) was played again, up to ten times.
- reached: where a case stopped while it was open got to.
- moves: every step once and in order, each play closed after its last
  step; a discarded case closes too; a step as its checks left it; a move's
  own step handed over before its settle step begins; the first failing
  case, the tries and the narrowed case as the trace has them; a replay by
  its phase; a cut case's steps, then its close.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@mageshb
mageshb merged commit 2512c75 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