save checkpoint: save features

This commit is contained in:
master
2026-02-12 10:27:23 +02:00
parent dca86e1248
commit 5bca406787
8837 changed files with 1796879 additions and 5294 deletions

View File

@@ -0,0 +1,31 @@
# Adaptive Noise Gating for Vulnerability Graphs
## Module
Attestor
## Status
VERIFIED
## Description
Four-part noise reduction system is implemented: semantic edge deduplication with merged provenance sets, proof-strength hierarchy for confidence scoring, hysteresis damping for small flip-flop deltas, and explicit delta category classification.
## Implementation Details
- **ProofChain Graph**: `src/Attestor/__Libraries/StellaOps.Attestor.ProofChain/Graph/` -- `InMemoryProofGraphService` deduplicates by semantic edge key and merges provenance values deterministically; `ProofGraphEdge` now carries provenance sets.
- **Proof Strength Hierarchy**: `src/Attestor/__Libraries/StellaOps.Attestor.ProofChain/Generators/BackportProofGenerator.Confidence.cs` maps evidence into `Authoritative > BinaryProof > StaticAnalysis > Heuristic` strengths and applies bounded corroboration bonuses.
- **Stability Damping Gate**: `src/Attestor/__Libraries/StellaOps.Attestor.ProofChain/ChangeTrace/IChangeTraceAttestationService.cs` + `ChangeTraceAttestationService.Mapping.cs` + `ChangeTraceAttestationService.Helpers.cs` add configurable hysteresis threshold suppression for low-amplitude modified/rebuilt deltas.
- **Delta Classification**: `src/Attestor/__Libraries/StellaOps.Attestor.ProofChain/Predicates/DeltaVerdictPredicate.Categorization.cs` adds explicit `New/Resolved/ConfidenceUp/ConfidenceDown/PolicyImpact` normalization and inference.
- **Tests**: `src/Attestor/__Tests/StellaOps.Attestor.ProofChain.Tests/Graph/InMemoryProofGraphServiceBehaviorTests.cs`, `src/Attestor/__Tests/StellaOps.Attestor.ProofChain.Tests/BackportProofGeneratorTests.cs`, `src/Attestor/__Tests/StellaOps.Attestor.ProofChain.Tests/ChangeTrace/ChangeTraceAttestationServiceTests.cs`, `src/Attestor/__Tests/StellaOps.Attestor.ProofChain.Tests/Statements/DeltaVerdictPredicateCategorizationTests.cs`.
## E2E Test Plan
- [x] Create a proof graph with redundant edges (same source/target, different provenance) and verify `InMemoryProofGraphService` deduplicates to one edge with merged provenance.
- [x] Submit evidence at different proof-strength tiers and verify confidence ordering.
- [x] Generate consecutive snapshots with minor score fluctuations below hysteresis threshold and verify flip-flop suppression.
- [x] Generate delta verdict changes and verify category mapping (`New/Resolved/ConfidenceUp/ConfidenceDown/PolicyImpact`).
- [x] Query a subgraph and verify only reachable nodes from root are included.
## Verification
- Verified on 2026-02-11 using `run-002`.
- Evidence:
- `docs/qa/feature-checks/runs/attestor/adaptive-noise-gating-for-vulnerability-graphs/run-002/tier0-source-check.json`
- `docs/qa/feature-checks/runs/attestor/adaptive-noise-gating-for-vulnerability-graphs/run-002/tier1-build-check.json`
- `docs/qa/feature-checks/runs/attestor/adaptive-noise-gating-for-vulnerability-graphs/run-002/tier2-e2e-check.json`

View File

