openpencil/packages
Fini fcbd2230c4 fix(ai): prune hidden subtrees in contrast walk — kill double-fix FP
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.
2026-05-10 14:59:00 +08:00
..
agent-native@22f20e42cd chore(agent): bump agent-native — anthropic provider gets same fix 2026-05-10 13:55:00 +08:00
pen-acp Merge origin/v0.8.0 into feat/rust-ification 2026-05-03 21:00:00 +08:00
pen-ai-skills fix(ai): prune hidden subtrees in contrast walk — kill double-fix FP 2026-05-10 14:59:00 +08:00
pen-core fix(ai): clean card-image corners + strip wrapper stroke/cornerRadius with fill 2026-05-09 21:42:00 +08:00
pen-engine Merge origin/v0.8.0 into feat/rust-ification 2026-05-03 21:00:00 +08:00
pen-figma Merge origin/v0.8.0 into feat/rust-ification 2026-05-03 21:00:00 +08:00
pen-mcp feat(ai): detect text-bg contrast below WCAG AA (P0-2 from aesthetics roadmap) 2026-05-10 14:30:00 +08:00
pen-react Merge origin/v0.8.0 into feat/rust-ification 2026-05-03 21:00:00 +08:00
pen-renderer Merge feat/rust-ification into v0.8.0 (Step 0 Rust workspace bootstrap) 2026-05-04 21:00:00 +08:00
pen-sdk Merge origin/v0.8.0 into feat/rust-ification 2026-05-03 21:00:00 +08:00
pen-types Merge origin/v0.8.0 into feat/rust-ification 2026-05-03 21:00:00 +08:00
CLAUDE.md V0.7.0 (#95) 2026-04-11 23:25:13 +08:00