corpus/attachment-edit/README.md | 12 + corpus/attachment-edit/renamed/candidate/Open Notebook.onetoc2 | Bin 0 -> 1612 bytes corpus/attachment-edit/renamed/candidate/synthetic.one | Bin 0 -> 21896 bytes corpus/attachment-edit/renamed/cold/commands.jsonl | 3 + corpus/attachment-edit/renamed/cold/machine.json | 1 + corpus/attachment-edit/renamed/cold/notebook/Open Notebook.onetoc2 | Bin 0 -> 3780 bytes corpus/attachment-edit/renamed/cold/notebook/synthetic.one | Bin 0 -> 21896 bytes corpus/attachment-edit/renamed/cold/read/af1af4b8987109ce1e335e538910fb3860b7c57eb3b6110a06aa2114e06d69a7.attachment | 1 + corpus/attachment-edit/renamed/cold/read/environment.json | 7 + corpus/attachment-edit/renamed/cold/read/hierarchy.xml | 2 + corpus/attachment-edit/renamed/cold/read/page-000.xml | 8 + corpus/attachment-edit/renamed/cold/read/payloads.json | 10 + corpus/attachment-edit/renamed/cold/run.json | 18 ++ corpus/attachment-edit/renamed/cold/scripts/cold.ps1 | 27 ++ corpus/attachment-edit/renamed/cold/scripts/read.ps1 | 142 +++++++++++ corpus/attachment-edit/renamed/cold/source.json | 14 + corpus/attachment-edit/renamed/cold/teardown.json | 1 + corpus/notebook-edit/README.md | 40 +++ corpus/notebook-edit/deleted/candidate/Kept/First.one | Bin 0 -> 3164 bytes corpus/notebook-edit/deleted/candidate/Kept/Open Notebook.onetoc2 | Bin 0 -> 4120 bytes corpus/notebook-edit/deleted/candidate/OneNote_RecycleBin/First.one | Bin 0 -> 3212 bytes corpus/notebook-edit/deleted/candidate/OneNote_RecycleBin/Open Notebook.onetoc2 | Bin 0 -> 3824 bytes corpus/notebook-edit/deleted/candidate/Open Notebook.onetoc2 | Bin 0 -> 6328 bytes corpus/notebook-edit/deleted/candidate/Renamed.one | Bin 0 -> 5504 bytes corpus/notebook-edit/deleted/cold/commands.jsonl | 3 + corpus/notebook-edit/deleted/cold/machine.json | 1 + corpus/notebook-edit/deleted/cold/notebook/Kept/First.one | Bin 0 -> 3164 bytes corpus/notebook-edit/deleted/cold/notebook/Kept/Open Notebook.onetoc2 | Bin 0 -> 4120 bytes corpus/notebook-edit/deleted/cold/notebook/OneNote_RecycleBin/First.one | Bin 0 -> 3212 bytes corpus/notebook-edit/deleted/cold/notebook/OneNote_RecycleBin/Open Notebook.onetoc2 | Bin 0 -> 3824 bytes corpus/notebook-edit/deleted/cold/notebook/Open Notebook.onetoc2 | Bin 0 -> 7392 bytes corpus/notebook-edit/deleted/cold/notebook/Renamed.one | Bin 0 -> 5504 bytes corpus/notebook-edit/deleted/cold/read/environment.json | 7 + corpus/notebook-edit/deleted/cold/read/hierarchy.xml | 2 + corpus/notebook-edit/deleted/cold/read/page-000.xml | 2 + corpus/notebook-edit/deleted/cold/read/page-001.xml | 2 + corpus/notebook-edit/deleted/cold/read/page-002.xml | 2 + corpus/notebook-edit/deleted/cold/read/payloads.json | 3 + corpus/notebook-edit/deleted/cold/run.json | 18 ++ corpus/notebook-edit/deleted/cold/scripts/cold.ps1 | 27 ++ corpus/notebook-edit/deleted/cold/scripts/read.ps1 | 142 +++++++++++ corpus/notebook-edit/deleted/cold/source.json | 38 +++ corpus/notebook-edit/deleted/cold/teardown.json | 1 + corpus/notebook-edit/native-reorder/commands.jsonl | 4 + corpus/notebook-edit/native-reorder/machine.json | 1 + corpus/notebook-edit/native-reorder/notebook-reordered/Group/Inner.one | Bin 0 -> 4016 bytes corpus/notebook-edit/native-reorder/notebook-reordered/Group/Open Notebook.onetoc2 | Bin 0 -> 3752 bytes corpus/notebook-edit/native-reorder/notebook-reordered/Open Notebook.onetoc2 | Bin 0 -> 4116 bytes corpus/notebook-edit/native-reorder/notebook-reordered/Second.one | Bin 0 -> 4016 bytes corpus/notebook-edit/native-reorder/notebook-reordered/Third.one | Bin 0 -> 4016 bytes corpus/notebook-edit/native-reorder/notebook-reordered/links.one | Bin 0 -> 6128 bytes corpus/notebook-edit/native-reorder/notebook/Group/Inner.one | Bin 0 -> 4016 bytes corpus/notebook-edit/native-reorder/notebook/Group/Open Notebook.onetoc2 | Bin 0 -> 3752 bytes corpus/notebook-edit/native-reorder/notebook/Open Notebook.onetoc2 | Bin 0 -> 4116 bytes corpus/notebook-edit/native-reorder/notebook/Second.one | Bin 0 -> 4016 bytes corpus/notebook-edit/native-reorder/notebook/Third.one | Bin 0 -> 4016 bytes corpus/notebook-edit/native-reorder/notebook/links.one | Bin 0 -> 6128 bytes corpus/notebook-edit/native-reorder/read/environment.json | 7 + corpus/notebook-edit/native-reorder/read/hierarchy.xml | 2 + corpus/notebook-edit/native-reorder/read/page-000.xml | 3 + corpus/notebook-edit/native-reorder/read/payloads.json | 3 + corpus/notebook-edit/native-reorder/reorder-00-opened.xml | 2 + corpus/notebook-edit/native-reorder/reorder-01-update.xml | 1 + corpus/notebook-edit/native-reorder/reorder-02-reordered.xml | 2 + corpus/notebook-edit/native-reorder/reorder-03-reopened.xml | 2 + corpus/notebook-edit/native-reorder/run.json | 19 ++ corpus/notebook-edit/native-reorder/scripts/author.ps1 | 50 ++++ corpus/notebook-edit/native-reorder/scripts/cold.ps1 | 27 ++ corpus/notebook-edit/native-reorder/scripts/read.ps1 | 142 +++++++++++ corpus/notebook-edit/native-reorder/source.json | 38 +++ corpus/notebook-edit/native-reorder/teardown.json | 1 + corpus/notebook-edit/native-structure/commands.jsonl | 4 + corpus/notebook-edit/native-structure/machine.json | 1 + corpus/notebook-edit/native-structure/notebook-renamed/Group/Inner.one | Bin 0 -> 4016 bytes corpus/notebook-edit/native-structure/notebook-renamed/Group/Open Notebook.onetoc2 | Bin 0 -> 3752 bytes corpus/notebook-edit/native-structure/notebook-renamed/Open Notebook.onetoc2 | Bin 0 -> 4116 bytes corpus/notebook-edit/native-structure/notebook-renamed/Second.one | Bin 0 -> 4016 bytes corpus/notebook-edit/native-structure/notebook-renamed/Third.one | Bin 0 -> 4016 bytes corpus/notebook-edit/native-structure/notebook-renamed/links.one | Bin 0 -> 6128 bytes corpus/notebook-edit/native-structure/notebook/Group/Inner.one | Bin 0 -> 4016 bytes corpus/notebook-edit/native-structure/notebook/Group/Open Notebook.onetoc2 | Bin 0 -> 3752 bytes corpus/notebook-edit/native-structure/notebook/OneNote_RecycleBin/OneNote_DeletedPages.one | Bin 0 -> 4016 bytes corpus/notebook-edit/native-structure/notebook/OneNote_RecycleBin/Open Notebook.onetoc2 | Bin 0 -> 3856 bytes corpus/notebook-edit/native-structure/notebook/OneNote_RecycleBin/Third.one | Bin 0 -> 4016 bytes corpus/notebook-edit/native-structure/notebook/Open Notebook.onetoc2 | Bin 0 -> 5276 bytes corpus/notebook-edit/native-structure/notebook/Second.one | Bin 0 -> 4016 bytes corpus/notebook-edit/native-structure/notebook/links.one | Bin 0 -> 6128 bytes corpus/notebook-edit/native-structure/read/environment.json | 7 + corpus/notebook-edit/native-structure/read/hierarchy.xml | 2 + corpus/notebook-edit/native-structure/read/page-000.xml | 3 + corpus/notebook-edit/native-structure/read/payloads.json | 3 + corpus/notebook-edit/native-structure/run.json | 19 ++ corpus/notebook-edit/native-structure/scripts/author.ps1 | 71 ++++++ corpus/notebook-edit/native-structure/scripts/cold.ps1 | 27 ++ corpus/notebook-edit/native-structure/scripts/read.ps1 | 142 +++++++++++ corpus/notebook-edit/native-structure/source.json | 14 + corpus/notebook-edit/native-structure/structure-00-opened.xml | 2 + corpus/notebook-edit/native-structure/structure-01-created.xml | 2 + corpus/notebook-edit/native-structure/structure-02-update.xml | 1 + corpus/notebook-edit/native-structure/structure-03-renamed.xml | 2 + corpus/notebook-edit/native-structure/structure-03b-reopened.xml | 2 + corpus/notebook-edit/native-structure/structure-04-deleted.xml | 2 + corpus/notebook-edit/native-structure/teardown.json | 1 + corpus/notebook-edit/structured/candidate/First.one | Bin 0 -> 3212 bytes corpus/notebook-edit/structured/candidate/Kept/Inner.one | Bin 0 -> 3164 bytes corpus/notebook-edit/structured/candidate/Kept/Open Notebook.onetoc2 | Bin 0 -> 3824 bytes corpus/notebook-edit/structured/candidate/Open Notebook.onetoc2 | Bin 0 -> 5408 bytes corpus/notebook-edit/structured/candidate/Renamed.one | Bin 0 -> 5504 bytes corpus/notebook-edit/structured/cold/commands.jsonl | 3 + corpus/notebook-edit/structured/cold/machine.json | 1 + corpus/notebook-edit/structured/cold/notebook/First.one | Bin 0 -> 3212 bytes corpus/notebook-edit/structured/cold/notebook/Kept/Inner.one | Bin 0 -> 3164 bytes corpus/notebook-edit/structured/cold/notebook/Kept/Open Notebook.onetoc2 | Bin 0 -> 3824 bytes corpus/notebook-edit/structured/cold/notebook/Open Notebook.onetoc2 | Bin 0 -> 6472 bytes corpus/notebook-edit/structured/cold/notebook/Renamed.one | Bin 0 -> 5504 bytes corpus/notebook-edit/structured/cold/read/environment.json | 7 + corpus/notebook-edit/structured/cold/read/hierarchy.xml | 2 + corpus/notebook-edit/structured/cold/read/page-000.xml | 2 + corpus/notebook-edit/structured/cold/read/page-001.xml | 2 + corpus/notebook-edit/structured/cold/read/page-002.xml | 2 + corpus/notebook-edit/structured/cold/read/payloads.json | 3 + corpus/notebook-edit/structured/cold/run.json | 18 ++ corpus/notebook-edit/structured/cold/scripts/cold.ps1 | 27 ++ corpus/notebook-edit/structured/cold/scripts/read.ps1 | 142 +++++++++++ corpus/notebook-edit/structured/cold/source.json | 32 +++ corpus/notebook-edit/structured/cold/teardown.json | 1 + crates/notebook/README.md | 45 +++- crates/notebook/examples/recovery_probe.rs | 1 + crates/notebook/src/lib.rs | 5 +- crates/notebook/src/schema.rs | 4 + crates/notebook/src/session.rs | 440 +++++++++++++++++++++++++++++++- crates/notebook/src/sync.rs | 131 +++++++++- crates/notebook/tests/changes.rs | 78 ++++++ crates/notebook/tests/links.rs | 78 ++++++ crates/notebook/tests/protected.rs | 29 +++ crates/notebook/tests/session.rs | 97 +++++++ crates/notebook/tests/structure.rs | 173 +++++++++++++ crates/notebook/tests/sync.rs | 36 +-- crates/notebook/tests/sync_formatting.rs | 7 +- crates/notebook/tests/sync_outline.rs | 10 +- crates/notebook/tests/sync_page.rs | 9 +- crates/notebook/tests/sync_pages.rs | 9 +- crates/notebook/tests/sync_paragraph.rs | 7 +- crates/notebook/tests/sync_worker.rs | 18 +- crates/onestore/README.md | 5 +- crates/onestore/src/commit.rs | 37 +++ crates/onestore/src/create.rs | 12 +- crates/onestore/src/lib.rs | 5 +- crates/onestore/src/page/link.rs | 43 ++++ crates/onestore/src/page/mod.rs | 23 +- crates/onestore/src/page/write.rs | 80 +++++- crates/onestore/src/store.rs | 10 +- crates/onestore/src/toc.rs | 226 ++++++++++++++++ crates/onestore/src/write.rs | 28 +- crates/onestore/tests/page_attachments.rs | 32 ++- crates/onestore/tests/page_links.rs | 28 +- crates/onestore/tests/toc.rs | 108 ++++++++ tools/native/notebook-reorder.ps1 | 50 ++++ tools/native/notebook-structure.ps1 | 71 ++++++ tools/test_attachment_edit.py | 9 + tools/test_notebook_edit.py | 65 +++++ 161 files changed, 3315 insertions(+), 79 deletions(-)