@rigour-labs/core 6.9.0-rc.3 → 6.9.0-rc.5

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.
Files changed (36) hide show
  1. package/dist/index.d.ts +3 -2
  2. package/dist/index.js +2 -2
  3. package/dist/outcomes/metrics.d.ts +88 -0
  4. package/dist/outcomes/metrics.js +56 -0
  5. package/dist/outcomes/run.d.ts +5 -0
  6. package/dist/outcomes/run.js +26 -6
  7. package/dist/review/reviewer/orchestrator.d.ts +51 -0
  8. package/dist/review/reviewer/orchestrator.js +96 -0
  9. package/dist/review/reviewer/settings.js +1 -1
  10. package/dist/review/reviewer/specialists/cleanup.v1.d.ts +9 -0
  11. package/dist/review/reviewer/specialists/cleanup.v1.js +9 -0
  12. package/dist/review/reviewer/specialists/correctness.v1.d.ts +9 -0
  13. package/dist/review/reviewer/specialists/correctness.v1.js +9 -0
  14. package/dist/review/reviewer/specialists/prior-points.v1.d.ts +9 -0
  15. package/dist/review/reviewer/specialists/prior-points.v1.js +9 -0
  16. package/dist/review/reviewer/specialists/production-cost.v1.d.ts +9 -0
  17. package/dist/review/reviewer/specialists/production-cost.v1.js +9 -0
  18. package/dist/review/reviewer/specialists/rules-and-goal.v1.d.ts +9 -0
  19. package/dist/review/reviewer/specialists/rules-and-goal.v1.js +9 -0
  20. package/dist/review/reviewer/store.d.ts +35 -0
  21. package/dist/review/reviewer/store.js +41 -0
  22. package/dist/review/reviewer/triage.d.ts +62 -0
  23. package/dist/review/reviewer/triage.js +147 -0
  24. package/dist/review/reviewer/usage.js +14 -0
  25. package/dist/review/reviewer/verdict.js +24 -7
  26. package/dist/review/reviewer.d.ts +31 -2
  27. package/dist/review/reviewer.js +187 -43
  28. package/dist/review-learning/lessons.d.ts +6 -0
  29. package/dist/review-learning/lessons.js +11 -0
  30. package/dist/settings.d.ts +1 -0
  31. package/dist/switches.d.ts +311 -0
  32. package/dist/switches.js +1 -0
  33. package/dist/templates/universal-config.js +1 -0
  34. package/dist/types/index.d.ts +11 -0
  35. package/dist/types/index.js +5 -0
  36. package/package.json +6 -6
