Third Codex stop-hook in this thread caught a bug introduced by the previous fix. The "skip ancestor whose node-level opacity=0 / visible =false" guard correctly stopped a hidden wrapper from being read as the bg, BUT the walk still descended into the hidden subtree and flagged its text against whatever bg sat above. Hidden text doesn't render at all, so flagging its contrast is a textbook false positive. Move the check up: if a node has `opacity === 0` or `visible === false` the whole subtree gets pruned at walk time. Text inside is never inspected. The earlier `ancestorBgColor` guard is left as defense- in-depth (cheap and protects against direct callers). The two tests added in 65e115e8 had the wrong expectation — they asserted the detector flagged hidden-wrapper text. Both now flip to "does NOT flag" matching the corrected semantic. Hidden = invisible = no contrast pair to score. Distinction the test set still pins: - fill.opacity=0 (rectangle invisible, node visible) → walk continues, ancestor walk picks real bg further up, FLAG - node.opacity=0 (whole subtree invisible) → walk prunes, NO flag Corpus replay holds at 14 hits — no regression. |
||
|---|---|---|
| .. | ||
| agent-native@22f20e42cd | ||
| pen-acp | ||
| pen-ai-skills | ||
| pen-core | ||
| pen-engine | ||
| pen-figma | ||
| pen-mcp | ||
| pen-react | ||
| pen-renderer | ||
| pen-sdk | ||
| pen-types | ||
| CLAUDE.md | ||