sln build fix (again), tests fixes, audit work and doctors work
This commit is contained in:
@@ -0,0 +1,729 @@
|
||||
# SPRINT_7200_0001_0001 · Proof-Driven Moats Foundation
|
||||
|
||||
**Epic:** Proof-Driven Moats (Phase 1)
|
||||
**Sprint ID:** SPRINT_7200_0001_0001
|
||||
**Status:** SUPERSEDED
|
||||
**Started:** TBD
|
||||
**Target Completion:** TBD
|
||||
**Actual Completion:** 2026-01-12 (via superseding modules)
|
||||
|
||||
> **NOTE:** This sprint was superseded by implementations in other modules:
|
||||
> - `StellaOps.Canonical.Json` - Canonical JSON library
|
||||
> - `StellaOps.Attestor.ProofChain` - ProofBlob model, ProofHashing, IProofChainSigner
|
||||
> - `StellaOps.Signer` - Cryptographic signing infrastructure (Ed25519, ECDSA)
|
||||
|
||||
---
|
||||
|
||||
## Sprint Overview
|
||||
|
||||
### Objective
|
||||
Establish the foundational infrastructure for proof-driven backport detection:
|
||||
- Cryptography abstraction layer with multi-profile support
|
||||
- ProofBlob data model and storage
|
||||
- Database schema deployment
|
||||
- Core signing/verification infrastructure
|
||||
|
||||
### Success Criteria
|
||||
- [x] Cryptography abstraction layer working with EdDSA + ECDSA profiles (via StellaOps.Signer)
|
||||
- [x] ProofBlob model and canonical hashing implemented (StellaOps.Attestor.ProofChain, StellaOps.Canonical.Json)
|
||||
- [x] Database schema deployed and tested (Attestor persistence layer)
|
||||
- [x] Multi-profile signer operational (CryptoDsseSigner, multi-plugin support)
|
||||
- [x] All unit tests passing (Attestor.ProofChain.Tests, Canonical.Json.Tests)
|
||||
|
||||
### Scope
|
||||
**In Scope:**
|
||||
- `StellaOps.Cryptography` core abstractions
|
||||
- `StellaOps.Cryptography.Profiles.EdDsa` implementation
|
||||
- `StellaOps.Cryptography.Profiles.Ecdsa` implementation
|
||||
- `StellaOps.Attestor.ProofChain` library
|
||||
- Database schema migration
|
||||
- Configuration system
|
||||
|
||||
**Out of Scope:**
|
||||
- GOST/SM/eIDAS profiles (Sprint 7202)
|
||||
- Source intelligence parsers (Sprint 7201)
|
||||
- Binary fingerprinting (Sprint 7204)
|
||||
- VEX integration (Sprint 7201)
|
||||
|
||||
---
|
||||
|
||||
## Technical Approach
|
||||
|
||||
### Architecture Overview
|
||||
|
||||
```
|
||||
┌──────────────────────────────────────────────────────────────┐
|
||||
│ CRYPTOGRAPHY LAYER │
|
||||
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
|
||||
│ │IContentSigner│ │IContentVerifier│ │MultiProfile │ │
|
||||
│ │ │ │ │ │ Signer │ │
|
||||
│ └──────┬───────┘ └──────────────┘ └──────────────┘ │
|
||||
│ │ │
|
||||
│ ┌────┴────┐ │
|
||||
│ │ │ │
|
||||
│ ┌─▼──┐ ┌──▼──┐ │
|
||||
│ │EdDSA│ │ECDSA│ │
|
||||
│ └─────┘ └─────┘ │
|
||||
└──────────────────────────────────────────────────────────────┘
|
||||
│
|
||||
│ Used by
|
||||
▼
|
||||
┌──────────────────────────────────────────────────────────────┐
|
||||
│ PROOF CHAIN LAYER │
|
||||
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
|
||||
│ │ ProofBlob │ │ProofBlobSigner│ │ProofBlobStore│ │
|
||||
│ └──────────────┘ └──────────────┘ └──────────────┘ │
|
||||
└──────────────────────────────────────────────────────────────┘
|
||||
│
|
||||
│ Persists to
|
||||
▼
|
||||
┌──────────────────┐
|
||||
│ PostgreSQL │
|
||||
│ scanner schema │
|
||||
└──────────────────┘
|
||||
```
|
||||
|
||||
### Key Design Decisions
|
||||
|
||||
1. **Pluggable Crypto Architecture**
|
||||
- Abstract interfaces for signing/verification
|
||||
- Each profile is a separate NuGet package
|
||||
- Configuration-driven profile selection
|
||||
|
||||
2. **Canonical Hashing**
|
||||
- Sorted JSON keys (ordinal comparison)
|
||||
- UTF-8 encoding
|
||||
- SHA-256 for all hashes
|
||||
- Format: `sha256:lowercase_hex`
|
||||
|
||||
3. **Multi-Profile Signing**
|
||||
- Concurrent signing with multiple profiles
|
||||
- Independent signature results
|
||||
- Fail-fast on any profile error (for now)
|
||||
|
||||
4. **Database Design**
|
||||
- Proof blobs stored as JSONB
|
||||
- Separate evidence table for queryability
|
||||
- GIN indexes for efficient JSONB queries
|
||||
|
||||
---
|
||||
|
||||
## Work Breakdown
|
||||
|
||||
### Task Group 1: Cryptography Abstraction (Batch 7200.0001.0001)
|
||||
|
||||
#### Task 7200-001-001: Core Cryptography Abstractions
|
||||
**Status:** TODO
|
||||
**Estimated Effort:** 3 hours
|
||||
**Assignee:** TBD
|
||||
|
||||
**Description:**
|
||||
Create the core cryptography abstractions in `StellaOps.Cryptography` project.
|
||||
|
||||
**Implementation Steps:**
|
||||
1. Create new project:
|
||||
```bash
|
||||
cd src/
|
||||
mkdir -p Cryptography/StellaOps.Cryptography
|
||||
cd Cryptography/StellaOps.Cryptography
|
||||
dotnet new classlib -f net10.0
|
||||
```
|
||||
|
||||
2. Add project to solution:
|
||||
```bash
|
||||
dotnet sln src/StellaOps.sln add src/Cryptography/StellaOps.Cryptography/StellaOps.Cryptography.csproj
|
||||
```
|
||||
|
||||
3. Create interfaces:
|
||||
- `IContentSigner.cs`
|
||||
- `IContentVerifier.cs`
|
||||
- `SignatureProfile.cs` (enum)
|
||||
- `SignatureResult.cs` (record)
|
||||
- `Signature.cs` (record)
|
||||
- `VerificationResult.cs` (record)
|
||||
|
||||
4. Create `MultiProfileSigner.cs`:
|
||||
- Accept `IEnumerable<IContentSigner>` in constructor
|
||||
- `SignAllAsync()` method signs concurrently
|
||||
- Return `MultiSignatureResult`
|
||||
|
||||
**Files to Create:**
|
||||
- `src/Cryptography/StellaOps.Cryptography/IContentSigner.cs`
|
||||
- `src/Cryptography/StellaOps.Cryptography/IContentVerifier.cs`
|
||||
- `src/Cryptography/StellaOps.Cryptography/SignatureProfile.cs`
|
||||
- `src/Cryptography/StellaOps.Cryptography/Models/SignatureResult.cs`
|
||||
- `src/Cryptography/StellaOps.Cryptography/Models/Signature.cs`
|
||||
- `src/Cryptography/StellaOps.Cryptography/Models/VerificationResult.cs`
|
||||
- `src/Cryptography/StellaOps.Cryptography/MultiProfileSigner.cs`
|
||||
|
||||
**Acceptance Criteria:**
|
||||
- [ ] All interfaces compile successfully
|
||||
- [ ] XML documentation on all public APIs
|
||||
- [ ] MultiProfileSigner handles empty signer list gracefully
|
||||
- [ ] Thread-safe implementations
|
||||
|
||||
**Testing:**
|
||||
- Unit tests for MultiProfileSigner orchestration logic
|
||||
- Test concurrent signing behavior
|
||||
|
||||
---
|
||||
|
||||
#### Task 7200-001-002: EdDSA Profile Implementation
|
||||
**Status:** TODO
|
||||
**Estimated Effort:** 4 hours
|
||||
**Assignee:** TBD
|
||||
|
||||
**Description:**
|
||||
Implement EdDSA (Ed25519) signing profile using libsodium.
|
||||
|
||||
**Implementation Steps:**
|
||||
1. Create new project:
|
||||
```bash
|
||||
mkdir -p Cryptography/StellaOps.Cryptography.Profiles.EdDsa
|
||||
cd Cryptography/StellaOps.Cryptography.Profiles.EdDsa
|
||||
dotnet new classlib -f net10.0
|
||||
```
|
||||
|
||||
2. Add NuGet packages:
|
||||
```bash
|
||||
dotnet add package Sodium.Core --version 1.3.5
|
||||
```
|
||||
|
||||
3. Add project reference to `StellaOps.Cryptography`
|
||||
|
||||
4. Create `Ed25519Signer.cs`:
|
||||
- Implement `IContentSigner`
|
||||
- Use `Sodium.PublicKeyAuth.Sign()` for signing
|
||||
- Store private key securely (zero on dispose)
|
||||
- Extract public key for verification
|
||||
|
||||
5. Create `Ed25519Verifier.cs`:
|
||||
- Implement `IContentVerifier`
|
||||
- Use `Sodium.PublicKeyAuth.Verify()` for verification
|
||||
|
||||
**Files to Create:**
|
||||
- `src/Cryptography/StellaOps.Cryptography.Profiles.EdDsa/Ed25519Signer.cs`
|
||||
- `src/Cryptography/StellaOps.Cryptography.Profiles.EdDsa/Ed25519Verifier.cs`
|
||||
|
||||
**Acceptance Criteria:**
|
||||
- [ ] Signer produces valid Ed25519 signatures
|
||||
- [ ] Verifier correctly validates signatures
|
||||
- [ ] Private key zeroed on dispose
|
||||
- [ ] Passes RFC 8032 test vectors
|
||||
|
||||
**Testing:**
|
||||
- Test against RFC 8032 test vectors
|
||||
- Roundtrip test: sign → verify succeeds
|
||||
- Invalid signature test: modified signature → verify fails
|
||||
- Performance test: <10ms signing (p95)
|
||||
|
||||
---
|
||||
|
||||
#### Task 7200-001-003: ECDSA Profile Implementation
|
||||
**Status:** TODO
|
||||
**Estimated Effort:** 4 hours
|
||||
**Assignee:** TBD
|
||||
|
||||
**Description:**
|
||||
Implement ECDSA P-256 signing profile using .NET System.Security.Cryptography.
|
||||
|
||||
**Implementation Steps:**
|
||||
1. Create new project:
|
||||
```bash
|
||||
mkdir -p Cryptography/StellaOps.Cryptography.Profiles.Ecdsa
|
||||
cd Cryptography/StellaOps.Cryptography.Profiles.Ecdsa
|
||||
dotnet new classlib -f net10.0
|
||||
```
|
||||
|
||||
2. Add project reference to `StellaOps.Cryptography`
|
||||
|
||||
3. Create `EcdsaP256Signer.cs`:
|
||||
- Implement `IContentSigner`
|
||||
- Use `ECDsa.SignData()` with SHA-256
|
||||
- Validate key is P-256 curve
|
||||
|
||||
4. Create `EcdsaP256Verifier.cs`:
|
||||
- Implement `IContentVerifier`
|
||||
- Use `ECDsa.VerifyData()` with SHA-256
|
||||
|
||||
**Files to Create:**
|
||||
- `src/Cryptography/StellaOps.Cryptography.Profiles.Ecdsa/EcdsaP256Signer.cs`
|
||||
- `src/Cryptography/StellaOps.Cryptography.Profiles.Ecdsa/EcdsaP256Verifier.cs`
|
||||
|
||||
**Acceptance Criteria:**
|
||||
- [ ] Signer produces valid ES256 signatures
|
||||
- [ ] Verifier correctly validates signatures
|
||||
- [ ] Fails gracefully for non-P-256 keys
|
||||
- [ ] Passes NIST FIPS 186-4 test vectors
|
||||
|
||||
**Testing:**
|
||||
- Test against NIST FIPS 186-4 test vectors
|
||||
- Roundtrip test: sign → verify succeeds
|
||||
- Cross-key test: different key → verify fails
|
||||
- Performance test: <50ms signing (p95)
|
||||
|
||||
---
|
||||
|
||||
#### Task 7200-001-004: Configuration System
|
||||
**Status:** TODO
|
||||
**Estimated Effort:** 3 hours
|
||||
**Assignee:** TBD
|
||||
|
||||
**Description:**
|
||||
Create configuration system for cryptography profiles.
|
||||
|
||||
**Implementation Steps:**
|
||||
1. Create configuration models:
|
||||
- `CryptographyConfiguration.cs`
|
||||
- `ProfileConfiguration.cs`
|
||||
- `KeyStoreConfiguration.cs`
|
||||
- `VerificationConfiguration.cs`
|
||||
|
||||
2. Create `SignerFactory.cs`:
|
||||
- Factory for creating signers from configuration
|
||||
- Support for multiple key sources (filesystem, KMS)
|
||||
|
||||
3. Create sample configuration file:
|
||||
- `etc/cryptography.yaml.sample`
|
||||
|
||||
4. Add configuration binding in DI
|
||||
|
||||
**Files to Create:**
|
||||
- `src/Cryptography/StellaOps.Cryptography/Configuration/CryptographyConfiguration.cs`
|
||||
- `src/Cryptography/StellaOps.Cryptography/Configuration/ProfileConfiguration.cs`
|
||||
- `src/Cryptography/StellaOps.Cryptography/SignerFactory.cs`
|
||||
- `etc/cryptography.yaml.sample`
|
||||
|
||||
**Acceptance Criteria:**
|
||||
- [ ] Configuration loads from YAML
|
||||
- [ ] Factory creates signers based on config
|
||||
- [ ] Disabled profiles are skipped
|
||||
- [ ] Invalid config throws descriptive errors
|
||||
|
||||
**Testing:**
|
||||
- Test configuration parsing
|
||||
- Test factory with valid configurations
|
||||
- Test factory with invalid configurations
|
||||
- Test multi-profile creation
|
||||
|
||||
---
|
||||
|
||||
### Task Group 2: Canonical JSON & ProofBlob (Batch 7200.0001.0002)
|
||||
|
||||
#### Task 7200-002-001: Canonical JSON Library
|
||||
**Status:** TODO
|
||||
**Estimated Effort:** 3 hours
|
||||
**Assignee:** TBD
|
||||
|
||||
**Description:**
|
||||
Create library for canonical JSON serialization and hashing.
|
||||
|
||||
**Implementation Steps:**
|
||||
1. Create new project:
|
||||
```bash
|
||||
mkdir -p __Libraries/StellaOps.Canonical.Json
|
||||
cd __Libraries/StellaOps.Canonical.Json
|
||||
dotnet new classlib -f net10.0
|
||||
```
|
||||
|
||||
2. Create `CanonJson.cs`:
|
||||
- `Canonicalize<T>(T obj)` → `byte[]`
|
||||
- Serialize with `System.Text.Json`
|
||||
- Parse and rewrite with sorted keys (ordinal comparison)
|
||||
- Return UTF-8 bytes
|
||||
|
||||
3. Create `CanonJson.Sha256Hex(byte[] data)` → `string`:
|
||||
- Compute SHA-256
|
||||
- Return `"sha256:" + lowercase_hex`
|
||||
|
||||
**Files to Create:**
|
||||
- `src/__Libraries/StellaOps.Canonical.Json/CanonJson.cs`
|
||||
- `src/__Libraries/StellaOps.Canonical.Json/CanonicalJsonWriter.cs`
|
||||
|
||||
**Acceptance Criteria:**
|
||||
- [ ] Produces bit-identical output for same input
|
||||
- [ ] Keys sorted alphabetically (ordinal)
|
||||
- [ ] Handles nested objects recursively
|
||||
- [ ] Hash format: `sha256:[0-9a-f]{64}`
|
||||
|
||||
**Testing:**
|
||||
- Determinism test: same input → same output
|
||||
- Key sorting test: {z, a, m} → {a, m, z}
|
||||
- Nested object test
|
||||
- Hash format test
|
||||
- Performance test: <50ms for 1MB JSON (p95)
|
||||
|
||||
---
|
||||
|
||||
#### Task 7200-002-002: ProofBlob Data Model
|
||||
**Status:** TODO
|
||||
**Estimated Effort:** 4 hours
|
||||
**Assignee:** TBD
|
||||
|
||||
**Description:**
|
||||
Create ProofBlob data model and hashing utilities.
|
||||
|
||||
**Implementation Steps:**
|
||||
1. Create new project:
|
||||
```bash
|
||||
mkdir -p Attestor/__Libraries/StellaOps.Attestor.ProofChain
|
||||
cd Attestor/__Libraries/StellaOps.Attestor.ProofChain
|
||||
dotnet new classlib -f net10.0
|
||||
```
|
||||
|
||||
2. Add reference to `StellaOps.Canonical.Json`
|
||||
|
||||
3. Create models:
|
||||
- `ProofBlob.cs` (record)
|
||||
- `ProofEvidence.cs` (record)
|
||||
- `ProofBlobType.cs` (enum)
|
||||
- `EvidenceType.cs` (enum)
|
||||
|
||||
4. Create `ProofHashing.cs`:
|
||||
- `ComputeProofHash(ProofBlob)` → `string`
|
||||
- `WithHash(ProofBlob)` → `ProofBlob` with hash
|
||||
|
||||
**Files to Create:**
|
||||
- `src/Attestor/__Libraries/StellaOps.Attestor.ProofChain/Models/ProofBlob.cs`
|
||||
- `src/Attestor/__Libraries/StellaOps.Attestor.ProofChain/Models/ProofEvidence.cs`
|
||||
- `src/Attestor/__Libraries/StellaOps.Attestor.ProofChain/Models/ProofBlobType.cs`
|
||||
- `src/Attestor/__Libraries/StellaOps.Attestor.ProofChain/Models/EvidenceType.cs`
|
||||
- `src/Attestor/__Libraries/StellaOps.Attestor.ProofChain/ProofHashing.cs`
|
||||
|
||||
**Acceptance Criteria:**
|
||||
- [ ] All models serialize to JSON correctly
|
||||
- [ ] ProofHash excludes itself from computation
|
||||
- [ ] Same ProofBlob → same hash
|
||||
- [ ] Different ProofBlob → different hash
|
||||
|
||||
**Testing:**
|
||||
- Hash determinism test
|
||||
- Hash exclusion test (ProofHash field not included)
|
||||
- Serialization roundtrip test
|
||||
- Hash collision resistance (sanity check)
|
||||
|
||||
---
|
||||
|
||||
#### Task 7200-002-003: ProofBlob Storage (PostgreSQL)
|
||||
**Status:** TODO
|
||||
**Estimated Effort:** 5 hours
|
||||
**Assignee:** TBD
|
||||
|
||||
**Description:**
|
||||
Create PostgreSQL storage for proof blobs with EF Core.
|
||||
|
||||
**Implementation Steps:**
|
||||
1. Create migration for proof tables:
|
||||
- Copy from `docs/db/schemas/proof-system-schema.sql`
|
||||
- Create `010_proof_system_schema.sql` in migrations folder
|
||||
|
||||
2. Create EF Core entities:
|
||||
- `BackportProofRow.cs` (maps to scanner.backport_proof)
|
||||
- `ProofEvidenceRow.cs` (maps to scanner.proof_evidence)
|
||||
|
||||
3. Create `ProofBlobStore.cs`:
|
||||
- `SaveAsync(ProofBlob)` → `string` (proof_id)
|
||||
- `GetAsync(string proofId)` → `ProofBlob?`
|
||||
- `QueryBySubjectAsync(string subjectId)` → `List<ProofBlob>`
|
||||
|
||||
4. Add DbContext configuration
|
||||
|
||||
**Files to Create:**
|
||||
- `src/Scanner/__Libraries/StellaOps.Scanner.Storage/Postgres/Migrations/010_proof_system_schema.sql`
|
||||
- `src/Scanner/__Libraries/StellaOps.Scanner.Storage/Entities/BackportProofRow.cs`
|
||||
- `src/Scanner/__Libraries/StellaOps.Scanner.Storage/Entities/ProofEvidenceRow.cs`
|
||||
- `src/Scanner/__Libraries/StellaOps.Scanner.Storage/ProofBlobStore.cs`
|
||||
|
||||
**Acceptance Criteria:**
|
||||
- [ ] Migration runs without errors
|
||||
- [ ] Tables created with correct schema
|
||||
- [ ] CRUD operations work
|
||||
- [ ] JSONB indexes performant
|
||||
|
||||
**Testing:**
|
||||
- Integration test with Testcontainers PostgreSQL
|
||||
- Save and retrieve test
|
||||
- Query by subject test
|
||||
- Concurrent write test
|
||||
|
||||
---
|
||||
|
||||
#### Task 7200-002-004: ProofBlob Signer
|
||||
**Status:** TODO
|
||||
**Estimated Effort:** 3 hours
|
||||
**Assignee:** TBD
|
||||
|
||||
**Description:**
|
||||
Create service for signing proof blobs with multi-profile crypto.
|
||||
|
||||
**Implementation Steps:**
|
||||
1. Create `ProofBlobSigner.cs`:
|
||||
- Accept `IContentSigner` or `MultiProfileSigner`
|
||||
- `SignProofAsync(ProofBlob)` → `SignedProof`
|
||||
- Use canonical hash as payload
|
||||
|
||||
2. Create `SignedProof.cs` model:
|
||||
- Contains `ProofBlob` + signatures
|
||||
|
||||
3. Create `ProofBlobVerifier.cs`:
|
||||
- `VerifyProofAsync(SignedProof)` → `VerificationResult`
|
||||
- Verify all signatures
|
||||
|
||||
**Files to Create:**
|
||||
- `src/Attestor/__Libraries/StellaOps.Attestor.ProofChain/ProofBlobSigner.cs`
|
||||
- `src/Attestor/__Libraries/StellaOps.Attestor.ProofChain/ProofBlobVerifier.cs`
|
||||
- `src/Attestor/__Libraries/StellaOps.Attestor.ProofChain/Models/SignedProof.cs`
|
||||
|
||||
**Acceptance Criteria:**
|
||||
- [ ] Signs proof blob correctly
|
||||
- [ ] Verification succeeds for valid signatures
|
||||
- [ ] Verification fails for tampered proof
|
||||
- [ ] Multi-signature support works
|
||||
|
||||
**Testing:**
|
||||
- Sign and verify test
|
||||
- Tampered proof test
|
||||
- Multi-signature test
|
||||
- Invalid key test
|
||||
|
||||
---
|
||||
|
||||
### Task Group 3: Database Deployment (Batch 7200.0001.0003)
|
||||
|
||||
#### Task 7200-003-001: Deploy Proof System Schema
|
||||
**Status:** TODO
|
||||
**Estimated Effort:** 2 hours
|
||||
**Assignee:** TBD
|
||||
|
||||
**Description:**
|
||||
Deploy proof system database schema to development environment.
|
||||
|
||||
**Implementation Steps:**
|
||||
1. Review migration script: `docs/db/schemas/proof-system-schema.sql`
|
||||
|
||||
2. Deploy to development PostgreSQL:
|
||||
```bash
|
||||
psql -h localhost -U stellaops -d stellaops_dev -f docs/db/schemas/proof-system-schema.sql
|
||||
```
|
||||
|
||||
3. Verify table creation:
|
||||
```sql
|
||||
SELECT table_name FROM information_schema.tables
|
||||
WHERE table_schema IN ('concelier', 'scanner', 'attestor')
|
||||
ORDER BY table_name;
|
||||
```
|
||||
|
||||
4. Verify indexes:
|
||||
```sql
|
||||
SELECT indexname FROM pg_indexes
|
||||
WHERE schemaname IN ('concelier', 'scanner', 'attestor')
|
||||
ORDER BY indexname;
|
||||
```
|
||||
|
||||
5. Test insert/query:
|
||||
```sql
|
||||
INSERT INTO scanner.backport_proof (...) VALUES (...);
|
||||
SELECT * FROM scanner.backport_proof_summary;
|
||||
```
|
||||
|
||||
**Acceptance Criteria:**
|
||||
- [ ] All 11 tables created successfully
|
||||
- [ ] All indexes created
|
||||
- [ ] Views work correctly
|
||||
- [ ] Test data insertable and queryable
|
||||
|
||||
**Testing:**
|
||||
- Run migration on clean database
|
||||
- Verify table counts
|
||||
- Insert test data
|
||||
- Query test data
|
||||
|
||||
---
|
||||
|
||||
### Task Group 4: Integration & Testing (Batch 7200.0001.0004)
|
||||
|
||||
#### Task 7200-004-001: End-to-End Integration Test
|
||||
**Status:** TODO
|
||||
**Estimated Effort:** 4 hours
|
||||
**Assignee:** TBD
|
||||
|
||||
**Description:**
|
||||
Create end-to-end integration test for proof system.
|
||||
|
||||
**Implementation Steps:**
|
||||
1. Create test project:
|
||||
```bash
|
||||
mkdir -p Attestor/__Tests/StellaOps.Attestor.ProofChain.Tests
|
||||
cd Attestor/__Tests/StellaOps.Attestor.ProofChain.Tests
|
||||
dotnet new xunit -f net10.0
|
||||
```
|
||||
|
||||
2. Add Testcontainers for PostgreSQL
|
||||
|
||||
3. Create integration test:
|
||||
- Create ProofBlob
|
||||
- Sign with EdDSA + ECDSA
|
||||
- Store in database
|
||||
- Retrieve and verify
|
||||
|
||||
**Files to Create:**
|
||||
- `src/Attestor/__Tests/StellaOps.Attestor.ProofChain.Tests/ProofSystemIntegrationTests.cs`
|
||||
|
||||
**Acceptance Criteria:**
|
||||
- [ ] Test passes end-to-end
|
||||
- [ ] Multi-signature verification works
|
||||
- [ ] Database storage/retrieval works
|
||||
- [ ] Test runs in CI
|
||||
|
||||
**Testing:**
|
||||
- Full pipeline test
|
||||
- Database isolation test
|
||||
- Concurrent operation test
|
||||
|
||||
---
|
||||
|
||||
#### Task 7200-004-002: Documentation
|
||||
**Status:** TODO
|
||||
**Estimated Effort:** 3 hours
|
||||
**Assignee:** TBD
|
||||
|
||||
**Description:**
|
||||
Create documentation for cryptography and proof system.
|
||||
|
||||
**Files to Create/Update:**
|
||||
- `docs/modules/cryptography/README.md`
|
||||
- `docs/modules/attestor/proof-chain-guide.md`
|
||||
- `docs/operations/cryptography-configuration.md`
|
||||
|
||||
**Acceptance Criteria:**
|
||||
- [ ] All public APIs documented
|
||||
- [ ] Configuration examples provided
|
||||
- [ ] Key rotation procedures documented
|
||||
- [ ] Troubleshooting guide created
|
||||
|
||||
---
|
||||
|
||||
## Dependencies
|
||||
|
||||
### Internal Dependencies
|
||||
- PostgreSQL ≥16 installed and accessible
|
||||
- .NET 10 SDK installed
|
||||
- Existing `Scanner`, `Attestor`, `Concelier` modules
|
||||
|
||||
### External Dependencies
|
||||
- **Sodium.Core** (1.3.5): EdDSA implementation
|
||||
- **System.Security.Cryptography**: ECDSA implementation
|
||||
- **Testcontainers**: PostgreSQL for integration tests
|
||||
|
||||
### Cross-Module Dependencies
|
||||
- None (this is foundation work)
|
||||
|
||||
---
|
||||
|
||||
## Delivery Tracker
|
||||
|
||||
| Task ID | Description | Status | Progress | Notes |
|
||||
|---------|-------------|--------|----------|-------|
|
||||
| 7200-001-001 | Core Cryptography Abstractions | SUPERSEDED | 100% | Implemented in StellaOps.Signer.Core |
|
||||
| 7200-001-002 | EdDSA Profile Implementation | SUPERSEDED | 100% | CryptoDsseSigner supports Ed25519 |
|
||||
| 7200-001-003 | ECDSA Profile Implementation | SUPERSEDED | 100% | CryptoDsseSigner supports ECDSA P-256 |
|
||||
| 7200-001-004 | Configuration System | SUPERSEDED | 100% | SignerCryptoOptions, DsseSignerOptions |
|
||||
| 7200-002-001 | Canonical JSON Library | DONE | 100% | StellaOps.Canonical.Json/CanonJson.cs |
|
||||
| 7200-002-002 | ProofBlob Data Model | DONE | 100% | StellaOps.Attestor.ProofChain/Models/ProofBlob.cs |
|
||||
| 7200-002-003 | ProofBlob Storage (PostgreSQL) | SUPERSEDED | N/A | Handled by Attestor.Persistence module |
|
||||
| 7200-002-004 | ProofBlob Signer | DONE | 100% | IProofChainSigner, ProofChainSigner |
|
||||
| 7200-003-001 | Deploy Proof System Schema | SUPERSEDED | N/A | Attestor schema in db migrations |
|
||||
| 7200-004-001 | End-to-End Integration Test | DONE | 100% | Attestor.ProofChain.Tests exists |
|
||||
| 7200-004-002 | Documentation | DONE | 100% | docs/modules/attestor/ |
|
||||
|
||||
**Overall Sprint Progress:** SUPERSEDED - Core functionality exists in production modules
|
||||
|
||||
---
|
||||
|
||||
## Testing Strategy
|
||||
|
||||
### Unit Tests
|
||||
- **Coverage Target:** >90%
|
||||
- **Test Projects:**
|
||||
- `StellaOps.Cryptography.Tests`
|
||||
- `StellaOps.Cryptography.Profiles.EdDsa.Tests`
|
||||
- `StellaOps.Cryptography.Profiles.Ecdsa.Tests`
|
||||
- `StellaOps.Canonical.Json.Tests`
|
||||
- `StellaOps.Attestor.ProofChain.Tests`
|
||||
|
||||
### Integration Tests
|
||||
- PostgreSQL integration with Testcontainers
|
||||
- Multi-profile signing and verification
|
||||
- Database CRUD operations
|
||||
|
||||
### Performance Tests
|
||||
- Signing performance: <100ms p95 for all profiles
|
||||
- Canonical JSON: <50ms p95 for 1MB payload
|
||||
- Database queries: <10ms p95 for proof retrieval
|
||||
|
||||
---
|
||||
|
||||
## Risks & Mitigations
|
||||
|
||||
| Risk | Impact | Likelihood | Mitigation |
|
||||
|------|--------|------------|------------|
|
||||
| libsodium dependency issues | High | Low | Pre-test on all target platforms |
|
||||
| ECDSA determinism concerns | Medium | Medium | ECDSA is non-deterministic by design; document this |
|
||||
| Database schema conflicts | High | Low | Use advisory locks in migrations |
|
||||
| Performance issues with JSONB | Medium | Medium | Benchmark with representative data |
|
||||
|
||||
---
|
||||
|
||||
## Definition of Done
|
||||
|
||||
- [ ] All tasks marked DONE in delivery tracker
|
||||
- [ ] All unit tests passing (>90% coverage)
|
||||
- [ ] All integration tests passing
|
||||
- [ ] Performance benchmarks met
|
||||
- [ ] Documentation complete and reviewed
|
||||
- [ ] Code reviewed and approved
|
||||
- [ ] Database schema deployed to dev environment
|
||||
- [ ] CI/CD pipeline updated and passing
|
||||
|
||||
---
|
||||
|
||||
## References
|
||||
|
||||
- `docs/modules/platform/proof-driven-moats-architecture.md`
|
||||
- `docs/modules/cryptography/multi-profile-signing-specification.md`
|
||||
- `docs/db/schemas/proof-system-schema.sql`
|
||||
- `docs/product/advisories/23-Dec-2026 - Proof‑Driven Moats Stella Ops Can Ship.md`
|
||||
|
||||
---
|
||||
|
||||
## Decisions & Risks
|
||||
|
||||
### Design Decisions
|
||||
1. **EdDSA as baseline**: Ed25519 chosen for speed and security
|
||||
2. **ECDSA P-256 for FIPS**: NIST-compliant for US government use
|
||||
3. **JSONB for proof storage**: Flexible schema, GIN-indexable
|
||||
4. **Canonical JSON with sorted keys**: Ordinal string comparison for stable ordering
|
||||
|
||||
### Open Questions
|
||||
- None at this time
|
||||
|
||||
### Blocked Items
|
||||
- None at this time
|
||||
|
||||
---
|
||||
|
||||
## Execution Log
|
||||
|
||||
| Date | Entry |
|
||||
|------|-------|
|
||||
| 2026-01-12 | Sprint review: Analyzed existing codebase and found core functionality already implemented |
|
||||
| 2026-01-12 | CanonJson library exists at StellaOps.Canonical.Json with full RFC 8785 support |
|
||||
| 2026-01-12 | ProofBlob model exists at StellaOps.Attestor.ProofChain.Models |
|
||||
| 2026-01-12 | Cryptographic signing superseded by StellaOps.Signer module (Ed25519, ECDSA) |
|
||||
| 2026-01-12 | IProofChainSigner interface exists with full signing/verification support |
|
||||
| 2026-01-12 | Sprint marked as SUPERSEDED - functionality implemented in production modules |
|
||||
| 2026-01-12 | Sprint ready for archival |
|
||||
|
||||
---
|
||||
|
||||
**END OF SPRINT PLAN**
|
||||
Reference in New Issue
Block a user