Uh oh!
There was an error while loading. Please reload this page.
ci: pin the data-ingestors schema ref + add a coverage floor (#1009 P0.3) - #188
Conversation
…0.3) Two of the three CI drift tripwires from #1009. (The third — a scheduled `sync-validator-goldens.sh --check` against the pinned ingestor — waits for #340 to land on a stable ref, since the value-aware check regenerates against the ingestor read path and needs the #340 fix; the Go-side parity test already enforces the committed goldens on every PR.) (b) Pin the schema-drift check to a data-ingestors SHA, not floating master. sync-schema.sh now builds the fetch URL from scripts/.data-ingestors-ref (a pinned commit SHA), overridable via DATA_INGESTORS_REF. Before, any upstream commit touching the schema reddened every open CLI PR until someone synced; now adopting upstream is a deliberate SHA bump + re-sync in one PR. Pinned to 0de1f148 (current master; the embedded schema matches it — check stays green). (c) Add a per-package coverage floor. `go test -cover` printed numbers and asserted nothing, so the two load-bearing, historically thin-tested packages could silently rot. scripts/coverage-floor.sh fails the build if internal/cli or internal/submit drops below its floor; wired into the Test job after `go test`. Floors are a RATCHET (bump UP only, lowering is a reviewed edit), set just under current develop: internal/cli 68% (now 70.1%), internal/submit 72% (now 74.8%). Bump these up once #186/#187 land (they lift internal/cli to ~72%). The script is bash-3.2-portable (no associative arrays — macOS default). Verified locally: sync-schema.sh --check matches at the pinned SHA; coverage-floor.sh passes and bites (a 99% floor fails, a below-current floor passes); shellcheck clean; build.yml parses; full suite green. Part of backend#1009 (P0 CI drift tripwires). Remaining #1009: the goldens drift job (post-#340), the cross-repo taxonomy contract test, one content-compared ingest e2e. Part of the data-ingest epic backend#1008. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
LukasWodka
commented
Jul 8, 2026
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit d44b949. Configure here.
A dropped ":floor" in FLOORS left min="$entry" (the whole token); the awk comparison then errored on that as bare source and exited non-zero, which `if awk` read as "not below floor" and printed a bogus "ok" — the ratchet became a silent no-op for that package. Validate each entry has a "package:INT" shape before the awk call. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
saadqbal
commented
Jul 8, 2026
Nice, tight PR 👍 One thing worth closing that I pushed a fix for (97186d3): in Two low-sev, non-blocking notes: the floor step re-runs |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 97186d3. Configure here.
Uh oh!
There was an error while loading. Please reload this page.
…#1009 P0.3)
The ref (pinned file value, or the DATA_INGESTORS_REF override) is
interpolated into a raw.githubusercontent.com URL. An unvalidated ref
could inject path traversal ("../..") or extra path segments — the same
class scripts/install.sh already guards for its release tag. Restrict
the ref to a SHA/branch/tag shape (alnum start; alnum . _ - / ; no "..")
and fail with exit 2 otherwise.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>Uh oh!
There was an error while loading. Please reload this page.

Summary
Two of the three CI drift tripwires from #1009. Both make an existing "prints a number, asserts nothing" check into an actual gate — without adding cross-repo flakiness.
(b) Pin the schema-drift check to a SHA, not floating
mastersync-schema.shnow builds its fetch URL fromscripts/.data-ingestors-ref(a pinned commit SHA), overridable viaDATA_INGESTORS_REF. Before, any upstream commit touching the schema reddened every open CLI PR until someone re-synced. Now adopting upstream is a deliberate SHA bump + re-sync in one PR. Pinned to0de1f148(current data-ingestorsmaster; the embedded schema matches it, so the check stays green).(c) Per-package coverage floor
go test -coverprinted coverage and asserted nothing, so the two load-bearing, historically thin-tested packages could silently rot.scripts/coverage-floor.shfails the build ifinternal/cli(the money path) orinternal/submit(the jobs-manager orchestration) drops below its floor — wired into theTestjob aftergo test.Floors are a ratchet (bump UP only; lowering is a reviewed edit with a reason), set just under current develop:
internal/cliinternal/submitBump these up once #186/#187 land (they lift
internal/clito ~72%). The script is bash-3.2-portable (no associative arrays — macOS default).(a) deferred, deliberately
The third tripwire — a scheduled
sync-validator-goldens.sh --checkagainst the pinned ingestor — waits for #340 to land on a stable ref: the value-aware--checkregenerates against the real ingestor read path and needs the #340 fix, else it fails. Meanwhile the Go-side parity test already enforces the committed goldens on every PR (in thetestjob), so value-level parity is not unguarded — (a) is the upstream-drift alarm, which correctly follows #340.Verification
sync-schema.sh --checkmatches at the pinned SHA (green).coverage-floor.shpasses and bites (a 99% floor fails; a below-current floor passes).build.ymlparses; fullgo test ./...green.Type
CI hardening · cli · RFC-0002 foundation. Part ofbackend#1009 (P0 CI drift tripwires). Independent of #186/#187/#340.
Note
Low Risk
Changes are limited to CI scripts and workflow wiring; no runtime CLI behavior changes, with modest operational risk from choosing the pinned schema SHA.
Overview
Pins schema drift checks to a fixed
data-ingestorscommit viascripts/.data-ingestors-refinstead of tracking floatingmaster, so unrelated upstream schema changes no longer fail every open CLI PR.sync-schema.shbuilds its fetch URL from that ref (overridable withDATA_INGESTORS_REF) and validates the ref before interpolating it into the download path.Adds a coverage ratchet in
scripts/coverage-floor.sh, run in the Test job aftergo test -cover, which fails the build ifinternal/cliorinternal/submitstatement coverage drops below configured floors (68% / 72%). Floors are intended to move up only with deliberate edits.Workflow comments for the schema-drift job are updated to describe the pinned-ref workflow and deliberate SHA bump + re-sync for adopting upstream.
Reviewed by Cursor Bugbot for commit 18b4e43. Bugbot is set up for automated code reviews on this repo. Configure here.