Files
git.stella-ops.org/docs/features/checked/tools/golden-pairs-validation-infrastructure.md
2026-02-11 01:32:14 +02:00

108 lines
6.4 KiB
Markdown

# Golden Pairs Validation Infrastructure
## Module
Tools
## Status
VERIFIED
## Description
Data model for golden pair metadata, binary artifacts, and diff reports used to validate binary diff detection against known-good CVE fix pairs.
## Implementation Details
- **Golden Pairs Models**: `src/Tools/GoldenPairs/Models/` (4 files, ~170 lines) -- `GoldenPairMetadata` (CVE ID, package name, distro, pre/post versions, binary artifacts with section hashes), `GoldenDiffReport` (sections, verdict, confidence, discrepancies), `SectionHashModels` (SectionHashSet, SectionHashEntry with Size), `GoldenPairsIndex` (version, pairs, summary).
- **Golden Pairs Schema Provider**: `src/Tools/GoldenPairs/Schema/GoldenPairsSchemaProvider.cs` (36 lines) -- lazy-loads JSON schemas for metadata and index validation.
- **Golden Pair Loader**: `src/Tools/GoldenPairs/Services/GoldenPairLoader.cs` (211 lines) -- loads and validates golden pair records with JSON Schema enforcement before deserialization, normalization, and error collection.
- **Serialization**: `src/Tools/GoldenPairs/Serialization/GoldenPairsJsonSerializer.cs` (78 lines) -- `DeterministicTypeInfoResolver` for alphabetical property ordering, ensuring deterministic output for hash comparison and attestation.
- **Section Hash Provider**: `src/Tools/GoldenPairs/Services/SectionHashProvider.cs` (87 lines) -- deterministic per-section hash computation via `IElfSectionHashExtractor`, producing ordered `SectionHashSet`.
## E2E Test Plan
- [x] Load a golden pair record and verify all required fields are populated and valid
- [x] Validate metadata against schema and verify it passes; corrupt a field and verify validation fails
- [x] Serialize a golden pair record, deserialize it back, and verify round-trip fidelity
- [x] Compute section hashes on two separate runs and verify determinism
- [x] Load a diff report and verify it correctly identifies changed sections
- [x] Verify schema provider covers metadata and index schemas
## Verification
- **Verified**: 2026-02-10
- **Method**: Tier 1 code review + Tier 2d test verification
- **Build**: Passes (0 errors, 0 warnings)
- **Tests**: 9 tests pass (shared with Golden Pairs Mirror feature: GoldenPairSchemaTests: 3, GoldenPairLoaderTests: 2, DiffPipelineServiceTests: 2, PackageMirrorServiceTests: 2)
## Recheck (Run-002)
- **Verified**: 2026-02-10
- **Method**: Tier 2d deterministic integration replay.
- **Tests**: PASS (`src/Tools/__Tests/StellaOps.Tools.GoldenPairs.Tests`: 9/9; shared coverage).
- **Tier 2 Evidence**: `docs/qa/feature-checks/runs/tools/golden-pairs-validation-infrastructure/run-002/tier2-integration-check.json`
- **Outcome**: Validation models/schema/serialization paths remain deterministic and replay-stable.
## Recheck (Run-003)
- **Verified**: 2026-02-10
- **Method**: Tier 2d deterministic integration replay.
- **Tests**: PASS (`src/Tools/__Tests/StellaOps.Tools.GoldenPairs.Tests`: 9/9; shared coverage).
- **Tier 2 Evidence**: `docs/qa/feature-checks/runs/tools/golden-pairs-validation-infrastructure/run-003/tier2-integration-check.json`
- **Outcome**: Validation models/schema/serialization paths remain deterministic and replay-stable.
## Recheck (Run-004)
- **Verified**: 2026-02-10
- **Method**: Tier 2d deterministic integration replay.
- **Tests**: PASS (GoldenPairs 9/9).
- **Tier 2 Evidence**: docs/qa/feature-checks/runs/tools/golden-pairs-validation-infrastructure/run-004/tier2-integration-check.json
- **Outcome**: Checked Tools behavior remains healthy in follow-up replay.
## Recheck (Run-005)
- **Verified**: 2026-02-10
- **Method**: Tier 2d deterministic integration replay.
- **Tests**: PASS (GoldenPairs 9/9).
- **Tier 2 Evidence**: docs/qa/feature-checks/runs/tools/golden-pairs-validation-infrastructure/run-005/tier2-integration-check.json
- **Outcome**: Checked Tools behavior remains healthy in continued replay.
## Recheck (Run-006)
- **Verified**: 2026-02-10
- **Method**: Tier 2d deterministic integration replay.
- **Tests**: PASS (GoldenPairs 9/9).
- **Tier 2 Evidence**: docs/qa/feature-checks/runs/tools/golden-pairs-validation-infrastructure/run-006/tier2-integration-check.json
- **Outcome**: Checked Tools behavior remains healthy in continued replay.
## Recheck (Run-007)
- **Verified**: 2026-02-10
- **Method**: Tier 2d deterministic integration replay.
- **Tests**: PASS (GoldenPairs shared 9/9).
- **Tier 2 Evidence**: docs/qa/feature-checks/runs/tools/golden-pairs-validation-infrastructure/run-007/tier2-integration-check.json
- **Outcome**: Checked Tools behavior remains healthy in continued replay.
## Recheck (Run-008)
- **Verified**: 2026-02-10
- **Method**: Tier 2d deterministic integration replay.
- **Tests**: PASS (GoldenPairs shared 9/9).
- **Tier 2 Evidence**: docs/qa/feature-checks/runs/tools/golden-pairs-validation-infrastructure/run-008/tier2-integration-check.json
- **Outcome**: Checked Tools behavior remains healthy in continued replay.
## Recheck (Run-009)
- **Verified**: 2026-02-10
- **Method**: Tier 2d deterministic integration replay.
- **Tests**: PASS (WorkflowGenerator 76/76, FixtureUpdater 2/2, GoldenPairs 9/9; total 87/87).
- **Tier 2 Evidence**: docs/qa/feature-checks/runs/tools/golden-pairs-validation-infrastructure/run-009/tier2-integration-check.json
- **Outcome**: Checked tools behavior remains healthy in continued replay.
## Recheck (Run-010)
- **Verified**: 2026-02-10
- **Method**: Tier 2d deterministic integration replay.
- **Tests**: PASS (WorkflowGenerator 76/76, FixtureUpdater 2/2, GoldenPairs 9/9; total 87/87).
- **Tier 2 Evidence**: docs/qa/feature-checks/runs/tools/golden-pairs-validation-infrastructure/run-010/tier2-integration-check.json
- **Outcome**: Checked tools behavior remains healthy in continued replay.
## Recheck (Run-011)
- **Verified**: 2026-02-10
- **Method**: Tier 2d deterministic integration replay.
- **Tests**: PASS (WorkflowGenerator 76/76, FixtureUpdater 2/2, GoldenPairs 9/9; total 87/87).
- **Tier 2 Evidence**: docs/qa/feature-checks/runs/tools/golden-pairs-validation-infrastructure/run-011/tier2-integration-check.json
- **Outcome**: Checked tools behavior remains healthy in continued replay.
## Recheck (Run-012)
- **Verified**: 2026-02-10
- **Method**: Tier 2d deterministic tools suite replay.
- **Tests**: PASS (WorkflowGenerator 76/76, FixtureUpdater 2/2, GoldenPairs 9/9; total 87/87).
- **Tier 2 Evidence**: docs/qa/feature-checks/runs/tools/golden-pairs-validation-infrastructure/run-012/tier2-integration-check.json
- **Outcome**: Checked tools behavior remains healthy in continued replay.