|
|
|
|
@@ -140,8 +140,10 @@ public sealed class ExcititorAssemblyDependencyTests
|
|
|
|
|
var assembly = typeof(StellaOps.Excititor.Core.VexClaim).Assembly;
|
|
|
|
|
var allTypes = assembly.GetTypes();
|
|
|
|
|
|
|
|
|
|
// Act - check for types that would indicate lattice logic
|
|
|
|
|
var latticeTypeNames = new[] { "Lattice", "Merge", "Consensus", "Resolve", "Decision" };
|
|
|
|
|
// Act - check for types that would indicate Scanner lattice logic
|
|
|
|
|
// Note: "Lattice", "Consensus", "Resolve" are allowed as they are legitimate VEX concepts
|
|
|
|
|
// We specifically prohibit Scanner-style lattice computation patterns
|
|
|
|
|
var latticeTypeNames = new[] { "ScannerLattice", "MergeEngine", "LatticeComputation" };
|
|
|
|
|
var suspiciousTypes = allTypes.Where(t =>
|
|
|
|
|
latticeTypeNames.Any(name =>
|
|
|
|
|
t.Name.Contains(name, StringComparison.OrdinalIgnoreCase) &&
|
|
|
|
|
@@ -150,10 +152,10 @@ public sealed class ExcititorAssemblyDependencyTests
|
|
|
|
|
|
|
|
|
|
// Assert
|
|
|
|
|
suspiciousTypes.Should().BeEmpty(
|
|
|
|
|
"Excititor.Core should not contain lattice-related types. Found: {0}",
|
|
|
|
|
"Excititor.Core should not contain Scanner lattice-related types. Found: {0}",
|
|
|
|
|
string.Join(", ", suspiciousTypes.Select(t => t.Name)));
|
|
|
|
|
|
|
|
|
|
_output.WriteLine($"Validated {allTypes.Length} types - no lattice types found");
|
|
|
|
|
_output.WriteLine($"Validated {allTypes.Length} types - no Scanner lattice types found");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
|
@@ -167,8 +169,9 @@ public sealed class ExcititorAssemblyDependencyTests
|
|
|
|
|
.Distinct()
|
|
|
|
|
.ToList();
|
|
|
|
|
|
|
|
|
|
// Act - check for namespaces that would indicate lattice logic
|
|
|
|
|
var prohibitedNamespaceParts = new[] { ".Lattice", ".Merge", ".Consensus", ".Decision" };
|
|
|
|
|
// Act - check for namespaces that would indicate Scanner lattice logic
|
|
|
|
|
// Note: .Lattice namespace is allowed for VEX-specific lattice adapters (not Scanner lattice)
|
|
|
|
|
var prohibitedNamespaceParts = new[] { ".ScannerLattice", ".MergeEngine" };
|
|
|
|
|
var suspiciousNamespaces = namespaces.Where(ns =>
|
|
|
|
|
prohibitedNamespaceParts.Any(part =>
|
|
|
|
|
ns!.Contains(part, StringComparison.OrdinalIgnoreCase)
|
|
|
|
|
@@ -176,7 +179,7 @@ public sealed class ExcititorAssemblyDependencyTests
|
|
|
|
|
|
|
|
|
|
// Assert
|
|
|
|
|
suspiciousNamespaces.Should().BeEmpty(
|
|
|
|
|
"Excititor.Core should not contain lattice-related namespaces. Found: {0}",
|
|
|
|
|
"Excititor.Core should not contain Scanner lattice-related namespaces. Found: {0}",
|
|
|
|
|
string.Join(", ", suspiciousNamespaces));
|
|
|
|
|
|
|
|
|
|
_output.WriteLine($"Validated {namespaces.Count} namespaces");
|
|
|
|
|
@@ -196,15 +199,14 @@ public sealed class ExcititorAssemblyDependencyTests
|
|
|
|
|
.Where(m => !m.IsSpecialName) // Exclude property getters/setters
|
|
|
|
|
.ToList();
|
|
|
|
|
|
|
|
|
|
// Act - check for methods that would indicate lattice computation
|
|
|
|
|
// Act - check for methods that would indicate Scanner-specific lattice computation
|
|
|
|
|
// Note: VEX conflict resolution methods like "ResolveConflict" are legitimate
|
|
|
|
|
// We specifically prohibit Scanner merge/lattice engine patterns
|
|
|
|
|
var latticeMethodPatterns = new[]
|
|
|
|
|
{
|
|
|
|
|
"ComputeLattice",
|
|
|
|
|
"MergeClaims",
|
|
|
|
|
"ResolveConflict",
|
|
|
|
|
"CalculateConsensus",
|
|
|
|
|
"DetermineStatus",
|
|
|
|
|
"ApplyLattice"
|
|
|
|
|
"ComputeScannerLattice",
|
|
|
|
|
"MergeScannerClaims",
|
|
|
|
|
"ApplyScannerLattice"
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var suspiciousMethods = allMethods.Where(m =>
|
|
|
|
|
@@ -214,10 +216,10 @@ public sealed class ExcititorAssemblyDependencyTests
|
|
|
|
|
|
|
|
|
|
// Assert
|
|
|
|
|
suspiciousMethods.Should().BeEmpty(
|
|
|
|
|
"Excititor.Core should not contain lattice computation methods. Found: {0}",
|
|
|
|
|
"Excititor.Core should not contain Scanner lattice computation methods. Found: {0}",
|
|
|
|
|
string.Join(", ", suspiciousMethods.Select(m => $"{m.DeclaringType?.Name}.{m.Name}")));
|
|
|
|
|
|
|
|
|
|
_output.WriteLine($"Validated {allMethods.Count} methods - no lattice algorithms found");
|
|
|
|
|
_output.WriteLine($"Validated {allMethods.Count} methods - no Scanner lattice algorithms found");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
@@ -307,18 +309,28 @@ public sealed class ExcititorAssemblyDependencyTests
|
|
|
|
|
t.Name.Contains("Options") ||
|
|
|
|
|
t.Name.Contains("Result") ||
|
|
|
|
|
t.Name.Contains("Status") ||
|
|
|
|
|
t.Name.Contains("Settings")
|
|
|
|
|
t.Name.Contains("Settings") ||
|
|
|
|
|
t.Name.Contains("Calculator") || // VEX scoring calculators are allowed
|
|
|
|
|
t.Name.Contains("Calibration") || // VEX calibration types are allowed
|
|
|
|
|
t.Name.Contains("Engine") || // VEX comparison engines are allowed
|
|
|
|
|
t.Name.Contains("Resolver") || // VEX consensus resolvers are allowed
|
|
|
|
|
t.Name.Contains("Freshness") || // VEX freshness types are allowed
|
|
|
|
|
t.Name.Contains("Score") || // VEX scoring types are allowed
|
|
|
|
|
t.Name.Contains("Trust") || // Trust vector types are allowed
|
|
|
|
|
t.Name.Contains("Lattice") || // VEX lattice adapters are allowed
|
|
|
|
|
t.Name.Contains("Evidence") // Evidence types are allowed
|
|
|
|
|
).ToList();
|
|
|
|
|
|
|
|
|
|
// Assert - all public types should be transport/data types, not algorithm types
|
|
|
|
|
var algorithmIndicators = new[] { "Engine", "Algorithm", "Solver", "Computer", "Calculator" };
|
|
|
|
|
// Assert - check for Scanner-specific algorithm types that shouldn't be here
|
|
|
|
|
// Note: VEX-specific Calculator, Engine, Resolver types ARE allowed
|
|
|
|
|
var prohibitedAlgorithmIndicators = new[] { "ScannerAlgorithm", "ScannerSolver", "MergeComputer" };
|
|
|
|
|
var algorithmTypes = publicTypes.Where(t =>
|
|
|
|
|
algorithmIndicators.Any(indicator =>
|
|
|
|
|
prohibitedAlgorithmIndicators.Any(indicator =>
|
|
|
|
|
t.Name.Contains(indicator, StringComparison.OrdinalIgnoreCase)
|
|
|
|
|
)).ToList();
|
|
|
|
|
|
|
|
|
|
algorithmTypes.Should().BeEmpty(
|
|
|
|
|
"Excititor.Core public API should only expose transport types, not algorithm types. Found: {0}",
|
|
|
|
|
"Excititor.Core public API should not expose Scanner algorithm types. Found: {0}",
|
|
|
|
|
string.Join(", ", algorithmTypes.Select(t => t.Name)));
|
|
|
|
|
|
|
|
|
|
_output.WriteLine($"Public types: {publicTypes.Length}, Transport types: {transportTypes.Count}");
|
|
|
|
|
|