semi implemented and features implemented save checkpoint

This commit is contained in:
master
2026-02-08 18:00:49 +02:00
parent 04360dff63
commit 1bf6bbf395
20895 changed files with 716795 additions and 64 deletions

View File

@@ -0,0 +1,28 @@
# Evidence Graph with Validation
## Module
__Libraries
## Status
IMPLEMENTED
## Description
Evidence graph model with pre-traversal validation, cycle detection, and policy integration.
## Implementation Details
- **EvidenceGraph**: `src/__Libraries/StellaOps.Resolver/EvidenceGraph.cs` -- immutable record with `ImmutableArray<Node> Nodes` and `ImmutableArray<Edge> Edges` (both sorted by ID for determinism); content-addressed `GraphDigest` computed via `CanonicalJsonSerializer.SerializeWithDigest`; factory method `Create(nodes, edges)` sorts collections; `AddNode`/`AddEdge` return new immutable instances; `GetInboundEdges`/`GetOutboundEdges` for graph traversal; `NodeIds`/`EdgeIds` lazy computed sorted arrays
- **GraphValidation**: `src/__Libraries/StellaOps.Resolver/GraphValidation.cs` -- `DefaultGraphValidator` combining cycle detection and implicit data detection; `TarjanCycleDetector` (Tarjan's SCC algorithm, excludes `IsCycleCut` edges from adjacency); `DefaultImplicitDataDetector` catches dangling edge sources/destinations, duplicate NodeIds, duplicate EdgeIds; `GraphValidationResult` record with `IsValid`, `Cycles`, `Errors`, `Warnings`, `ImplicitDataViolations`; `CycleInfo` record with CycleNodes and optional CutEdge; `ImplicitDataViolation` record; `InvalidGraphException` for validation failures
- **DeterministicResolver**: `src/__Libraries/StellaOps.Resolver/DeterministicResolver.cs` -- 4-phase resolution: (1) Validate graph via `IGraphValidator`, (2) Compute traversal order via `IGraphOrderer`, (3) Evaluate each node with `ITrustLatticeEvaluator` using predecessor verdicts, (4) Compute final digest via `IFinalDigestComputer`; `ResolutionResult` with TraversalSequence, Verdicts, GraphDigest, PolicyDigest, FinalDigest, ResolvedAt, ResolverVersion
- **TopologicalGraphOrderer**: `src/__Libraries/StellaOps.Resolver/TopologicalGraphOrderer.cs` -- deterministic topological sort for traversal ordering
- **ResolutionVerifier**: `src/__Libraries/StellaOps.Resolver/ResolutionVerifier.cs` -- verifies resolution results for integrity
- **Source**: Feature matrix scan
## E2E Test Plan
- [ ] Verify EvidenceGraph.Create sorts nodes and edges deterministically
- [ ] Test GraphDigest is content-addressed and changes when nodes/edges change
- [ ] Verify TarjanCycleDetector finds cycles and identifies IsCycleCut edges
- [ ] Test DefaultImplicitDataDetector catches dangling edges and duplicate IDs
- [ ] Verify DeterministicResolver produces identical ResolutionResult for same inputs
- [ ] Test 4-phase resolution: validate, order, evaluate, digest
- [ ] Verify immutability: AddNode/AddEdge return new graph instances without mutating original
- [ ] Test InvalidGraphException contains validation error details