[P0] Enforce 80% Rust and frontend coverage with explained shortfalls #40

Closed
opened 2026-10-22 03:03:02 +02:00 by amiryahaya · 1 comment
Owner

Outcome

Enforce SRS NFR-MAINT-007: at least 80% line coverage, measured separately for first-party Rust workspace code and React/TypeScript application code, with explicit reasons/remediation for any shortfall.

Priority and prerequisites

P0, M1. Follow-up to #6; integrate the real PostgreSQL contracts from #8 before finalizing backend instrumentation. Complete this test infrastructure before expanding application features.

Current gap and risk

The frontend scaffold currently has type checking and production builds but no test runner/coverage instrumentation. Its coverage is unmeasured, so the 80% minimum is not demonstrated. This is a scoped foundation-stage shortfall; UI behavior remains unverified by coverage until this issue is completed. PR #39 records the Rust measurement separately. Neither a successful build nor passing tests alone is coverage evidence.

Acceptance criteria

  • Measure first-party Rust and React/TypeScript line coverage independently, retaining reports with revision and exact commands.
  • Backend coverage includes unit/shared contract and real-service integration execution; explicitly ignored database tests must run in coverage collection.
  • Add meaningful frontend behavior tests and instrumentation; achieve >=80% line coverage.
  • CI enforces >=80% for each component. Any below-threshold/unmeasured result must include actual result, affected scope, concrete reason, risk, and linked remediation in PR/release evidence; no silent threshold bypass.
  • Document all denominator/exclusion choices. Exclude generated/vendor/test code as appropriate; do not hide difficult first-party application paths or add tests that merely mirror implementation.
  • Coverage complements denial-path/security and real-service guarantees; it does not replace them.

Requirement requested by the user during #8 implementation; see docs/SRS.md NFR-MAINT-007 and docs/architecture.md §5.2.

## Outcome Enforce SRS NFR-MAINT-007: at least **80% line coverage**, measured separately for first-party Rust workspace code and React/TypeScript application code, with explicit reasons/remediation for any shortfall. ## Priority and prerequisites P0, M1. Follow-up to #6; integrate the real PostgreSQL contracts from #8 before finalizing backend instrumentation. Complete this test infrastructure before expanding application features. ## Current gap and risk The frontend scaffold currently has type checking and production builds but no test runner/coverage instrumentation. Its coverage is **unmeasured**, so the 80% minimum is not demonstrated. This is a scoped foundation-stage shortfall; UI behavior remains unverified by coverage until this issue is completed. PR #39 records the Rust measurement separately. Neither a successful build nor passing tests alone is coverage evidence. ## Acceptance criteria - [ ] Measure first-party Rust and React/TypeScript line coverage independently, retaining reports with revision and exact commands. - [ ] Backend coverage includes unit/shared contract and real-service integration execution; explicitly ignored database tests must run in coverage collection. - [ ] Add meaningful frontend behavior tests and instrumentation; achieve >=80% line coverage. - [ ] CI enforces >=80% for each component. Any below-threshold/unmeasured result must include actual result, affected scope, concrete reason, risk, and linked remediation in PR/release evidence; no silent threshold bypass. - [ ] Document all denominator/exclusion choices. Exclude generated/vendor/test code as appropriate; do not hide difficult first-party application paths or add tests that merely mirror implementation. - [ ] Coverage complements denial-path/security and real-service guarantees; it does not replace them. Requirement requested by the user during #8 implementation; see docs/SRS.md NFR-MAINT-007 and docs/architecture.md §5.2.
Author
Owner

Baseline recorded by PR #39 at e12e70a78a209359f0da985336f26d4b6930b478: Rust application-only line coverage 87.29% (632/724), including all 14 real PostgreSQL tests. Test fixtures are excluded; API/migration entry points remain included. Frontend is unmeasured because its scaffold currently has typecheck/build but no behavior-test/coverage tooling. The concrete reason, risk and remediation are recorded in coverage evidence, alongside the normalized LLVM report. Functional CI passed; the separate coverage gates and frontend coverage remain the work of this issue.

Baseline recorded by PR #39 at `e12e70a78a209359f0da985336f26d4b6930b478`: Rust application-only line coverage **87.29% (632/724)**, including all 14 real PostgreSQL tests. Test fixtures are excluded; API/migration entry points remain included. Frontend is **unmeasured** because its scaffold currently has typecheck/build but no behavior-test/coverage tooling. The concrete reason, risk and remediation are recorded in [coverage evidence](https://forgejo.primatekun.tech/primatekuntech/rag-rust/src/commit/e12e70a78a209359f0da985336f26d4b6930b478/docs/verification/2026-10-22-coverage.md), alongside the normalized LLVM report. Functional CI passed; the separate coverage gates and frontend coverage remain the work of this issue.
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
primatekuntech/rag-rust#40
No description provided.