save work
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user