Skip to content

Make the live source-contract monitor trustworthy - #207

Merged
jimdc merged 3 commits into
mainfrom
the-daily-live-civic-data-source-contracts-monit
Jul 31, 2026
Merged

Make the live source-contract monitor trustworthy#207
jimdc merged 3 commits into
mainfrom
the-daily-live-civic-data-source-contracts-monit

Conversation

@jimdc

@jimdc jimdc commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Summary

The daily live civic-data source-contract check mixed real upstream catches with false alarms (wrong probe shapes, runner bot-blocks, anonymous network errors, and pointer-class freshness gates). This change keeps hard failures for genuine drift while re-truing each probe class to the product path.

What changed

  • Checkbook Spending — probe by contract_id (the product path after Contracts-domain join) and require live XML fields contract_id, payee_name, check_amount, issue_date. Spending parser accepts those field names.
  • Legistar / ZAP machine endpoints — Legistar probes Bodies?$top=1 (auth via optional LEGISTAR_API_TOKEN; unauthenticated 403 is the expected gate). ZAP probes a real sample project id, not the literal {project_id} path.
  • Diagnostics — every live failure names source_id and URL class (no bare fetch failed); concurrent probes are bounded with one retry on network/5xx flakes.
  • Bot-blocked landings — PASSPort, NYCIDA, and DCAS annual landings that block CI runners no longer count as upstream drift when the product machine path (or product-side challenge handling) is the contract.
  • Pointer class — Capital Projects is existence/schema only; publisher staleness is not an ingest failure.
  • MOCS LL63 — update landing URL to the publisher’s current path so the disabled field-case check still works.
  • Depot — source-contract landing pages win over stale depot copies on re-derive.

Validation

  • node tools/verify_source_contracts.mjs (offline fixtures)
  • node --test test/source_contracts.test.mjs test/depot_rederive.test.mjs test/capital_projects_join.test.mjs
  • cd worker && node --test test/checkbook_lifecycle.test.mjs
  • node tools/verify_source_contracts.mjs --livegreen (36/36) locally

Notes for reviewers

Real teeth remain: vanished datasets, schema loss on fields the product uses, broken machine endpoints, and ingest-class freshness still fail the job and open/update the drift issue.

jimdc added 3 commits July 30, 2026 21:23
Retune the daily live verifier so it fails on real upstream drift only:
Checkbook Spending probes the product contract_id path and real XML fields;
Legistar and ZAP use probeable machine endpoints; bot-blocked landings are
classified when the product machine path is healthy; pointer-class sources
skip ingest freshness; every failure line names source id and URL class.

Also move the MOCS LL63 landing URL to the publisher's current path, align
Spending XML parsing with live field names, and keep depot landing pages in
sync with source contracts.
GitHub runners are blocked from PASSPort Public machine dumps as well as the
HTML landings. Mark those contracts as bot-blocked egress so the live monitor
does not report runner 403 as upstream drift; product freshness remains the
Worker materialization path.
The keyboard focus gate was failing on Cloudflare Turnstile widget hosts
(bare DIVs without product focus styles). Block third-party captcha loads
during the walk and skip any remaining captcha hosts so the gate only
checks first-party controls.
@jimdc
jimdc force-pushed the the-daily-live-civic-data-source-contracts-monit branch from 857b86f to 8dcdadc Compare July 31, 2026 01:26
@jimdc
jimdc added this pull request to the merge queue Jul 31, 2026
Merged via the queue into main with commit f79b816 Jul 31, 2026
11 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