M20: Add README.md Hero Badge Row (PyPI, License, Python 3.12+, CI) & Parity Guard¶
- Task ID:
M20 - Priority:
P2(Master Rank#9, Track B — Simple Fixes, Docs & CI Hygiene) - Status:
Done - Dependencies:
M10,M11 - Target Repository:
/Users/ivan/Project/3t.tools.intellij/verityredteam-free(verity-redteam-core) - GitHub Project #5: Verity RedTeam Free Task Board
1. Context & Problem Statement¶
README.md opens with the H1 title and a one-line tagline but carries no hero badge row.
A visitor landing on PyPI or GitHub cannot tell at a glance:
- the published distribution name (
verity-redteam-core) and current version, - the supported Python floor (
3.12+, already pinned inpyproject.tomlrequires-python), - the license (
Apache-2.0, already shipped asLICENSE), - whether CI is green (
ci.yml).
tests/unit/test_documentation_parity.py already guards CLI fidelity, relative links,
the demo asset, and stale verity-core package references, but it has no assertion that a
badge row exists, so a regression (a dropped badge, a badge pointing at a retired project
URL, or a badge block drifting below the hero fold) can land unnoticed. Result: the hero
block is unverified documentation surface, and wheel metadata (Requires-Python, License,
Name) is never cross-checked against what the README advertises.
2. Requirements & Target Files¶
- Hero badge row (
README.mdlines 1–8): insert a single badge row immediately beneath the H1 title and above the tagline, per M10 spec §2.1, keeping the hero block insideREADME.mdlines 1–8. Exactly four badges, one per line, in this order:
[](https://pypi.org/project/verity-redteam-core/)
[](https://pypi.org/project/verity-redteam-core/)
[](LICENSE)
[](https://github.com/JMartynov/verityredteam-free/actions/workflows/ci.yml)
- Valid targets only: every badge target must resolve —
- PyPI/Python badges point at
https://pypi.org/project/verity-redteam-core/, - License badge points at the relative
LICENSEfile (already covered bytest_relative_links_and_media_resolve), - CI badge points at the existing
.github/workflows/ci.ymland itsactions/workflows/ci.ymlURL. - No stale package links: zero
\bverity-core\boccurrences anywhere in the hero block (reuse_STALE_PACKAGE_RE); retiredverity-coreURLs must not be introduced. - Parity guard: add
test_readme_hero_badges_present_and_validtotests/unit/test_documentation_parity.py, built on the existingREADME_PATH,_LINK_RE, and_STALE_PACKAGE_REhelpers — no new dependencies. - Metadata consistency: badge claims must match packaged wheel metadata (
Name,Requires-Python,License) — the README must not advertise a Python floor, license, or distribution name the wheel does not declare.
3. Automated Tests to Verify (tests/unit/test_documentation_parity.py)¶
test_readme_hero_badges_present_and_valid must assert, over the first 8 lines of
README.md (hero = text.splitlines()[:8]) and with a parametrized _HERO_BADGES
mapping:
- All four badge images are present in the hero block:
img.shields.io/pypi/v/verity-redteam-core.svg,img.shields.io/badge/python-3.12%2B-blue.svg,img.shields.io/badge/License-Apache_2.0-blue.svg,actions/workflows/ci.yml/badge.svg(parametrized — one case per badge). - All four targets are present and valid: the PyPI project URL
https://pypi.org/project/verity-redteam-core/, the relativeLICENSEtarget, and the.../actions/workflows/ci.ymlURL; relative targets resolve on disk via(REPO_ROOT / target).is_file(). - Ordering/location: the badge lines appear after the
#H1 line and before the tagline line, and every badge line matches_LINK_RE(image form](target)). _STALE_PACKAGE_RE.search(hero_text)isNone— zero staleverity-corereferences.(REPO_ROOT / ".github" / "workflows" / "ci.yml").is_file()— the CI badge target exists in-tree.- Existing guard
test_no_stale_package_referencesstill passes unchanged.
4. Acceptance Scenario in Clean Container with Packaged Wheel Metadata¶
Extend tests/e2e_containers/verify_all_scenarios.sh with a documentation-metadata
scenario (or a new docs-metadata step in run_e2e.sh) that runs against the packaged
wheel, not the source tree:
- Build and install the wheel exactly as the suite does today
(
INSTALL_SOURCE=wheel ./tests/e2e_containers/run_e2e.sh), then copyREADME.mdinto the container image so the shipped doc is asserted. - Extract wheel metadata and compare it with the README badges:
python -c "from importlib.metadata import metadata; m = metadata('verity-redteam-core'); print(m['Name'], m['Version'], m['Requires-Python'], m['License'])"
- Assertions:
Nameisverity-redteam-coreand the hero PyPI badge image URL contains that exact normalized name.Requires-Python(e.g.>=3.12) is consistent with thepython-3.12%2Bbadge.LicenseisApache-2.0and the hero license badge image containsLicense-Apache_2.0and links to an existingLICENSEfile..github/workflows/ci.ymlexists in the checked-out tree and the CI badge URL matches its path.grep -rn "verity-core" README.mdreturns no matches (no stale package links).- Full
INSTALL_SOURCE=wheel ./tests/e2e_containers/run_e2e.shpasses.
5. Verification Commands¶
cd /Users/ivan/Project/3t.tools.intellij/verityredteam-free
uv run ruff check src tests
uv run pytest tests/unit/test_documentation_parity.py -v
uv run pytest tests/
INSTALL_SOURCE=wheel ./tests/e2e_containers/run_e2e.sh
6. Acceptance Criteria¶
- [ ]
README.mdlines 1–8 contain the four-badge hero row (PyPIverity-redteam-core, Python3.12+, LicenseApache-2.0, CIci.yml) beneath the H1 and above the tagline. - [ ] Every badge target resolves (PyPI project URL, relative
LICENSE,ci.ymlworkflow URL) and the hero block contains zero staleverity-corereferences. - [ ]
test_readme_hero_badges_present_and_validpasses and asserts all four badges, their targets, ordering, and the no-stale-link guard. - [ ] Packaged wheel metadata (
Name,Requires-Python,License) matches the advertised badge claims in the container E2E run. - [ ]
uv run pytest tests/,uv run ruff check src tests, andINSTALL_SOURCE=wheel ./tests/e2e_containers/run_e2e.shpass cleanly.