Add full-flow order tracing and per-section selector discovery#19
Merged
Conversation
Add a `trace-order` CLI command and an opt-in live trace that dump a rendered DOM, a selector probe, and a screenshot at every checkpoint of the buy flow — product page, cart, cart view, delivery, payment, and the review page. Unlike `dump-dom`/`verify-selectors` (which stop at the product page), this reaches the checkout/review surface where the place-order, order-total, and payment selectors finally render, so they become discoverable and verifiable. Implementation threads an optional `FlowTracer` through the real `BasePurchaser.buy()` and the store-specific `_start_checkout()`, defaulting to a shared no-op singleton. A normal worker/orchestrator buy pays only one inert call per checkpoint — the live order path is unchanged. The CLI command hard-forces DRY_RUN (like `dry-run`), so it always halts at the review page before Place Order. Every checkpoint is best-effort: a capture failure is logged and swallowed and can never alter the order's outcome. - purchase.py: `FlowTracer`/`TraceStep`/`_NullTracer`/`new_run_id`; checkpoints in `buy()` and both `_start_checkout` overrides; `trace` full-page shot prefix. - cli.py: `trace-order` command with a per-step PASS/MISS digest. - config.py: `trace_orders` flag (ROOMIEORDER_TRACE_ORDERS, default off) wired into the orchestrator for opt-in live tracing. - New `/trace-order` skill; bring-up/triage-failure/AGENTS docs updated. - Tests for the dry-run contract, step output, no-op default, checkpoint ordering, and best-effort probe-failure isolation. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01F5GyaYcKJEkPz7nCaKfrm7
The nix pre-commit hook runs mypy over the test files too (a scope the local `mypy src/roomieorder` skipped): - Drop `is None` on the no-op tracer call (`[func-returns-value]` — the method returns None). - Remove three redundant `# type: ignore[arg-type]` comments; the module already disables arg-type via a file-level directive (`[unused-ignore]`). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01F5GyaYcKJEkPz7nCaKfrm7
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.
Add a
trace-orderCLI command and an opt-in live trace that dump arendered DOM, a selector probe, and a screenshot at every checkpoint of
the buy flow — product page, cart, cart view, delivery, payment, and the
review page. Unlike
dump-dom/verify-selectors(which stop at theproduct page), this reaches the checkout/review surface where the
place-order, order-total, and payment selectors finally render, so they
become discoverable and verifiable.
Implementation threads an optional
FlowTracerthrough the realBasePurchaser.buy()and the store-specific_start_checkout(), defaultingto a shared no-op singleton. A normal worker/orchestrator buy pays only one
inert call per checkpoint — the live order path is unchanged. The CLI
command hard-forces DRY_RUN (like
dry-run), so it always halts at thereview page before Place Order. Every checkpoint is best-effort: a capture
failure is logged and swallowed and can never alter the order's outcome.
FlowTracer/TraceStep/_NullTracer/new_run_id; checkpointsin
buy()and both_start_checkoutoverrides;tracefull-page shot prefix.trace-ordercommand with a per-step PASS/MISS digest.trace_ordersflag (ROOMIEORDER_TRACE_ORDERS, default off) wiredinto the orchestrator for opt-in live tracing.
/trace-orderskill; bring-up/triage-failure/AGENTS docs updated.ordering, and best-effort probe-failure isolation.
Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01F5GyaYcKJEkPz7nCaKfrm7