chore(test): coverage tooling + test-coverage analysis - #373
Open
mavaali wants to merge 1 commit into
Open
Conversation
Adds @vitest/coverage-v8 and a test:coverage script so line/branch coverage can be measured locally and later wired into CI. Ignores the generated coverage/ output. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6TubGkW4b529nMAJNbiRX
mavaali
marked this pull request as ready for review
August 14, 2026 00:24
Contributor
Review summaryReviewed for correctness bugs, simplification/efficiency, and CLAUDE.md invariants (frontmatter-as-metadata, derived SQLite index, git-as-version-layer, advisory-only curation, existence-disclosure rules, No findings. This PR only touches
Nothing to flag. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
@vitest/coverage-v8as a devDependency, atest:coveragescript (vitest run --coverage --coverage.include='src/**/*.ts' --coverage.reportOnFailure), and a.gitignoreentry for the generatedcoverage/directory. This came out of a test-coverage analysis of the codebase (requested via task); the measured baseline and proposed focus areas are below so they're recorded with the tooling that produces them.Measured baseline (main
src/tree only, 2,819 tests)89.2% line / 77.2% branch coverage overall. Leaf/domain logic is very well covered (
fence,canary,hooks,witnessat 100%;curation94.6%,tools92.3%,search92.0%,storage93.7%). The gaps concentrate in orchestration/entrypoint layers:src/index.tsdist/, which v8 coverage doesn't attributesrc/eval/llm.tssrc/cli.tssrc/import/langgraph-store.tssrc/sleep/report.ts54%,index.ts59% — cycle orchestrationsrc/serve/index.tssrc/access/locks.tssrc/storage/backend.tsProposed focus areas
test:coverageinto CI with a threshold (~85% lines) so the baseline can't erode silently — no workflow currently reports coverage.src/access/locks.tsbranches (contested acquire, expired-lock takeover, non-holder release) — highest value per line.eval/llm.tsretry/error/tool-loop against a stubbed SDK client.src/index.tsandsrc/cli.tsinto pure functions and unit-test them (thevalidateServeStartuppattern already used inserveis the precedent).import/langgraph-store.tsbranch matrix.npm run build(dist/-dependent e2e), or when run as root (chmod-unreadable fixtures) —describe.skipIfguards like the ones inaudit.perf/eval smokewould make the suite green anywhere.Test plan
npm run buildpasses locallynpm test— 2,774 passed; the 31 failures are sandbox-environment-only (no network for the HF model download, nodist/at first run, root user defeats chmod fixtures) and reproduce onmainsrc/; every tool gets a test file) — n/a: tooling-only change, nosrc/behavior touchedInvariants
No
src/code touched — tooling/config only, so the CLAUDE.md invariants are unaffected.🤖 Generated with Claude Code
https://claude.ai/code/session_01L6TubGkW4b529nMAJNbiRX
Generated by Claude Code