Files
KArtSell.Aegis/tests/KArtSell.ModelOperations.UnitTests/PromotionGateEvaluatorTests.cs
T
kjh2064 6a31bc3737 PR 4b: Apply CA1822 static method modifiers + Gitea Actions secrets guidance
Completed DEBT-001 paydown (1pt) by making three pure-function methods static:
- ScheduleOccurrencePlanner.GetNextDueAt (no instance state accessed)
- PromotionGateEvaluator.Evaluate (evidence gate only, no mutations)
- EvaluationWindowPlanner.Plan (deterministic date calculation)

Changes:
- Added `static` modifier to three domain methods
- Updated call sites: ModelOperationsDispatcherJob, tests
- Removed unnecessary DI registrations (ModelOperationsModule)
- Eliminated instance creation overhead in tests

Test Results: 40/40 PASS (17 ModelOps + 18 SignalEngine + 5 Architecture)

Documentation:
- Updated TECH_DEBT_REGISTER.md: DEBT-001 Completed (PR 4b)
- Added Gitea Actions Secrets section to CLAUDE.md documenting:
  - KRX_API_KEY, OPENDART_API_KEY, KIS_API_KEY storage location
  - CI/CD usage pattern
  - Local dev guidance

Per AGENTS.md v16.0: Code changes are performance improvements, not suppressions.
Quarterly paydown: +1pt (target 4pts for 20% Q3 2026)

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-08-02 05:59:01 +09:00

58 lines
1.6 KiB
C#

using KArtSell.Modules.ModelOperations.Domain;
namespace KArtSell.ModelOperations.UnitTests;
public sealed class PromotionGateEvaluatorTests
{
[Fact]
public void Passes_evidence_gate_but_still_requires_human_approval()
{
var snapshot = new ModelEvaluationSnapshot(
"GLOBAL",
"model-1",
504,
3,
0.08m,
0.01m,
0.70m,
0.10m,
0.97m,
true,
0,
true,
DateTimeOffset.UtcNow);
var result = PromotionGateEvaluator.Evaluate(snapshot, PromotionGateThresholds.ResearchBaseline);
Assert.Equal(GateDecision.Pass, result.Decision);
Assert.Empty(result.BlockingReasons);
Assert.True(result.RequiresIndependentValidation);
Assert.True(result.RequiresHumanApproval);
Assert.Equal("EVIDENCE_ONLY_NO_AUTO_PROMOTION", result.Boundary);
}
[Fact]
public void Holds_when_any_operational_integrity_error_exists()
{
var snapshot = new ModelEvaluationSnapshot(
"GLOBAL",
"model-1",
504,
3,
0.08m,
0.01m,
0.70m,
0.10m,
0.97m,
true,
1,
true,
DateTimeOffset.UtcNow);
var result = PromotionGateEvaluator.Evaluate(snapshot, PromotionGateThresholds.ResearchBaseline);
Assert.Equal(GateDecision.Hold, result.Decision);
Assert.Contains(result.BlockingReasons, reason => reason.Contains("Operational integrity", StringComparison.Ordinal));
}
}