Skip to content

test: architecture.md inventory-count drift gate — docs/architecture.md Coverage counts vs tools/package_inventory.py - #103

Closed
hivecommons-hive[bot] wants to merge 1 commit into
mainfrom
arch/architecture-doc-count-gate
Closed

hivecommons-hive[bot] wants to merge 1 commit into
mainfrom
arch/architecture-doc-count-gate

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Refactor

Closes #102

docs/architecture.md publishes four inventory counts as verifiable command output — ls -d packages/*/ | wc -l, the .packit.yaml and config/upstream-sources.json entry counts, and the quoted tools/validate.py line — and invites the reader to reproduce them. All four said 193; the repository carries 192. The review table's "31 of 193 packages carry a hand-assigned stage" had the same stale denominator (the 31 is still correct).

Nothing gated them, so the only document stating the factory's coverage contract drifted away from the factory, and every package added or removed would have widened the gap.

Exact ground this PR claims

  • docs/architecture.md — the Coverage section counts (lines ~80–91) and the stage row of the review table. 193 → 192 in five places.
  • tests/test_architecture_counts.py — new file. Recomputes every documented count from tools.package_inventory.inventory and source_locks, the same contract the factory itself reads, and fails when the document and the inventory disagree. Also asserts tools/validate.py still returns 0, since quoting its output is only meaningful if it passes.

Nothing else is touched: no tool behavior, no workflow, no config, no recipe. The 193 in docs/superpowers/specs/2026-09-05-full-packit-rpm-factory-design.md is a dated design snapshot and is deliberately left alone.

This follows the pattern the repository already uses for generated artifacts — tests/test_render_packit_config.py gating .packit.yaml, tools/publish_gate.py gating the publish rule — extended to the coverage claims that had no owner.

Verification

  • python3 -m pytest tests -q → 188 passed, 27 subtests passed
  • python3 -m unittest discover -s tests (the runner rebuild-rpms.yml prepare uses) → passes
  • python3 tools/validate.py, python3 tools/factory_contract.py, python3 tools/check_workflow_quoting.py → pass
  • Mutation check: reverting a single count back to 193 fails test_prose_coverage_claim_matches_the_inventory, so the gate is load-bearing rather than tautological.

Not claimed here

The related but disjoint finding #101 — the prepare job's inline matrix heredoc re-parsing config/upstream-sources.json outside tools/package_inventory.py — is not in this PR. Its fix necessarily edits .github/workflows/rebuild-rpms.yml, which the bot push token cannot write (refusing to allow a GitHub App to create or update workflow ... without 'workflows' permission). It is left as an issue for a human.


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

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

…rchitecture.md vs tools/package_inventory.py

The Coverage section of docs/architecture.md publishes four numbers as
verifiable command output: 'ls -d packages/*/ | wc -l', the .packit.yaml and
config/upstream-sources.json entry counts, and the line tools/validate.py
prints. Nothing kept them honest. All four claimed 193 while the repository
carries 192 recipes, so the only document stating the factory's coverage
contract disagreed with the factory, and every package added or removed moved
it further apart.

Correct the four counts, and add tests/test_architecture_counts.py, which
recomputes each one from tools.package_inventory.inventory -- the same contract
the factory reads -- and fails when the document and the inventory disagree.
The hand-assigned stage count quoted in the review table is gated the same way,
and validate.py is asserted to still succeed, since quoting its output is only
meaningful if it passes.

Docs and tests only; no tool or workflow behavior changes.

Closes #102

Signed-off-by: sec-check[bot] <sec-check[bot]@users.noreply.github.com>
@hivecommons-hive hivecommons-hive Bot added hold Work is intentionally paused. architecture Structural or interface design work. agent/architect Filed or owned by the architect agent. hive/hosted-projectbluefin-knuckle-gjvq labels Sep 14, 2026
@hivecommons-hive hivecommons-hive Bot changed the title [architect] test: architecture.md inventory-count drift gate — docs/architecture.md Coverage counts vs tools/package_inventory.py test: architecture.md inventory-count drift gate — docs/architecture.md Coverage counts vs tools/package_inventory.py Sep 17, 2026
@hivecommons-hive hivecommons-hive Bot added the agent/scanner Filed or owned by the scanner agent. label Sep 17, 2026
@hanthor

hanthor commented Sep 18, 2026

Copy link
Copy Markdown
Member

Closing: it conflicts with docs/architecture.md, whose inventory counts moved twice since (#70: 343 recipes, then 340), and the hive agent doesn't rebase. A drift gate for those counts is still a good idea (#102) — done fresh it should read the numbers from tools/validate.py's output rather than assert today's literals.


Generated by Claude Code

@hanthor hanthor closed this Sep 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent/architect Filed or owned by the architect agent. agent/scanner Filed or owned by the scanner agent. architecture Structural or interface design work. hold Work is intentionally paused.

Projects

None yet

1 participant