Skip to content

Refuse --retries 0, unify the not-served message, fix donor --help text - #14

Merged
jehrr merged 2 commits into
mainfrom
fix/retries-zero-help-diagnostics
Oct 13, 2026
Merged

jehrr merged 2 commits into
mainfrom
fix/retries-zero-help-diagnostics

Conversation

@jehrr

@jehrr jehrr commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

Worked through a third-party audit of 443a052. Each claim was checked against the code and a live run.

What the audit got wrong, and what was real under it

Its live run used --retries 0. The load loop is range(1, retries + 1), so it ran zero times, goto never happened, and the engine classified about:blank (39 bytes) as blocked. Measured 2026-10-09 from a datacentre-class Linux host under xvfb:

run result
repo engine, --retries 0 (headful and headless) exit 3, 39 B, ~50 ms, no navigation
bare Playwright headful / headless / curl 200 648 KB / 403 310 B / 403
repo engine, --retries 1, 3 pages 72 lots, complete, exit 0

So the README's headful finding reproduces; the defect is that 0 attempts is reported as a block.

Changes

  • --retries must be >= 1 (all three engines, usage error exit 2)
  • page_flow.not_served_message: shared, states observation first; no longer blames headless on a headful run or recommends a proxy beside it
  • --help / usage errors rewritten for Catawiki from shared strings (URL_HELP, MODE_HELP, PAGES_HELP, RETRIES_HELP); dead discovery-hub warning removed
  • SECURITY.md: a dump is page markup, not the cookie jar
  • Suite: 494 checks pass. Four planted faults each turned the suite red on the intended check (retries type reverted, n < 0, empty-DOM threshold zeroed, stale word in a help string).

Not changed, deliberately

  • Three engines stay (family contract); no sidecar for failed runs (it would contradict preserved good output); no package entry point; LibreSSL warning is the auditor's local Python.
  • Internal comments in the engines still mention the donor (Apollo, shop front). User-visible text is clean; comments are a follow-up.
  • --locale default is still id-ID (donor leftover; only the help text was corrected, behaviour untouched).
  • scraper_api_client.py computes attempts as retries + 1, unlike the engines.

🤖 Generated with Claude Code

jehrr and others added 2 commits October 9, 2026 10:42
--retries 0 made the load loop run zero times, so goto was never called and
the engine judged about:blank (39 bytes) as a block: exit 3 for a site that
was never asked. Now a usage error in all three engines.

The not-served log blamed headless and recommended a residential exit in the
same sentence, and said so for headful runs too. One shared
page_flow.not_served_message states the observation first and the cause only
when it applies.

--help and usage errors described another marketplace scraper (product mode,
Apollo, IDR, /p/<cat>). Now from one set of strings in page_flow, with a
suite check over every string in the engines.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…let diff_runs read lot runs

Comments, docstrings, CONTRIBUTING and a few help strings still described a
different marketplace (its selectors, ids, page sizes, modes and currency),
and some of that was code, not prose:

- diff_runs refused every --mode lot run: the diffable-mode list named a mode
  this repo does not have. A test pinned that list, so it defended the bug.
- PageOutcome carried scroll and shop_facts fields no engine ever set, and
  the sidecar logic around them could never fire. Removed (the always-empty
  scroll and pages_still_growing sidecar keys go with them).
- output_writer's Product comments now describe this site's real columns.
- page_url, the completeness check and the blocked-retry comments no longer
  state another site's measurements, one of which contradicted the parser
  (it said a search cannot be paginated by URL).

No column or flag changed. Suite: 499 checks; planted faults for the mode
list and the removed fields each turned it red on the intended check; a live
--mode lot run pair now diffs.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@jehrr
jehrr marked this pull request as ready for review October 13, 2026 08:40
@jehrr
jehrr merged commit acd5cc3 into main Oct 13, 2026
8 checks passed
@jehrr
jehrr deleted the fix/retries-zero-help-diagnostics branch October 13, 2026 08:40
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