@diegovelasquezweb/a11y-engine 0.11.47 → 0.11.49
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/package.json
CHANGED
|
@@ -1059,7 +1059,9 @@ export async function applyFindingsFix(input) {
|
|
|
1059
1059
|
|
|
1060
1060
|
// If Claude tagged changes with findingId, use those for per-finding success tracking.
|
|
1061
1061
|
// If no findingId tags were emitted, fall back to group-level success for all findings.
|
|
1062
|
+
// If no files were changed at all, the issue was already resolved — mark accordingly.
|
|
1062
1063
|
const hasFindingIdTracking = applied.succeededFindingIds.size > 0;
|
|
1064
|
+
const anyFileChanged = applied.changedFiles && applied.changedFiles.length > 0;
|
|
1063
1065
|
|
|
1064
1066
|
for (const finding of withRules) {
|
|
1065
1067
|
const ruleId = typeof finding.rule_id === "string" ? finding.rule_id.trim() : "";
|
|
@@ -1068,14 +1070,18 @@ export async function applyFindingsFix(input) {
|
|
|
1068
1070
|
|
|
1069
1071
|
const findingApplied = hasFindingIdTracking
|
|
1070
1072
|
? applied.succeededFindingIds.has(finding.id)
|
|
1071
|
-
:
|
|
1073
|
+
: anyFileChanged;
|
|
1074
|
+
|
|
1075
|
+
const alreadyResolved = !hasFindingIdTracking && !anyFileChanged;
|
|
1072
1076
|
|
|
1073
1077
|
resultMap.set(
|
|
1074
1078
|
finding.id,
|
|
1075
1079
|
makeResult(finding.id, {
|
|
1076
|
-
applied: findingApplied,
|
|
1077
|
-
reason: findingApplied ? "" : FIX_ERROR_CODES.PATCH_APPLY_FAILED,
|
|
1078
|
-
message:
|
|
1080
|
+
applied: alreadyResolved ? true : findingApplied,
|
|
1081
|
+
reason: findingApplied || alreadyResolved ? "" : FIX_ERROR_CODES.PATCH_APPLY_FAILED,
|
|
1082
|
+
message: alreadyResolved
|
|
1083
|
+
? "Already resolved — no changes needed."
|
|
1084
|
+
: findingApplied
|
|
1079
1085
|
? "Patch applied successfully."
|
|
1080
1086
|
: "The change for this finding could not be applied (search block not found).",
|
|
1081
1087
|
changedFiles: applied.changedFiles,
|
|
@@ -321,10 +321,15 @@ export async function discoverRoutes(page, baseUrl, maxRoutes, crawlDepth = 2) {
|
|
|
321
321
|
try {
|
|
322
322
|
const targetUrl = new URL(routePath, origin).toString();
|
|
323
323
|
if (page.url() !== targetUrl) {
|
|
324
|
-
await page.goto(targetUrl, {
|
|
324
|
+
const response = await page.goto(targetUrl, {
|
|
325
325
|
waitUntil: "domcontentloaded",
|
|
326
326
|
timeout: 10000,
|
|
327
327
|
});
|
|
328
|
+
if (response && response.status() >= 400) {
|
|
329
|
+
routes.delete(routePath);
|
|
330
|
+
log.warn(`Discovery skip ${routePath}: HTTP ${response.status()}`);
|
|
331
|
+
continue;
|
|
332
|
+
}
|
|
328
333
|
}
|
|
329
334
|
|
|
330
335
|
const hrefs = await page.$$eval("a[href]", (elements) =>
|