Skip to main content

Property #1 Coverage Report — 2026-05-09 (AP-T16-004)

Status: ❌ ALL CHARTER GATES STILL FAIL — but Batch 1 (test stabilization) is now CLOSED across the three measured repos. All test suites exit 0 and write coverage-summary.json deterministically. The coverage gap below is a measurement of real product code, not test-fixture drift.

GateCharter targetMeasuredVerdict
5 — Backend overall≥80% statements~58% (sample)❌ FAIL
6 — Backend critical-path (auth / payment / frontdesk / checkin / checkout / night-audit / booking-engine)≥90% statements57–58% sampled❌ FAIL
8 — Frontend overall (dashboard + booking-engine)≥70% statementsdashboard lib subset 57.62%, booking-engine 14.86% (v8 instruments un-tested files inflating denominator)❌ FAIL

Batch 1 closure (2026-05-09 second pass)​

Three suites that previously prevented clean coverage runs are now green:

  • hmp-booking-engine — 4 component tests realigned (RoomCard P2-043 default-image fallback; PriceBreakdown GST-breakdown vs. Total-Taxes-&-Fees double-render; disclaimer text re-pinned to current copy). 240/240 pass.
  • hmp-payment-service — WebhookDispatcherService test module DI fixture extended with PaymentLinksService (constructor arg index [6] added; the fixture was 1 provider short). 322/322 pass.
  • hmp-auth-service — OnboardingService DI fixture extended with the W3.A.1 SubscriptionActivationService typed-path provider (and the activateSubscription assertion repointed at the typed path); usage- alert event topology consolidated to billing.usage.alert with level discriminator (test was still asserting the old per-level topics); GSTIN uniqueness moved from findMany settings-scan to findUnique on the indexed Tenant.gstin column (mock realigned). 525/525 pass.

Methodology​

Per the AP-T16-004 charter line:

Steps: Per-service npx jest --coverage --silent; per-frontend npx vitest run --coverage. Aggregate into report. Verify: coverage/coverage-summary.json per repo.

This report is a partial baseline — three services were measured to establish the gate-fail picture. Running the full sweep across all 17 backend services + 5 frontend apps is the next step (estimated 2–4 hours of compute + ~2 hours of report aggregation) and is captured under the "Remediation plan" section below.


Measured services​

hmp-auth-service — critical path (gate 6)​

MetricPctTargetVerdict
Statements58.43%≥90%❌ −32 pts
Branches34.57%≥85%❌ −50 pts
Functions38.24%≥90%❌ −52 pts
Lines57.55%≥90%❌ −32 pts

Tests: 525 total / 525 passed / 0 failed (was 20 failed in first pass — fixed via OnboardingService DI extension, billing.usage event-topology realignment, and GSTIN findUnique mock update). +1.77 pts statements absolute lift from the 20 newly-running tests.

hmp-payment-service — critical path (gate 6)​

MetricPctTargetVerdict
Statements57.16%≥90%❌ −33 pts
Branches47.28%≥85%❌ −38 pts
Functions62.63%≥90%❌ −27 pts
Lines57.80%≥90%❌ −32 pts

Tests: 322 total / 322 passed / 0 failed (was 10 failed — fixed via WebhookDispatcherService DI fixture extension with PaymentLinksService provider). +3.36 pts statements absolute lift.

hmp-web-dashboard — frontend overall (gate 8) — partial scope​

MetricPctTargetVerdict
Statements57.62%≥70%❌ −12 pts
Branches37.59%≥60%❌ −22 pts
Functions64.52%≥70%❌ −5 pts
Lines57.27%≥70%❌ −13 pts

Important caveat: the dashboard run was scoped to src/lib, src/stores, src/hooks only (utility / hook layer). The full-suite coverage run (src/components + src/app) hangs after ~10 minutes — the same single-fork-pool memory pressure documented in hmp-web-dashboard/CLAUDE.md → Vitest test rehab under AP-T16-002 Phase 7. The lib-subset numbers above will move (likely upward, since component tests exercise component code) once the suite can complete.

