Files
git.stella-ops.org/docs/features/checked/graph/graph-indexer-clustering-and-centrality-background-jobs.md

2.4 KiB

Graph Indexer Clustering and Centrality Background Jobs

Module

Graph

Status

VERIFIED

Description

Background hosted service that runs graph analytics (Louvain community detection, betweenness/closeness centrality) on the dependency graph, producing cluster assignments and centrality scores for risk prioritization.

Implementation Details

  • Hosted service: src/Graph/StellaOps.Graph.Indexer/Analytics/GraphAnalyticsHostedService.cs -- background service that schedules clustering and centrality jobs
  • Analytics engine: src/Graph/StellaOps.Graph.Indexer/Analytics/GraphAnalyticsEngine.cs -- Louvain community detection and betweenness/closeness centrality algorithms
  • Analytics pipeline: src/Graph/StellaOps.Graph.Indexer/Analytics/GraphAnalyticsPipeline.cs -- orchestrates multi-stage analytics (clustering -> centrality -> export)
  • Analytics types: src/Graph/StellaOps.Graph.Indexer/Analytics/GraphAnalyticsTypes.cs -- ClusterAssignment, centrality score models
  • Metrics: src/Graph/StellaOps.Graph.Indexer/Analytics/GraphAnalyticsMetrics.cs -- job execution metrics (duration, cluster count, centrality stats)
  • Options: src/Graph/StellaOps.Graph.Indexer/Analytics/GraphAnalyticsOptions.cs -- configurable job intervals and algorithm parameters
  • Snapshot provider: src/Graph/StellaOps.Graph.Indexer/Analytics/InMemoryGraphSnapshotProvider.cs -- provides graph snapshot for analytics input
  • Postgres writer: src/Graph/__Libraries/StellaOps.Graph.Indexer.Persistence/Postgres/Repositories/PostgresGraphAnalyticsWriter.cs -- persists cluster and centrality results
  • Tests: src/Graph/__Tests/StellaOps.Graph.Indexer.Tests/GraphAnalyticsEngineTests.cs, GraphAnalyticsPipelineTests.cs
  • Source: SPRINT_0141_0001_0001_graph_indexer.md

E2E Test Plan

  • Verify Louvain community detection produces stable cluster assignments
  • Test betweenness and closeness centrality score computation
  • Verify background service runs on configured schedule
  • Test analytics results are persisted to PostgreSQL (skipped: Docker unavailable)
  • Verify metrics are emitted for job duration and cluster counts

Verification

  • Run ID: run-001
  • Date: 2026-02-09T16:00:00Z
  • Tier: 1 (Build + Test)
  • Result: PASS
  • Evidence: Graph.Indexer.Tests 37/37 pass (clustering/centrality tests covered). All source files verified (10/10).