1# Page creation
2
3`candidate` adds four pages to `../03-renamed/notebook/Lifecycle.one`: an appended
4page without a title node, a prepended page with an empty title field, and two
5appended pages titled `New 🦋 é`. All thirteen ordered page identities survive
6each fresh OneNote 2010 reopen. Identical artifacts are relative symlinks.
7
8`cold` captures the first reopen. `native` adds a distinct body paragraph to each
9duplicate-title page through `tools/native/created-pages.ps1`; `native/cold`
10reopens that result in another cache. `followup` prefixes those bodies with
11`Rust + ` and the titles with `Reviewed `; `followup/cold` reopens that result.
12The retained `provenance.json` records the native capture inputs and clone removal.
13
14After building workspace examples, run `python -m unittest discover -s tools
15-p test_page_creation.py -v`. It compares native XML content and character formats,
16ordered identities, and complete active object graphs across each cold reopen.
17Only `followup/cold` differs: OneNote refreshes the section's cached copies of the
18two renamed titles, which the Rust title edit leaves stale.
19
20Export fresh Rust candidates by setting each variable to a new output directory:
21
22| Core integration test (`cargo test -p onestore --test page TEST -- --exact`) | Variable |
23| --- | --- |
24| `native_section_accepts_empty_and_titled_pages_with_preserved_history` | `ONESTORE_PAGE_CREATION_OUTPUT` |
25| `native_changes_on_created_pages_accept_rust_followups` | `ONESTORE_PAGE_FOLLOWUP_OUTPUT` |
26| `repeated_page_creation_crosses_root_fragments_counters_and_section_checkpoints` | `ONESTORE_PAGE_STRESS_OUTPUT` |
27
28The last test produces 521 pages, crosses a section revision checkpoint and
29transaction-counter rollover, and checks that every unpublished candidate still
30exposes the complete preceding page order. Its large native capture is local
31evidence. Reproduce with `tools/native_runner.py INPUT OUTPUT --expected-pages 521
32--collect-notebook`, then `PYTHONPATH=tools python tools/verify_page_creation.py
33INPUT OUTPUT`. That comparison permits only exact native materialization of a
34previously absent section metadata copy; all other graph fields compare exactly.
35
36This core operation deliberately creates one optional title outline without
37generated date/time text or template content. MS-ONE 2.2.50 permits a title with
38one or two outlines. The fixture establishes this explicit empty-page contract.