Repository navigation
Conversation
One job, one instrumented run, two gates fed by it: cargo-tarpaulin runs the whole suite (the coverage run IS the test run -- tarpaulin exits non-zero on any test failure) and writes lcov.info, which cargo-crap then scores (CRAP = CC^2*(1-cov)^3 + CC; without the coverage feed every function scores cov=0 and the ceiling measures nothing). Both tools are pinned release tarballs (tarpaulin 0.37.5, cargo-crap 0.6.1) with asserted exact versions. The ptrace engine is blocked on the fleet's sysbox-confined runners (EPERM), so the job uses --engine Llvm with llvm-tools-preview. Measured on the first run (ptrace, build host): 62.47% line coverage (10249/16405), worst maintained-surface CRAP 425.5 (handle_session_browser_key, crates/pawan-cli/src/tui/events/ default.rs:36, CC 22, 5.9% cov). Floors: coverage 59, CRAP 510.
Member
Author
|
Superseded by #141 — please keep that one for review; this one can close. To be fair to the work here: this was a working gate, not a failed attempt — the job already produced the byte-exact
Also practical: both PRs need the owner's approval under pawan's protection, and two competing gate PRs would split that review. The ratchet rule from here (raise the floor in whole points as coverage improves) carries over to #141. |
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.
What this adds
One CI job,
coverage-crap, with TWO gates fed by ONE instrumented run:--fail-under 59.cargo crap --lcov lcov.info --workspace --exclude '**/main.rs' --threshold 510 --fail-above). cargo-crap never runs tests itself: it parses source with syn and computes CRAP(m) = CC²·(1−cov)³ + CC. With no coverage feed every function scores cov=0 and CRAP collapses to CC³+CC, so the ceiling would measure nothing — that is why the two gates live in one job.Both tools install from per-arch release tarballs at exact asserted versions (
cargo-tarpaulin --version | grep -qx "tarpaulin 0.37.5", same for crap), so two runs cannot disagree because one host had a newer tool.Measured first-run numbers (2026-10-10, tarpaulin 0.37.5)
handle_session_browser_key(crates/pawan-cli/src/tui/events/default.rs:36, CC 22, 5.9% coverage). Next:LspTool::execute377.8 (crates/pawan-core/src/tools/lsp_tool.rs:276, CC 30),OllamaBackend::streaming240.0.run(crates/pawan-cli/src/main.rs:918, CC 42, CRAP 1806) and the othermain.rsfunctions (870/506/462/380) — argument parsing and process wiring, 0% covered by design, like skywalkers' spike exclusion and git-sync'smain.rsexclusion. 1053 functions are scored.Thresholds + rationale
Ratchet rule
Runner choice
ubuntu-latest, matching every existing job in this workflow. pawan is a public repo, so GitHub-hosted runners work (private dirmacs repos get zero-step admission refusal there). The self-hosted arm64 fleet labels are not needed.Engine choice (measured, not preferred)
--engine Ptracewas the first choice and is blocked on the fleet: tarpaulin's ptrace engine fails in the sysbox-confined runner containers withASLR disable failed: EPERM: Operation not permitted(measured on dirmacs/skywalkers run 38064108686).autowould fall back silently, so the job pins--engine Llvmwith thellvm-tools-previewcomponent. The thresholds above were measured under ptrace on the build host and carry the stated margins for that delta.DB needs
None. No Postgres/Redis; live tests are env-gated (
PAWAN_NVIDIA_LIVE_TUI,PAWAN_RMUX_LIVE,#[ignore]live cases) and run nowhere in CI. The job does install the same test deps as thetestjob (protobuf-compiler, ripgrep, fd-find + thefdsymlink) because the suite shells out torg/fdand the workspace builds prost types.Caveats
grind/is a separate 16-crate workspace (own Cargo.lock, run bymise grind-test), not a root-workspace member. tarpaulin lists 9 of its files in the LCOV at 0% coverage as a scanning artifact (it is in the 16405 denominator, which makes the coverage floor conservative); cargo-crap--workspacedoes not score it. Nogrind/gate is proposed here.crates/pawan-core/src/agent/backend/lancor.rsis behind the optionallancorfeature and is not built by the default test run, so it appears in neither the LCOV nor the CRAP report — consistent in CI, which also runs default features only.testjob runscargo test --workspace --docseparately; tarpaulin runs them as part of itscargo testinvocation.crap.jsonwith shell only (no python3 — the runner images carry none) and can never fail the job.Required-check intent
pawan is public, so this gate is intended to become a required check on
mainonce its first CI run is green — the wiring (branch protection) is the repo owner's action and is deliberately not taken by this PR.First CI run results (verified green)
Run 38067951458 — all five jobs pass, including
Coverage + CRAP:testjob: 1836 tests passed, 12 skipped).**/main.rsexcluded (worst measured locally under ptrace: 425.5).