test(quality): enforce Python branch coverage - #861
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@opencode-agent Review only exact current head The old central trusted-uv prerequisite named in the PR body is stale; protected central Verify the three-file diff only: branch coverage is actually enabled in Inspect current exact-head reviews and unresolved threads. Submit formal APPROVE only if the unchanged head has the required source-backed evidence and no valid product finding; otherwise REQUEST_CHANGES with the first causal boundary and narrowest test-first remediation. Do not edit, merge, weaken protection, rerun unrelated workflows, or duplicate #783. |
Quality outcome
BandScope's Python quickcheck now measures branch coverage as well as statement coverage. Enabling coverage.py branch measurement exposed reachable branch gaps that the former statement-only gate could not see; this PR repairs them with bounded regression tests or removes one logically unreachable branch. No coverage omission, pragma, threshold reduction, or ignored module is used.
Exact current scope
6afbc9fff585a5a7c2bf0454b0673c3f71f1b0e1.develop@acdbea6344fe1231c39535b575f4de35e4c607c9.develop:services/analysis-engine/pyproject.toml: sets[tool.coverage.run] branch = true;services/analysis-engine/src/bandscope_analysis/roles/activity.py: removes the redundantdeact_role in handoffsbranch because every deactivating role is constructed fromcurrent_roles, whose keys initializehandoffs;services/analysis-engine/tests/test_branch_coverage_contract.py: adds focused regressions for branch arcs that statement-only measurement previously hid.Verification-driven RED → GREEN history
4ec36a6c0e03104127b197dd18361956accaccfffailedcirun31919361371and release at the repository Ruff formatter. The affected Python files were formatted with the repository's pinned toolchain through a self-cleaning one-shot workflow; that workflow is absent from the current tree.fcf7e52ac441c92a8950075f1b292c3b3dfc0ff7then reached the substantive RED state: release job95097924193reported3020statements with zero misses and986branches with one partial arc,sections/segmenter.py150->153, for 99.98% total coverage.31920094986, job95098490420, is terminal-success. Its fallback-path report proves 3020/3020 statements and 986/986 branches at 100%, includingsections/segmenter.pyat195statements and74branches with zero misses/partial branches. Public docstrings (D100–D107), Ruff check/format, Bandit, mypy, desktop/shared-types 100% statement/branch/function/line coverage, Python671 passed / 24 skipped, and frontend production build also pass. Skipped native-parity cases in this fallback job are not counted as parity success.cirun31920094933, job95098490111, builds and installs the Rust numeric extension before quickcheck and is terminal-success. It executes all 23/23test_numeric_parity.pycases, reports694 passed / 1 skippedoverall, and independently proves 3020 statements / 986 branches / 0 misses / 0 partial branches = 100%.gate / ci / rust-checkjob95098490180is also terminal-success.build-baselinerun31920094977is now terminal-success. macOS amd64/arm64 and Windows amd64/arm64 builds all succeed; both platform gates succeed. The workflow-intentional Windows arm64 Python-sync skip and release-publish skip are not substituted for test/security evidence.Exact-head security and supply-chain state
Terminal-success exact-head repository gates now include
ci,build-baseline,release,sbom,SAST Semgrep,bandit, andsecret-scan-gate.The two failed exact-head security gates were inspected at job/annotation/log level before classification:
security-auditrun31920095039, job95098490621, fails atnpm audit --workspaces --audit-level=highon the protected-base JavaScript set:nanoid <3.3.18,pdfjs-dist >=5.6.83 <6.2.108, andundici 7.0.0-7.28.0. Python/Rust audit steps are skipped because npm exits first; skipped stages are not success.Security Scanrun31920094950has terminal-success OSV base-vs-head comparison, dependency review, and Scorecard. Its only failed job istrivy-fsjob95098490404: scan and SARIF upload succeed, then the finding gate reports one HIGHCVE-2026-16633for protected-basepdfjs-distatpackage-lock.json:6370and directs remediation to the shared base.This branch has no JavaScript dependency/root-lock delta and exact-head OSV PR-introduced comparison is clean. These whole-tree failures are inherited protected-base evidence owned by canonical dependency-security baseline #783; they are not suppressed, duplicated, or counted as success here.
Review state
Current inline review inspection has no unresolved actionable product thread; the former Scorecard thread referred only to the deleted one-shot formatter workflow and is resolved/outdated. There is no qualifying independent non-author approval for this exact head.
Central owned-coverage/OpenCode evidence remains gated on
ContextualWisdomLab/.github#1020reaching protected centralmain. #1020 explicitly supersedes closed-unmerged #1008; no predecessor check/review/approval evidence transfers. Do not redispatch unchanged reviewer-agent work merely to reproduce that known prerequisite failure.Security Notes
No runtime trust boundary changes. Coverage.py branch measurement is enabled at the analysis-engine package boundary while
--cov-fail-under=100remains unchanged. Exact current-head native and fallback runs prove statement and branch coverage at 100%, while native CI separately proves all 23 Rust↔NumPy numeric-parity cases execute and pass. No dependency, lockfile, user-data, or PII handling change is introduced.Merge gate
Keep Draft until all of the following are true on the then-current exact head/base:
developand this branch is refreshed/revalidated so repository security/audit gates are terminal-success rather than inherited-base failures..github#1020reaches protected centralmainand exact-current-head central coverage/review evidence is terminal-success.Queued, in-progress, skipped-required, failed inherited-base, predecessor-head, protected-base, author/self, or administrative-bypass evidence is not success.