@@ -292,6 +292,316 @@ export declare const SWITCHES: {
292
292
  panel: "off" | "on" | "required";
293
293
  mode_required: boolean;
294
294
  dismissals: boolean;
295
+ orchestrator: "off" | "on" | "required";
296
+ panel_max_items: number;
297
+ judges: 2 | 3;
298
+ escalate: "always" | "risk";
299
+ cross_models: Record<string, string>;
300
+ reasoning: Record<string, "high" | "medium" | "low">;
301
+ judge_env: Record<string, {
302
+ unset: string[];
303
+ }>;
304
+ model?: string | undefined;
305
+ max_runs_per_day?: number | undefined;
306
+ max_usd_per_day?: number | undefined;
307
+ api?: {
308
+ model: string;
309
+ url: string;
310
+ key_env: string;
311
+ max_turns: number;
312
+ vendor?: "anthropic" | "openai" | "google" | "other" | undefined;
313
+ } | undefined;
314
+ };
315
+ github_account?: string | undefined;
316
+ };
317
+ preset?: string | undefined;
318
+ paradigm?: string | undefined;
319
+ }) => "off" | "on" | "required";
320
+ };
321
+ orchestrator: {
322
+ label: string;
323
+ env: string;
324
+ teamPath: string[];
325
+ team: (config: {
326
+ ignore: string[];
327
+ commands: {
328
+ format?: string | undefined;
329
+ lint?: string | undefined;
330
+ typecheck?: string | undefined;
331
+ test?: string | undefined;
332
+ };
333
+ gates: {
334
+ deep: {
335
+ temperature: number;
336
+ intent_checks: boolean;
337
+ checks: {
338
+ architecture: boolean;
339
+ test_quality: boolean;
340
+ solid: boolean;
341
+ dry: boolean;
342
+ design_patterns: boolean;
343
+ language_idioms: boolean;
344
+ error_handling: boolean;
345
+ code_smells: boolean;
346
+ };
347
+ max_tokens?: number | undefined;
348
+ timeout_ms?: number | undefined;
349
+ budget_ms?: number | undefined;
350
+ agentic?: boolean | undefined;
351
+ repo_rules?: boolean | undefined;
352
+ review_lessons?: "verified" | "all" | "off" | undefined;
353
+ router?: {
354
+ enabled?: boolean | undefined;
355
+ min_score?: number | undefined;
356
+ max_functions?: number | undefined;
357
+ } | undefined;
358
+ };
359
+ max_file_lines: number;
360
+ forbid_todos: boolean;
361
+ forbid_fixme: boolean;
362
+ required_files: string[];
363
+ ast: {
364
+ complexity: number;
365
+ max_methods: number;
366
+ max_params: number;
367
+ };
368
+ staleness: {
369
+ enabled: boolean;
370
+ rules: Record<string, boolean>;
371
+ };
372
+ dependencies: {
373
+ forbid: string[];
374
+ detect_unused: boolean;
375
+ detect_heavy_alternatives: boolean;
376
+ detect_duplicate_purpose: boolean;
377
+ unused_allowlist: string[];
378
+ };
379
+ architecture: {
380
+ boundaries: {
381
+ from: string;
382
+ to: string;
383
+ mode: "allow" | "deny";
384
+ }[];
385
+ };
386
+ safety: {
387
+ max_files_changed_per_cycle: number;
388
+ protected_paths: string[];
389
+ };
390
+ context: {
391
+ enabled: boolean;
392
+ sensitivity: number;
393
+ mining_depth: number;
394
+ };
395
+ environment: {
396
+ enabled: boolean;
397
+ enforce_contracts: boolean;
398
+ tools: Record<string, string>;
399
+ required_env: string[];
400
+ };
401
+ retry_loop_breaker: {
402
+ enabled: boolean;
403
+ max_retries: number;
404
+ doc_sources: Record<string, string>;
405
+ };
406
+ agent_team: {
407
+ enabled: boolean;
408
+ max_concurrent_agents: number;
409
+ task_ownership: "strict" | "collaborative";
410
+ };
411
+ checkpoint: {
412
+ enabled: boolean;
413
+ interval_minutes: number;
414
+ quality_threshold: number;
415
+ drift_detection: boolean;
416
+ };
417
+ security: {
418
+ enabled: boolean;
419
+ sql_injection: boolean;
420
+ xss: boolean;
421
+ path_traversal: boolean;
422
+ hardcoded_secrets: boolean;
423
+ insecure_randomness: boolean;
424
+ command_injection: boolean;
425
+ block_on_severity: "critical" | "high" | "medium" | "low";
426
+ };
427
+ frontend_secret_exposure: {
428
+ enabled: boolean;
429
+ block_on_severity: "critical" | "high" | "medium" | "low";
430
+ check_process_env: boolean;
431
+ check_import_meta_env: boolean;
432
+ secret_env_name_patterns: string[];
433
+ safe_public_prefixes: string[];
434
+ frontend_path_patterns: string[];
435
+ server_path_patterns: string[];
436
+ allowlist_env_names: string[];
437
+ };
438
+ duplication_drift: {
439
+ enabled: boolean;
440
+ similarity_threshold: number;
441
+ min_body_lines: number;
442
+ };
443
+ hallucinated_imports: {
444
+ enabled: boolean;
445
+ ignore_patterns: string[];
446
+ };
447
+ inconsistent_error_handling: {
448
+ enabled: boolean;
449
+ max_strategies_per_type: number;
450
+ min_occurrences: number;
451
+ ignore_empty_catches: boolean;
452
+ };
453
+ context_window_artifacts: {
454
+ enabled: boolean;
455
+ min_file_lines: number;
456
+ degradation_threshold: number;
457
+ signals_required: number;
458
+ };
459
+ promise_safety: {
460
+ enabled: boolean;
461
+ ignore_patterns: string[];
462
+ check_unhandled_then: boolean;
463
+ check_unsafe_parse: boolean;
464
+ check_async_without_await: boolean;
465
+ check_unsafe_fetch: boolean;
466
+ };
467
+ phantom_apis: {
468
+ enabled: boolean;
469
+ ignore_patterns: string[];
470
+ check_node: boolean;
471
+ check_python: boolean;
472
+ check_go: boolean;
473
+ check_csharp: boolean;
474
+ check_java: boolean;
475
+ };
476
+ deprecated_apis: {
477
+ enabled: boolean;
478
+ ignore_patterns: string[];
479
+ check_node: boolean;
480
+ check_python: boolean;
481
+ check_go: boolean;
482
+ check_csharp: boolean;
483
+ check_java: boolean;
484
+ check_web: boolean;
485
+ block_security_deprecated: boolean;
486
+ };
487
+ test_quality: {
488
+ enabled: boolean;
489
+ check_empty_tests: boolean;
490
+ check_tautological: boolean;
491
+ check_mock_heavy: boolean;
492
+ check_assertion_free_async: boolean;
493
+ max_mocks_per_test: number;
494
+ };
495
+ governance: {
496
+ enabled: boolean;
497
+ enforce_memory: boolean;
498
+ enforce_skills: boolean;
499
+ block_native_memory: boolean;
500
+ protected_memory_paths: string[];
501
+ protected_skills_paths: string[];
502
+ exempt_paths: string[];
503
+ };
504
+ unindexed_reads: {
505
+ enabled: boolean;
506
+ migrations: string[];
507
+ };
508
+ deprecated_dependencies: {
509
+ enabled: boolean;
510
+ registry?: string | undefined;
511
+ };
512
+ unused_exports: {
513
+ enabled: boolean;
514
+ allow: string[];
515
+ block: boolean;
516
+ };
517
+ query_patterns: {
518
+ enabled: boolean;
519
+ };
520
+ change_sweep: {
521
+ enabled: boolean;
522
+ };
523
+ redundancy: {
524
+ enabled: boolean;
525
+ wire_contracts: string[];
526
+ schema_migrations: string[];
527
+ };
528
+ optional_params: {
529
+ enabled: boolean;
530
+ };
531
+ duplicate_functions: {
532
+ enabled: boolean;
533
+ };
534
+ orphan_files: {
535
+ enabled: boolean;
536
+ allow: string[];
537
+ block: boolean;
538
+ };
539
+ migration_order: {
540
+ enabled: boolean;
541
+ dirs: string[];
542
+ };
543
+ semantic_bugs: {
544
+ enabled: boolean;
545
+ rules?: string[] | undefined;
546
+ };
547
+ side_effect_analysis: {
548
+ enabled: boolean;
549
+ ignore_patterns: string[];
550
+ check_unbounded_timers: boolean;
551
+ check_unbounded_loops: boolean;
552
+ check_process_lifecycle: boolean;
553
+ check_recursive_depth: boolean;
554
+ check_resource_lifecycle: boolean;
555
+ check_retry_without_limit: boolean;
556
+ check_circular_triggers: boolean;
557
+ check_auto_restart: boolean;
558
+ };
559
+ style_drift: {
560
+ enabled: boolean;
561
+ deviation_threshold: number;
562
+ sample_size: number;
563
+ baseline_path: string;
564
+ };
565
+ logic_drift: {
566
+ enabled: boolean;
567
+ baseline_path: string;
568
+ track_operators: boolean;
569
+ track_branches: boolean;
570
+ track_returns: boolean;
571
+ };
572
+ };
573
+ hooks: {
574
+ require_review_ack: boolean;
575
+ };
576
+ output: {
577
+ report_path: string;
578
+ };
579
+ brief: {
580
+ enabled: boolean;
581
+ max_items: number;
582
+ };
583
+ learning: {
584
+ outcomes: {
585
+ mode: "off" | "on" | "required";
586
+ window_days: number;
587
+ demote_after: number;
588
+ };
589
+ };
590
+ review: {
591
+ include_heuristics: boolean;
592
+ show_preexisting: boolean;
593
+ goal: "off" | "on" | "required";
594
+ reviewer: {
595
+ enabled: boolean;
596
+ mode: "single" | "cross" | "full";
597
+ timeout_ms: number;
598
+ on_push: "off" | "background" | "wait";
599
+ reviewers: string[];
600
+ models: Record<string, string>;
601
+ panel: "off" | "on" | "required";
602
+ mode_required: boolean;
603
+ dismissals: boolean;
604
+ orchestrator: "off" | "on" | "required";
295
605
  panel_max_items: number;
296
606
  judges: 2 | 3;
297
607
  escalate: "always" | "risk";
@@ -600,6 +910,7 @@ export declare const SWITCHES: {
600
910
  panel: "off" | "on" | "required";
601
911
  mode_required: boolean;
602
912
  dismissals: boolean;
913
+ orchestrator: "off" | "on" | "required";
603
914
  panel_max_items: number;
604
915
  judges: 2 | 3;
605
916
  escalate: "always" | "risk";
package/dist/switches.js CHANGED
@@ -7,6 +7,7 @@
7
7
  import { loadSettings, saveSettings } from './settings.js';
8
8
  export const SWITCHES = {
9
9
  goal: { label: 'goal check', env: 'RIGOUR_GOAL', teamPath: ['review', 'goal'], team: config => config.review?.goal },
10
+ orchestrator: { label: 'review orchestrator', env: 'RIGOUR_REVIEWER_ORCHESTRATOR', teamPath: ['review', 'reviewer', 'orchestrator'], team: config => config.review?.reviewer?.orchestrator },
10
11
  outcomes: { label: 'outcome loop', env: 'RIGOUR_OUTCOMES', teamPath: ['learning', 'outcomes', 'mode'], team: config => config.learning?.outcomes?.mode },
11
12
  };
12
13
  export function resolveSwitch(name, config, flag, user = loadSettings()[name], env = process.env) {
@@ -297,6 +297,7 @@ export const UNIVERSAL_CONFIG = {
297
297
  mode_required: false,
298
298
  panel_max_items: 20,
299
299
  dismissals: false,
300
+ orchestrator: 'off',
300
301
  judges: 2,
301
302
  escalate: 'always',
302
303
  cross_models: {},
@@ -2489,6 +2489,11 @@ export declare const ConfigSchema: z.ZodObject<{
2489
2489
  * a wrong finding is fixed by improving the reviewer, a right one by fixing the code. A team decision only.
2490
2490
  */
2491
2491
  dismissals: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
2492
+ /**
2493
+ * Review only the parts a change needs, picked without a model, usually in one pass (reviewer/orchestrator.ts,
2494
+ * triage.ts): off, on, or required (no person, environment variable or flag may turn it off). Experimental.
2495
+ */
2496
+ orchestrator: z.ZodDefault<z.ZodOptional<z.ZodEnum<["off", "on", "required"]>>>;
2492
2497
  /** Findings cross-examined per review at most; the rest are shown as disputed. */
2493
2498
  panel_max_items: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
2494
2499
  /**
@@ -2555,6 +2560,7 @@ export declare const ConfigSchema: z.ZodObject<{
2555
2560
  panel: "off" | "on" | "required";
2556
2561
  mode_required: boolean;
2557
2562
  dismissals: boolean;
2563
+ orchestrator: "off" | "on" | "required";
2558
2564
  panel_max_items: number;
2559
2565
  judges: 2 | 3;
2560
2566
  escalate: "always" | "risk";
@@ -2584,6 +2590,7 @@ export declare const ConfigSchema: z.ZodObject<{
2584
2590
  panel?: "off" | "on" | "required" | undefined;
2585
2591
  mode_required?: boolean | undefined;
2586
2592
  dismissals?: boolean | undefined;
2593
+ orchestrator?: "off" | "on" | "required" | undefined;
2587
2594
  panel_max_items?: number | undefined;
2588
2595
  max_runs_per_day?: number | undefined;
2589
2596
  max_usd_per_day?: number | undefined;
@@ -2616,6 +2623,7 @@ export declare const ConfigSchema: z.ZodObject<{
2616
2623
  panel: "off" | "on" | "required";
2617
2624
  mode_required: boolean;
2618
2625
  dismissals: boolean;
2626
+ orchestrator: "off" | "on" | "required";
2619
2627
  panel_max_items: number;
2620
2628
  judges: 2 | 3;
2621
2629
  escalate: "always" | "risk";
@@ -2652,6 +2660,7 @@ export declare const ConfigSchema: z.ZodObject<{
2652
2660
  panel?: "off" | "on" | "required" | undefined;
2653
2661
  mode_required?: boolean | undefined;
2654
2662
  dismissals?: boolean | undefined;
2663
+ orchestrator?: "off" | "on" | "required" | undefined;
2655
2664
  panel_max_items?: number | undefined;
2656
2665
  max_runs_per_day?: number | undefined;
2657
2666
  max_usd_per_day?: number | undefined;
@@ -2951,6 +2960,7 @@ export declare const ConfigSchema: z.ZodObject<{
2951
2960
  panel: "off" | "on" | "required";
2952
2961
  mode_required: boolean;
2953
2962
  dismissals: boolean;
2963
+ orchestrator: "off" | "on" | "required";
2954
2964
  panel_max_items: number;
2955
2965
  judges: 2 | 3;
2956
2966
  escalate: "always" | "risk";
@@ -3257,6 +3267,7 @@ export declare const ConfigSchema: z.ZodObject<{
3257
3267
  panel?: "off" | "on" | "required" | undefined;
3258
3268
  mode_required?: boolean | undefined;
3259
3269
  dismissals?: boolean | undefined;
3270
+ orchestrator?: "off" | "on" | "required" | undefined;
3260
3271
  panel_max_items?: number | undefined;
3261
3272
  max_runs_per_day?: number | undefined;
3262
3273
  max_usd_per_day?: number | undefined;
@@ -429,6 +429,11 @@ export const ConfigSchema = z.object({
429
429
  * a wrong finding is fixed by improving the reviewer, a right one by fixing the code. A team decision only.
430
430
  */
431
431
  dismissals: z.boolean().optional().default(false),
432
+ /**
433
+ * Review only the parts a change needs, picked without a model, usually in one pass (reviewer/orchestrator.ts,
434
+ * triage.ts): off, on, or required (no person, environment variable or flag may turn it off). Experimental.
435
+ */
436
+ orchestrator: z.enum(['off', 'on', 'required']).optional().default('off'),
432
437
  /** Findings cross-examined per review at most; the rest are shown as disputed. */
433
438
  panel_max_items: z.number().int().positive().optional().default(20),
434
439
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rigour-labs/core",
3
- "version": "6.9.0-rc.3",
3
+ "version": "6.9.0-rc.5",
4
4
  "description": "Rigour's review engine: deterministic gates on changed lines, rules and lessons learned from your team's fixes, and per-check precision from what you fix versus dismiss, across TypeScript, JavaScript, Python, Go, Ruby and C#.",
5
5
  "engines": {
6
6
  "node": ">=22.13"
@@ -75,11 +75,11 @@
75
75
  "@anthropic-ai/sdk": "^0.132.1",
76
76
  "pg": "^8.16.3",
77
77
  "openai": "^5.23.2",
78
- "@rigour-labs/brain-darwin-arm64": "6.9.0-rc.3",
79
- "@rigour-labs/brain-darwin-x64": "6.9.0-rc.3",
80
- "@rigour-labs/brain-linux-arm64": "6.9.0-rc.3",
81
- "@rigour-labs/brain-win-x64": "6.9.0-rc.3",
82
- "@rigour-labs/brain-linux-x64": "6.9.0-rc.3"
78
+ "@rigour-labs/brain-darwin-arm64": "6.9.0-rc.5",
79
+ "@rigour-labs/brain-linux-arm64": "6.9.0-rc.5",
80
+ "@rigour-labs/brain-win-x64": "6.9.0-rc.5",
81
+ "@rigour-labs/brain-darwin-x64": "6.9.0-rc.5",
82
+ "@rigour-labs/brain-linux-x64": "6.9.0-rc.5"
83
83
  },
84
84
  "devDependencies": {
85
85
  "@types/fs-extra": "^11.0.4",