Restructure solution layout by module

This commit is contained in:
master
2025-10-28 15:10:40 +02:00
parent 95daa159c4
commit d870da18ce
4103 changed files with 192899 additions and 187024 deletions

View File

@@ -0,0 +1,21 @@
using MongoDB.Bson.Serialization.Attributes;
namespace StellaOps.Signals.Models;
/// <summary>
/// Metadata describing the stored raw callgraph artifact.
/// </summary>
public sealed class CallgraphArtifactMetadata
{
[BsonElement("path")]
public string Path { get; set; } = string.Empty;
[BsonElement("hash")]
public string Hash { get; set; } = string.Empty;
[BsonElement("contentType")]
public string ContentType { get; set; } = string.Empty;
[BsonElement("length")]
public long Length { get; set; }
}

View File

@@ -0,0 +1,41 @@
using System;
using System.Collections.Generic;
using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
namespace StellaOps.Signals.Models;
/// <summary>
/// MongoDB document representing an ingested callgraph.
/// </summary>
public sealed class CallgraphDocument
{
[BsonId]
[BsonRepresentation(BsonType.ObjectId)]
public string Id { get; set; } = ObjectId.GenerateNewId().ToString();
[BsonElement("language")]
public string Language { get; set; } = string.Empty;
[BsonElement("component")]
public string Component { get; set; } = string.Empty;
[BsonElement("version")]
public string Version { get; set; } = string.Empty;
[BsonElement("ingestedAt")]
public DateTimeOffset IngestedAt { get; set; }
[BsonElement("artifact")]
public CallgraphArtifactMetadata Artifact { get; set; } = new();
[BsonElement("nodes")]
public List<CallgraphNode> Nodes { get; set; } = new();
[BsonElement("edges")]
public List<CallgraphEdge> Edges { get; set; } = new();
[BsonElement("metadata")]
[BsonIgnoreIfNull]
public Dictionary<string, string?>? Metadata { get; set; }
}

View File

@@ -0,0 +1,9 @@
namespace StellaOps.Signals.Models;
/// <summary>
/// Normalized callgraph edge.
/// </summary>
public sealed record CallgraphEdge(
string SourceId,
string TargetId,
string Type);

View File

@@ -0,0 +1,16 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
namespace StellaOps.Signals.Models;
/// <summary>
/// API request payload for callgraph ingestion.
/// </summary>
public sealed record CallgraphIngestRequest(
[property: Required] string Language,
[property: Required] string Component,
[property: Required] string Version,
[property: Required] string ArtifactContentType,
[property: Required] string ArtifactFileName,
[property: Required] string ArtifactContentBase64,
IReadOnlyDictionary<string, string?>? Metadata);

View File

@@ -0,0 +1,9 @@
namespace StellaOps.Signals.Models;
/// <summary>
/// Response returned after callgraph ingestion.
/// </summary>
public sealed record CallgraphIngestResponse(
string CallgraphId,
string ArtifactPath,
string ArtifactHash);

View File

@@ -0,0 +1,12 @@
namespace StellaOps.Signals.Models;
/// <summary>
/// Normalized callgraph node.
/// </summary>
public sealed record CallgraphNode(
string Id,
string Name,
string Kind,
string? Namespace,
string? File,
int? Line);