@derwinjs/db 0.12.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  {
2
- "name": "prisma-client-b50acb8ba6a971962b4114ac48cb52ea37c6a0a760ad2278d452f35f9c278c8c",
2
+ "name": "prisma-client-00cfa620928582b31d30005d1c7a6d19d06a48592e2ae5625b10eef0b2027265",
3
3
  "main": "index.js",
4
4
  "types": "index.d.ts",
5
5
  "browser": "index-browser.js",
@@ -153,6 +153,7 @@ model Project {
153
153
  tenantFuzzConfig TenantFuzzConfig?
154
154
  rumSamples RumSample[]
155
155
  milestoneEvents MilestoneEvent[]
156
+ selfReviewVerdicts SelfReviewVerdict[]
156
157
 
157
158
  @@map("projects")
158
159
  @@schema("derwin")
@@ -485,9 +486,10 @@ model QAFixAttempt {
485
486
  attemptedAt DateTime @default(now())
486
487
  closedAt DateTime?
487
488
 
488
- ticket QATicket @relation(fields: [qaTicketId], references: [id], onDelete: Cascade)
489
- project Project @relation(fields: [projectId], references: [id], onDelete: Cascade)
490
- artifacts AuditArtifact[]
489
+ ticket QATicket @relation(fields: [qaTicketId], references: [id], onDelete: Cascade)
490
+ project Project @relation(fields: [projectId], references: [id], onDelete: Cascade)
491
+ artifacts AuditArtifact[]
492
+ selfReviewVerdicts SelfReviewVerdict[]
491
493
 
492
494
  @@index([qaTicketId, attemptNumber])
493
495
  @@index([projectId, attemptedAt(sort: Desc)])
@@ -505,6 +507,11 @@ enum AttemptStatus {
505
507
  REJECTED
506
508
  REGRESSED_REVERTED
507
509
  FAILED
510
+ // QAP-133 (Sprint 13 Phase 9). Set by the orchestrator when the recursive
511
+ // self-reviewer returns 'fail' or 'manual_review_required'. Blocks dispatch
512
+ // until an operator overrides via the orchestrate route's ?force=true flag
513
+ // (which auditably writes a synthetic SelfReviewVerdict 'pass' row).
514
+ MANUAL_REVIEW_REQUIRED
508
515
 
509
516
  @@schema("derwin")
510
517
  }
@@ -1171,3 +1178,47 @@ model MilestoneEvent {
1171
1178
  @@map("milestone_events")
1172
1179
  @@schema("derwin")
1173
1180
  }
1181
+
1182
+ // ═══════════════════════════════════════════════════════════════════════════
1183
+ // QAP-133 (Sprint 13 Phase 9) — Recursive self-review verdict audit trail.
1184
+ //
1185
+ // Pre-merge gate: the recursive self-reviewer (Anthropic-backed adapter
1186
+ // reviewing Claude's own diff) emits one verdict row per call. The
1187
+ // orchestrator persists every call's verdict regardless of outcome — the
1188
+ // audit trail is non-negotiable. The orchestrate route's `?force=true`
1189
+ // override path also writes here with verdict='pass' and reasonHints
1190
+ // capturing the operator's userId so every override is auditable.
1191
+ //
1192
+ // Tenant scope: every read/write filters by projectId (Pattern D). The
1193
+ // (projectId, classification, surface) compound index supports cohort
1194
+ // queries surfaced on the dashboard. The (projectId, createdAt desc)
1195
+ // index supports the recent-verdicts pane.
1196
+ //
1197
+ // The Prisma-backed implementation lives at
1198
+ // packages/db/src/self-review-verdict-store.ts; the SDK contract is in
1199
+ // @derwinjs/sdk (SelfReviewVerdictStore in
1200
+ // packages/sdk/src/types/self-review-verdict-store.ts).
1201
+
1202
+ model SelfReviewVerdict {
1203
+ id String @id @default(cuid())
1204
+ projectId String
1205
+ qaFixAttemptId String
1206
+ qaTicketId String
1207
+ classification String // mirrored from QATicket for cohort analysis
1208
+ surface String // mirrored from QATicket for cohort analysis
1209
+ verdict String // 'pass' | 'fail' | 'manual_review_required'
1210
+ reasonHints String[] // pgsql native array; reasonHints from the SDK
1211
+ criticalIssuesFound Int
1212
+ minorIssuesFound Int
1213
+ createdAt DateTime @default(now())
1214
+
1215
+ project Project @relation(fields: [projectId], references: [id], onDelete: Cascade)
1216
+ qaFixAttempt QAFixAttempt @relation(fields: [qaFixAttemptId], references: [id], onDelete: Cascade)
1217
+
1218
+ @@index([projectId])
1219
+ @@index([qaFixAttemptId])
1220
+ @@index([projectId, classification, surface]) // cohort queries
1221
+ @@index([projectId, createdAt(sort: Desc)]) // recent verdicts
1222
+ @@map("self_review_verdicts")
1223
+ @@schema("derwin")
1224
+ }
@@ -504,6 +504,20 @@ exports.Prisma.MilestoneEventScalarFieldEnum = {
504
504
  updatedAt: 'updatedAt'
505
505
  };
506
506
 
507
+ exports.Prisma.SelfReviewVerdictScalarFieldEnum = {
508
+ id: 'id',
509
+ projectId: 'projectId',
510
+ qaFixAttemptId: 'qaFixAttemptId',
511
+ qaTicketId: 'qaTicketId',
512
+ classification: 'classification',
513
+ surface: 'surface',
514
+ verdict: 'verdict',
515
+ reasonHints: 'reasonHints',
516
+ criticalIssuesFound: 'criticalIssuesFound',
517
+ minorIssuesFound: 'minorIssuesFound',
518
+ createdAt: 'createdAt'
519
+ };
520
+
507
521
  exports.Prisma.SortOrder = {
508
522
  asc: 'asc',
509
523
  desc: 'desc'
@@ -617,7 +631,8 @@ exports.AttemptStatus = exports.$Enums.AttemptStatus = {
617
631
  HUMAN_MERGED: 'HUMAN_MERGED',
618
632
  REJECTED: 'REJECTED',
619
633
  REGRESSED_REVERTED: 'REGRESSED_REVERTED',
620
- FAILED: 'FAILED'
634
+ FAILED: 'FAILED',
635
+ MANUAL_REVIEW_REQUIRED: 'MANUAL_REVIEW_REQUIRED'
621
636
  };
622
637
 
623
638
  exports.ArtifactType = exports.$Enums.ArtifactType = {
@@ -717,7 +732,8 @@ exports.Prisma.ModelName = {
717
732
  ContractBaseline: 'ContractBaseline',
718
733
  TenantFuzzConfig: 'TenantFuzzConfig',
719
734
  RumSample: 'RumSample',
720
- MilestoneEvent: 'MilestoneEvent'
735
+ MilestoneEvent: 'MilestoneEvent',
736
+ SelfReviewVerdict: 'SelfReviewVerdict'
721
737
  };
722
738
 
723
739
  /**