Skip to content

feat(cua): surface per-step final_url on success steps in result.json - #958

Open
mercurialsolo wants to merge 1 commit into
mainfrom
feat/result-per-step-final-url
Open

mercurialsolo wants to merge 1 commit into
mainfrom
feat/result-per-step-final-url

Conversation

@mercurialsolo

Copy link
Copy Markdown
Owner

Why

result.json only exposed a step's browser URL on failure (via _stamp_failure_context); successful steps stayed slim. So a downstream extraction reward can be earned from a landing page that happens to show the target field — HN's front page shows comment counts, lu.ma cards show dates — conflating "right data" with "right page". This blocks any URL-verified reward (e.g. SA-OPSD's segment reward) from confirming a "successful" extract actually landed on the intended page.

What

  • run_executor: stamp step_result.final_url from the post-step env URL on success steps too (only when not already set; page_title/screenshot stay failure-only to keep success payloads slim).
  • result_payload.pack_step: emit final_url on success when non-empty; failure keeps it unconditionally (contract unchanged).

Tests

tests/test_result_payload.py — two new cases: success surfaces final_url when present; a URL-less success step stays slim. The existing test_success_payload_stays_slim is unchanged (URL-less success adds no key). 17 passed.

Notes

Independent of #957 (that's volume/profile reliability; this is result-payload observability). The sibling backlog item — per-run cost attribution (session_costs.gpu_usd is 0) — is intentionally not in this PR; it's a separate, murkier GPU-cost-attribution change.

🤖 Generated with Claude Code

result.json only exposed a step's browser URL on failure (via
_stamp_failure_context) — successful steps stayed slim. That let a
downstream extraction reward be earned from a landing page that happens
to show the target field (HN's front page shows comment counts; lu.ma
cards show dates), conflating "right data" with "right page". This
blocks any URL-verified reward (e.g. SA-OPSD's segment reward) from
confirming a "successful" extract actually landed on the intended page.

- run_executor: stamp step_result.final_url from the post-step env URL on
  SUCCESS steps too (only when not already set; page_title/screenshot
  stay failure-only to keep success payloads slim).
- result_payload.pack_step: emit final_url on success when non-empty;
  failure keeps it unconditionally (unchanged contract).

Tests: two new cases in test_result_payload.py — success surfaces
final_url when present; a URL-less success step stays slim. The existing
slim-success assertion is unchanged (URL-less success adds no key).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

This branch has not been deployed

No deployments
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