sprints and audit work

This commit is contained in:
StellaOps Bot
2026-01-07 09:36:16 +02:00
parent 05833e0af2
commit ab364c6032
377 changed files with 64534 additions and 1627 deletions

View File

@@ -19,8 +19,7 @@ public static class VexLensEndpointExtensions
public static IEndpointRouteBuilder MapVexLensEndpoints(this IEndpointRouteBuilder app)
{
var group = app.MapGroup("/api/v1/vexlens")
.WithTags("VexLens")
.WithOpenApi();
.WithTags("VexLens");
// Consensus endpoints
group.MapPost("/consensus", ComputeConsensusAsync)
@@ -78,8 +77,7 @@ public static class VexLensEndpointExtensions
// Delta/Noise-Gating endpoints
var deltaGroup = app.MapGroup("/api/v1/vexlens/deltas")
.WithTags("VexLens Delta")
.WithOpenApi();
.WithTags("VexLens Delta");
deltaGroup.MapPost("/compute", ComputeDeltaAsync)
.WithName("ComputeDelta")
@@ -88,8 +86,7 @@ public static class VexLensEndpointExtensions
.Produces(StatusCodes.Status400BadRequest);
var gatingGroup = app.MapGroup("/api/v1/vexlens/gating")
.WithTags("VexLens Gating")
.WithOpenApi();
.WithTags("VexLens Gating");
gatingGroup.MapGet("/statistics", GetGatingStatisticsAsync)
.WithName("GetGatingStatistics")
@@ -104,8 +101,7 @@ public static class VexLensEndpointExtensions
// Issuer endpoints
var issuerGroup = app.MapGroup("/api/v1/vexlens/issuers")
.WithTags("VexLens Issuers")
.WithOpenApi();
.WithTags("VexLens Issuers");
issuerGroup.MapGet("/", ListIssuersAsync)
.WithName("ListIssuers")
@@ -375,8 +371,8 @@ public static class VexLensEndpointExtensions
SnapshotId: gatedSnapshot.SnapshotId,
Digest: gatedSnapshot.Digest,
CreatedAt: gatedSnapshot.CreatedAt,
EdgeCount: gatedSnapshot.Edges.Count,
VerdictCount: gatedSnapshot.Verdicts.Count,
EdgeCount: gatedSnapshot.Edges.Length,
VerdictCount: gatedSnapshot.Verdicts.Length,
Statistics: NoiseGatingApiMapper.MapStatistics(gatedSnapshot.Statistics)));
}

View File

@@ -5,9 +5,13 @@ using Serilog;
using StellaOps.VexLens.Api;
using StellaOps.VexLens.Consensus;
using StellaOps.VexLens.Persistence;
using StellaOps.VexLens.Persistence.Postgres;
using StellaOps.VexLens.Storage;
using StellaOps.VexLens.Trust;
using StellaOps.VexLens.Verification;
using StellaOps.VexLens.WebService.Extensions;
using System.Threading.RateLimiting;
using Microsoft.AspNetCore.RateLimiting;
var builder = WebApplication.CreateBuilder(args);
@@ -40,22 +44,15 @@ builder.Services.AddOpenTelemetry()
});
// Configure VexLens services
builder.Services.AddSingleton<IVexConsensusEngine, DefaultVexConsensusEngine>();
builder.Services.AddSingleton<ITrustWeightEngine, DefaultTrustWeightEngine>();
builder.Services.AddSingleton<IVexConsensusEngine, VexConsensusEngine>();
builder.Services.AddSingleton<ITrustWeightEngine, TrustWeightEngine>();
builder.Services.AddSingleton<IConsensusProjectionStore, InMemoryConsensusProjectionStore>();
builder.Services.AddSingleton<IIssuerDirectory, InMemoryIssuerDirectory>();
builder.Services.AddSingleton<IVexStatementProvider, NullVexStatementProvider>();
builder.Services.AddScoped<IVexLensApiService, VexLensApiService>();
// Configure PostgreSQL persistence if configured
var connectionString = builder.Configuration.GetConnectionString("VexLens");
if (!string.IsNullOrEmpty(connectionString))
{
builder.Services.AddSingleton<IConsensusProjectionStore>(sp =>
new PostgresConsensusProjectionStore(connectionString, "vexlens"));
builder.Services.AddSingleton<IIssuerDirectory>(sp =>
new PostgresIssuerDirectory(connectionString, "vexlens"));
}
// Note: PostgreSQL persistence configuration requires VexLens persistence service registration
// For now, using in-memory stores configured above
// Configure health checks
builder.Services.AddHealthChecks();

View File

@@ -0,0 +1,12 @@
{
"profiles": {
"StellaOps.VexLens.WebService": {
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "https://localhost:52412;http://localhost:52414"
}
}
}

View File

@@ -131,7 +131,7 @@ public sealed record AggregatedGatingStatisticsResponse(
/// <summary>
/// Maps internal delta models to API responses.
/// </summary>
internal static class NoiseGatingApiMapper
public static class NoiseGatingApiMapper
{
public static DeltaReportResponse MapToResponse(DeltaReport report)
{