Repository navigation
docs(contributing): record the four negative-count BRDA branches as a v8 await artifact, not a gap - #511
Conversation
… v8 await artifact, not a gap The unit coverage run lists close.ts:39, reopen.ts:36, approve.ts:504 and auth.ts:220 as uncovered branches although every test run drives both arms; coverage/lcov.info carries a negative hit count for each. They are the implicit else of an if that follows a short-circuited await: V8 opens a new block-count range when the async function resumes, so the enclosing count misses the calls that never awaited, and enclosing minus then goes negative. Add a section to the Testing chapter naming the four lines, the awk recognizer for negative BRDA records, a minimal reproduction against @vitest/coverage-v8 5.0.4, and the instruction not to paper over them with v8-ignore markers or a lower threshold. Refs #507 Signed-off-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com>
|
Important Held for human review by the hive's ACMM level gate. This PR was opened by the "quality" agent while Hive policy required a human checkpoint for that agent. Agent PRs are held at ACMM L3–L5; an Hive will keep the |
|
Please add a kind label with |
mrbobbytables
left a comment
There was a problem hiding this comment.
Copilot review performed under the maintainer's explicit authorization to update, review, release reviewed holds, and merge eligible PRs in this cleanup.
The documentation records the negative-count BRDA artifact, a recognizer and a reduced reproduction, without lowering thresholds or hiding covered branches. The upstream-report follow-up remains independently tracked in #550.
Verified successful build-test, e2e-coverage and DCO results on head 3ffa788. Any folded issue findings remain assigned to the canonical destinations in the updated scope tables.
Coverage documentation
npm run test:coverageonmain@ 88241f4 reports 100 % lines / 99.75 % branches (1652/1656), and the four "uncovered" branches areclose.ts:39,reopen.ts:36,approve.ts:504,auth.ts:220. All four arms are driven by the suite;coverage/lcov.infocarries a negative hit count for each (BRDA:39,3,1,-3,BRDA:36,3,1,-1,BRDA:504,80,1,-6,BRDA:220,13,1,-51), and the e2e run repeats the last two (-28,-43). The folded finding on #507 asked for this to be recorded indocs/contributing.mdso the lines stop being re-triaged as gaps; #500 merged without it.This adds a "Phantom uncovered branches after an
await" section to the Testing chapter ofdocs/contributing.md: the four lines, the mechanism, anawkrecognizer for negativeBRDArecords, a minimal reproduction, and the instruction not to add/* v8 ignore */markers or lower the branch floor for them.Files:
docs/contributing.mdonly. Nosrc/, test ordist/change. Disjoint from #510 (src/utils/auth.ts,dist/index.js).Root cause (reduced locally,
@vitest/coverage-v85.0.4)The prior finding guessed "an
ifafter a multi-line awaited condition". Reduction shows formatting is irrelevant; the trigger is anawaitthat is only sometimes reached before theif:gate(true,false)×3,gate(false,true),gate(false,false)→BRDA:3,1,0,4/BRDA:3,1,1,-2. V8 opens a new block-count range where the async function resumes, so the range enclosing theifcounts only the two calls that awaited; the then-block counts all four; the implicit else (enclosing − then) is −2 although it ran once. A ternary with anawaitin each arm (approve.ts:504,auth.ts:220shape) is miscounted the same way (enclosing = resumptions from the last await only; the else read 1 when it ran 6 times in the reduction). An explicitelse { … }block is counted correctly because it owns a range of its own. A trivial unconditionalawaitbefore theifis counted correctly.Verification (this branch, local)
npx vitest run __tests__/docsYamlExamples.test.ts __tests__/version.test.ts __tests__/configurationDocs.test.ts(the suites that walkdocs/*.md): 3 files / 130 tests passnpx eslint docs/contributing.md: cleanawkrecognizer in the note, run oncoverage/lcov.infofrommain@ 88241f4, prints exactly the four records aboveRelated Issue
Refs #507 — ticks the
docs/contributing.mdbox of the folded BRDA finding on that tracker. The issue's own two boxes (auth.ts:24) are #510's. The remaining box of the folded finding, a vitest-dev/vitest report with the reproduction above, needs a human: this lane cannot file outside cncf/prow-github-actions.Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88