Skip to content

[quality] coverage-gap: both desktop contract gates (verify-desktop-contract.py, verify-gnome-extensions.py) have zero unit coverage #95

Closed

Description

@hivecommons-hive

Finding

Two CI/build gates in scripts/ have no unit coverage at all:

  • scripts/verify-desktop-contract.py (179 lines) — runs in just check as --check (contract syntax) and from the Containerfile against the composed image (branding, os-release, image-info, Flatpak Brewfile parity, remote URL, enabled services).
  • scripts/verify-gnome-extensions.py (64 lines) — asserts all 9 bundled GNOME extensions exist and declare GNOME 51.

tests/ currently holds only test_iso_ci.py, test_live_kernel.py and test_package_resolution.py, which cover resolve-e2e-inputs.py, iso/scripts/live-kernel.py, install-packages.py and check-repo-availability.py. Neither verifier is referenced by any test.

These are fail-closed gates: if validate_contract stopped flagging a missing section, a relative path, a duplicate Flatpak ID or a relative Brewfile; or if parse_brewfile stopped matching flatpak "id" lines; or if unit_enabled started accepting static/masked; or if the GNOME check stopped noticing a missing metadata.json — every affected build would still report the contract as passing. Nothing today would catch that.

Recommendation

Add tests/test_desktop_contract.py (picked up by the existing python3 -m unittest discover -s tests -p "test_*.py") exercising:

  • validate_contract — valid contract, each missing section named, relative contract file, empty app list, duplicate Flatpak IDs, relative Brewfile; plus the shipped contracts/bluefin-desktop.toml validating clean.
  • read_os_release — quoting, comments, blank lines, values containing =.
  • verify_values — exact mismatch, missing key, full-match (not prefix) pattern semantics.
  • parse_brewfile — order preserved, non-flatpak lines ignored, indentation, trailing-argument lines rejected.
  • unit_enabled — enabled/enabled-runtime pass; static, masked, non-zero exit fail; argv asserted.
  • main(--check) — accepts the shipped contract, rejects a truncated one, and touches no image path.
  • verify-gnome-extensions — complete tree passes, missing extension fails, non-51 shell-version fails, invalid JSON fails instead of raising, @PACKAGE_VERSION@ placeholder substitution, shell_versions rejects metadata without the key.

PR follows with exactly that file. It deliberately does not touch Justfile, which is already claimed by open PRs #40 and #91.

Priority

  • Impact: high (silent gate erosion on the image contract)
  • Effort: low (pure-Python, temp-dir driven, no image needed)

Filed by quality agent (hold-gated mode)

🐝 Hive Agent: quality | Instance: hosted-projectbluefin-knuckle-gjvq | SHA: ca3bd98

— hive: agent=quality backend=copilot model=claude-opus-5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/qualityFiled or owned by the quality agent.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions