Fix coverage source inventories and preserve nested c8 counters (re-land of #134 onto main) - #140
Conversation
* Keep the coverage source inventory unique and preserve nested run counters Deduplicate and sort source roots before forming c8 includes and checking reported file presence. Replace three hard-coded fixture inventories with reports derived from runner arguments. Independent real-c8 fixtures verify new-module discovery, unimported-file failure and preservation of parent data. Pin c8 raw counters to the measured repository instead of inheriting a parent NODE_V8_COVERAGE directory that c8 cleans. Update the approved CLI/SDK pin and lockfile to published 2026.9.29 without changing coverage thresholds/exemptions. Validation: 456 tests, zero skips with real pm-slack/pm-csv selections; c8 reports per-file 100 statements/branches/functions/lines over 23 runtime and tooling files. PM-linked snapshot checks pass 11 tests. npm ci, types, lint, duplication, selected docstrings, production/full audits and release gates pass. ops-cl0o remains blocked for full internal documentation (ops-0c8k), default CI opt-in skips and required reviews. No publication or deployment is included. * Isolate every c8 run and independently verify the package source scope Give each coverage invocation unique report and counter directories. Validate its own fresh LCOV, then publish the successful report atomically and clean only that invocation. Preserve a parent using c8's default coverage/tmp. Add two real concurrent same-repository c8 processes, stale-report rejection, cleanup checks, and an independent fast-glob package inventory. A controlled index.ts omission fails the inventory assertion. Factor shared include parsing to retain the zero-duplication gate. Regenerate the existing September 29 changelog heading with pm-changelog after refreshing published tags; this reproduces and fixes the fresh-checkout CI failure without weakening the check or creating a release. Validation: 456 passed, zero failed/skipped/TODO; c8 100 statements, branches, functions and lines per-file across 23 runtime/tooling/template files; PM-linked none/snapshot 11 passed; strict types/lint, duplication, selected docstrings, full/production audits, package allowlist and release contract gates pass. Addresses Sourcery 4137899586/4137911348, CodeRabbit 4137928843 and Greptile 4137938933. Full documentation remains incomplete at 582/1883 declarations, 22/23 modules under ops-0c8k. Parent PR132 and exact-head reviews remain required. No publication, deployment or production data changes. Owner: ops-cl0o. * Invalidate shared coverage evidence when a gate starts or fails The gate previously retained the last successful canonical LCOV after failing. The actual assurance provider could therefore report the earlier 100% result after only tests changed. Invalidate the shared report before measuring and at every failure exit, including preflight. Unexpected failures invalidate in finally; validated successes publish atomically from their private run directory. Peer raw counters remain isolated. Document the generated paths and state. The real-provider regression first measures 100 from c8, changes only a test, observes failure, and requires the provider to refuse the old report. It fails against f801740 and passes with this fix. Existing concurrency, default-parent counter preservation, unimported-module and independent-inventory regressions pass. Validation: full release:check with real pm-slack/pm-csv selections passes 456/456 with zero skips/TODOs, all four c8 columns at 100 per-file across 23 runtime/tooling/template modules; linked PM none/snapshot acceptance passes 11. Strict types/lint, zero duplication, selected documentation, audits, artifact allowlist, changelog/date, attestation and lifecycle contracts pass. Full documentation remains 590/1887 declarations and 22/23 modules. Bun strict health independently reproduces existing upstream1349 with extensions disabled; imports, real ops execution and all five adapter configurations pass. Keep ops-cl0o blocked and unclaimed pending these gates, parent PR132 and reviews. Addresses Greptile 4138181201. No publication or deployment. Blocker: ops-0c8k. * Sort coverage directory listings in coverage gate tests readdirSync does not guarantee lexical order on every filesystem (XFS and tmpfs return hash or creation order), so the three directory assertions in test/coverage-gate.test.ts compared an unsorted listing against an ordered array and could fail on a correct gate. Sort each listing before the deepStrictEqual comparison; single-entry checks stay equivalent. CodeRabbit finding 4138483396. Rebased onto pm-ops#132 head f3e66c3 (main now includes releases 2026.9.28-1 and 2026.9.29). Full release:check passes: 456 tests, 0 failures, 2 existing opt-in real-data skips; coverage 100/100/100/100 across 23 sources. * Record the sorted directory-listing fix and gate evidence on ops-cl0o * Clarify the pm-run timeout against the directly verified gate evidence on ops-cl0o * Route a locked coverage report publish through the gate exit Cubic 4168720026: renameSync failures escaped failRun and the injected exit boundary. A throwing publisher now fails closed with the gate diagnostic. Also record the default-suite skip-count clarification. * Record the cubic skip clarification evidence and release the ops-cl0o claim * Explain the 457-test total in the ops-cl0o land-pass note CodeRabbit 4169890374: the extra test is the failed-publish path. The two default-suite skips are unchanged. * docs(ops): record resumed PR #134 verification * docs(ops): retain verified parent schema disposition --------- Co-authored-by: unbraind <1153461+unbraind@users.noreply.github.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
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 |
Reviewer's GuideThe PR reworks the coverage gate around a sorted, unique package source inventory and per-run c8 isolation, invalidating stale evidence and atomically publishing only fresh validated LCOV reports. It adds extensive real and controlled regressions for concurrency and failure paths, updates the PM CLI pin, documents the behavior, and records PM verification history. Sequence diagram for isolated concurrent c8 coverage runssequenceDiagram
participant RunA as Coverage run A
participant RunB as Coverage run B
participant C8 as c8
participant ADir as run-A directory
participant BDir as run-B directory
participant Canonical as canonical lcov.info
RunA->>Canonical: invalidateReport()
RunB->>Canonical: invalidateReport()
RunA->>ADir: mkdtempSync()
RunB->>BDir: mkdtempSync()
RunA->>C8: spawn(... --reports-dir ADir, --temp-directory ADir/tmp)
RunB->>C8: spawn(... --reports-dir BDir, --temp-directory BDir/tmp)
C8-->>ADir: write fresh LCOV and counters
C8-->>BDir: write fresh LCOV and counters
RunA->>ADir: readFileSync(lcov.info)
RunB->>BDir: readFileSync(lcov.info)
RunA->>Canonical: publishReport(ADir/lcov.info, canonical)
RunB->>Canonical: publishReport(BDir/lcov.info, canonical)
RunA->>ADir: cleanupRun()
RunB->>BDir: cleanupRun()
Flow diagram for the isolated coverage gateflowchart TD
A["Discover coverageGate.sources"] --> B["Collect sorted unique source inventory"]
B --> C["Invalidate canonical coverage/lcov.info"]
C --> D["Create isolated coverage/run-* directory"]
D --> E["Run c8 with isolated report and counter paths"]
E --> F{"Runner succeeded?"}
F -- No --> G["Remove run artifacts and leave canonical report unavailable"]
F -- Yes --> H["Validate fresh LCOV and required source presence"]
H --> I{"Report complete?"}
I -- No --> G
I -- Yes --> J["Atomically publish validated LCOV"]
J --> K{"Publication succeeded?"}
K -- No --> G
K -- Yes --> L["Remove temporary run directory"]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
|
Re-land acknowledged: Greptile 5/5 with no findings, Sourcery's reviewer guide matches the content reviewed across three rounds on #134. CodeRabbit's auto-review skip and Sourcery's budget notice are quota notices (down-voted, no finding). All required checks green; merging. |
Coverage scopes now derive a sorted unique source inventory and independently verify the package denominator. Each c8 invocation isolates its counters/reports, invalidates shared evidence at start or failure, validates a fresh report before atomic publication, and cleans its own artifacts. Real concurrent c8, omitted-source, stale-report, directory-order and failed-publication regressions cover the failure paths. Stacked on #132.
Owner ops-cl0o at this head records the decisions and append-only verification history.
Validation at
881af8bc4c2c87fba557f1e24f5d63053a3041ea:npm run release:checkpasses (457 tests, 455 pass, 2 skips); strict local PM health with required merge drivers, fresh committed-dist comparison, the PM-linked focused test andbun install --no-savepass. Thresholds and gates are unchanged.Configured c8 coverage measures 100/100/100/100 across 23 files. Two existing opt-in fleet tests remain skipped in the default CI gate. Broader documentation, Trivy/ShellCheck and native Bun core #1349 evidence remain separate from these passing checks.
Fresh exact-head CI and substantive reviewer results remain required. This PR remains open for the orchestrator to assess; nothing is merged, published or deployed.
Re-land note: #134 was stacked on the #132 branch and its merge landed on that branch after #132 had already been squashed into main, so none of it reached main. This PR cherry-picks that exact squash (2109bd8) onto main unchanged: same 10 files, +594/-177. Every finding from the #134 review rounds is already addressed in this content.
Summary by cubic
Re-lands the package coverage gate rework onto main — the #134 squash landed on a branch that never reached main. The gate now derives a sorted, unique source inventory from
coverageGate.sourcesfor both the c8 includes and the report-presence check, replacing hand-maintained fixture lists, so adding a source file can no longer break the gate silently.Each c8 invocation gets its own report and counter directories, the shared LCOV is invalidated before measuring and on every failure, and a validated report is atomically published only on success, so concurrent or nested runs can't corrupt one another's data.
@unbrained/pm-clito 2026.9.29.Written for commit 3338ce8. Summary will update on new commits.
Summary by Sourcery
Harden the package coverage gate so every c8 run measures the complete source inventory and publishes only fresh, validated evidence.
Bug Fixes:
Enhancements:
Documentation:
Tests:
Chores: