Skip to content

webapi-test: a run's trace — a record per move, the narrowing, label and move counts (zenbridge #2712) - #50

Merged
mageshb merged 2 commits into
masterfrom
feature/2712-move-trace
Nov 15, 2026
Merged

mageshb merged 2 commits into
masterfrom
feature/2712-move-trace

Conversation

@mageshb

@mageshb mageshb commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

Zenbridge #2712 (Preflight 1) replaces QuickCheck's counterexample text with a record per move. Two commits:

webapi-session 0.1.1.0: the last answer's body. The session already kept the last answer's status and headers (#49). Both transports now keep its body as well (ClientsState.lastBody, read with getLastResponseBody). beginStep clears it along with the rest. The change is additive.

webapi-test 0.2.0.0: a run's trace, as data (Test.WebApi.Trace, qc-dynamic)

  • One record per step a case played:
    • the request as sent, with fresh values filled, credentials masked and the body clipped;
    • the answer as received: status, body and value;
    • every check by name, whether it held, and why not;
    • the labels that held;
    • the model after the step;
    • the stage before and after (appStageOf; noStage for a model with none).
  • For the run: a line per generated case and per narrowing try (taken when the try still failed), the first failing case and the narrowed one in full, and label and move counts over the generated cases.
  • Phases come from QuickCheck's own callbacks. PostTest runs after every test, narrowing tries included; PostFinalFailure runs on the narrowed case. propDLTraced records a property. propDL records nothing, as before.
  • Checks by name. A step's postcondition is now a list of named checks (andCheck): the script's postcondition, each ensures and each refutes. Every check runs. Before, only the first failure was reported.
  • andClassify labels a step's case through QuickCheck's classify.
  • setStep/StepInfo record where a step was written. EffectCall gains a field for it, which is a breaking change, hence the major bump.

Consumers:

  • dhall-do-api (the classify field, urTrace);
  • webapi-test-dhall (runPlanText returns the trace);
  • dhall-do-mcp (plan_run).

Zenbridge pins all three together with this branch.

Verified:

  • through a Zenbridge worktree that builds these branches: cabal build all --keep-going is clean;
  • webapi-test-dhall's parity suite reads the trace of a passing and a failing run;
  • a real preflight translation run on a sandbox returned the trace, and its narrowed case could be read without the text.

🤖 Generated with Claude Code

https://claude.ai/code/session_011wn1pGkP2oCTsWbhEafdF2

mageshb and others added 2 commits November 15, 2026 20:46
… (0.1.1.0, zenbridge #2712)

A run's trace shows each step's answer as received; the session kept the
last answer's status and headers (#2377) but not its body. Both transports
now keep the body too (`ClientsState.lastBody`), cleared with the rest by
`beginStep`; `getLastResponseBody` reads it. Additive: `testClientWith`
keeps its shape, `testClientRawWith` (internal) answers the body as well.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011wn1pGkP2oCTsWbhEafdF2
…and move counts (0.2.0.0, zenbridge #2712)

QuickCheck's counterexample text was the only record of a run. A
`Recorder` (`Test.WebApi.Trace`, qc-dynamic) now keeps it as data:

* one record per step a case played: the request as sent (fresh values
  filled, credentials masked, the body clipped), the answer as received
  (status, body, value), every check by name with whether it held and why
  not, the labels that held, the model after the step, the stage before
  and after (`appStageOf`, `noStage` for a model with none);
* a line per generated case and per narrowing try (`taken` when it still
  failed), the first failing case and the narrowed one in full, and the
  label and move counts over the generated cases.

The cases close through QuickCheck's own callbacks: `PostTest` after every
test, narrowing tries included, `PostFinalFailure` on the narrowed case.
`propDLTraced` records a property; `propDL` records nothing, as before.

A step's postcondition becomes a list of named checks (`andCheck`; the
script's postcondition, each `ensures`, each `refutes`) and every check
runs: before, the first failure was the only one reported. `andClassify`
labels a step's case through QuickCheck's `classify`. `setStep` says where
a step was written (`StepInfo`: its trail, summary and operation);
`EffectCall` carries one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011wn1pGkP2oCTsWbhEafdF2
@mageshb
mageshb merged commit 017a178 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