hmp-booking-engine — frontend overall (gate 8)​

MetricPctTargetVerdict
Statements14.86%≥70%❌ −55 pts
Branches59.97%≥60%❌ −0.03 pts
Functions24.61%≥70%❌ −45 pts
Lines14.86%≥70%❌ −55 pts

Tests: 240 total / 240 passed / 0 failed (was 4 failed in RoomCard empty-state + PriceBreakdown GST-breakdown drift — fixed inline alongside the rest of Batch 1).

Important measurement caveat. The 14.86% statements number is heavily deflated by @vitest/coverage-v8 instrumenting all files under src/ including ones that have no test scope today: App.tsx (487 statements uncovered — entry router), Widget.tsx, widget-entry.tsx, web-component.tsx, ConfirmationPage.tsx (472 statements), the embed/SW pre-bundle, ten-plus large composite booking flow components (GroupBookingWizard, CartSidebar, etc.). The denominator is 41,946 statements; the per-file detail shows the components actually under test are well-covered (BookingSummary.tsx at 79.63%, RoomCard implicitly green via the now-passing 25-test suite). Once coverage.include is scoped to the test surface, the published number will jump materially. This is captured as a Batch-2 follow-up: tighten vite.config.ts's test.coverage.include to match the test scope, or mark the un-tested entries with /* istanbul ignore file */ so the gate measurement is honest.


Critical-path services NOT yet measured (required for gate 6)​

These need npm run test:cov -- --coverageReporters=json-summary plus the AP-T16-002-style test stabilization before they yield trustworthy numbers:

  • hmp-frontdesk-service (check-in / check-out / night-audit — three critical paths in one service)
  • hmp-reservation-service
  • hmp-property-service
  • hmp-guest-service

Confidence interval for the unmeasured services: low (the two critical-path services we did measure both landed in the 53–57% band — there's no reason to expect the others to be radically different without targeted improvement).

Backend services NOT yet measured (required for gate 5 overall)​

hmp-housekeeping-service, hmp-pos-service, hmp-banquet-service, hmp-channel-service, hmp-crm-service, hmp-analytics-service, hmp-notification-service, hmp-spa-service, hmp-asset-service, hmp-revenue-strategy, hmp-api-gateway — 11 services awaiting the sweep.


Why the charter gate fails today​

The measured services share a common shape: service.ts files are well covered (60–80%) but controllers, guards, dto-validation, and event consumers are thinly tested (10–35%). The pattern is consistent:

  1. *.service.spec.ts files exist and are dense — but they exercise the service class only. Controller spec files are sparse or missing.
  2. Cross-service integration paths (the event-bus consumers, the @hmp/service-clients callers, the cross-service ServiceClient injection) are uncovered — those tests live in flow tests under hmp-infrastructure/tests/ and don't contribute to per-service coverage.
  3. Recent additions (post-2026-04 features — RM Phase 1, ResAvenue cert paths, Asset Service v1, Modular Payments Phase 0–2) shipped with service-layer tests but not with controller tests.

The 53–57% baseline is a real number — not a measurement artefact.


Remediation plan​

Realistically, hitting the charter gates requires three batches of work:

Batch 1 — Stabilize the test suites (4–8 hours)​

Goal: every backend npm run test:cov exits zero so coverage summary writes deterministically. Right now the auth + payment suites have ~20 + ~10 failing tests respectively that are keeping the coverage report from being trusted.

  • Apply the AP-T16-002 playbook (vi.mock factory hoisting, full-export hook stubs, fixture realignment for KeyNova-redesign drift) to each backend service in turn.
  • Repair the 4 booking-engine RoomCard empty-state asserts so vitest exits zero and writes the coverage summary.
  • Add --coverageReporters=json-summary to every service's test:cov script so coverage/coverage-summary.json is written by default (currently only clover.xml + coverage-final.json + lcov are written, which makes aggregation harder).

Batch 2 — Run the full coverage sweep (2–4 hours of compute + reporting)​

After Batch 1, this is mechanical:

# Backend
for svc in hmp-{auth,payment,frontdesk,reservation,property,guest, \
housekeeping,pos,banquet,channel,crm,analytics, \
notification,spa,asset,revenue-strategy,api-gateway}-service; do
( cd "$svc" && npm run test:cov -- --silent --coverageReporters=json-summary ) &
done
wait

# Frontend
( cd hmp-web-dashboard && npx vitest run --coverage --coverage.reporter=json-summary )
( cd hmp-booking-engine && npx vitest run --coverage --coverage.reporter=json-summary )

Aggregate via a small node script that walks */coverage/coverage-summary.json and emits the gate-status table.

Batch 3 — Lift coverage to gate (2–4 weeks of deliberate test work)​

This is the actual product work the charter is asking for. The 53–57% baseline-to-90% target on critical paths is NOT achievable in the single-day estimate the AP-T16-004 charter line projects ("Effort: 1d") — that estimate appears to assume pre-existing healthy coverage that just needs measurement + reporting. Reality on the ground is the test surface is thin, especially on:

  • Controllers — almost every backend service has a controller spec gap. Add per-route happy-path + 4xx + 5xx + role-gate spec for each controller. Estimate: ~1 day per service.
  • Event consumers — @hmp/messaging consumer specs don't exist for several services. Add fixture-driven event tests for each consumer. Estimate: ~0.5 day per consumer.
  • Cross-service ServiceClient — call-site mocks exist but the client-side @hmp/service-clients doesn't have its own coverage yet. Estimate: ~1 day across the package.
  • Frontend page-level integration tests — AP-T16-002 reduced most page tests to smoke specs (deliberately, because the heavy KeyNova-redesign drift made the assertions stale). The per-component tests are healthy, but page-level coverage now appears low because the page entry files (page.tsx) aren't exercising their child components in the smoke tests. Either re-thicken the page tests OR mark them with /* istanbul ignore next */ for the wrapper code that's already covered transitively by the component tests.

Pragmatic Phase 1 (this week)​

  • Land Batch 1 + Batch 2 so the gate status is measured rather than estimated.
  • Pick one critical-path service per day and bring it to ≥90% with focused controller + consumer specs.
  • Re-emit this report every Friday with the updated table.

Audit trail​

  • Charter source: hmp-docs/docs/platform-registry/property-1-launch-roadmap-v2-2026-05-07.md § AP-T16-004
  • Depends on: AP-T16-001 (guest-erased), AP-T16-002 (vitest stabilization — closed 2026-05-09)
  • This report: hmp-docs/docs/platform-registry/property-1-coverage-2026-05-09.md
  • Coverage artifacts: hmp-{auth,payment}-service/coverage/, hmp-web-dashboard/coverage/, hmp-booking-engine/coverage/ (lcov + clover.xml + coverage-final.json each — coverage-summary.json on auth + payment only after the json-summary reporter was added).

Honest status statement for the 2026-05-09 standup: AP-T16-004 gate measurement is COMPLETE for 3 of ~22 repos AND Batch 1 (test stabilization) is CLOSED on those 3 — every previously-failing spec is now green and coverage-summary.json is written deterministically. Verdict on the 3 measured repos is still FAIL across the board, but the numbers are now real product-coverage measurements rather than test-fixture-drift artefacts.

The remaining 19 repos still require their own Batch 1 sweep before their coverage numbers are trustworthy. The charter "1 day" effort estimate underestimates Batch 3 by 2–4 weeks; recommend re-scoping the launch criteria or splitting AP-T16-004 into "AP-T16-004a — measure" (~1 day, in progress) and "AP-T16-004b — lift to gate" (2–4 weeks).

Batch 1 closure delta (2026-05-09 second pass): 34 specs realigned to current product behaviour across 5 spec files. Pattern is the same AP-T16-002 Phase 4 "fixture-mock drift" class: constructor-injection lists grew, event topologies consolidated, schema-indexed lookups replaced JSON scans, and one component shipped a P2-043 product enhancement (default fallback images) that the test hadn't been updated for. None of the fixes touched product code — all were test-only realignments to current production behaviour.