Coverage: ratchet from the measured 40.6% baseline to the 95% target #8

Open
opened 2026-07-09 22:21:58 -03:00 by navigator · 0 comments
Owner

First real measurement (2026-07-09, cargo llvm-cov, full workspace, real PostgreSQL): 40.62% lines (35,422 lines, 21,032 uncovered). The previous 80% CI gate had never actually run; it is now a ratchet (fail-under-lines 40) that must only move UP.

Where the uncovered mass lives (missed lines):

  • gateway/federation.rs 2600 · mastodon_api.rs 1423 · social_graph.rs 1272 · federation_feed.rs 761 — the fediverso surface
  • platform/auth: queries 679 · profile 582 · http 562 · mandate_invite 390 · signup_verify 330
  • gateway admin/reports/activity modules: admin_reports 633 · parlamentar_activity 527 · reports 507 · amendments 454 · admin_ext 422 · admin_users 386 · invitations 360 · note_media 360 · fediverso_admin 348 · mastodon_oauth 320 · polls 311 · discovery 311 · worker 305 · signup_gates 302 · govbr_oidc 275
  • spaces/mandates/parties.rs 159 · spaces/initiatives/http.rs 194 (0%)

Plan (each step raises the ratchet in the same PR):

  1. crates/gateway/tests/http_surface.rs — oneshot harness (auth/authz gates, input validation, public read surface, preferences loop). 19 tests.
  2. Extend the harness to the fediverso surface (webfinger/actors/outbox as anonymous reads; social_graph CRUD with a session; mastodon_api timelines) — biggest single win (~5k lines).
  3. platform/auth service-level tests for profile/mandate_invite/signup_verify flows (harness already exists in tests/integration.rs).
  4. Admin surface via the same oneshot harness with a granted role (admin_users, admin_reports, fediverso_admin, invitations, webhooks CRUD).
  5. Isolate network-bound proxies (parlamentar_activity, reports fetch) behind injectable fetchers so their logic is testable offline.

Half of new tests security-flavored (gates, validation, leak checks), half functional (loop behavior) — per the standing instruction.

First real measurement (2026-07-09, cargo llvm-cov, full workspace, real PostgreSQL): **40.62% lines** (35,422 lines, 21,032 uncovered). The previous 80% CI gate had never actually run; it is now a ratchet (fail-under-lines 40) that must only move UP. **Where the uncovered mass lives (missed lines):** - `gateway/federation.rs` 2600 · `mastodon_api.rs` 1423 · `social_graph.rs` 1272 · `federation_feed.rs` 761 — the fediverso surface - `platform/auth`: queries 679 · profile 582 · http 562 · mandate_invite 390 · signup_verify 330 - `gateway` admin/reports/activity modules: admin_reports 633 · parlamentar_activity 527 · reports 507 · amendments 454 · admin_ext 422 · admin_users 386 · invitations 360 · note_media 360 · fediverso_admin 348 · mastodon_oauth 320 · polls 311 · discovery 311 · worker 305 · signup_gates 302 · govbr_oidc 275 - `spaces/mandates/parties.rs` 159 · `spaces/initiatives/http.rs` 194 (0%) **Plan (each step raises the ratchet in the same PR):** 1. ✅ `crates/gateway/tests/http_surface.rs` — oneshot harness (auth/authz gates, input validation, public read surface, preferences loop). 19 tests. 2. Extend the harness to the fediverso surface (webfinger/actors/outbox as anonymous reads; social_graph CRUD with a session; mastodon_api timelines) — biggest single win (~5k lines). 3. `platform/auth` service-level tests for profile/mandate_invite/signup_verify flows (harness already exists in `tests/integration.rs`). 4. Admin surface via the same oneshot harness with a granted role (admin_users, admin_reports, fediverso_admin, invitations, webhooks CRUD). 5. Isolate network-bound proxies (parlamentar_activity, reports fetch) behind injectable fetchers so their logic is testable offline. Half of new tests security-flavored (gates, validation, leak checks), half functional (loop behavior) — per the standing instruction.
Sign in to join this conversation.
No milestone
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.

Dependencies

No dependencies set.

Reference
brasil/democracia-social#8
No description provided.