@rigour-labs/core 6.6.4 → 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 (70) 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/code-patterns.test.js +58 -0
  19. package/dist/review/dead-code.test.js +8 -0
  20. package/dist/review/duplicate-functions.js +7 -2
  21. package/dist/review/lint-overlay.d.ts +21 -0
  22. package/dist/review/lint-overlay.js +89 -0
  23. package/dist/review/loop-copies.d.ts +2 -0
  24. package/dist/review/loop-copies.js +116 -0
  25. package/dist/review/migration-order.js +5 -1
  26. package/dist/review/orphan-files.js +5 -1
  27. package/dist/review/partial-fixes.d.ts +2 -0
  28. package/dist/review/partial-fixes.js +138 -0
  29. package/dist/review/partial-wiring.d.ts +2 -0
  30. package/dist/review/partial-wiring.js +201 -0
  31. package/dist/review/quiet.d.ts +6 -0
  32. package/dist/review/quiet.js +12 -2
  33. package/dist/review/quiet.test.js +11 -0
  34. package/dist/review/review.d.ts +6 -0
  35. package/dist/review/review.js +12 -2
  36. package/dist/review/reviewer/adapters.d.ts +35 -0
  37. package/dist/review/reviewer/adapters.js +156 -0
  38. package/dist/review/reviewer/background.d.ts +34 -0
  39. package/dist/review/reviewer/background.js +128 -0
  40. package/dist/review/reviewer/background.test.d.ts +1 -0
  41. package/dist/review/reviewer/background.test.js +104 -0
  42. package/dist/review/reviewer/exec.d.ts +17 -0
  43. package/dist/review/reviewer/exec.js +23 -0
  44. package/dist/review/reviewer/inputs.d.ts +37 -0
  45. package/dist/review/reviewer/inputs.js +103 -0
  46. package/dist/review/reviewer/merge-impact.d.ts +2 -0
  47. package/dist/review/reviewer/merge-impact.js +64 -0
  48. package/dist/review/reviewer/prompt.d.ts +21 -0
  49. package/dist/review/reviewer/prompt.js +123 -0
  50. package/dist/review/reviewer/store.d.ts +26 -0
  51. package/dist/review/reviewer/store.js +57 -0
  52. package/dist/review/reviewer/verdict.d.ts +127 -0
  53. package/dist/review/reviewer/verdict.js +156 -0
  54. package/dist/review/reviewer.d.ts +41 -49
  55. package/dist/review/reviewer.js +210 -194
  56. package/dist/review/reviewer.test.js +199 -48
  57. package/dist/review/toolchain.d.ts +5 -2
  58. package/dist/review/toolchain.js +81 -6
  59. package/dist/review/toolchain.test.js +39 -1
  60. package/dist/review/typed/program.d.ts +27 -0
  61. package/dist/review/typed/program.js +90 -0
  62. package/dist/review/typed/redundancy.d.ts +10 -0
  63. package/dist/review/typed/redundancy.js +339 -0
  64. package/dist/review/typed/redundancy.test.d.ts +1 -0
  65. package/dist/review/typed/redundancy.test.js +121 -0
  66. package/dist/review/unused-exports.js +8 -4
  67. package/dist/templates/universal-config.js +11 -1
  68. package/dist/types/index.d.ts +128 -8
  69. package/dist/types/index.js +26 -2
  70. package/package.json +6 -6
@@ -537,6 +537,30 @@ export declare const GatesSchema: z.ZodObject<{
537
537
  }, {
538
538
  enabled?: boolean | undefined;
539
539
  }>>>;
540
+ /** 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). */
541
+ change_sweep: z.ZodDefault<z.ZodOptional<z.ZodObject<{
542
+ enabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
543
+ }, "strip", z.ZodTypeAny, {
544
+ enabled: boolean;
545
+ }, {
546
+ enabled?: boolean | undefined;
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
+ }>>>;
540
564
  /** A parameter the change adds as optional that only tests omit (review/optional-params.ts). */
