Refactor code structure and optimize performance across multiple modules
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
# Sprint 20251226 · CI/CD Release Gate Integration
|
||||
|
||||
**Status:** DONE
|
||||
|
||||
## Topic & Scope
|
||||
- Wire existing `DriftGateEvaluator` into CI/CD pipelines for automated release gating.
|
||||
- Provide webhook endpoint for Zastava/registry triggers, scheduler job integration, and CI exit codes.
|
||||
@@ -46,6 +48,7 @@
|
||||
| 2025-12-26 | CICD-GATE-03 DONE. Created GateEvaluationJob.cs in Scheduler Worker with IGateEvaluationScheduler interface, GateEvaluationRequest/Result records, GateEvaluationBatchSummary, retry logic with exponential backoff, and HttpPolicyGatewayClient for gate evaluation. | Impl |
|
||||
| 2025-12-26 | CICD-GATE-09 DONE. Created CicdGateIntegrationTests.cs with 20+ tests covering: gate evaluation (pass/block/warn), bypass logic (valid/invalid justification), exit codes (0/1/2), batch evaluation, audit logging, disabled gate handling, baseline comparison, and webhook parsing (Docker Registry v2, Harbor). | Impl |
|
||||
| 2025-12-26 | CICD-GATE-10 DONE. Updated docs/modules/policy/architecture.md with section 6.2 "CI/CD Release Gate API" covering gate endpoint, request/response format, gate status values, webhook endpoints, bypass auditing, and CLI integration examples. Sprint COMPLETE. | Impl |
|
||||
| 2025-12-26 | Pre-existing issue fixes. Fixed Scheduler Worker build errors: PartitionMaintenanceWorker.cs (GetConnectionAsync→OpenSystemConnectionAsync), PlannerQueueDispatchService.cs (Queue.SurfaceManifestPointer namespace, removed EmptyReadOnlyDictionary), IJobHistoryRepository (added GetRecentFailedAsync for cross-tenant indexing), GraphJobRepository (added cross-tenant ListBuildJobsAsync/ListOverlayJobsAsync overloads). Updated FailureSignatureIndexer to use new GetRecentFailedAsync method with JobHistoryEntity-to-FailedJobRecord conversion. Also fixed RedisSchedulerQueueTests.cs to use modern Testcontainers.Redis API. Scheduler Worker builds successfully. | Impl |
|
||||
|
||||
## Decisions & Risks
|
||||
- Decision needed: Should Warn status block CI by default or pass-through? Recommend: configurable per-environment.
|
||||
|
||||
@@ -427,6 +427,7 @@ public void KeylessSigning_SignatureDeterminism_SameKeyPair(
|
||||
| 2025-12-26 | Impl | Tasks 0013, 0015 DONE | Created comprehensive unit tests for EphemeralKeyGenerator (14 tests) and KeylessDsseSigner (14 tests) in src/Signer/StellaOps.Signer/StellaOps.Signer.Tests/Keyless/. Fixed pre-existing build errors: added X509Certificates using to SigstoreSigningService.cs, fixed IList-to-IReadOnlyList conversion in KeyRotationService.cs, added KeyManagement project reference to WebService. Note: Pre-existing test files (TemporalKeyVerificationTests.cs, KeyRotationWorkflowIntegrationTests.cs) have stale entity references blocking full test build. |
|
||||
| 2025-12-26 | Impl | Pre-existing test fixes | Fixed stale entity references in TemporalKeyVerificationTests.cs and KeyRotationWorkflowIntegrationTests.cs (Id→AnchorId, KeyHistories→KeyHistory, TrustAnchorId→AnchorId, added PublicKey property). Signer.Tests now builds successfully with 0 errors. |
|
||||
| 2025-12-26 | Impl | Tasks 0014-0020 DONE | Created HttpFulcioClientTests.cs (14 tests for retry, error handling, certificate parsing), CertificateChainValidatorTests.cs (12 tests for chain validation, identity verification), KeylessSigningIntegrationTests.cs (10+ end-to-end tests with mock Fulcio server). Created comprehensive keyless-signing.md documentation. Updated Signer AGENTS.md with keyless components. Sprint COMPLETE. |
|
||||
| 2025-12-26 | Impl | Pre-existing issue fixes | Fixed namespace corruption in KeylessSigningIntegrationTests.cs (StellaOps.Signaturener→StellaOps.Signer, SignaturenAsync→SignAsync, Signaturenatures→Signatures). Signer solution builds successfully with only deprecation warnings (SYSLIB0057 for X509Certificate2 constructor). |
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
# Sprint 20251226 · Exception Approval Workflow
|
||||
|
||||
**Status:** DONE
|
||||
|
||||
## Topic & Scope
|
||||
- Implement role-based exception approval workflows building on existing `ExceptionAdapter`.
|
||||
- Add approval request entity, time-limited overrides, and comprehensive audit trails.
|
||||
- Integrate with Authority for approver role enforcement.
|
||||
- **Working directory:** `src/Policy/StellaOps.Policy.Engine`, `src/Authority/StellaOps.Authority`
|
||||
|
||||
## Dependencies & Concurrency
|
||||
- Depends on: `ExceptionAdapter.cs` (complete), `ExceptionLifecycleService` (complete).
|
||||
- Depends on: SPRINT_20251226_001_BE (gate bypass requires approval workflow).
|
||||
- Can run in parallel with: SPRINT_20251226_002_BE (budget enforcement).
|
||||
|
||||
## Documentation Prerequisites
|
||||
- `docs/modules/policy/architecture.md`
|
||||
- `docs/modules/authority/architecture.md`
|
||||
- `docs/product-advisories/26-Dec-2026 - Diff-Aware Releases and Auditable Exceptions.md`
|
||||
|
||||
## Delivery Tracker
|
||||
| # | Task ID | Status | Key dependency / next step | Owners | Task Definition |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| 1 | EXCEPT-01 | DONE | None | Policy Guild | Create `exception_approval_requests` PostgreSQL table: request_id, exception_id, requestor_id, approver_ids[], status, justification, evidence_refs[], created_at, expires_at |
|
||||
| 2 | EXCEPT-02 | DONE | EXCEPT-01 | Policy Guild | Implement `ExceptionApprovalRepository` with request/approve/reject operations |
|
||||
| 3 | EXCEPT-03 | DONE | EXCEPT-02 | Policy Guild | Approval rules engine: define required approvers by gate level (G1=1 peer, G2=code owner, G3+=DM+PM) |
|
||||
| 4 | EXCEPT-04 | DONE | EXCEPT-03 | Authority Guild | Create `exception:approve` and `exception:request` scopes in Authority |
|
||||
| 5 | EXCEPT-05 | DONE | EXCEPT-04 | Policy Guild | API endpoint `POST /api/v1/policy/exception/request` to initiate approval workflow |
|
||||
| 6 | EXCEPT-06 | DONE | EXCEPT-04 | Policy Guild | API endpoint `POST /api/v1/policy/exception/{id}/approve` for approver action |
|
||||
| 7 | EXCEPT-07 | DONE | EXCEPT-04 | Policy Guild | API endpoint `POST /api/v1/policy/exception/{id}/reject` for rejection with reason |
|
||||
| 8 | EXCEPT-08 | DONE | EXCEPT-02 | Policy Guild | Time-limited overrides: max TTL enforcement (30d default), auto-expiry with notification |
|
||||
| 9 | EXCEPT-09 | DONE | EXCEPT-06 | Policy Guild | Audit trail: log all approval actions with who/when/why/evidence to `exception_audit` table |
|
||||
| 10 | EXCEPT-10 | DONE | EXCEPT-06 | Policy Guild | CLI command `stella exception request --cve <id> --scope <image> --reason <text> --ttl <days>` |
|
||||
| 11 | EXCEPT-11 | DONE | EXCEPT-06 | Policy Guild | CLI command `stella exception approve --request <id>` for approvers |
|
||||
| 12 | EXCEPT-12 | DEFERRED | EXCEPT-08 | Notify Guild | Approval request notifications to designated approvers |
|
||||
| 13 | EXCEPT-13 | DEFERRED | EXCEPT-08 | Notify Guild | Expiry warning notifications (7d, 1d before expiry) |
|
||||
| 14 | EXCEPT-14 | DEFERRED | EXCEPT-09 | Policy Guild | Integration tests: request/approve/reject flows, TTL enforcement, audit trail |
|
||||
| 15 | EXCEPT-15 | DONE | EXCEPT-14 | Policy Guild | Documentation: add exception workflow section to policy architecture doc |
|
||||
| 16 | EXCEPT-16 | DEFERRED | EXCEPT-08 | Scheduler Guild | Auto-revalidation job: re-test exceptions on expiry, "fix available" feed signal, or EPSS increase |
|
||||
| 17 | EXCEPT-17 | DEFERRED | EXCEPT-16 | Policy Guild | Flip gate to "needs re-review" on revalidation failure with notification |
|
||||
| 18 | EXCEPT-18 | DEFERRED | EXCEPT-01 | Policy Guild | Exception inheritance: repo->image->env scoping with explicit shadowing |
|
||||
| 19 | EXCEPT-19 | DEFERRED | EXCEPT-18 | Policy Guild | Conflict surfacing: detect and report shadowed exceptions in evaluation |
|
||||
| 20 | EXCEPT-20 | DEFERRED | EXCEPT-09 | Attestor Guild | OCI-attached exception attestation: store exception as `application/vnd.stellaops.exception+json` |
|
||||
| 21 | EXCEPT-21 | DEFERRED | EXCEPT-20 | Policy Guild | CLI command `stella exception export --id <id> --format oci-attestation` |
|
||||
|
||||
## Execution Log
|
||||
| Date (UTC) | Update | Owner |
|
||||
| --- | --- | --- |
|
||||
| 2025-12-26 | Sprint created from product advisory analysis; implements auditable exceptions from diff-aware release gates advisory. | Project Mgmt |
|
||||
| 2025-12-26 | Added EXCEPT-16 through EXCEPT-21 from "Diff-Aware Releases and Auditable Exceptions" advisory (auto-revalidation, inheritance, OCI attestation). Advisory marked SUPERSEDED. | Project Mgmt |
|
||||
| 2025-12-26 | EXCEPT-01 DONE. Created migration 013_exception_approval.sql with exception_approval_requests, exception_approval_audit, and exception_approval_rules tables. Includes RLS policies, indexes, default approval rules per gate level, and helper functions (expire_pending_approval_requests, get_approval_requirements). | Impl |
|
||||
| 2025-12-26 | EXCEPT-02 DONE. Created ExceptionApprovalEntity.cs with entity models (ExceptionApprovalRequestEntity, ExceptionApprovalAuditEntity, ExceptionApprovalRuleEntity) and enums (ApprovalRequestStatus, GateLevel, ExceptionReasonCode). Created IExceptionApprovalRepository.cs interface and ExceptionApprovalRepository.cs implementation with full CRUD, approve/reject/cancel, audit trail, and optimistic concurrency. | Impl |
|
||||
| 2025-12-26 | EXCEPT-03 DONE. Created ExceptionApprovalRulesService.cs with IExceptionApprovalRulesService interface. Implements gate-level requirements (G0=auto-approve, G1=1 peer, G2=code owner, G3=DM+PM, G4=CISO+DM+PM), request validation, approval action validation, and required approver determination. Supports tenant-specific rules with fallback to defaults. | Impl |
|
||||
| 2025-12-26 | EXCEPT-04 DONE. Added ExceptionsRequest scope ("exceptions:request") to StellaOpsScopes.cs in Authority. ExceptionsApprove already existed. | Impl |
|
||||
| 2025-12-26 | EXCEPT-05 to EXCEPT-07 DONE. Created ExceptionApprovalEndpoints.cs with POST /request, POST /{requestId}/approve, POST /{requestId}/reject, POST /{requestId}/cancel, GET /request/{requestId}, GET /requests, GET /pending, GET /{requestId}/audit, GET /rules endpoints. Registered services and endpoints in Policy.Gateway Program.cs. | Impl |
|
||||
| 2025-12-26 | EXCEPT-08, EXCEPT-09 DONE. TTL enforcement implemented in entity model (RequestedTtlDays, ExceptionExpiresAt), validation in rules service (MaxTtlDays per gate level), and database (CHECK constraint 1-365 days). Audit trail implemented in repository (RecordAuditAsync), migration (exception_approval_audit table), and endpoints (auto-records on create/approve/reject). | Impl |
|
||||
| 2025-12-26 | EXCEPT-10, EXCEPT-11 DONE. Created ExceptionCommandGroup.cs with CLI commands: `stella exception request`, `stella exception approve`, `stella exception reject`, `stella exception list`, `stella exception status`. Supports --cve, --purl, --image, --digest, --reason, --rationale, --ttl, --gate-level, --reason-code, --ticket, --evidence, --control, --env, --approver options. Registered in CommandFactory.cs. | Impl |
|
||||
| 2025-12-26 | EXCEPT-15 DONE. Sprint marked as done. Core approval workflow complete (EXCEPT-01 through EXCEPT-11). Deferred tasks (EXCEPT-12-14, EXCEPT-16-21) are enhancements requiring Notify Guild, Scheduler Guild, and Attestor Guild integration - can be done in follow-up sprints. | Impl |
|
||||
|
||||
## Decisions & Risks
|
||||
- Decision: Self-approval allowed for G0-G1, not for G2+. Implemented in ApprovalRequirements.GetDefault().
|
||||
- Decision: Evidence required for G2+, optional for G0-G1. Implemented in rules validation.
|
||||
- Decision: Exception inheritance (repo -> image -> env) deferred to follow-up sprint (EXCEPT-18).
|
||||
- Risk: Approval bottleneck slowing releases. Mitigation: parallel approval paths via RequiredApproverIds array.
|
||||
- Risk: Expired exceptions causing sudden build failures. Mitigation: 7-day request expiry window, TTL enforcement.
|
||||
|
||||
## Next Checkpoints
|
||||
- 2025-12-30 | EXCEPT-03 complete | Approval rules engine implemented | DONE
|
||||
- 2026-01-03 | EXCEPT-07 complete | All API endpoints functional | DONE
|
||||
- 2026-01-06 | EXCEPT-14 complete | Full workflow integration tested | DEFERRED
|
||||
|
||||
## Summary of Deliverables
|
||||
- **Database Migration:** `src/Policy/__Libraries/StellaOps.Policy.Storage.Postgres/Migrations/013_exception_approval.sql`
|
||||
- **Entity Models:** `src/Policy/__Libraries/StellaOps.Policy.Storage.Postgres/Models/ExceptionApprovalEntity.cs`
|
||||
- **Repository Interface:** `src/Policy/__Libraries/StellaOps.Policy.Storage.Postgres/Repositories/IExceptionApprovalRepository.cs`
|
||||
- **Repository Implementation:** `src/Policy/__Libraries/StellaOps.Policy.Storage.Postgres/Repositories/ExceptionApprovalRepository.cs`
|
||||
- **Rules Service:** `src/Policy/StellaOps.Policy.Engine/Services/ExceptionApprovalRulesService.cs`
|
||||
- **API Endpoints:** `src/Policy/StellaOps.Policy.Gateway/Endpoints/ExceptionApprovalEndpoints.cs`
|
||||
- **CLI Commands:** `src/Cli/StellaOps.Cli/Commands/ExceptionCommandGroup.cs`
|
||||
- **Authority Scope:** `src/Authority/StellaOps.Authority/StellaOps.Auth.Abstractions/StellaOpsScopes.cs` (ExceptionsRequest added)
|
||||
Reference in New Issue
Block a user