@rigour-labs/core 6.4.4 → 6.5.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.
Files changed (117) hide show
  1. package/dist/deep/agent-review.d.ts +19 -0
  2. package/dist/deep/agent-review.js +19 -0
  3. package/dist/deep/agent-review.test.d.ts +1 -0
  4. package/dist/deep/agent-review.test.js +53 -0
  5. package/dist/deep/code-pass.d.ts +10 -0
  6. package/dist/deep/code-pass.js +64 -33
  7. package/dist/deep/code-pass.test.js +53 -12
  8. package/dist/deep/code-verifier.d.ts +3 -1
  9. package/dist/deep/code-verifier.js +11 -11
  10. package/dist/deep/code-verifier.test.js +8 -0
  11. package/dist/deep/pr-diff.d.ts +7 -0
  12. package/dist/deep/pr-diff.js +47 -0
  13. package/dist/deep/pr-review.d.ts +33 -0
  14. package/dist/deep/pr-review.js +81 -0
  15. package/dist/deep/pr-review.test.d.ts +1 -0
  16. package/dist/deep/pr-review.test.js +80 -0
  17. package/dist/deep/related-changes.d.ts +13 -0
  18. package/dist/deep/related-changes.js +56 -0
  19. package/dist/deep/related-changes.test.d.ts +1 -0
  20. package/dist/deep/related-changes.test.js +33 -0
  21. package/dist/deep/review-tools.d.ts +16 -0
  22. package/dist/deep/review-tools.js +111 -0
  23. package/dist/deep/review-tools.test.d.ts +1 -0
  24. package/dist/deep/review-tools.test.js +39 -0
  25. package/dist/deep/risk.d.ts +41 -0
  26. package/dist/deep/risk.js +135 -0
  27. package/dist/deep/risk.test.d.ts +1 -0
  28. package/dist/deep/risk.test.js +63 -0
  29. package/dist/deep/router.d.ts +27 -0
  30. package/dist/deep/router.js +15 -0
  31. package/dist/deep/self-check.d.ts +14 -9
  32. package/dist/deep/self-check.js +41 -32
  33. package/dist/deep/tool-loop.d.ts +19 -0
  34. package/dist/deep/tool-loop.js +23 -0
  35. package/dist/gates/deep-analysis.d.ts +27 -0
  36. package/dist/gates/deep-analysis.js +73 -2
  37. package/dist/gates/deep-runner.js +14 -0
  38. package/dist/gates/frontend-secret-exposure.d.ts +2 -0
  39. package/dist/gates/frontend-secret-exposure.js +8 -0
  40. package/dist/gates/frontend-secret-exposure.test.js +14 -0
  41. package/dist/gates/hallucinated-imports/framework-modules-nuxt.test.d.ts +1 -0
  42. package/dist/gates/hallucinated-imports/framework-modules-nuxt.test.js +27 -0
  43. package/dist/gates/hallucinated-imports/framework-modules.d.ts +12 -3
  44. package/dist/gates/hallucinated-imports/framework-modules.js +32 -6
  45. package/dist/gates/hallucinated-imports/index.js +2 -1
  46. package/dist/gates/hallucinated-imports/js-resolver-types.test.d.ts +1 -0
  47. package/dist/gates/hallucinated-imports/js-resolver-types.test.js +14 -0
  48. package/dist/gates/hallucinated-imports/js-resolver.d.ts +6 -1
  49. package/dist/gates/hallucinated-imports/js-resolver.js +25 -3
  50. package/dist/gates/phantom-apis.js +2 -2
  51. package/dist/gates/phantom-apis.test.js +10 -0
  52. package/dist/gates/promise-safety.js +1 -1
  53. package/dist/gates/test-quality-matchers.js +3 -0
  54. package/dist/gates/test-quality.test.js +13 -0
  55. package/dist/hooks/checker.test.js +9 -0
  56. package/dist/hooks/stop-review.d.ts +2 -0
  57. package/dist/hooks/stop-review.js +19 -3
  58. package/dist/hooks/templates.d.ts +2 -0
  59. package/dist/hooks/templates.js +16 -2
  60. package/dist/hooks/templates.test.d.ts +1 -0
  61. package/dist/hooks/templates.test.js +16 -0
  62. package/dist/index.d.ts +12 -0
  63. package/dist/index.js +12 -0
  64. package/dist/inference/cloud-provider.d.ts +12 -1
  65. package/dist/inference/cloud-provider.js +137 -2
  66. package/dist/inference/cloud-provider.test.d.ts +1 -0
  67. package/dist/inference/cloud-provider.test.js +118 -0
  68. package/dist/inference/pricing.d.ts +15 -0
  69. package/dist/inference/pricing.js +13 -0
  70. package/dist/inference/types.d.ts +42 -0
  71. package/dist/review/changed-function-spans.d.ts +4 -0
  72. package/dist/review/changed-function-spans.js +48 -0
  73. package/dist/review/changed-lines.d.ts +9 -3
  74. package/dist/review/changed-lines.js +19 -2
  75. package/dist/review/deep-runs.d.ts +22 -0
  76. package/dist/review/deep-runs.js +59 -0
  77. package/dist/review/deep-runs.test.d.ts +1 -0
  78. package/dist/review/deep-runs.test.js +23 -0
  79. package/dist/review/generated-files.d.ts +3 -0
  80. package/dist/review/generated-files.js +35 -0
  81. package/dist/review/generated-files.test.d.ts +1 -0
  82. package/dist/review/generated-files.test.js +25 -0
  83. package/dist/review/ledger.d.ts +27 -0
  84. package/dist/review/ledger.js +72 -0
  85. package/dist/review/quiet.d.ts +14 -0
  86. package/dist/review/quiet.js +69 -0
  87. package/dist/review/quiet.test.d.ts +1 -0
  88. package/dist/review/quiet.test.js +27 -0
  89. package/dist/review/review-ack.d.ts +16 -0
  90. package/dist/review/review-ack.js +25 -0
  91. package/dist/review/review-task.d.ts +40 -0
  92. package/dist/review/review-task.js +50 -0
  93. package/dist/review/review-task.test.d.ts +1 -0
  94. package/dist/review/review-task.test.js +80 -0
  95. package/dist/review/review.d.ts +11 -1
  96. package/dist/review/review.js +15 -6
  97. package/dist/review/review.test.js +25 -0
  98. package/dist/review-learning/acted-on.d.ts +25 -0
  99. package/dist/review-learning/acted-on.js +69 -0
  100. package/dist/review-learning/learn-from-reviews.d.ts +34 -0
  101. package/dist/review-learning/learn-from-reviews.js +65 -0
  102. package/dist/review-learning/lessons.d.ts +52 -0
  103. package/dist/review-learning/lessons.js +149 -0
  104. package/dist/review-learning/repo-rules.d.ts +16 -0
  105. package/dist/review-learning/repo-rules.js +84 -0
  106. package/dist/review-learning/repo-rules.test.d.ts +1 -0
  107. package/dist/review-learning/repo-rules.test.js +39 -0
  108. package/dist/review-learning/review-learning.test.d.ts +1 -0
  109. package/dist/review-learning/review-learning.test.js +104 -0
  110. package/dist/review-learning/team-lessons.d.ts +4 -0
  111. package/dist/review-learning/team-lessons.js +24 -0
  112. package/dist/semantic/rules/credential-redirect.js +4 -1
  113. package/dist/settings.js +4 -1
  114. package/dist/templates/universal-config.js +7 -3
  115. package/dist/types/index.d.ts +276 -10
  116. package/dist/types/index.js +38 -5
  117. package/package.json +6 -6
