Repository navigation
Report lost pages, dead exits and bad flags honestly; harden the key scan - #18
Merged
Merged
Conversation
…scan - A concurrent run that lost a page (worker raised, or workers never launched) now ends partial (exit 6) with pages_failed / pages_unattempted, instead of complete, exit 0. - A navigation that never returned a document (timeout, failed proxy) now exits 5 with page_load_timeout / proxy_failed instead of 3 "blocked". - --pages/--concurrency below 1 and --delay/--retry-delay/ --proxy-block-retries below 0 are usage errors in all three engines. - A WOOLWORTHS_URL from .env no longer turns --postcode into a listing run; .env.example ships it commented out. - diff_runs.py refuses store-lookup files instead of reporting 0 changes. - pyppeteer answers proxy auth through CDP Fetch on current Chromium, keeps the browser's own user agent, and connects without ignoreHTTPSErrors. - The credential scan reads JSON/CSV/.env backups, sees JSON-escaped key fields, judges exclusions relative to the repo, fails on 0 files, and the offline suite runs it. - Private-note citations removed from shipped files, with a guard. - .gitignore, docs, canary messages and CI matrix brought in line. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jehrr
force-pushed
the
fix/audit-2026-10-14
branch
from
October 15, 2026 13:55
2dc134b to
a13868a
Compare
jehrr
marked this pull request as ready for review
October 15, 2026 13:56
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.
Fixes the findings of a rules audit of
mainat7fac23d. The live canary failure is diagnosed and fixed separately in #17.Problem → resulting behaviour
complete, exit 0. The in-flight page appeared in no list.pages_failed. Queued pages no worker reached go into the newpages_unattemptedsidecar field withstop_reason: pages_unattempted. Either way the run ispartial, exit 6.land()returnedblocked, so the run exited 3 withblocked_by='no-response'and advised buying an exit.unreachableandproxy_failed, withstop_reasonpage_load_timeoutorproxy_failed, give exit 5. The store-lookup paths do the same.block_advicesays "no document was received" when the HTML is empty. A real Akamai denial is still exit 3.--pages 0/-2fetched one page and reported complete.--delay -1crashed after page 1 with its rows unsaved.--concurrency 0and negative retry counts were accepted.page_flowvalidators..env.exampleURL.envmade--postcode 3000a search-listing run.WOOLWORTHS_URLis commented out. Engines capturetyped_urlbefore.envis applied and decide the store shortcut on it.diff_runs.pyon store files0 added, 0 removed, 0 changed, exit 0, with address, phone and latitude changed.--force, because the tool compares product prices..jsonor.csvfiles or an untracked.env.bak. A clone under a parent namedvenvscanned 0 files and passed. The suite never ran the scan..env*(except.env), and matches JSON-escaped key fields. Exclusions are relative to the repo. A scan of 0 files fails. A context word only excuses a 32-hex run when it sits near the match on long lines. The suite runssecret_check().page.authenticatecrashed on current Chromium. The user agent was a hardcoded Windows string.connect(ignoreHTTPSErrors=True)was sent to the managed browser.Fetch.authRequiredand answers only Proxy challenges. Keeps the browser's own UA and only strips "Headless".connect()dropsignoreHTTPSErrors.test_no_private_citations_in_shipped_files, uses assembled tokens. Release notes v0.2.1 and v0.3.0 were edited: only the citation sentence changed, verified byte-for-byte..gitignoremissedX.pageNdumps,live/and top-level*.html. Docs said "credentials expire in about a day". Donor (Medium) prose remained in docstrings. The banned stem appeared in a docstring. CI had a duplicate inline sample check, and its 3.9/3.12 matrix did not match the 3.9–3.13 badge.Evidence
Offline suite, run in four venvs with
PYTHONDONTWRITEBYTECODE=1and__pycache__cleared:ci_checks.py --alland--history-checkare clean (142 blobs).Controls. Each one plants the fault, confirms the suite goes red on the named check, then restores it and confirms green:
playwright_scraper.pyfrommain: red ontest_a_worker_that_raises_neither_hangs_the_run_nor_loses_its_siblings(rewritten: it used to assert the raising page was lost),test_a_concurrent_run_that_loses_a_page_is_partial_not_completeandtest_workers_that_never_launch_leave_a_partial_run.land()returningblockedagain: red ontest_the_shared_loop_runs_end_to_end_against_a_fake_driver, new cases 7 and 8.diff_runs.pyfrommain: red ontest_diff_runs_refuses_store_lookups_instead_of_reporting_no_change.--delayback totype=float: tried in each engine separately; each one is red ontest_numeric_flags_are_validated_in_every_engine.args.url: red ontest_a_url_from_env_does_not_turn_a_store_lookup_into_a_listing.sample_output.json,TWOCAPTCHA_KEY=<hex>in an untracked.env.bak, a JSON-escapedclientKeyinside the served-page fixture, and a key innotes.pyin a clone under…/venv/ws. Each one failsci_checks.py --secret-checkby file:line and failstest_the_credential_scan_runs_here_and_finds_nothing. A clean clone under…/venv/wsscans 42 files and passes.env_config.pyor a rules-directory name in.gitignoreturnstest_no_private_citations_in_shipped_filesred. Ause_<stem>incaptcha_solver.pyturnstest_banned_wordingred.Behavioural probes:
.env,--postcode 3000now parses asmode=storesin all three engines.error: argument --X: --X must be at least N.--chromium-pathset to Chromium from the Playwright cache: the proxy logged 407 challenges answered and 87 authenticated tunnels, and the run returned 37 rows, exit 0. The same command onmaindies withProtocol error (Network.setRequestInterception), exit 1..gitignore:git check-ignoreignoreslive/x.html,x.page3,canary_dump.json.page3,dump.htmlandsub/dump.page2, and keeps the samples, fixtures,.env.example, README and tests.Not changed
--retries 0and these exit-code changes sit unreleased under[Unreleased]), schema/sinks, and shared-loop refactors.--allow-emptyon a genuinely empty listing writesstatus: failed. That is an open question for the owner.diff_runsstore support. Store files are refused rather than diffed; supporting them would be a feature, and it is the owner's call.connect()change was not exercised live, because that needs a paid credential. The pyppeteer UA change was checked from source only.🤖 Generated with Claude Code