@rigour-labs/core 6.6.5 → 6.6.6

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 (60) hide show
  1. package/dist/gates/frontend-secret-exposure.d.ts +1 -1
  2. package/dist/gates/frontend-secret-exposure.js +9 -3
  3. package/dist/gates/frontend-secret-exposure.test.js +4 -1
  4. package/dist/hooks/index.d.ts +1 -1
  5. package/dist/hooks/index.js +1 -1
  6. package/dist/hooks/stop-review.d.ts +6 -9
  7. package/dist/hooks/stop-review.js +5 -10
  8. package/dist/index.d.ts +5 -2
  9. package/dist/index.js +5 -2
  10. package/dist/review/backtest-init.d.ts +8 -0
  11. package/dist/review/backtest-init.js +87 -0
  12. package/dist/review/backtest-init.test.d.ts +1 -0
  13. package/dist/review/backtest-init.test.js +74 -0
  14. package/dist/review/backtest.d.ts +315 -0
  15. package/dist/review/backtest.js +197 -0
  16. package/dist/review/backtest.test.d.ts +1 -0
  17. package/dist/review/backtest.test.js +129 -0
  18. package/dist/review/dead-code.test.js +8 -0
  19. package/dist/review/lint-overlay.d.ts +21 -0
  20. package/dist/review/lint-overlay.js +89 -0
  21. package/dist/review/quiet.d.ts +6 -0
  22. package/dist/review/quiet.js +12 -2
  23. package/dist/review/quiet.test.js +11 -0
  24. package/dist/review/review.d.ts +6 -0
  25. package/dist/review/review.js +8 -1
  26. package/dist/review/reviewer/adapters.d.ts +35 -0
  27. package/dist/review/reviewer/adapters.js +156 -0
  28. package/dist/review/reviewer/background.d.ts +34 -0
  29. package/dist/review/reviewer/background.js +128 -0
  30. package/dist/review/reviewer/background.test.d.ts +1 -0
  31. package/dist/review/reviewer/background.test.js +104 -0
  32. package/dist/review/reviewer/exec.d.ts +17 -0
  33. package/dist/review/reviewer/exec.js +23 -0
  34. package/dist/review/reviewer/inputs.d.ts +37 -0
  35. package/dist/review/reviewer/inputs.js +103 -0
  36. package/dist/review/reviewer/merge-impact.d.ts +2 -0
  37. package/dist/review/reviewer/merge-impact.js +64 -0
  38. package/dist/review/reviewer/prompt.d.ts +21 -0
  39. package/dist/review/reviewer/prompt.js +123 -0
  40. package/dist/review/reviewer/store.d.ts +26 -0
  41. package/dist/review/reviewer/store.js +57 -0
  42. package/dist/review/reviewer/verdict.d.ts +127 -0
  43. package/dist/review/reviewer/verdict.js +156 -0
  44. package/dist/review/reviewer.d.ts +41 -49
  45. package/dist/review/reviewer.js +210 -202
  46. package/dist/review/reviewer.test.js +199 -48
  47. package/dist/review/toolchain.d.ts +5 -2
  48. package/dist/review/toolchain.js +81 -6
  49. package/dist/review/toolchain.test.js +39 -1
  50. package/dist/review/typed/program.d.ts +27 -0
  51. package/dist/review/typed/program.js +90 -0
  52. package/dist/review/typed/redundancy.d.ts +10 -0
  53. package/dist/review/typed/redundancy.js +339 -0
  54. package/dist/review/typed/redundancy.test.d.ts +1 -0
  55. package/dist/review/typed/redundancy.test.js +121 -0
  56. package/dist/review/unused-exports.js +8 -4
  57. package/dist/templates/universal-config.js +8 -1
  58. package/dist/types/index.d.ts +94 -8
  59. package/dist/types/index.js +24 -2
  60. package/package.json +6 -6
@@ -545,6 +545,22 @@ export declare const GatesSchema: z.ZodObject<{
545
545
  }, {
546
546
  enabled?: boolean | undefined;
547
547
  }>>>;
548
+ /**
549
+ * What a change made redundant, from the project's own TypeScript (review/typed/redundancy.ts): a null filter beside a
550
+ * range on the same column, a nullable row type the query filters non-null, an optional member every host supplies, a
551
+ * property written and never read. Runs at push, in `rigour review` and in a backtest (the program takes seconds to build).
552
+ * `wire_contracts`: files whose types another service reads, so their members are never write-only here.
553
+ */
554
+ redundancy: z.ZodDefault<z.ZodOptional<z.ZodObject<{
555
+ enabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
556
+ wire_contracts: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
557
+ }, "strip", z.ZodTypeAny, {
558
+ enabled: boolean;
559
+ wire_contracts: string[];
560
+ }, {
561
+ enabled?: boolean | undefined;
562
+ wire_contracts?: string[] | undefined;
563
+ }>>>;
548
564
  /** A parameter the change adds as optional that only tests omit (review/optional-params.ts). */
