Expand real integration coverage and enforce all four coverage floors
This change expands real HTTP/CLI/PostgreSQL tests and enforces all four aggregate coverage metrics. Plan steps, linked tests and bulk closing now persist the intended state. Concurrent clients verify exactly-once mutation fan-out, replay suppression, competing edit history and project watcher delivery.
The all-source 100/100/100/100 acceptance remains open. The gate still measures all 33 src files; scripts and browser sources are explicitly inventoried for follow-up.
| Metric | Comparable resumed c8 baseline | Final verified | Previous floor | New floor |
|---|---|---|---|---|
| Statements | 86.39% | 90.22% | absent | 90% |
| Branches | 80.46% | 79.34% | 79% | 79% |
| Functions | 92.11% | 93.90% (Node 26) / 92.90% (Node 22) | 75% | 92% |
| Lines | 86.39% | 90.22% | 79% | 90% |
The interrupted run's Node built-in baseline was lines 85.00%, branches 81.40%, functions 78.58%. c8 function accounting differs, so changing reporters is not counted as test improvement. The comparable c8 baseline was taken after the recovered route fixes. Branch coverage decreased as newly exercised paths expanded the V8 denominator; its floor is retained. Final counts are statements/lines 10,372/11,496, branches 1,736/2,188 and functions 262/279. A preceding full run measured 79.35% branches due to a one-counter concurrency variation.
The gate uses c8 --all to count unloaded modules at zero, independently checks the source inventory, isolates each measurement's counters and publishes LCOV/JSON only after a successful suite and complete inventory. It invalidates accepted receipts before configuration reads. Real gate subprocess tests cover missing metrics, independent statements enforcement, untouched files and failed-run invalidation.
Regressions fixed, each with persisted behavior assertions:
- pm-web-i1mr: plan step title/body flags.
- pm-web-t0mu: missing step positional argument in plan link/unlink.
- pm-web-957x: linked-test command/note serialization.
- pm-web-culw: close-many selection versus mutation status flag.
- pm-web-4fgv: unconfigured automatic graph sync provisioned an extension before checking Neo4j credentials.
- pm-web-juk7: spawned commands inherited a foreign PM_PATH and targeted another workspace.
- pm-web-sblf: configuration/source failures retained stale accepted coverage reports.
The four recovered route-contract regressions failed on the original implementation; the graph provisioning and foreign-root regressions failed before their fixes. Added OIDC coverage uses an actual disposable HTTPS issuer, PKCE verification, signed RS256 tokens and PostgreSQL identity persistence, including returning login, state rejection and authorization-code replay. Route round trips also cover plan lifecycle, import partial failures, export escaping, filtered bulk previews, task transitions, status shortcuts and linked metadata. The additions do not mock the production units under test or add coverage exclusions.
Validation:
npm ciandPM_FLEET_ROOT=coverage/fleet-fixture npm run coverage: 487/487 tests, zero skips, 115.965 seconds test time, all 33 required files reported, ratcheted thresholds met. The prior same-suite run took 94.759 seconds; builds are additional.npm run typecheck,npm run build:test,npm run lint,npm run duplication(zero clones),npm run docstringandnpm run audit:prod(zero production vulnerabilities): passed.pm test pm-web-fy9a --run --progress: both linked real-database commands passed. Graph, foreign-root and coverage-gate items also have passing linked tests.node --test test/identity-audit.test.tsandpm health --strict-exit --json: passed.pm validate --jsonpasses with existing non-fatal tracker warnings.
Optional external-fleet assertions remain enabled. The first resumed run passed 472/476 tests because the external fleet has pm-jev absent from this package's catalog/snapshot; implicit worktree sibling discovery also misidentifies aliases. Follow-ups are pm-web-s99c and pm-web-cqwm. The passing scoped run supplies a disposable filesystem fleet fixture from the independent committed snapshot. This demonstrates package/snapshot consistency, not external live-fleet freshness.
Owner: pm-web-fy9a. Coverage progress contains exact per-file baseline/final percentages, uncovered lines, untaken branch locations, uncalled functions, outside-gate inventory and reproduction. Largest remaining gaps include GitHub provider routes, pm route/error paths, realtime recovery/SSE shutdown and configured Neo4j integration. All items remain open with claims released. Only the public package worktree and disposable fixtures were changed; no deployment resources were touched.
Summary by Sourcery
Expand real integration coverage and ratchet the aggregate coverage gate while fixing the pm route, workspace isolation, graph provisioning, and stale-report regressions uncovered by the tests.
New Features:
- Expand real HTTP, CLI, PostgreSQL, OIDC, SSE collaboration, and project-watcher integration coverage.
Bug Fixes:
- Correct pm route command contracts for plan steps, plan links, linked tests, and bulk closing so mutations persist the intended state.
- Prevent graph synchronization from provisioning extensions before Neo4j credentials are configured.
- Bind spawned pm commands to the requested workspace and invalidate stale coverage evidence after failed or invalid gate runs.
- Stabilize idempotency retention cleanup and ensure test database pools are released during teardown.
Enhancements:
- Replace the coverage measurement with c8 and enforce independent 90% statements, 90% lines, 79% branches, and 92% functions floors across all 33 source files.
- Add coverage progress documentation and real subprocess validation for source inventory, unloaded modules, independent metrics, and failed-run invalidation.
Build:
- Add c8 as a development dependency and update coverage configuration and lockfiles.
Documentation:
- Document per-file coverage progress, remaining gaps, source inventory, reproduction steps, and open follow-ups.
Tests:
- Add persisted route-contract tests covering plan lifecycle, linked metadata, imports and exports, task transitions, bulk operations, workspace isolation, and linked-test serialization.
- Add real OIDC HTTP tests covering discovery, PKCE, signed tokens, identity persistence, state rejection, and authorization-code replay.
- Add concurrent SSE and watcher integration tests covering exactly-once fan-out, replay suppression, competing edit history, presence authorization, graph errors, and filesystem changes.
- Add real coverage-gate fixture tests for missing metrics, untouched files, independent statement enforcement, and failed-run invalidation.
Summary by cubic
Expands real integration coverage across HTTP, CLI, PostgreSQL, OIDC, SSE collaboration, and watcher delivery, and raises the coverage gate to enforce all four aggregate metrics. Also fixes the pm route contract regressions, workspace isolation, and graph-provisioning bugs the new tests surfaced.
Bug Fixes
- Plan step, plan link, linked-test, and bulk close-many routes now send the argument shapes the pm CLI accepts; close-many selects open items via an authoritative filter, rejects terminal statuses anywhere in the filter, and reads closed items back from the tracker.
- Spawned pm commands pin
PM_PATHto the requested workspace so a foreign tracker root cannot redirect mutations. - Graph auto-sync validates Neo4j credentials before provisioning extensions or opening a driver.
- The coverage gate invalidates accepted reports before reading configuration so stale receipts cannot survive a config or source inventory failure.
- The idempotency retention test now waits for the outcome record to settle before backdating it, fixing a Node 22 race.
Coverage gate
- Measurement moves to c8
--all, so unloaded sources count at zero across all 33srcfiles. - Floors rise to 90% statements, 90% lines, 79% branches, and 92% functions, the highest level both Node 22 and Node 26 measure in CI.
- Adds real subprocess tests for missing metrics, independent statements enforcement, untouched files, and failed-run invalidation, plus OIDC, concurrent SSE mutation, and watcher delivery coverage.
- Adds
c8as a dev dependency and documents per-file progress; the all-source 100/100/100/100 acceptance and the pm-jev catalog refresh remain open.
Summary by CodeRabbit
- Bug Fixes
- Corrected project-management actions for adding tests, editing plan steps, linking records, and filtering bulk closures.
- Ensured project-management commands use the requested workspace, not an inherited tracker location.
- Graph sync now validates Neo4j credentials before provisioning the graph extension and reports errors to connected viewers without changing workspace settings.
- Reliability
- Strengthened coverage checks and added regression tests for coverage reporting, project-management routes, live collaboration, and sign-in flows.