Repository navigation
One paid solve per page, atomic writes, formula-safe CSV, env URL as a default - #8
Merged
Merged
Conversation
- A page's CAPTCHA allowance now survives every landing on it. Each block-retry or exit rotation landed again with a fresh allowance, so one refused page could buy 2 AWS WAF solves with no pool and 4 with a 3-exit pool against SOLVES_PER_PAGE = 1. The pay-type pre-check no longer solves. - JSON, CSV and the run sidecar are written to a temp file in the same directory, fsynced and renamed. A failure mid-write leaves the previous file intact. New files get 0o666 & ~umask, existing files keep their mode. - CSV cells starting with = + - @ or a control character get a leading apostrophe (after list joining; numbers and JSON untouched), counted as csv_cells_escaped in the sidecar under the caller's own fields. - BINANCE_URL in the environment is a default: a typed --mode or query flag wins. .env.example ships it commented out. - HTTP 451 advice and docs no longer claim an unmeasured US refusal; a CDP 401 is "credentials refused", not "they last about a day". - Root-level *.html captures are ignored; .dockerignore covers .env*. - README heading counts six items, not five. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every comment and docstring that cited a private note or a bare section number now says the rule in its own words, or drops the pointer. A suite check fails if such a citation reappears in any shipped file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Problem
An audit of
mainat85553e8(2026-10-14) found these, each reproduced by running code rather than by reading it:page_flow.land()ran its ownfor _ in range(SOLVES_PER_PAGE)on every landing, andfetch_one_pagelands again after every block-retry and rotation. With the solver stubbed: 2 solves with no pool, 4 with a 3-exit pool, againstSOLVES_PER_PAGE = 1.json.dumpturned a goodout.jsoninto 13 bytes of invalid JSON. The same applied to the CSV and the.meta.jsonsidecar.=HYPERLINK(...)and-cmdwere written as they came. Advertiser, portfolio and announcement names are third-party text..env.examplebroke every flag-built query. It shippedBINANCE_URLset to a P2P page.--mode announcements,--mode copytradingand--asset/--fiatthen exited 2 with a conflict against a URL the user never typed.§N) across 14 files.*.htmlcapture was not ignored,.dockerignorelisted.envbut not.env*, there were two donor-repo mentions in comments, and the README said "Five things" above six.What happens now
page_flow.SolveBudget, created once infetch_one_pageand passed to everyland()for that page. The budget is checked before each purchase. Retries and rotations do not reset it. The--pay-typepre-check lands without solving, so page 1 pays from its own allowance._atomic()inoutput_writerwrites to a temporary file in the target's directory, then flushes, fsyncs and callsos.replace, and unlinks the temporary file on any error. CSV keepsnewline="". A new file gets0o666 & ~umaskand an existing file keeps its mode.write_json,write_csvandwrite_run_metaall go through it. Each file is replaced atomically on its own; the three are not one transaction.= + - @ \t \r \nget a leading'. This runs after the list cells are joined. Numbers and JSON are unchanged. The sidecar recordscsv_cells_escaped, merged under the caller'sextra.args.typed_urlbeforeenv_config.apply.build_querydrops an environment URL when the user typed--modeor a query flag. A typed--urltogether with a flag is still refused..env.examplenow shipsBINANCE_URLcommented out..env.exampleand the bug template no longer claim a US refusal. A 401 is reported as "credentials refused (expired, revoked or mistyped)"./*.htmlis now in.gitignore,.env*is in.dockerignore, and the README heading says "Six things".Evidence
Offline suite, core-only venv (Python 3.13): 426 passed, 0 failed. Before this change it was 390. The five skipped groups are the absent engines.
Per-engine venvs (
requirements.txt+requirements-<engine>.txt, no browser download): playwright 431/0, selenium 428/0, puppeteer 428/0. Each run skipped only the other engines, andpip checkwas clean in each.ci_checks.py --secret-check: 48 files, nothing credential-shaped.No-network probe of the env URL fix: with
BINANCE_URL=<p2p url>,http_scraper.py --mode announcements --pages 0reaches the--pagesvalidation instead of failing on the mode conflict. A typed--url ... --fiat TRYis still refused.Controls. Each fault below was planted with
PYTHONDONTWRITEBYTECODE=1and__pycache__removed. Each one turned the suite RED on the named check, and the restored tree was green again:land(..., SolveBudget())): got 2 solves, want 10o644 & ~umask: umask 002 gave 644extratyped_urlrecorded afterenv_config.applypage_flow.py,CHANGELOG.mdandcanary.ymlOne planted fault (env URL treated as typed) first crashed the suite with an uncaught
SystemExitinstead of failing the named check. The check now catchesSystemExitand reports by name.Release notes for v0.1.0, v0.1.1 and v0.2.0 contain no private citations, so none were edited. No released CHANGELOG section contained one either.
Not changed
.env.exampleand the env-URL fix: both options from the audit were taken (comment it out, and record the typed URL). Either can be reverted on its own.[Unreleased]now holds these fixes and the earlier--retries 0change.🤖 Generated with Claude Code