Workstream H: Implement VS-03 Approval Workflow #23
Reference in New Issue
Block a user
Delete Branch "feat/H-vs03-approval-workflow"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Workstream H: Implement VS-03 Approval Workflow (Maker-Checker Governance)
Summary
Deliverables
1. API Endpoints (3)
POST /approvals (CreateApprovalEndpoint)
GET /approvals (ListApprovalsEndpoint)
POST /approvals/{id}/approve (ApproveApprovalEndpoint)
2. Domain Logic
ApprovalPolicy.cs: Pure business rules
ApprovalProposal.cs: Entities
3. Data Access
4. Database Schema (0036_approval_workflow.sql)
`sql
model_operations.approval_proposals
├─ id, model_id, status (DRAFT|PROPOSED|APPROVED|ACTIVE)
├─ created_by, created_at
├─ proposed_at, approved_by, approved_at
├─ activated_by, activated_at
└─ published_at, revision, correlation_id
model_operations.approval_evidence
├─ id, approval_proposal_id
├─ evidence_type (PBO_SCORE, DSR_METRIC, OOS_RETURN, BACKTEST_REPORT)
├─ evidence_url (S3 artifact), reviewer_comment
└─ published_at, correlation_id
model_operations.approval_events (audit trail)
├─ event_type (CREATED, PROPOSED, APPROVED, ACTIVATED)
├─ actor_email, event_at, details (JSONB)
└─ published_at, correlation_id
`
RBAC & Separation of Duties
Critical: CanApproveApproval(proposal, checker, maker) returns false if checker == maker (separation of duties enforced at Endpoint level)
Testing
Unit Tests (5):
Integration Tests (3):
Compliance & Verification
AGENTS.md v16.0: 13/13 criteria
Separation of Duties: Maker ≠ Checker enforced
Evidence Linkage: All evidence URLs traceable to S3 artifacts
Immutable Audit Trail: INSERT-only events, no UPDATE/DELETE
Correlation Tracking: CorrelationId links all related events
Review Checklist
Related Issues & PRs
Timeline
Generated with Claude Code 🤖
- 3 API endpoints: POST /approvals, GET /approvals, POST /approvals/{id}/approve - State machine: DRAFT → PROPOSED → APPROVED → ACTIVE - RBAC enforcement: Maker ≠ Checker separation of duties - Evidence linkage: PBO/DSR/OOS artifact URLs stored - Schema: Append-only events with correlation_id - Tests: 5+ unit/integration scenarios - Documentation: Full API contracts + compliance procedures - AGENTS.md v16.0 13/13 compliance ✅ Closes workstream H (Phase 2 implementation). Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>