| 1 | # Native page lifecycle controls |
| 2 | |
| 3 | Six sequential OneNote 2010 controls, each independently reopened in a fresh |
| 4 | Windows clone. `notebook` is the closed source; `read` is its native section XML; |
| 5 | `cold/notebook` and `cold/read` retain the independently reopened notebook and XML. |
| 6 | Identical artifacts link to one copy. `provenance.json` records the source, |
| 7 | controller hash and clone teardown. The seed section is the existing synthetic |
| 8 | deletion fixture; personal notebooks are not inputs. |
| 9 | |
| 10 | | Phase | Native operation | |
| 11 | | --- | --- | |
| 12 | | 01-blank | Create default, blank-with-title and blank-without-title pages. | |
| 13 | | 02-authored | Add six pages, including duplicate explicit titles and a body-derived title. | |
| 14 | | 03-renamed | Rename one duplicate with Unicode; clear another title. | |
| 15 | | 04-nested | Place child/grandchild pages at levels 2 and 3. | |
| 16 | | 05-reordered | Move an ordinary page before the parent/subpage group using complete explicit order. | |
| 17 | | 06-deleted-parent | Soft-delete the parent while retaining its subpages. | |
| 18 | |
| 19 | The native deletion moves the parent into `OneNote_RecycleBin` and appends its |
| 20 | surviving level-2/3 pages to the preceding page series. These COM controls do not |
| 21 | define keyboard selection or implicit subtree movement. Renaming reallocates |
| 22 | title content; body identities, formatting and content remain unchanged. |
| 23 | |
| 24 | Run `PYTHONPATH=tools python3 -m unittest tools.test_page_lifecycle -v` after |
| 25 | building the workspace examples with all features. The tests compare every phase |
| 26 | to its native XML and cold output, then independently check page styles, titles, |
| 27 | order, levels, series grouping and exact preserved body graphs. |
| 28 | |
| 29 | To reproduce, copy `corpus/native-delete/deletion-05/before/synthetic.one` into a |
| 30 | new notebook directory and run `tools/native_runner.py INPUT OUTPUT --author |
| 31 | tools/native/page-lifecycle.ps1 --collect-notebook`. Cold-capture each generated |
| 32 | phase's notebook with the same runner, without `--author`. The controller waits |
| 33 | for stable native content before closing and refreshes COM IDs after reopening; |
| 34 | COM IDs are not the stored object-space identities. |