Merge branch 'main' of https://git.stella-ops.org/stella-ops.org/git.stella-ops.org
This commit is contained in:
@@ -129,6 +129,7 @@ public sealed class AdvisoryGuardrailInjectionTests
|
||||
}
|
||||
|
||||
using var stream = File.OpenRead(path);
|
||||
using StellaOps.TestKit;
|
||||
var cases = JsonSerializer.Deserialize<List<InjectionCase>>(stream, SerializerOptions);
|
||||
return cases ?? throw new InvalidOperationException("Guardrail injection harness cases could not be loaded.");
|
||||
}
|
||||
|
||||
@@ -67,6 +67,7 @@ public sealed class AdvisoryGuardrailOptionsBindingTests
|
||||
services.AddAdvisoryAiCore(configuration);
|
||||
|
||||
await using var provider = services.BuildServiceProvider();
|
||||
using StellaOps.TestKit;
|
||||
var action = () => provider.GetRequiredService<IOptions<AdvisoryGuardrailOptions>>().Value;
|
||||
action.Should().Throw<FileNotFoundException>();
|
||||
}
|
||||
|
||||
@@ -118,6 +118,7 @@ public sealed class AdvisoryGuardrailPerformanceTests
|
||||
var path = Path.Combine(AppContext.BaseDirectory, "TestData", "guardrail-blocked-phrases.json");
|
||||
using var stream = File.OpenRead(path);
|
||||
using var document = JsonDocument.Parse(stream);
|
||||
using StellaOps.TestKit;
|
||||
if (document.RootElement.TryGetProperty("phrases", out var phrasesElement) && phrasesElement.ValueKind == JsonValueKind.Array)
|
||||
{
|
||||
return phrasesElement.EnumerateArray()
|
||||
|
||||
@@ -178,6 +178,7 @@ public sealed class AdvisoryPipelineExecutorTests : IDisposable
|
||||
var guardrail = new StubGuardrailPipeline(blocked: false);
|
||||
var store = new InMemoryAdvisoryOutputStore();
|
||||
using var metrics = new AdvisoryPipelineMetrics(_meterFactory);
|
||||
using StellaOps.TestKit;
|
||||
var inferenceMetadata = ImmutableDictionary<string, string>.Empty.Add("inference.fallback_reason", "throttle");
|
||||
var inference = new StubInferenceClient
|
||||
{
|
||||
|
||||
@@ -71,6 +71,7 @@ public sealed class AdvisoryPromptAssemblerTests
|
||||
var prompt = await assembler.AssembleAsync(plan, CancellationToken.None);
|
||||
|
||||
using var document = JsonDocument.Parse(prompt.Prompt);
|
||||
using StellaOps.TestKit;
|
||||
var matches = document.RootElement
|
||||
.GetProperty("vectors")[0]
|
||||
.GetProperty("matches")
|
||||
|
||||
Reference in New Issue
Block a user