> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.adid.dev/llms.txt.
> For full documentation content, see https://docs.adid.dev/llms-full.txt.

# Issuer Analytics Data Flow

**Used in:** §4.5 Issuer Analytics, §9.9
**Audience:** Issuer
**IA ID:** extra

```mermaid
flowchart LR
  Issue["POST /credentials/issue"] --> Evt["events table (issuance)"]
  Revoke["POST /credentials/revoke"] --> Evt2["events table (revocation)"]
  Verify["POST /credentials/verify"] --> Evt3["events table (verification)"]

  Evt --> Agg["Aggregator (daily / hourly rollup job)"]
  Evt2 --> Agg
  Evt3 --> Agg

  Agg --> Stats[("issuer_analytics table")]
  Stats --> API["GET /issuers/{did}/analytics"]
  Stats --> ActAPI["GET /issuers/{did}/activity"]
  API --> Portal["IssuerAnalytics.tsx widgets"]
  ActAPI --> Portal
```

**Reading guide:** Raw events are append-only; the aggregator produces materialized rollups read by the dashboard for sub-second queries.

***

## 3. Open Questions (for tech-reviewer)

1. **Status list bit semantics:** does the codebase use a single platform-wide `statusListId` per issuer, or per credential type? Assumed per-issuer in `vc-revocation-statuslist`. Confirm against `vc.go` revoke handler.
2. **ZK challenge transport:** `zkp.go` exposes `/zkp/challenge` but the IA's open question 3 hints DID-Auth `/auth/challenge` is reused for wallet sign-in. Diagrams treat them as separate endpoints; reviewer to confirm there is no conflation.
3. **Agent trust score formula:** weights and decay shown abstractly in `trust-scoring-dataflow`. If the actual formula is documented in `pkg/trust/*` or `AgentTrustRegistry.sol`, doc-writer should append exact constants in §6.6 — diagram remains formula-agnostic.
4. **DB schema accuracy:** the ER diagram is reconstructed from repo conventions and IA section 9. Reviewer should diff it against the latest `migrations/*.sql` (path not yet inspected) and flag drift before this lands in v2.0.
5. **MCP-I capability check granularity:** assumed every `tools/call` triggers a server-side `verify-delegation`. If the runtime caches verifications per session, update `mcp-integration-sequence` to show a cache-hit path.
6. **A2A `.well-known/agent.json`:** the router exposes one global `/.well-known/agent.json` (`router.go:47`). The `a2a-handshake` diagram shows the *remote* peer's discovery URL — confirm with handler whether per-agent endpoints exist.
7. **Wallet MPC threshold:** `wallet-mpc-topology` assumes 2-of-3 with one dormant recovery share. Confirm against `packages/wallet/**` MPC config.
8. **Bulk issuance batching:** `vc-bulk-issuance` shows on-chain anchoring is batched, but the actual batch size and trigger (per-N rows or per-time-window) is not yet sourced. Doc-writer to fill in concrete values from the worker code.
9. **Issuer analytics rollup cadence:** described as "daily/hourly" in `issuer-analytics-dataflow`. Confirm the cron interval used by the aggregator job.
10. **DID-Auth verify endpoint:** the IA notes `/auth/challenge` exists but no canonical "verify-DID-signature" endpoint is named in `router.go`. The OAuth+DID-Auth diagram routes the verified signature through `/auth/verify-otp` or `/auth/login-did`; reviewer should confirm the actual endpoint name and either rename the arrow or open a follow-up to add the route.

***

## 4. Hand-off

* File saved to `/Users/subhransu/Documents/infinia/ida/_workspace/03_diagrams.md`.
* Slug index in §0 maps every diagram to `01_doc_structure.md` §5 IDs and to the doc-writer's `{/* DIAGRAM: <slug> */}` placeholders.
* All 24 IA-mandated diagrams (D1–D24) are present; three extras (`component-layering`, `trust-scoring-dataflow`, `er-diagram-core`, `issuer-analytics-dataflow`) are added per the diagram-maker brief.
* Mermaid blocks use widely-supported syntax (no HTML, quoted parenthetical labels, single `classDef` per diagram).

*End of `03_diagrams.md` — handoff to doc-writer (paste into placeholders) and tech-reviewer (verify open questions).*