Skip to content

PREWAVE-BE-109 — Replace Hard-Coded Admin Dashboard Counts with Authoritative Metrics #810

Open

Description

@dDevAhmed

Problem context

ProtocolAdminService.getOperationalStats() currently returns hard-coded zero values for total claims, total disputes, active admins, pending claims, and finalized claims, even though the admin dashboard presents these as operational statistics. This makes the dashboard misleading.

Technical scope

Implement the missing metrics using the authoritative database/read-model repositories and clearly define each metric's scope, status, chain/release binding, and freshness. Use bounded queries/aggregates rather than loading full tables. If a metric cannot be computed safely, return an explicit unavailable/stale state rather than zero. Keep on-chain protocol state sourced from finalized projections and distinguish it from operational database counts.

Required tests

  • Seeded fixtures produce exact counts for each metric and status bucket.
  • Pagination/aggregate queries remain bounded under large datasets.
  • Wrong chain/release or stale projection produces explicit unavailable/stale metadata.
  • Empty dataset returns a true zero only when the source is healthy and complete.
  • Authorization tests prevent public access to admin statistics.

Security and architecture constraints

  • Durable state must be consistent across restarts and replicas where the feature is user-, privacy-, security-, or operations-critical.
  • Fail closed when persistence, authorization, policy version, or source provenance cannot be verified.
  • Keep protocol authority in canonical contracts and finalized event projections.
  • Protect contact details, consent records, subject identifiers, capabilities, and audit metadata.
  • Do not create new protocol mutation authority in API services.

Acceptance criteria

  • The process-local-only behavior is replaced by a durable/shared implementation where required.
  • Ownership, role, and privacy boundaries are enforced.
  • Concurrency, restart, retention, and failure behavior are covered by automated tests.
  • Documentation describes the persistence and operational model.
  • Exact-head required CI passes and independent review is recorded.

Dependencies

  • Existing claim, dispute, admin, and finalized projection repositories.

Non-goals

Redesigning the admin dashboard UI or changing claim/dispute lifecycle semantics.

Complexity and points

  • Medium — 150 points

Candidate only. Activation remains maintainer-controlled; do not apply Stellar Wave as part of implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions