test(platform): pin platform()'s no-platform throw and installed-scope fall-back (src/platform/index.ts:49,51) #609
All Vouch review confidence checks passed
Residual risk 0.18 = Change Risk (0.42) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.42 · 342 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.349
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #609"
general
weight: 0.35
jeefy
Test Improvement
Adds
__tests__/platform/platformGuards.test.ts, three cases for the two arms ofplatform()(src/platform/index.ts, added by #607) that no suite reaches:throw new Error('no platform installed: …')on line 51 when nothing has installed a platform;?? currentfall-back on line 49, from an installedPlatformScopewhoseget()has no platform for the current work (an adapter'sAsyncLocalStorageoutside any run) to the process-wide value — and the throw when that fall-back is empty too.Each case imports
src/platformfresh (vi.resetModules()before and after) so the empty slot and the installed scope never touch the platformsetup.tsgives every other test; the scope used is a tiny flag-based one rather thanAsyncLocalStoragebecause the arm under test is "scope has nothing", not concurrency, whichrunState.test.tsalready pins.Why. Both coverage runs at
main@8878c9dreport the same miss — unit (local, and CI artifactcoverage-8878c9d…of run 40801080844):DA:51,0,BRDA:49,0,1,0; bundle (artifactcoverage-e2e-8878c9d…, same run):DA:51,0,BRDA:49,2,1,0. The run was still green at 99.95 % lines (2470/2471) because the floor invitest.config.mjsis 99, so a guard written today landed with no test able to notice it being removed. Whether that floor should now be 100 lines is a maintainer call recorded as a folded finding on the coverage tracker; this PR only closes the gap.Files / cluster claimed — one new file,
__tests__/platform/platformGuards.test.ts. Disjoint from every held PR: #591/#593/#597 (plugin, dispatcher, label tests), #595 (setup.ts, config type guards), #596 (bundle scenario), #598 (testUtils.ts, ordering), #599 (tsconfig.test.json), #601 (coverageIgnoreHints.test.ts), #603 (runtime.test.ts), #605 (setupQuietActionsCore.ts). Nosrc/,dist/, config or docs file is touched.Testing
npx vitest run __tests__/platform— 4 files, 20 passednpx vitest run --coverage --exclude '__tests__/bundle/'— 106 files, 1954 passed / 75 skipped; Lines 100 % (2471/2471)*, branches 99.76 % (the four remaining arm misses —close.ts:37,reopen.ts:34,approve.ts:502,auth.ts:224— predate #607 and are not touched here)npx eslint __tests__/platform/platformGuards.test.ts— clean?? currentfall-back fromplatform()fails "falls back to the process-wide platform…"; replacing the throw withreturn found as Platformfails both throw cases---
Filed by quality agent (hold-gated mode). Human review required.*
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88