@@ -0,0 +1,43 @@
# AI-Assisted Explanation and Classification
## Module
Attestor
## Status
VERIFIED
## Description
AI authority classifier with explanation scoring, citation references, explanation types, and model identifiers. AI artifact verification step integrates into the verification pipeline.
## Implementation Details
- **AIAuthorityClassifier**: `src/Attestor/__Libraries/StellaOps.Attestor.ProofChain/Predicates/AI/AIAuthorityClassifier.cs` (with `.Explanation`, `.ExplanationScore`, `.PolicyDraft`, `.PolicyDraftScore`, `.Remediation`, `.RemediationScore`, `.VexDraft`, `.VexDraftScore` partials) -- classifies AI outputs into `Suggestion`, `EvidenceBacked`, or `AuthorityThreshold` based on citation rate, verified rate, and confidence score.
- **AIAuthorityThresholds**: `AIAuthorityThresholds.cs` -- configurable thresholds: `MinCitationRate` (default 0.8), `MinConfidenceScore` (default 0.7), `MinVerifiedCitationRate` (default 0.9), `AuthorityThresholdScore` (default 0.95).
- **AIArtifactAuthority enum**: `AIArtifactAuthority.cs` -- three levels: Suggestion (no evidence), EvidenceBacked (citations verified), AuthorityThreshold (meets auto-processing score).
- **AIExplanationPredicate**: `AIExplanationPredicate.cs` -- record extending `AIArtifactBasePredicate` with `ExplanationType`, `Content`, `Citations`, `ConfidenceScore`, `CitationRate`, `Subject`, `ContextScope`.
- **AIExplanationCitation**: `AIExplanationCitation.cs` -- links claims to evidence with `ClaimIndex`, `ClaimText`, `EvidenceId` (sha256 format), `EvidenceType`, `Verified` flag.
- **AIExplanationType enum**: `AIExplanationType.cs` -- Exploitability, CodePath, PolicyDecision, RiskFactors, RemediationOptions, PlainLanguageSummary, EvidenceChain.
- **AIModelIdentifier**: `AIModelIdentifier.cs` -- tracks provider/model/version with optional `WeightsDigest` for local models.
- **Verification Step**: `src/Attestor/__Libraries/StellaOps.Attestor.ProofChain/Verification/AIArtifactVerificationStep.cs` (with `.Execute`, `.Classify`, `.Helpers`, `.Summary`, `.VerifyParse`, `.VerifyValidation` partials) -- integrates into `VerificationPipeline` to verify AI artifacts in proof bundles.
- **Tests**: `src/Attestor/__Tests/StellaOps.Attestor.ProofChain.Tests/AI/AIExplanationAndVerificationBehaviorTests.cs`
## E2E Test Plan
- [ ] Create an `AIExplanationPredicate` with citation rate >= 0.8, verified rate >= 0.9, and confidence >= 0.7, classify via `AIAuthorityClassifier`, and verify it returns `EvidenceBacked`
- [ ] Create an explanation with citation rate < 0.8 and verify classifier returns `Suggestion` with appropriate reason messages
- [ ] Create an explanation with quality score >= 0.95 and verify classifier returns `AuthorityThreshold`
- [ ] Submit a proof bundle containing AI artifacts through `AIArtifactVerificationStep.ExecuteAsync` and verify all artifacts are validated (parse, schema, classification)
- [ ] Submit a proof bundle with invalid AI artifacts (malformed predicate) and verify the verification step returns `Passed = false` with error details
- [ ] Create an `AIExplanationCitation` with `Verified = false` and verify it lowers the verified rate below the threshold, causing the classifier to return `Suggestion`
- [ ] Verify `AIModelIdentifier.ToString()` produces the canonical `provider:model:version` format
## Verification
- Verified on 2026-02-11 with `run-001`.
- Tier 0 source checks passed for classifier, predicate, model identifier, and verification-step files.
- Tier 1 build passed and feature-scoped AI behavior tests passed (`7/7`) via xUnit runner class filtering.
- Tier 2 behavioral checks passed for:
- `EvidenceBacked`, `Suggestion`, and `AuthorityThreshold` classifier outcomes
- invalid/malformed artifact rejection in `AIArtifactVerificationStep.ExecuteAsync`
- canonical `AIModelIdentifier.ToString()` format
- Evidence:
- `docs/qa/feature-checks/runs/attestor/ai-assisted-explanation-and-classification/run-001/tier0-source-check.json`
- `docs/qa/feature-checks/runs/attestor/ai-assisted-explanation-and-classification/run-001/tier1-build-check.json`
- `docs/qa/feature-checks/runs/attestor/ai-assisted-explanation-and-classification/run-001/tier2-integration-check.json`

View File

