Repository navigation
flow: keep the server's answer to a save, labelled same_screen - #1298
Merged
Merged
Conversation
When the browser sees the server answer a save request (POST, PUT, PATCH, DELETE), the replayer keeps the answer on the save step (StepResult.server_responses) and the receipt counts it (server_responses: observed, 2xx, check_level same_screen). Kept: method, status, a digest of the endpoint (no query string), a digest and size of the body, the media type. Never a body, URL, header or value. The answer comes from the same transaction as the save, so on its own it never confirms an effect and never makes a run VERIFIED; the configured verifier still decides. Results and receipts without answers keep their exact bytes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Keep only method, status and media type: no endpoint or body digests (a digest of a short path or body can be guessed). - Never read a response body, so a streaming answer can't hold up a run. - Count only the page's own fetch, XHR and form writes to its origin, sent after the save began; never beacons, other origins, requests already in flight, or service-worker answers. - "Not an error" is a status below 400: a form save often redirects. - Keep up to 64 answers per step. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
Full-diff review found 4 issues + 2 minor; fixed in the latest commit and pinned in tests/test_server_responses.py: possible hang on streaming bodies (bodies are never read now); brute-forceable endpoint/body digests (dropped: method, status, media type only); unrelated answers counted (only same-origin fetch/XHR/form writes sent after the mark; no beacons, in-flight requests or service-worker answers); redirects counted as failures (ok = status < 400); per-step cap raised to 64; caveat wording fixed. |
…ventory Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # packages/flow/docs/VERIFICATION.md # packages/flow/docs/verification.json # packages/flow/openadapt_flow/receipt.py # packages/flow/public-artifacts.json
# Conflicts: # packages/flow/docs/VERIFICATION.md # packages/flow/docs/verification.json # packages/flow/public-artifacts.json
The page gets no request/response listeners until a save step marks the log (nothing earlier is kept anyway), so a page that never saves keeps the exact listener set it had, and the mask-tracking teardown check holds. close() removes the listeners. Masking is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…idence # Conflicts: # packages/flow/openadapt_flow/backends/playwright_backend.py # packages/flow/openadapt_flow/runtime/replayer.py
…idence # Conflicts: # packages/flow/claims.yaml # packages/flow/docs/VERIFICATION.md # packages/flow/docs/verification.json # packages/flow/public-artifacts.json
…idence # Conflicts: # packages/flow/claims.yaml # packages/flow/docs/EFFECT_KIT.md # packages/flow/docs/VERIFICATION.md # packages/flow/docs/verification.json # packages/flow/openadapt_flow/runtime/replayer.py # packages/flow/public-artifacts.json
…idence # Conflicts: # packages/flow/claims.yaml # packages/flow/docs/VERIFICATION.md # packages/flow/docs/verification.json # packages/flow/openadapt_flow/ir.py # packages/flow/public-artifacts.json
Member
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
In a browser, a save usually sends a write request and the server answers it. That answer is now kept as evidence, labelled honestly.
PlaywrightBackendlogs answers to POST/PUT/PATCH/DELETE (backends/_server_responses.py).StepResult.server_responses(method, status, endpoint digest without query string, body digest and size, media type). No body, URL, header or value.server_responses: {observed, ok, check_level: same_screen}. The production receipt projection is unchanged.Why
same_screen, never a checkThe answer comes from the same transaction as the save. A server can say
201 Createdand store the wrong value, store it under another record, or roll it back. So on its own it never confirms an effect and never makes a run VERIFIED; the configured verifier still decides. A 500 behind a "Saved" banner is still worth seeing.Results and receipts without answers serialize byte-for-byte as before (fields omitted when empty).
Tests
tests/test_server_responses.py: only write answers kept, no URL/query/body text; a real Chromium save produces one; a 201 with an unconfirmed read-back still endsRECONCILIATION_REQUIRED, not billable; the receipt counts answers without changing its evidence tier.test_run_receipt.pyallow-list gainsserver_responses(deliberate privacy-boundary edit: counts and a fixed label only). 275 related tests pass locally.Docs: EFFECT_KIT.md, APPROVAL_AND_VERIFICATION.md (check-level section), claims.yaml + VERIFICATION.md.
Stacked on #1280. Part 4 of 4.
🤖 Generated with Claude Code