@7n/rules 1.49.14 → 1.49.15

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.49.15] - 2026-07-27
4
+
5
+ ### Fixed
6
+
7
+ - refresh canonical mutation results after generated coverage tests
8
+
3
9
  ## [1.49.14] - 2026-07-27
4
10
 
5
11
  ### Changed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@7n/rules",
3
- "version": "1.49.14",
3
+ "version": "1.49.15",
4
4
  "description": "CLI еталонних правил і skills (префікс n-): синк у репозиторій, дельта-lint, конформність",
5
5
  "keywords": [
6
6
  "cli",
@@ -88,6 +88,7 @@ export async function fixWorker(violations, ctx, deps = {}) {
88
88
 
89
89
  /** @type {string[]} */
90
90
  const touchedFiles = []
91
+ const mutationRefreshFiles = []
91
92
  /** @type {Array<{provider: string, hook: string, files: string[], error: string}>} */
92
93
  const failed = []
93
94
  let feedback = null
@@ -105,6 +106,7 @@ export async function fixWorker(violations, ctx, deps = {}) {
105
106
  try {
106
107
  const res = await provider[hook]({ ...args, cwd: ctx.cwd, ctx: hookCtx(ctx, deadlineAt) })
107
108
  touchedFiles.push(...(res?.touchedFiles ?? []))
109
+ mutationRefreshFiles.push(...(res?.mutationRefreshFiles ?? []))
108
110
  if (res?.feedback?.previousError) feedback = res.feedback
109
111
  deferred.push(...(res?.deferred ?? []))
110
112
  for (const failure of res?.failed ?? []) {
@@ -137,5 +139,5 @@ export async function fixWorker(violations, ctx, deps = {}) {
137
139
  }
138
140
  }
139
141
 
140
- return { touchedFiles, failed, deferred, feedback }
142
+ return { touchedFiles, mutationRefreshFiles: [...new Set(mutationRefreshFiles)], failed, deferred, feedback }
141
143
  }
@@ -113,7 +113,7 @@ export async function lint(ctx) {
113
113
  }
114
114
 
115
115
  if (!(await provider.detect(cwd))) continue
116
- let rows = await provider.collect(cwd, {})
116
+ let rows = await provider.collect(cwd, { mutationRefreshFiles: ctx.mutationRefreshFiles ?? [] })
117
117
 
118
118
  // LLM-класифікація survived-мутантів (allowed gaps): verdict-и
119
119
  // equivalent/defensive/glue/wrapper з confidence ≥ порогу виключаються зі
@@ -126,10 +126,18 @@ function isStandaloneConcern(patterns) {
126
126
  * @param {string} cwd Робоча директорія для запуску детектора.
127
127
  * @param {import('./progress.mjs').ProgressReporter|null} [progress] Reporter прогресу.
128
128
  * @param {boolean} [verbose] Детальний вивід (прокидається у ctx concern-а).
129
+ * @param {string[]} [mutationRefreshFiles] Source-файли з cache-independent mutation verdict-ом.
129
130
  * @returns {Promise<LintViolation[]>} Актуальні порушення concern-а після re-detect.
130
131
  */
131
- async function reDetect(item, cwd, progress = null, verbose = false) {
132
- const ctx = { cwd, ruleId: item.entry.ruleId, concernId: item.entry.concern.name, files: item.files, verbose }
132
+ async function reDetect(item, cwd, progress = null, verbose = false, mutationRefreshFiles = []) {
133
+ const ctx = {
134
+ cwd,
135
+ ruleId: item.entry.ruleId,
136
+ concernId: item.entry.concern.name,
137
+ files: item.files,
138
+ verbose,
139
+ mutationRefreshFiles
140
+ }
133
141
  const res = await runConcernDetector(item.entry.concern, ctx)
134
142
  progress?.detectSnapshot(progressKey(item), res.violations.length)
135
143
  return res.violations
@@ -416,7 +424,7 @@ async function runRung(rung, worker, violations, feedback, rungDeps) {
416
424
  // ніколи не виконується.
417
425
  let after
418
426
  try {
419
- after = await reDetect(item, cwd, progress, verbose)
427
+ after = await reDetect(item, cwd, progress, verbose, workerResult?.mutationRefreshFiles ?? [])
420
428
  } catch (detectError) {
421
429
  snapshot.rollback()
422
430
  throw detectError