@@ -0,0 +1,42 @@
# AI Authority Classification Engine
## Module
Attestor
## Status
VERIFIED
## Description
Authority classification engine that determines whether AI outputs are evidence-backed (authoritative) or suggestion-only, with configurable thresholds and scoring across multiple artifact types.
## Implementation Details
- **Core Classifier**: `src/Attestor/__Libraries/StellaOps.Attestor.ProofChain/Predicates/AI/AIAuthorityClassifier.cs` -- partial class with `DetermineAuthority()` method that evaluates `citationRate`, `verifiedRate`, `confidenceScore`, and `qualityScore` against configurable thresholds.
- **Artifact-Specific Scoring**: Partial files implement scoring for each artifact type:
- `AIAuthorityClassifier.Explanation.cs` / `AIAuthorityClassifier.ExplanationScore.cs` -- explanation classification and scoring
- `AIAuthorityClassifier.PolicyDraft.cs` / `AIAuthorityClassifier.PolicyDraftScore.cs` -- policy draft classification
- `AIAuthorityClassifier.Remediation.cs` / `AIAuthorityClassifier.RemediationScore.cs` -- remediation plan classification
- `AIAuthorityClassifier.VexDraft.cs` / `AIAuthorityClassifier.VexDraftScore.cs` -- VEX statement draft classification
- **Authority Levels**: `AIArtifactAuthority.cs` -- `Suggestion` (no evidence backing), `EvidenceBacked` (citations verified, evidence resolvable), `AuthorityThreshold` (auto-processing eligible)
- **Thresholds Config**: `AIAuthorityThresholds.cs` -- `MinCitationRate` (0.8), `MinConfidenceScore` (0.7), `MinVerifiedCitationRate` (0.9), `AuthorityThresholdScore` (0.95), `RequireResolvableEvidence` (true)
- **Classification Result**: `AIAuthorityClassificationResult.cs` -- captures authority level, reasons, and individual scores
- **Evidence Resolution**: Constructor accepts optional `Func<string, bool>` evidence resolver to verify that cited evidence IDs are resolvable
- **Tests**: `src/Attestor/__Tests/StellaOps.Attestor.ProofChain.Tests/AI/AIAuthorityClassifierTests.cs`
## E2E Test Plan
- [ ] Classify an explanation with all metrics above thresholds and verify `EvidenceBacked` result with three reason entries (citation rate, verified rate, confidence)
- [ ] Classify a policy draft with `qualityScore >= 0.95` and verify `AuthorityThreshold` result regardless of other metrics
- [ ] Classify a remediation plan with `citationRate = 0.5` and verify `Suggestion` result with reason mentioning citation rate below threshold
- [ ] Classify a VEX draft with an evidence resolver that returns `false` for some evidence IDs and verify the verified rate drops below threshold
- [ ] Override `AIAuthorityThresholds` with stricter values (e.g., `MinCitationRate = 0.95`) and verify classification changes accordingly
- [ ] Verify all four artifact-type classifiers (Explanation, PolicyDraft, Remediation, VexDraft) produce correct `AIAuthorityClassificationResult` with type-specific scoring
## Verification
- Verified on 2026-02-11 with `run-002`.
- Tier 0 source checks passed for classifier core, thresholds, authority enums, scoring partials, and classification-result model.
- Tier 1 build passed; scoped xUnit class run passed (`11/11`) including policy-threshold and VEX evidence-resolvability downgrade scenarios.
- Tier 2 behavioral checks passed across Explanation, PolicyDraft, Remediation, and VEX draft classification paths.
- Full ProofChain suite remains red on unrelated baseline failures (`35 failed / 780 total`); evidence captured for traceability.
- Evidence:
- `docs/qa/feature-checks/runs/attestor/ai-authority-classification-engine/run-002/tier0-source-check.json`
- `docs/qa/feature-checks/runs/attestor/ai-authority-classification-engine/run-002/tier1-build-check.json`
- `docs/qa/feature-checks/runs/attestor/ai-authority-classification-engine/run-002/tier2-integration-check.json`

View File

@@ -19,6 +19,9 @@ AI explanation attestation predicates with model identifiers, decoding parameter
- **Replay Support**: `src/Attestor/__Libraries/StellaOps.Attestor.ProofChain/Replay/` -- `AIArtifactReplayManifest.cs`, `IAIArtifactReplayer.cs`, `ReplayInputArtifact.cs`, `ReplayPromptTemplate.cs`, `ReplayResult.cs`, `ReplayVerificationResult.cs` implement deterministic replay of AI artifacts.
- **Media Types**: `__Libraries/StellaOps.Attestor.ProofChain/MediaTypes/AIArtifactMediaTypes.cs` -- defines content-type constants for AI artifacts.
- **Statement**: `src/Attestor/__Libraries/StellaOps.Attestor.ProofChain/Statements/AI/AIExplanationStatement.cs` -- wraps the predicate as an in-toto statement.
- **Tests**:
- `src/Attestor/__Tests/StellaOps.Attestor.ProofChain.Tests/AI/AIExplanationAndVerificationBehaviorTests.cs`
- `src/Attestor/__Tests/StellaOps.Attestor.ProofChain.Tests/AI/AIExplanationAttestationTypesTests.cs`
## E2E Test Plan
- [ ] Create an `AIExplanationPredicate` with all required fields (explanation type, content, citations, confidence, citation rate, subject) and serialize to JSON, verifying all fields are correctly mapped via `JsonPropertyName` attributes
@@ -30,6 +33,16 @@ AI explanation attestation predicates with model identifiers, decoding parameter
## Verification
- Verified on 2026-02-11 via `run-001`.
- Tier 1 and Tier 2 feature-scoped xUnit class-filtered execution passed (`13/13`) across:
- `AIExplanationAndVerificationBehaviorTests`
- `AIExplanationAttestationTypesTests`
- Full ProofChain suite remains baseline-red on unrelated failures (`35`) due Microsoft.Testing.Platform filter limitations; feature gate used class-filtered runner evidence.
- Behavior confirmed:
- `AIExplanationPredicate` JSON contract field mapping and round-trip fidelity
- replay manifest capture of model identifier and decoding parameters
- mixed citation verification accounting and enum serialization across all explanation types
- `AIExplanationStatement` in-toto envelope and `predicateType` contract
- positive and negative AI artifact verification-step paths
- Tier 0: `docs/qa/feature-checks/runs/attestor/ai-explanation-attestation-types/run-001/tier0-source-check.json`
- Tier 1: `docs/qa/feature-checks/runs/attestor/ai-explanation-attestation-types/run-001/tier1-build-check.json`
- Tier 2: `docs/qa/feature-checks/runs/attestor/ai-explanation-attestation-types/run-001/tier2-integration-check.json`

