Priority: Medium · Area: CI / test coverage · Est. effort: 5–8 h
📌 Problem
vitest.config.ts:17-21 configures coverage thresholds of 95% for branches and lines. package.json provides a test:coverage script.
.github/workflows/ci.yml:31 runs npm run test — the plain runner. grep -c 'test:coverage' .github/workflows/ci.yml returns 0.
So the thresholds have never gated anything across 59 test files, and actual coverage is unknown. There is already evidence of real gaps: src/hooks/useAsync.ts and src/lib/wallet.ts are the only modules in their directories with no test file at all (each tracked separately), so the true figure is very likely below 95%.
🎯 Design decision required
State and defend:
- What is the current coverage? Run it and report per-metric numbers against the configured 95%. Everything else follows from that figure.
- Gate scope. If the repo misses the threshold, do you gate globally at the current level as a ratchet that may only rise, or gate only changed files? Argue which will actually stay enabled — a gate that blocks every PR on pre-existing debt gets removed.
- Which metrics block. Branch coverage is the one that catches untested error paths; say whether you weight it differently from lines.
🧩 Requirements and context
- Do not lower the configured 95% thresholds to make the gate pass. If they are unreachable today, keep them and narrow what is gated, then say so explicitly.
- The coverage run must replace or supplement the existing test step without losing the plain test signal.
- Report the added CI wall-clock cost — coverage instrumentation is slower.
- Coordinate with the
useAsync and wallet.ts test issues: if those land first, the baseline improves. Say how you sequenced.
- All 59 test files must pass.
🛠️ Suggested execution
- Run
npm run test:coverage; paste the full per-metric report.
- Identify the least-covered modules and list them — that inventory is useful beyond this PR.
- Implement your gating decision.
- Prove it fires — delete a test on a scratch branch, show coverage dropping below the floor and the job failing, revert.
- Report runtime cost.
✅ Acceptance criteria
🚫 Out of scope
- Writing tests for
useAsync or wallet.ts — separate issues.
- Adding the typecheck gate — separate issue.
- Changing threshold values.
🧪 Verification
npm ci
npm run test:coverage
npm run lint && npm run build
📤 What your PR must include
- The full per-metric coverage report.
- The least-covered module inventory.
- Your gate-scope and metric-weighting decisions.
- A link to a run failing on a coverage drop, plus runtime cost.
Closes #<n>.
🔒 Security notes
Branch coverage is the metric that tracks untested error paths — the code that runs when a wallet call is rejected, an API request fails, or data is missing. On a financial interface those are the paths where an untested regression becomes user-visible fastest, and they are exactly the branches an unenforced threshold lets erode.
📋 Guidelines
- Minimum 95% test coverage on changed lines
- Clear documentation
- Timeframe: 96 hours from assignment
- One logical change per commit; no merge commits
💬 Join our community
Working on this, or want to sanity-check your approach before you start? Come and ask — the maintainers are there and happy to help.
Telegram: https://t.me/Grainlify
Priority: Medium · Area: CI / test coverage · Est. effort: 5–8 h
📌 Problem
vitest.config.ts:17-21configures coverage thresholds of 95% for branches and lines.package.jsonprovides atest:coveragescript..github/workflows/ci.yml:31runsnpm run test— the plain runner.grep -c 'test:coverage' .github/workflows/ci.ymlreturns 0.So the thresholds have never gated anything across 59 test files, and actual coverage is unknown. There is already evidence of real gaps:
src/hooks/useAsync.tsandsrc/lib/wallet.tsare the only modules in their directories with no test file at all (each tracked separately), so the true figure is very likely below 95%.🎯 Design decision required
State and defend:
🧩 Requirements and context
useAsyncandwallet.tstest issues: if those land first, the baseline improves. Say how you sequenced.🛠️ Suggested execution
npm run test:coverage; paste the full per-metric report.✅ Acceptance criteria
🚫 Out of scope
useAsyncorwallet.ts— separate issues.🧪 Verification
npm ci npm run test:coverage npm run lint && npm run build📤 What your PR must include
Closes #<n>.🔒 Security notes
Branch coverage is the metric that tracks untested error paths — the code that runs when a wallet call is rejected, an API request fails, or data is missing. On a financial interface those are the paths where an untested regression becomes user-visible fastest, and they are exactly the branches an unenforced threshold lets erode.
📋 Guidelines
💬 Join our community
Working on this, or want to sanity-check your approach before you start? Come and ask — the maintainers are there and happy to help.
Telegram: https://t.me/Grainlify