Surfaced by typing during the Phase 3 TypeScript conversion (#120) and preserved verbatim there per the no-behavior-change policy; this issue tracks the fix.
Symptom
Any job that runs the ibm tool with standard results enabled and withItems: false gets a failed act: data.prevented: true with error: "Act failed (Cannot read properties of undefined (reading 'forEach'))". It looks like the accessibility-checker failed, but the tool ran fine — the failure is in the reporter's own standard-result pass.
Root cause
tests/ibm.ts (and the emitted ibm.js): trimActReport assigns actReport.items only inside its if (withItems) branch, then returns {totals, items: actReport.items} — so items is undefined when itemization was not requested. The standard pass then iterates it unconditionally (tests/ibm.ts:210):
nativeResult.items.forEach(item => {...});
The TypeError is swallowed by the reporter's outer catch, which reclassifies it as an act failure. (The standard totals were already correctly populated from totals.recommendation/totals.violation just before the throw, but the result is discarded.)
Suggested fix
Two options, either of which makes withItems: false usable with standard results:
- Build the standard instances from
actReport.results regardless of withItems, and let withItems control only the native result's itemization (matches how other adapters treat the flag), or
- Guard the loop (
if (nativeResult.items)), yielding a totals-only standard result when itemization is off.
Option 1 preserves instance-level standard reporting, which downstream scoring generally expects.
🤖 Generated with Claude Code
Surfaced by typing during the Phase 3 TypeScript conversion (#120) and preserved verbatim there per the no-behavior-change policy; this issue tracks the fix.
Symptom
Any job that runs the ibm tool with standard results enabled and
withItems: falsegets a failed act:data.prevented: truewitherror: "Act failed (Cannot read properties of undefined (reading 'forEach'))". It looks like the accessibility-checker failed, but the tool ran fine — the failure is in the reporter's own standard-result pass.Root cause
tests/ibm.ts(and the emittedibm.js):trimActReportassignsactReport.itemsonly inside itsif (withItems)branch, then returns{totals, items: actReport.items}— soitemsisundefinedwhen itemization was not requested. The standard pass then iterates it unconditionally (tests/ibm.ts:210):The
TypeErroris swallowed by the reporter's outer catch, which reclassifies it as an act failure. (The standard totals were already correctly populated fromtotals.recommendation/totals.violationjust before the throw, but the result is discarded.)Suggested fix
Two options, either of which makes
withItems: falseusable with standard results:actReport.resultsregardless ofwithItems, and letwithItemscontrol only the native result's itemization (matches how other adapters treat the flag), orif (nativeResult.items)), yielding a totals-only standard result when itemization is off.Option 1 preserves instance-level standard reporting, which downstream scoring generally expects.
🤖 Generated with Claude Code