@diegovelasquezweb/a11y-engine 0.11.47 → 0.11.48

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diegovelasquezweb/a11y-engine",
3
- "version": "0.11.47",
3
+ "version": "0.11.48",
4
4
  "description": "WCAG 2.2 accessibility audit engine — scanner, analyzer, and report builders",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -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
- : true;
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: findingApplied
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,