openpencil/apps/web/src/services
Fini d1734f5480 fix(ai): run clipCardImageCorners AFTER role-resolver fills in card defaults
Why: Codex stop-time review 2026-05-10 — clipCardImageCorners was
slotted between unwrapFakePhoneMockups and resolveTreeRoles in the
post-streaming pipeline. Cards that don't carry an explicit
cornerRadius from the sub-agent get one filled in by role-resolver
(e.g. role='card' → default cornerRadius=12). Running clip before role
defaults silently skipped every default-radius card — match policy
required scalar cornerRadius > 0 and saw cornerRadius=undefined at
that point. Net effect: the bug stayed for the most common case where
the model wrote role='card' without a numeric radius.

What: move the clipCardImageCorners call to the freshRoot block right
after resolveTreeRoles + resolveTreePostPass. By that point the
role-resolver has populated defaults, so a card without an explicit
radius now correctly hits the predicate. Reuse the existing
\`freshRoot\` reference (re-fetched after updateNode mutations earlier
in the pipeline) so we don't double-fetch from the store.

No new tests — the existing 9 unit tests already pin the predicate;
the bug was placement-only. 1448 / 1448 pen-core tests, 1110 / 1110
AI service tests still pass.
2026-05-09 21:43:00 +08:00
..
__tests__ V0.7.0 (#95) 2026-04-11 23:25:13 +08:00
ai fix(ai): run clipCardImageCorners AFTER role-resolver fills in card defaults 2026-05-09 21:43:00 +08:00
figma V0.7.2-bugfix (#109) 2026-04-14 21:42:56 +08:00
git-client.ts V0.7.0 (#95) 2026-04-11 23:25:13 +08:00
git-error.ts V0.7.0 (#95) 2026-04-11 23:25:13 +08:00
git-types.ts V0.7.0 (#95) 2026-04-11 23:25:13 +08:00