Skip to content

v1.0.1: fixes from the 2026-09-27 audit - #1

Merged
suvorovmika25-gif merged 2 commits into
mainfrom
fix/audit-2026-09-27
Sep 28, 2026
Merged

suvorovmika25-gif merged 2 commits into
mainfrom
fix/audit-2026-09-27

Conversation

@suvorovmika25-gif

Copy link
Copy Markdown
Collaborator

Fixes the findings of the 2026-09-27 third-party audit that survived a re-check against the code, plus one the re-check found (--help reading .env). Details in CHANGELOG.md → 1.0.1.

Fixed

  • Atomic output: JSON, CSV and sidecar are staged as temp files, fsync'd, and renamed together (sidecar last).
  • Absolute page numbers: a run started on WS=120 whose next page failed recorded pages_failed: [2]; now [3].
  • pages_unattempted: pages a concurrent run's dead workers never fetched are now named, and make the run partial.
  • --out directory checked before any fetch (exit 2). It used to turn a refused page into exit 5, and crash a successful run at the final write after all pages were paid for.
  • Internal errors → exit 1 (internal_error, masked traceback, gathered rows kept) instead of a transport failure. Browser/driver errors unchanged.
  • Raw dumps are 0600.
  • --help no longer reads .env (env_config.py, fingerprint_client.py); the config report shows values by allowlist only.
  • scraper_api_client.py validates --timeout (1–120), --retries, --retry-delay.
  • CI runs the offline suite once; two stale docstrings corrected.

Deferred (not in this PR): FetchBackend / mobile API spike, schema v2, src/ layout, lockfiles, action SHA pinning, Docker digest + non-root.

Verification

  • smoke_test.py: 359 PASS (Python 3.14 and 3.9); pytest: 1 passed; ci_checks.py --all: green.
  • Red control: the new smoke_test.py run against 1.0.0 fails 25 checks, one or more per fix.
  • The whole offline suite ran under a Python audit hook that refuses any open of the repo's .env and any socket use: zero hits. A new check proves --help of every CLI opens no .env (scratch copy + canary .env, so it works in CI too).
  • Live (Scraping Browser, 2026-09-28): the canary URL, 3 pages → exit 0, 325/325 rows, all canary assertions pass; a run started on WS=120 → pages 2–3, complete. Logs/outputs scanned for credential fragments: 0 hits.

🤖 Generated with Claude Code

suvorovmika25-gif and others added 2 commits September 28, 2026 09:36
… .env on --help

From the third-party audit of 2026-09-27 and its re-check:

- Publish JSON, CSV and sidecar atomically (temp file + fsync + os.replace,
  all staged, sidecar last).
- Record the listing's own page numbers in logs, debug dumps and the
  sidecar; a run started on WS>0 named the wrong failed page.
- List pages a concurrent run never attempted in `pages_unattempted`.
- Refuse a missing --out directory before any fetch; a debug dump that
  cannot be written no longer turns exit 3 into exit 5.
- Report internal errors (TypeError, KeyError, ...) as exit 1 with a masked
  traceback, keeping gathered rows, instead of as a transport failure.
- Create raw page dumps 0600.
- env_config.py and fingerprint_client.py parse argv before loading .env,
  so --help (run by CI and the offline suite) no longer reads it; the
  config report shows values by allowlist only.
- Validate scraper_api_client.py's --timeout/--retries/--retry-delay.
- Run the offline suite once in CI; fix two stale docstrings.

Every fix is pinned by a smoke_test.py check that fails on 1.0.0.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@suvorovmika25-gif
suvorovmika25-gif merged commit 61db4e0 into main Sep 28, 2026
7 checks passed
@suvorovmika25-gif
suvorovmika25-gif deleted the fix/audit-2026-09-27 branch September 28, 2026 08:52
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