save work
This commit is contained in:
@@ -156,15 +156,7 @@ public sealed record UnknownItem(
|
||||
double score,
|
||||
string? proofRef = null)
|
||||
{
|
||||
// Extract reasons from context/kind
|
||||
var reasons = unknown.Kind switch
|
||||
{
|
||||
UnknownKind.MissingVex => ["missing_vex"],
|
||||
UnknownKind.AmbiguousIndirect => ["ambiguous_indirect_call"],
|
||||
UnknownKind.NoGraph => ["no_dependency_graph"],
|
||||
UnknownKind.StaleEvidence => ["stale_evidence"],
|
||||
_ => [unknown.Kind.ToString().ToLowerInvariant()]
|
||||
};
|
||||
var reasons = new[] { unknown.Kind.ToString().ToLowerInvariant() };
|
||||
|
||||
return new UnknownItem(
|
||||
Id: unknown.Id.ToString(),
|
||||
|
||||
@@ -18,11 +18,14 @@ namespace StellaOps.Unknowns.Core.Services;
|
||||
public sealed class NativeUnknownClassifier
|
||||
{
|
||||
private readonly TimeProvider _timeProvider;
|
||||
private readonly string _createdBy;
|
||||
|
||||
public NativeUnknownClassifier(TimeProvider timeProvider)
|
||||
public NativeUnknownClassifier(TimeProvider timeProvider, string createdBy = "unknowns")
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(timeProvider);
|
||||
ArgumentException.ThrowIfNullOrWhiteSpace(createdBy);
|
||||
_timeProvider = timeProvider;
|
||||
_createdBy = createdBy;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -49,7 +52,9 @@ public sealed class NativeUnknownClassifier
|
||||
Severity = UnknownSeverity.Medium,
|
||||
Context = SerializeContext(context with { ClassifiedAt = now }),
|
||||
ValidFrom = now,
|
||||
SysFrom = now
|
||||
SysFrom = now,
|
||||
CreatedAt = now,
|
||||
CreatedBy = _createdBy
|
||||
};
|
||||
}
|
||||
|
||||
@@ -82,7 +87,9 @@ public sealed class NativeUnknownClassifier
|
||||
Severity = UnknownSeverity.Low,
|
||||
Context = SerializeContext(context with { ClassifiedAt = now }),
|
||||
ValidFrom = now,
|
||||
SysFrom = now
|
||||
SysFrom = now,
|
||||
CreatedAt = now,
|
||||
CreatedBy = _createdBy
|
||||
};
|
||||
}
|
||||
|
||||
@@ -115,7 +122,9 @@ public sealed class NativeUnknownClassifier
|
||||
Severity = UnknownSeverity.Low,
|
||||
Context = SerializeContext(context with { ClassifiedAt = now }),
|
||||
ValidFrom = now,
|
||||
SysFrom = now
|
||||
SysFrom = now,
|
||||
CreatedAt = now,
|
||||
CreatedBy = _createdBy
|
||||
};
|
||||
}
|
||||
|
||||
@@ -156,7 +165,9 @@ public sealed class NativeUnknownClassifier
|
||||
Severity = severity,
|
||||
Context = SerializeContext(context with { ClassifiedAt = now }),
|
||||
ValidFrom = now,
|
||||
SysFrom = now
|
||||
SysFrom = now,
|
||||
CreatedAt = now,
|
||||
CreatedBy = _createdBy
|
||||
};
|
||||
}
|
||||
|
||||
@@ -184,7 +195,9 @@ public sealed class NativeUnknownClassifier
|
||||
Severity = UnknownSeverity.Info,
|
||||
Context = SerializeContext(context with { ClassifiedAt = now }),
|
||||
ValidFrom = now,
|
||||
SysFrom = now
|
||||
SysFrom = now,
|
||||
CreatedAt = now,
|
||||
CreatedBy = _createdBy
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -11,5 +11,12 @@
|
||||
<Description>Core domain models and abstractions for the StellaOps Unknowns module (bitemporal ambiguity tracking)</Description>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="../../../Policy/__Libraries/StellaOps.Policy/StellaOps.Policy.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
Reference in New Issue
Block a user