View File

@@ -0,0 +1,40 @@
# AI Remediation Plan Attestation
## Module
Attestor
## Status
VERIFIED
## Description
Predicate types for AI-generated remediation plans, including remediation steps, risk assessment, classifier authority decisions, and in-toto statement wrapping as signed attestation artifacts.
## Implementation Details
- **Remediation Predicate Contract**: `src/Attestor/__Libraries/StellaOps.Attestor.ProofChain/Predicates/AI/AIRemediationPlanPredicate.cs` defines remediation-specific fields on top of `AIArtifactBasePredicate`.
- **Remediation Step Models**: `src/Attestor/__Libraries/StellaOps.Attestor.ProofChain/Predicates/AI/RemediationStep.cs`, `RemediationActionType.cs`, and `RemediationStepStatus.cs` model step intent and execution lifecycle.
- **Risk and Verification Models**: `src/Attestor/__Libraries/StellaOps.Attestor.ProofChain/Predicates/AI/RemediationRiskAssessment.cs` and `RemediationVerificationStatus.cs` capture risk deltas and remediation verification state.
- **Classifier Integration**: `src/Attestor/__Libraries/StellaOps.Attestor.ProofChain/Predicates/AI/AIAuthorityClassifier.Remediation.cs` and `AIAuthorityClassifier.RemediationScore.cs` classify remediation plan authority from evidence resolvability, risk delta, automation coverage, and verification status.
- **Statement Wrapper**: `src/Attestor/__Libraries/StellaOps.Attestor.ProofChain/Statements/AI/AIRemediationPlanStatement.cs` wraps remediation predicates in in-toto statement shape (`predicateType: ai-remediation.stella/v1`).
- **Behavioral Tests**: `src/Attestor/__Tests/StellaOps.Attestor.ProofChain.Tests/AI/AIRemediationPlanAttestationBehaviorTests.cs` and `src/Attestor/__Tests/StellaOps.Attestor.ProofChain.Tests/AI/AIAuthorityClassifierTests.cs` verify serialization, classifier outcomes, and statement contract behavior.
## E2E Test Plan
- [x] Create an `AIRemediationPlanPredicate` with multiple `RemediationStep` entries of different `RemediationActionType` values and verify JSON serialization.
- [x] Create a remediation plan with `RemediationRiskAssessment` and verify risk level fields are preserved.
- [x] Classify a remediation plan with high resolvable evidence and sufficient confidence threshold inputs and verify `EvidenceBacked` authority.
- [x] Classify a remediation plan with low evidence backing and verify `Suggestion` authority.
- [x] Wrap the predicate in `AIRemediationPlanStatement` and verify valid in-toto statement shape and predicate type.
- [x] Verify `RemediationStepStatus` progression persists through serialization.
- [x] Verify `RemediationVerificationStatus` persists through serialization.
## Verification
- Verified on 2026-02-11 with `run-001`.
- Tier 0 source checks passed for remediation predicate/models, classifier partials, statement wrapper, and targeted test classes.
- Tier 1 passed after resolving one remediation fixture threshold mismatch (`17/17` scoped class tests pass on retest).
- Tier 2 behavioral verification passed using class-scoped xUnit execution covering remediation serialization, high/low evidence classification outcomes, statement wrapping, and status persistence.
- Evidence:
- `docs/qa/feature-checks/runs/attestor/ai-remediation-plan-attestation/run-001/tier0-source-check.json`
- `docs/qa/feature-checks/runs/attestor/ai-remediation-plan-attestation/run-001/tier1-build-check.json`
- `docs/qa/feature-checks/runs/attestor/ai-remediation-plan-attestation/run-001/triage.json`
- `docs/qa/feature-checks/runs/attestor/ai-remediation-plan-attestation/run-001/fix-summary.json`
- `docs/qa/feature-checks/runs/attestor/ai-remediation-plan-attestation/run-001/retest-result.json`
- `docs/qa/feature-checks/runs/attestor/ai-remediation-plan-attestation/run-001/tier2-integration-check.json`

