@diegovelasquezweb/a11y-engine 0.11.5 → 0.11.7
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 +1 -1
- package/src/enrichment/analyzer.mjs +14 -7
package/package.json
CHANGED
|
@@ -608,13 +608,18 @@ function deduplicateFindings(findings) {
|
|
|
608
608
|
if (group.length === 1) {
|
|
609
609
|
result.push(group[0]);
|
|
610
610
|
} else {
|
|
611
|
-
|
|
611
|
+
// Confirmed findings (needs_verification=false) always take priority over incomplete ones.
|
|
612
|
+
// Among confirmed, pick the one with most instances; same for incomplete-only groups.
|
|
613
|
+
const confirmed = group.filter((f) => !f.needs_verification);
|
|
614
|
+
const pool = confirmed.length > 0 ? confirmed : group;
|
|
615
|
+
const representative = pool.reduce((best, f) =>
|
|
612
616
|
(f.total_instances || 1) >= (best.total_instances || 1) ? f : best,
|
|
613
617
|
);
|
|
614
618
|
const affectedUrls = [...new Set(group.map((f) => f.url))];
|
|
615
619
|
const totalInstances = group.reduce((sum, f) => sum + (f.total_instances || 1), 0);
|
|
616
620
|
result.push({
|
|
617
621
|
...representative,
|
|
622
|
+
needs_verification: confirmed.length === 0,
|
|
618
623
|
total_instances: totalInstances,
|
|
619
624
|
pages_affected: affectedUrls.length,
|
|
620
625
|
affected_urls: affectedUrls,
|
|
@@ -853,11 +858,13 @@ function buildFindings(inputPayload, cliArgs) {
|
|
|
853
858
|
const fixInfo = ruleInfo.fix || {};
|
|
854
859
|
const resolvedGuardrails = resolveGuardrails(ruleInfo, null);
|
|
855
860
|
|
|
856
|
-
let recFix =
|
|
857
|
-
?
|
|
858
|
-
:
|
|
859
|
-
?
|
|
860
|
-
:
|
|
861
|
+
let recFix = fixInfo.description
|
|
862
|
+
? fixInfo.description
|
|
863
|
+
: apgUrl
|
|
864
|
+
? apgUrl
|
|
865
|
+
: v.helpUrl
|
|
866
|
+
? v.helpUrl
|
|
867
|
+
: null;
|
|
861
868
|
|
|
862
869
|
const codeLang = detectCodeLang(fixInfo.code);
|
|
863
870
|
const fileSearchPattern = getFileSearchPattern(ctx.framework, codeLang);
|
|
@@ -930,7 +937,7 @@ function buildFindings(inputPayload, cliArgs) {
|
|
|
930
937
|
primary_source_scope: ownership.primarySourceScope,
|
|
931
938
|
search_strategy: ownership.searchStrategy,
|
|
932
939
|
component_hint: extractComponentHint(bestSelector) ?? derivePageHint(route.path),
|
|
933
|
-
needs_verification: !!v._fromIncomplete,
|
|
940
|
+
needs_verification: !!v._fromIncomplete || !!v.needs_verification,
|
|
934
941
|
verification_command: `pnpm a11y --base-url ${route.url} --routes ${route.path} --only-rule ${v.id} --max-routes 1`,
|
|
935
942
|
verification_command_fallback: `node scripts/audit.mjs --base-url ${route.url} --routes ${route.path} --only-rule ${v.id} --max-routes 1`,
|
|
936
943
|
pm_summary: ruleInfo.pm?.summary ?? null,
|