@@ -172,7 +172,7 @@ export const GatesSchema = z.object({
172
172
  promise_safety: z.object({
173
173
  enabled: z.boolean().optional().default(true),
174
174
  check_unhandled_then: z.boolean().optional().default(true),
175
- check_unsafe_parse: z.boolean().optional().default(true),
175
+ check_unsafe_parse: z.boolean().optional().default(false), // opt-in: a regex cannot tell trusted JSON (own files, own serializer) from untrusted input
176
176
  check_async_without_await: z.boolean().optional().default(true),
177
177
  check_unsafe_fetch: z.boolean().optional().default(true),
178
178
  ignore_patterns: z.array(z.string()).optional().default([]),
@@ -211,10 +211,13 @@ export const GatesSchema = z.object({
211
211
  // v4.2+ Memory & Skills Governance
212
212
  governance: z.object({
213
213
  enabled: z.boolean().optional().default(true),
214
- /** Enforce rigour_remember for all persistent storage — block native agent memory writes */
215
- enforce_memory: z.boolean().optional().default(true),
216
- /** Enforce rigour skills over native agent skills/rules files */
217
- enforce_skills: z.boolean().optional().default(true),
214
+ /**
215
+ * Block agent writes to native memory files (CLAUDE.md, …) and point to rigour_remember.
216
+ * Off by default: teams edit their agent instructions deliberately; their content is still scanned for secrets.
217
+ */
218
+ enforce_memory: z.boolean().optional().default(false),
219
+ /** Block agent writes to native skills/rules files (.cursor/rules, …). Off by default, like enforce_memory. */
220
+ enforce_skills: z.boolean().optional().default(false),
218
221
  /** Block writes and tell agent to use rigour_remember / rigour_recall */
219
222
  block_native_memory: z.boolean().optional().default(true),
220
223
  /** Agent-native MEMORY paths — where agents auto-save context (glob patterns) */
@@ -312,6 +315,15 @@ export const GatesSchema = z.object({
312
315
  max_tokens: z.number().optional(), // default per provider: local 1024, cloud 4096
313
316
  temperature: z.number().optional().default(0.1),
314
317
  timeout_ms: z.number().optional(), // per inference call; default per provider: local 60s, cloud 120s
318
+ budget_ms: z.number().optional(), // whole deep run; files not started in time are reported as skipped
319
+ agentic: z.boolean().optional(), // cloud tier: the model may read the repository while it reviews (default true)
320
+ repo_rules: z.boolean().optional(), // show the reviewer the rules in AGENTS.md / CLAUDE.md / Cursor rules that name what the change touches (default false)
321
+ review_lessons: z.enum(['verified', 'all', 'off']).optional(), // the team's past review lessons shown to the reviewer: off (default), verified, or all
322
+ router: z.object({
323
+ enabled: z.boolean().optional(), // default true
324
+ min_score: z.number().optional(), // functions below this get the deterministic gates only
325
+ max_functions: z.number().optional(), // at most this many functions go to the model
326
+ }).optional(),
315
327
  // Intent questions at engine-proven sites (optional-read-no-fallback) in scoped reviews.
316
328
  // Off: the stock local models failed the zero-false-finding bar (docs/DEEP_ANALYSIS.md).
317
329
  intent_checks: z.boolean().optional().default(false),
@@ -347,6 +359,8 @@ export const HooksSchema = z.object({
347
359
  ]),
348
360
  timeout_ms: z.number().optional().default(5000),
349
361
  block_on_failure: z.boolean().optional().default(false),
362
+ /** Stop hook: hold "done" until the agent acknowledges each risky changed function (rigour_review_ack). */
363
+ require_review_ack: z.boolean().optional().default(false),
350
364
  /** Enable DLP (Data Loss Prevention) pre-input hooks — default ON for security */
351
365
  dlp: z.boolean().optional().default(true),
352
366
  }).optional().default({});
@@ -360,6 +374,11 @@ export const ConfigSchema = z.object({
360
374
  output: z.object({
361
375
  report_path: z.string().default('rigour-report.json'),
362
376
  }).optional().default({}),
377
+ /** rigour review / rigour_review / the PR bot / the stop hook. */
378
+ review: z.object({
379
+ /** Let heuristic gates decide the verdict too; by default only findings that prove a defect do (quiet.ts). */
380
+ include_heuristics: z.boolean().optional().default(false),
381
+ }).optional().default({}),
363
382
  planned: z.array(z.string()).optional().default([]),
364
383
  ignore: z.array(z.string()).optional().default([]),
365
384
  });
@@ -384,6 +403,8 @@ export const FailureSchema = z.object({
384
403
  files: z.array(z.string()).optional(),
385
404
  line: z.number().optional(),
386
405
  endLine: z.number().optional(),
406
+ /** The changed line a finding about its enclosing changed function is posted on. */
407
+ anchorLine: z.number().optional(),
387
408
  hint: z.string().optional(),
388
409
  // Deep analysis fields
389
410
  confidence: z.number().min(0).max(1).optional(), // LLM confidence score
@@ -424,6 +445,18 @@ export const ReportSchema = z.object({
424
445
  error: z.string().optional(),
425
446
  findings_proposed: z.number().optional(), // code mode, before the self-check
426
447
  findings_withdrawn: z.number().optional(), // by the self-check
448
+ /** Findings the grounding check dropped, by reason. */
449
+ findings_rejected: z.record(z.number()).optional(),
450
+ /** Files a run budget (`gates.deep.budget_ms`) left unreviewed. */
451
+ files_skipped: z.number().optional(),
452
+ /** Repository lookups the model made in an agentic review. */
453
+ tool_calls: z.number().optional(),
454
+ /** Cloud router: changed functions ranked, how many went to the model, files it left to the gates. */
455
+ router: z.object({ functions: z.number(), routed: z.number(), files_skipped: z.number(), already_reviewed: z.number() }).optional(),
456
+ input_tokens: z.number().optional(),
457
+ output_tokens: z.number().optional(),
458
+ /** Provider-reported cost when available, else tokens × list price; undefined for an unpriced model. */
459
+ cost_usd: z.number().optional(),
427
460
  findings_count: z.number().optional(),
428
461
  findings_verified: z.number().optional(),
429
462
  }).optional(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rigour-labs/core",
3
- "version": "6.4.4",
3
+ "version": "6.5.0",
4
4
  "description": "AI-native quality gate engine with local Bayesian learning. AST analysis, drift detection, Fix Packet generation, and agent self-healing across TypeScript, JavaScript, Python, Go, Ruby, and C#.",
5
5
  "engines": {
6
6
  "node": ">=22"
@@ -70,11 +70,11 @@
70
70
  "pg": "^8.16.3",
71
71
  "sqlite3": "^5.1.7",
72
72
  "openai": "^4.104.0",
73
- "@rigour-labs/brain-darwin-arm64": "6.4.4",
74
- "@rigour-labs/brain-linux-arm64": "6.4.4",
75
- "@rigour-labs/brain-win-x64": "6.4.4",
76
- "@rigour-labs/brain-linux-x64": "6.4.4",
77
- "@rigour-labs/brain-darwin-x64": "6.4.4"
73
+ "@rigour-labs/brain-darwin-arm64": "6.5.0",
74
+ "@rigour-labs/brain-linux-arm64": "6.5.0",
75
+ "@rigour-labs/brain-darwin-x64": "6.5.0",
76
+ "@rigour-labs/brain-linux-x64": "6.5.0",
77
+ "@rigour-labs/brain-win-x64": "6.5.0"
78
78
  },
79
79
  "devDependencies": {
80
80
  "@types/fs-extra": "^11.0.4",