541
565
  optional_params: z.ZodDefault<z.ZodOptional<z.ZodObject<{
542
566
  enabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
@@ -1008,6 +1032,13 @@ export declare const GatesSchema: z.ZodObject<{
1008
1032
  query_patterns: {
1009
1033
  enabled: boolean;
1010
1034
  };
1035
+ change_sweep: {
1036
+ enabled: boolean;
1037
+ };
1038
+ redundancy: {
1039
+ enabled: boolean;
1040
+ wire_contracts: string[];
1041
+ };
1011
1042
  optional_params: {
1012
1043
  enabled: boolean;
1013
1044
  };
@@ -1280,6 +1311,13 @@ export declare const GatesSchema: z.ZodObject<{
1280
1311
  query_patterns?: {
1281
1312
  enabled?: boolean | undefined;
1282
1313
  } | undefined;
1314
+ change_sweep?: {
1315
+ enabled?: boolean | undefined;
1316
+ } | undefined;
1317
+ redundancy?: {
1318
+ enabled?: boolean | undefined;
1319
+ wire_contracts?: string[] | undefined;
1320
+ } | undefined;
1283
1321
  optional_params?: {
1284
1322
  enabled?: boolean | undefined;
1285
1323
  } | undefined;
@@ -1925,6 +1963,30 @@ export declare const ConfigSchema: z.ZodObject<{
1925
1963
  }, {
1926
1964
  enabled?: boolean | undefined;
1927
1965
  }>>>;
1966
+ /** 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). */
1967
+ change_sweep: z.ZodDefault<z.ZodOptional<z.ZodObject<{
1968
+ enabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
1969
+ }, "strip", z.ZodTypeAny, {
1970
+ enabled: boolean;
1971
+ }, {
1972
+ enabled?: boolean | undefined;
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
+ }>>>;
1928
1990
  /** A parameter the change adds as optional that only tests omit (review/optional-params.ts). */
1929
1991
  optional_params: z.ZodDefault<z.ZodOptional<z.ZodObject<{
1930
1992
  enabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
@@ -2396,6 +2458,13 @@ export declare const ConfigSchema: z.ZodObject<{
2396
2458
  query_patterns: {
2397
2459
  enabled: boolean;
2398
2460
  };
2461
+ change_sweep: {
2462
+ enabled: boolean;
2463
+ };
2464
+ redundancy: {
2465
+ enabled: boolean;
2466
+ wire_contracts: string[];
2467
+ };
2399
2468
  optional_params: {
2400
2469
  enabled: boolean;
2401
2470
  };
@@ -2668,6 +2737,13 @@ export declare const ConfigSchema: z.ZodObject<{
2668
2737
  query_patterns?: {
2669
2738
  enabled?: boolean | undefined;
2670
2739
  } | undefined;
2740
+ change_sweep?: {
2741
+ enabled?: boolean | undefined;
2742
+ } | undefined;
2743
+ redundancy?: {
2744
+ enabled?: boolean | undefined;
2745
+ wire_contracts?: string[] | undefined;
2746
+ } | undefined;
2671
2747
  optional_params?: {
2672
2748
  enabled?: boolean | undefined;
2673
2749
  } | undefined;
@@ -2754,30 +2830,51 @@ export declare const ConfigSchema: z.ZodObject<{
2754
2830
  show_preexisting: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
2755
2831
  /** The GitHub account whose token fetches the pull request's previous review (`gh auth token --user`). */
2756
2832
  github_account: z.ZodOptional<z.ZodString>;
2757
- /** 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. */
2758
2834
  reviewer: z.ZodDefault<z.ZodOptional<z.ZodObject<{
2759
2835
  enabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
2760
- 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. */
2761
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>>>;
2762
2850
  timeout_ms: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
2763
2851
  }, "strip", z.ZodTypeAny, {
2764
2852
  enabled: boolean;
2853
+ mode: "single" | "cross" | "full";
2765
2854
  timeout_ms: number;
2766
- command: string;
2855
+ on_push: "off" | "background" | "wait";
2856
+ reviewers: string[];
2857
+ models: Record<string, string>;
2767
2858
  model?: string | undefined;
2768
2859
  }, {
2769
2860
  enabled?: boolean | undefined;
2861
+ mode?: "single" | "cross" | "full" | undefined;
2770
2862
  timeout_ms?: number | undefined;
2771
- command?: string | undefined;
2863
+ on_push?: "off" | "background" | "wait" | undefined;
2864
+ reviewers?: string[] | undefined;
2772
2865
  model?: string | undefined;
2866
+ models?: Record<string, string> | undefined;
2773
2867
  }>>>;
2774
2868
  }, "strip", z.ZodTypeAny, {
2775
2869
  include_heuristics: boolean;
2776
2870
  show_preexisting: boolean;
2777
2871
  reviewer: {
2778
2872
  enabled: boolean;
2873
+ mode: "single" | "cross" | "full";
2779
2874
  timeout_ms: number;
2780
- command: string;
2875
+ on_push: "off" | "background" | "wait";
2876
+ reviewers: string[];
2877
+ models: Record<string, string>;
2781
2878
  model?: string | undefined;
2782
2879
  };
2783
2880
  github_account?: string | undefined;
@@ -2787,9 +2884,12 @@ export declare const ConfigSchema: z.ZodObject<{
2787
2884
  github_account?: string | undefined;
2788
2885
  reviewer?: {
2789
2886
  enabled?: boolean | undefined;
2887
+ mode?: "single" | "cross" | "full" | undefined;
2790
2888
  timeout_ms?: number | undefined;
2791
- command?: string | undefined;
2889
+ on_push?: "off" | "background" | "wait" | undefined;
2890
+ reviewers?: string[] | undefined;
2792
2891
  model?: string | undefined;
2892
+ models?: Record<string, string> | undefined;
2793
2893
  } | undefined;
2794
2894
  }>>>;
2795
2895
  planned: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
@@ -3032,6 +3132,13 @@ export declare const ConfigSchema: z.ZodObject<{
3032
3132
  query_patterns: {
3033
3133
  enabled: boolean;
3034
3134
  };
3135
+ change_sweep: {
3136
+ enabled: boolean;
3137
+ };
3138
+ redundancy: {
3139
+ enabled: boolean;
3140
+ wire_contracts: string[];
3141
+ };
3035
3142
  optional_params: {
3036
3143
  enabled: boolean;
3037
3144
  };
@@ -3093,8 +3200,11 @@ export declare const ConfigSchema: z.ZodObject<{
3093
3200
  show_preexisting: boolean;
3094
3201
  reviewer: {
3095
3202
  enabled: boolean;
3203
+ mode: "single" | "cross" | "full";
3096
3204
  timeout_ms: number;
3097
- command: string;
3205
+ on_push: "off" | "background" | "wait";
3206
+ reviewers: string[];
3207
+ models: Record<string, string>;
3098
3208
  model?: string | undefined;
3099
3209
  };
3100
3210
  github_account?: string | undefined;
@@ -3342,6 +3452,13 @@ export declare const ConfigSchema: z.ZodObject<{
3342
3452
  query_patterns?: {
3343
3453
  enabled?: boolean | undefined;
3344
3454
  } | undefined;
3455
+ change_sweep?: {
3456
+ enabled?: boolean | undefined;
3457
+ } | undefined;
3458
+ redundancy?: {
3459
+ enabled?: boolean | undefined;
3460
+ wire_contracts?: string[] | undefined;
3461
+ } | undefined;
3345
3462
  optional_params?: {
3346
3463
  enabled?: boolean | undefined;
3347
3464
  } | undefined;
@@ -3404,9 +3521,12 @@ export declare const ConfigSchema: z.ZodObject<{
3404
3521
  github_account?: string | undefined;
3405
3522
  reviewer?: {
3406
3523
  enabled?: boolean | undefined;
3524
+ mode?: "single" | "cross" | "full" | undefined;
3407
3525
  timeout_ms?: number | undefined;
3408
- command?: string | undefined;
3526
+ on_push?: "off" | "background" | "wait" | undefined;
3527
+ reviewers?: string[] | undefined;
3409
3528
  model?: string | undefined;
3529
+ models?: Record<string, string> | undefined;
3410
3530
  } | undefined;
3411
3531
  } | undefined;
3412
3532
  planned?: string[] | undefined;
@@ -288,6 +288,18 @@ export const GatesSchema = z.object({
288
288
  }).optional().default({}),
289
289
  /** Query shapes that cost production: offset paging in a loop, a time window with no upper bound (review/query-patterns.ts). */
290
290
  query_patterns: z.object({ enabled: z.boolean().optional().default(true) }).optional().default({}),
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
+ 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({}),
291
303
  /** A parameter the change adds as optional that only tests omit (review/optional-params.ts). */
292
304
  optional_params: z.object({ enabled: z.boolean().optional().default(true) }).optional().default({}),
293
305
  /** A changed function whose body duplicates another in the files the change touched (review/duplicate-functions.ts). */
@@ -413,11 +425,23 @@ export const ConfigSchema = z.object({
413
425
  show_preexisting: z.boolean().optional().default(false),
414
426
  /** The GitHub account whose token fetches the pull request's previous review (`gh auth token --user`). */
415
427
  github_account: z.string().optional(),
416
- /** 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. */
417
429
  reviewer: z.object({
418
430
  enabled: z.boolean().optional().default(false),
419
- 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. */
420
442
  model: z.string().optional(),
443
+ /** A model per reviewer name, e.g. { cursor: "auto" }. */
444
+ models: z.record(z.string()).optional().default({}),
421
445
  timeout_ms: z.number().optional().default(15 * 60_000),
422
446
  }).optional().default({}),
423
447
  }).optional().default({}),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rigour-labs/core",
3
- "version": "6.6.4",
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.4",
78
- "@rigour-labs/brain-darwin-x64": "6.6.4",
79
- "@rigour-labs/brain-linux-x64": "6.6.4",
80
- "@rigour-labs/brain-linux-arm64": "6.6.4",
81
- "@rigour-labs/brain-win-x64": "6.6.4"
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",