Skip to content

fix(sources): reject new Fedora primary URLs in the source lock - #310

Merged
hanthor merged 1 commit into
mainfrom
scanner/fix-fedora-primary-ratchet
Oct 1, 2026
Merged

hanthor merged 1 commit into
mainfrom
scanner/fix-fedora-primary-ratchet

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Fix

Step 3 of #42 — the one the issue says "stops the gap reopening" and "should land with or before the bulk re-pin".

tools/source_pipeline.py fetches each lock entry's primary url directly, so an entry pointing at src.fedoraproject.org takes its payload from Fedora's lookaside instead of the project's own release. tools/bootstrap_upstream_sources.py already refuses a Fedora host when generating candidates (FEDORA_HOSTS), but nothing enforced that against the committed file — the set has grown from the 114 of 193 the issue recorded to 254 of 401.

tools/validate.py now reads config/fedora-primary-sources.txt as a ratchet:

  • a package outside the list using a Fedora primary url fails, with the remediation spelled out (point url at the upstream release, keep Fedora in fallback_urls, which source_pipeline.py already consults after an upstream transport failure; use a tools/generated_sources.py generator where no upstream artifact exists verbatim);
  • a package re-pinned upstream but left in the list fails too, so the list only shrinks and cannot hold a slot open for a silent regression;
  • the 254 current entries are recorded as-is, so the checked-in tree passes today.

Files/functions claimed: tools/validate.py (fedora_primary_sources, read_fedora_primary_baseline, check_fedora_primary_sources), new config/fedora-primary-sources.txt, tests/test_validate.py, plus the rule statement in AGENTS.md and the gate table in docs/architecture.md. No config/upstream-sources.json entry is touched, so this is disjoint from #198, #225 and #233, which only add or edit lock entries.

Refs #42 — the bulk re-pin (steps 1, 2 and 4: re-pointing 254 entries at their upstream releases, demoting Fedora to fallback_urls, and the generate entries for gcc/intel-media) is deliberately left open; it is per-package work with its own verification and does not fit one reviewable diff.

Tests: python3 -m pytest tests/ -q — 810 passed, 1 skipped, 2325 subtests. python3 tools/validate.py — validated 401 source RPMs (398 rawhide, 3 upstream). Both new failure modes were exercised against the real tree: an injected Fedora-primary entry and a stale baseline line each exit 1 with their own message.


Filed by scanner agent (ACMM L5 — hold-gated mode). Hold-gated: human review required.

— hive: agent=scanner backend=copilot model=claude-opus-5 copilot=1.0.88 requested_by=@castrojo

tools/source_pipeline.py fetches each entry's primary url directly, so the
254 locks pointing at src.fedoraproject.org build from Fedora's lookaside
rather than from the project's own release -- the dependency the
direct-source pipeline exists to remove. bootstrap_upstream_sources.py
already refuses a Fedora host when generating candidates, but nothing
enforced that against the committed file, so the set could keep growing.

tools/validate.py now reads config/fedora-primary-sources.txt as a ratchet:
the packages still on a Fedora primary url are recorded there, anything
outside the list fails with the remediation (move Fedora to fallback_urls,
which source_pipeline already consults after a transport failure), and an
entry re-pinned upstream must be deleted from the list, so it only shrinks.

The bulk re-pin itself is unchanged work; this stops the gap widening while
it happens.

Signed-off-by: scanner <scanner@hive.kubestellar.io>
@hivecommons-hive hivecommons-hive Bot added the hold Work is intentionally paused. label Oct 1, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Important

Held for human review by the hive's ACMM level gate.

This PR was opened by the "scanner" agent while Hive policy required a human checkpoint for that agent. Non-outreach agents are held at ACMM L3–L5; the outreach agent is always held because it publishes project-facing communication.

Hive will automatically remove the hold label once current policy no longer requires a level hold for "scanner". If this is an outreach PR, a human must review it and remove the label.

@hanthor
hanthor merged commit 330f914 into main Oct 1, 2026
167 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hold Work is intentionally paused.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant