fix(QUAL-009): bring app.py into the coverage gate - #123
Open
DoRmAmMu1997 wants to merge 1 commit into
Open
Conversation
The gate measured `--cov=backend --cov=screeners --cov=ui`, so the 927-line Streamlit entrypoint contributed nothing to the 89% floor even though ~14 tests/test_app_*.py modules exercise it. Coverage could regress in app.py without CI noticing - the exact failure the floor exists to prevent. Add `--cov=app` to the command. Note the spelling: `--cov=app.py` makes pytest-cov abort, so the module name is what works. The floor did NOT need re-baselining. app.py measures 76% (290 statements, 69 missed) and pulls the total from 89.97% to 89.71%, which still clears 89 with 0.71pp of headroom - matching the "~0.7pp" figure AGENTS.md already documents. Leaving the number alone also keeps this diff to one flag in six files rather than a floor change nobody asked for. Per AGENTS.md section 7, the command string is updated in every place that mirrors it - the workflow, AGENTS.md, README.md, docs/operations.md, docs/adding-a-screener.md - and in all three assertions in tests/test_supply_chain_policy.py, in the same commit. The three *-handoff.md docs still quote `--cov-fail-under=84`. Those are point-in-time ticket handoffs, so they are left as the historical record they are, exactly like the audit register. Deliberately NOT included: the `--strict-markers` rider suggested on the issue. Its premise was "if a [tool.coverage.run] section is being added anyway" - it is not, because `--cov=app` needs no coverage config. Keeping pyproject.toml untouched preserves the empty section-7 pin diff for this branch. Worth its own small ticket. Closes #120 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #120.
Problem
The gate measured
--cov=backend --cov=screeners --cov=ui, so the 927-line Streamlit entrypoint contributed nothing to the 89% floor — despite roughly 14tests/test_app_*.pymodules actively exercising it. Coverage could regress inapp.pywithout CI noticing, which is the exact failure the floor exists to prevent.The floor did not need re-baselining
This is the useful finding, and it is why the diff is small:
app.pyalone89.71% still clears the 89 floor with 0.71pp of headroom — which matches the "~0.7pp" figure
AGENTS.mdalready documents. So the floor number is untouched, and this PR is one flag in six files rather than a floor change nobody asked for.(Amusingly,
AGENTS.mdclaimed "measured ~89.7%" while the real figure was 89.97%. Includingapp.pymakes that sentence accurate again.)Note on the spelling
--cov=app.pymakes pytest-cov abort outright. The module name--cov=appis what works, and is what landed.Files kept in sync
Per AGENTS.md §7, changing a CI command means co-updating everything that mirrors it, in the same commit:
.github/workflows/quality-and-security.yml:52AGENTS.md§6,README.md,docs/operations.md,docs/adding-a-screener.mdtests/test_supply_chain_policy.py(theCI_COMMANDStuple plus the workflow and README checks)AGENTS.mdalso gains a short note on what is measured and what is not:Dependencies/(an interactive credential helper) andmigrations/(hand-written, covered by the Alembic drift guard instead) stay out on purpose.The three
*-handoff.mddocs still quote--cov-fail-under=84. Those are point-in-time ticket handoffs, so they are left as the historical record they are — same treatment as the audit register.Deliberately not included
The
--strict-markersrider I suggested on the issue. Its premise was "if a[tool.coverage.run]section is being added anyway" — it is not, because--cov=appneeds no coverage config at all. Keepingpyproject.tomluntouched preserves the empty §7 pin diff for this branch. It is worth its own small ticket: there is still no[tool.pytest.ini_options], so a typo'd@pytest.mark.slwowould silently do nothing.Verification
pytest -q --cov=app --cov=backend --cov=screeners --cov=ui --cov-fail-under=89— 2034 passed, 1 skipped, 89.71%ruff check,compileall— cleantests/test_supply_chain_policy.py— 13 passed against the new command stringsgit diff origin/main HEAD -- constraints.txt pyproject.toml— empty🤖 Generated with Claude Code