View File

@@ -0,0 +1,46 @@
# Attestable reachability slices (DSSE/in-toto signed evidence)
## Module
Attestor
## Status
VERIFIED
## Description
Reachability witness payloads wrapped in DSSE-signed attestations provide verifiable evidence slices for triage decisions.
## Implementation Details
- **Reachability Witness Payload**: `src/Attestor/__Libraries/StellaOps.Attestor.ProofChain/Statements/ReachabilityWitnessPayload.cs` (with `.Path` partial) -- defines the witness payload containing call paths from entry points to vulnerable functions.
- **Witness Path Nodes**: `WitnessPathNode.cs`, `WitnessCallPathNode.cs` -- model individual nodes in the reachability call path.
- **Witness Evidence Metadata**: `WitnessEvidenceMetadata.cs` -- metadata about the evidence source (scanner, analysis tool, timestamp).
- **Witness Gate Info**: `WitnessGateInfo.cs` -- gate information for policy evaluation of witness data.
- **Reachability Witness Statement**: `ReachabilityWitnessStatement.cs` -- wraps witness payload as an in-toto statement with subject and predicate.
- **Reachability Subgraph**: `ReachabilitySubgraphStatement.cs` -- subgraph attestation for minimal reachability evidence. `ReachabilitySubgraphPredicate.cs` defines the subgraph predicate.
- **DSSE Signing**: `src/Attestor/__Libraries/StellaOps.Attestor.ProofChain/Signing/ProofChainSigner.cs` (with `.Verification` partial) signs statements. `DsseEnvelope.cs`, `DsseSignature.cs` model the envelope.
- **Path Witness Predicate Types**: `src/Attestor/StellaOps.Attestor/StellaOps.Attestor.Core/PathWitnessPredicateTypes.cs` -- defines predicate type URIs for path witnesses.
- **Proof Emitter**: `IProofEmitter.cs` -- interface for emitting signed proofs including reachability slices.
## E2E Test Plan
- [ ] Create a `ReachabilityWitnessPayload` with a call path containing 3+ nodes from entry point to vulnerable function, wrap in `ReachabilityWitnessStatement`, and verify the statement structure
- [ ] Sign the witness statement via `ProofChainSigner` and verify the DSSE envelope contains valid signature and payload
- [ ] Verify the signed reachability slice via `ProofChainSigner.Verification` and confirm signature validation passes
- [ ] Create a `ReachabilitySubgraphPredicate` with a minimal subgraph (entry point -> intermediate -> sink) and verify it serializes with correct predicate type
- [ ] Modify the signed envelope payload and verify that signature verification fails (tamper detection)
- [ ] Create witness payloads with `WitnessEvidenceMetadata` from different analysis tools and verify metadata is preserved in the signed attestation
## Verification
- Verified on 2026-02-11 via `run-001`.
- Tier 1 and Tier 2 feature-scoped xUnit class-filtered execution passed (`5/5`) in:
- `src/Attestor/__Tests/StellaOps.Attestor.ProofChain.Tests/Statements/ReachabilityWitnessAttestationBehaviorTests.cs`
- Full ProofChain suite remains baseline-red on unrelated failures (`35`), but feature-scoped reachability verification passed and includes fresh behavioral evidence.
- Behavior confirmed:
- `ReachabilityWitnessPayload` + `ReachabilityWitnessStatement` structure with 3-node call path and witness metadata
- DSSE signing and verification through `ProofChainSigner`
- tamper detection on modified DSSE payload
- `ReachabilitySubgraphStatement` serialization with predicate type `reachability-subgraph.stella/v1`
- witness evidence metadata preservation across signed payload serialization/deserialization
- Evidence:
- `docs/qa/feature-checks/runs/attestor/attestable-reachability-slices/run-001/tier0-source-check.json`
- `docs/qa/feature-checks/runs/attestor/attestable-reachability-slices/run-001/tier1-build-check.json`
- `docs/qa/feature-checks/runs/attestor/attestable-reachability-slices/run-001/tier2-integration-check.json`