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,34 @@
# Proof Graph (Node/Edge Types for Evidence Lineage and Integrity)
## Module
Attestor
## Status
IMPLEMENTED
## Description
In-memory proof graph service with typed nodes (Artifact, SbomDocument, DsseEnvelope, RekorEntry, VexStatement, Subject) and edges (DESCRIBED_BY, ATTESTED_BY, WRAPPED_BY, etc.) supporting mutation, queries, paths, and subgraph extraction.
## Implementation Details
- **In-Memory Proof Graph Service**: `src/Attestor/__Libraries/StellaOps.Attestor.ProofChain/Graph/InMemoryProofGraphService.cs` -- core graph service with partials:
- `.Mutation` -- add/remove nodes and edges, update metadata.
- `.Queries` -- query nodes by type, find paths, search by content hash.
- `.Subgraph` -- extract subgraphs rooted at a specific node.
- **Node Types**: `Graph/ProofGraphNodeType.cs` -- Evidence, Verdict, Policy, Artifact (representing SbomDocument, DsseEnvelope, RekorEntry, VexStatement, etc.).
- **Edge Types**: `Graph/ProofGraphEdgeType.cs` -- relationship types (DependsOn, Produces, Validates, DescribedBy, AttestedBy, WrappedBy, etc.).
- **Graph Node**: `Graph/ProofGraphNode.cs` -- node with content-addressed ID, type, metadata, and content hash.
- **Graph Edge**: `Graph/ProofGraphEdge.cs` -- directed edge with source, target, type, and optional metadata.
- **Graph Path**: `Graph/ProofGraphPath.cs` -- ordered sequence of nodes representing a traversal path.
- **Subgraph**: `Graph/ProofGraphSubgraph.cs` -- extracted subgraph with nodes and edges for a specific evidence lineage.
- **Content-Addressed IDs**: `Identifiers/ContentAddressedIdGenerator.Graph.cs` -- generates graph-scoped content-addressed node/edge IDs.
- **Tests**: `__Tests/StellaOps.Attestor.ProofChain.Tests/ProofGraphTests.cs`
## E2E Test Plan
- [ ] Create a proof graph with Artifact, Evidence, Reasoning, and Verdict nodes and verify all node types are stored
- [ ] Add edges with different `ProofGraphEdgeType` values and verify edge traversal returns correct neighbors
- [ ] Query nodes by type via `.Queries` and verify filtering works (e.g., all Evidence nodes)
- [ ] Find the shortest path between a Verdict and an Evidence node and verify the `ProofGraphPath` is correct
- [ ] Extract a subgraph rooted at a Verdict via `.Subgraph` and verify it includes all Evidence and Reasoning descendants
- [ ] Add a node via `.Mutation`, then remove it, and verify cascading edge removal
- [ ] Verify content-addressed node IDs: same content produces the same node ID across insertions
- [ ] Build a complex graph with cycles (e.g., mutual dependencies) and verify query operations handle cycles correctly