Skip to content

ci: data-quality automation — lint gate, coverage, Wayback archiving, staleness sweep - #229

Merged
ch-bas merged 1 commit into
mainfrom
feat/ci-data-quality
Aug 7, 2026
Merged

ch-bas merged 1 commit into
mainfrom
feat/ci-data-quality

Conversation

@ch-bas

@ch-bas ch-bas commented Aug 7, 2026

Copy link
Copy Markdown
Owner

Data-quality CI automation (ideas #1–#4)

Adds four automations, all documented in docs/ci.md. No breaking changes — the dataset already passes the new gate (and it caught 2 real bugs on the way).

1. Consistency lint → PR gate (scripts/lint-data.js, wired into build.yml)

Cross-field invariants a JSON Schema can't express. Errors fail a PR:

  • environment vs ip_rating — weatherproof (water digit ≥5, incl. IP66/IP67) can't be ["indoor"]-only (Data: raise environment (indoor/outdoor) coverage above 53% #123)
  • ip_rating must contain a valid IEC 60529 token (allows compound IP66/IP67 + partial IPX5/IP5X)
  • weight_g positive ≤ 100 000; last_verified must be ISO YYYY-MM-DD

Warnings (advisory): non-canonical JSON (npm run lint -- --fix), ° in FOV, source URLs shared across cameras.

🐛 Already fixed 2 Bosch entries it flagged with a bogus ip_rating: "none (indoor)".

2. Coverage report (scripts/coverage-report.js → COVERAGE.md)

Auto-regenerated + committed on main. Replaces the manual data-lane tallies — a progress-bar table linked to #123/#161/#162/#177/#178/#179/#166/#170.

3. Wayback source archiving (scripts/archive-sources.js + archive-sources.yml)

On push to main, submits changed cameras' sources[] to the Wayback "Save Page Now" API so specs survive manufacturer link-rot (we've already had to recover entries this way).

4. last_verified staleness sweep (scripts/check-staleness.js + check-staleness.yml)

Monthly companion to the existing dead-link sweep (#222) — flags stale/unverified entries into a self-updating tracking issue.

Also: npm run scripts (lint/coverage/archive-sources/check-staleness) + a CONTRIBUTING.md pointer. Build + lint + coverage all green locally.

…ess sweep

Adds four data-quality automations (all documented in docs/ci.md):
- scripts/lint-data.js — cross-field consistency lint wired into build.yml as a
  PR gate (environment<->IP, ip_rating shape, weight sanity, ISO last_verified);
  warnings for JSON formatting (--fix), FOV degree symbols, shared source URLs.
  Already caught + fixed 2 bosch entries with a bogus ip_rating 'none (indoor)'.
- scripts/coverage-report.js -> COVERAGE.md, regenerated + committed on main by
  build.yml; replaces the manual data-lane coverage tallies.
- scripts/archive-sources.js + archive-sources.yml — pushes changed cameras'
  sources to the Wayback Machine so specs survive vendor link-rot.
- scripts/check-staleness.js + check-staleness.yml — monthly last_verified
  freshness sweep with a self-updating tracking issue (companion to the existing
  dead-link check-sources sweep).

Adds npm scripts (lint/coverage/archive-sources/check-staleness) and a
CONTRIBUTING.md pointer.
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