4 Commits

Author SHA1 Message Date
alonso.torres
3e6c98c01a ✨ Generate and check random component histories
The Phase 4 bug hunt: random component programs, an independent model
of what they should leave, and the regression programs of what they
found. The production fixes they found are the commits before this one,
each with its regression programs; this commit holds the test harness,
the rest of the tests and the memories they grew with. A regression
program that needs the harness runs once this commit is in.

- Generation (composable gen): worlds of components, nested copies,
  variants, libraries (stale and dependent), flex and grid layouts and
  texts; operations for structure, geometry, styles, texts, layout items,
  grid tracks and cells, swaps, variant switches, update main, reset,
  detach, library edits and syncs, undo and redo; shrinking, coverage
  accounting per operation kind, and PENPOT_GEN_SEED, PENPOT_GEN_NUM
  and PENPOT_GEN_HISTORIES to choose the seed, the number of programs
  and their length.
- The oracle: invariants on touched groups, overrides, refs, settled
  versus full sync, design snapshots and the model values, with its
  own model of authored intent (shadow, geometry, grid and variant
  rules) instead of production's results.
- The frontend replays generated programs through the workspace events
  and the completion contract, with undo and redo checks.
- The oracle unit tests, the test runners' registrations, the golden
  masters recorded again where a fix changed them, and the memories of
  the component sync contract and its tests.

Harness only; the benchmark is not run.

Also in this commit:

- Adapt develop's variant set and reload tests to this branch. Develop's tests
  of transforming a component into a variant set call the event with the set's
  id and expect the defining commit to hold only the main. Here the transform
  builds the whole set, its second member included, in one commit:
  transform-in-variant takes an optional variant id, and the tests expect both
  members in that commit.
- Restore the requires and test wiring the rebase merges dropped.
- Generate variant property edits and added variants. The random programs
  switched between the members of a variant set but never changed the set.

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:46 +01:00
alonso.torres
c3356b5325 🐛 Keep a reflected copy's transform when settling its decomposition
After a reflection, copy descendants are settled through a sync proposal
from their mains so their flip flags take the decomposition sync gives.
The proposal reads the loaded main. A dependent library main nesting a copy
whose child the upstream library flipped, not yet accepted there, was
flipped; mirrored twice, the pending flip gave the child the same corners,
so the footprint check accepted it and the child lost its reflection.

Accept a proposal only where it keeps the shape's corners and transform, so
it can change only how rotation and flips decompose that transform.

A third re-run of the seed-20261101 library dependency property found this;
it also fails on earlier commits. The program regression fails before the
fix and passes after it. Full common passes lint, JVM, JavaScript and
formatting: JVM 2079 tests / 33875 assertions; JavaScript 2015 / 32526. All
six component properties pass 40 programs each at seed 712 in both runtimes.

Compare lower-quantile milliseconds with the saved baseline; keep that
baseline unchanged. The machine/JVM warning makes ratios rough. No world
is flagged.

World                      Baseline       Now    Ratio
Main into 10 copies           1.790     1.007     0.56
Main into 100 copies         15.415     8.691     0.56
Main into 1000 copies       153.086    87.750     0.57
Three nesting levels         35.215    19.121     0.54
Dependency chain             68.931    36.243     0.53
Library update               83.083    46.041     0.55
Many plain shapes             4.837     2.219     0.46
Variant switch               32.052    20.574     0.64

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:45 +01:00
alonso.torres
7f1edd5659 🐛 Keep a stale nested copy's size when its main is reflected
Reflecting a shape re-decomposes the flip flags of the copy heads under it
by placing them through a sync proposal from their mains. Its docstring
promises to stay within existing geometry, but the proposal also carries a
pending size of the copy's library main. A dependent library main nesting
a copy of an upstream main whose width changed took that width when the
dependent main was flipped, before the update was accepted.

Settle reflected heads only on the shapes whose footprint the proposal
keeps. Untouched swapped heads after a parent turn still take the proposal
whole, since their content may differ in size from their position.

A fresh JVM library-dependency run (seed 20261101) found this: a 0.01 px
nested frame became 160 px wide (I4). The program regression fails before
the fix and passes after it. The source, oracle, expected-geometry, reset,
sync, swap-group and composable namespaces pass at seed 712: 330 tests /
3729 assertions.

Compare lower-quantile milliseconds with the saved baseline; keep that
baseline unchanged. The machine/JVM warning makes ratios rough. No world
is flagged.

World                      Baseline       Now    Ratio
Main into 10 copies           1.790     0.944     0.53
Main into 100 copies         15.415     9.742     0.63
Main into 1000 copies       153.086    91.886     0.60
Three nesting levels         35.215    18.344     0.52
Dependency chain             68.931    36.790     0.53
Library update               83.083    45.517     0.55
Many plain shapes             4.837     2.256     0.47
Variant switch               32.052    20.228     0.63

AI-assisted-by: claude-opus-5-5
2026-11-10 20:21:42 +01:00
alonso.torres
a88f53874d 🐛 Keep pending library edits out of transform settlement
Use the component sync result only as a geometry proposal when settling
reflections and swapped placement. Correct existing shapes without pulling
pending library content, styles or structure into a transformed copy.
Keep path geometry and the primary action's exact undo/redo group.

Generate source transforms, letters and all twelve text style units with
separate source histories and explicit consumer acceptance. Add dropped
source-edit controls and portable/frontend regressions for the accidental
pull. Register the new portable namespace in the JavaScript runner.
The complete original program and both reductions pass unchanged.

Common JVM passes 1,919 tests/31,313 assertions. Full JS passes
1,845/29,770; the newly registered source namespace adds 5/135 passing
checks. Frontend passes 1,566/11,119, backend 1,610/8,104 and exporter
14/32. Lint and formatting pass; browser ShapeProxy replay passes.
No golden data changes.

Benchmark ratios against the unchanged baseline: mains 10/100/1000
0.57/0.65/0.61, levels 0.52, chain 0.51, library 0.52, many shapes 0.47,
variant switch 0.60. No regression flag.

AI-assisted-by: gpt-6
2026-11-10 20:21:41 +01:00