openpencil/packages
Fini bafbdfaeef fix(pen-core): reject invalid enum values in 5 more element builders
Sweep follow-up to 113bd55a — same defensive pattern (reject
unknown enum strings at the entry boundary) applied to every other
builder that indexed a Record<EnumLiteral, T> with a value sourced
from raw JSON args.

Builders + enums covered:
- buildTag — TagTone (default | accent | success | warning | error)
- buildCallout — CalloutTone (info | success | warning | danger | note)
- buildActivityLog — tone (info | success | warning | danger | neutral)
- buildInviteRow — InviteStatus (pending | expired | accepted)
- buildMemberRow — trailing.tone for status_dot (online | busy | away
  | offline). role_badge / menu variants skip the check (no tone field)

Same failure mode each one fixed: when a model invents an
out-of-enum string (gpt-5.4 did this with `level: "caption"` in
ab-v4), the lookup `TONES[bad]` / `STATUS_TONE[bad]` returned
undefined, the next property access crashed mid-batch with a
cryptic `undefined is not an object`, and the surrounding dispatch
loop dropped every remaining tag (until df33e937 + 07639f6d landed
the per-shape continuation + partial-doc scoring earlier today).
With validation in place, a bad enum becomes a clean per-shape
error message + the rest of the batch still applies.

13 new edge-case tests cover throw on bad input + valid path on
every enum value + omitted-default for each builder. 3785 vitest
pass, format clean, tsc silent.

Builders not touched: heading.ts (already done in 113bd55a).
Builders that don't fit this pattern (no enum→Record lookup of a
user-controlled string): everything else surveyed via grep on
`Record<.*Tone|Status|Level|Mode|Kind`.
2026-04-29 09:49:57 +08:00
..
agent-native@e1f90cab96 chore(agent): bump agent-native to v0.4.0 release 2026-04-17 19:04:15 +08:00
pen-acp chore(release): bump to v0.8.0 2026-04-27 08:20:00 +08:00
pen-ai-skills fix(pen-ai-skills): score partial PenDocument when apply.ok=false 2026-04-29 09:49:56 +08:00
pen-core fix(pen-core): reject invalid enum values in 5 more element builders 2026-04-29 09:49:57 +08:00
pen-engine chore(release): bump to v0.8.0 2026-04-27 08:20:00 +08:00
pen-figma chore(release): bump to v0.8.0 2026-04-27 08:20:00 +08:00
pen-mcp fix(ai): step-card marker clips overflow + tighten doc to short index 2026-04-28 08:55:00 +08:00
pen-react chore(release): bump to v0.8.0 2026-04-27 08:20:00 +08:00
pen-renderer chore(release): bump to v0.8.0 2026-04-27 08:20:00 +08:00
pen-sdk chore(release): bump to v0.8.0 2026-04-27 08:20:00 +08:00
pen-types chore(release): bump to v0.8.0 2026-04-27 08:20:00 +08:00
CLAUDE.md V0.7.0 (#95) 2026-04-11 23:25:13 +08:00