Problem
v2/main's mid-session / step-up auth code (merged via #1608) falls below the ≥90% per-file coverage gate on all four dimensions for several files. This is invisible on v2/main because v2/main's CI does not run the coverage gate — .github/workflows/main.yml on v2/main explicitly notes npm run coverage is "intentionally NOT run in CI" (it runs validate → test:integration → smoke → storybook only).
The gate (#1550) is run in the Wave-1 rollup (1579-wave-1, PR #1601), so merging v2/main into that branch turns CI red on these pre-existing gaps. They are not introduced by the merge — running npm run coverage on a clean v2/main checkout reproduces every failure below.
Failing files (measured on v2/main @ d825af37)
| File |
Stmts |
Branch |
Funcs |
Lines |
Uncovered |
clients/cli/src/cliOAuth.ts |
75 |
78.57 |
75 |
75 |
32–38, 123–137 |
clients/tui/src/components/AuthTab.tsx |
88.46 |
86.73 |
93.33 |
91.78 |
120–121, 139–143 |
clients/tui/src/App.tsx |
79.01 |
82.51 |
85.71 |
79.73 |
large (~430 lines uncovered of 2054) |
The uncovered cliOAuth.ts paths are the interactive step-up code: confirmStepUpFromStdin() (default stdin confirmer) and the AuthRecoveryRequiredError branch of connectInspectorWithOAuth. The existing tests inject a mock confirmer / hit the isUnauthorizedError path, so those lines are never exercised. AuthTab.tsx and App.tsx gaps are the new mid-session-auth TUI surface (keypress handlers, the auth tab's recovery/step-up UI) not reached by the current ink renderer tests.
Decision / approach
Fix at the source on v2/main (not in the rollup), then re-merge v2/main into 1579-wave-1:
Note — a working cliOAuth.ts fix already exists
While resolving the v2/main → 1579-wave-1 merge, cliOAuth.ts was already brought to 100 / 96.42 / 100 / 100 by adding unit tests in clients/cli/__tests__/cliOAuth.test.ts (covering confirmStepUpFromStdin via a mocked node:readline/promises, and the AuthRecoveryRequiredError / isUnauthorizedError branches of connectInspectorWithOAuth). That diff can be lifted onto the v2/main PR verbatim — only the two TUI files need net-new work.
Acceptance criteria
npm run coverage passes (per-file ≥90 on lines/statements/functions/branches) on v2/main.
- No coverage regressions elsewhere; no new
v8 ignore used to mask reachable-but-untested code.
Problem
v2/main's mid-session / step-up auth code (merged via #1608) falls below the ≥90% per-file coverage gate on all four dimensions for several files. This is invisible on
v2/mainbecause v2/main's CI does not run the coverage gate —.github/workflows/main.ymlon v2/main explicitly notesnpm run coverageis "intentionally NOT run in CI" (it runsvalidate→test:integration→smoke→ storybook only).The gate (#1550) is run in the Wave-1 rollup (
1579-wave-1, PR #1601), so mergingv2/maininto that branch turns CI red on these pre-existing gaps. They are not introduced by the merge — runningnpm run coverageon a cleanv2/maincheckout reproduces every failure below.Failing files (measured on
v2/main@d825af37)clients/cli/src/cliOAuth.tsclients/tui/src/components/AuthTab.tsxclients/tui/src/App.tsxThe uncovered
cliOAuth.tspaths are the interactive step-up code:confirmStepUpFromStdin()(default stdin confirmer) and theAuthRecoveryRequiredErrorbranch ofconnectInspectorWithOAuth. The existing tests inject a mock confirmer / hit theisUnauthorizedErrorpath, so those lines are never exercised.AuthTab.tsxandApp.tsxgaps are the new mid-session-auth TUI surface (keypress handlers, the auth tab's recovery/step-up UI) not reached by the current ink renderer tests.Decision / approach
Fix at the source on
v2/main(not in the rollup), then re-mergev2/maininto1579-wave-1:clients/cli/src/cliOAuth.ts→ ≥90 on all four dimensionsclients/tui/src/components/AuthTab.tsx→ ≥90 on all four dimensionsclients/tui/src/App.tsx→ ≥90 on all four dimensions (largest effort — extend the ink-testing-library renderer tests to drive the mid-session-auth keypress/UI paths)npm run coverageis green from the repo root onv2/mainv2/maininto1579-wave-1and confirm the rollup CI is greenNote — a working
cliOAuth.tsfix already existsWhile resolving the
v2/main → 1579-wave-1merge,cliOAuth.tswas already brought to 100 / 96.42 / 100 / 100 by adding unit tests inclients/cli/__tests__/cliOAuth.test.ts(coveringconfirmStepUpFromStdinvia a mockednode:readline/promises, and theAuthRecoveryRequiredError/isUnauthorizedErrorbranches ofconnectInspectorWithOAuth). That diff can be lifted onto the v2/main PR verbatim — only the two TUI files need net-new work.Acceptance criteria
npm run coveragepasses (per-file ≥90 on lines/statements/functions/branches) onv2/main.v8 ignoreused to mask reachable-but-untested code.