Require every capability case with tool calls to replay equal under DBOS and Temporal

Merged
DO
4d ago
+857-208

Stacked on #14366 (base capability-conformance); retargets to main when that merges. No issue: this is contract D1 of the capability-conformance plan, agreed with @DouweM.

Every capability case with calls (core and Harness) now runs its calls under DBOS and Temporal, and the units each run journals are pinned next to the case.

Changes:

  • Calls.durable_steps is now a typed DurableSteps(dbos=..., temporal=...): step and activity names in order, without the agent prefix and the run's own model requests, which are counted instead (one per call, plus one). Every case lists them; an empty list is checked too.
  • DURABLE_DBOS (tests/harness/test_durable_tool_io.py, now over every case): runs the calls one per response in a DBOS workflow and forks it from after the last step, as recovery does. It fails if a counted request repeats or the steps drift. No exemptions.
  • DURABLE_TEMPORAL (new tests/harness/test_durable_temporal_replay.py): one dev server and one worker per module. A Replayer must replay each recorded history without failing or making a request, and the activities must match the case's list. Exempt, each still checked to break:
    • PydanticAIDocs and BrowserUse: id-less toolsets, #9233.
    • CompactOnRequest: its for_run copy builds a new toolset, #14403, found here.
    • Planning: tool events under Temporal, #7971.
  • Case fixtures: the echo stand-in and the core MCP toolset get ids. ToolGuardrail and PromptInjectionDefender get explicit ids, which core requires of an id-less capability with durable operations.
  • The Prefect construction check now covers every case Temporal accepts.
  • The CONTRACTS helpers moved to tests/harness/_contracts.py, shared with test_capability_contracts.py, which adds unit tests for the journal check and for nested-run request counting.
  • agent_docs/capability-conformance.md: the "Durable execution" section (requirements, D1).

Decisions:

  • start_local rather than a time-skipping server: it's repo precedent and cached in CI, the time-skipping binary is a separate download, and these workflows have no timers.
  • UnsandboxedWorkflowRunner: the cases' stand-ins live in the test process, and the replay checks determinism.
  • One call per response with a non-streaming model: the journal order is deterministic, and the call ids match the C contracts'.
  • The expected lists were worked out from the code, then corrected from CI's output.

Open for @DouweM:

  • BrowserUse isn't checked by D1 in CI, since only the browser-use job installs browser_use. Under DBOS its nested agent's requests are probably repeated on recovery. Should that job also run the two durable suites, which means installing DBOS and Temporal there?

Checklist

  • No breaking changes in accordance with the version policy.
  • Any permitted compatibility impact has a label, warning, migration and release note, and an exact API-check waiver if the gate reports it.
  • PR title is fit for the release changelog.