Skip to content

fix(gaps): drop runtime-contract [unavailable] packages from the parity report - #175

Closed
hivecommons-hive[bot] wants to merge 1 commit into
mainfrom
scanner/fix-gap-report-unavailable
Closed

hivecommons-hive[bot] wants to merge 1 commit into
mainfrom
scanner/fix-gap-report-unavailable

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Fix

tools/recalculate_hummingbird_gaps.py built the parity contract from every section of config/bluefin-packages.toml except [excluded], and never read config/runtime-contract.toml. The six packages Utah has deliberately dropped — firefox, slitherer, anaconda-live, evolution-ews-core, fish, zsh — were counted as parity debt Hummingbird still owed.

That contradicted tools/runtime_contract.py, which already filters the same [unavailable] list out of the resolved transaction. The two measurements disagreed: the runtime contract said firefox was out, the gap report said firefox was owed.

Changes

  • tools/recalculate_hummingbird_gaps.py: add a --policy argument defaulting to config/runtime-contract.toml, subtract [unavailable] from the contract, and record the subtraction as excluded_as_unavailable (plus a matching count) so the exclusions stay auditable rather than silent. Reuses load_policy/package_section from tools/runtime_contract.py via the sys.path + from tools.X import Y pattern the other tools already use.
  • tests/test_hummingbird_gaps.py: pin the new rule — exclusions leave the contract, dropped names are reported, an exception for a package the manifest never named does not inflate the audit list, availability does not revive an exception, a policy with no [unavailable] section drops nothing, and a malformed section is rejected. Plus an end-to-end check against the real config/ pair asserting firefox is absent from missing_from_hummingbird.

The workflow call site (.github/workflows/recalculate-hummingbird-gaps.yml) passes neither --manifest nor --output and relies on defaults, so no workflow change is required — nothing in this PR touches .github/workflows/.

Verification

On the real manifest the contract drops from 77 to 71, matching what the runtime contract resolves:

before: contract: 77, missing: 77   (firefox counted as missing)
after:  contract: 71, excluded_as_unavailable: 6, missing: 71
        excluded_as_unavailable: anaconda-live, evolution-ews-core,
                                 firefox, fish, slitherer, zsh

Gates run locally on this branch:

python3 -m pytest -q          -> 323 passed, 27 subtests passed
python3 tools/factory_contract.py -> factory contract satisfied (2468 tracked files checked)
python3 tools/validate.py         -> validated 340 source RPMs

Closes #174

Refs #112 — this closes that issue's "verify the current package set against the packages already provided for hummingbird" half. The "drop firefox from the build" half was already done before this PR: there is no packages/firefox recipe, and config/runtime-contract.toml already lists firefox as [unavailable], so runtime_contract.resolve() yields 71 packages with zero firefox entries. #112 is left open only because closing it is a maintainer's call on whether the Flatpak-vs-RPM request is now fully satisfied.

Scope

Touches only tools/recalculate_hummingbird_gaps.py and tests/test_hummingbird_gaps.py. Disjoint from the other open utah-packages PRs: #143 (tests/test_rebuild_matrix.py), #152 (tests/test_packit_workflow.py), #171 (tools/rebuild_plan.py), #164 (tests/test_recipe_set_agreement.py), #163 (Justfile, tests/test_gate_catalog.py), #162 (tests/test_architecture_counts.py).


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.78 requested_by=@hanthor

…ty report

recalculate_hummingbird_gaps.py built the contract from every section of
config/bluefin-packages.toml except [excluded] and never read
config/runtime-contract.toml. The six packages Utah deliberately dropped —
firefox, slitherer, anaconda-live, evolution-ews-core, fish, zsh — were
therefore counted as parity debt Hummingbird still owed, contradicting
tools/runtime_contract.py, which already filters the same list out of the
resolved transaction.

Add a --policy argument defaulting to config/runtime-contract.toml, subtract
[unavailable] from the contract, and record the subtraction as
excluded_as_unavailable so the exclusions stay auditable rather than silent.
The workflow call site relies on argument defaults, so it needs no change.

On the real manifest the contract drops from 77 to 71 and firefox no longer
appears in missing_from_hummingbird.

Assisted-by: Claude Opus 5 via GitHub Copilot
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: sec-check[bot] <sec-check[bot]@users.noreply.github.com>
@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.

@hivecommons-hive hivecommons-hive Bot added the hold Work is intentionally paused. label Sep 19, 2026

@castrojo castrojo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Substantive review:

  • Correctness: Subtracts [unavailable] packages from the runtime contract in tools/recalculate_hummingbird_gaps.py and records them under excluded_as_unavailable, properly reconciling gap reporting with runtime contract policy.
  • Test Coverage: Unit tests comprehensively cover contract partitioning, exclusion auditing, non-revival on image presence, and end-to-end integration against real config files.
  • Validation: Factory contract, validate.py, and unittest suite pass cleanly against current main.
  • Outstanding: PR carries the hold label and requires human maintainer review to remove hold before landing.

@hanthor

hanthor commented Sep 20, 2026

Copy link
Copy Markdown
Member

Closing to consolidate the queue on the merged #178 full-factory candidate. The branch is retained; please re-open or submit a fresh, rebased PR after that build establishes the current baseline.

@hanthor hanthor closed this Sep 20, 2026
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

2 participants