42 builders × 2 assertions: 1. Semantic preservation: role / type / content / layout are identical at every tree position before and after normalizePenDocument. Also asserts node count unchanged — a pass must not create or drop nodes. 2. Idempotency: normalize(normalize(x)) === normalize(x). Why it matters: normalizePenDocument runs at document open + after AI generation rounds (see load-op-file.ts / import-pen-document.ts). Builders produce canonical format output, so normalize SHOULD be a no-op on the semantic fields. A regression that silently rewrites a role or swaps a type would be invisible without this guard. Complements element-builders-post-process-idempotent.test.ts (which gates the OTHER four post-processing passes); this one specifically covers the format-layer pass. |
||
|---|---|---|
| .. | ||
| agent-native@e1f90cab96 | ||
| pen-acp | ||
| pen-ai-skills | ||
| pen-core | ||
| pen-engine | ||
| pen-figma | ||
| pen-mcp | ||
| pen-react | ||
| pen-renderer | ||
| pen-sdk | ||
| pen-types | ||
| CLAUDE.md | ||