549
565
  optional_params: z.ZodDefault<z.ZodOptional<z.ZodObject<{
550
566
  enabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
@@ -1019,6 +1035,10 @@ export declare const GatesSchema: z.ZodObject<{
1019
1035
  change_sweep: {
1020
1036
  enabled: boolean;
1021
1037
  };
1038
+ redundancy: {
1039
+ enabled: boolean;
1040
+ wire_contracts: string[];
1041
+ };
1022
1042
  optional_params: {
1023
1043
  enabled: boolean;
1024
1044
  };
@@ -1294,6 +1314,10 @@ export declare const GatesSchema: z.ZodObject<{
1294
1314
  change_sweep?: {
1295
1315
  enabled?: boolean | undefined;
1296
1316
  } | undefined;
1317
+ redundancy?: {
1318
+ enabled?: boolean | undefined;
1319
+ wire_contracts?: string[] | undefined;
1320
+ } | undefined;
1297
1321
  optional_params?: {
1298
1322
  enabled?: boolean | undefined;
1299
1323
  } | undefined;
@@ -1947,6 +1971,22 @@ export declare const ConfigSchema: z.ZodObject<{
1947
1971
  }, {
1948
1972
  enabled?: boolean | undefined;
1949
1973
  }>>>;
1974
+ /**
1975
+ * What a change made redundant, from the project's own TypeScript (review/typed/redundancy.ts): a null filter beside a
1976
+ * range on the same column, a nullable row type the query filters non-null, an optional member every host supplies, a
1977
+ * property written and never read. Runs at push, in `rigour review` and in a backtest (the program takes seconds to build).
1978
+ * `wire_contracts`: files whose types another service reads, so their members are never write-only here.
1979
+ */
1980
+ redundancy: z.ZodDefault<z.ZodOptional<z.ZodObject<{
1981
+ enabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
1982
+ wire_contracts: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
1983
+ }, "strip", z.ZodTypeAny, {
1984
+ enabled: boolean;
1985
+ wire_contracts: string[];
1986
+ }, {
1987
+ enabled?: boolean | undefined;
1988
+ wire_contracts?: string[] | undefined;
1989
+ }>>>;
1950
1990
  /** A parameter the change adds as optional that only tests omit (review/optional-params.ts). */
1951
1991
  optional_params: z.ZodDefault<z.ZodOptional<z.ZodObject<{
1952
1992
  enabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
@@ -2421,6 +2461,10 @@ export declare const ConfigSchema: z.ZodObject<{
2421
2461
  change_sweep: {
2422
2462
  enabled: boolean;
2423
2463
  };
2464
+ redundancy: {
2465
+ enabled: boolean;
2466
+ wire_contracts: string[];
2467
+ };
2424
2468
  optional_params: {
2425
2469
  enabled: boolean;
2426
2470
  };
@@ -2696,6 +2740,10 @@ export declare const ConfigSchema: z.ZodObject<{
2696
2740
  change_sweep?: {
2697
2741
  enabled?: boolean | undefined;
2698
2742
  } | undefined;
2743
+ redundancy?: {
2744
+ enabled?: boolean | undefined;
2745
+ wire_contracts?: string[] | undefined;
2746
+ } | undefined;
2699
2747
  optional_params?: {
2700
2748
  enabled?: boolean | undefined;
2701
2749
  } | undefined;
@@ -2782,30 +2830,51 @@ export declare const ConfigSchema: z.ZodObject<{
2782
2830
  show_preexisting: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
2783
2831
  /** The GitHub account whose token fetches the pull request's previous review (`gh auth token --user`). */
2784
2832
  github_account: z.ZodOptional<z.ZodString>;
2785
- /** The fresh reviewer (review/reviewer.ts): the person's own coding agent CLI, headless. `enabled` runs it at every push; `rigour review --reviewer` runs it on request. */
2833
+ /** The reviewer (review/reviewer.ts): the person's own coding-agent CLIs, headless and read-only. `enabled` runs it at push; `rigour review --reviewer` runs it on request. */
2786
2834
  reviewer: z.ZodDefault<z.ZodOptional<z.ZodObject<{
2787
2835
  enabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
2788
- command: z.ZodDefault<z.ZodOptional<z.ZodString>>;
2836
+ /**
2837
+ * At push, once the deterministic gates pass: `background` (default) starts the model review of the pushed
2838
+ * commit without holding the push; `wait` holds the push for it; `off` reviews only on request. Either way
2839
+ * a model is asked only when the branch has an open, non-draft pull request (someone will read the push).
2840
+ */
2841
+ on_push: z.ZodDefault<z.ZodOptional<z.ZodEnum<["background", "wait", "off"]>>>;
2842
+ /** The adapters, in order: claude, cursor, codex. */
2843
+ reviewers: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
2844
+ /** single: the first installed reviewer. cross: prefer a vendor not on the commits' trailers. full: two vendors, verdicts merged. */
2845
+ mode: z.ZodDefault<z.ZodOptional<z.ZodEnum<["single", "cross", "full"]>>>;
2846
+ /** The model for the claude reviewer. */
2789
2847
  model: z.ZodOptional<z.ZodString>;
2848
+ /** A model per reviewer name, e.g. { cursor: "auto" }. */
2849
+ models: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>>;
2790
2850
  timeout_ms: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
2791
2851
  }, "strip", z.ZodTypeAny, {
2792
2852
  enabled: boolean;
2853
+ mode: "single" | "cross" | "full";
2793
2854
  timeout_ms: number;
2794
- command: string;
2855
+ on_push: "off" | "background" | "wait";
2856
+ reviewers: string[];
2857
+ models: Record<string, string>;
2795
2858
  model?: string | undefined;
2796
2859
  }, {
2797
2860
  enabled?: boolean | undefined;
2861
+ mode?: "single" | "cross" | "full" | undefined;
2798
2862
  timeout_ms?: number | undefined;
2799
- command?: string | undefined;
2863
+ on_push?: "off" | "background" | "wait" | undefined;
2864
+ reviewers?: string[] | undefined;
2800
2865
  model?: string | undefined;
2866
+ models?: Record<string, string> | undefined;
2801
2867
  }>>>;
2802
2868
  }, "strip", z.ZodTypeAny, {
2803
2869
  include_heuristics: boolean;
2804
2870
  show_preexisting: boolean;
2805
2871
  reviewer: {
2806
2872
  enabled: boolean;
2873
+ mode: "single" | "cross" | "full";
2807
2874
  timeout_ms: number;
2808
- command: string;
2875
+ on_push: "off" | "background" | "wait";
2876
+ reviewers: string[];
2877
+ models: Record<string, string>;
2809
2878
  model?: string | undefined;
2810
2879
  };
2811
2880
  github_account?: string | undefined;
@@ -2815,9 +2884,12 @@ export declare const ConfigSchema: z.ZodObject<{
2815
2884
  github_account?: string | undefined;
2816
2885
  reviewer?: {
2817
2886
  enabled?: boolean | undefined;
2887
+ mode?: "single" | "cross" | "full" | undefined;
2818
2888
  timeout_ms?: number | undefined;
2819
- command?: string | undefined;
2889
+ on_push?: "off" | "background" | "wait" | undefined;
2890
+ reviewers?: string[] | undefined;
2820
2891
  model?: string | undefined;
2892
+ models?: Record<string, string> | undefined;
2821
2893
  } | undefined;
2822
2894
  }>>>;
2823
2895
  planned: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
@@ -3063,6 +3135,10 @@ export declare const ConfigSchema: z.ZodObject<{
3063
3135
  change_sweep: {
3064
3136
  enabled: boolean;
3065
3137
  };
3138
+ redundancy: {
3139
+ enabled: boolean;
3140
+ wire_contracts: string[];
3141
+ };
3066
3142
  optional_params: {
3067
3143
  enabled: boolean;
3068
3144
  };
@@ -3124,8 +3200,11 @@ export declare const ConfigSchema: z.ZodObject<{
3124
3200
  show_preexisting: boolean;
3125
3201
  reviewer: {
3126
3202
  enabled: boolean;
3203
+ mode: "single" | "cross" | "full";
3127
3204
  timeout_ms: number;
3128
- command: string;
3205
+ on_push: "off" | "background" | "wait";
3206
+ reviewers: string[];
3207
+ models: Record<string, string>;
3129
3208
  model?: string | undefined;
3130
3209
  };
3131
3210
  github_account?: string | undefined;
@@ -3376,6 +3455,10 @@ export declare const ConfigSchema: z.ZodObject<{
3376
3455
  change_sweep?: {
3377
3456
  enabled?: boolean | undefined;
3378
3457
  } | undefined;
3458
+ redundancy?: {
3459
+ enabled?: boolean | undefined;
3460
+ wire_contracts?: string[] | undefined;
3461
+ } | undefined;
3379
3462
  optional_params?: {
3380
3463
  enabled?: boolean | undefined;
3381
3464
  } | undefined;
@@ -3438,9 +3521,12 @@ export declare const ConfigSchema: z.ZodObject<{
3438
3521
  github_account?: string | undefined;
3439
3522
  reviewer?: {
3440
3523
  enabled?: boolean | undefined;
3524
+ mode?: "single" | "cross" | "full" | undefined;
3441
3525
  timeout_ms?: number | undefined;
3442
- command?: string | undefined;
3526
+ on_push?: "off" | "background" | "wait" | undefined;
3527
+ reviewers?: string[] | undefined;
3443
3528
  model?: string | undefined;
3529
+ models?: Record<string, string> | undefined;
3444
3530
  } | undefined;
3445
3531
  } | undefined;
3446
3532
  planned?: string[] | undefined;
@@ -290,6 +290,16 @@ export const GatesSchema = z.object({
290
290
  query_patterns: z.object({ enabled: z.boolean().optional().default(true) }).optional().default({}),
291
291
  /** What a fix leaves half done: the narrower condition still used elsewhere, a prop wired into some sibling mounts only, an accumulator copied every step (review/partial-fixes.ts, partial-wiring.ts, loop-copies.ts). */
292
292
  change_sweep: z.object({ enabled: z.boolean().optional().default(true) }).optional().default({}),
293
+ /**
294
+ * What a change made redundant, from the project's own TypeScript (review/typed/redundancy.ts): a null filter beside a
295
+ * range on the same column, a nullable row type the query filters non-null, an optional member every host supplies, a
296
+ * property written and never read. Runs at push, in `rigour review` and in a backtest (the program takes seconds to build).
297
+ * `wire_contracts`: files whose types another service reads, so their members are never write-only here.
298
+ */
299
+ redundancy: z.object({
300
+ enabled: z.boolean().optional().default(true),
301
+ wire_contracts: z.array(z.string()).optional().default([]),
302
+ }).optional().default({}),
293
303
  /** A parameter the change adds as optional that only tests omit (review/optional-params.ts). */
294
304
  optional_params: z.object({ enabled: z.boolean().optional().default(true) }).optional().default({}),
295
305
  /** A changed function whose body duplicates another in the files the change touched (review/duplicate-functions.ts). */
@@ -415,11 +425,23 @@ export const ConfigSchema = z.object({
415
425
  show_preexisting: z.boolean().optional().default(false),
416
426
  /** The GitHub account whose token fetches the pull request's previous review (`gh auth token --user`). */
417
427
  github_account: z.string().optional(),
418
- /** The fresh reviewer (review/reviewer.ts): the person's own coding agent CLI, headless. `enabled` runs it at every push; `rigour review --reviewer` runs it on request. */
428
+ /** The reviewer (review/reviewer.ts): the person's own coding-agent CLIs, headless and read-only. `enabled` runs it at push; `rigour review --reviewer` runs it on request. */
419
429
  reviewer: z.object({
420
430
  enabled: z.boolean().optional().default(false),
421
- command: z.string().optional().default('claude'),
431
+ /**
432
+ * At push, once the deterministic gates pass: `background` (default) starts the model review of the pushed
433
+ * commit without holding the push; `wait` holds the push for it; `off` reviews only on request. Either way
434
+ * a model is asked only when the branch has an open, non-draft pull request (someone will read the push).
435
+ */
436
+ on_push: z.enum(['background', 'wait', 'off']).optional().default('background'),
437
+ /** The adapters, in order: claude, cursor, codex. */
438
+ reviewers: z.array(z.string()).optional().default(['claude']),
439
+ /** single: the first installed reviewer. cross: prefer a vendor not on the commits' trailers. full: two vendors, verdicts merged. */
440
+ mode: z.enum(['single', 'cross', 'full']).optional().default('single'),
441
+ /** The model for the claude reviewer. */
422
442
  model: z.string().optional(),
443
+ /** A model per reviewer name, e.g. { cursor: "auto" }. */
444
+ models: z.record(z.string()).optional().default({}),
423
445
  timeout_ms: z.number().optional().default(15 * 60_000),
424
446
  }).optional().default({}),
425
447
  }).optional().default({}),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rigour-labs/core",
3
- "version": "6.6.5",
3
+ "version": "6.6.6",
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"
@@ -74,11 +74,11 @@
74
74
  "pg": "^8.16.3",
75
75
  "sqlite3": "^5.1.7",
76
76
  "openai": "^4.104.0",
77
- "@rigour-labs/brain-darwin-arm64": "6.6.5",
78
- "@rigour-labs/brain-darwin-x64": "6.6.5",
79
- "@rigour-labs/brain-linux-arm64": "6.6.5",
80
- "@rigour-labs/brain-linux-x64": "6.6.5",
81
- "@rigour-labs/brain-win-x64": "6.6.5"
77
+ "@rigour-labs/brain-darwin-x64": "6.6.6",
78
+ "@rigour-labs/brain-darwin-arm64": "6.6.6",
79
+ "@rigour-labs/brain-win-x64": "6.6.6",
80
+ "@rigour-labs/brain-linux-x64": "6.6.6",
81
+ "@rigour-labs/brain-linux-arm64": "6.6.6"
82
82
  },
83
83
  "devDependencies": {
84
84
  "@types/fs-extra": "^11.0.4",