Make URL wait outcomes safe to branch on
Keep the existing action and raw result. Add stable error diagnostics for ordinary nonmatch and cancellation, using the existing dispatch, transport and report pipeline.
| Terminal fact | Public result | Consumer decision |
|---|---|---|
| Live match, no cancellation before settlement | completed + satisfied | Continue |
| Deadline after a successful nonmatching read | timeout + attest.web.url-unmatched | Allow an authored fallback or retry |
| Invocation cancelled before settlement | timeout + attest.web.aborted | Stop |
| Queue expiry, read timeout/failure, invalid input | Existing other errors | Stop |
Tradeoff and risk
Diagnostic-code changes preserve payload compatibility and automatically reach reports. The main risk is cancellation racing a finished observation or capture; classify at the final executor boundary and test delayed resolution and rejection. No URL privacy, polling, navigation, consumer dependency or resource ownership changes.
Evidence required
Deterministic race and consumer branching regressions; serialized daemon envelopes with secret masking; fresh Stagehand browser and Shuru public-CLI tests with saved reports. Run typecheck, lint, full tests, build and npm pack. Record skips as unverified, and prove regressions fail against the baseline.
Baseline: 93942e0838552fe3bf1909709065f1764e50024c, clean sucre checkout. Other worktrees remain separate. Tracking: sageox-attest-8fb. The provided handoff and existing ADR-002/extraction contract bound this change.
<!-- ox:details -->Implementation notes
In src/executors/web.ts, preserve read errors before deadline mapping, mark only deadline checks following successful nonmatches, and normalize aborted URL outcomes at executor settlement. Export the diagnostic code union through src/index.ts. Update docs/guides/writing-runners.md with the exact wire shape, strict fail-closed branching and compatibility implications. Extend tests/executors/web.test.ts, the transported Shuru fixture and tests/backends/shuru/wait-for-url.tier1.test.ts. Keep existing real-browser URL tests and cleanup assertions. Save build provenance, validation logs and integration reports in .context. Do not commit, push, publish, modify canonical dist or touch consumer files.
<!-- /ox:details -->
