@codyswann/lisa 4.23.3 → 4.23.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.
- package/all/copy-overwrite/scripts/lib/process-tree-runner.mjs +1 -1
- package/all/copy-overwrite/scripts/lisa-hooks/block-no-verify.sh +75 -2
- package/all/copy-overwrite/scripts/lisa-reconcile-policy.mjs +22 -8
- package/dist/cli/doctor-nightly-e2e-guard-graph.d.ts.map +1 -1
- package/dist/cli/doctor-nightly-e2e-guard-graph.js +35 -6
- package/dist/cli/doctor-nightly-e2e-guard-graph.js.map +1 -1
- package/dist/codex/scripts/block-no-verify.sh +63 -0
- package/dist/core/lisa-owned-hash-ledger.d.ts.map +1 -1
- package/dist/core/lisa-owned-hash-ledger.js +18 -0
- package/dist/core/lisa-owned-hash-ledger.js.map +1 -1
- package/dist/core/nightly-e2e-guard-behavior-certificate.js +2 -2
- package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
- package/dist/core/upstream-evidence-manifest.js +11 -10
- package/dist/core/upstream-evidence-manifest.js.map +1 -1
- package/dist/opencode/plugin-templates/block-no-verify.sh +75 -2
- package/dist/opencode/plugin-templates/lisa-block-direct-issue-create.ts +17 -7
- package/package.json +3 -3
- package/plugins/lisa/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa/.codex-plugin/skills/lisa-github-sync/SKILL.md +4 -3
- package/plugins/lisa/.codex-plugin/skills/lisa-jira-journey/scripts/parse-plan.py +3 -1
- package/plugins/lisa/.codex-plugin/skills/lisa-setup-remote-env/scripts/setup-remote-env.mjs +34 -6
- package/plugins/lisa/hooks/block-no-verify.agy.sh +63 -0
- package/plugins/lisa/hooks/block-no-verify.sh +75 -2
- package/plugins/lisa/skills/lisa-github-sync/SKILL.md +4 -3
- package/plugins/lisa/skills/lisa-jira-journey/scripts/parse-plan.py +3 -1
- package/plugins/lisa/skills/lisa-setup-remote-env/scripts/setup-remote-env.mjs +34 -6
- package/plugins/lisa-agy/hooks/block-no-verify.agy.sh +63 -0
- package/plugins/lisa-agy/plugin.json +1 -1
- package/plugins/lisa-agy/skills/lisa-github-sync/SKILL.md +4 -3
- package/plugins/lisa-agy/skills/lisa-jira-journey/scripts/parse-plan.py +3 -1
- package/plugins/lisa-agy/skills/lisa-setup-remote-env/scripts/setup-remote-env.mjs +34 -6
- package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-agy/plugin.json +1 -1
- package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-copilot/hooks/block-no-verify.sh +75 -2
- package/plugins/lisa-copilot/skills/lisa-github-sync/SKILL.md +4 -3
- package/plugins/lisa-copilot/skills/lisa-jira-journey/scripts/parse-plan.py +3 -1
- package/plugins/lisa-copilot/skills/lisa-setup-remote-env/scripts/setup-remote-env.mjs +34 -6
- package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cursor/hooks/block-no-verify.sh +75 -2
- package/plugins/lisa-cursor/skills/lisa-github-sync/SKILL.md +4 -3
- package/plugins/lisa-cursor/skills/lisa-jira-journey/scripts/parse-plan.py +3 -1
- package/plugins/lisa-cursor/skills/lisa-setup-remote-env/scripts/setup-remote-env.mjs +34 -6
- package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-agy/plugin.json +1 -1
- package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-agy/plugin.json +1 -1
- package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-agy/plugin.json +1 -1
- package/plugins/lisa-openclaw-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-agy/plugin.json +1 -1
- package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-agy/plugin.json +1 -1
- package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-agy/plugin.json +1 -1
- package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-agy/plugin.json +1 -1
- package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/src/base/hooks/block-no-verify.agy.sh +63 -0
- package/plugins/src/base/hooks/block-no-verify.sh +75 -2
- package/plugins/src/base/skills/lisa-github-sync/SKILL.md +4 -3
- package/plugins/src/base/skills/lisa-jira-journey/scripts/parse-plan.py +3 -1
- package/plugins/src/base/skills/lisa-setup-remote-env/scripts/setup-remote-env.mjs +34 -6
- package/typescript/copy-overwrite/scripts/check-skipped-required-checks.mjs +2 -2
- package/typescript/copy-overwrite/scripts/lisa-mutation.mjs +91 -13
|
@@ -110,7 +110,8 @@ If the `subIssues` field is unavailable (older GHES), fall back to body parentag
|
|
|
110
110
|
| else any child has **started** (`status:in-progress`, or shipped to an env while a sibling has not) | `claimed` | `status:in-progress` |
|
|
111
111
|
| else (children exist, none started) | — | unchanged — parent keeps its non-ready container label |
|
|
112
112
|
|
|
113
|
-
- **Blocked dominates — and the rollup must say which child and which kind** — a single blocked child surfaces `status:blocked` on the parent even while siblings progress, so a human sees the parent needs attention. `status:blocked` alone is a single bit and cannot tell a child waiting on an external event from one whose acceptance criteria are unbuildable; the second never clears on its own.
|
|
113
|
+
- **Blocked dominates — and the rollup must say which child and which kind** — a single blocked child surfaces `status:blocked` on the parent even while siblings progress, so a human sees the parent needs attention. `status:blocked` alone is a single bit and cannot tell a child waiting on an external event from one whose acceptance criteria are unbuildable; the second never clears on its own.
|
|
114
|
+
- **Run the shared classifier for every derived rollup state before writing the label or comment**, not only for `status:blocked`. Include the exact rendered state and child tally in the classifier input alongside the resolved child graph, so its fingerprint and `change.summary` deduplicate the complete rollup note for `status:in-progress`, every env-keyed `done`, and `status:blocked` alike:
|
|
114
115
|
|
|
115
116
|
```bash
|
|
116
117
|
CLASSIFIER_ROOT="${CLAUDE_PLUGIN_ROOT:-${PLUGIN_ROOT:-plugins/lisa}}"
|
|
@@ -121,7 +122,7 @@ The current-directory `plugins/lisa` fallback is for a Lisa checkout where no
|
|
|
121
122
|
plugin-root variable is injected; it must be tried before declaring the shared
|
|
122
123
|
classifier absent.
|
|
123
124
|
|
|
124
|
-
|
|
125
|
+
When the derived state is blocked, its report names, per class, the blocking leaf, the path to it (`#1495 -> #1515 -> #1547`) and **who must act** — that text goes in the rollup comment verbatim. It exits non-zero when it classified nothing (unreadable graph, no children, no readable child): that is a strict **no-write** result. Do not change a label and do not post/update a rollup comment; report the classifier failure to the caller. Never fall through to "no blocked children", infer a class from prose, or apply the `spec_defect` marker from a flow — see `leaf-only-lifecycle` → **Classifying a hold**.
|
|
125
126
|
- **Least-advanced env wins** — the parent reaches an env only when every required child has reached at least that env; it never sits ahead of its laggard child. Native closure (`gh issue close --reason completed`) fires only when the resolved env is the production `status:done`, never at `status:on-dev`/`status:on-stg`.
|
|
126
127
|
- **"Required" children only** — a child labelled won't-do / optional does not hold the parent open; only leaves that must ship count toward the env-rollup check.
|
|
127
128
|
- **Recursive** — a parent reaches an env only when its children have all reached at least that env; an Epic reaches it only when its Stories have themselves rolled up to it. Evaluate bottom-up.
|
|
@@ -129,7 +130,7 @@ classifier absent.
|
|
|
129
130
|
|
|
130
131
|
**Single-environment collapse (this repo).** `.lisa.config.json` `deploy.branches` declares only `production: main`, so the env-keyed `done` resolves to the single label `status:done` — there is no `status:on-dev` / `status:on-stg` and **no dev → staging → prod promotion chain**. Resolve the env rungs via the env-keyed `done` logic in `config-resolution`, but in the single-environment case the only rung is production and it collapses to the one `status:done` value; the rollup never attempts to resolve a dev or staging `done`. Projects that DO have multiple environments keep the env-keyed map and roll the parent up to whichever `done` (including intermediate `status:on-dev`/`status:on-stg`) its leaves have collectively reached.
|
|
131
132
|
|
|
132
|
-
**Apply the derived label** (only when it differs from the parent's current `status:*`): remove the parent's existing `status:*` label and add the derived one, keeping exactly one `status:*` label so the build-queue invariant holds. Re-read the labels immediately after the edit and require exactly one `status:*`; if the count differs, surface an error and stop without trying to normalize the ambiguous set automatically. Post an idempotent `[claude-sync] rollup` comment naming the derived state and the child tally (e.g. `3/4 leaves terminal, 1 blocked → status:blocked`); when the derived state is `status:blocked` the comment also carries the classifier's per-class section, so the blocking child and its actor are one read rather than a descent.
|
|
133
|
+
**Apply the derived label** (only when it differs from the parent's current `status:*`): remove the parent's existing `status:*` label and add the derived one, keeping exactly one `status:*` label so the build-queue invariant holds. Re-read the labels immediately after the edit and require exactly one `status:*`; if the count differs, surface an error and stop without trying to normalize the ambiguous set automatically. Post an idempotent `[claude-sync] rollup` comment naming the derived state and the child tally (e.g. `3/4 leaves terminal, 1 blocked → status:blocked`); when the derived state is `status:blocked` the comment also carries the classifier's per-class section, so the blocking child and its actor are one read rather than a descent. Persist the classifier's `change.fingerprint` with the rollup comment and use `change.changed` as the dedupe decision for every rollup. Use `change.summary` only as display text; it describes the transition and is not a stable key.
|
|
133
134
|
|
|
134
135
|
```bash
|
|
135
136
|
gh issue edit <parent-number> --repo <org>/<repo> \
|
|
@@ -89,9 +89,11 @@ def server_origin(server):
|
|
|
89
89
|
return ""
|
|
90
90
|
if parsed.scheme.lower() != "https" or not parsed.hostname:
|
|
91
91
|
return ""
|
|
92
|
+
if port == 0:
|
|
93
|
+
return ""
|
|
92
94
|
hostname = parsed.hostname.lower()
|
|
93
95
|
authority = f"[{hostname}]" if ":" in hostname else hostname
|
|
94
|
-
if port and port != 443:
|
|
96
|
+
if port is not None and port != 443:
|
|
95
97
|
authority = f"{authority}:{port}"
|
|
96
98
|
return f"https://{authority}"
|
|
97
99
|
|
|
@@ -812,6 +812,7 @@ export function installUserSessionHook(repoRoot, options = {}) {
|
|
|
812
812
|
// Single quotes suppress parameter expansion and command substitution. An
|
|
813
813
|
// embedded quote closes, escapes, and reopens the quoted shell word.
|
|
814
814
|
const command = `bash '${script.replaceAll("'", `'\\''`)}'`;
|
|
815
|
+
const legacyCommand = `bash ${JSON.stringify(script)}`;
|
|
815
816
|
|
|
816
817
|
let settings = {};
|
|
817
818
|
if (exists(settingsPath)) {
|
|
@@ -833,11 +834,38 @@ export function installUserSessionHook(repoRoot, options = {}) {
|
|
|
833
834
|
const sessionStart = Array.isArray(hooks.SessionStart)
|
|
834
835
|
? hooks.SessionStart
|
|
835
836
|
: [];
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
837
|
+
let installed = false;
|
|
838
|
+
let migrated = false;
|
|
839
|
+
const normalizedSessionStart = sessionStart.flatMap(entry => {
|
|
840
|
+
if (!Array.isArray(entry?.hooks)) return [entry];
|
|
841
|
+
const normalizedHooks = entry.hooks.flatMap(hook => {
|
|
842
|
+
if (hook?.command !== command && hook?.command !== legacyCommand) {
|
|
843
|
+
return [hook];
|
|
844
|
+
}
|
|
845
|
+
if (installed) {
|
|
846
|
+
migrated = true;
|
|
847
|
+
return [];
|
|
848
|
+
}
|
|
849
|
+
installed = true;
|
|
850
|
+
if (hook.command === command) return [hook];
|
|
851
|
+
migrated = true;
|
|
852
|
+
return [{ ...hook, command }];
|
|
853
|
+
});
|
|
854
|
+
return normalizedHooks.length > 0
|
|
855
|
+
? [{ ...entry, hooks: normalizedHooks }]
|
|
856
|
+
: [];
|
|
857
|
+
});
|
|
858
|
+
|
|
859
|
+
if (installed) {
|
|
860
|
+
if (!migrated) return { action: "present", path: settingsPath };
|
|
861
|
+
if (dryRun) return { action: "would-migrate", path: settingsPath };
|
|
862
|
+
const updated = {
|
|
863
|
+
...settings,
|
|
864
|
+
hooks: { ...hooks, SessionStart: normalizedSessionStart },
|
|
865
|
+
};
|
|
866
|
+
mkdir(dir, { recursive: true });
|
|
867
|
+
write(settingsPath, `${JSON.stringify(updated, null, 2)}\n`);
|
|
868
|
+
return { action: "migrated", path: settingsPath };
|
|
841
869
|
}
|
|
842
870
|
|
|
843
871
|
const updated = {
|
|
@@ -845,7 +873,7 @@ export function installUserSessionHook(repoRoot, options = {}) {
|
|
|
845
873
|
hooks: {
|
|
846
874
|
...hooks,
|
|
847
875
|
SessionStart: [
|
|
848
|
-
...
|
|
876
|
+
...normalizedSessionStart,
|
|
849
877
|
{
|
|
850
878
|
matcher: "startup|resume",
|
|
851
879
|
hooks: [{ type: "command", command }],
|
|
@@ -1542,7 +1542,7 @@ export function fetchChecksForCommit(sha, repo) {
|
|
|
1542
1542
|
);
|
|
1543
1543
|
const runs = ghApiPaginatedArray(
|
|
1544
1544
|
`repos/${slug}/commits/${sha}/check-runs?per_page=100`,
|
|
1545
|
-
'[.check_runs[] | {id: .id, name: .name, conclusion: .conclusion, description: (.output.title // ""), completed_at: .completed_at, started_at: .started_at}]'
|
|
1545
|
+
'[.check_runs[] | {id: .id, name: .name, conclusion: .conclusion, description: (.output.title // ""), completed_at: .completed_at, created_at: .created_at, started_at: .started_at}]'
|
|
1546
1546
|
);
|
|
1547
1547
|
return mergeCheckRows(
|
|
1548
1548
|
statuses.map(row =>
|
|
@@ -1562,7 +1562,7 @@ export function fetchChecksForCommit(sha, repo) {
|
|
|
1562
1562
|
export function newestCheckRuns(runs) {
|
|
1563
1563
|
const newest = new Map();
|
|
1564
1564
|
const rank = row => {
|
|
1565
|
-
const timestamp = Date.parse(row.
|
|
1565
|
+
const timestamp = Date.parse(row.created_at ?? "");
|
|
1566
1566
|
return [Number.isFinite(timestamp) ? timestamp : 0, Number(row.id) || 0];
|
|
1567
1567
|
};
|
|
1568
1568
|
for (const row of runs) {
|
|
@@ -10,10 +10,11 @@
|
|
|
10
10
|
*
|
|
11
11
|
* 1. Reads `mutation.gate.json`. Disabled (the default) prints a notice and
|
|
12
12
|
* exits 0, so pushes and CI are never slowed down until a project opts in.
|
|
13
|
-
* 2. When enabled, it computes the
|
|
14
|
-
* merge-base with the configured `since` ref), keeps the
|
|
13
|
+
* 2. When enabled, it computes the lines changed on this branch (vs the
|
|
14
|
+
* merge-base with the configured `since` ref), keeps the files the project's
|
|
15
15
|
* **own Stryker `mutate` configuration** selects, and runs Stryker on only
|
|
16
|
-
* those. Mutation testing is slow; a full-
|
|
16
|
+
* those changed line ranges. Mutation testing is slow; a full-file or
|
|
17
|
+
* full-repo run is never done here.
|
|
17
18
|
* 3. The score threshold lives in `stryker.conf.*` (`thresholds.break`).
|
|
18
19
|
* Stryker exits non-zero below it, which fails the gate.
|
|
19
20
|
*
|
|
@@ -174,6 +175,7 @@ export const OUTCOMES = Object.freeze({
|
|
|
174
175
|
disabled: "mutation-gate: disabled",
|
|
175
176
|
noBase: "mutation-gate: no-diff-base",
|
|
176
177
|
nothingToMutate: "mutation-gate: nothing-to-mutate",
|
|
178
|
+
noCurrentLines: "mutation-gate: no-current-lines-to-mutate",
|
|
177
179
|
uninstrumentableLanguage: "mutation-gate: uninstrumentable-language",
|
|
178
180
|
inertConfig: "mutation-gate: inert-mutate-config",
|
|
179
181
|
uninstrumentableTarget: "mutation-gate: uninstrumentable-mutate-target",
|
|
@@ -1312,12 +1314,64 @@ export const selectUninstrumentableMutateTargets = (cwd, patterns) => {
|
|
|
1312
1314
|
};
|
|
1313
1315
|
|
|
1314
1316
|
/**
|
|
1315
|
-
*
|
|
1317
|
+
* New-side line ranges from a zero-context unified diff.
|
|
1318
|
+
*
|
|
1319
|
+
* Stryker accepts `path:start-end` entries in `--mutate`. Git already reports
|
|
1320
|
+
* the exact new-side extent in every hunk header, including additions and
|
|
1321
|
+
* replacements. Deletion-only hunks have a zero count and deliberately produce
|
|
1322
|
+
* no range: there is no current line on which Stryker could place a mutant.
|
|
1323
|
+
* Adjacent ranges are merged so one logical edit never becomes redundant
|
|
1324
|
+
* overlapping Stryker work merely because Git rendered more than one hunk.
|
|
1325
|
+
*
|
|
1326
|
+
* @param {string} patch - `git diff --unified=0` output for one file.
|
|
1327
|
+
* @returns {{start: number, end: number}[]} Sorted, non-overlapping ranges.
|
|
1328
|
+
*/
|
|
1329
|
+
export const parseChangedLineRanges = patch => {
|
|
1330
|
+
const ranges = [];
|
|
1331
|
+
const headers = /^@@ -\d+(?:,\d+)? \+(\d+)(?:,(\d+))? @@/gmu;
|
|
1332
|
+
for (const match of patch.matchAll(headers)) {
|
|
1333
|
+
const start = Number(match[1]);
|
|
1334
|
+
const count = match[2] === undefined ? 1 : Number(match[2]);
|
|
1335
|
+
if (count === 0) continue;
|
|
1336
|
+
const end = start + count - 1;
|
|
1337
|
+
const previous = ranges.at(-1);
|
|
1338
|
+
if (previous && start <= previous.end + 1) {
|
|
1339
|
+
previous.end = Math.max(previous.end, end);
|
|
1340
|
+
} else {
|
|
1341
|
+
ranges.push({ start, end });
|
|
1342
|
+
}
|
|
1343
|
+
}
|
|
1344
|
+
return ranges;
|
|
1345
|
+
};
|
|
1346
|
+
|
|
1347
|
+
/**
|
|
1348
|
+
* Stryker mutation ranges for one changed file.
|
|
1349
|
+
* @param {string} cwd - Project root.
|
|
1350
|
+
* @param {string} base - Merge-base sha.
|
|
1351
|
+
* @param {string} file - Repository-relative path.
|
|
1352
|
+
* @returns {string[]} `path:start-end` entries for current changed lines.
|
|
1353
|
+
*/
|
|
1354
|
+
export const selectChangedLineRanges = (cwd, base, file) =>
|
|
1355
|
+
parseChangedLineRanges(
|
|
1356
|
+
git(cwd, [
|
|
1357
|
+
"diff",
|
|
1358
|
+
"--unified=0",
|
|
1359
|
+
"--diff-filter=ACMR",
|
|
1360
|
+
`${base}...HEAD`,
|
|
1361
|
+
"--",
|
|
1362
|
+
file,
|
|
1363
|
+
])
|
|
1364
|
+
).map(({ start, end }) => `${file}:${start}-${end}`);
|
|
1365
|
+
|
|
1366
|
+
/**
|
|
1367
|
+
* Line ranges changed on this branch in files this project mutates.
|
|
1316
1368
|
* @param {string} cwd - Project root.
|
|
1317
1369
|
* @param {string} base - Merge-base sha.
|
|
1318
1370
|
* @param {{include: RegExp[], exclude: RegExp[]}} patterns - Compiled matchers.
|
|
1319
|
-
* @returns {{changed: number,
|
|
1320
|
-
*
|
|
1371
|
+
* @returns {{changed: number, selectedFiles: number, selected: string[],
|
|
1372
|
+
* noCurrentLines: string[], uninstrumentable: string[]}}
|
|
1373
|
+
* Totals, line-range selection, files with only deletions/renames, and changed
|
|
1374
|
+
* files no mutation tool here reaches.
|
|
1321
1375
|
*/
|
|
1322
1376
|
export const selectChangedTargets = (cwd, base, patterns) => {
|
|
1323
1377
|
const changed = git(cwd, [
|
|
@@ -1329,11 +1383,20 @@ export const selectChangedTargets = (cwd, base, patterns) => {
|
|
|
1329
1383
|
.split("\n")
|
|
1330
1384
|
.map(file => file.trim())
|
|
1331
1385
|
.filter(Boolean);
|
|
1386
|
+
const selectedFiles = changed
|
|
1387
|
+
.filter(file => isMutateTarget(file, patterns))
|
|
1388
|
+
.filter(file => fs.existsSync(path.join(cwd, file)));
|
|
1389
|
+
const byFile = selectedFiles.map(file => ({
|
|
1390
|
+
file,
|
|
1391
|
+
ranges: selectChangedLineRanges(cwd, base, file),
|
|
1392
|
+
}));
|
|
1332
1393
|
return {
|
|
1333
1394
|
changed: changed.length,
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1395
|
+
selectedFiles: selectedFiles.length,
|
|
1396
|
+
selected: byFile.flatMap(entry => entry.ranges),
|
|
1397
|
+
noCurrentLines: byFile
|
|
1398
|
+
.filter(entry => entry.ranges.length === 0)
|
|
1399
|
+
.map(entry => entry.file),
|
|
1337
1400
|
// Reported from the diff, not from the selection, because by construction
|
|
1338
1401
|
// these can never BE in the selection — that is the whole point of them.
|
|
1339
1402
|
uninstrumentable: uninstrumentableGuards(changed),
|
|
@@ -2115,7 +2178,7 @@ export const runGate = (cwd = process.cwd(), argv = []) => {
|
|
|
2115
2178
|
const blind = scope.uninstrumentable.map(file => ` • ${file}`).join("\n");
|
|
2116
2179
|
console.log(
|
|
2117
2180
|
`⚪ ${OUTCOMES.uninstrumentableLanguage}\n` +
|
|
2118
|
-
` ${scope.changed} file(s) changed vs ${since}; ${scope.
|
|
2181
|
+
` ${scope.changed} file(s) changed vs ${since}; ${scope.selectedFiles} of them are mutate targets\n` +
|
|
2119
2182
|
` under the patterns from ${declaration.source}, and ${scope.uninstrumentable.length} of them\n` +
|
|
2120
2183
|
` ${scope.uninstrumentable.length === 1 ? "is" : "are"} in a language Stryker cannot instrument in ANY configuration:\n` +
|
|
2121
2184
|
`${blind}\n` +
|
|
@@ -2127,10 +2190,25 @@ export const runGate = (cwd = process.cwd(), argv = []) => {
|
|
|
2127
2190
|
" payload table and asserts the blocked/allowed verdict, with a control\n" +
|
|
2128
2191
|
" on both sides. Check that one exists; nothing here did."
|
|
2129
2192
|
);
|
|
2130
|
-
if (scope.selected.length === 0
|
|
2193
|
+
if (scope.selected.length === 0 && scope.noCurrentLines.length === 0)
|
|
2194
|
+
return 0;
|
|
2131
2195
|
}
|
|
2132
2196
|
|
|
2133
2197
|
if (scope.selected.length === 0) {
|
|
2198
|
+
if (scope.noCurrentLines.length > 0) {
|
|
2199
|
+
const listed = scope.noCurrentLines
|
|
2200
|
+
.map(file => ` • ${file}`)
|
|
2201
|
+
.join("\n");
|
|
2202
|
+
console.log(
|
|
2203
|
+
`⚪ ${OUTCOMES.noCurrentLines}\n` +
|
|
2204
|
+
` ${scope.noCurrentLines.length} mutate-target file(s) changed vs ${since}, but their diff\n` +
|
|
2205
|
+
` contains only deletions or a rename with no changed current lines:\n` +
|
|
2206
|
+
`${listed}\n` +
|
|
2207
|
+
" Stryker can place mutants only on current lines. NO mutant was generated\n" +
|
|
2208
|
+
" and NO score was computed; this is not a measured pass."
|
|
2209
|
+
);
|
|
2210
|
+
return 0;
|
|
2211
|
+
}
|
|
2134
2212
|
console.log(
|
|
2135
2213
|
`⚪ ${OUTCOMES.nothingToMutate}\n` +
|
|
2136
2214
|
` ${scope.changed} file(s) changed vs ${since}; 0 of them are mutate targets\n` +
|
|
@@ -2160,8 +2238,8 @@ export const runGate = (cwd = process.cwd(), argv = []) => {
|
|
|
2160
2238
|
}
|
|
2161
2239
|
|
|
2162
2240
|
console.log(
|
|
2163
|
-
`🧬 ${OUTCOMES.scoped} — Stryker on ${scope.selected.length}
|
|
2164
|
-
`${scope.changed} changed file(s), selected by ${declaration.source}:`
|
|
2241
|
+
`🧬 ${OUTCOMES.scoped} — Stryker on ${scope.selected.length} changed line range(s) in ` +
|
|
2242
|
+
`${scope.selectedFiles} of ${scope.changed} changed file(s), selected by ${declaration.source}:`
|
|
2165
2243
|
);
|
|
2166
2244
|
for (const file of scope.selected) console.log(` • ${file}`);
|
|
2167
2245
|
|