Skip to content

Lost rows fail the run, one paid solve per page, atomic formula-safe output - #4

Merged
jehrr merged 2 commits into
mainfrom
fix/audit-2026-10-14
Oct 15, 2026
Merged

jehrr merged 2 commits into
mainfrom
fix/audit-2026-10-14

Conversation

@jehrr

@jehrr jehrr commented Oct 15, 2026

Copy link
Copy Markdown
Collaborator

Fixes from the 2026-10-14 audit of main at 9f66b72.

Problems, and the behaviour now

Finding Before Now
F2 served page parses to 0 rows (high) Real Goa capture with each hotel's id renamed: classified content, 4 properties stated, 0 rows. --pages 1/3 gave exit 4; good p1 + broken p2 gave exit 0, complete stop_reason: parser_found_nothing: exit 5 with no rows, exit 6 partial, pages_failed: [2] after page 1. The response is saved as <out>_pageN_debug.html. "No Hotels Found" is still exit 4
F3 .env.example URL (high) cp .env.example .env then --city Goa gave exit 2 ("--url already carries the query") MAKEMYTRIP_URL ships commented out. Each engine records typed_url before env_config.apply, and an environment URL gives way to typed query flags. A typed --url with --city is still exit 2
F1 atomic writes (high) A failure injected in json.dump left out.json/out.meta.json as 10-byte invalid fragments _atomic(): temp file in the target's dir, flush, fsync, os.replace, unlink on error. New file gets 0o666 & ~umask, an existing file keeps its mode. Used by json, csv (newline="") and the sidecar
F4 CSV formulas Written unchanged String cells starting = + - @ TAB CR LF get ' after list joining. Numbers and JSON are untouched. csv_cells_escaped is in the sidecar, merged under the caller's extra
F5 solve budget Stub solver: 3 solves for one page, 5 for a run by city name, against SOLVES_PER_PAGE = 1 page_flow.SolveBudget, one per page, checked before each purchase and never reset by retry or relaunch. The city lookup spends page 1's allowance. Now 1 and 1
F6 private citations 96 lines in 15 tracked files 0. Rules are stated in plain words. New guard: check_no_private_citations_in_shipped_files (tokens assembled from pieces)
F7 "credentials last about a day" In the 401 hint, README, TROUBLESHOOTING, CONTRIBUTING, .env.example, bug template and canary The text now says the credentials were refused (expired, revoked or mistyped). The suite check was rewritten to assert no lifetime is claimed
F8 / section 12 canary Green on a datacentre refusal (exit 3). The data job was dispatch-only and skipped green without its secret The datacentre job is documented as "datacentre refusal expected" and still treats exit 3 as a notice. The scraping-browser job now runs on the schedule, fails with ::error:: naming MAKEMYTRIP_CDP_ENDPOINT when the secret is absent, and fails on exit 3/4/5/6 or fewer than 60 rows
F9 --retries text Described another repo's loop and measurement Describes this repo's loop (while attempt < args.retries after the landing)
F10 .dockerignore binance_rows.* makemytrip_hotels.*, .env.*, canary*.json, *.page[0-9]*
F12 negative values --delay, --retry-delay and --proxy-block-retries took negatives argparse error naming the flag, exit 2. 0 is still legal
F14 stale example date Active .env value Moot: the line is commented out and says to put your own dates in

Evidence

  • Offline suite results, no driver installed for the core run:

    Venv Passed Failed Notes
    core 404 0 was 361
    playwright 407 0
    selenium 408 0
    puppeteer 406 0

    Each engine venv skipped only the other engines, and pip check was clean in each.

  • ci_checks.py --secret-check: 44 files, clean.

  • Through playwright_scraper.parse_args with MAKEMYTRIP_URL set:

    • --city Goa builds a Goa query;
    • --delay -1 gives error: argument --delay: --delay must be 0 or more;
    • a typed --url plus --city is refused.
  • Planted-fault controls, run with PYTHONDONTWRITEBYTECODE=1 and __pycache__ removed. Each one went RED on its named check, and the restored tree was green:

    • budget reset per landing
    • lookup with its own budget
    • non-atomic json, csv and meta
    • temp cleanup removed
    • flat 0o644
    • no chmod (0600)
    • no CSV escape
    • escape before list join
    • housekeeping merged over extra
    • env URL treated as typed
    • parser-failure detection removed
    • plain float for --delay
    • a section-sign citation in CHANGELOG
    • a private-notes citation in page_flow.py
    • MAKEMYTRIP_URL uncommented

    The last control first crashed the env check instead of failing it by name. The check was fixed to report by name. A first version of the budget control looped forever, so the solver stub now raises after 20 calls.

  • No paid calls, no proxies, no credentials and no live requests.

Not changed

Owner action

The MAKEMYTRIP_CDP_ENDPOINT secret (set 2026-09-25) has to be valid, or the scheduled canary goes red. That is intended: red means nothing tested the site.

🤖 Generated with Claude Code

jehrr and others added 2 commits October 15, 2026 13:04
…output

- A served page holding properties that parses to no rows is now a failed
  page (stop_reason parser_found_nothing): exit 5 with nothing gathered,
  exit 6 after earlier pages. It used to be exit 4, or a complete run.
- Every landing for a page, and the city lookup before page 1, spends one
  page_flow.SolveBudget; a page could buy 3 solves and a run by city 5.
- JSON, CSV and the sidecar are written atomically with the mode open()
  would give; formula-shaped CSV cells get a leading apostrophe and the
  sidecar records csv_cells_escaped.
- MAKEMYTRIP_URL ships commented out, and a URL from .env gives way to
  typed query flags, so the README's `--city Goa` works after copying
  .env.example.
- Negative --delay, --retry-delay and --proxy-block-retries are usage
  errors.
- A CDP 401 no longer claims credentials last about a day.
- The canary's Scraping Browser job runs on the schedule and fails when
  its secret is missing.
- Comments and docs state their reasons without pointing at private notes;
  a suite check keeps it so.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
….env URL

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jehrr
jehrr marked this pull request as ready for review October 15, 2026 21:16
@jehrr
jehrr merged commit ac3dfbc into main Oct 15, 2026
9 checks passed
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