Commit aa3cc2e
feat(code-review): manual council reviews (multi-specialist, per-model, single session) (#4569)
* feat(code-review): council manual-run backend, council_result persistence, selection glue
* fix Problem: const reviewType = input.council ? 'council' : 'standard' keys only off the presence of the council object. CodeReviewCouncilConfigSchema allows specialists up to .max(8) with no minimum and defaults enabled to true, so an input as small as council: {} parses successfully to { enabled: true, specialists: [] }. That request is stamped review_type: 'council', passes through the enterprise entitlement gate (assertCouncilCreationAllowed), and is persisted as a council run — even though the canonical isCouncilActive predicate (packages/worker-utils/src/code-review-council.ts:526) requires enabled && enabledSpecialists >= COUNCIL_MIN_SPECIALISTS (2). This creates drift between how the row is labeled/gated and whether it can actually behave as a council.
* feat(code-review): manual council New Job UI (specialist picker, per-model/effort, voting), gated
* refactor(code-review): single source of truth for council finding schema
* feat(code-review): single-session council execution (runtimeAgents, coordinator prompt, payload fork)
* feat(code-review): capture council manifest, compute decision, persist council_result
* refactor(code-review): parse manual config once in council finalize; document intentional entitlement fail-fast
* feat(code-review): council results panel + council unit tests (prompt, finalize mapping)
* refactor(code-review): drop unused councilSelectionsFromConfig until a seed-from-config flow exists
* fix(code-review-council): address PR findings
* fix(code-review-council): address second-round review findings
- Persist council_result atomically in the analytics completion tx
- Council manifest no longer collides with the analytics final-line marker
- Specialists on their own model no longer inherit the base model's variant
- Bound the inherited council base model to the runtime-agent limit
- Keep council_result off hot full-row reads; load it only for the detail view
- Remove the colliding 0185 council migration (regenerate as 0186 post-merge)
* chore(db): regenerate council_result
migration as 0186 after main merge
Resolves the 0185 collision with origin/main's
0185_lowly_mandroid; the
council_result column now lands on top of the merged
baseline.
* fix(council reviews) correct the sub agent guidance prompts for council reviews
* perf(code-review-council): skip council_result query on in-flight polls
* perf(code-review-council): gate entitlement query on rollout flag + non-local
* chore: re-sign HEAD with verified
identity
---------
Co-authored-by: St0rmz1 <astorms@replicated.com>1 parent cb39835 commit aa3cc2e
30 files changed
Lines changed: 37042 additions & 59 deletions
File tree
- apps/web/src
- app
- (app)
- code-reviews/[reviewId]
- organizations/[id]/code-reviews
- api/internal/code-review-status/[reviewId]
- components/code-reviews
- lib/code-reviews
- analytics
- core
- council
- db
- prompts
- triggers
- routers
- code-reviews
- organizations
- packages
- db/src
- migrations
- meta
- worker-utils/src
- services/code-review-infra/src
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
287 | 288 | | |
288 | 289 | | |
289 | 290 | | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
290 | 299 | | |
291 | 300 | | |
292 | 301 | | |
| |||
Lines changed: 18 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
28 | 30 | | |
29 | 31 | | |
30 | 32 | | |
| |||
59 | 61 | | |
60 | 62 | | |
61 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
62 | 78 | | |
63 | 79 | | |
64 | 80 | | |
| |||
292 | 308 | | |
293 | 309 | | |
294 | 310 | | |
| 311 | + | |
295 | 312 | | |
296 | 313 | | |
297 | 314 | | |
| |||
405 | 422 | | |
406 | 423 | | |
407 | 424 | | |
| 425 | + | |
408 | 426 | | |
409 | 427 | | |
410 | 428 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
252 | 252 | | |
253 | 253 | | |
254 | 254 | | |
| 255 | + | |
255 | 256 | | |
256 | 257 | | |
257 | 258 | | |
| |||
Lines changed: 26 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
96 | 100 | | |
97 | 101 | | |
98 | 102 | | |
| |||
1052 | 1056 | | |
1053 | 1057 | | |
1054 | 1058 | | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
1055 | 1066 | | |
1056 | 1067 | | |
1057 | 1068 | | |
| |||
1321 | 1332 | | |
1322 | 1333 | | |
1323 | 1334 | | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
1324 | 1350 | | |
1325 | 1351 | | |
1326 | 1352 | | |
| |||
Lines changed: 131 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
50 | 68 | | |
51 | 69 | | |
52 | 70 | | |
| |||
76 | 94 | | |
77 | 95 | | |
78 | 96 | | |
| 97 | + | |
| 98 | + | |
79 | 99 | | |
80 | 100 | | |
81 | 101 | | |
| |||
167 | 187 | | |
168 | 188 | | |
169 | 189 | | |
| 190 | + | |
170 | 191 | | |
171 | 192 | | |
172 | 193 | | |
| |||
179 | 200 | | |
180 | 201 | | |
181 | 202 | | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
182 | 209 | | |
183 | 210 | | |
184 | 211 | | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
185 | 220 | | |
186 | 221 | | |
187 | 222 | | |
| |||
264 | 299 | | |
265 | 300 | | |
266 | 301 | | |
267 | | - | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
268 | 307 | | |
269 | 308 | | |
270 | 309 | | |
| |||
311 | 350 | | |
312 | 351 | | |
313 | 352 | | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
314 | 356 | | |
315 | 357 | | |
316 | 358 | | |
| |||
370 | 412 | | |
371 | 413 | | |
372 | 414 | | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
373 | 429 | | |
374 | 430 | | |
375 | 431 | | |
376 | 432 | | |
377 | 433 | | |
378 | 434 | | |
| 435 | + | |
379 | 436 | | |
380 | 437 | | |
381 | 438 | | |
| |||
528 | 585 | | |
529 | 586 | | |
530 | 587 | | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
531 | 661 | | |
532 | 662 | | |
533 | 663 | | |
| |||
0 commit comments