save work

This commit is contained in:
StellaOps Bot
2025-12-19 07:28:23 +02:00
parent 6410a6d082
commit 2eafe98d44
97 changed files with 5040 additions and 1443 deletions

View File

@@ -341,6 +341,18 @@ public sealed class LanguageComponentRecord
public LanguageComponentSnapshot ToSnapshot()
{
ComponentThreatVectorSnapshot[]? threatVectors = null;
if (_threatVectors.Count > 0)
{
threatVectors = _threatVectors.Select(static item => new ComponentThreatVectorSnapshot
{
VectorType = item.VectorType,
Confidence = item.Confidence,
Evidence = item.Evidence,
EntryPath = item.EntryPath,
}).ToArray();
}
return new LanguageComponentSnapshot
{
AnalyzerId = AnalyzerId,
@@ -351,14 +363,8 @@ public sealed class LanguageComponentRecord
Type = Type,
UsedByEntrypoint = UsedByEntrypoint,
Intent = Intent,
Capabilities = _capabilities.ToArray(),
ThreatVectors = _threatVectors.Select(static item => new ComponentThreatVectorSnapshot
{
VectorType = item.VectorType,
Confidence = item.Confidence,
Evidence = item.Evidence,
EntryPath = item.EntryPath,
}).ToArray(),
Capabilities = _capabilities.Count == 0 ? null : _capabilities.ToArray(),
ThreatVectors = threatVectors,
Metadata = _metadata.ToDictionary(static pair => pair.Key, static pair => pair.Value, StringComparer.Ordinal),
Evidence = _evidence.Values.Select(static item => new LanguageComponentEvidenceSnapshot
{
@@ -417,14 +423,14 @@ public sealed class LanguageComponentSnapshot
/// </summary>
/// <remarks>Part of Sprint 0411 - Semantic Entrypoint Engine (Task 18).</remarks>
[JsonPropertyName("capabilities")]
public IReadOnlyList<string> Capabilities { get; set; } = Array.Empty<string>();
public IReadOnlyList<string>? Capabilities { get; set; }
/// <summary>
/// Identified threat vectors.
/// </summary>
/// <remarks>Part of Sprint 0411 - Semantic Entrypoint Engine (Task 18).</remarks>
[JsonPropertyName("threatVectors")]
public IReadOnlyList<ComponentThreatVectorSnapshot> ThreatVectors { get; set; } = Array.Empty<ComponentThreatVectorSnapshot>();
public IReadOnlyList<ComponentThreatVectorSnapshot>? ThreatVectors { get; set; }
[JsonPropertyName("metadata")]
public IDictionary<string, string?> Metadata { get; set; } = new Dictionary<string, string?>(StringComparer.Ordinal);