diff --git a/corpus/outline-edit/README.md b/corpus/outline-edit/README.md index 8ea0c1938367d1eeebccf312f1cf91d5238d1283..92f9b0d0a9aba3b94b0dedcaddeeab5a1b48d6df 100644 --- a/corpus/outline-edit/README.md +++ b/corpus/outline-edit/README.md @@ -68,21 +68,20 @@ To regenerate, run `resizing_a_native_reserved_width_preserves_content` with `ONESTORE_RESERVED_WIDTH_OUTPUT` set to a new absolute directory, then cold-open it with the same runner arguments. -`offline` reconciles local layout/default intents and later text edits against all -fourteen native changes. Five merge automatically, five require explicit review, -and four deleted targets retain their local branches and dependent queues. The ten -successful cases produce eighteen publications and twenty durable receipts; the -already-converged collapse defaults require confirmation without another append. -The final cold capture preserves all 304 active graph objects, ten tags, and 8,937 -explicit formatting comparisons. The `cases.json` records stable targets and the -retained/dependent outcomes used by the public test. +`offline` reconciles one page-model save per page, carrying a layout or collapse +change and a dependent text edit, against all fourteen native changes. Seven +merge automatically; seven are reviewed against the remote page and then +publish, including the four whose target the native side deleted, where the +review keeps only the dependent text. The `cases.json` records each page's +outcome, the changed object, the change and the dependent text object used by +the public test. -Regenerate by running the offline sync test -`native_moves_deletions_and_layout_changes_merge_or_retain_explicit_conflicts` -with `ONESTORE_OFFLINE_OUTLINE_OUTPUT` set to a new absolute directory, then use -the same cold runner arguments. The test also retains a JSON record next to that -directory. Cache migration, uncertain revision retention, stale review, and twelve -offline writers are exercised in `crates/onestore-offline/tests`. +Regenerate by running the sync test +`native_moves_deletions_and_layout_changes_merge_or_require_review` in +`crates/notebook/tests/sync_outline.rs` with `ONESTORE_OFFLINE_OUTLINE_OUTPUT` +set to a new absolute directory, then cold-open its `candidate` with +`--expected-pages 15 --collect-notebook`. Uncertain revision retention, stale +review and twelve offline writers are exercised in the same file. `tree` extends the native controls with eleven cases involving outline groups, indentation gaps, numbered/bulleted subtrees, and table cells. The stored graphs, @@ -136,20 +135,18 @@ unit test. Cold-open the resulting `ordinary`, `groups-cells`, `cross-container` and `unequal-groups` notebooks with expected page counts 15, 12, 12 and 1, respectively, using `tools/native_runner.py --collect-notebook`. -`offline-tree` reconciles moves/deletions and dependent text edits against the -fourteen ordinary native controls. Three already-converged moves confirm without -publication, seven competing structure/content changes require explicit review, -and four deleted targets retain the complete local branch. The cold capture -preserves all 247 active graph objects across fifteen pages, three tags, and -6,497 explicit character-format comparisons per image. Its `cases.json` records -the native input cases and outcomes. Regenerate with the offline sync test -`native_tree_and_layout_changes_reconcile_without_discarding_unreviewed_content`, -setting `ONESTORE_OFFLINE_TREE_OUTPUT` to a new absolute directory, then cold-open -its `candidate` with `--expected-pages 15 --collect-notebook`. +`offline-tree` reconciles page-model saves carrying a move or deletion and a +dependent text edit against the fourteen ordinary native controls. Seven merge +automatically and seven are reviewed against the remote page before publishing. +Its `cases.json` records the native input cases and outcomes. Regenerate with +the sync test +`native_tree_and_layout_changes_reconcile_without_discarding_unreviewed_content` +in `crates/notebook/tests/sync/tree.rs`, setting `ONESTORE_OFFLINE_TREE_OUTPUT` +to a new absolute directory, then cold-open its `candidate` with +`--expected-pages 15 --collect-notebook`. Its `cell-delete` and `cell-move` captures additionally verify local edits to an emptied cell's replacement paragraph while preserving remote text in the other -cell. They retain 272 and 274 active objects, respectively, with 8,201 and 8,377 -explicit format comparisons per image. Regenerate with the offline sync test +cell. Regenerate with the sync test `emptied_cell_replacement_is_durable_and_cannot_be_silently_omitted_on_replay`, using the same output variable; cold-open each candidate with twelve expected pages. diff --git a/corpus/outline-edit/offline-tree/candidate/synthetic.one b/corpus/outline-edit/offline-tree/candidate/synthetic.one index 685ee81cbcd88ee73564b37f6e8118bc42803213..689f3f5836818614dc526572641faa877256f75c 100644 Binary files a/corpus/outline-edit/offline-tree/candidate/synthetic.one and b/corpus/outline-edit/offline-tree/candidate/synthetic.one differ diff --git a/corpus/outline-edit/offline-tree/cases.json b/corpus/outline-edit/offline-tree/cases.json index f88e7b7ac84f4c18112867710fad315bfb7fec0b..ca92dd44b3353a57188e86e261da8a95064d6f5e 100644 --- a/corpus/outline-edit/offline-tree/cases.json +++ b/corpus/outline-edit/offline-tree/cases.json @@ -1,72 +1,58 @@ [ - { - "page": "Move leaf down", - "result": "converged", - "space": "{B7267338-BF83-0893-27A7-37F606DD20C8},1" - }, - { - "page": "Move subtree down", - "result": "converged", - "space": "{9B80D7CA-18B4-02B0-1E85-6E8AA0DAD827},1" - }, - { - "page": "Move subtree up", - "result": "converged", - "space": "{7538095C-389B-07D8-2991-B2BC46EBD52A},1" - }, - { - "page": "Indent subtree", - "result": "reviewed", - "space": "{651463E3-C768-0C93-363D-FCE642B07408},1" - }, - { - "page": "Outdent subtree", - "result": "reviewed", - "space": "{8384083C-60ED-0F7C-2F15-8B20B878B3EB},1" - }, - { - "page": "Collapse subtree", - "result": "reviewed", - "space": "{FF88B513-029C-00E2-0082-9E3DCE1D7796},1" - }, - { - "page": "Expand subtree", - "result": "reviewed", - "space": "{850B34E4-D62A-042B-138A-B2A905CEE28E},1" - }, - { - "page": "Delete leaf", - "result": "retained", - "space": "{363FE055-44E1-0B27-14A8-46278FD681FF},1" - }, - { - "page": "Delete subtree", - "result": "retained", - "space": "{8BBAD88F-D248-0959-00B3-2438A7065330},1" - }, - { - "page": "Delete only paragraph", - "result": "retained", - "space": "{A4CB3BA2-767F-0AE8-0916-AF142D995822},1" - }, - { - "page": "Delete outline", - "result": "retained", - "space": "{80E80543-87A1-0C3A-0816-22B190BDFC87},1" - }, - { - "page": "Move outline", - "result": "reviewed", - "space": "{16207F40-69C9-0CA1-09B5-DC5712DB2BBE},1" - }, - { - "page": "Resize outline", - "result": "reviewed", - "space": "{CD420421-73F7-0F11-02EC-35FCA348998C},1" - }, - { - "page": "Automatic outline size", - "result": "reviewed", - "space": "{F383096F-2121-0225-1E62-AB37C9B15B33},1" - } + [ + "Move leaf down", + "merged" + ], + [ + "Move subtree down", + "merged" + ], + [ + "Move subtree up", + "merged" + ], + [ + "Indent subtree", + "reviewed" + ], + [ + "Outdent subtree", + "reviewed" + ], + [ + "Collapse subtree", + "reviewed" + ], + [ + "Expand subtree", + "reviewed" + ], + [ + "Delete leaf", + "merged" + ], + [ + "Delete subtree", + "merged" + ], + [ + "Delete only paragraph", + "merged" + ], + [ + "Delete outline", + "merged" + ], + [ + "Move outline", + "reviewed" + ], + [ + "Resize outline", + "reviewed" + ], + [ + "Automatic outline size", + "reviewed" + ] ] \ No newline at end of file diff --git a/corpus/outline-edit/offline-tree/cell-delete/candidate/synthetic.one b/corpus/outline-edit/offline-tree/cell-delete/candidate/synthetic.one index d436dd78487631e41e1449151855924eec9debf4..8bcf1873b1dd8c53592c6ffea3b755e6db65b077 100644 Binary files a/corpus/outline-edit/offline-tree/cell-delete/candidate/synthetic.one and b/corpus/outline-edit/offline-tree/cell-delete/candidate/synthetic.one differ diff --git a/corpus/outline-edit/offline-tree/cell-delete/cold/commands.jsonl b/corpus/outline-edit/offline-tree/cell-delete/cold/commands.jsonl index 376f0fbbc073e2a0fde448f5a6d6a462e418c7e5..9c4d8dd64df91112e334f73e7bced1c227558ebb 100644 --- a/corpus/outline-edit/offline-tree/cell-delete/cold/commands.jsonl +++ b/corpus/outline-edit/offline-tree/cell-delete/cold/commands.jsonl @@ -1,3 +1,3 @@ {"command": "powershell -NoProfile -Command \"Expand-Archive -LiteralPath C:\\one-tests\\transfer.zip -DestinationPath C:\\one-tests\\runs\\capture\\notebook\"", "exit": 0, "stdout": "", "stderr": "", "error": null} -{"command": "powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -File C:\\one-tests\\read-current.ps1 -Root C:\\one-tests\\runs\\capture -CloneHost ONE-M6-37ACD671 -ExpectedPages 12", "exit": 0, "stdout": "Read 1 sections and 12 pages.\r\n", "stderr": "", "error": null} +{"command": "powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -File C:\\one-tests\\read-current.ps1 -Root C:\\one-tests\\runs\\capture -CloneHost ONE-M6-2DD749D3 -ExpectedPages 12", "exit": 0, "stdout": "Read 1 sections and 12 pages.\r\n", "stderr": "", "error": null} {"command": "powershell -NoProfile -Command \"Compress-Archive -Force -Path C:\\one-tests\\runs\\capture\\* -DestinationPath C:\\one-tests\\captured.zip\"", "exit": 0, "stdout": "", "stderr": "", "error": null} diff --git a/corpus/outline-edit/offline-tree/cell-delete/cold/machine.json b/corpus/outline-edit/offline-tree/cell-delete/cold/machine.json new file mode 100644 index 0000000000000000000000000000000000000000..d7978e2e9744c39c6b5108e6fa741cd0e3443ce3 --- /dev/null +++ b/corpus/outline-edit/offline-tree/cell-delete/cold/machine.json @@ -0,0 +1 @@ +{"name": "m6-2dd749d3", "hostname": "ONE-M6-2DD749D3"} diff --git a/corpus/outline-edit/offline-tree/cell-delete/cold/notebook/Open Notebook.onetoc2 b/corpus/outline-edit/offline-tree/cell-delete/cold/notebook/Open Notebook.onetoc2 index 6aaa8771213ea8929090e4f9321a8f42a7909acc..3a483643d614f46bd75a0c69edacec61d9ffc66a 100644 Binary files a/corpus/outline-edit/offline-tree/cell-delete/cold/notebook/Open Notebook.onetoc2 and b/corpus/outline-edit/offline-tree/cell-delete/cold/notebook/Open Notebook.onetoc2 differ diff --git a/corpus/outline-edit/offline-tree/cell-delete/cold/notebook/synthetic.one b/corpus/outline-edit/offline-tree/cell-delete/cold/notebook/synthetic.one index fbc3b6f8b77f9917bc47778188e6de47e313f390..62ce218c0fd55aae4486aa21c2b47c9cecae4c90 100644 Binary files a/corpus/outline-edit/offline-tree/cell-delete/cold/notebook/synthetic.one and b/corpus/outline-edit/offline-tree/cell-delete/cold/notebook/synthetic.one differ diff --git a/corpus/outline-edit/offline-tree/cell-delete/cold/read/environment.json b/corpus/outline-edit/offline-tree/cell-delete/cold/read/environment.json index 57f6f05726c48c3876e2a8002e33edf10ddc1bb3..7a59183cc23215e7963cde89c8fd3903d33eee7f 100644 --- a/corpus/outline-edit/offline-tree/cell-delete/cold/read/environment.json +++ b/corpus/outline-edit/offline-tree/cell-delete/cold/read/environment.json @@ -1,7 +1,7 @@ { "powershell": "5.1.14409.1005", "schema": "xs2010", - "hostname": "ONE-M6-37ACD671", + "hostname": "ONE-M6-2DD749D3", "cold": true, "onenote": "14.0.4763.1000" } diff --git a/corpus/outline-edit/offline-tree/cell-delete/cold/read/hierarchy.xml b/corpus/outline-edit/offline-tree/cell-delete/cold/read/hierarchy.xml index 377ee3f31f458c230ecc475dc8abc7066cc65779..e0681e3ed87dc612b195a04c0ab8e7133691de1d 100644 --- a/corpus/outline-edit/offline-tree/cell-delete/cold/read/hierarchy.xml +++ b/corpus/outline-edit/offline-tree/cell-delete/cold/read/hierarchy.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/outline-edit/offline-tree/cell-delete/cold/read/page-000.xml b/corpus/outline-edit/offline-tree/cell-delete/cold/read/page-000.xml index 5b596ba0cb694a935fd463c1669b51242d3bb544..7089c972bef8f828002f8698c664dae327de8993 100644 --- a/corpus/outline-edit/offline-tree/cell-delete/cold/read/page-000.xml +++ b/corpus/outline-edit/offline-tree/cell-delete/cold/read/page-000.xml @@ -1,5 +1,5 @@  -Target 🦀 é Link label]]>Child]]> +href="https://example.invalid/tree">Link label]]>Child]]> diff --git a/corpus/outline-edit/offline-tree/cell-delete/cold/read/page-001.xml b/corpus/outline-edit/offline-tree/cell-delete/cold/read/page-001.xml index ef35bd7d297ba0f0b5725c70f3a1b2e38986772e..16142d3c8999ce1c59b8e40016ce672086754fe2 100644 --- a/corpus/outline-edit/offline-tree/cell-delete/cold/read/page-001.xml +++ b/corpus/outline-edit/offline-tree/cell-delete/cold/read/page-001.xml @@ -1,5 +1,2 @@  -Target 🦀 é Link label]]>Child]]> + diff --git a/corpus/outline-edit/offline-tree/cell-delete/cold/read/page-002.xml b/corpus/outline-edit/offline-tree/cell-delete/cold/read/page-002.xml index 7e3e1a9aeeb1cfb1545433d80ed7543a98b84903..10069be629f0e2d0288e2767578fc3b28201afe6 100644 --- a/corpus/outline-edit/offline-tree/cell-delete/cold/read/page-002.xml +++ b/corpus/outline-edit/offline-tree/cell-delete/cold/read/page-002.xml @@ -1,5 +1,5 @@  -Target 🦀 é Link label]]>Child]]> +href="https://example.invalid/tree">Link label]]>Child]]> diff --git a/corpus/outline-edit/offline-tree/cell-delete/cold/read/page-003.xml b/corpus/outline-edit/offline-tree/cell-delete/cold/read/page-003.xml index 91c27de6d6060425ae6c54c035cedd9d87c4596c..0023cf4452feb4d8d231ba4e9f2cb0b125c3a43d 100644 --- a/corpus/outline-edit/offline-tree/cell-delete/cold/read/page-003.xml +++ b/corpus/outline-edit/offline-tree/cell-delete/cold/read/page-003.xml @@ -1,5 +1,4 @@  -Target 🦀 é Link label]]>Child]]> +href="https://example.invalid/tree">Link label]]> diff --git a/corpus/outline-edit/offline-tree/cell-delete/cold/read/page-004.xml b/corpus/outline-edit/offline-tree/cell-delete/cold/read/page-004.xml index e1b4293c682ad863ef826df86205f1501a380e5d..fc1c3c9240e862a836d43ef8c2e021283d6da11b 100644 --- a/corpus/outline-edit/offline-tree/cell-delete/cold/read/page-004.xml +++ b/corpus/outline-edit/offline-tree/cell-delete/cold/read/page-004.xml @@ -1,2 +1,20 @@  - +Remote Bold 🦀 italic é color 東京
+End
]]>
Fictitious: café, 東京, مرحبا]]>
diff --git a/corpus/outline-edit/offline-tree/cell-delete/cold/read/page-005.xml b/corpus/outline-edit/offline-tree/cell-delete/cold/read/page-005.xml index 28bd3aaffb53138691a0a0c0274ac6189af15863..08c1363d4c43ae322c7e5302bfbfdff1382ab49e 100644 --- a/corpus/outline-edit/offline-tree/cell-delete/cold/read/page-005.xml +++ b/corpus/outline-edit/offline-tree/cell-delete/cold/read/page-005.xml @@ -1,5 +1,5 @@  -Target 🦀 é Link label]]>Child]]> +href="https://example.invalid/tree">Link label]]>Child]]> diff --git a/corpus/outline-edit/offline-tree/cell-delete/cold/read/page-006.xml b/corpus/outline-edit/offline-tree/cell-delete/cold/read/page-006.xml index 6db2eb3af060b96524dd1cb35b0387bd43c48e84..dcd1d765468fadc9ce929a2c181c9c29969964be 100644 --- a/corpus/outline-edit/offline-tree/cell-delete/cold/read/page-006.xml +++ b/corpus/outline-edit/offline-tree/cell-delete/cold/read/page-006.xml @@ -1,20 +1,5 @@  -Bold 🦀 italic é color 東京
-End
]]>
Fictitious: café, 東京, مرحبا]]>
+Target 🦀 é Link label]]>Child]]> diff --git a/corpus/outline-edit/offline-tree/cell-delete/cold/read/page-007.xml b/corpus/outline-edit/offline-tree/cell-delete/cold/read/page-007.xml index 7ff4c27aa74a5bc66687b4fd112675d297eefdcf..93bd49d4e9b493b5213a54b213c73d4de46be8d1 100644 --- a/corpus/outline-edit/offline-tree/cell-delete/cold/read/page-007.xml +++ b/corpus/outline-edit/offline-tree/cell-delete/cold/read/page-007.xml @@ -1,4 +1,5 @@  -Target 🦀 é Link label]]> +href="https://example.invalid/tree">Link label]]>Child]]> diff --git a/corpus/outline-edit/offline-tree/cell-delete/cold/read/page-008.xml b/corpus/outline-edit/offline-tree/cell-delete/cold/read/page-008.xml index d1192626314920b26ae68505cab85dc39ca6999c..51f8cb62c954d230e4aa9eb8c77cb42accafd294 100644 --- a/corpus/outline-edit/offline-tree/cell-delete/cold/read/page-008.xml +++ b/corpus/outline-edit/offline-tree/cell-delete/cold/read/page-008.xml @@ -1,5 +1,5 @@  -Target 🦀 é Link label]]>Child]]> +href="https://example.invalid/tree">Link label]]>Child]]> diff --git a/corpus/outline-edit/offline-tree/cell-delete/cold/read/page-009.xml b/corpus/outline-edit/offline-tree/cell-delete/cold/read/page-009.xml index 2efd5ef0591f702be1709aa514214ac97c956bd3..aba9e374db66652229d59eea4cce68d956991dcc 100644 --- a/corpus/outline-edit/offline-tree/cell-delete/cold/read/page-009.xml +++ b/corpus/outline-edit/offline-tree/cell-delete/cold/read/page-009.xml @@ -1,5 +1,5 @@  -Target 🦀 é Link label]]>Child]]> +href="https://example.invalid/tree">Link label]]>Child]]> diff --git a/corpus/outline-edit/offline-tree/cell-delete/cold/read/page-010.xml b/corpus/outline-edit/offline-tree/cell-delete/cold/read/page-010.xml index e66be2846ed280e83f5b57fbe02750ddababbac6..440e7e6b83f72561c2f4db05ac60b72b4e6aaa83 100644 --- a/corpus/outline-edit/offline-tree/cell-delete/cold/read/page-010.xml +++ b/corpus/outline-edit/offline-tree/cell-delete/cold/read/page-010.xml @@ -1,5 +1,5 @@  -Target 🦀 é Link label]]>Child]]> +href="https://example.invalid/tree">Link label]]>Child]]> diff --git a/corpus/outline-edit/offline-tree/cell-delete/cold/read/page-011.xml b/corpus/outline-edit/offline-tree/cell-delete/cold/read/page-011.xml index 174806a0ca3f05c5e56ed253b2a1a9fd485c2943..bccba0f5519f724cab9c11eec54f5a879ea847be 100644 --- a/corpus/outline-edit/offline-tree/cell-delete/cold/read/page-011.xml +++ b/corpus/outline-edit/offline-tree/cell-delete/cold/read/page-011.xml @@ -1,5 +1,5 @@  -Target 🦀 é Link label]]>Child]]> +href="https://example.invalid/tree">Link label]]>Child]]> diff --git a/corpus/outline-edit/offline-tree/cell-delete/cold/read/payloads.json b/corpus/outline-edit/offline-tree/cell-delete/cold/read/payloads.json deleted file mode 120000 index 28e766c3d4f4499afc8ee14682bf4467ff3087cd..0000000000000000000000000000000000000000 --- a/corpus/outline-edit/offline-tree/cell-delete/cold/read/payloads.json +++ /dev/null @@ -1 +0,0 @@ -../../../../../paragraph-edit/before/read/payloads.json \ No newline at end of file diff --git a/corpus/outline-edit/offline-tree/cell-delete/cold/read/payloads.json b/corpus/outline-edit/offline-tree/cell-delete/cold/read/payloads.json new file mode 100644 index 0000000000000000000000000000000000000000..1ce91a413d6fff4d58765187b76756f0e97ae843 --- /dev/null +++ b/corpus/outline-edit/offline-tree/cell-delete/cold/read/payloads.json @@ -0,0 +1,3 @@ +[ + +] \ No newline at end of file diff --git a/corpus/outline-edit/offline-tree/cell-delete/cold/run.json b/corpus/outline-edit/offline-tree/cell-delete/cold/run.json index 94b34a8c1b76c8573dd004991339daef6ad62693..906c2f1e724746a1726099767cd41588ba1b0ce5 100644 --- a/corpus/outline-edit/offline-tree/cell-delete/cold/run.json +++ b/corpus/outline-edit/offline-tree/cell-delete/cold/run.json @@ -1,5 +1,5 @@ { - "notebook": "/Users/clo/dev/one/evidence/m10/offline-tree-native-01/cell-delete/candidate", + "notebook": "/private/tmp/m33/offline-tree/cell-delete/candidate", "expected_pages": 12, "author": null, "author_timeout_seconds": 600, diff --git a/corpus/outline-edit/offline-tree/cell-delete/cold/scripts/cold.ps1 b/corpus/outline-edit/offline-tree/cell-delete/cold/scripts/cold.ps1 deleted file mode 120000 index 9b4c65b63ddad6e65d7acb85fb7d0accbb23d030..0000000000000000000000000000000000000000 --- a/corpus/outline-edit/offline-tree/cell-delete/cold/scripts/cold.ps1 +++ /dev/null @@ -1 +0,0 @@ -../../../../../paragraph-edit/reconciliation/keyboard/scripts/cold.ps1 \ No newline at end of file diff --git a/corpus/outline-edit/offline-tree/cell-delete/cold/scripts/cold.ps1 b/corpus/outline-edit/offline-tree/cell-delete/cold/scripts/cold.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..a0b99e7aeb86f4dc10032537800501a52ad65b4f --- /dev/null +++ b/corpus/outline-edit/offline-tree/cell-delete/cold/scripts/cold.ps1 @@ -0,0 +1,27 @@ +param([Parameter(Mandatory=$true)][string]$Root, [string]$CloneHost = '') +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' +$root = [IO.Path]::GetFullPath($Root).TrimEnd('\') +if ([IO.Path]::GetDirectoryName($root) -ne 'C:\one-tests\runs') { + throw 'Choose a run directly below C:\one-tests\runs.' +} +if (Get-Process ONENOTE -ErrorAction SilentlyContinue) { throw 'Close OneNote before resetting its test cache.' } +$key = 'HKCU:\Software\Microsoft\Office\14.0\OneNote' +if ($CloneHost) { + if ($CloneHost -notmatch '^ONE-[A-Z0-9-]+$' -or [Environment]::MachineName -ne $CloneHost) { + throw 'The disposable clone hostname does not match this machine.' + } + New-Item "$key\Options\Paths" -Force | Out-Null + New-ItemProperty "$key\Options\Paths" -Name UnfiledNotesSection -PropertyType ExpandString -Value 'C:\one-tests\Loose.one' -Force | Out-Null +} elseif ((Get-ItemProperty "$key\Options\Paths").UnfiledNotesSection -ne 'C:\one-tests\Loose.one' -or + -not (Test-Path 'C:\one-tests\profile-original-cache')) { + throw 'Park the personal OneNote profile before resetting the test cache.' +} +$cache = Join-Path $env:LOCALAPPDATA 'Microsoft\OneNote\14.0' +$parked = Join-Path 'C:\one-tests\caches' ([IO.Path]::GetFileName($root)) +if (Test-Path $parked) { throw 'Choose a new run; its parked cache already exists.' } +New-Item -ItemType Directory -Path 'C:\one-tests\caches' -Force | Out-Null +if (Test-Path $cache) { Move-Item -LiteralPath $cache -Destination $parked } +if (Test-Path "$key\OpenNotebooks") { Remove-Item "$key\OpenNotebooks" -Recurse } +New-Item "$key\OpenNotebooks" | Out-Null +New-ItemProperty "$key\OpenNotebooks" -Name '1' -PropertyType String -Value "$root\notebook" | Out-Null diff --git a/corpus/outline-edit/offline-tree/cell-delete/cold/scripts/read.ps1 b/corpus/outline-edit/offline-tree/cell-delete/cold/scripts/read.ps1 deleted file mode 120000 index 113263f9c23ecc3cafa21407510de560fdc964a8..0000000000000000000000000000000000000000 --- a/corpus/outline-edit/offline-tree/cell-delete/cold/scripts/read.ps1 +++ /dev/null @@ -1 +0,0 @@ -../../../../../paragraph-edit/reconciliation/keyboard/scripts/read.ps1 \ No newline at end of file diff --git a/corpus/outline-edit/offline-tree/cell-delete/cold/scripts/read.ps1 b/corpus/outline-edit/offline-tree/cell-delete/cold/scripts/read.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..476094ab1e0c47077988a6461db2080cf208642b --- /dev/null +++ b/corpus/outline-edit/offline-tree/cell-delete/cold/scripts/read.ps1 @@ -0,0 +1,142 @@ +param( + [Parameter(Mandatory=$true)][string]$Root, + [int]$ExpectedPages = -1, + [switch]$UseCurrentCache, + [switch]$Pdf, + [switch]$KeepOpen, + [string]$CloneHost = '' +) +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' +$root = [IO.Path]::GetFullPath($Root).TrimEnd('\') +if ([IO.Path]::GetDirectoryName($root) -ne 'C:\one-tests\runs') { + throw 'Choose a run directly below C:\one-tests\runs.' +} +$notebook = Join-Path $root 'notebook' +$output = Join-Path $root 'read' +if (Test-Path $output) { throw 'Choose a new read destination.' } +if ($UseCurrentCache) { + if ((Get-ItemProperty 'HKCU:\Software\Microsoft\Office\14.0\OneNote\Options\Paths').UnfiledNotesSection -ne 'C:\one-tests\Loose.one') { + throw 'Park the personal OneNote profile before reading test notebooks.' + } +} else { + & "$PSScriptRoot\cold-current.ps1" -Root $root -CloneHost $CloneHost +} +New-Item -ItemType Directory -Path $output | Out-Null +$app = New-Object -ComObject OneNote.Application +$notebookId = '' +$failure = $null +try { + $app.OpenHierarchy($notebook, '', [ref]$notebookId, 0) + $process = Get-Process ONENOTE + @{ hostname = [Environment]::MachineName; onenote = $process.MainModule.FileVersionInfo.FileVersion; + powershell = $PSVersionTable.PSVersion.ToString(); schema = 'xs2010'; cold = (-not $UseCurrentCache.IsPresent) } | + ConvertTo-Json | Set-Content (Join-Path $output 'environment.json') -Encoding UTF8 + $sections = @() + foreach ($file in @(Get-ChildItem $notebook -Recurse | Where-Object { $_.Extension -eq '.one' })) { + $id = '' + $app.OpenHierarchy($file.FullName, '', [ref]$id, 0) + $sections += $id + } + $deadline = [DateTime]::UtcNow.AddSeconds(300) + $previous = '' + $lastChange = '' + $stableSince = [DateTime]::UtcNow + $settled = $false + do { + $pages = @{} + foreach ($section in $sections) { + $hierarchy = '' + $app.GetHierarchy($section, 4, [ref]$hierarchy, 1) + [xml]$xml = $hierarchy + foreach ($node in $xml.SelectNodes('//*[@path]')) { + if (-not $node.GetAttribute('path').StartsWith("$notebook\", [StringComparison]::OrdinalIgnoreCase)) { + throw 'OneNote opened a section outside the copied notebook.' + } + } + foreach ($node in $xml.SelectNodes('//*[local-name()="Page"]')) { + $id = $node.GetAttribute('ID') + $content = '' + $app.GetPageContent($id, [ref]$content, 1, 1) + $pages[$id] = $content + } + } + $signature = [String]::Join('|', @($pages.Keys | Sort-Object | ForEach-Object { $_ + $pages[$_] })) + if ($signature -ne $previous) { + $lastChange = $previous + $previous = $signature + $stableSince = [DateTime]::UtcNow + } + if ((($ExpectedPages -ge 0 -and $pages.Count -eq $ExpectedPages) -or + ($ExpectedPages -lt 0 -and $pages.Count -gt 0)) -and + ([DateTime]::UtcNow - $stableSince).TotalSeconds -ge 2) { $settled = $true; break } + Start-Sleep -Milliseconds 250 + } while ([DateTime]::UtcNow -lt $deadline) + if (-not $settled -or ($ExpectedPages -ge 0 -and $pages.Count -ne $ExpectedPages) -or ($ExpectedPages -lt 0 -and $pages.Count -eq 0)) { + [IO.File]::WriteAllText((Join-Path $output 'previous-signature.txt'), $lastChange, [Text.Encoding]::UTF8) + $index = 0 + foreach ($id in @($pages.Keys | Sort-Object)) { + [IO.File]::WriteAllText((Join-Path $output ('unsettled-{0:d3}.xml' -f $index)), $pages[$id], [Text.Encoding]::UTF8) + $index++ + } + $hierarchy = '' + $app.GetHierarchy($notebookId, 4, [ref]$hierarchy, 1) + [IO.File]::WriteAllText((Join-Path $output 'unsettled-hierarchy.xml'), $hierarchy, [Text.Encoding]::UTF8) + throw "Expected $ExpectedPages stable pages; OneNote returned $($pages.Count), settled=$settled." + } + $index = 0 + $payloads = @() + foreach ($id in @($pages.Keys | Sort-Object)) { + [IO.File]::WriteAllText((Join-Path $output ('page-{0:d3}.xml' -f $index)), $pages[$id], [Text.Encoding]::UTF8) + if ($Pdf) { + $pdfPath = Join-Path $output ('page-{0:d3}.pdf' -f $index) + $app.NavigateTo($id, '', $false) + $app.Publish($id, $pdfPath, 3, '') + if (-not (Test-Path $pdfPath) -or (Get-Item $pdfPath).Length -eq 0) { throw 'OneNote did not publish the page PDF.' } + } + [xml]$page = $pages[$id] + foreach ($file in $page.SelectNodes('//*[local-name()="InsertedFile" or local-name()="MediaFile"]')) { + $bytes = [IO.File]::ReadAllBytes($file.GetAttribute('pathCache')) + $hash = [BitConverter]::ToString([Security.Cryptography.SHA256]::Create().ComputeHash($bytes)).Replace('-', '').ToLowerInvariant() + [IO.File]::WriteAllBytes((Join-Path $output ($hash + '.attachment')), $bytes) + $payloads += @{ page = $id; object = $file.ParentNode.GetAttribute('objectID'); + kind = $file.LocalName; name = $file.GetAttribute('preferredName'); + sha256 = $hash; bytes = $bytes.Length } + } + $index++ + } + [IO.File]::WriteAllText((Join-Path $output 'payloads.json'), (ConvertTo-Json -InputObject $payloads -Depth 4), [Text.Encoding]::UTF8) + $all = '' + $app.GetHierarchy($notebookId, 4, [ref]$all, 1) + [xml]$finalTree = $all + $finalIds = @($finalTree.SelectNodes('//*[local-name()="Page"]') | ForEach-Object { $_.GetAttribute('ID') } | Sort-Object -Unique) + if ($finalIds.Count -ne $pages.Count -or @($finalIds | Where-Object { -not $pages.ContainsKey($_) }).Count -ne 0) { + throw 'The notebook hierarchy changed while collecting page evidence; repeat the cold read.' + } + [IO.File]::WriteAllText((Join-Path $output 'hierarchy.xml'), $all, [Text.Encoding]::UTF8) + Write-Output "Read $($sections.Count) sections and $($pages.Count) pages." +} catch { + $failure = $_ + [IO.File]::WriteAllText((Join-Path $output 'failure.txt'), ($_ | Out-String), [Text.Encoding]::UTF8) + throw +} finally { + try { + try { + if ($notebookId -and $CloneHost) { $app.SyncHierarchy($notebookId) } + if ($notebookId -and -not $KeepOpen -and (-not $UseCurrentCache -or $CloneHost)) { + $app.CloseNotebook($notebookId, $false) + } + } catch { + if ($null -eq $failure) { throw } + [IO.File]::WriteAllText((Join-Path $output 'cleanup-failure.txt'), ($_ | Out-String), [Text.Encoding]::UTF8) + } + } finally { + [void][Runtime.InteropServices.Marshal]::FinalReleaseComObject($app) + } + $app = $null + [GC]::Collect() + [GC]::WaitForPendingFinalizers() + if (-not $UseCurrentCache -and -not $CloneHost) { + Get-Process ONENOTE -ErrorAction SilentlyContinue | Wait-Process -Timeout 10 + } +} diff --git a/corpus/outline-edit/offline-tree/cell-delete/cold/source.json b/corpus/outline-edit/offline-tree/cell-delete/cold/source.json index 7baa2ca5d5742c75adb26f380f51d8279111a589..aec94489351f7ca638104b53bcce2f397a77b061 100644 --- a/corpus/outline-edit/offline-tree/cell-delete/cold/source.json +++ b/corpus/outline-edit/offline-tree/cell-delete/cold/source.json @@ -1,8 +1,8 @@ [ { "path": "synthetic.one", - "bytes": 88240, - "sha256": "963f5c960c690ff21451787f2a0028573cdc3ce4edeb887a8ed115997fcda194", - "mtime_ns": 1788901194571318513 + "bytes": 90624, + "sha256": "b3d8165c630cfad9d3b0f006f635eb238f6a3fea184872ff7ec25b65849798a2", + "mtime_ns": 1789121632667264018 } ] diff --git a/corpus/outline-edit/offline-tree/cell-delete/cold/teardown.json b/corpus/outline-edit/offline-tree/cell-delete/cold/teardown.json deleted file mode 120000 index f87f229e17cdf751396fcf149ad2624727a29624..0000000000000000000000000000000000000000 --- a/corpus/outline-edit/offline-tree/cell-delete/cold/teardown.json +++ /dev/null @@ -1 +0,0 @@ -../../../offline/cold/teardown.json \ No newline at end of file diff --git a/corpus/outline-edit/offline-tree/cell-delete/cold/teardown.json b/corpus/outline-edit/offline-tree/cell-delete/cold/teardown.json new file mode 100644 index 0000000000000000000000000000000000000000..05a47793de40f322e745c4c4183727e3590ecf70 --- /dev/null +++ b/corpus/outline-edit/offline-tree/cell-delete/cold/teardown.json @@ -0,0 +1 @@ +{"absent": true} diff --git a/corpus/outline-edit/offline-tree/cell-move/candidate/synthetic.one b/corpus/outline-edit/offline-tree/cell-move/candidate/synthetic.one index a803314f1105069601bb012294d0722b18e1b10d..3d7d8577b14f6905f9075b3bc9672bd462ee92e1 100644 Binary files a/corpus/outline-edit/offline-tree/cell-move/candidate/synthetic.one and b/corpus/outline-edit/offline-tree/cell-move/candidate/synthetic.one differ diff --git a/corpus/outline-edit/offline-tree/cell-move/cold/commands.jsonl b/corpus/outline-edit/offline-tree/cell-move/cold/commands.jsonl index 81ecca46b8bb05edac92ed89d4e159e008835478..a816cec5cc0bac279074ef9d251a5ad905cd5652 100644 --- a/corpus/outline-edit/offline-tree/cell-move/cold/commands.jsonl +++ b/corpus/outline-edit/offline-tree/cell-move/cold/commands.jsonl @@ -1,3 +1,3 @@ {"command": "powershell -NoProfile -Command \"Expand-Archive -LiteralPath C:\\one-tests\\transfer.zip -DestinationPath C:\\one-tests\\runs\\capture\\notebook\"", "exit": 0, "stdout": "", "stderr": "", "error": null} -{"command": "powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -File C:\\one-tests\\read-current.ps1 -Root C:\\one-tests\\runs\\capture -CloneHost ONE-M6-B3E79CAE -ExpectedPages 12", "exit": 0, "stdout": "Read 1 sections and 12 pages.\r\n", "stderr": "", "error": null} +{"command": "powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -File C:\\one-tests\\read-current.ps1 -Root C:\\one-tests\\runs\\capture -CloneHost ONE-M6-5256934C -ExpectedPages 12", "exit": 0, "stdout": "Read 1 sections and 12 pages.\r\n", "stderr": "", "error": null} {"command": "powershell -NoProfile -Command \"Compress-Archive -Force -Path C:\\one-tests\\runs\\capture\\* -DestinationPath C:\\one-tests\\captured.zip\"", "exit": 0, "stdout": "", "stderr": "", "error": null} diff --git a/corpus/outline-edit/offline-tree/cell-move/cold/machine.json b/corpus/outline-edit/offline-tree/cell-move/cold/machine.json new file mode 100644 index 0000000000000000000000000000000000000000..f80e25e1951439f6de88f6b8606812633059b400 --- /dev/null +++ b/corpus/outline-edit/offline-tree/cell-move/cold/machine.json @@ -0,0 +1 @@ +{"name": "m6-5256934c", "hostname": "ONE-M6-5256934C"} diff --git a/corpus/outline-edit/offline-tree/cell-move/cold/notebook/Open Notebook.onetoc2 b/corpus/outline-edit/offline-tree/cell-move/cold/notebook/Open Notebook.onetoc2 index ea8defc64e1d250d13f34869bf8c6a720fd221e1..df2d99c0c1b17001e668cbcb0c3620643a661ac7 100644 Binary files a/corpus/outline-edit/offline-tree/cell-move/cold/notebook/Open Notebook.onetoc2 and b/corpus/outline-edit/offline-tree/cell-move/cold/notebook/Open Notebook.onetoc2 differ diff --git a/corpus/outline-edit/offline-tree/cell-move/cold/notebook/synthetic.one b/corpus/outline-edit/offline-tree/cell-move/cold/notebook/synthetic.one index 5225bc6a0238f882b6df42b82c798290144f4901..3d99921c23258433b24f5a0c6e64c1f8f3bbad73 100644 Binary files a/corpus/outline-edit/offline-tree/cell-move/cold/notebook/synthetic.one and b/corpus/outline-edit/offline-tree/cell-move/cold/notebook/synthetic.one differ diff --git a/corpus/outline-edit/offline-tree/cell-move/cold/read/environment.json b/corpus/outline-edit/offline-tree/cell-move/cold/read/environment.json index 5f9e3bff82977d360ee0e0c0fe8be18ce8df7562..5ece2a67e6903de3d1f1c1a9fd0fcfe71c4f7562 100644 --- a/corpus/outline-edit/offline-tree/cell-move/cold/read/environment.json +++ b/corpus/outline-edit/offline-tree/cell-move/cold/read/environment.json @@ -1,7 +1,7 @@ { "powershell": "5.1.14409.1005", "schema": "xs2010", - "hostname": "ONE-M6-B3E79CAE", + "hostname": "ONE-M6-5256934C", "cold": true, "onenote": "14.0.4763.1000" } diff --git a/corpus/outline-edit/offline-tree/cell-move/cold/read/hierarchy.xml b/corpus/outline-edit/offline-tree/cell-move/cold/read/hierarchy.xml index b1ec5d7d4a92fcdadbcefffbe6a3d93a9ac9470a..e552448190eecd3cbcaddcc5acc396360966e492 100644 --- a/corpus/outline-edit/offline-tree/cell-move/cold/read/hierarchy.xml +++ b/corpus/outline-edit/offline-tree/cell-move/cold/read/hierarchy.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/outline-edit/offline-tree/cell-move/cold/read/page-000.xml b/corpus/outline-edit/offline-tree/cell-move/cold/read/page-000.xml index 38a5fe2bc583842c23c5f3c5d06c4fdb7498fca2..669c3d7b071abbe2588e1663bb7ef93e4fdfb219 100644 --- a/corpus/outline-edit/offline-tree/cell-move/cold/read/page-000.xml +++ b/corpus/outline-edit/offline-tree/cell-move/cold/read/page-000.xml @@ -1,5 +1,5 @@  -Target 🦀 é Link label]]>Child]]> +href="https://example.invalid/tree">Link label]]>Child]]> diff --git a/corpus/outline-edit/offline-tree/cell-move/cold/read/page-001.xml b/corpus/outline-edit/offline-tree/cell-move/cold/read/page-001.xml index 7c7868edb0e5ad2e0da9c32d46da4a5c71dab36c..fbe1870f159a3879221fe816dcaa6318f772ceaa 100644 --- a/corpus/outline-edit/offline-tree/cell-move/cold/read/page-001.xml +++ b/corpus/outline-edit/offline-tree/cell-move/cold/read/page-001.xml @@ -1,5 +1,5 @@  -Target 🦀 é Link label]]>Child]]> +href="https://example.invalid/tree">Link label]]>Child]]> diff --git a/corpus/outline-edit/offline-tree/cell-move/cold/read/page-002.xml b/corpus/outline-edit/offline-tree/cell-move/cold/read/page-002.xml index d87dec3e9ec72b23d1da613f0bc6ac5d7d8a4741..3048c2ad9d17923787a43841ec881e49dad52342 100644 --- a/corpus/outline-edit/offline-tree/cell-move/cold/read/page-002.xml +++ b/corpus/outline-edit/offline-tree/cell-move/cold/read/page-002.xml @@ -1,5 +1,5 @@  -Target 🦀 é Link label]]>Child]]> +href="https://example.invalid/tree">Link label]]>Child]]> diff --git a/corpus/outline-edit/offline-tree/cell-move/cold/read/page-003.xml b/corpus/outline-edit/offline-tree/cell-move/cold/read/page-003.xml index 61258b17bd3b4696470e45fd15b2238e85102c8c..522193219efe9fd3dde49aac1400c9e9810d0a48 100644 --- a/corpus/outline-edit/offline-tree/cell-move/cold/read/page-003.xml +++ b/corpus/outline-edit/offline-tree/cell-move/cold/read/page-003.xml @@ -1,5 +1,5 @@  -Target 🦀 é Link label]]>Child]]> +href="https://example.invalid/tree">Link label]]>Child]]> diff --git a/corpus/outline-edit/offline-tree/cell-move/cold/read/page-004.xml b/corpus/outline-edit/offline-tree/cell-move/cold/read/page-004.xml index 77144bad3020ab4aea23da62a3a7fb2bf2442ec4..5e809637f201f44628d7947bd72076c93d63fa35 100644 --- a/corpus/outline-edit/offline-tree/cell-move/cold/read/page-004.xml +++ b/corpus/outline-edit/offline-tree/cell-move/cold/read/page-004.xml @@ -1,20 +1,5 @@  -Bold 🦀 italic é color 東京
-End
]]>
Fictitious: café, 東京, مرحبا]]>
+Target 🦀 é Link label]]>Child]]> diff --git a/corpus/outline-edit/offline-tree/cell-move/cold/read/page-005.xml b/corpus/outline-edit/offline-tree/cell-move/cold/read/page-005.xml index d6691b8df4f4c92c62bd3dc9ca08b5399205b54e..baf398626d234d8ada01d3532b34a1e65069f604 100644 --- a/corpus/outline-edit/offline-tree/cell-move/cold/read/page-005.xml +++ b/corpus/outline-edit/offline-tree/cell-move/cold/read/page-005.xml @@ -1,4 +1,5 @@  -Target 🦀 é Link label]]> +href="https://example.invalid/tree">Link label]]>Child]]> diff --git a/corpus/outline-edit/offline-tree/cell-move/cold/read/page-006.xml b/corpus/outline-edit/offline-tree/cell-move/cold/read/page-006.xml index dc9c3f123f7066f05b7badef1177ef90c5866da5..f859e5cf233ca2e11ee91e3928cf0687d237efba 100644 --- a/corpus/outline-edit/offline-tree/cell-move/cold/read/page-006.xml +++ b/corpus/outline-edit/offline-tree/cell-move/cold/read/page-006.xml @@ -1,5 +1,5 @@  -Target 🦀 é Link label]]>Child]]> +href="https://example.invalid/tree">Link label]]>Child]]> diff --git a/corpus/outline-edit/offline-tree/cell-move/cold/read/page-007.xml b/corpus/outline-edit/offline-tree/cell-move/cold/read/page-007.xml index 2043c5c8487baf35d348cc326f6cd4f6150c0ba1..dbe6b63db1ea169f9c086fc5179dd95c60494c62 100644 --- a/corpus/outline-edit/offline-tree/cell-move/cold/read/page-007.xml +++ b/corpus/outline-edit/offline-tree/cell-move/cold/read/page-007.xml @@ -1,4 +1,5 @@  -Target 🦀 é Link label]]> +href="https://example.invalid/tree">Link label]]>Child]]> diff --git a/corpus/outline-edit/offline-tree/cell-move/cold/read/page-008.xml b/corpus/outline-edit/offline-tree/cell-move/cold/read/page-008.xml index 815993c199fc421ebf87eb5d7d4ae31ecbbef2bb..de5d7ab417cedc1f28d6117dedb291b810082021 100644 --- a/corpus/outline-edit/offline-tree/cell-move/cold/read/page-008.xml +++ b/corpus/outline-edit/offline-tree/cell-move/cold/read/page-008.xml @@ -1,5 +1,4 @@  -Target 🦀 é Link label]]>Child]]> +href="https://example.invalid/tree">Link label]]> diff --git a/corpus/outline-edit/offline-tree/cell-move/cold/read/page-009.xml b/corpus/outline-edit/offline-tree/cell-move/cold/read/page-009.xml index 53301e198094d41179ff16c32690f920984e389a..0bdd1b35c308c32fd1db27d7435de61ddca15f1a 100644 --- a/corpus/outline-edit/offline-tree/cell-move/cold/read/page-009.xml +++ b/corpus/outline-edit/offline-tree/cell-move/cold/read/page-009.xml @@ -1,5 +1,5 @@  -Target 🦀 é Link label]]>Child]]> +href="https://example.invalid/tree">Link label]]>Child]]> diff --git a/corpus/outline-edit/offline-tree/cell-move/cold/read/page-010.xml b/corpus/outline-edit/offline-tree/cell-move/cold/read/page-010.xml index 8d83e900f90dc4d3d4673b33832070e3b1f88f54..05c842aa60d43b935062abd7ef4c121e8c7812a4 100644 --- a/corpus/outline-edit/offline-tree/cell-move/cold/read/page-010.xml +++ b/corpus/outline-edit/offline-tree/cell-move/cold/read/page-010.xml @@ -1,5 +1,4 @@  -Target 🦀 é Link label]]>Child]]> +href="https://example.invalid/tree">Link label]]> diff --git a/corpus/outline-edit/offline-tree/cell-move/cold/read/page-011.xml b/corpus/outline-edit/offline-tree/cell-move/cold/read/page-011.xml index 2a31def0593f8b0ea52c4f12eb9b9c2fcd79f512..e6660882bad56ac8b91bd32a040a2e5f15857900 100644 --- a/corpus/outline-edit/offline-tree/cell-move/cold/read/page-011.xml +++ b/corpus/outline-edit/offline-tree/cell-move/cold/read/page-011.xml @@ -1,5 +1,20 @@  -Target 🦀 é Link label]]>Child]]> +Remote Bold 🦀 italic é color 東京
+End
]]>
Fictitious: café, 東京, مرحبا]]>
diff --git a/corpus/outline-edit/offline-tree/cell-move/cold/read/payloads.json b/corpus/outline-edit/offline-tree/cell-move/cold/read/payloads.json deleted file mode 120000 index 28e766c3d4f4499afc8ee14682bf4467ff3087cd..0000000000000000000000000000000000000000 --- a/corpus/outline-edit/offline-tree/cell-move/cold/read/payloads.json +++ /dev/null @@ -1 +0,0 @@ -../../../../../paragraph-edit/before/read/payloads.json \ No newline at end of file diff --git a/corpus/outline-edit/offline-tree/cell-move/cold/read/payloads.json b/corpus/outline-edit/offline-tree/cell-move/cold/read/payloads.json new file mode 100644 index 0000000000000000000000000000000000000000..1ce91a413d6fff4d58765187b76756f0e97ae843 --- /dev/null +++ b/corpus/outline-edit/offline-tree/cell-move/cold/read/payloads.json @@ -0,0 +1,3 @@ +[ + +] \ No newline at end of file diff --git a/corpus/outline-edit/offline-tree/cell-move/cold/run.json b/corpus/outline-edit/offline-tree/cell-move/cold/run.json index 90033d1c9018364ba72c03d6e54278b7b2e33c12..12e8f8abf1ebc51f926d56cb7f3bead203707ad8 100644 --- a/corpus/outline-edit/offline-tree/cell-move/cold/run.json +++ b/corpus/outline-edit/offline-tree/cell-move/cold/run.json @@ -1,5 +1,5 @@ { - "notebook": "/Users/clo/dev/one/evidence/m10/offline-tree-native-01/cell-move/candidate", + "notebook": "/private/tmp/m33/offline-tree/cell-move/candidate", "expected_pages": 12, "author": null, "author_timeout_seconds": 600, diff --git a/corpus/outline-edit/offline-tree/cell-move/cold/scripts/cold.ps1 b/corpus/outline-edit/offline-tree/cell-move/cold/scripts/cold.ps1 deleted file mode 120000 index 9b4c65b63ddad6e65d7acb85fb7d0accbb23d030..0000000000000000000000000000000000000000 --- a/corpus/outline-edit/offline-tree/cell-move/cold/scripts/cold.ps1 +++ /dev/null @@ -1 +0,0 @@ -../../../../../paragraph-edit/reconciliation/keyboard/scripts/cold.ps1 \ No newline at end of file diff --git a/corpus/outline-edit/offline-tree/cell-move/cold/scripts/cold.ps1 b/corpus/outline-edit/offline-tree/cell-move/cold/scripts/cold.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..a0b99e7aeb86f4dc10032537800501a52ad65b4f --- /dev/null +++ b/corpus/outline-edit/offline-tree/cell-move/cold/scripts/cold.ps1 @@ -0,0 +1,27 @@ +param([Parameter(Mandatory=$true)][string]$Root, [string]$CloneHost = '') +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' +$root = [IO.Path]::GetFullPath($Root).TrimEnd('\') +if ([IO.Path]::GetDirectoryName($root) -ne 'C:\one-tests\runs') { + throw 'Choose a run directly below C:\one-tests\runs.' +} +if (Get-Process ONENOTE -ErrorAction SilentlyContinue) { throw 'Close OneNote before resetting its test cache.' } +$key = 'HKCU:\Software\Microsoft\Office\14.0\OneNote' +if ($CloneHost) { + if ($CloneHost -notmatch '^ONE-[A-Z0-9-]+$' -or [Environment]::MachineName -ne $CloneHost) { + throw 'The disposable clone hostname does not match this machine.' + } + New-Item "$key\Options\Paths" -Force | Out-Null + New-ItemProperty "$key\Options\Paths" -Name UnfiledNotesSection -PropertyType ExpandString -Value 'C:\one-tests\Loose.one' -Force | Out-Null +} elseif ((Get-ItemProperty "$key\Options\Paths").UnfiledNotesSection -ne 'C:\one-tests\Loose.one' -or + -not (Test-Path 'C:\one-tests\profile-original-cache')) { + throw 'Park the personal OneNote profile before resetting the test cache.' +} +$cache = Join-Path $env:LOCALAPPDATA 'Microsoft\OneNote\14.0' +$parked = Join-Path 'C:\one-tests\caches' ([IO.Path]::GetFileName($root)) +if (Test-Path $parked) { throw 'Choose a new run; its parked cache already exists.' } +New-Item -ItemType Directory -Path 'C:\one-tests\caches' -Force | Out-Null +if (Test-Path $cache) { Move-Item -LiteralPath $cache -Destination $parked } +if (Test-Path "$key\OpenNotebooks") { Remove-Item "$key\OpenNotebooks" -Recurse } +New-Item "$key\OpenNotebooks" | Out-Null +New-ItemProperty "$key\OpenNotebooks" -Name '1' -PropertyType String -Value "$root\notebook" | Out-Null diff --git a/corpus/outline-edit/offline-tree/cell-move/cold/scripts/read.ps1 b/corpus/outline-edit/offline-tree/cell-move/cold/scripts/read.ps1 deleted file mode 120000 index 113263f9c23ecc3cafa21407510de560fdc964a8..0000000000000000000000000000000000000000 --- a/corpus/outline-edit/offline-tree/cell-move/cold/scripts/read.ps1 +++ /dev/null @@ -1 +0,0 @@ -../../../../../paragraph-edit/reconciliation/keyboard/scripts/read.ps1 \ No newline at end of file diff --git a/corpus/outline-edit/offline-tree/cell-move/cold/scripts/read.ps1 b/corpus/outline-edit/offline-tree/cell-move/cold/scripts/read.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..476094ab1e0c47077988a6461db2080cf208642b --- /dev/null +++ b/corpus/outline-edit/offline-tree/cell-move/cold/scripts/read.ps1 @@ -0,0 +1,142 @@ +param( + [Parameter(Mandatory=$true)][string]$Root, + [int]$ExpectedPages = -1, + [switch]$UseCurrentCache, + [switch]$Pdf, + [switch]$KeepOpen, + [string]$CloneHost = '' +) +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' +$root = [IO.Path]::GetFullPath($Root).TrimEnd('\') +if ([IO.Path]::GetDirectoryName($root) -ne 'C:\one-tests\runs') { + throw 'Choose a run directly below C:\one-tests\runs.' +} +$notebook = Join-Path $root 'notebook' +$output = Join-Path $root 'read' +if (Test-Path $output) { throw 'Choose a new read destination.' } +if ($UseCurrentCache) { + if ((Get-ItemProperty 'HKCU:\Software\Microsoft\Office\14.0\OneNote\Options\Paths').UnfiledNotesSection -ne 'C:\one-tests\Loose.one') { + throw 'Park the personal OneNote profile before reading test notebooks.' + } +} else { + & "$PSScriptRoot\cold-current.ps1" -Root $root -CloneHost $CloneHost +} +New-Item -ItemType Directory -Path $output | Out-Null +$app = New-Object -ComObject OneNote.Application +$notebookId = '' +$failure = $null +try { + $app.OpenHierarchy($notebook, '', [ref]$notebookId, 0) + $process = Get-Process ONENOTE + @{ hostname = [Environment]::MachineName; onenote = $process.MainModule.FileVersionInfo.FileVersion; + powershell = $PSVersionTable.PSVersion.ToString(); schema = 'xs2010'; cold = (-not $UseCurrentCache.IsPresent) } | + ConvertTo-Json | Set-Content (Join-Path $output 'environment.json') -Encoding UTF8 + $sections = @() + foreach ($file in @(Get-ChildItem $notebook -Recurse | Where-Object { $_.Extension -eq '.one' })) { + $id = '' + $app.OpenHierarchy($file.FullName, '', [ref]$id, 0) + $sections += $id + } + $deadline = [DateTime]::UtcNow.AddSeconds(300) + $previous = '' + $lastChange = '' + $stableSince = [DateTime]::UtcNow + $settled = $false + do { + $pages = @{} + foreach ($section in $sections) { + $hierarchy = '' + $app.GetHierarchy($section, 4, [ref]$hierarchy, 1) + [xml]$xml = $hierarchy + foreach ($node in $xml.SelectNodes('//*[@path]')) { + if (-not $node.GetAttribute('path').StartsWith("$notebook\", [StringComparison]::OrdinalIgnoreCase)) { + throw 'OneNote opened a section outside the copied notebook.' + } + } + foreach ($node in $xml.SelectNodes('//*[local-name()="Page"]')) { + $id = $node.GetAttribute('ID') + $content = '' + $app.GetPageContent($id, [ref]$content, 1, 1) + $pages[$id] = $content + } + } + $signature = [String]::Join('|', @($pages.Keys | Sort-Object | ForEach-Object { $_ + $pages[$_] })) + if ($signature -ne $previous) { + $lastChange = $previous + $previous = $signature + $stableSince = [DateTime]::UtcNow + } + if ((($ExpectedPages -ge 0 -and $pages.Count -eq $ExpectedPages) -or + ($ExpectedPages -lt 0 -and $pages.Count -gt 0)) -and + ([DateTime]::UtcNow - $stableSince).TotalSeconds -ge 2) { $settled = $true; break } + Start-Sleep -Milliseconds 250 + } while ([DateTime]::UtcNow -lt $deadline) + if (-not $settled -or ($ExpectedPages -ge 0 -and $pages.Count -ne $ExpectedPages) -or ($ExpectedPages -lt 0 -and $pages.Count -eq 0)) { + [IO.File]::WriteAllText((Join-Path $output 'previous-signature.txt'), $lastChange, [Text.Encoding]::UTF8) + $index = 0 + foreach ($id in @($pages.Keys | Sort-Object)) { + [IO.File]::WriteAllText((Join-Path $output ('unsettled-{0:d3}.xml' -f $index)), $pages[$id], [Text.Encoding]::UTF8) + $index++ + } + $hierarchy = '' + $app.GetHierarchy($notebookId, 4, [ref]$hierarchy, 1) + [IO.File]::WriteAllText((Join-Path $output 'unsettled-hierarchy.xml'), $hierarchy, [Text.Encoding]::UTF8) + throw "Expected $ExpectedPages stable pages; OneNote returned $($pages.Count), settled=$settled." + } + $index = 0 + $payloads = @() + foreach ($id in @($pages.Keys | Sort-Object)) { + [IO.File]::WriteAllText((Join-Path $output ('page-{0:d3}.xml' -f $index)), $pages[$id], [Text.Encoding]::UTF8) + if ($Pdf) { + $pdfPath = Join-Path $output ('page-{0:d3}.pdf' -f $index) + $app.NavigateTo($id, '', $false) + $app.Publish($id, $pdfPath, 3, '') + if (-not (Test-Path $pdfPath) -or (Get-Item $pdfPath).Length -eq 0) { throw 'OneNote did not publish the page PDF.' } + } + [xml]$page = $pages[$id] + foreach ($file in $page.SelectNodes('//*[local-name()="InsertedFile" or local-name()="MediaFile"]')) { + $bytes = [IO.File]::ReadAllBytes($file.GetAttribute('pathCache')) + $hash = [BitConverter]::ToString([Security.Cryptography.SHA256]::Create().ComputeHash($bytes)).Replace('-', '').ToLowerInvariant() + [IO.File]::WriteAllBytes((Join-Path $output ($hash + '.attachment')), $bytes) + $payloads += @{ page = $id; object = $file.ParentNode.GetAttribute('objectID'); + kind = $file.LocalName; name = $file.GetAttribute('preferredName'); + sha256 = $hash; bytes = $bytes.Length } + } + $index++ + } + [IO.File]::WriteAllText((Join-Path $output 'payloads.json'), (ConvertTo-Json -InputObject $payloads -Depth 4), [Text.Encoding]::UTF8) + $all = '' + $app.GetHierarchy($notebookId, 4, [ref]$all, 1) + [xml]$finalTree = $all + $finalIds = @($finalTree.SelectNodes('//*[local-name()="Page"]') | ForEach-Object { $_.GetAttribute('ID') } | Sort-Object -Unique) + if ($finalIds.Count -ne $pages.Count -or @($finalIds | Where-Object { -not $pages.ContainsKey($_) }).Count -ne 0) { + throw 'The notebook hierarchy changed while collecting page evidence; repeat the cold read.' + } + [IO.File]::WriteAllText((Join-Path $output 'hierarchy.xml'), $all, [Text.Encoding]::UTF8) + Write-Output "Read $($sections.Count) sections and $($pages.Count) pages." +} catch { + $failure = $_ + [IO.File]::WriteAllText((Join-Path $output 'failure.txt'), ($_ | Out-String), [Text.Encoding]::UTF8) + throw +} finally { + try { + try { + if ($notebookId -and $CloneHost) { $app.SyncHierarchy($notebookId) } + if ($notebookId -and -not $KeepOpen -and (-not $UseCurrentCache -or $CloneHost)) { + $app.CloseNotebook($notebookId, $false) + } + } catch { + if ($null -eq $failure) { throw } + [IO.File]::WriteAllText((Join-Path $output 'cleanup-failure.txt'), ($_ | Out-String), [Text.Encoding]::UTF8) + } + } finally { + [void][Runtime.InteropServices.Marshal]::FinalReleaseComObject($app) + } + $app = $null + [GC]::Collect() + [GC]::WaitForPendingFinalizers() + if (-not $UseCurrentCache -and -not $CloneHost) { + Get-Process ONENOTE -ErrorAction SilentlyContinue | Wait-Process -Timeout 10 + } +} diff --git a/corpus/outline-edit/offline-tree/cell-move/cold/source.json b/corpus/outline-edit/offline-tree/cell-move/cold/source.json index d521823056591867a7a1141208e263d8ee1c447d..e74fae033ee905099f8227d52d0bf361bbfeb233 100644 --- a/corpus/outline-edit/offline-tree/cell-move/cold/source.json +++ b/corpus/outline-edit/offline-tree/cell-move/cold/source.json @@ -1,8 +1,8 @@ [ { "path": "synthetic.one", - "bytes": 88104, - "sha256": "0d50bcef1e1b80d7920777e4734412e7549c484972aac0d9fbb313757ff85929", - "mtime_ns": 1788901195424267841 + "bytes": 90488, + "sha256": "dfbf1c95a6d5709b19a147f8db3033d487452ce7ba0895f73d41907233ea4dae", + "mtime_ns": 1789121633821515267 } ] diff --git a/corpus/outline-edit/offline-tree/cell-move/cold/teardown.json b/corpus/outline-edit/offline-tree/cell-move/cold/teardown.json deleted file mode 120000 index f87f229e17cdf751396fcf149ad2624727a29624..0000000000000000000000000000000000000000 --- a/corpus/outline-edit/offline-tree/cell-move/cold/teardown.json +++ /dev/null @@ -1 +0,0 @@ -../../../offline/cold/teardown.json \ No newline at end of file diff --git a/corpus/outline-edit/offline-tree/cell-move/cold/teardown.json b/corpus/outline-edit/offline-tree/cell-move/cold/teardown.json new file mode 100644 index 0000000000000000000000000000000000000000..05a47793de40f322e745c4c4183727e3590ecf70 --- /dev/null +++ b/corpus/outline-edit/offline-tree/cell-move/cold/teardown.json @@ -0,0 +1 @@ +{"absent": true} diff --git a/corpus/outline-edit/offline-tree/cold/commands.jsonl b/corpus/outline-edit/offline-tree/cold/commands.jsonl index 1a23ac47beb5b14ed3a96021c3be08de87442207..adf462a171416449527a0787850fbfbadffdd185 100644 --- a/corpus/outline-edit/offline-tree/cold/commands.jsonl +++ b/corpus/outline-edit/offline-tree/cold/commands.jsonl @@ -1,3 +1,3 @@ {"command": "powershell -NoProfile -Command \"Expand-Archive -LiteralPath C:\\one-tests\\transfer.zip -DestinationPath C:\\one-tests\\runs\\capture\\notebook\"", "exit": 0, "stdout": "", "stderr": "", "error": null} -{"command": "powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -File C:\\one-tests\\read-current.ps1 -Root C:\\one-tests\\runs\\capture -CloneHost ONE-M6-7605A4F1 -ExpectedPages 15", "exit": 0, "stdout": "Read 1 sections and 15 pages.\r\n", "stderr": "", "error": null} +{"command": "powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -File C:\\one-tests\\read-current.ps1 -Root C:\\one-tests\\runs\\capture -CloneHost ONE-M6-F749AF66 -ExpectedPages 15", "exit": 0, "stdout": "Read 1 sections and 15 pages.\r\n", "stderr": "", "error": null} {"command": "powershell -NoProfile -Command \"Compress-Archive -Force -Path C:\\one-tests\\runs\\capture\\* -DestinationPath C:\\one-tests\\captured.zip\"", "exit": 0, "stdout": "", "stderr": "", "error": null} diff --git a/corpus/outline-edit/offline-tree/cold/machine.json b/corpus/outline-edit/offline-tree/cold/machine.json new file mode 100644 index 0000000000000000000000000000000000000000..b6ef30570b7022baba9d352fa967cea748917a4d --- /dev/null +++ b/corpus/outline-edit/offline-tree/cold/machine.json @@ -0,0 +1 @@ +{"name": "m6-f749af66", "hostname": "ONE-M6-F749AF66"} diff --git a/corpus/outline-edit/offline-tree/cold/notebook/Open Notebook.onetoc2 b/corpus/outline-edit/offline-tree/cold/notebook/Open Notebook.onetoc2 index 9bcfeb67122a90d8d83001106c707f0fe7bbaebe..9f0fb2e2e59948fd45477a13d9a02cb539e654f2 100644 Binary files a/corpus/outline-edit/offline-tree/cold/notebook/Open Notebook.onetoc2 and b/corpus/outline-edit/offline-tree/cold/notebook/Open Notebook.onetoc2 differ diff --git a/corpus/outline-edit/offline-tree/cold/notebook/synthetic.one b/corpus/outline-edit/offline-tree/cold/notebook/synthetic.one index a98e60962617853d8ccd44cca3d171abc4dc03e6..d3d77e1649de7ee42fd4bc6c35453f50a0ef7be0 100644 Binary files a/corpus/outline-edit/offline-tree/cold/notebook/synthetic.one and b/corpus/outline-edit/offline-tree/cold/notebook/synthetic.one differ diff --git a/corpus/outline-edit/offline-tree/cold/read/environment.json b/corpus/outline-edit/offline-tree/cold/read/environment.json index 09566e094a43f1176d82def6c60999341cb85f71..384f4770f2dac8103d0880eeefec544bf017f211 100644 --- a/corpus/outline-edit/offline-tree/cold/read/environment.json +++ b/corpus/outline-edit/offline-tree/cold/read/environment.json @@ -1,7 +1,7 @@ { "powershell": "5.1.14409.1005", "schema": "xs2010", - "hostname": "ONE-M6-7605A4F1", + "hostname": "ONE-M6-F749AF66", "cold": true, "onenote": "14.0.4763.1000" } diff --git a/corpus/outline-edit/offline-tree/cold/read/hierarchy.xml b/corpus/outline-edit/offline-tree/cold/read/hierarchy.xml index 8c6ea32186c6f9c27481a971ee09b04fe417bcac..5695ec5dad3dd35c26973d6812a1e583ef04316b 100644 --- a/corpus/outline-edit/offline-tree/cold/read/hierarchy.xml +++ b/corpus/outline-edit/offline-tree/cold/read/hierarchy.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/outline-edit/offline-tree/cold/read/page-000.xml b/corpus/outline-edit/offline-tree/cold/read/page-000.xml index f7088b5d78d77ba3aa02e2ffb7b32689e46ac4b1..9f3335d389af5645a1f5ace280c0933a8c6374a9 100644 --- a/corpus/outline-edit/offline-tree/cold/read/page-000.xml +++ b/corpus/outline-edit/offline-tree/cold/read/page-000.xml @@ -1,2 +1,5 @@  - +Target 🦀 é Link label]]>Child]]> diff --git a/corpus/outline-edit/offline-tree/cold/read/page-001.xml b/corpus/outline-edit/offline-tree/cold/read/page-001.xml index 38017a1d7fcc9df5640c30590885df703022fecb..9014e4275df5b2e8731daa7994b047f9f5a744d3 100644 --- a/corpus/outline-edit/offline-tree/cold/read/page-001.xml +++ b/corpus/outline-edit/offline-tree/cold/read/page-001.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/outline-edit/offline-tree/cold/read/page-002.xml b/corpus/outline-edit/offline-tree/cold/read/page-002.xml index 67c2e52e667222d5ed459ddbd833d3fb2f74a0aa..212f984d035c136f9b893d1a369f8300615e1a32 100644 --- a/corpus/outline-edit/offline-tree/cold/read/page-002.xml +++ b/corpus/outline-edit/offline-tree/cold/read/page-002.xml @@ -1,20 +1,2 @@  -Bold 🦀 italic é color 東京
-End
]]>
Fictitious: café, 東京, مرحبا]]>
+ diff --git a/corpus/outline-edit/offline-tree/cold/read/page-003.xml b/corpus/outline-edit/offline-tree/cold/read/page-003.xml index e91b1202b3ef808c70f19f6c39458a644cb3f514..d6df723e46fda135fcc90b38dfed7a2cc7a2a26c 100644 --- a/corpus/outline-edit/offline-tree/cold/read/page-003.xml +++ b/corpus/outline-edit/offline-tree/cold/read/page-003.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/outline-edit/offline-tree/cold/read/page-004.xml b/corpus/outline-edit/offline-tree/cold/read/page-004.xml index c2da7d7bb0f0b72af82e63c463aa418226fa5334..c2efe3ae1cf9da353f3b97f6935b4c1e3f254cbb 100644 --- a/corpus/outline-edit/offline-tree/cold/read/page-004.xml +++ b/corpus/outline-edit/offline-tree/cold/read/page-004.xml @@ -1,5 +1,5 @@  -Target 🦀 é Link label]]>Child]]> +href="https://example.invalid/outline">Link label]]>Child]]> diff --git a/corpus/outline-edit/offline-tree/cold/read/page-005.xml b/corpus/outline-edit/offline-tree/cold/read/page-005.xml index b97a3beace587830b849c7b2f0a035e8c0330211..840f559bf7d479f1c2eb064588a4ee8041d46096 100644 --- a/corpus/outline-edit/offline-tree/cold/read/page-005.xml +++ b/corpus/outline-edit/offline-tree/cold/read/page-005.xml @@ -1,2 +1,4 @@  - +Target 🦀 é Link label]]> diff --git a/corpus/outline-edit/offline-tree/cold/read/page-006.xml b/corpus/outline-edit/offline-tree/cold/read/page-006.xml index 8504acda4447ca06dfe8de1184aabbe2473016db..5e9c731f467e6d540c71be50e15a80cbf22fd7bf 100644 --- a/corpus/outline-edit/offline-tree/cold/read/page-006.xml +++ b/corpus/outline-edit/offline-tree/cold/read/page-006.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/outline-edit/offline-tree/cold/read/page-007.xml b/corpus/outline-edit/offline-tree/cold/read/page-007.xml index aa15f615fbd3e6a0371999a8c6e01b504db9384b..52052ca6afc5d29782d4809a25dd3302ef5a04b5 100644 --- a/corpus/outline-edit/offline-tree/cold/read/page-007.xml +++ b/corpus/outline-edit/offline-tree/cold/read/page-007.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/outline-edit/offline-tree/cold/read/page-008.xml b/corpus/outline-edit/offline-tree/cold/read/page-008.xml index 547b18ec2cd492e08b9301773a695a682eb7a913..63ccbf0c913921db3d6971ea792cf9199abbeccd 100644 --- a/corpus/outline-edit/offline-tree/cold/read/page-008.xml +++ b/corpus/outline-edit/offline-tree/cold/read/page-008.xml @@ -1,2 +1,5 @@  - +Target 🦀 é Link label]]>Child]]> diff --git a/corpus/outline-edit/offline-tree/cold/read/page-009.xml b/corpus/outline-edit/offline-tree/cold/read/page-009.xml index 7c09d1e66df39b3e75ebc3e209dfcd66b8bcee0c..cab0f22832fee130d8799b76c7889aaa100e4e2f 100644 --- a/corpus/outline-edit/offline-tree/cold/read/page-009.xml +++ b/corpus/outline-edit/offline-tree/cold/read/page-009.xml @@ -1,5 +1,2 @@  -Target 🦀 é Link label]]>Child]]> + diff --git a/corpus/outline-edit/offline-tree/cold/read/page-010.xml b/corpus/outline-edit/offline-tree/cold/read/page-010.xml index 91d86124956dc049a7c3d38d991faa64ac14088f..d38100d7b79de99b69965b666925799981066fef 100644 --- a/corpus/outline-edit/offline-tree/cold/read/page-010.xml +++ b/corpus/outline-edit/offline-tree/cold/read/page-010.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/outline-edit/offline-tree/cold/read/page-011.xml b/corpus/outline-edit/offline-tree/cold/read/page-011.xml index 08fc27b702e86ce0c9489b31480b77f1ea191e60..99ded23d3332ccc0833bbb700b8b54a54be27978 100644 --- a/corpus/outline-edit/offline-tree/cold/read/page-011.xml +++ b/corpus/outline-edit/offline-tree/cold/read/page-011.xml @@ -1,4 +1,2 @@  -Target 🦀 é Link label]]> + diff --git a/corpus/outline-edit/offline-tree/cold/read/page-012.xml b/corpus/outline-edit/offline-tree/cold/read/page-012.xml index 8352935a309b73e0da8789b9b9a19c7b9116875a..59e9801b0af11a6c2df7e28337821dbd3d66fba4 100644 --- a/corpus/outline-edit/offline-tree/cold/read/page-012.xml +++ b/corpus/outline-edit/offline-tree/cold/read/page-012.xml @@ -1,2 +1,5 @@  - +Target 🦀 é Link label]]>Child]]> diff --git a/corpus/outline-edit/offline-tree/cold/read/page-013.xml b/corpus/outline-edit/offline-tree/cold/read/page-013.xml index 7dc3e80cd912dc5034c0d493d5ec9ff103fe088c..803a91c7ca517ac21cce2896777dd0e491beec14 100644 --- a/corpus/outline-edit/offline-tree/cold/read/page-013.xml +++ b/corpus/outline-edit/offline-tree/cold/read/page-013.xml @@ -1,2 +1,20 @@  - +Bold 🦀 italic é color 東京
+End
]]>
Fictitious: café, 東京, مرحبا]]>
diff --git a/corpus/outline-edit/offline-tree/cold/read/page-014.xml b/corpus/outline-edit/offline-tree/cold/read/page-014.xml index 5c5c21da02c4028ec2c40f07a2c615607d1f3c63..daeea93b34ecc72d9bb43581642164788cd1a65e 100644 --- a/corpus/outline-edit/offline-tree/cold/read/page-014.xml +++ b/corpus/outline-edit/offline-tree/cold/read/page-014.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/outline-edit/offline-tree/cold/read/payloads.json b/corpus/outline-edit/offline-tree/cold/read/payloads.json deleted file mode 120000 index 9e1be3e2b6d87478e7c48d278ecac8ee6c97f6d0..0000000000000000000000000000000000000000 --- a/corpus/outline-edit/offline-tree/cold/read/payloads.json +++ /dev/null @@ -1 +0,0 @@ -../../../../paragraph-edit/before/read/payloads.json \ No newline at end of file diff --git a/corpus/outline-edit/offline-tree/cold/read/payloads.json b/corpus/outline-edit/offline-tree/cold/read/payloads.json new file mode 100644 index 0000000000000000000000000000000000000000..1ce91a413d6fff4d58765187b76756f0e97ae843 --- /dev/null +++ b/corpus/outline-edit/offline-tree/cold/read/payloads.json @@ -0,0 +1,3 @@ +[ + +] \ No newline at end of file diff --git a/corpus/outline-edit/offline-tree/cold/run.json b/corpus/outline-edit/offline-tree/cold/run.json index c416e28bcfe053dd9dafaed85cdcc408f344d922..3e08089d0881260324e8177eb961149cbbe9eedc 100644 --- a/corpus/outline-edit/offline-tree/cold/run.json +++ b/corpus/outline-edit/offline-tree/cold/run.json @@ -1,5 +1,5 @@ { - "notebook": "/Users/clo/dev/one/evidence/m10/offline-tree-native-01/candidate", + "notebook": "/private/tmp/m33/offline-tree/candidate", "expected_pages": 15, "author": null, "author_timeout_seconds": 600, diff --git a/corpus/outline-edit/offline-tree/cold/scripts/cold.ps1 b/corpus/outline-edit/offline-tree/cold/scripts/cold.ps1 deleted file mode 120000 index 5bc2f1837e1f0b639923a80b79c517c98c5c519a..0000000000000000000000000000000000000000 --- a/corpus/outline-edit/offline-tree/cold/scripts/cold.ps1 +++ /dev/null @@ -1 +0,0 @@ -../../../../paragraph-edit/reconciliation/keyboard/scripts/cold.ps1 \ No newline at end of file diff --git a/corpus/outline-edit/offline-tree/cold/scripts/cold.ps1 b/corpus/outline-edit/offline-tree/cold/scripts/cold.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..a0b99e7aeb86f4dc10032537800501a52ad65b4f --- /dev/null +++ b/corpus/outline-edit/offline-tree/cold/scripts/cold.ps1 @@ -0,0 +1,27 @@ +param([Parameter(Mandatory=$true)][string]$Root, [string]$CloneHost = '') +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' +$root = [IO.Path]::GetFullPath($Root).TrimEnd('\') +if ([IO.Path]::GetDirectoryName($root) -ne 'C:\one-tests\runs') { + throw 'Choose a run directly below C:\one-tests\runs.' +} +if (Get-Process ONENOTE -ErrorAction SilentlyContinue) { throw 'Close OneNote before resetting its test cache.' } +$key = 'HKCU:\Software\Microsoft\Office\14.0\OneNote' +if ($CloneHost) { + if ($CloneHost -notmatch '^ONE-[A-Z0-9-]+$' -or [Environment]::MachineName -ne $CloneHost) { + throw 'The disposable clone hostname does not match this machine.' + } + New-Item "$key\Options\Paths" -Force | Out-Null + New-ItemProperty "$key\Options\Paths" -Name UnfiledNotesSection -PropertyType ExpandString -Value 'C:\one-tests\Loose.one' -Force | Out-Null +} elseif ((Get-ItemProperty "$key\Options\Paths").UnfiledNotesSection -ne 'C:\one-tests\Loose.one' -or + -not (Test-Path 'C:\one-tests\profile-original-cache')) { + throw 'Park the personal OneNote profile before resetting the test cache.' +} +$cache = Join-Path $env:LOCALAPPDATA 'Microsoft\OneNote\14.0' +$parked = Join-Path 'C:\one-tests\caches' ([IO.Path]::GetFileName($root)) +if (Test-Path $parked) { throw 'Choose a new run; its parked cache already exists.' } +New-Item -ItemType Directory -Path 'C:\one-tests\caches' -Force | Out-Null +if (Test-Path $cache) { Move-Item -LiteralPath $cache -Destination $parked } +if (Test-Path "$key\OpenNotebooks") { Remove-Item "$key\OpenNotebooks" -Recurse } +New-Item "$key\OpenNotebooks" | Out-Null +New-ItemProperty "$key\OpenNotebooks" -Name '1' -PropertyType String -Value "$root\notebook" | Out-Null diff --git a/corpus/outline-edit/offline-tree/cold/scripts/read.ps1 b/corpus/outline-edit/offline-tree/cold/scripts/read.ps1 deleted file mode 120000 index 85257c76cede599f47da88e69419a767dd6b99ee..0000000000000000000000000000000000000000 --- a/corpus/outline-edit/offline-tree/cold/scripts/read.ps1 +++ /dev/null @@ -1 +0,0 @@ -../../../../paragraph-edit/reconciliation/keyboard/scripts/read.ps1 \ No newline at end of file diff --git a/corpus/outline-edit/offline-tree/cold/scripts/read.ps1 b/corpus/outline-edit/offline-tree/cold/scripts/read.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..476094ab1e0c47077988a6461db2080cf208642b --- /dev/null +++ b/corpus/outline-edit/offline-tree/cold/scripts/read.ps1 @@ -0,0 +1,142 @@ +param( + [Parameter(Mandatory=$true)][string]$Root, + [int]$ExpectedPages = -1, + [switch]$UseCurrentCache, + [switch]$Pdf, + [switch]$KeepOpen, + [string]$CloneHost = '' +) +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' +$root = [IO.Path]::GetFullPath($Root).TrimEnd('\') +if ([IO.Path]::GetDirectoryName($root) -ne 'C:\one-tests\runs') { + throw 'Choose a run directly below C:\one-tests\runs.' +} +$notebook = Join-Path $root 'notebook' +$output = Join-Path $root 'read' +if (Test-Path $output) { throw 'Choose a new read destination.' } +if ($UseCurrentCache) { + if ((Get-ItemProperty 'HKCU:\Software\Microsoft\Office\14.0\OneNote\Options\Paths').UnfiledNotesSection -ne 'C:\one-tests\Loose.one') { + throw 'Park the personal OneNote profile before reading test notebooks.' + } +} else { + & "$PSScriptRoot\cold-current.ps1" -Root $root -CloneHost $CloneHost +} +New-Item -ItemType Directory -Path $output | Out-Null +$app = New-Object -ComObject OneNote.Application +$notebookId = '' +$failure = $null +try { + $app.OpenHierarchy($notebook, '', [ref]$notebookId, 0) + $process = Get-Process ONENOTE + @{ hostname = [Environment]::MachineName; onenote = $process.MainModule.FileVersionInfo.FileVersion; + powershell = $PSVersionTable.PSVersion.ToString(); schema = 'xs2010'; cold = (-not $UseCurrentCache.IsPresent) } | + ConvertTo-Json | Set-Content (Join-Path $output 'environment.json') -Encoding UTF8 + $sections = @() + foreach ($file in @(Get-ChildItem $notebook -Recurse | Where-Object { $_.Extension -eq '.one' })) { + $id = '' + $app.OpenHierarchy($file.FullName, '', [ref]$id, 0) + $sections += $id + } + $deadline = [DateTime]::UtcNow.AddSeconds(300) + $previous = '' + $lastChange = '' + $stableSince = [DateTime]::UtcNow + $settled = $false + do { + $pages = @{} + foreach ($section in $sections) { + $hierarchy = '' + $app.GetHierarchy($section, 4, [ref]$hierarchy, 1) + [xml]$xml = $hierarchy + foreach ($node in $xml.SelectNodes('//*[@path]')) { + if (-not $node.GetAttribute('path').StartsWith("$notebook\", [StringComparison]::OrdinalIgnoreCase)) { + throw 'OneNote opened a section outside the copied notebook.' + } + } + foreach ($node in $xml.SelectNodes('//*[local-name()="Page"]')) { + $id = $node.GetAttribute('ID') + $content = '' + $app.GetPageContent($id, [ref]$content, 1, 1) + $pages[$id] = $content + } + } + $signature = [String]::Join('|', @($pages.Keys | Sort-Object | ForEach-Object { $_ + $pages[$_] })) + if ($signature -ne $previous) { + $lastChange = $previous + $previous = $signature + $stableSince = [DateTime]::UtcNow + } + if ((($ExpectedPages -ge 0 -and $pages.Count -eq $ExpectedPages) -or + ($ExpectedPages -lt 0 -and $pages.Count -gt 0)) -and + ([DateTime]::UtcNow - $stableSince).TotalSeconds -ge 2) { $settled = $true; break } + Start-Sleep -Milliseconds 250 + } while ([DateTime]::UtcNow -lt $deadline) + if (-not $settled -or ($ExpectedPages -ge 0 -and $pages.Count -ne $ExpectedPages) -or ($ExpectedPages -lt 0 -and $pages.Count -eq 0)) { + [IO.File]::WriteAllText((Join-Path $output 'previous-signature.txt'), $lastChange, [Text.Encoding]::UTF8) + $index = 0 + foreach ($id in @($pages.Keys | Sort-Object)) { + [IO.File]::WriteAllText((Join-Path $output ('unsettled-{0:d3}.xml' -f $index)), $pages[$id], [Text.Encoding]::UTF8) + $index++ + } + $hierarchy = '' + $app.GetHierarchy($notebookId, 4, [ref]$hierarchy, 1) + [IO.File]::WriteAllText((Join-Path $output 'unsettled-hierarchy.xml'), $hierarchy, [Text.Encoding]::UTF8) + throw "Expected $ExpectedPages stable pages; OneNote returned $($pages.Count), settled=$settled." + } + $index = 0 + $payloads = @() + foreach ($id in @($pages.Keys | Sort-Object)) { + [IO.File]::WriteAllText((Join-Path $output ('page-{0:d3}.xml' -f $index)), $pages[$id], [Text.Encoding]::UTF8) + if ($Pdf) { + $pdfPath = Join-Path $output ('page-{0:d3}.pdf' -f $index) + $app.NavigateTo($id, '', $false) + $app.Publish($id, $pdfPath, 3, '') + if (-not (Test-Path $pdfPath) -or (Get-Item $pdfPath).Length -eq 0) { throw 'OneNote did not publish the page PDF.' } + } + [xml]$page = $pages[$id] + foreach ($file in $page.SelectNodes('//*[local-name()="InsertedFile" or local-name()="MediaFile"]')) { + $bytes = [IO.File]::ReadAllBytes($file.GetAttribute('pathCache')) + $hash = [BitConverter]::ToString([Security.Cryptography.SHA256]::Create().ComputeHash($bytes)).Replace('-', '').ToLowerInvariant() + [IO.File]::WriteAllBytes((Join-Path $output ($hash + '.attachment')), $bytes) + $payloads += @{ page = $id; object = $file.ParentNode.GetAttribute('objectID'); + kind = $file.LocalName; name = $file.GetAttribute('preferredName'); + sha256 = $hash; bytes = $bytes.Length } + } + $index++ + } + [IO.File]::WriteAllText((Join-Path $output 'payloads.json'), (ConvertTo-Json -InputObject $payloads -Depth 4), [Text.Encoding]::UTF8) + $all = '' + $app.GetHierarchy($notebookId, 4, [ref]$all, 1) + [xml]$finalTree = $all + $finalIds = @($finalTree.SelectNodes('//*[local-name()="Page"]') | ForEach-Object { $_.GetAttribute('ID') } | Sort-Object -Unique) + if ($finalIds.Count -ne $pages.Count -or @($finalIds | Where-Object { -not $pages.ContainsKey($_) }).Count -ne 0) { + throw 'The notebook hierarchy changed while collecting page evidence; repeat the cold read.' + } + [IO.File]::WriteAllText((Join-Path $output 'hierarchy.xml'), $all, [Text.Encoding]::UTF8) + Write-Output "Read $($sections.Count) sections and $($pages.Count) pages." +} catch { + $failure = $_ + [IO.File]::WriteAllText((Join-Path $output 'failure.txt'), ($_ | Out-String), [Text.Encoding]::UTF8) + throw +} finally { + try { + try { + if ($notebookId -and $CloneHost) { $app.SyncHierarchy($notebookId) } + if ($notebookId -and -not $KeepOpen -and (-not $UseCurrentCache -or $CloneHost)) { + $app.CloseNotebook($notebookId, $false) + } + } catch { + if ($null -eq $failure) { throw } + [IO.File]::WriteAllText((Join-Path $output 'cleanup-failure.txt'), ($_ | Out-String), [Text.Encoding]::UTF8) + } + } finally { + [void][Runtime.InteropServices.Marshal]::FinalReleaseComObject($app) + } + $app = $null + [GC]::Collect() + [GC]::WaitForPendingFinalizers() + if (-not $UseCurrentCache -and -not $CloneHost) { + Get-Process ONENOTE -ErrorAction SilentlyContinue | Wait-Process -Timeout 10 + } +} diff --git a/corpus/outline-edit/offline-tree/cold/source.json b/corpus/outline-edit/offline-tree/cold/source.json index 1e424af0fe0483cb5c76015ea425e248ea4d25bb..788b222f23b490c81308a9bc29f612e8af95a326 100644 --- a/corpus/outline-edit/offline-tree/cold/source.json +++ b/corpus/outline-edit/offline-tree/cold/source.json @@ -1,8 +1,8 @@ [ { "path": "synthetic.one", - "bytes": 152736, - "sha256": "c724b5590d30d8a2ba5d12a25ba1e62bb05792947fd5405b65e68e9b2ae7c256", - "mtime_ns": 1788900756034686311 + "bytes": 153008, + "sha256": "8d1f6eacdb124a4d0b8c854264320e25ee0a7ba6767d07d5c861f870ccf879cc", + "mtime_ns": 1789121640205341562 } ] diff --git a/corpus/outline-edit/offline-tree/cold/teardown.json b/corpus/outline-edit/offline-tree/cold/teardown.json deleted file mode 120000 index a9088cc9e6bf00c88849f584d2a4967ba2372903..0000000000000000000000000000000000000000 --- a/corpus/outline-edit/offline-tree/cold/teardown.json +++ /dev/null @@ -1 +0,0 @@ -../../offline/cold/teardown.json \ No newline at end of file diff --git a/corpus/outline-edit/offline-tree/cold/teardown.json b/corpus/outline-edit/offline-tree/cold/teardown.json new file mode 100644 index 0000000000000000000000000000000000000000..05a47793de40f322e745c4c4183727e3590ecf70 --- /dev/null +++ b/corpus/outline-edit/offline-tree/cold/teardown.json @@ -0,0 +1 @@ +{"absent": true} diff --git a/corpus/outline-edit/offline/candidate/synthetic.one b/corpus/outline-edit/offline/candidate/synthetic.one index 72a2843936fe40a397370ea1bc5d68802ee8b425..7ce0cdbc1d84bb72bd1489516428956a32b2ace2 100644 Binary files a/corpus/outline-edit/offline/candidate/synthetic.one and b/corpus/outline-edit/offline/candidate/synthetic.one differ diff --git a/corpus/outline-edit/offline/cases.json b/corpus/outline-edit/offline/cases.json index 40623c317bc500504538eb48cc5f9437477aa7c6..24472e659ff3d180df1a2e0b0555ec88819242e5 100644 --- a/corpus/outline-edit/offline/cases.json +++ b/corpus/outline-edit/offline/cases.json @@ -6,8 +6,7 @@ "dependent_text": "{033CC036-70D6-02D3-2869-6264552F7B9E},64", "name": "Move leaf down", "object": "{033CC036-70D6-02D3-2869-6264552F7B9E},45", - "retained": false, - "space": "{B7267338-BF83-0893-27A7-37F606DD20C8},1" + "outcome": "merged" }, { "change": { @@ -16,8 +15,7 @@ "dependent_text": "{E79A0442-BFCF-04C6-1E04-364B68877B88},75", "name": "Move subtree down", "object": "{E79A0442-BFCF-04C6-1E04-364B68877B88},45", - "retained": false, - "space": "{9B80D7CA-18B4-02B0-1E85-6E8AA0DAD827},1" + "outcome": "merged" }, { "change": { @@ -26,8 +24,7 @@ "dependent_text": "{3F47069A-F0C5-053E-1DEC-13B552EEE2A0},75", "name": "Move subtree up", "object": "{3F47069A-F0C5-053E-1DEC-13B552EEE2A0},45", - "retained": false, - "space": "{7538095C-389B-07D8-2991-B2BC46EBD52A},1" + "outcome": "merged" }, { "change": { @@ -36,8 +33,7 @@ "dependent_text": "{5A89330E-0803-08CF-2BF5-26621F998039},75", "name": "Indent subtree", "object": "{5A89330E-0803-08CF-2BF5-26621F998039},45", - "retained": false, - "space": "{651463E3-C768-0C93-363D-FCE642B07408},1" + "outcome": "merged" }, { "change": { @@ -46,8 +42,7 @@ "dependent_text": "{1A8D8A0B-E96E-01B0-3DA2-EF182AA19042},75", "name": "Outdent subtree", "object": "{1A8D8A0B-E96E-01B0-3DA2-EF182AA19042},45", - "retained": false, - "space": "{8384083C-60ED-0F7C-2F15-8B20B878B3EB},1" + "outcome": "merged" }, { "change": { @@ -56,8 +51,7 @@ "dependent_text": "{7375C8D1-28F0-0B05-00E5-093957D7F5F1},75", "name": "Collapse subtree", "object": "{7375C8D1-28F0-0B05-00E5-093957D7F5F1},45", - "retained": false, - "space": "{FF88B513-029C-00E2-0082-9E3DCE1D7796},1" + "outcome": "merged" }, { "change": { @@ -66,8 +60,7 @@ "dependent_text": "{B11DD73E-4234-04EF-0F4D-1F67E8F92C22},75", "name": "Expand subtree", "object": "{B11DD73E-4234-04EF-0F4D-1F67E8F92C22},45", - "retained": false, - "space": "{850B34E4-D62A-042B-138A-B2A905CEE28E},1" + "outcome": "merged" }, { "change": { @@ -76,8 +69,7 @@ "dependent_text": "{DC976FEC-CD30-0C41-20AD-BB462A203464},64", "name": "Delete leaf", "object": "{DC976FEC-CD30-0C41-20AD-BB462A203464},45", - "retained": true, - "space": "{363FE055-44E1-0B27-14A8-46278FD681FF},1" + "outcome": "reviewed" }, { "change": { @@ -86,8 +78,7 @@ "dependent_text": "{73987DA5-C014-0EEA-00F8-5C1E149736E4},75", "name": "Delete subtree", "object": "{73987DA5-C014-0EEA-00F8-5C1E149736E4},45", - "retained": true, - "space": "{8BBAD88F-D248-0959-00B3-2438A7065330},1" + "outcome": "reviewed" }, { "change": { @@ -96,8 +87,7 @@ "dependent_text": "{C868DD34-6E8C-07E9-116E-4C68D2C45DFC},54", "name": "Delete only paragraph", "object": "{C868DD34-6E8C-07E9-116E-4C68D2C45DFC},40", - "retained": true, - "space": "{A4CB3BA2-767F-0AE8-0916-AF142D995822},1" + "outcome": "reviewed" }, { "change": { @@ -109,8 +99,7 @@ "dependent_text": "{78796D8B-FB39-02D8-2502-22530F00073C},75", "name": "Delete outline", "object": "{78796D8B-FB39-02D8-2502-22530F00073C},39", - "retained": true, - "space": "{80E80543-87A1-0C3A-0816-22B190BDFC87},1" + "outcome": "reviewed" }, { "change": { @@ -122,8 +111,7 @@ "dependent_text": "{462B969B-FCFA-0201-073A-0B4C3C23ABF5},75", "name": "Move outline", "object": "{462B969B-FCFA-0201-073A-0B4C3C23ABF5},39", - "retained": false, - "space": "{16207F40-69C9-0CA1-09B5-DC5712DB2BBE},1" + "outcome": "reviewed" }, { "change": { @@ -135,8 +123,7 @@ "dependent_text": "{048364F9-D353-05E3-319E-2633D33434CE},75", "name": "Resize outline", "object": "{048364F9-D353-05E3-319E-2633D33434CE},39", - "retained": false, - "space": "{CD420421-73F7-0F11-02EC-35FCA348998C},1" + "outcome": "reviewed" }, { "change": { @@ -148,7 +135,6 @@ "dependent_text": "{CE365E1B-9B76-067E-2EC7-220FB6AC76E9},75", "name": "Automatic outline size", "object": "{CE365E1B-9B76-067E-2EC7-220FB6AC76E9},39", - "retained": false, - "space": "{F383096F-2121-0225-1E62-AB37C9B15B33},1" + "outcome": "reviewed" } ] \ No newline at end of file diff --git a/corpus/outline-edit/offline/cold/commands.jsonl b/corpus/outline-edit/offline/cold/commands.jsonl index 3ca2a0d7a0a8100956f32249e22b0b52c430db17..f6efe72e90da7aa6bdb6b7f403bc0afcd05a8140 100644 --- a/corpus/outline-edit/offline/cold/commands.jsonl +++ b/corpus/outline-edit/offline/cold/commands.jsonl @@ -1,3 +1,3 @@ {"command": "powershell -NoProfile -Command \"Expand-Archive -LiteralPath C:\\one-tests\\transfer.zip -DestinationPath C:\\one-tests\\runs\\capture\\notebook\"", "exit": 0, "stdout": "", "stderr": "", "error": null} -{"command": "powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -File C:\\one-tests\\read-current.ps1 -Root C:\\one-tests\\runs\\capture -CloneHost ONE-M6-B0D8A07E -ExpectedPages 15", "exit": 0, "stdout": "Read 1 sections and 15 pages.\r\n", "stderr": "", "error": null} +{"command": "powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -File C:\\one-tests\\read-current.ps1 -Root C:\\one-tests\\runs\\capture -CloneHost ONE-M6-397443BC -ExpectedPages 15", "exit": 0, "stdout": "Read 1 sections and 15 pages.\r\n", "stderr": "", "error": null} {"command": "powershell -NoProfile -Command \"Compress-Archive -Force -Path C:\\one-tests\\runs\\capture\\* -DestinationPath C:\\one-tests\\captured.zip\"", "exit": 0, "stdout": "", "stderr": "", "error": null} diff --git a/corpus/outline-edit/offline/cold/machine.json b/corpus/outline-edit/offline/cold/machine.json index 2fddeba2bd756293074dce48eecba902509d105e..24667f29d5e2b768d667767a16ff7382241ce622 100644 --- a/corpus/outline-edit/offline/cold/machine.json +++ b/corpus/outline-edit/offline/cold/machine.json @@ -1 +1 @@ -{"name": "m6-b0d8a07e", "hostname": "ONE-M6-B0D8A07E"} +{"name": "m6-397443bc", "hostname": "ONE-M6-397443BC"} diff --git a/corpus/outline-edit/offline/cold/notebook/Open Notebook.onetoc2 b/corpus/outline-edit/offline/cold/notebook/Open Notebook.onetoc2 index ca2d23e914168eb4e1cf10450afb22b8af9e73cf..1b1942a6114891c51ac39bcf1c3c14bbfc71173f 100644 Binary files a/corpus/outline-edit/offline/cold/notebook/Open Notebook.onetoc2 and b/corpus/outline-edit/offline/cold/notebook/Open Notebook.onetoc2 differ diff --git a/corpus/outline-edit/offline/cold/notebook/synthetic.one b/corpus/outline-edit/offline/cold/notebook/synthetic.one index 3d2228b42f3bf92091ce641f1caf3ab4a11d11eb..064869b445ee6393030cdc02165033614a0f1033 100644 Binary files a/corpus/outline-edit/offline/cold/notebook/synthetic.one and b/corpus/outline-edit/offline/cold/notebook/synthetic.one differ diff --git a/corpus/outline-edit/offline/cold/read/environment.json b/corpus/outline-edit/offline/cold/read/environment.json index 6ae9b744b00d8ad9a4d76e32a145436c615f6563..511e81bd38c25ecc3f3c5e0bee39bf5e6c3748f2 100644 --- a/corpus/outline-edit/offline/cold/read/environment.json +++ b/corpus/outline-edit/offline/cold/read/environment.json @@ -1,7 +1,7 @@ { "powershell": "5.1.14409.1005", "schema": "xs2010", - "hostname": "ONE-M6-B0D8A07E", + "hostname": "ONE-M6-397443BC", "cold": true, "onenote": "14.0.4763.1000" } diff --git a/corpus/outline-edit/offline/cold/read/hierarchy.xml b/corpus/outline-edit/offline/cold/read/hierarchy.xml index 0204d58383339adec8feaf54bf500679741f6b9c..36366e0c1e9190b025365460c8fc383e4aff4213 100644 --- a/corpus/outline-edit/offline/cold/read/hierarchy.xml +++ b/corpus/outline-edit/offline/cold/read/hierarchy.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/outline-edit/offline/cold/read/page-000.xml b/corpus/outline-edit/offline/cold/read/page-000.xml index 92615e94b447e118621d2a59144184e84e651e6e..f3717d3d2b03e1a4faa7a8138db8ba15f393e412 100644 --- a/corpus/outline-edit/offline/cold/read/page-000.xml +++ b/corpus/outline-edit/offline/cold/read/page-000.xml @@ -1,5 +1,4 @@  -Target 🦀 é Link label]]>Child]]> +href="https://example.invalid/outline">Link label]]> diff --git a/corpus/outline-edit/offline/cold/read/page-001.xml b/corpus/outline-edit/offline/cold/read/page-001.xml index 6ccb6255a089fb2fe6e0c42387cc479f72ebbdea..2817bb21f8a4a494ecfcb9e8f46e3c3ec2e84c09 100644 --- a/corpus/outline-edit/offline/cold/read/page-001.xml +++ b/corpus/outline-edit/offline/cold/read/page-001.xml @@ -1,20 +1,2 @@  -Bold 🦀 italic é color 東京
-End
]]>
Fictitious: café, 東京, مرحبا]]>
+ diff --git a/corpus/outline-edit/offline/cold/read/page-002.xml b/corpus/outline-edit/offline/cold/read/page-002.xml index fd2f2fbe02f1229cd212a0c1b88a10595b2870eb..2e8e92a9f62be30113f93a06ac9e0323536da099 100644 --- a/corpus/outline-edit/offline/cold/read/page-002.xml +++ b/corpus/outline-edit/offline/cold/read/page-002.xml @@ -1,5 +1,5 @@  -Target 🦀 é Link label]]>Child]]> +href="https://example.invalid/outline">Link label]]>Child]]> diff --git a/corpus/outline-edit/offline/cold/read/page-003.xml b/corpus/outline-edit/offline/cold/read/page-003.xml index af9b2af57eb448d917e65d456ddb64cd33b4d3e8..53a0ed3dd01e765c41306ea218866203d97cea08 100644 --- a/corpus/outline-edit/offline/cold/read/page-003.xml +++ b/corpus/outline-edit/offline/cold/read/page-003.xml @@ -1,2 +1,5 @@  - +Target 🦀 é Link label]]>Child]]> diff --git a/corpus/outline-edit/offline/cold/read/page-004.xml b/corpus/outline-edit/offline/cold/read/page-004.xml index fc84dcf2d2d8d46ecb76ab6d1a9afe5713fa331c..22ecb7507fdbef018a7db69ed6057d5094e77248 100644 --- a/corpus/outline-edit/offline/cold/read/page-004.xml +++ b/corpus/outline-edit/offline/cold/read/page-004.xml @@ -1,5 +1,2 @@  -Target 🦀 é Link label]]>Child]]> + diff --git a/corpus/outline-edit/offline/cold/read/page-005.xml b/corpus/outline-edit/offline/cold/read/page-005.xml index 65b18bd345968995b34b8d54d092f6d45df726f1..98981ed576dda1252423ab842e702094e05bd7ea 100644 --- a/corpus/outline-edit/offline/cold/read/page-005.xml +++ b/corpus/outline-edit/offline/cold/read/page-005.xml @@ -1,5 +1,5 @@  -Target 🦀 é Link label]]>Child]]> +href="https://example.invalid/outline">Link label]]>Child]]> diff --git a/corpus/outline-edit/offline/cold/read/page-006.xml b/corpus/outline-edit/offline/cold/read/page-006.xml index f8a14bee6efb9f1df88c8dd6d78a1e6b60a34808..3e16b106dd4883ed7a485e5cb8fac2ef70172b01 100644 --- a/corpus/outline-edit/offline/cold/read/page-006.xml +++ b/corpus/outline-edit/offline/cold/read/page-006.xml @@ -1,5 +1,2 @@  -Target 🦀 é Link label]]>Child]]> + diff --git a/corpus/outline-edit/offline/cold/read/page-007.xml b/corpus/outline-edit/offline/cold/read/page-007.xml index 0c3c0b97cff7e771638fc0ee59778ec92a074070..57d259399a107cc313063636b4161d8b00dde712 100644 --- a/corpus/outline-edit/offline/cold/read/page-007.xml +++ b/corpus/outline-edit/offline/cold/read/page-007.xml @@ -1,5 +1,5 @@  -Target 🦀 é Link label]]>Child]]> +href="https://example.invalid/outline">Link label]]>Child]]> diff --git a/corpus/outline-edit/offline/cold/read/page-008.xml b/corpus/outline-edit/offline/cold/read/page-008.xml index 4a425d20db03d8ebdf3c5639ac9d1358ca4ab69f..7acc9909da694567d005fa78e975535f7d30ad30 100644 --- a/corpus/outline-edit/offline/cold/read/page-008.xml +++ b/corpus/outline-edit/offline/cold/read/page-008.xml @@ -1,2 +1,5 @@  - +Target 🦀 é Link label]]>Child]]> diff --git a/corpus/outline-edit/offline/cold/read/page-009.xml b/corpus/outline-edit/offline/cold/read/page-009.xml index 2e10eaeff992340702c39f5209ce5a82cd68fcb2..e024115764bc01675982636ec685757e63a6d2d4 100644 --- a/corpus/outline-edit/offline/cold/read/page-009.xml +++ b/corpus/outline-edit/offline/cold/read/page-009.xml @@ -1,4 +1,5 @@  -Target 🦀 é Link label]]> +href="https://example.invalid/outline">Link label]]>Child]]> diff --git a/corpus/outline-edit/offline/cold/read/page-010.xml b/corpus/outline-edit/offline/cold/read/page-010.xml index a1d53f47f159ab8288c69cc79036170a54d1d897..9962dbbc6532ccc644fb8accd9e4f8959dca455a 100644 --- a/corpus/outline-edit/offline/cold/read/page-010.xml +++ b/corpus/outline-edit/offline/cold/read/page-010.xml @@ -1,5 +1,2 @@  -Target 🦀 é Link label]]>Child]]> + diff --git a/corpus/outline-edit/offline/cold/read/page-011.xml b/corpus/outline-edit/offline/cold/read/page-011.xml index 0b524b2623a0e04b9a9dea0c6997240d04b7ad26..49201c6a35cf7b4187a290cd7bdb8368eae49899 100644 --- a/corpus/outline-edit/offline/cold/read/page-011.xml +++ b/corpus/outline-edit/offline/cold/read/page-011.xml @@ -1,2 +1,5 @@  - +Target 🦀 é Link label]]>Child]]> diff --git a/corpus/outline-edit/offline/cold/read/page-012.xml b/corpus/outline-edit/offline/cold/read/page-012.xml index 3cdeb076e5761dafb8999ba352bca4bfb67d7ad4..3e87b85118fa6ccf94a8a98b0c6c4a3e3d4de957 100644 --- a/corpus/outline-edit/offline/cold/read/page-012.xml +++ b/corpus/outline-edit/offline/cold/read/page-012.xml @@ -1,5 +1,5 @@  -Target 🦀 é Link label]]>Child]]> +href="https://example.invalid/outline">Link label]]>Child]]> diff --git a/corpus/outline-edit/offline/cold/read/page-013.xml b/corpus/outline-edit/offline/cold/read/page-013.xml index fe7126cf65360af6f16da4aa84e9916b2894258a..3d7acc220a814e9b2563baa7672fc5aeb30bc1d6 100644 --- a/corpus/outline-edit/offline/cold/read/page-013.xml +++ b/corpus/outline-edit/offline/cold/read/page-013.xml @@ -1,2 +1,20 @@  - +Bold 🦀 italic é color 東京
+End
]]>
Fictitious: café, 東京, مرحبا]]>
diff --git a/corpus/outline-edit/offline/cold/read/page-014.xml b/corpus/outline-edit/offline/cold/read/page-014.xml index 95cba123060980b973bd7a83c4437f5eb37b4d89..57d56d992230dfcdf655d40edbf0fe7607e0d5b3 100644 --- a/corpus/outline-edit/offline/cold/read/page-014.xml +++ b/corpus/outline-edit/offline/cold/read/page-014.xml @@ -1,5 +1,5 @@  -Target 🦀 é Link label]]>Child]]> +href="https://example.invalid/outline">Link label]]>Child]]> diff --git a/corpus/outline-edit/offline/cold/read/payloads.json b/corpus/outline-edit/offline/cold/read/payloads.json deleted file mode 120000 index 9e1be3e2b6d87478e7c48d278ecac8ee6c97f6d0..0000000000000000000000000000000000000000 --- a/corpus/outline-edit/offline/cold/read/payloads.json +++ /dev/null @@ -1 +0,0 @@ -../../../../paragraph-edit/before/read/payloads.json \ No newline at end of file diff --git a/corpus/outline-edit/offline/cold/read/payloads.json b/corpus/outline-edit/offline/cold/read/payloads.json new file mode 100644 index 0000000000000000000000000000000000000000..1ce91a413d6fff4d58765187b76756f0e97ae843 --- /dev/null +++ b/corpus/outline-edit/offline/cold/read/payloads.json @@ -0,0 +1,3 @@ +[ + +] \ No newline at end of file diff --git a/corpus/outline-edit/offline/cold/run.json b/corpus/outline-edit/offline/cold/run.json index afe77f78d76e0bc7a673bf8f335422d71457a911..e2e36384413daa846a304b449f4d69c4de1027e6 100644 --- a/corpus/outline-edit/offline/cold/run.json +++ b/corpus/outline-edit/offline/cold/run.json @@ -1,5 +1,5 @@ { - "notebook": "/Users/clo/dev/one/evidence/m10/offline-outline-candidate-01", + "notebook": "/private/tmp/m33/offline-outline/candidate", "expected_pages": 15, "author": null, "author_timeout_seconds": 600, diff --git a/corpus/outline-edit/offline/cold/scripts/cold.ps1 b/corpus/outline-edit/offline/cold/scripts/cold.ps1 deleted file mode 120000 index 5bc2f1837e1f0b639923a80b79c517c98c5c519a..0000000000000000000000000000000000000000 --- a/corpus/outline-edit/offline/cold/scripts/cold.ps1 +++ /dev/null @@ -1 +0,0 @@ -../../../../paragraph-edit/reconciliation/keyboard/scripts/cold.ps1 \ No newline at end of file diff --git a/corpus/outline-edit/offline/cold/scripts/cold.ps1 b/corpus/outline-edit/offline/cold/scripts/cold.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..a0b99e7aeb86f4dc10032537800501a52ad65b4f --- /dev/null +++ b/corpus/outline-edit/offline/cold/scripts/cold.ps1 @@ -0,0 +1,27 @@ +param([Parameter(Mandatory=$true)][string]$Root, [string]$CloneHost = '') +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' +$root = [IO.Path]::GetFullPath($Root).TrimEnd('\') +if ([IO.Path]::GetDirectoryName($root) -ne 'C:\one-tests\runs') { + throw 'Choose a run directly below C:\one-tests\runs.' +} +if (Get-Process ONENOTE -ErrorAction SilentlyContinue) { throw 'Close OneNote before resetting its test cache.' } +$key = 'HKCU:\Software\Microsoft\Office\14.0\OneNote' +if ($CloneHost) { + if ($CloneHost -notmatch '^ONE-[A-Z0-9-]+$' -or [Environment]::MachineName -ne $CloneHost) { + throw 'The disposable clone hostname does not match this machine.' + } + New-Item "$key\Options\Paths" -Force | Out-Null + New-ItemProperty "$key\Options\Paths" -Name UnfiledNotesSection -PropertyType ExpandString -Value 'C:\one-tests\Loose.one' -Force | Out-Null +} elseif ((Get-ItemProperty "$key\Options\Paths").UnfiledNotesSection -ne 'C:\one-tests\Loose.one' -or + -not (Test-Path 'C:\one-tests\profile-original-cache')) { + throw 'Park the personal OneNote profile before resetting the test cache.' +} +$cache = Join-Path $env:LOCALAPPDATA 'Microsoft\OneNote\14.0' +$parked = Join-Path 'C:\one-tests\caches' ([IO.Path]::GetFileName($root)) +if (Test-Path $parked) { throw 'Choose a new run; its parked cache already exists.' } +New-Item -ItemType Directory -Path 'C:\one-tests\caches' -Force | Out-Null +if (Test-Path $cache) { Move-Item -LiteralPath $cache -Destination $parked } +if (Test-Path "$key\OpenNotebooks") { Remove-Item "$key\OpenNotebooks" -Recurse } +New-Item "$key\OpenNotebooks" | Out-Null +New-ItemProperty "$key\OpenNotebooks" -Name '1' -PropertyType String -Value "$root\notebook" | Out-Null diff --git a/corpus/outline-edit/offline/cold/scripts/read.ps1 b/corpus/outline-edit/offline/cold/scripts/read.ps1 deleted file mode 120000 index 85257c76cede599f47da88e69419a767dd6b99ee..0000000000000000000000000000000000000000 --- a/corpus/outline-edit/offline/cold/scripts/read.ps1 +++ /dev/null @@ -1 +0,0 @@ -../../../../paragraph-edit/reconciliation/keyboard/scripts/read.ps1 \ No newline at end of file diff --git a/corpus/outline-edit/offline/cold/scripts/read.ps1 b/corpus/outline-edit/offline/cold/scripts/read.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..476094ab1e0c47077988a6461db2080cf208642b --- /dev/null +++ b/corpus/outline-edit/offline/cold/scripts/read.ps1 @@ -0,0 +1,142 @@ +param( + [Parameter(Mandatory=$true)][string]$Root, + [int]$ExpectedPages = -1, + [switch]$UseCurrentCache, + [switch]$Pdf, + [switch]$KeepOpen, + [string]$CloneHost = '' +) +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' +$root = [IO.Path]::GetFullPath($Root).TrimEnd('\') +if ([IO.Path]::GetDirectoryName($root) -ne 'C:\one-tests\runs') { + throw 'Choose a run directly below C:\one-tests\runs.' +} +$notebook = Join-Path $root 'notebook' +$output = Join-Path $root 'read' +if (Test-Path $output) { throw 'Choose a new read destination.' } +if ($UseCurrentCache) { + if ((Get-ItemProperty 'HKCU:\Software\Microsoft\Office\14.0\OneNote\Options\Paths').UnfiledNotesSection -ne 'C:\one-tests\Loose.one') { + throw 'Park the personal OneNote profile before reading test notebooks.' + } +} else { + & "$PSScriptRoot\cold-current.ps1" -Root $root -CloneHost $CloneHost +} +New-Item -ItemType Directory -Path $output | Out-Null +$app = New-Object -ComObject OneNote.Application +$notebookId = '' +$failure = $null +try { + $app.OpenHierarchy($notebook, '', [ref]$notebookId, 0) + $process = Get-Process ONENOTE + @{ hostname = [Environment]::MachineName; onenote = $process.MainModule.FileVersionInfo.FileVersion; + powershell = $PSVersionTable.PSVersion.ToString(); schema = 'xs2010'; cold = (-not $UseCurrentCache.IsPresent) } | + ConvertTo-Json | Set-Content (Join-Path $output 'environment.json') -Encoding UTF8 + $sections = @() + foreach ($file in @(Get-ChildItem $notebook -Recurse | Where-Object { $_.Extension -eq '.one' })) { + $id = '' + $app.OpenHierarchy($file.FullName, '', [ref]$id, 0) + $sections += $id + } + $deadline = [DateTime]::UtcNow.AddSeconds(300) + $previous = '' + $lastChange = '' + $stableSince = [DateTime]::UtcNow + $settled = $false + do { + $pages = @{} + foreach ($section in $sections) { + $hierarchy = '' + $app.GetHierarchy($section, 4, [ref]$hierarchy, 1) + [xml]$xml = $hierarchy + foreach ($node in $xml.SelectNodes('//*[@path]')) { + if (-not $node.GetAttribute('path').StartsWith("$notebook\", [StringComparison]::OrdinalIgnoreCase)) { + throw 'OneNote opened a section outside the copied notebook.' + } + } + foreach ($node in $xml.SelectNodes('//*[local-name()="Page"]')) { + $id = $node.GetAttribute('ID') + $content = '' + $app.GetPageContent($id, [ref]$content, 1, 1) + $pages[$id] = $content + } + } + $signature = [String]::Join('|', @($pages.Keys | Sort-Object | ForEach-Object { $_ + $pages[$_] })) + if ($signature -ne $previous) { + $lastChange = $previous + $previous = $signature + $stableSince = [DateTime]::UtcNow + } + if ((($ExpectedPages -ge 0 -and $pages.Count -eq $ExpectedPages) -or + ($ExpectedPages -lt 0 -and $pages.Count -gt 0)) -and + ([DateTime]::UtcNow - $stableSince).TotalSeconds -ge 2) { $settled = $true; break } + Start-Sleep -Milliseconds 250 + } while ([DateTime]::UtcNow -lt $deadline) + if (-not $settled -or ($ExpectedPages -ge 0 -and $pages.Count -ne $ExpectedPages) -or ($ExpectedPages -lt 0 -and $pages.Count -eq 0)) { + [IO.File]::WriteAllText((Join-Path $output 'previous-signature.txt'), $lastChange, [Text.Encoding]::UTF8) + $index = 0 + foreach ($id in @($pages.Keys | Sort-Object)) { + [IO.File]::WriteAllText((Join-Path $output ('unsettled-{0:d3}.xml' -f $index)), $pages[$id], [Text.Encoding]::UTF8) + $index++ + } + $hierarchy = '' + $app.GetHierarchy($notebookId, 4, [ref]$hierarchy, 1) + [IO.File]::WriteAllText((Join-Path $output 'unsettled-hierarchy.xml'), $hierarchy, [Text.Encoding]::UTF8) + throw "Expected $ExpectedPages stable pages; OneNote returned $($pages.Count), settled=$settled." + } + $index = 0 + $payloads = @() + foreach ($id in @($pages.Keys | Sort-Object)) { + [IO.File]::WriteAllText((Join-Path $output ('page-{0:d3}.xml' -f $index)), $pages[$id], [Text.Encoding]::UTF8) + if ($Pdf) { + $pdfPath = Join-Path $output ('page-{0:d3}.pdf' -f $index) + $app.NavigateTo($id, '', $false) + $app.Publish($id, $pdfPath, 3, '') + if (-not (Test-Path $pdfPath) -or (Get-Item $pdfPath).Length -eq 0) { throw 'OneNote did not publish the page PDF.' } + } + [xml]$page = $pages[$id] + foreach ($file in $page.SelectNodes('//*[local-name()="InsertedFile" or local-name()="MediaFile"]')) { + $bytes = [IO.File]::ReadAllBytes($file.GetAttribute('pathCache')) + $hash = [BitConverter]::ToString([Security.Cryptography.SHA256]::Create().ComputeHash($bytes)).Replace('-', '').ToLowerInvariant() + [IO.File]::WriteAllBytes((Join-Path $output ($hash + '.attachment')), $bytes) + $payloads += @{ page = $id; object = $file.ParentNode.GetAttribute('objectID'); + kind = $file.LocalName; name = $file.GetAttribute('preferredName'); + sha256 = $hash; bytes = $bytes.Length } + } + $index++ + } + [IO.File]::WriteAllText((Join-Path $output 'payloads.json'), (ConvertTo-Json -InputObject $payloads -Depth 4), [Text.Encoding]::UTF8) + $all = '' + $app.GetHierarchy($notebookId, 4, [ref]$all, 1) + [xml]$finalTree = $all + $finalIds = @($finalTree.SelectNodes('//*[local-name()="Page"]') | ForEach-Object { $_.GetAttribute('ID') } | Sort-Object -Unique) + if ($finalIds.Count -ne $pages.Count -or @($finalIds | Where-Object { -not $pages.ContainsKey($_) }).Count -ne 0) { + throw 'The notebook hierarchy changed while collecting page evidence; repeat the cold read.' + } + [IO.File]::WriteAllText((Join-Path $output 'hierarchy.xml'), $all, [Text.Encoding]::UTF8) + Write-Output "Read $($sections.Count) sections and $($pages.Count) pages." +} catch { + $failure = $_ + [IO.File]::WriteAllText((Join-Path $output 'failure.txt'), ($_ | Out-String), [Text.Encoding]::UTF8) + throw +} finally { + try { + try { + if ($notebookId -and $CloneHost) { $app.SyncHierarchy($notebookId) } + if ($notebookId -and -not $KeepOpen -and (-not $UseCurrentCache -or $CloneHost)) { + $app.CloseNotebook($notebookId, $false) + } + } catch { + if ($null -eq $failure) { throw } + [IO.File]::WriteAllText((Join-Path $output 'cleanup-failure.txt'), ($_ | Out-String), [Text.Encoding]::UTF8) + } + } finally { + [void][Runtime.InteropServices.Marshal]::FinalReleaseComObject($app) + } + $app = $null + [GC]::Collect() + [GC]::WaitForPendingFinalizers() + if (-not $UseCurrentCache -and -not $CloneHost) { + Get-Process ONENOTE -ErrorAction SilentlyContinue | Wait-Process -Timeout 10 + } +} diff --git a/corpus/outline-edit/offline/cold/source.json b/corpus/outline-edit/offline/cold/source.json index c24898bd5a570d771a210ecb1fd572535e985442..f47716a131e8bb12e2bbec02ac756bf417dfaa18 100644 --- a/corpus/outline-edit/offline/cold/source.json +++ b/corpus/outline-edit/offline/cold/source.json @@ -1,8 +1,8 @@ [ { "path": "synthetic.one", - "bytes": 149936, - "sha256": "608532b4ef9be3cbeac3c0ec9b7e624a96aa4ce0ce6c0f86837933703e61fd0c", - "mtime_ns": 1788894002037909008 + "bytes": 151272, + "sha256": "c7597855c339b53c41023864a8365aebd22af36afcf0964e7bbee49a87c5cf31", + "mtime_ns": 1789121631571331942 } ] diff --git a/corpus/page-lifecycle/offline-edits/README.md b/corpus/page-lifecycle/offline-edits/README.md index 229eb140c29c299bc9b09d8d7eb68fccf6735fef..b14bf0aabd9b55fdd976c4d877580ce8b049667e 100644 --- a/corpus/page-lifecycle/offline-edits/README.md +++ b/corpus/page-lifecycle/offline-edits/README.md @@ -24,9 +24,9 @@ captures, source hashes, scripts, base image and clone removal. Reproduce candidates with new absolute output directories: ```sh -ONESTORE_OFFLINE_PAGE_EDIT_OUTPUT=/tmp/one-page-edits cargo test -p onestore-offline --all-features --test sync pages::native_page_changes_reconcile_with_atomic_offline_batches_and_review -- --exact +ONESTORE_OFFLINE_PAGE_EDIT_OUTPUT=/tmp/one-page-edits cargo test -p notebook --all-features --test sync_pages native_page_changes_reconcile_with_atomic_offline_batches_and_review -- --exact python tools/offline_page_edits.py /tmp/one-page-edits /tmp/one-page-edits-cold --workers 4 -ONESTORE_OFFLINE_PAGE_CLIENT_OUTPUT=/tmp/one-page-clients cargo test -p onestore-offline --all-features --test sync pages::twelve_disjoint_page_batches_merge_with_dependent_bodies_without_review -- --exact +ONESTORE_OFFLINE_PAGE_CLIENT_OUTPUT=/tmp/one-page-clients cargo test -p notebook --all-features --test sync_pages twelve_disjoint_page_batches_merge_with_dependent_bodies_without_review -- --exact python tools/native_runner.py /tmp/one-page-clients /tmp/one-page-clients-cold --expected-pages 37 --collect-notebook ``` diff --git a/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/candidate/Lifecycle.one b/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/candidate/Lifecycle.one index a5f9214f1d6f124243acbf2deece1042eb54b0ed..bbf1e7fea73127ac8b1484ab9dfede4c0750870e 100644 Binary files a/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/candidate/Lifecycle.one and b/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/candidate/Lifecycle.one differ diff --git a/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/candidate/manifest.json b/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/candidate/manifest.json index a2e59f7c6b0534d4baf1b7c839a80bc0f1be89ab..a5cf8eefe641be3d809dd5d24b292895c16cf90c 100644 --- a/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/candidate/manifest.json +++ b/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/candidate/manifest.json @@ -5,22 +5,22 @@ "original": [ { "guid": [ - 252, - 123, - 153, - 77, - 36, - 185, - 51, - 68, - 157, - 175, - 43, - 0, - 120, - 23, - 139, - 98 + 219, + 78, + 214, + 48, + 121, + 246, + 240, + 69, + 149, + 46, + 231, + 118, + 35, + 65, + 22, + 1 ], "level": 1, "position": { @@ -30,22 +30,22 @@ }, { "guid": [ - 98, - 233, - 125, - 166, + 171, + 101, + 57, + 44, + 136, + 41, + 110, + 77, + 163, + 43, + 21, + 253, + 184, 225, - 132, - 140, - 70, - 165, - 161, - 117, - 217, - 23, - 3, - 116, - 120 + 42, + 59 ], "level": 2, "position": { @@ -55,22 +55,22 @@ }, { "guid": [ - 239, - 150, - 201, - 240, - 46, - 241, - 31, - 69, - 183, - 57, - 169, - 176, - 1, - 44, - 199, - 228 + 128, + 194, + 10, + 70, + 22, + 20, + 11, + 72, + 172, + 110, + 58, + 149, + 244, + 136, + 167, + 93 ], "level": 3, "position": { @@ -79,28 +79,28 @@ "space": "{8A6DBA48-33BB-0681-2F02-2C73A811E8B8},1" } ], - "page_receipt": "Some(Published { revision: ExGuid { guid: [45, 245, 5, 231, 195, 155, 59, 69, 132, 30, 135, 57, 44, 58, 98, 121], n: 1 } })", + "page_receipt": "Some(Published { revision: ExGuid { guid: [103, 5, 75, 15, 56, 115, 249, 78, 186, 144, 249, 24, 8, 153, 139, 52], n: 1 } })", "phase": "01-demoted-parent", "publications": 2, "reviewed": [ { "guid": [ - 252, - 123, - 153, - 77, - 36, - 185, - 51, - 68, - 157, - 175, - 43, - 0, - 120, - 23, - 139, - 98 + 219, + 78, + 214, + 48, + 121, + 246, + 240, + 69, + 149, + 46, + 231, + 118, + 35, + 65, + 22, + 1 ], "level": 1, "position": { @@ -110,22 +110,22 @@ }, { "guid": [ - 98, - 233, - 125, - 166, + 171, + 101, + 57, + 44, + 136, + 41, + 110, + 77, + 163, + 43, + 21, + 253, + 184, 225, - 132, - 140, - 70, - 165, - 161, - 117, - 217, - 23, - 3, - 116, - 120 + 42, + 59 ], "level": 2, "position": { @@ -135,22 +135,22 @@ }, { "guid": [ - 239, - 150, - 201, - 240, - 46, - 241, - 31, - 69, - 183, - 57, - 169, - 176, - 1, - 44, - 199, - 228 + 128, + 194, + 10, + 70, + 22, + 20, + 11, + 72, + 172, + 110, + 58, + 149, + 244, + 136, + 167, + 93 ], "level": 3, "position": { @@ -159,5 +159,5 @@ "space": "{8A6DBA48-33BB-0681-2F02-2C73A811E8B8},1" } ], - "text_receipt": "Some(Published { revision: ExGuid { guid: [158, 168, 187, 37, 45, 131, 162, 76, 190, 222, 10, 76, 236, 19, 235, 183], n: 1 } })" + "text_receipt": "Some(Published { revision: ExGuid { guid: [78, 56, 3, 211, 18, 210, 109, 71, 180, 97, 192, 231, 132, 214, 169, 26], n: 1 } })" } \ No newline at end of file diff --git a/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/commands.jsonl b/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/commands.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..f9973a2184f84e8933730b45ee32fe3d8dba768d --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/commands.jsonl @@ -0,0 +1,3 @@ +{"command": "powershell -NoProfile -Command \"Expand-Archive -LiteralPath C:\\one-tests\\transfer.zip -DestinationPath C:\\one-tests\\runs\\capture\\notebook\"", "exit": 0, "stdout": "", "stderr": "", "error": null} +{"command": "powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -File C:\\one-tests\\read-current.ps1 -Root C:\\one-tests\\runs\\capture -CloneHost ONE-M6-E8220F62 -ExpectedPages 9", "exit": 0, "stdout": "Read 1 sections and 9 pages.\r\n", "stderr": "", "error": null} +{"command": "powershell -NoProfile -Command \"Compress-Archive -Force -Path C:\\one-tests\\runs\\capture\\* -DestinationPath C:\\one-tests\\captured.zip\"", "exit": 0, "stdout": "", "stderr": "", "error": null} diff --git a/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/machine.json b/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/machine.json new file mode 100644 index 0000000000000000000000000000000000000000..bcd3154b5daa0915e9b9f049231288f1d0198186 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/machine.json @@ -0,0 +1 @@ +{"name": "m6-e8220f62", "hostname": "ONE-M6-E8220F62"} diff --git a/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/notebook/Lifecycle.one b/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/notebook/Lifecycle.one index 80f1e99b69c3e9adc7c434113a25aee76c55207e..f8bc51debe202b5883c6e7e236a572c4ce56b404 100644 Binary files a/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/notebook/Lifecycle.one and b/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/notebook/Lifecycle.one differ diff --git a/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/notebook/Open Notebook.onetoc2 b/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/notebook/Open Notebook.onetoc2 new file mode 100644 index 0000000000000000000000000000000000000000..4ee0b2f5633446696fe370bcf4ab11a00cc9b97d Binary files /dev/null and b/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/notebook/Open Notebook.onetoc2 differ diff --git a/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/read/environment.json b/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/read/environment.json new file mode 100644 index 0000000000000000000000000000000000000000..6b413be795aa8233a06acbf0f1edade4401b1313 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/read/environment.json @@ -0,0 +1,7 @@ +{ + "powershell": "5.1.14409.1005", + "schema": "xs2010", + "hostname": "ONE-M6-E8220F62", + "cold": true, + "onenote": "14.0.4763.1000" +} diff --git a/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/read/hierarchy.xml b/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/read/hierarchy.xml index 8ddbea76bb664363d095779528aa88347d14dd60..702becda49cd3a1e37891176b0a0e2aac9bc71ec 100644 --- a/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/read/hierarchy.xml +++ b/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/read/hierarchy.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/read/page-000.xml b/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/read/page-000.xml index 3ee348a35859185d865152b1eaf187df0ec1474d..10df27db05a3540158b2661dfefe4b226c90dc68 100644 --- a/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/read/page-000.xml +++ b/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/read/page-000.xml @@ -1,2 +1,4 @@  - +Body grandchild 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/read/page-001.xml b/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/read/page-001.xml index 12e634fad1f842455d581e11d8dfd37c842a9d6e..b8bf6f81e1c7439e195e2dfe4399f83cdb4f7d0e 100644 --- a/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/read/page-001.xml +++ b/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/read/page-001.xml @@ -1,2 +1,4 @@  - +Offline Body parent 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/read/page-002.xml b/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/read/page-002.xml index 85216cfdc05263624742fe73ce0d7c08165c340b..b38abb01cb797021743afd1b7a056815988e4254 100644 --- a/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/read/page-002.xml +++ b/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/read/page-002.xml @@ -1,4 +1,2 @@  -Body grandchild 🦀 é preserved]]> + diff --git a/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/read/page-003.xml b/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/read/page-003.xml index 20740711b6cc7e8fe8fe29c6bb4de61f5e8c8517..f08eb1c61412117a204e615580f3c08c8d91c2f7 100644 --- a/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/read/page-003.xml +++ b/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/read/page-003.xml @@ -1,4 +1,2 @@  -Offline Body parent 🦀 é preserved]]> + diff --git a/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/read/page-004.xml b/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/read/page-004.xml index d32f327d6c8a91806bfac5bff526356135178802..6d6d59a72119256e28ad0e1784a50227d6c2cc7f 100644 --- a/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/read/page-004.xml +++ b/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/read/page-004.xml @@ -1,2 +1,4 @@  - +Body child 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/read/page-005.xml b/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/read/page-005.xml index d60aad063d3af51798dd95027f7d15ed704868bb..7f938e968ea04a97bbc6d0ccc9a45a0ff6cae5e9 100644 --- a/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/read/page-005.xml +++ b/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/read/page-005.xml @@ -1,4 +1,2 @@  -Body child 🦀 é preserved]]> + diff --git a/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/read/page-006.xml b/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/read/page-006.xml index c63d9a1990243b8a47c5238a44ba7fd6cb62c339..225fb96e1c3421a9e4d6e4a0a48ae3a27510f53f 100644 --- a/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/read/page-006.xml +++ b/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/read/page-006.xml @@ -1,4 +1,4 @@  -Body trailing 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/read/page-007.xml b/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/read/page-007.xml index 797255f7f07481ec6a652be069428287c508a4fa..c43e33a0e71b2671be64806bde5d0fab076261d4 100644 --- a/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/read/page-007.xml +++ b/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/read/page-007.xml @@ -1,4 +1,4 @@  -Body duplicate 🦀 éBody automatic 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/read/page-008.xml b/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/read/page-008.xml index d25e3ec6e0fd06cbc6a68c9a425e4d1e09677ad4..1719fdb588ae76cd99041a85607817255c34129c 100644 --- a/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/read/page-008.xml +++ b/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/read/page-008.xml @@ -1,4 +1,4 @@  -Body automatic 🦀 éBody duplicate 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/read/payloads.json b/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/read/payloads.json new file mode 100644 index 0000000000000000000000000000000000000000..1ce91a413d6fff4d58765187b76756f0e97ae843 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/read/payloads.json @@ -0,0 +1,3 @@ +[ + +] \ No newline at end of file diff --git a/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/run.json b/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/run.json new file mode 100644 index 0000000000000000000000000000000000000000..de4c9be215186b9443aad14aacd6d083a0706966 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/run.json @@ -0,0 +1,18 @@ +{ + "notebook": "/private/var/folders/90/4f4rngds01j55ggdj_vglk_c0000gn/T/tmpbu44alfu", + "expected_pages": 9, + "author": null, + "author_timeout_seconds": 600, + "inspect": false, + "collect_notebook": true, + "base": { + "file": "win7-office-base.qcow2", + "format": "qcow2", + "sha256": "a1a4f8fab782ee14885ff801ca2f6347c208fdcfc3513637096f314315c89346", + "virtual_size": 68719476736 + }, + "scripts": { + "cold.ps1": "c177fc72ae6c2634d186f5671a880de20b09f9716532c37c69cb13aa15c7e331", + "read.ps1": "04013bfcccee40a17e2a225f9b9e96f40a3a8daad9e350609654f8eda3ccbb41" + } +} diff --git a/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/scripts/cold.ps1 b/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/scripts/cold.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..a0b99e7aeb86f4dc10032537800501a52ad65b4f --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/scripts/cold.ps1 @@ -0,0 +1,27 @@ +param([Parameter(Mandatory=$true)][string]$Root, [string]$CloneHost = '') +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' +$root = [IO.Path]::GetFullPath($Root).TrimEnd('\') +if ([IO.Path]::GetDirectoryName($root) -ne 'C:\one-tests\runs') { + throw 'Choose a run directly below C:\one-tests\runs.' +} +if (Get-Process ONENOTE -ErrorAction SilentlyContinue) { throw 'Close OneNote before resetting its test cache.' } +$key = 'HKCU:\Software\Microsoft\Office\14.0\OneNote' +if ($CloneHost) { + if ($CloneHost -notmatch '^ONE-[A-Z0-9-]+$' -or [Environment]::MachineName -ne $CloneHost) { + throw 'The disposable clone hostname does not match this machine.' + } + New-Item "$key\Options\Paths" -Force | Out-Null + New-ItemProperty "$key\Options\Paths" -Name UnfiledNotesSection -PropertyType ExpandString -Value 'C:\one-tests\Loose.one' -Force | Out-Null +} elseif ((Get-ItemProperty "$key\Options\Paths").UnfiledNotesSection -ne 'C:\one-tests\Loose.one' -or + -not (Test-Path 'C:\one-tests\profile-original-cache')) { + throw 'Park the personal OneNote profile before resetting the test cache.' +} +$cache = Join-Path $env:LOCALAPPDATA 'Microsoft\OneNote\14.0' +$parked = Join-Path 'C:\one-tests\caches' ([IO.Path]::GetFileName($root)) +if (Test-Path $parked) { throw 'Choose a new run; its parked cache already exists.' } +New-Item -ItemType Directory -Path 'C:\one-tests\caches' -Force | Out-Null +if (Test-Path $cache) { Move-Item -LiteralPath $cache -Destination $parked } +if (Test-Path "$key\OpenNotebooks") { Remove-Item "$key\OpenNotebooks" -Recurse } +New-Item "$key\OpenNotebooks" | Out-Null +New-ItemProperty "$key\OpenNotebooks" -Name '1' -PropertyType String -Value "$root\notebook" | Out-Null diff --git a/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/scripts/read.ps1 b/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/scripts/read.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..476094ab1e0c47077988a6461db2080cf208642b --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/scripts/read.ps1 @@ -0,0 +1,142 @@ +param( + [Parameter(Mandatory=$true)][string]$Root, + [int]$ExpectedPages = -1, + [switch]$UseCurrentCache, + [switch]$Pdf, + [switch]$KeepOpen, + [string]$CloneHost = '' +) +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' +$root = [IO.Path]::GetFullPath($Root).TrimEnd('\') +if ([IO.Path]::GetDirectoryName($root) -ne 'C:\one-tests\runs') { + throw 'Choose a run directly below C:\one-tests\runs.' +} +$notebook = Join-Path $root 'notebook' +$output = Join-Path $root 'read' +if (Test-Path $output) { throw 'Choose a new read destination.' } +if ($UseCurrentCache) { + if ((Get-ItemProperty 'HKCU:\Software\Microsoft\Office\14.0\OneNote\Options\Paths').UnfiledNotesSection -ne 'C:\one-tests\Loose.one') { + throw 'Park the personal OneNote profile before reading test notebooks.' + } +} else { + & "$PSScriptRoot\cold-current.ps1" -Root $root -CloneHost $CloneHost +} +New-Item -ItemType Directory -Path $output | Out-Null +$app = New-Object -ComObject OneNote.Application +$notebookId = '' +$failure = $null +try { + $app.OpenHierarchy($notebook, '', [ref]$notebookId, 0) + $process = Get-Process ONENOTE + @{ hostname = [Environment]::MachineName; onenote = $process.MainModule.FileVersionInfo.FileVersion; + powershell = $PSVersionTable.PSVersion.ToString(); schema = 'xs2010'; cold = (-not $UseCurrentCache.IsPresent) } | + ConvertTo-Json | Set-Content (Join-Path $output 'environment.json') -Encoding UTF8 + $sections = @() + foreach ($file in @(Get-ChildItem $notebook -Recurse | Where-Object { $_.Extension -eq '.one' })) { + $id = '' + $app.OpenHierarchy($file.FullName, '', [ref]$id, 0) + $sections += $id + } + $deadline = [DateTime]::UtcNow.AddSeconds(300) + $previous = '' + $lastChange = '' + $stableSince = [DateTime]::UtcNow + $settled = $false + do { + $pages = @{} + foreach ($section in $sections) { + $hierarchy = '' + $app.GetHierarchy($section, 4, [ref]$hierarchy, 1) + [xml]$xml = $hierarchy + foreach ($node in $xml.SelectNodes('//*[@path]')) { + if (-not $node.GetAttribute('path').StartsWith("$notebook\", [StringComparison]::OrdinalIgnoreCase)) { + throw 'OneNote opened a section outside the copied notebook.' + } + } + foreach ($node in $xml.SelectNodes('//*[local-name()="Page"]')) { + $id = $node.GetAttribute('ID') + $content = '' + $app.GetPageContent($id, [ref]$content, 1, 1) + $pages[$id] = $content + } + } + $signature = [String]::Join('|', @($pages.Keys | Sort-Object | ForEach-Object { $_ + $pages[$_] })) + if ($signature -ne $previous) { + $lastChange = $previous + $previous = $signature + $stableSince = [DateTime]::UtcNow + } + if ((($ExpectedPages -ge 0 -and $pages.Count -eq $ExpectedPages) -or + ($ExpectedPages -lt 0 -and $pages.Count -gt 0)) -and + ([DateTime]::UtcNow - $stableSince).TotalSeconds -ge 2) { $settled = $true; break } + Start-Sleep -Milliseconds 250 + } while ([DateTime]::UtcNow -lt $deadline) + if (-not $settled -or ($ExpectedPages -ge 0 -and $pages.Count -ne $ExpectedPages) -or ($ExpectedPages -lt 0 -and $pages.Count -eq 0)) { + [IO.File]::WriteAllText((Join-Path $output 'previous-signature.txt'), $lastChange, [Text.Encoding]::UTF8) + $index = 0 + foreach ($id in @($pages.Keys | Sort-Object)) { + [IO.File]::WriteAllText((Join-Path $output ('unsettled-{0:d3}.xml' -f $index)), $pages[$id], [Text.Encoding]::UTF8) + $index++ + } + $hierarchy = '' + $app.GetHierarchy($notebookId, 4, [ref]$hierarchy, 1) + [IO.File]::WriteAllText((Join-Path $output 'unsettled-hierarchy.xml'), $hierarchy, [Text.Encoding]::UTF8) + throw "Expected $ExpectedPages stable pages; OneNote returned $($pages.Count), settled=$settled." + } + $index = 0 + $payloads = @() + foreach ($id in @($pages.Keys | Sort-Object)) { + [IO.File]::WriteAllText((Join-Path $output ('page-{0:d3}.xml' -f $index)), $pages[$id], [Text.Encoding]::UTF8) + if ($Pdf) { + $pdfPath = Join-Path $output ('page-{0:d3}.pdf' -f $index) + $app.NavigateTo($id, '', $false) + $app.Publish($id, $pdfPath, 3, '') + if (-not (Test-Path $pdfPath) -or (Get-Item $pdfPath).Length -eq 0) { throw 'OneNote did not publish the page PDF.' } + } + [xml]$page = $pages[$id] + foreach ($file in $page.SelectNodes('//*[local-name()="InsertedFile" or local-name()="MediaFile"]')) { + $bytes = [IO.File]::ReadAllBytes($file.GetAttribute('pathCache')) + $hash = [BitConverter]::ToString([Security.Cryptography.SHA256]::Create().ComputeHash($bytes)).Replace('-', '').ToLowerInvariant() + [IO.File]::WriteAllBytes((Join-Path $output ($hash + '.attachment')), $bytes) + $payloads += @{ page = $id; object = $file.ParentNode.GetAttribute('objectID'); + kind = $file.LocalName; name = $file.GetAttribute('preferredName'); + sha256 = $hash; bytes = $bytes.Length } + } + $index++ + } + [IO.File]::WriteAllText((Join-Path $output 'payloads.json'), (ConvertTo-Json -InputObject $payloads -Depth 4), [Text.Encoding]::UTF8) + $all = '' + $app.GetHierarchy($notebookId, 4, [ref]$all, 1) + [xml]$finalTree = $all + $finalIds = @($finalTree.SelectNodes('//*[local-name()="Page"]') | ForEach-Object { $_.GetAttribute('ID') } | Sort-Object -Unique) + if ($finalIds.Count -ne $pages.Count -or @($finalIds | Where-Object { -not $pages.ContainsKey($_) }).Count -ne 0) { + throw 'The notebook hierarchy changed while collecting page evidence; repeat the cold read.' + } + [IO.File]::WriteAllText((Join-Path $output 'hierarchy.xml'), $all, [Text.Encoding]::UTF8) + Write-Output "Read $($sections.Count) sections and $($pages.Count) pages." +} catch { + $failure = $_ + [IO.File]::WriteAllText((Join-Path $output 'failure.txt'), ($_ | Out-String), [Text.Encoding]::UTF8) + throw +} finally { + try { + try { + if ($notebookId -and $CloneHost) { $app.SyncHierarchy($notebookId) } + if ($notebookId -and -not $KeepOpen -and (-not $UseCurrentCache -or $CloneHost)) { + $app.CloseNotebook($notebookId, $false) + } + } catch { + if ($null -eq $failure) { throw } + [IO.File]::WriteAllText((Join-Path $output 'cleanup-failure.txt'), ($_ | Out-String), [Text.Encoding]::UTF8) + } + } finally { + [void][Runtime.InteropServices.Marshal]::FinalReleaseComObject($app) + } + $app = $null + [GC]::Collect() + [GC]::WaitForPendingFinalizers() + if (-not $UseCurrentCache -and -not $CloneHost) { + Get-Process ONENOTE -ErrorAction SilentlyContinue | Wait-Process -Timeout 10 + } +} diff --git a/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/source.json b/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/source.json new file mode 100644 index 0000000000000000000000000000000000000000..11ac61d07f260f42639babe8fb2e7372ebc796f1 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/source.json @@ -0,0 +1,8 @@ +[ + { + "path": "Lifecycle.one", + "bytes": 61168, + "sha256": "b0fd7dc60d8bb7d26310e363f8ec9269651bf1c6bccce6465b292978e6c932ce", + "mtime_ns": 1789121644250856649 + } +] diff --git a/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/teardown.json b/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/teardown.json new file mode 100644 index 0000000000000000000000000000000000000000..05a47793de40f322e745c4c4183727e3590ecf70 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-01-demoted-parent/cold/teardown.json @@ -0,0 +1 @@ +{"absent": true} diff --git a/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/candidate/Lifecycle.one b/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/candidate/Lifecycle.one index 353b3b73aca4f83700b1a37ca34883680a4f7e88..7157c9767ed919aea696ce02e17b6d4d64389f09 100644 Binary files a/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/candidate/Lifecycle.one and b/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/candidate/Lifecycle.one differ diff --git a/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/candidate/manifest.json b/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/candidate/manifest.json index 0a91ee206e09713c25317a6d6e58133d910125ec..395613a07fd1cf32f39e38a6a17f638775d9ac70 100644 --- a/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/candidate/manifest.json +++ b/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/candidate/manifest.json @@ -5,22 +5,22 @@ "original": [ { "guid": [ - 205, - 25, - 35, - 174, - 21, - 169, - 174, + 68, + 176, + 77, + 20, + 183, + 9, + 54, + 75, + 168, + 116, 72, - 182, - 223, - 57, - 112, - 191, - 108, - 153, - 199 + 109, + 49, + 21, + 21, + 17 ], "level": 1, "position": { @@ -30,22 +30,22 @@ }, { "guid": [ - 59, - 191, - 216, - 214, - 87, - 39, - 49, - 64, - 147, - 84, - 80, - 127, - 29, - 240, 132, - 241 + 65, + 94, + 115, + 140, + 181, + 53, + 79, + 149, + 192, + 118, + 105, + 127, + 89, + 100, + 201 ], "level": 2, "position": { @@ -55,22 +55,22 @@ }, { "guid": [ - 111, - 54, - 53, - 101, - 131, + 92, + 74, + 109, + 169, + 47, + 35, + 107, + 73, + 130, + 118, + 81, 37, - 42, - 79, - 140, - 237, - 226, - 118, - 126, - 82, - 234, - 186 + 128, + 161, + 143, + 254 ], "level": 3, "position": { @@ -79,28 +79,28 @@ "space": "{8A6DBA48-33BB-0681-2F02-2C73A811E8B8},1" } ], - "page_receipt": "Some(Published { revision: ExGuid { guid: [67, 193, 171, 179, 22, 209, 32, 71, 157, 84, 15, 231, 121, 87, 141, 208], n: 1 } })", + "page_receipt": "Some(Published { revision: ExGuid { guid: [69, 197, 41, 73, 240, 242, 167, 75, 159, 32, 34, 137, 246, 238, 110, 191], n: 1 } })", "phase": "02-promoted-parent", "publications": 2, "reviewed": [ { "guid": [ - 205, - 25, - 35, - 174, - 21, - 169, - 174, + 68, + 176, + 77, + 20, + 183, + 9, + 54, + 75, + 168, + 116, 72, - 182, - 223, - 57, - 112, - 191, - 108, - 153, - 199 + 109, + 49, + 21, + 21, + 17 ], "level": 1, "position": { @@ -110,22 +110,22 @@ }, { "guid": [ - 59, - 191, - 216, - 214, - 87, - 39, - 49, - 64, - 147, - 84, - 80, - 127, - 29, - 240, 132, - 241 + 65, + 94, + 115, + 140, + 181, + 53, + 79, + 149, + 192, + 118, + 105, + 127, + 89, + 100, + 201 ], "level": 2, "position": { @@ -135,22 +135,22 @@ }, { "guid": [ - 111, - 54, - 53, - 101, - 131, + 92, + 74, + 109, + 169, + 47, + 35, + 107, + 73, + 130, + 118, + 81, 37, - 42, - 79, - 140, - 237, - 226, - 118, - 126, - 82, - 234, - 186 + 128, + 161, + 143, + 254 ], "level": 3, "position": { @@ -159,5 +159,5 @@ "space": "{8A6DBA48-33BB-0681-2F02-2C73A811E8B8},1" } ], - "text_receipt": "Some(Published { revision: ExGuid { guid: [117, 117, 239, 204, 176, 55, 94, 77, 143, 225, 32, 46, 243, 247, 87, 45], n: 1 } })" + "text_receipt": "Some(Published { revision: ExGuid { guid: [30, 209, 131, 188, 64, 110, 181, 77, 167, 7, 22, 237, 194, 202, 131, 214], n: 1 } })" } \ No newline at end of file diff --git a/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/commands.jsonl b/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/commands.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..4c1c1492088bc872543d7c5b89ce3757eb5a62ce --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/commands.jsonl @@ -0,0 +1,3 @@ +{"command": "powershell -NoProfile -Command \"Expand-Archive -LiteralPath C:\\one-tests\\transfer.zip -DestinationPath C:\\one-tests\\runs\\capture\\notebook\"", "exit": 0, "stdout": "", "stderr": "", "error": null} +{"command": "powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -File C:\\one-tests\\read-current.ps1 -Root C:\\one-tests\\runs\\capture -CloneHost ONE-M6-529C1CBC -ExpectedPages 9", "exit": 0, "stdout": "Read 1 sections and 9 pages.\r\n", "stderr": "", "error": null} +{"command": "powershell -NoProfile -Command \"Compress-Archive -Force -Path C:\\one-tests\\runs\\capture\\* -DestinationPath C:\\one-tests\\captured.zip\"", "exit": 0, "stdout": "", "stderr": "", "error": null} diff --git a/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/machine.json b/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/machine.json new file mode 100644 index 0000000000000000000000000000000000000000..a3bdae076b1df6732d90f4c58d0063ba7bdfa6a3 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/machine.json @@ -0,0 +1 @@ +{"name": "m6-529c1cbc", "hostname": "ONE-M6-529C1CBC"} diff --git a/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/notebook/Lifecycle.one b/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/notebook/Lifecycle.one index dbde03ccf5d068f64771aff896b56afec51957d3..550ac220cb8e3cb7b1cb03bc980b2937a19c5a28 100644 Binary files a/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/notebook/Lifecycle.one and b/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/notebook/Lifecycle.one differ diff --git a/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/notebook/Open Notebook.onetoc2 b/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/notebook/Open Notebook.onetoc2 new file mode 100644 index 0000000000000000000000000000000000000000..5d22c5a2dfcf0d11aa1601e9c227bf631e9035cf Binary files /dev/null and b/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/notebook/Open Notebook.onetoc2 differ diff --git a/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/read/environment.json b/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/read/environment.json new file mode 100644 index 0000000000000000000000000000000000000000..7b488d296eb63f5b8a4df37f7eb331cea0c28a0c --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/read/environment.json @@ -0,0 +1,7 @@ +{ + "powershell": "5.1.14409.1005", + "schema": "xs2010", + "hostname": "ONE-M6-529C1CBC", + "cold": true, + "onenote": "14.0.4763.1000" +} diff --git a/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/read/hierarchy.xml b/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/read/hierarchy.xml index e1c3260092a2a2888a6fac8aad6e3ec09423dc88..365999684ce26dc3ec07bc87f935842b54514a36 100644 --- a/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/read/hierarchy.xml +++ b/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/read/hierarchy.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/read/page-000.xml b/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/read/page-000.xml index b49393e0bec505558d406e92368349c3179da095..eb285fb834e41d98f0d2f48986192179e0160c37 100644 --- a/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/read/page-000.xml +++ b/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/read/page-000.xml @@ -1,4 +1,2 @@  -Body duplicate 🦀 é preserved]]> + diff --git a/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/read/page-001.xml b/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/read/page-001.xml index ac53606f49a7e98edbe97b13d95831ad3cffb429..310fe6e6aeb8636aa960926d43dd05186b5a1572 100644 --- a/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/read/page-001.xml +++ b/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/read/page-001.xml @@ -1,4 +1,4 @@  -Body automatic 🦀 éBody child 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/read/page-002.xml b/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/read/page-002.xml index e59d479b7161382835c959d60af6b9d2167eaa1d..044e861b291fe0c4d279772ef669be9a55389de9 100644 --- a/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/read/page-002.xml +++ b/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/read/page-002.xml @@ -1,4 +1,2 @@  -Body trailing 🦀 é preserved]]> + diff --git a/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/read/page-003.xml b/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/read/page-003.xml index 7567ea80bced6c3c2782e8c6f4ed224dbd364307..eed308396e5366effb6fe3354bc73bf660b6454c 100644 --- a/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/read/page-003.xml +++ b/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/read/page-003.xml @@ -1,4 +1,2 @@  -Body child 🦀 é preserved]]> + diff --git a/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/read/page-004.xml b/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/read/page-004.xml index 1a8ea955732ef95b63306495a01d7005585c2a55..8f2d35eabc781123dd847fb0429200f6a0c407e2 100644 --- a/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/read/page-004.xml +++ b/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/read/page-004.xml @@ -1,2 +1,4 @@  - +Body grandchild 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/read/page-005.xml b/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/read/page-005.xml index a0d1ae4322235093fe1aee25115d21195f9ba149..0e20915e0a86f545b9b3ecffff05902f555df304 100644 --- a/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/read/page-005.xml +++ b/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/read/page-005.xml @@ -1,2 +1,4 @@  - +Offline Body parent 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/read/page-006.xml b/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/read/page-006.xml index af74b0b3ce0f12e16643d21e3c773980617b707c..c219a62d71478e334bca680f90652827bab11829 100644 --- a/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/read/page-006.xml +++ b/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/read/page-006.xml @@ -1,4 +1,4 @@  -Body grandchild 🦀 éBody duplicate 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/read/page-007.xml b/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/read/page-007.xml index 19cfa6e08a9bad712003c9abbd1636a641df3c7c..3a7f98d715ce92323ead6a1e555db2bab284b11d 100644 --- a/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/read/page-007.xml +++ b/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/read/page-007.xml @@ -1,4 +1,4 @@  -Offline Body parent 🦀 éBody automatic 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/read/page-008.xml b/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/read/page-008.xml index b756f6f806dde3c05a91037e60add9566ee9eefe..8f328ea83807224a72eb9c1b42e6cd7cac86c90e 100644 --- a/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/read/page-008.xml +++ b/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/read/page-008.xml @@ -1,2 +1,4 @@  - +Body trailing 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/read/payloads.json b/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/read/payloads.json new file mode 100644 index 0000000000000000000000000000000000000000..1ce91a413d6fff4d58765187b76756f0e97ae843 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/read/payloads.json @@ -0,0 +1,3 @@ +[ + +] \ No newline at end of file diff --git a/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/run.json b/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/run.json new file mode 100644 index 0000000000000000000000000000000000000000..c919f7448e77865f141f7b398a4b1f46c57248b0 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/run.json @@ -0,0 +1,18 @@ +{ + "notebook": "/private/var/folders/90/4f4rngds01j55ggdj_vglk_c0000gn/T/tmpzv4zdwuu", + "expected_pages": 9, + "author": null, + "author_timeout_seconds": 600, + "inspect": false, + "collect_notebook": true, + "base": { + "file": "win7-office-base.qcow2", + "format": "qcow2", + "sha256": "a1a4f8fab782ee14885ff801ca2f6347c208fdcfc3513637096f314315c89346", + "virtual_size": 68719476736 + }, + "scripts": { + "cold.ps1": "c177fc72ae6c2634d186f5671a880de20b09f9716532c37c69cb13aa15c7e331", + "read.ps1": "04013bfcccee40a17e2a225f9b9e96f40a3a8daad9e350609654f8eda3ccbb41" + } +} diff --git a/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/scripts/cold.ps1 b/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/scripts/cold.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..a0b99e7aeb86f4dc10032537800501a52ad65b4f --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/scripts/cold.ps1 @@ -0,0 +1,27 @@ +param([Parameter(Mandatory=$true)][string]$Root, [string]$CloneHost = '') +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' +$root = [IO.Path]::GetFullPath($Root).TrimEnd('\') +if ([IO.Path]::GetDirectoryName($root) -ne 'C:\one-tests\runs') { + throw 'Choose a run directly below C:\one-tests\runs.' +} +if (Get-Process ONENOTE -ErrorAction SilentlyContinue) { throw 'Close OneNote before resetting its test cache.' } +$key = 'HKCU:\Software\Microsoft\Office\14.0\OneNote' +if ($CloneHost) { + if ($CloneHost -notmatch '^ONE-[A-Z0-9-]+$' -or [Environment]::MachineName -ne $CloneHost) { + throw 'The disposable clone hostname does not match this machine.' + } + New-Item "$key\Options\Paths" -Force | Out-Null + New-ItemProperty "$key\Options\Paths" -Name UnfiledNotesSection -PropertyType ExpandString -Value 'C:\one-tests\Loose.one' -Force | Out-Null +} elseif ((Get-ItemProperty "$key\Options\Paths").UnfiledNotesSection -ne 'C:\one-tests\Loose.one' -or + -not (Test-Path 'C:\one-tests\profile-original-cache')) { + throw 'Park the personal OneNote profile before resetting the test cache.' +} +$cache = Join-Path $env:LOCALAPPDATA 'Microsoft\OneNote\14.0' +$parked = Join-Path 'C:\one-tests\caches' ([IO.Path]::GetFileName($root)) +if (Test-Path $parked) { throw 'Choose a new run; its parked cache already exists.' } +New-Item -ItemType Directory -Path 'C:\one-tests\caches' -Force | Out-Null +if (Test-Path $cache) { Move-Item -LiteralPath $cache -Destination $parked } +if (Test-Path "$key\OpenNotebooks") { Remove-Item "$key\OpenNotebooks" -Recurse } +New-Item "$key\OpenNotebooks" | Out-Null +New-ItemProperty "$key\OpenNotebooks" -Name '1' -PropertyType String -Value "$root\notebook" | Out-Null diff --git a/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/scripts/read.ps1 b/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/scripts/read.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..476094ab1e0c47077988a6461db2080cf208642b --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/scripts/read.ps1 @@ -0,0 +1,142 @@ +param( + [Parameter(Mandatory=$true)][string]$Root, + [int]$ExpectedPages = -1, + [switch]$UseCurrentCache, + [switch]$Pdf, + [switch]$KeepOpen, + [string]$CloneHost = '' +) +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' +$root = [IO.Path]::GetFullPath($Root).TrimEnd('\') +if ([IO.Path]::GetDirectoryName($root) -ne 'C:\one-tests\runs') { + throw 'Choose a run directly below C:\one-tests\runs.' +} +$notebook = Join-Path $root 'notebook' +$output = Join-Path $root 'read' +if (Test-Path $output) { throw 'Choose a new read destination.' } +if ($UseCurrentCache) { + if ((Get-ItemProperty 'HKCU:\Software\Microsoft\Office\14.0\OneNote\Options\Paths').UnfiledNotesSection -ne 'C:\one-tests\Loose.one') { + throw 'Park the personal OneNote profile before reading test notebooks.' + } +} else { + & "$PSScriptRoot\cold-current.ps1" -Root $root -CloneHost $CloneHost +} +New-Item -ItemType Directory -Path $output | Out-Null +$app = New-Object -ComObject OneNote.Application +$notebookId = '' +$failure = $null +try { + $app.OpenHierarchy($notebook, '', [ref]$notebookId, 0) + $process = Get-Process ONENOTE + @{ hostname = [Environment]::MachineName; onenote = $process.MainModule.FileVersionInfo.FileVersion; + powershell = $PSVersionTable.PSVersion.ToString(); schema = 'xs2010'; cold = (-not $UseCurrentCache.IsPresent) } | + ConvertTo-Json | Set-Content (Join-Path $output 'environment.json') -Encoding UTF8 + $sections = @() + foreach ($file in @(Get-ChildItem $notebook -Recurse | Where-Object { $_.Extension -eq '.one' })) { + $id = '' + $app.OpenHierarchy($file.FullName, '', [ref]$id, 0) + $sections += $id + } + $deadline = [DateTime]::UtcNow.AddSeconds(300) + $previous = '' + $lastChange = '' + $stableSince = [DateTime]::UtcNow + $settled = $false + do { + $pages = @{} + foreach ($section in $sections) { + $hierarchy = '' + $app.GetHierarchy($section, 4, [ref]$hierarchy, 1) + [xml]$xml = $hierarchy + foreach ($node in $xml.SelectNodes('//*[@path]')) { + if (-not $node.GetAttribute('path').StartsWith("$notebook\", [StringComparison]::OrdinalIgnoreCase)) { + throw 'OneNote opened a section outside the copied notebook.' + } + } + foreach ($node in $xml.SelectNodes('//*[local-name()="Page"]')) { + $id = $node.GetAttribute('ID') + $content = '' + $app.GetPageContent($id, [ref]$content, 1, 1) + $pages[$id] = $content + } + } + $signature = [String]::Join('|', @($pages.Keys | Sort-Object | ForEach-Object { $_ + $pages[$_] })) + if ($signature -ne $previous) { + $lastChange = $previous + $previous = $signature + $stableSince = [DateTime]::UtcNow + } + if ((($ExpectedPages -ge 0 -and $pages.Count -eq $ExpectedPages) -or + ($ExpectedPages -lt 0 -and $pages.Count -gt 0)) -and + ([DateTime]::UtcNow - $stableSince).TotalSeconds -ge 2) { $settled = $true; break } + Start-Sleep -Milliseconds 250 + } while ([DateTime]::UtcNow -lt $deadline) + if (-not $settled -or ($ExpectedPages -ge 0 -and $pages.Count -ne $ExpectedPages) -or ($ExpectedPages -lt 0 -and $pages.Count -eq 0)) { + [IO.File]::WriteAllText((Join-Path $output 'previous-signature.txt'), $lastChange, [Text.Encoding]::UTF8) + $index = 0 + foreach ($id in @($pages.Keys | Sort-Object)) { + [IO.File]::WriteAllText((Join-Path $output ('unsettled-{0:d3}.xml' -f $index)), $pages[$id], [Text.Encoding]::UTF8) + $index++ + } + $hierarchy = '' + $app.GetHierarchy($notebookId, 4, [ref]$hierarchy, 1) + [IO.File]::WriteAllText((Join-Path $output 'unsettled-hierarchy.xml'), $hierarchy, [Text.Encoding]::UTF8) + throw "Expected $ExpectedPages stable pages; OneNote returned $($pages.Count), settled=$settled." + } + $index = 0 + $payloads = @() + foreach ($id in @($pages.Keys | Sort-Object)) { + [IO.File]::WriteAllText((Join-Path $output ('page-{0:d3}.xml' -f $index)), $pages[$id], [Text.Encoding]::UTF8) + if ($Pdf) { + $pdfPath = Join-Path $output ('page-{0:d3}.pdf' -f $index) + $app.NavigateTo($id, '', $false) + $app.Publish($id, $pdfPath, 3, '') + if (-not (Test-Path $pdfPath) -or (Get-Item $pdfPath).Length -eq 0) { throw 'OneNote did not publish the page PDF.' } + } + [xml]$page = $pages[$id] + foreach ($file in $page.SelectNodes('//*[local-name()="InsertedFile" or local-name()="MediaFile"]')) { + $bytes = [IO.File]::ReadAllBytes($file.GetAttribute('pathCache')) + $hash = [BitConverter]::ToString([Security.Cryptography.SHA256]::Create().ComputeHash($bytes)).Replace('-', '').ToLowerInvariant() + [IO.File]::WriteAllBytes((Join-Path $output ($hash + '.attachment')), $bytes) + $payloads += @{ page = $id; object = $file.ParentNode.GetAttribute('objectID'); + kind = $file.LocalName; name = $file.GetAttribute('preferredName'); + sha256 = $hash; bytes = $bytes.Length } + } + $index++ + } + [IO.File]::WriteAllText((Join-Path $output 'payloads.json'), (ConvertTo-Json -InputObject $payloads -Depth 4), [Text.Encoding]::UTF8) + $all = '' + $app.GetHierarchy($notebookId, 4, [ref]$all, 1) + [xml]$finalTree = $all + $finalIds = @($finalTree.SelectNodes('//*[local-name()="Page"]') | ForEach-Object { $_.GetAttribute('ID') } | Sort-Object -Unique) + if ($finalIds.Count -ne $pages.Count -or @($finalIds | Where-Object { -not $pages.ContainsKey($_) }).Count -ne 0) { + throw 'The notebook hierarchy changed while collecting page evidence; repeat the cold read.' + } + [IO.File]::WriteAllText((Join-Path $output 'hierarchy.xml'), $all, [Text.Encoding]::UTF8) + Write-Output "Read $($sections.Count) sections and $($pages.Count) pages." +} catch { + $failure = $_ + [IO.File]::WriteAllText((Join-Path $output 'failure.txt'), ($_ | Out-String), [Text.Encoding]::UTF8) + throw +} finally { + try { + try { + if ($notebookId -and $CloneHost) { $app.SyncHierarchy($notebookId) } + if ($notebookId -and -not $KeepOpen -and (-not $UseCurrentCache -or $CloneHost)) { + $app.CloseNotebook($notebookId, $false) + } + } catch { + if ($null -eq $failure) { throw } + [IO.File]::WriteAllText((Join-Path $output 'cleanup-failure.txt'), ($_ | Out-String), [Text.Encoding]::UTF8) + } + } finally { + [void][Runtime.InteropServices.Marshal]::FinalReleaseComObject($app) + } + $app = $null + [GC]::Collect() + [GC]::WaitForPendingFinalizers() + if (-not $UseCurrentCache -and -not $CloneHost) { + Get-Process ONENOTE -ErrorAction SilentlyContinue | Wait-Process -Timeout 10 + } +} diff --git a/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/source.json b/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/source.json new file mode 100644 index 0000000000000000000000000000000000000000..447664d0fcf556ac01bfd7e6aff245611e37b1d4 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/source.json @@ -0,0 +1,8 @@ +[ + { + "path": "Lifecycle.one", + "bytes": 62200, + "sha256": "1799f81b54d3d38ff66e420e83d4a242711cae40e52c8c3a2fb8d7886c43fd6b", + "mtime_ns": 1789121644594396710 + } +] diff --git a/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/teardown.json b/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/teardown.json new file mode 100644 index 0000000000000000000000000000000000000000..05a47793de40f322e745c4c4183727e3590ecf70 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-02-promoted-parent/cold/teardown.json @@ -0,0 +1 @@ +{"absent": true} diff --git a/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/candidate/Lifecycle.one b/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/candidate/Lifecycle.one index 2c360d4926f138ed90c66657c9eaa4a905039b3b..2e149c4888f2d2d609d53dabd29c80e7c439d8c3 100644 Binary files a/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/candidate/Lifecycle.one and b/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/candidate/Lifecycle.one differ diff --git a/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/candidate/manifest.json b/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/candidate/manifest.json index 78fde90ddefdfa2372df478c17fd4cdc2a9a770d..2d59c60cac551677a91b1616c92f28ae0f6ec1b1 100644 --- a/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/candidate/manifest.json +++ b/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/candidate/manifest.json @@ -5,22 +5,22 @@ "original": [ { "guid": [ - 59, - 56, - 245, - 11, - 183, - 166, - 17, - 77, - 128, - 103, - 4, - 198, - 84, - 31, - 176, - 132 + 42, + 117, + 255, + 71, + 239, + 218, + 67, + 71, + 175, + 211, + 157, + 52, + 145, + 208, + 101, + 95 ], "level": 1, "position": { @@ -30,22 +30,22 @@ }, { "guid": [ - 125, - 120, - 25, - 176, - 131, - 146, - 79, - 66, - 152, + 33, + 225, + 101, + 47, + 69, + 149, + 52, 72, - 8, - 5, - 112, 144, - 227, - 13 + 162, + 220, + 60, + 114, + 18, + 197, + 88 ], "level": 2, "position": { @@ -55,22 +55,22 @@ }, { "guid": [ - 13, + 112, + 138, + 67, + 208, + 44, + 116, + 79, + 76, + 139, + 42, 28, - 56, - 21, - 0, - 191, - 211, - 65, - 137, - 203, - 79, - 98, - 79, - 246, - 200, - 111 + 6, + 127, + 208, + 43, + 160 ], "level": 3, "position": { @@ -85,22 +85,22 @@ "reviewed": [ { "guid": [ - 59, - 56, - 245, - 11, - 183, - 166, - 17, - 77, - 128, - 103, - 4, - 198, - 84, - 31, - 176, - 132 + 42, + 117, + 255, + 71, + 239, + 218, + 67, + 71, + 175, + 211, + 157, + 52, + 145, + 208, + 101, + 95 ], "level": 1, "position": { @@ -110,22 +110,22 @@ }, { "guid": [ - 125, - 120, - 25, - 176, - 131, - 146, - 79, - 66, - 152, + 33, + 225, + 101, + 47, + 69, + 149, + 52, 72, - 8, - 5, - 112, 144, - 227, - 13 + 162, + 220, + 60, + 114, + 18, + 197, + 88 ], "level": 2, "position": { @@ -135,22 +135,22 @@ }, { "guid": [ - 13, + 112, + 138, + 67, + 208, + 44, + 116, + 79, + 76, + 139, + 42, 28, - 56, - 21, - 0, - 191, - 211, - 65, - 137, - 203, - 79, - 98, - 79, - 246, - 200, - 111 + 6, + 127, + 208, + 43, + 160 ], "level": 3, "position": { @@ -159,5 +159,5 @@ "space": "{8A6DBA48-33BB-0681-2F02-2C73A811E8B8},1" } ], - "text_receipt": "Some(Published { revision: ExGuid { guid: [60, 10, 128, 166, 67, 192, 180, 77, 159, 109, 56, 86, 122, 77, 206, 97], n: 1 } })" + "text_receipt": "Some(Published { revision: ExGuid { guid: [63, 129, 91, 193, 126, 198, 36, 73, 163, 168, 32, 171, 78, 68, 176, 9], n: 1 } })" } \ No newline at end of file diff --git a/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/commands.jsonl b/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/commands.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..321880d1b6176d139057103e43e5e06fe98601e4 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/commands.jsonl @@ -0,0 +1,3 @@ +{"command": "powershell -NoProfile -Command \"Expand-Archive -LiteralPath C:\\one-tests\\transfer.zip -DestinationPath C:\\one-tests\\runs\\capture\\notebook\"", "exit": 0, "stdout": "", "stderr": "", "error": null} +{"command": "powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -File C:\\one-tests\\read-current.ps1 -Root C:\\one-tests\\runs\\capture -CloneHost ONE-M6-757551A0 -ExpectedPages 9", "exit": 0, "stdout": "Read 1 sections and 9 pages.\r\n", "stderr": "", "error": null} +{"command": "powershell -NoProfile -Command \"Compress-Archive -Force -Path C:\\one-tests\\runs\\capture\\* -DestinationPath C:\\one-tests\\captured.zip\"", "exit": 0, "stdout": "", "stderr": "", "error": null} diff --git a/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/machine.json b/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/machine.json new file mode 100644 index 0000000000000000000000000000000000000000..99493ed690064b7376ac909b1b7cb473e7b5f00e --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/machine.json @@ -0,0 +1 @@ +{"name": "m6-757551a0", "hostname": "ONE-M6-757551A0"} diff --git a/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/notebook/Lifecycle.one b/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/notebook/Lifecycle.one index c8ef9758827843a7de8a5841061ec81a50f82f5b..65d0cae77ab60bd96e63bdb9127a49132d1860ef 100644 Binary files a/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/notebook/Lifecycle.one and b/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/notebook/Lifecycle.one differ diff --git a/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/notebook/Open Notebook.onetoc2 b/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/notebook/Open Notebook.onetoc2 new file mode 100644 index 0000000000000000000000000000000000000000..7783f8f56e02698c4b49861a00d28bb457c8108e Binary files /dev/null and b/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/notebook/Open Notebook.onetoc2 differ diff --git a/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/read/environment.json b/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/read/environment.json new file mode 100644 index 0000000000000000000000000000000000000000..42da147eb166eaed158dbaec1006a72bfdaf5a32 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/read/environment.json @@ -0,0 +1,7 @@ +{ + "powershell": "5.1.14409.1005", + "schema": "xs2010", + "hostname": "ONE-M6-757551A0", + "cold": true, + "onenote": "14.0.4763.1000" +} diff --git a/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/read/hierarchy.xml b/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/read/hierarchy.xml index 3f8eb5430a158b16c4b13ad412368a1caf5921fd..4a21c596b50ed4d4b406bce7fab1d2af4394ff04 100644 --- a/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/read/hierarchy.xml +++ b/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/read/hierarchy.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/read/page-000.xml b/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/read/page-000.xml index 4606c1dc986c96fa06b62cb2ab7ef72cd82a41e9..eacefb93a1c6b0a591824fba3b3b42a7b2bee8aa 100644 --- a/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/read/page-000.xml +++ b/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/read/page-000.xml @@ -1,2 +1,4 @@  - +Body trailing 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/read/page-001.xml b/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/read/page-001.xml index 83dc60453e4f4ccc1df31be48d5f12956e928ec6..619d20bb96cddb19e7f76996c3ad2c5d95aecaca 100644 --- a/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/read/page-001.xml +++ b/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/read/page-001.xml @@ -1,4 +1,4 @@  -Offline Body parent 🦀 éBody automatic 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/read/page-002.xml b/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/read/page-002.xml index 547a567b37b677d592a76297e9b5f1d0aa98d9d1..89600d1605b9d9228ad55ab0b7fc93e3d24c246c 100644 --- a/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/read/page-002.xml +++ b/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/read/page-002.xml @@ -1,4 +1,4 @@  -Body grandchild 🦀 éBody duplicate 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/read/page-003.xml b/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/read/page-003.xml index cc1955130f89864806f7a4e6b2425067a0fe607d..e107570730c7da99c57bf2036207400f688e607f 100644 --- a/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/read/page-003.xml +++ b/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/read/page-003.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/read/page-004.xml b/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/read/page-004.xml index 555151550341e889451c675f7892271a0bbd541a..2c7801c1e1ed95799bc0a357c4e5644620224edb 100644 --- a/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/read/page-004.xml +++ b/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/read/page-004.xml @@ -1,2 +1,4 @@  - +Offline Body parent 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/read/page-005.xml b/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/read/page-005.xml index 8692105a5442dfb9154f32bc03bb7b4d3ceb88b9..9349b048a8737400ee0894318a1900a06810879e 100644 --- a/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/read/page-005.xml +++ b/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/read/page-005.xml @@ -1,4 +1,4 @@  -Body child 🦀 éBody grandchild 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/read/page-006.xml b/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/read/page-006.xml index 93de8fbb47c60089f4b428c30113904416f32b9c..8852747f42dc27890fa85c1a390b659a75680371 100644 --- a/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/read/page-006.xml +++ b/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/read/page-006.xml @@ -1,4 +1,2 @@  -Body trailing 🦀 é preserved]]> + diff --git a/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/read/page-007.xml b/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/read/page-007.xml index a944412ed9ca6e8c07515b1301daf91f4be599e4..58dda18426ee710543727cc5914ab26273eccacc 100644 --- a/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/read/page-007.xml +++ b/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/read/page-007.xml @@ -1,4 +1,2 @@  -Body automatic 🦀 é preserved]]> + diff --git a/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/read/page-008.xml b/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/read/page-008.xml index 826cf6ceb894ab1f79787892ad911ae1b4e9e5a7..b48c2d8da9be88041db81bd195ffbd5432e99ce8 100644 --- a/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/read/page-008.xml +++ b/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/read/page-008.xml @@ -1,4 +1,4 @@  -Body duplicate 🦀 éBody child 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/read/payloads.json b/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/read/payloads.json new file mode 100644 index 0000000000000000000000000000000000000000..1ce91a413d6fff4d58765187b76756f0e97ae843 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/read/payloads.json @@ -0,0 +1,3 @@ +[ + +] \ No newline at end of file diff --git a/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/run.json b/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/run.json new file mode 100644 index 0000000000000000000000000000000000000000..f8ded1acf6dae5ec4471da872d687269a796903b --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/run.json @@ -0,0 +1,18 @@ +{ + "notebook": "/private/var/folders/90/4f4rngds01j55ggdj_vglk_c0000gn/T/tmpukazpfqa", + "expected_pages": 9, + "author": null, + "author_timeout_seconds": 600, + "inspect": false, + "collect_notebook": true, + "base": { + "file": "win7-office-base.qcow2", + "format": "qcow2", + "sha256": "a1a4f8fab782ee14885ff801ca2f6347c208fdcfc3513637096f314315c89346", + "virtual_size": 68719476736 + }, + "scripts": { + "cold.ps1": "c177fc72ae6c2634d186f5671a880de20b09f9716532c37c69cb13aa15c7e331", + "read.ps1": "04013bfcccee40a17e2a225f9b9e96f40a3a8daad9e350609654f8eda3ccbb41" + } +} diff --git a/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/scripts/cold.ps1 b/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/scripts/cold.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..a0b99e7aeb86f4dc10032537800501a52ad65b4f --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/scripts/cold.ps1 @@ -0,0 +1,27 @@ +param([Parameter(Mandatory=$true)][string]$Root, [string]$CloneHost = '') +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' +$root = [IO.Path]::GetFullPath($Root).TrimEnd('\') +if ([IO.Path]::GetDirectoryName($root) -ne 'C:\one-tests\runs') { + throw 'Choose a run directly below C:\one-tests\runs.' +} +if (Get-Process ONENOTE -ErrorAction SilentlyContinue) { throw 'Close OneNote before resetting its test cache.' } +$key = 'HKCU:\Software\Microsoft\Office\14.0\OneNote' +if ($CloneHost) { + if ($CloneHost -notmatch '^ONE-[A-Z0-9-]+$' -or [Environment]::MachineName -ne $CloneHost) { + throw 'The disposable clone hostname does not match this machine.' + } + New-Item "$key\Options\Paths" -Force | Out-Null + New-ItemProperty "$key\Options\Paths" -Name UnfiledNotesSection -PropertyType ExpandString -Value 'C:\one-tests\Loose.one' -Force | Out-Null +} elseif ((Get-ItemProperty "$key\Options\Paths").UnfiledNotesSection -ne 'C:\one-tests\Loose.one' -or + -not (Test-Path 'C:\one-tests\profile-original-cache')) { + throw 'Park the personal OneNote profile before resetting the test cache.' +} +$cache = Join-Path $env:LOCALAPPDATA 'Microsoft\OneNote\14.0' +$parked = Join-Path 'C:\one-tests\caches' ([IO.Path]::GetFileName($root)) +if (Test-Path $parked) { throw 'Choose a new run; its parked cache already exists.' } +New-Item -ItemType Directory -Path 'C:\one-tests\caches' -Force | Out-Null +if (Test-Path $cache) { Move-Item -LiteralPath $cache -Destination $parked } +if (Test-Path "$key\OpenNotebooks") { Remove-Item "$key\OpenNotebooks" -Recurse } +New-Item "$key\OpenNotebooks" | Out-Null +New-ItemProperty "$key\OpenNotebooks" -Name '1' -PropertyType String -Value "$root\notebook" | Out-Null diff --git a/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/scripts/read.ps1 b/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/scripts/read.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..476094ab1e0c47077988a6461db2080cf208642b --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/scripts/read.ps1 @@ -0,0 +1,142 @@ +param( + [Parameter(Mandatory=$true)][string]$Root, + [int]$ExpectedPages = -1, + [switch]$UseCurrentCache, + [switch]$Pdf, + [switch]$KeepOpen, + [string]$CloneHost = '' +) +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' +$root = [IO.Path]::GetFullPath($Root).TrimEnd('\') +if ([IO.Path]::GetDirectoryName($root) -ne 'C:\one-tests\runs') { + throw 'Choose a run directly below C:\one-tests\runs.' +} +$notebook = Join-Path $root 'notebook' +$output = Join-Path $root 'read' +if (Test-Path $output) { throw 'Choose a new read destination.' } +if ($UseCurrentCache) { + if ((Get-ItemProperty 'HKCU:\Software\Microsoft\Office\14.0\OneNote\Options\Paths').UnfiledNotesSection -ne 'C:\one-tests\Loose.one') { + throw 'Park the personal OneNote profile before reading test notebooks.' + } +} else { + & "$PSScriptRoot\cold-current.ps1" -Root $root -CloneHost $CloneHost +} +New-Item -ItemType Directory -Path $output | Out-Null +$app = New-Object -ComObject OneNote.Application +$notebookId = '' +$failure = $null +try { + $app.OpenHierarchy($notebook, '', [ref]$notebookId, 0) + $process = Get-Process ONENOTE + @{ hostname = [Environment]::MachineName; onenote = $process.MainModule.FileVersionInfo.FileVersion; + powershell = $PSVersionTable.PSVersion.ToString(); schema = 'xs2010'; cold = (-not $UseCurrentCache.IsPresent) } | + ConvertTo-Json | Set-Content (Join-Path $output 'environment.json') -Encoding UTF8 + $sections = @() + foreach ($file in @(Get-ChildItem $notebook -Recurse | Where-Object { $_.Extension -eq '.one' })) { + $id = '' + $app.OpenHierarchy($file.FullName, '', [ref]$id, 0) + $sections += $id + } + $deadline = [DateTime]::UtcNow.AddSeconds(300) + $previous = '' + $lastChange = '' + $stableSince = [DateTime]::UtcNow + $settled = $false + do { + $pages = @{} + foreach ($section in $sections) { + $hierarchy = '' + $app.GetHierarchy($section, 4, [ref]$hierarchy, 1) + [xml]$xml = $hierarchy + foreach ($node in $xml.SelectNodes('//*[@path]')) { + if (-not $node.GetAttribute('path').StartsWith("$notebook\", [StringComparison]::OrdinalIgnoreCase)) { + throw 'OneNote opened a section outside the copied notebook.' + } + } + foreach ($node in $xml.SelectNodes('//*[local-name()="Page"]')) { + $id = $node.GetAttribute('ID') + $content = '' + $app.GetPageContent($id, [ref]$content, 1, 1) + $pages[$id] = $content + } + } + $signature = [String]::Join('|', @($pages.Keys | Sort-Object | ForEach-Object { $_ + $pages[$_] })) + if ($signature -ne $previous) { + $lastChange = $previous + $previous = $signature + $stableSince = [DateTime]::UtcNow + } + if ((($ExpectedPages -ge 0 -and $pages.Count -eq $ExpectedPages) -or + ($ExpectedPages -lt 0 -and $pages.Count -gt 0)) -and + ([DateTime]::UtcNow - $stableSince).TotalSeconds -ge 2) { $settled = $true; break } + Start-Sleep -Milliseconds 250 + } while ([DateTime]::UtcNow -lt $deadline) + if (-not $settled -or ($ExpectedPages -ge 0 -and $pages.Count -ne $ExpectedPages) -or ($ExpectedPages -lt 0 -and $pages.Count -eq 0)) { + [IO.File]::WriteAllText((Join-Path $output 'previous-signature.txt'), $lastChange, [Text.Encoding]::UTF8) + $index = 0 + foreach ($id in @($pages.Keys | Sort-Object)) { + [IO.File]::WriteAllText((Join-Path $output ('unsettled-{0:d3}.xml' -f $index)), $pages[$id], [Text.Encoding]::UTF8) + $index++ + } + $hierarchy = '' + $app.GetHierarchy($notebookId, 4, [ref]$hierarchy, 1) + [IO.File]::WriteAllText((Join-Path $output 'unsettled-hierarchy.xml'), $hierarchy, [Text.Encoding]::UTF8) + throw "Expected $ExpectedPages stable pages; OneNote returned $($pages.Count), settled=$settled." + } + $index = 0 + $payloads = @() + foreach ($id in @($pages.Keys | Sort-Object)) { + [IO.File]::WriteAllText((Join-Path $output ('page-{0:d3}.xml' -f $index)), $pages[$id], [Text.Encoding]::UTF8) + if ($Pdf) { + $pdfPath = Join-Path $output ('page-{0:d3}.pdf' -f $index) + $app.NavigateTo($id, '', $false) + $app.Publish($id, $pdfPath, 3, '') + if (-not (Test-Path $pdfPath) -or (Get-Item $pdfPath).Length -eq 0) { throw 'OneNote did not publish the page PDF.' } + } + [xml]$page = $pages[$id] + foreach ($file in $page.SelectNodes('//*[local-name()="InsertedFile" or local-name()="MediaFile"]')) { + $bytes = [IO.File]::ReadAllBytes($file.GetAttribute('pathCache')) + $hash = [BitConverter]::ToString([Security.Cryptography.SHA256]::Create().ComputeHash($bytes)).Replace('-', '').ToLowerInvariant() + [IO.File]::WriteAllBytes((Join-Path $output ($hash + '.attachment')), $bytes) + $payloads += @{ page = $id; object = $file.ParentNode.GetAttribute('objectID'); + kind = $file.LocalName; name = $file.GetAttribute('preferredName'); + sha256 = $hash; bytes = $bytes.Length } + } + $index++ + } + [IO.File]::WriteAllText((Join-Path $output 'payloads.json'), (ConvertTo-Json -InputObject $payloads -Depth 4), [Text.Encoding]::UTF8) + $all = '' + $app.GetHierarchy($notebookId, 4, [ref]$all, 1) + [xml]$finalTree = $all + $finalIds = @($finalTree.SelectNodes('//*[local-name()="Page"]') | ForEach-Object { $_.GetAttribute('ID') } | Sort-Object -Unique) + if ($finalIds.Count -ne $pages.Count -or @($finalIds | Where-Object { -not $pages.ContainsKey($_) }).Count -ne 0) { + throw 'The notebook hierarchy changed while collecting page evidence; repeat the cold read.' + } + [IO.File]::WriteAllText((Join-Path $output 'hierarchy.xml'), $all, [Text.Encoding]::UTF8) + Write-Output "Read $($sections.Count) sections and $($pages.Count) pages." +} catch { + $failure = $_ + [IO.File]::WriteAllText((Join-Path $output 'failure.txt'), ($_ | Out-String), [Text.Encoding]::UTF8) + throw +} finally { + try { + try { + if ($notebookId -and $CloneHost) { $app.SyncHierarchy($notebookId) } + if ($notebookId -and -not $KeepOpen -and (-not $UseCurrentCache -or $CloneHost)) { + $app.CloseNotebook($notebookId, $false) + } + } catch { + if ($null -eq $failure) { throw } + [IO.File]::WriteAllText((Join-Path $output 'cleanup-failure.txt'), ($_ | Out-String), [Text.Encoding]::UTF8) + } + } finally { + [void][Runtime.InteropServices.Marshal]::FinalReleaseComObject($app) + } + $app = $null + [GC]::Collect() + [GC]::WaitForPendingFinalizers() + if (-not $UseCurrentCache -and -not $CloneHost) { + Get-Process ONENOTE -ErrorAction SilentlyContinue | Wait-Process -Timeout 10 + } +} diff --git a/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/source.json b/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/source.json new file mode 100644 index 0000000000000000000000000000000000000000..0d1248875d7d200bb3e4a9b8378c85a0ec6522f5 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/source.json @@ -0,0 +1,8 @@ +[ + { + "path": "Lifecycle.one", + "bytes": 62664, + "sha256": "7f9d34875babd03e06d9c1c19e308651a32f60128a82fc3ebe4ceb7c26b4ff8d", + "mtime_ns": 1789121644927702132 + } +] diff --git a/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/teardown.json b/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/teardown.json new file mode 100644 index 0000000000000000000000000000000000000000..05a47793de40f322e745c4c4183727e3590ecf70 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-03-selected-group-move/cold/teardown.json @@ -0,0 +1 @@ +{"absent": true} diff --git a/corpus/page-lifecycle/offline-edits/group-04-subpage-move/candidate/Lifecycle.one b/corpus/page-lifecycle/offline-edits/group-04-subpage-move/candidate/Lifecycle.one index f2246dc48f1be0aac3a93e92973f6d97df0093e6..3d65719eb12efe2889a5e7758629a8118c3677bc 100644 Binary files a/corpus/page-lifecycle/offline-edits/group-04-subpage-move/candidate/Lifecycle.one and b/corpus/page-lifecycle/offline-edits/group-04-subpage-move/candidate/Lifecycle.one differ diff --git a/corpus/page-lifecycle/offline-edits/group-04-subpage-move/candidate/manifest.json b/corpus/page-lifecycle/offline-edits/group-04-subpage-move/candidate/manifest.json index 542a43c578e4c9ac7562e829f316a13ed1899c30..b5fb6180df0dbfb1dc0a0c853ffdf0831cac14d7 100644 --- a/corpus/page-lifecycle/offline-edits/group-04-subpage-move/candidate/manifest.json +++ b/corpus/page-lifecycle/offline-edits/group-04-subpage-move/candidate/manifest.json @@ -5,22 +5,22 @@ "original": [ { "guid": [ - 199, - 220, - 106, - 186, 152, + 128, + 175, + 195, + 17, + 190, + 211, 76, - 232, - 72, - 177, - 255, - 217, - 123, - 93, - 179, - 135, - 200 + 152, + 1, + 231, + 122, + 112, + 7, + 10, + 54 ], "level": 1, "position": { @@ -30,22 +30,22 @@ }, { "guid": [ - 201, - 193, - 170, - 254, - 196, - 54, - 169, - 65, - 154, - 108, - 193, - 198, - 218, - 35, - 28, - 28 + 46, + 26, + 204, + 164, + 242, + 190, + 81, + 66, + 144, + 106, + 111, + 2, + 236, + 71, + 14, + 166 ], "level": 2, "position": { @@ -55,22 +55,22 @@ }, { "guid": [ - 115, - 244, - 83, - 70, - 165, - 185, - 39, - 79, - 140, + 191, + 224, + 129, + 54, + 186, 95, - 5, - 252, + 248, + 64, 174, - 129, - 183, - 255 + 137, + 121, + 46, + 144, + 88, + 88, + 161 ], "level": 3, "position": { @@ -79,28 +79,28 @@ "space": "{8A6DBA48-33BB-0681-2F02-2C73A811E8B8},1" } ], - "page_receipt": "Some(Published { revision: ExGuid { guid: [1, 23, 42, 161, 80, 203, 9, 65, 141, 37, 73, 126, 83, 54, 184, 88], n: 1 } })", + "page_receipt": "Some(Published { revision: ExGuid { guid: [114, 19, 114, 0, 153, 181, 44, 75, 191, 11, 5, 237, 1, 110, 205, 35], n: 1 } })", "phase": "04-subpage-move", "publications": 2, "reviewed": [ { "guid": [ - 199, - 220, - 106, - 186, 152, + 128, + 175, + 195, + 17, + 190, + 211, 76, - 232, - 72, - 177, - 255, - 217, - 123, - 93, - 179, - 135, - 200 + 152, + 1, + 231, + 122, + 112, + 7, + 10, + 54 ], "level": 1, "position": { @@ -110,22 +110,22 @@ }, { "guid": [ - 201, - 193, - 170, - 254, - 196, - 54, - 169, - 65, - 154, - 108, - 193, - 198, - 218, - 35, - 28, - 28 + 46, + 26, + 204, + 164, + 242, + 190, + 81, + 66, + 144, + 106, + 111, + 2, + 236, + 71, + 14, + 166 ], "level": 2, "position": { @@ -135,22 +135,22 @@ }, { "guid": [ - 115, - 244, - 83, - 70, - 165, - 185, - 39, - 79, - 140, + 191, + 224, + 129, + 54, + 186, 95, - 5, - 252, + 248, + 64, 174, - 129, - 183, - 255 + 137, + 121, + 46, + 144, + 88, + 88, + 161 ], "level": 3, "position": { @@ -159,5 +159,5 @@ "space": "{8A6DBA48-33BB-0681-2F02-2C73A811E8B8},1" } ], - "text_receipt": "Some(Published { revision: ExGuid { guid: [240, 236, 238, 203, 108, 116, 178, 66, 158, 216, 234, 236, 225, 51, 111, 153], n: 1 } })" + "text_receipt": "Some(Published { revision: ExGuid { guid: [130, 30, 229, 84, 5, 226, 119, 66, 170, 10, 33, 222, 68, 109, 13, 168], n: 1 } })" } \ No newline at end of file diff --git a/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/commands.jsonl b/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/commands.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..d95fee0efcc85483d4b4eb444999e299b71dfcdb --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/commands.jsonl @@ -0,0 +1,3 @@ +{"command": "powershell -NoProfile -Command \"Expand-Archive -LiteralPath C:\\one-tests\\transfer.zip -DestinationPath C:\\one-tests\\runs\\capture\\notebook\"", "exit": 0, "stdout": "", "stderr": "", "error": null} +{"command": "powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -File C:\\one-tests\\read-current.ps1 -Root C:\\one-tests\\runs\\capture -CloneHost ONE-M6-7B82F5FD -ExpectedPages 9", "exit": 0, "stdout": "Read 1 sections and 9 pages.\r\n", "stderr": "", "error": null} +{"command": "powershell -NoProfile -Command \"Compress-Archive -Force -Path C:\\one-tests\\runs\\capture\\* -DestinationPath C:\\one-tests\\captured.zip\"", "exit": 0, "stdout": "", "stderr": "", "error": null} diff --git a/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/machine.json b/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/machine.json new file mode 100644 index 0000000000000000000000000000000000000000..d3471abdbbb23e425284be9981570461dd78c534 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/machine.json @@ -0,0 +1 @@ +{"name": "m6-7b82f5fd", "hostname": "ONE-M6-7B82F5FD"} diff --git a/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/notebook/Lifecycle.one b/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/notebook/Lifecycle.one index fd9993809907ef62e50d0048d6d001c8894415d9..397c078d935dd1ebb5397e346e6eba7462c5b30c 100644 Binary files a/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/notebook/Lifecycle.one and b/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/notebook/Lifecycle.one differ diff --git a/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/notebook/Open Notebook.onetoc2 b/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/notebook/Open Notebook.onetoc2 new file mode 100644 index 0000000000000000000000000000000000000000..1484d5948ba65d1aa2a58dec1bb7f281acfe4c09 Binary files /dev/null and b/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/notebook/Open Notebook.onetoc2 differ diff --git a/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/read/environment.json b/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/read/environment.json new file mode 100644 index 0000000000000000000000000000000000000000..2ccd0dbc617ae986fa22c1ea49bd0ad4979ab759 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/read/environment.json @@ -0,0 +1,7 @@ +{ + "powershell": "5.1.14409.1005", + "schema": "xs2010", + "hostname": "ONE-M6-7B82F5FD", + "cold": true, + "onenote": "14.0.4763.1000" +} diff --git a/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/read/hierarchy.xml b/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/read/hierarchy.xml index 29b297008f732d1b59dc23c73eab41dddf83117c..b4ae4aaa5c923fb01b5122137313e76c658efa96 100644 --- a/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/read/hierarchy.xml +++ b/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/read/hierarchy.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/read/page-000.xml b/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/read/page-000.xml index 641d0f427604e5f658a64c761b62edad722521ca..3c7ec4792b2edeb0afb9d6f90d3b0a9d85eee4e2 100644 --- a/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/read/page-000.xml +++ b/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/read/page-000.xml @@ -1,2 +1,4 @@  - +Body child 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/read/page-001.xml b/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/read/page-001.xml index 47e7dc37a7d1165b83787020b1c651c6a4795499..607394ec4f30124be54dfa5c6fef41ee55e4b37c 100644 --- a/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/read/page-001.xml +++ b/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/read/page-001.xml @@ -1,4 +1,2 @@  -Body grandchild 🦀 é preserved]]> + diff --git a/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/read/page-002.xml b/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/read/page-002.xml index 45c7729e4c7fa4bf41f7188e5b304d4537c9e701..213a2ed96dbaf3eee577c6dbeb660517c4ff4c98 100644 --- a/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/read/page-002.xml +++ b/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/read/page-002.xml @@ -1,4 +1,4 @@  -Offline Body parent 🦀 éBody grandchild 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/read/page-003.xml b/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/read/page-003.xml index 89f9bdf8bba3bc0ef1c2475a3ea8847817f8a835..516541a095b5e90d4f75d7a6d7383b12c6d59c32 100644 --- a/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/read/page-003.xml +++ b/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/read/page-003.xml @@ -1,2 +1,4 @@  - +Offline Body parent 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/read/page-004.xml b/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/read/page-004.xml index 95930861ec6efc5d6f67f1f9aa08305bf5872d00..13ff5e1cebc72b07bc33ea040a7b87315ea647e8 100644 --- a/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/read/page-004.xml +++ b/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/read/page-004.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/read/page-005.xml b/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/read/page-005.xml index 6046d9cef4384d45cb8821d442a9b765638dffa1..7671086359149686086f8a6796a97ff15bb8d2e1 100644 --- a/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/read/page-005.xml +++ b/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/read/page-005.xml @@ -1,4 +1,2 @@  -Body child 🦀 é preserved]]> + diff --git a/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/read/page-006.xml b/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/read/page-006.xml index 90449ac07241299d3bddba540c1b14e4c8f33dfc..5c2b86e7982836257eb7bb0ba84b65c435fcf4db 100644 --- a/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/read/page-006.xml +++ b/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/read/page-006.xml @@ -1,4 +1,4 @@  -Body trailing 🦀 éBody automatic 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/read/page-007.xml b/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/read/page-007.xml index 9328dbea04689335589756d508d10632a932f564..67e2f1137aa44b6eff6616593713b8f0bcd25c9b 100644 --- a/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/read/page-007.xml +++ b/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/read/page-007.xml @@ -1,4 +1,4 @@  -Body automatic 🦀 éBody duplicate 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/read/page-008.xml b/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/read/page-008.xml index f232d0470aa691fd2d252c686b33c3547a487dd9..6efc5ed75b774d0c1bb765b368c21329b8d14fcb 100644 --- a/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/read/page-008.xml +++ b/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/read/page-008.xml @@ -1,4 +1,4 @@  -Body duplicate 🦀 éBody trailing 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/read/payloads.json b/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/read/payloads.json new file mode 100644 index 0000000000000000000000000000000000000000..1ce91a413d6fff4d58765187b76756f0e97ae843 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/read/payloads.json @@ -0,0 +1,3 @@ +[ + +] \ No newline at end of file diff --git a/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/run.json b/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/run.json new file mode 100644 index 0000000000000000000000000000000000000000..ce0b235d7119f02f98002a438f93a1434fcddee8 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/run.json @@ -0,0 +1,18 @@ +{ + "notebook": "/private/var/folders/90/4f4rngds01j55ggdj_vglk_c0000gn/T/tmphwmxgpck", + "expected_pages": 9, + "author": null, + "author_timeout_seconds": 600, + "inspect": false, + "collect_notebook": true, + "base": { + "file": "win7-office-base.qcow2", + "format": "qcow2", + "sha256": "a1a4f8fab782ee14885ff801ca2f6347c208fdcfc3513637096f314315c89346", + "virtual_size": 68719476736 + }, + "scripts": { + "cold.ps1": "c177fc72ae6c2634d186f5671a880de20b09f9716532c37c69cb13aa15c7e331", + "read.ps1": "04013bfcccee40a17e2a225f9b9e96f40a3a8daad9e350609654f8eda3ccbb41" + } +} diff --git a/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/scripts/cold.ps1 b/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/scripts/cold.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..a0b99e7aeb86f4dc10032537800501a52ad65b4f --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/scripts/cold.ps1 @@ -0,0 +1,27 @@ +param([Parameter(Mandatory=$true)][string]$Root, [string]$CloneHost = '') +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' +$root = [IO.Path]::GetFullPath($Root).TrimEnd('\') +if ([IO.Path]::GetDirectoryName($root) -ne 'C:\one-tests\runs') { + throw 'Choose a run directly below C:\one-tests\runs.' +} +if (Get-Process ONENOTE -ErrorAction SilentlyContinue) { throw 'Close OneNote before resetting its test cache.' } +$key = 'HKCU:\Software\Microsoft\Office\14.0\OneNote' +if ($CloneHost) { + if ($CloneHost -notmatch '^ONE-[A-Z0-9-]+$' -or [Environment]::MachineName -ne $CloneHost) { + throw 'The disposable clone hostname does not match this machine.' + } + New-Item "$key\Options\Paths" -Force | Out-Null + New-ItemProperty "$key\Options\Paths" -Name UnfiledNotesSection -PropertyType ExpandString -Value 'C:\one-tests\Loose.one' -Force | Out-Null +} elseif ((Get-ItemProperty "$key\Options\Paths").UnfiledNotesSection -ne 'C:\one-tests\Loose.one' -or + -not (Test-Path 'C:\one-tests\profile-original-cache')) { + throw 'Park the personal OneNote profile before resetting the test cache.' +} +$cache = Join-Path $env:LOCALAPPDATA 'Microsoft\OneNote\14.0' +$parked = Join-Path 'C:\one-tests\caches' ([IO.Path]::GetFileName($root)) +if (Test-Path $parked) { throw 'Choose a new run; its parked cache already exists.' } +New-Item -ItemType Directory -Path 'C:\one-tests\caches' -Force | Out-Null +if (Test-Path $cache) { Move-Item -LiteralPath $cache -Destination $parked } +if (Test-Path "$key\OpenNotebooks") { Remove-Item "$key\OpenNotebooks" -Recurse } +New-Item "$key\OpenNotebooks" | Out-Null +New-ItemProperty "$key\OpenNotebooks" -Name '1' -PropertyType String -Value "$root\notebook" | Out-Null diff --git a/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/scripts/read.ps1 b/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/scripts/read.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..476094ab1e0c47077988a6461db2080cf208642b --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/scripts/read.ps1 @@ -0,0 +1,142 @@ +param( + [Parameter(Mandatory=$true)][string]$Root, + [int]$ExpectedPages = -1, + [switch]$UseCurrentCache, + [switch]$Pdf, + [switch]$KeepOpen, + [string]$CloneHost = '' +) +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' +$root = [IO.Path]::GetFullPath($Root).TrimEnd('\') +if ([IO.Path]::GetDirectoryName($root) -ne 'C:\one-tests\runs') { + throw 'Choose a run directly below C:\one-tests\runs.' +} +$notebook = Join-Path $root 'notebook' +$output = Join-Path $root 'read' +if (Test-Path $output) { throw 'Choose a new read destination.' } +if ($UseCurrentCache) { + if ((Get-ItemProperty 'HKCU:\Software\Microsoft\Office\14.0\OneNote\Options\Paths').UnfiledNotesSection -ne 'C:\one-tests\Loose.one') { + throw 'Park the personal OneNote profile before reading test notebooks.' + } +} else { + & "$PSScriptRoot\cold-current.ps1" -Root $root -CloneHost $CloneHost +} +New-Item -ItemType Directory -Path $output | Out-Null +$app = New-Object -ComObject OneNote.Application +$notebookId = '' +$failure = $null +try { + $app.OpenHierarchy($notebook, '', [ref]$notebookId, 0) + $process = Get-Process ONENOTE + @{ hostname = [Environment]::MachineName; onenote = $process.MainModule.FileVersionInfo.FileVersion; + powershell = $PSVersionTable.PSVersion.ToString(); schema = 'xs2010'; cold = (-not $UseCurrentCache.IsPresent) } | + ConvertTo-Json | Set-Content (Join-Path $output 'environment.json') -Encoding UTF8 + $sections = @() + foreach ($file in @(Get-ChildItem $notebook -Recurse | Where-Object { $_.Extension -eq '.one' })) { + $id = '' + $app.OpenHierarchy($file.FullName, '', [ref]$id, 0) + $sections += $id + } + $deadline = [DateTime]::UtcNow.AddSeconds(300) + $previous = '' + $lastChange = '' + $stableSince = [DateTime]::UtcNow + $settled = $false + do { + $pages = @{} + foreach ($section in $sections) { + $hierarchy = '' + $app.GetHierarchy($section, 4, [ref]$hierarchy, 1) + [xml]$xml = $hierarchy + foreach ($node in $xml.SelectNodes('//*[@path]')) { + if (-not $node.GetAttribute('path').StartsWith("$notebook\", [StringComparison]::OrdinalIgnoreCase)) { + throw 'OneNote opened a section outside the copied notebook.' + } + } + foreach ($node in $xml.SelectNodes('//*[local-name()="Page"]')) { + $id = $node.GetAttribute('ID') + $content = '' + $app.GetPageContent($id, [ref]$content, 1, 1) + $pages[$id] = $content + } + } + $signature = [String]::Join('|', @($pages.Keys | Sort-Object | ForEach-Object { $_ + $pages[$_] })) + if ($signature -ne $previous) { + $lastChange = $previous + $previous = $signature + $stableSince = [DateTime]::UtcNow + } + if ((($ExpectedPages -ge 0 -and $pages.Count -eq $ExpectedPages) -or + ($ExpectedPages -lt 0 -and $pages.Count -gt 0)) -and + ([DateTime]::UtcNow - $stableSince).TotalSeconds -ge 2) { $settled = $true; break } + Start-Sleep -Milliseconds 250 + } while ([DateTime]::UtcNow -lt $deadline) + if (-not $settled -or ($ExpectedPages -ge 0 -and $pages.Count -ne $ExpectedPages) -or ($ExpectedPages -lt 0 -and $pages.Count -eq 0)) { + [IO.File]::WriteAllText((Join-Path $output 'previous-signature.txt'), $lastChange, [Text.Encoding]::UTF8) + $index = 0 + foreach ($id in @($pages.Keys | Sort-Object)) { + [IO.File]::WriteAllText((Join-Path $output ('unsettled-{0:d3}.xml' -f $index)), $pages[$id], [Text.Encoding]::UTF8) + $index++ + } + $hierarchy = '' + $app.GetHierarchy($notebookId, 4, [ref]$hierarchy, 1) + [IO.File]::WriteAllText((Join-Path $output 'unsettled-hierarchy.xml'), $hierarchy, [Text.Encoding]::UTF8) + throw "Expected $ExpectedPages stable pages; OneNote returned $($pages.Count), settled=$settled." + } + $index = 0 + $payloads = @() + foreach ($id in @($pages.Keys | Sort-Object)) { + [IO.File]::WriteAllText((Join-Path $output ('page-{0:d3}.xml' -f $index)), $pages[$id], [Text.Encoding]::UTF8) + if ($Pdf) { + $pdfPath = Join-Path $output ('page-{0:d3}.pdf' -f $index) + $app.NavigateTo($id, '', $false) + $app.Publish($id, $pdfPath, 3, '') + if (-not (Test-Path $pdfPath) -or (Get-Item $pdfPath).Length -eq 0) { throw 'OneNote did not publish the page PDF.' } + } + [xml]$page = $pages[$id] + foreach ($file in $page.SelectNodes('//*[local-name()="InsertedFile" or local-name()="MediaFile"]')) { + $bytes = [IO.File]::ReadAllBytes($file.GetAttribute('pathCache')) + $hash = [BitConverter]::ToString([Security.Cryptography.SHA256]::Create().ComputeHash($bytes)).Replace('-', '').ToLowerInvariant() + [IO.File]::WriteAllBytes((Join-Path $output ($hash + '.attachment')), $bytes) + $payloads += @{ page = $id; object = $file.ParentNode.GetAttribute('objectID'); + kind = $file.LocalName; name = $file.GetAttribute('preferredName'); + sha256 = $hash; bytes = $bytes.Length } + } + $index++ + } + [IO.File]::WriteAllText((Join-Path $output 'payloads.json'), (ConvertTo-Json -InputObject $payloads -Depth 4), [Text.Encoding]::UTF8) + $all = '' + $app.GetHierarchy($notebookId, 4, [ref]$all, 1) + [xml]$finalTree = $all + $finalIds = @($finalTree.SelectNodes('//*[local-name()="Page"]') | ForEach-Object { $_.GetAttribute('ID') } | Sort-Object -Unique) + if ($finalIds.Count -ne $pages.Count -or @($finalIds | Where-Object { -not $pages.ContainsKey($_) }).Count -ne 0) { + throw 'The notebook hierarchy changed while collecting page evidence; repeat the cold read.' + } + [IO.File]::WriteAllText((Join-Path $output 'hierarchy.xml'), $all, [Text.Encoding]::UTF8) + Write-Output "Read $($sections.Count) sections and $($pages.Count) pages." +} catch { + $failure = $_ + [IO.File]::WriteAllText((Join-Path $output 'failure.txt'), ($_ | Out-String), [Text.Encoding]::UTF8) + throw +} finally { + try { + try { + if ($notebookId -and $CloneHost) { $app.SyncHierarchy($notebookId) } + if ($notebookId -and -not $KeepOpen -and (-not $UseCurrentCache -or $CloneHost)) { + $app.CloseNotebook($notebookId, $false) + } + } catch { + if ($null -eq $failure) { throw } + [IO.File]::WriteAllText((Join-Path $output 'cleanup-failure.txt'), ($_ | Out-String), [Text.Encoding]::UTF8) + } + } finally { + [void][Runtime.InteropServices.Marshal]::FinalReleaseComObject($app) + } + $app = $null + [GC]::Collect() + [GC]::WaitForPendingFinalizers() + if (-not $UseCurrentCache -and -not $CloneHost) { + Get-Process ONENOTE -ErrorAction SilentlyContinue | Wait-Process -Timeout 10 + } +} diff --git a/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/source.json b/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/source.json new file mode 100644 index 0000000000000000000000000000000000000000..8240d1f0d61e6f89a81c76e3c338450597d80788 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/source.json @@ -0,0 +1,8 @@ +[ + { + "path": "Lifecycle.one", + "bytes": 66464, + "sha256": "698e65aec54d2096cb78fe19daf07002cd4cff49139cbe2a8ae515cb8a07f75d", + "mtime_ns": 1789121645336160751 + } +] diff --git a/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/teardown.json b/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/teardown.json new file mode 100644 index 0000000000000000000000000000000000000000..05a47793de40f322e745c4c4183727e3590ecf70 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-04-subpage-move/cold/teardown.json @@ -0,0 +1 @@ +{"absent": true} diff --git a/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/candidate/Lifecycle.one b/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/candidate/Lifecycle.one index a3c872c9c655a1dd02b125a7ddb85c14f079febf..9948f6c44ba31a09d8ef961a8b124f1379b307fe 100644 Binary files a/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/candidate/Lifecycle.one and b/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/candidate/Lifecycle.one differ diff --git a/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/candidate/manifest.json b/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/candidate/manifest.json index 01347c85d709f49e59aed974458f98da97aca2ba..7d8156109059eb68b76e73ddf4bb7a448d78ebe8 100644 --- a/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/candidate/manifest.json +++ b/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/candidate/manifest.json @@ -5,22 +5,22 @@ "original": [ { "guid": [ - 226, - 236, - 241, - 200, - 113, - 141, - 171, - 65, + 214, + 112, 191, - 3, - 115, - 230, - 170, - 34, - 82, - 43 + 76, + 177, + 132, + 199, + 74, + 148, + 117, + 134, + 207, + 52, + 51, + 67, + 46 ], "level": 1, "position": { @@ -30,22 +30,22 @@ }, { "guid": [ - 20, - 121, - 4, - 218, - 137, + 128, + 178, 56, - 175, - 77, - 160, - 58, + 171, + 138, + 138, + 246, + 66, + 139, + 88, + 79, + 196, 161, - 132, - 129, - 41, - 1, - 141 + 192, + 138, + 130 ], "level": 2, "position": { @@ -55,22 +55,22 @@ }, { "guid": [ - 231, - 161, - 138, - 72, - 118, - 99, - 127, - 79, - 169, - 229, - 47, - 28, - 85, - 29, - 216, - 80 + 210, + 174, + 167, + 147, + 15, + 58, + 110, + 66, + 134, + 223, + 121, + 114, + 175, + 78, + 139, + 163 ], "level": 3, "position": { @@ -79,28 +79,28 @@ "space": "{8A6DBA48-33BB-0681-2F02-2C73A811E8B8},1" } ], - "page_receipt": "Some(Published { revision: ExGuid { guid: [183, 145, 48, 129, 50, 121, 10, 64, 180, 97, 141, 196, 85, 188, 142, 54], n: 1 } })", + "page_receipt": "Some(Published { revision: ExGuid { guid: [97, 70, 101, 4, 72, 93, 202, 77, 173, 162, 7, 191, 108, 100, 122, 119], n: 1 } })", "phase": "05-insert-before-subpage", "publications": 2, "reviewed": [ { "guid": [ - 226, - 236, - 241, - 200, - 113, - 141, - 171, - 65, + 214, + 112, 191, - 3, - 115, - 230, - 170, - 34, - 82, - 43 + 76, + 177, + 132, + 199, + 74, + 148, + 117, + 134, + 207, + 52, + 51, + 67, + 46 ], "level": 1, "position": { @@ -110,22 +110,22 @@ }, { "guid": [ - 20, - 121, - 4, - 218, - 137, + 128, + 178, 56, - 175, - 77, - 160, - 58, + 171, + 138, + 138, + 246, + 66, + 139, + 88, + 79, + 196, 161, - 132, - 129, - 41, - 1, - 141 + 192, + 138, + 130 ], "level": 2, "position": { @@ -135,22 +135,22 @@ }, { "guid": [ - 231, - 161, - 138, - 72, - 118, - 99, - 127, - 79, - 169, - 229, - 47, - 28, - 85, - 29, - 216, - 80 + 210, + 174, + 167, + 147, + 15, + 58, + 110, + 66, + 134, + 223, + 121, + 114, + 175, + 78, + 139, + 163 ], "level": 3, "position": { @@ -159,5 +159,5 @@ "space": "{8A6DBA48-33BB-0681-2F02-2C73A811E8B8},1" } ], - "text_receipt": "Some(Published { revision: ExGuid { guid: [31, 6, 219, 197, 110, 152, 68, 76, 172, 35, 161, 30, 41, 171, 164, 154], n: 1 } })" + "text_receipt": "Some(Published { revision: ExGuid { guid: [129, 132, 34, 48, 213, 101, 31, 68, 132, 62, 242, 153, 231, 13, 4, 12], n: 1 } })" } \ No newline at end of file diff --git a/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/commands.jsonl b/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/commands.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..d8d13b7a4904f8b8cef02db9cd59de71069a22a6 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/commands.jsonl @@ -0,0 +1,3 @@ +{"command": "powershell -NoProfile -Command \"Expand-Archive -LiteralPath C:\\one-tests\\transfer.zip -DestinationPath C:\\one-tests\\runs\\capture\\notebook\"", "exit": 0, "stdout": "", "stderr": "", "error": null} +{"command": "powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -File C:\\one-tests\\read-current.ps1 -Root C:\\one-tests\\runs\\capture -CloneHost ONE-M6-797C5E28 -ExpectedPages 9", "exit": 0, "stdout": "Read 1 sections and 9 pages.\r\n", "stderr": "", "error": null} +{"command": "powershell -NoProfile -Command \"Compress-Archive -Force -Path C:\\one-tests\\runs\\capture\\* -DestinationPath C:\\one-tests\\captured.zip\"", "exit": 0, "stdout": "", "stderr": "", "error": null} diff --git a/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/machine.json b/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/machine.json new file mode 100644 index 0000000000000000000000000000000000000000..c55b4783c35a180a91d4b8bbeed3d5d0b4b707a8 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/machine.json @@ -0,0 +1 @@ +{"name": "m6-797c5e28", "hostname": "ONE-M6-797C5E28"} diff --git a/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/notebook/Lifecycle.one b/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/notebook/Lifecycle.one index 7264884661d4692d36a36ae7faa62496b462725c..211853432a9ade4268f81951c42a6bd7633db28a 100644 Binary files a/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/notebook/Lifecycle.one and b/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/notebook/Lifecycle.one differ diff --git a/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/notebook/Open Notebook.onetoc2 b/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/notebook/Open Notebook.onetoc2 new file mode 100644 index 0000000000000000000000000000000000000000..4552fc1dbcfb1826349333df051bfa23f620fcf9 Binary files /dev/null and b/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/notebook/Open Notebook.onetoc2 differ diff --git a/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/read/environment.json b/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/read/environment.json new file mode 100644 index 0000000000000000000000000000000000000000..99f65c3c99974d0caa70d8e228bcf637a96967b7 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/read/environment.json @@ -0,0 +1,7 @@ +{ + "powershell": "5.1.14409.1005", + "schema": "xs2010", + "hostname": "ONE-M6-797C5E28", + "cold": true, + "onenote": "14.0.4763.1000" +} diff --git a/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/read/hierarchy.xml b/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/read/hierarchy.xml index ff049c9c8cfcc579a6512cf18a203fad3f1fb18e..b16a737579d10e1c8513120a7d296a3b3ba3140e 100644 --- a/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/read/hierarchy.xml +++ b/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/read/hierarchy.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/read/page-000.xml b/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/read/page-000.xml index 56409f471881843d6412125de69260a6385043af..580181b862e21c102ea7cf71b556bd219e7ad0af 100644 --- a/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/read/page-000.xml +++ b/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/read/page-000.xml @@ -1,4 +1,4 @@  -Body child 🦀 éBody grandchild 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/read/page-001.xml b/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/read/page-001.xml index 2c1397fd535eba6b9d56e0ff3d815b6358beb5b7..b9420c6a1c022d0d66e9f991428ed13bfbb0195f 100644 --- a/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/read/page-001.xml +++ b/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/read/page-001.xml @@ -1,2 +1,4 @@  - +Offline Body parent 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/read/page-002.xml b/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/read/page-002.xml index d9a41c904e5c8b0de61054913ce252b9bbbfa67f..a082aed77aa1178dbe902a23961460561b74513e 100644 --- a/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/read/page-002.xml +++ b/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/read/page-002.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/read/page-003.xml b/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/read/page-003.xml index 138fd929e3fc8b18fcbef521a1849a4a69c66247..be94f9e238a645bd0172c78270692f861781020a 100644 --- a/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/read/page-003.xml +++ b/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/read/page-003.xml @@ -1,4 +1,2 @@  -Offline Body parent 🦀 é preserved]]> + diff --git a/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/read/page-004.xml b/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/read/page-004.xml index 370d826a803e0667a73b1f09ac1179562cb1f2e3..b99894439887a47a85b1d50b59e206865a9a983f 100644 --- a/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/read/page-004.xml +++ b/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/read/page-004.xml @@ -1,4 +1,4 @@  -Body grandchild 🦀 éBody child 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/read/page-005.xml b/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/read/page-005.xml index 6df0b9a75d431ad7e3c4d401a6b0a89c777c1789..d99efda1e6c27e2ddb05040a7e2e609a63a71a4b 100644 --- a/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/read/page-005.xml +++ b/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/read/page-005.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/read/page-006.xml b/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/read/page-006.xml index da5ff0193b117ff66aec2ac8ce8e000cf56f39bd..51ded3ab607d4cd93806cec6a4e370e7c53b40b9 100644 --- a/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/read/page-006.xml +++ b/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/read/page-006.xml @@ -1,4 +1,4 @@  -Body duplicate 🦀 éBody trailing 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/read/page-007.xml b/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/read/page-007.xml index 5d88cb6927aee56fe9206fbc673d0cb058846de6..3c080b86668054f921b98a11b78d99854e570546 100644 --- a/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/read/page-007.xml +++ b/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/read/page-007.xml @@ -1,4 +1,4 @@  -Body automatic 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/read/page-008.xml b/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/read/page-008.xml index 817b4dd435498d30b4d9eba16e70e9dbc0ffe789..6a503538c391b986b2be71a8f5477209c2e82892 100644 --- a/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/read/page-008.xml +++ b/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/read/page-008.xml @@ -1,4 +1,4 @@  -Body trailing 🦀 éBody duplicate 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/read/payloads.json b/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/read/payloads.json new file mode 100644 index 0000000000000000000000000000000000000000..1ce91a413d6fff4d58765187b76756f0e97ae843 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/read/payloads.json @@ -0,0 +1,3 @@ +[ + +] \ No newline at end of file diff --git a/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/run.json b/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/run.json new file mode 100644 index 0000000000000000000000000000000000000000..88f26c6897b4d9c840ddf515522a01c525f931c0 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/run.json @@ -0,0 +1,18 @@ +{ + "notebook": "/private/var/folders/90/4f4rngds01j55ggdj_vglk_c0000gn/T/tmpq5zb96wg", + "expected_pages": 9, + "author": null, + "author_timeout_seconds": 600, + "inspect": false, + "collect_notebook": true, + "base": { + "file": "win7-office-base.qcow2", + "format": "qcow2", + "sha256": "a1a4f8fab782ee14885ff801ca2f6347c208fdcfc3513637096f314315c89346", + "virtual_size": 68719476736 + }, + "scripts": { + "cold.ps1": "c177fc72ae6c2634d186f5671a880de20b09f9716532c37c69cb13aa15c7e331", + "read.ps1": "04013bfcccee40a17e2a225f9b9e96f40a3a8daad9e350609654f8eda3ccbb41" + } +} diff --git a/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/scripts/cold.ps1 b/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/scripts/cold.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..a0b99e7aeb86f4dc10032537800501a52ad65b4f --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/scripts/cold.ps1 @@ -0,0 +1,27 @@ +param([Parameter(Mandatory=$true)][string]$Root, [string]$CloneHost = '') +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' +$root = [IO.Path]::GetFullPath($Root).TrimEnd('\') +if ([IO.Path]::GetDirectoryName($root) -ne 'C:\one-tests\runs') { + throw 'Choose a run directly below C:\one-tests\runs.' +} +if (Get-Process ONENOTE -ErrorAction SilentlyContinue) { throw 'Close OneNote before resetting its test cache.' } +$key = 'HKCU:\Software\Microsoft\Office\14.0\OneNote' +if ($CloneHost) { + if ($CloneHost -notmatch '^ONE-[A-Z0-9-]+$' -or [Environment]::MachineName -ne $CloneHost) { + throw 'The disposable clone hostname does not match this machine.' + } + New-Item "$key\Options\Paths" -Force | Out-Null + New-ItemProperty "$key\Options\Paths" -Name UnfiledNotesSection -PropertyType ExpandString -Value 'C:\one-tests\Loose.one' -Force | Out-Null +} elseif ((Get-ItemProperty "$key\Options\Paths").UnfiledNotesSection -ne 'C:\one-tests\Loose.one' -or + -not (Test-Path 'C:\one-tests\profile-original-cache')) { + throw 'Park the personal OneNote profile before resetting the test cache.' +} +$cache = Join-Path $env:LOCALAPPDATA 'Microsoft\OneNote\14.0' +$parked = Join-Path 'C:\one-tests\caches' ([IO.Path]::GetFileName($root)) +if (Test-Path $parked) { throw 'Choose a new run; its parked cache already exists.' } +New-Item -ItemType Directory -Path 'C:\one-tests\caches' -Force | Out-Null +if (Test-Path $cache) { Move-Item -LiteralPath $cache -Destination $parked } +if (Test-Path "$key\OpenNotebooks") { Remove-Item "$key\OpenNotebooks" -Recurse } +New-Item "$key\OpenNotebooks" | Out-Null +New-ItemProperty "$key\OpenNotebooks" -Name '1' -PropertyType String -Value "$root\notebook" | Out-Null diff --git a/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/scripts/read.ps1 b/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/scripts/read.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..476094ab1e0c47077988a6461db2080cf208642b --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/scripts/read.ps1 @@ -0,0 +1,142 @@ +param( + [Parameter(Mandatory=$true)][string]$Root, + [int]$ExpectedPages = -1, + [switch]$UseCurrentCache, + [switch]$Pdf, + [switch]$KeepOpen, + [string]$CloneHost = '' +) +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' +$root = [IO.Path]::GetFullPath($Root).TrimEnd('\') +if ([IO.Path]::GetDirectoryName($root) -ne 'C:\one-tests\runs') { + throw 'Choose a run directly below C:\one-tests\runs.' +} +$notebook = Join-Path $root 'notebook' +$output = Join-Path $root 'read' +if (Test-Path $output) { throw 'Choose a new read destination.' } +if ($UseCurrentCache) { + if ((Get-ItemProperty 'HKCU:\Software\Microsoft\Office\14.0\OneNote\Options\Paths').UnfiledNotesSection -ne 'C:\one-tests\Loose.one') { + throw 'Park the personal OneNote profile before reading test notebooks.' + } +} else { + & "$PSScriptRoot\cold-current.ps1" -Root $root -CloneHost $CloneHost +} +New-Item -ItemType Directory -Path $output | Out-Null +$app = New-Object -ComObject OneNote.Application +$notebookId = '' +$failure = $null +try { + $app.OpenHierarchy($notebook, '', [ref]$notebookId, 0) + $process = Get-Process ONENOTE + @{ hostname = [Environment]::MachineName; onenote = $process.MainModule.FileVersionInfo.FileVersion; + powershell = $PSVersionTable.PSVersion.ToString(); schema = 'xs2010'; cold = (-not $UseCurrentCache.IsPresent) } | + ConvertTo-Json | Set-Content (Join-Path $output 'environment.json') -Encoding UTF8 + $sections = @() + foreach ($file in @(Get-ChildItem $notebook -Recurse | Where-Object { $_.Extension -eq '.one' })) { + $id = '' + $app.OpenHierarchy($file.FullName, '', [ref]$id, 0) + $sections += $id + } + $deadline = [DateTime]::UtcNow.AddSeconds(300) + $previous = '' + $lastChange = '' + $stableSince = [DateTime]::UtcNow + $settled = $false + do { + $pages = @{} + foreach ($section in $sections) { + $hierarchy = '' + $app.GetHierarchy($section, 4, [ref]$hierarchy, 1) + [xml]$xml = $hierarchy + foreach ($node in $xml.SelectNodes('//*[@path]')) { + if (-not $node.GetAttribute('path').StartsWith("$notebook\", [StringComparison]::OrdinalIgnoreCase)) { + throw 'OneNote opened a section outside the copied notebook.' + } + } + foreach ($node in $xml.SelectNodes('//*[local-name()="Page"]')) { + $id = $node.GetAttribute('ID') + $content = '' + $app.GetPageContent($id, [ref]$content, 1, 1) + $pages[$id] = $content + } + } + $signature = [String]::Join('|', @($pages.Keys | Sort-Object | ForEach-Object { $_ + $pages[$_] })) + if ($signature -ne $previous) { + $lastChange = $previous + $previous = $signature + $stableSince = [DateTime]::UtcNow + } + if ((($ExpectedPages -ge 0 -and $pages.Count -eq $ExpectedPages) -or + ($ExpectedPages -lt 0 -and $pages.Count -gt 0)) -and + ([DateTime]::UtcNow - $stableSince).TotalSeconds -ge 2) { $settled = $true; break } + Start-Sleep -Milliseconds 250 + } while ([DateTime]::UtcNow -lt $deadline) + if (-not $settled -or ($ExpectedPages -ge 0 -and $pages.Count -ne $ExpectedPages) -or ($ExpectedPages -lt 0 -and $pages.Count -eq 0)) { + [IO.File]::WriteAllText((Join-Path $output 'previous-signature.txt'), $lastChange, [Text.Encoding]::UTF8) + $index = 0 + foreach ($id in @($pages.Keys | Sort-Object)) { + [IO.File]::WriteAllText((Join-Path $output ('unsettled-{0:d3}.xml' -f $index)), $pages[$id], [Text.Encoding]::UTF8) + $index++ + } + $hierarchy = '' + $app.GetHierarchy($notebookId, 4, [ref]$hierarchy, 1) + [IO.File]::WriteAllText((Join-Path $output 'unsettled-hierarchy.xml'), $hierarchy, [Text.Encoding]::UTF8) + throw "Expected $ExpectedPages stable pages; OneNote returned $($pages.Count), settled=$settled." + } + $index = 0 + $payloads = @() + foreach ($id in @($pages.Keys | Sort-Object)) { + [IO.File]::WriteAllText((Join-Path $output ('page-{0:d3}.xml' -f $index)), $pages[$id], [Text.Encoding]::UTF8) + if ($Pdf) { + $pdfPath = Join-Path $output ('page-{0:d3}.pdf' -f $index) + $app.NavigateTo($id, '', $false) + $app.Publish($id, $pdfPath, 3, '') + if (-not (Test-Path $pdfPath) -or (Get-Item $pdfPath).Length -eq 0) { throw 'OneNote did not publish the page PDF.' } + } + [xml]$page = $pages[$id] + foreach ($file in $page.SelectNodes('//*[local-name()="InsertedFile" or local-name()="MediaFile"]')) { + $bytes = [IO.File]::ReadAllBytes($file.GetAttribute('pathCache')) + $hash = [BitConverter]::ToString([Security.Cryptography.SHA256]::Create().ComputeHash($bytes)).Replace('-', '').ToLowerInvariant() + [IO.File]::WriteAllBytes((Join-Path $output ($hash + '.attachment')), $bytes) + $payloads += @{ page = $id; object = $file.ParentNode.GetAttribute('objectID'); + kind = $file.LocalName; name = $file.GetAttribute('preferredName'); + sha256 = $hash; bytes = $bytes.Length } + } + $index++ + } + [IO.File]::WriteAllText((Join-Path $output 'payloads.json'), (ConvertTo-Json -InputObject $payloads -Depth 4), [Text.Encoding]::UTF8) + $all = '' + $app.GetHierarchy($notebookId, 4, [ref]$all, 1) + [xml]$finalTree = $all + $finalIds = @($finalTree.SelectNodes('//*[local-name()="Page"]') | ForEach-Object { $_.GetAttribute('ID') } | Sort-Object -Unique) + if ($finalIds.Count -ne $pages.Count -or @($finalIds | Where-Object { -not $pages.ContainsKey($_) }).Count -ne 0) { + throw 'The notebook hierarchy changed while collecting page evidence; repeat the cold read.' + } + [IO.File]::WriteAllText((Join-Path $output 'hierarchy.xml'), $all, [Text.Encoding]::UTF8) + Write-Output "Read $($sections.Count) sections and $($pages.Count) pages." +} catch { + $failure = $_ + [IO.File]::WriteAllText((Join-Path $output 'failure.txt'), ($_ | Out-String), [Text.Encoding]::UTF8) + throw +} finally { + try { + try { + if ($notebookId -and $CloneHost) { $app.SyncHierarchy($notebookId) } + if ($notebookId -and -not $KeepOpen -and (-not $UseCurrentCache -or $CloneHost)) { + $app.CloseNotebook($notebookId, $false) + } + } catch { + if ($null -eq $failure) { throw } + [IO.File]::WriteAllText((Join-Path $output 'cleanup-failure.txt'), ($_ | Out-String), [Text.Encoding]::UTF8) + } + } finally { + [void][Runtime.InteropServices.Marshal]::FinalReleaseComObject($app) + } + $app = $null + [GC]::Collect() + [GC]::WaitForPendingFinalizers() + if (-not $UseCurrentCache -and -not $CloneHost) { + Get-Process ONENOTE -ErrorAction SilentlyContinue | Wait-Process -Timeout 10 + } +} diff --git a/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/source.json b/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/source.json new file mode 100644 index 0000000000000000000000000000000000000000..8aaea301f426779b0138393b9bc4409a4a6cbf3a --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/source.json @@ -0,0 +1,8 @@ +[ + { + "path": "Lifecycle.one", + "bytes": 68104, + "sha256": "6d156380c9a4fe2be62662f6cb18fb2dad0423c4baf6c7ff7cc74a0fb6f39ec7", + "mtime_ns": 1789121645747767832 + } +] diff --git a/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/teardown.json b/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/teardown.json new file mode 100644 index 0000000000000000000000000000000000000000..05a47793de40f322e745c4c4183727e3590ecf70 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-05-insert-before-subpage/cold/teardown.json @@ -0,0 +1 @@ +{"absent": true} diff --git a/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/candidate/Lifecycle.one b/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/candidate/Lifecycle.one index cba6a1d547983632bfdbcb8f010dd7237341409f..7005a9c9f8ae88518fa4056afb36d4c267b2afa5 100644 Binary files a/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/candidate/Lifecycle.one and b/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/candidate/Lifecycle.one differ diff --git a/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/candidate/manifest.json b/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/candidate/manifest.json index 7e16fb916c1d7d8906503fddf3aa2ddfac6125d8..3e75cf1c71cb7853394835e467b9c18fd371431b 100644 --- a/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/candidate/manifest.json +++ b/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/candidate/manifest.json @@ -5,22 +5,22 @@ "original": [ { "guid": [ - 250, - 94, - 81, - 44, - 38, - 41, - 18, - 79, - 176, - 32, - 212, - 55, - 124, - 86, - 24, - 127 + 68, + 158, + 11, + 68, + 154, + 29, + 16, + 77, + 138, + 227, + 126, + 70, + 53, + 196, + 30, + 137 ], "level": 1, "position": { @@ -30,22 +30,22 @@ }, { "guid": [ - 212, - 192, - 147, - 247, - 2, - 22, - 36, - 69, - 191, - 7, - 210, + 168, + 186, + 220, + 11, + 33, + 242, + 222, + 73, + 186, + 14, 26, - 138, - 233, + 68, + 126, 236, - 190 + 227, + 189 ], "level": 2, "position": { @@ -55,22 +55,22 @@ }, { "guid": [ - 161, - 179, - 107, - 180, - 28, - 108, - 129, - 70, - 167, - 177, - 5, - 12, - 8, - 212, - 104, - 95 + 169, + 20, + 205, + 3, + 56, + 3, + 3, + 78, + 176, + 171, + 155, + 220, + 21, + 165, + 243, + 237 ], "level": 3, "position": { @@ -85,22 +85,22 @@ "reviewed": [ { "guid": [ - 250, - 94, - 81, - 44, - 38, - 41, - 18, - 79, - 176, - 32, - 212, - 55, - 124, - 86, - 24, - 127 + 68, + 158, + 11, + 68, + 154, + 29, + 16, + 77, + 138, + 227, + 126, + 70, + 53, + 196, + 30, + 137 ], "level": 1, "position": { @@ -110,22 +110,22 @@ }, { "guid": [ - 212, - 192, - 147, - 247, - 2, - 22, - 36, - 69, - 191, - 7, - 210, + 168, + 186, + 220, + 11, + 33, + 242, + 222, + 73, + 186, + 14, 26, - 138, - 233, + 68, + 126, 236, - 190 + 227, + 189 ], "level": 2, "position": { @@ -135,22 +135,22 @@ }, { "guid": [ - 161, - 179, - 107, - 180, - 28, - 108, - 129, - 70, - 167, - 177, - 5, - 12, - 8, - 212, - 104, - 95 + 169, + 20, + 205, + 3, + 56, + 3, + 3, + 78, + 176, + 171, + 155, + 220, + 21, + 165, + 243, + 237 ], "level": 3, "position": { @@ -159,5 +159,5 @@ "space": "{8A6DBA48-33BB-0681-2F02-2C73A811E8B8},1" } ], - "text_receipt": "Some(Published { revision: ExGuid { guid: [196, 162, 225, 119, 228, 238, 138, 70, 157, 106, 207, 59, 244, 169, 255, 34], n: 1 } })" + "text_receipt": "Some(Published { revision: ExGuid { guid: [51, 201, 152, 157, 39, 204, 254, 79, 163, 2, 70, 230, 36, 46, 107, 249], n: 1 } })" } \ No newline at end of file diff --git a/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/commands.jsonl b/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/commands.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..46409fa65be9e207f1419ba94f5e5a78bdf61993 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/commands.jsonl @@ -0,0 +1,3 @@ +{"command": "powershell -NoProfile -Command \"Expand-Archive -LiteralPath C:\\one-tests\\transfer.zip -DestinationPath C:\\one-tests\\runs\\capture\\notebook\"", "exit": 0, "stdout": "", "stderr": "", "error": null} +{"command": "powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -File C:\\one-tests\\read-current.ps1 -Root C:\\one-tests\\runs\\capture -CloneHost ONE-M6-5F2EA96F -ExpectedPages 9", "exit": 0, "stdout": "Read 1 sections and 9 pages.\r\n", "stderr": "", "error": null} +{"command": "powershell -NoProfile -Command \"Compress-Archive -Force -Path C:\\one-tests\\runs\\capture\\* -DestinationPath C:\\one-tests\\captured.zip\"", "exit": 0, "stdout": "", "stderr": "", "error": null} diff --git a/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/machine.json b/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/machine.json new file mode 100644 index 0000000000000000000000000000000000000000..e828aeec25caea961182114d7512490c50221002 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/machine.json @@ -0,0 +1 @@ +{"name": "m6-5f2ea96f", "hostname": "ONE-M6-5F2EA96F"} diff --git a/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/notebook/Lifecycle.one b/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/notebook/Lifecycle.one index 8ca150210d1bdf4eff78e0c77821370b130d1c8b..8057df9e7e6568e6f04049f199aea3a773e9ece4 100644 Binary files a/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/notebook/Lifecycle.one and b/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/notebook/Lifecycle.one differ diff --git a/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/notebook/Open Notebook.onetoc2 b/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/notebook/Open Notebook.onetoc2 new file mode 100644 index 0000000000000000000000000000000000000000..c3e49dacb9e12dda78e8623adf7b652ee0641b4d Binary files /dev/null and b/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/notebook/Open Notebook.onetoc2 differ diff --git a/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/read/environment.json b/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/read/environment.json new file mode 100644 index 0000000000000000000000000000000000000000..60b3b751b88328da7630ebed0f9cb59a9dbdcadd --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/read/environment.json @@ -0,0 +1,7 @@ +{ + "powershell": "5.1.14409.1005", + "schema": "xs2010", + "hostname": "ONE-M6-5F2EA96F", + "cold": true, + "onenote": "14.0.4763.1000" +} diff --git a/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/read/hierarchy.xml b/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/read/hierarchy.xml index 185019a1ab9cd23e9cf12a88956802e3b577634b..25db231084d5f5180f5a0b58b05abee1725305c2 100644 --- a/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/read/hierarchy.xml +++ b/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/read/hierarchy.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/read/page-000.xml b/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/read/page-000.xml index ca35946118950b08b9539761e4b41bf4cbfd359a..d5431fc20ca51a517ce933845929a73df410cf00 100644 --- a/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/read/page-000.xml +++ b/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/read/page-000.xml @@ -1,4 +1,2 @@  -Body automatic 🦀 é preserved]]> + diff --git a/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/read/page-001.xml b/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/read/page-001.xml index f93737305928e254976a6629e1898fa793f270f1..63bfade0371259891f1b6309865024c919066066 100644 --- a/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/read/page-001.xml +++ b/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/read/page-001.xml @@ -1,4 +1,4 @@  -Body duplicate 🦀 éBody child 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/read/page-002.xml b/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/read/page-002.xml index c206d2154f0423e3e8ab0ad5b12f913dbfaa16ca..0ed15d9410a1d26127286f82236dce1bc274b513 100644 --- a/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/read/page-002.xml +++ b/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/read/page-002.xml @@ -1,4 +1,2 @@  -Body trailing 🦀 é preserved]]> + diff --git a/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/read/page-003.xml b/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/read/page-003.xml index bd7332627d400e0f8cc6f01b67216e1dd710083c..63527cc43a99c8f14713788c30d017ef2ba1ec2d 100644 --- a/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/read/page-003.xml +++ b/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/read/page-003.xml @@ -1,2 +1,4 @@  - +Offline Body parent 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/read/page-004.xml b/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/read/page-004.xml index c683033bab3aaa11cc4253ac8fb3ad8d67031ea3..339825a56b38aabb6947c06cf5fbf945e1a9745a 100644 --- a/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/read/page-004.xml +++ b/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/read/page-004.xml @@ -1,4 +1,4 @@  -Body child 🦀 éBody grandchild 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/read/page-005.xml b/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/read/page-005.xml index cf69328c7c5908b7fd44355ceabe557211e0489c..a2bf4210d4f2c7cda5c6a37aafed1ae5d25bd0da 100644 --- a/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/read/page-005.xml +++ b/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/read/page-005.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/read/page-006.xml b/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/read/page-006.xml index 85aa554da7b9f5aab922f37fc9c1675dbfeffe94..aa614608be1acca751ceec7325a8d333cd9c10a3 100644 --- a/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/read/page-006.xml +++ b/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/read/page-006.xml @@ -1,4 +1,4 @@  -Body grandchild 🦀 éBody automatic 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/read/page-007.xml b/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/read/page-007.xml index fdd0ee6268a31303cb6f99d4f96f83c63eddc1a0..3a0bea4b5e1b06743cb1dc99c049020021065612 100644 --- a/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/read/page-007.xml +++ b/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/read/page-007.xml @@ -1,4 +1,4 @@  -Offline Body parent 🦀 éBody duplicate 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/read/page-008.xml b/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/read/page-008.xml index 2e34b0f3fc827fdb87fe607bc5fb25c387382031..dbb5d792579285b444786556266ae000fc7c6951 100644 --- a/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/read/page-008.xml +++ b/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/read/page-008.xml @@ -1,2 +1,4 @@  - +Body trailing 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/read/payloads.json b/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/read/payloads.json new file mode 100644 index 0000000000000000000000000000000000000000..1ce91a413d6fff4d58765187b76756f0e97ae843 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/read/payloads.json @@ -0,0 +1,3 @@ +[ + +] \ No newline at end of file diff --git a/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/run.json b/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/run.json new file mode 100644 index 0000000000000000000000000000000000000000..ca52a42162f9918fff0ce770b8d3a144662c48f4 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/run.json @@ -0,0 +1,18 @@ +{ + "notebook": "/private/var/folders/90/4f4rngds01j55ggdj_vglk_c0000gn/T/tmp8h8axamn", + "expected_pages": 9, + "author": null, + "author_timeout_seconds": 600, + "inspect": false, + "collect_notebook": true, + "base": { + "file": "win7-office-base.qcow2", + "format": "qcow2", + "sha256": "a1a4f8fab782ee14885ff801ca2f6347c208fdcfc3513637096f314315c89346", + "virtual_size": 68719476736 + }, + "scripts": { + "cold.ps1": "c177fc72ae6c2634d186f5671a880de20b09f9716532c37c69cb13aa15c7e331", + "read.ps1": "04013bfcccee40a17e2a225f9b9e96f40a3a8daad9e350609654f8eda3ccbb41" + } +} diff --git a/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/scripts/cold.ps1 b/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/scripts/cold.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..a0b99e7aeb86f4dc10032537800501a52ad65b4f --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/scripts/cold.ps1 @@ -0,0 +1,27 @@ +param([Parameter(Mandatory=$true)][string]$Root, [string]$CloneHost = '') +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' +$root = [IO.Path]::GetFullPath($Root).TrimEnd('\') +if ([IO.Path]::GetDirectoryName($root) -ne 'C:\one-tests\runs') { + throw 'Choose a run directly below C:\one-tests\runs.' +} +if (Get-Process ONENOTE -ErrorAction SilentlyContinue) { throw 'Close OneNote before resetting its test cache.' } +$key = 'HKCU:\Software\Microsoft\Office\14.0\OneNote' +if ($CloneHost) { + if ($CloneHost -notmatch '^ONE-[A-Z0-9-]+$' -or [Environment]::MachineName -ne $CloneHost) { + throw 'The disposable clone hostname does not match this machine.' + } + New-Item "$key\Options\Paths" -Force | Out-Null + New-ItemProperty "$key\Options\Paths" -Name UnfiledNotesSection -PropertyType ExpandString -Value 'C:\one-tests\Loose.one' -Force | Out-Null +} elseif ((Get-ItemProperty "$key\Options\Paths").UnfiledNotesSection -ne 'C:\one-tests\Loose.one' -or + -not (Test-Path 'C:\one-tests\profile-original-cache')) { + throw 'Park the personal OneNote profile before resetting the test cache.' +} +$cache = Join-Path $env:LOCALAPPDATA 'Microsoft\OneNote\14.0' +$parked = Join-Path 'C:\one-tests\caches' ([IO.Path]::GetFileName($root)) +if (Test-Path $parked) { throw 'Choose a new run; its parked cache already exists.' } +New-Item -ItemType Directory -Path 'C:\one-tests\caches' -Force | Out-Null +if (Test-Path $cache) { Move-Item -LiteralPath $cache -Destination $parked } +if (Test-Path "$key\OpenNotebooks") { Remove-Item "$key\OpenNotebooks" -Recurse } +New-Item "$key\OpenNotebooks" | Out-Null +New-ItemProperty "$key\OpenNotebooks" -Name '1' -PropertyType String -Value "$root\notebook" | Out-Null diff --git a/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/scripts/read.ps1 b/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/scripts/read.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..476094ab1e0c47077988a6461db2080cf208642b --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/scripts/read.ps1 @@ -0,0 +1,142 @@ +param( + [Parameter(Mandatory=$true)][string]$Root, + [int]$ExpectedPages = -1, + [switch]$UseCurrentCache, + [switch]$Pdf, + [switch]$KeepOpen, + [string]$CloneHost = '' +) +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' +$root = [IO.Path]::GetFullPath($Root).TrimEnd('\') +if ([IO.Path]::GetDirectoryName($root) -ne 'C:\one-tests\runs') { + throw 'Choose a run directly below C:\one-tests\runs.' +} +$notebook = Join-Path $root 'notebook' +$output = Join-Path $root 'read' +if (Test-Path $output) { throw 'Choose a new read destination.' } +if ($UseCurrentCache) { + if ((Get-ItemProperty 'HKCU:\Software\Microsoft\Office\14.0\OneNote\Options\Paths').UnfiledNotesSection -ne 'C:\one-tests\Loose.one') { + throw 'Park the personal OneNote profile before reading test notebooks.' + } +} else { + & "$PSScriptRoot\cold-current.ps1" -Root $root -CloneHost $CloneHost +} +New-Item -ItemType Directory -Path $output | Out-Null +$app = New-Object -ComObject OneNote.Application +$notebookId = '' +$failure = $null +try { + $app.OpenHierarchy($notebook, '', [ref]$notebookId, 0) + $process = Get-Process ONENOTE + @{ hostname = [Environment]::MachineName; onenote = $process.MainModule.FileVersionInfo.FileVersion; + powershell = $PSVersionTable.PSVersion.ToString(); schema = 'xs2010'; cold = (-not $UseCurrentCache.IsPresent) } | + ConvertTo-Json | Set-Content (Join-Path $output 'environment.json') -Encoding UTF8 + $sections = @() + foreach ($file in @(Get-ChildItem $notebook -Recurse | Where-Object { $_.Extension -eq '.one' })) { + $id = '' + $app.OpenHierarchy($file.FullName, '', [ref]$id, 0) + $sections += $id + } + $deadline = [DateTime]::UtcNow.AddSeconds(300) + $previous = '' + $lastChange = '' + $stableSince = [DateTime]::UtcNow + $settled = $false + do { + $pages = @{} + foreach ($section in $sections) { + $hierarchy = '' + $app.GetHierarchy($section, 4, [ref]$hierarchy, 1) + [xml]$xml = $hierarchy + foreach ($node in $xml.SelectNodes('//*[@path]')) { + if (-not $node.GetAttribute('path').StartsWith("$notebook\", [StringComparison]::OrdinalIgnoreCase)) { + throw 'OneNote opened a section outside the copied notebook.' + } + } + foreach ($node in $xml.SelectNodes('//*[local-name()="Page"]')) { + $id = $node.GetAttribute('ID') + $content = '' + $app.GetPageContent($id, [ref]$content, 1, 1) + $pages[$id] = $content + } + } + $signature = [String]::Join('|', @($pages.Keys | Sort-Object | ForEach-Object { $_ + $pages[$_] })) + if ($signature -ne $previous) { + $lastChange = $previous + $previous = $signature + $stableSince = [DateTime]::UtcNow + } + if ((($ExpectedPages -ge 0 -and $pages.Count -eq $ExpectedPages) -or + ($ExpectedPages -lt 0 -and $pages.Count -gt 0)) -and + ([DateTime]::UtcNow - $stableSince).TotalSeconds -ge 2) { $settled = $true; break } + Start-Sleep -Milliseconds 250 + } while ([DateTime]::UtcNow -lt $deadline) + if (-not $settled -or ($ExpectedPages -ge 0 -and $pages.Count -ne $ExpectedPages) -or ($ExpectedPages -lt 0 -and $pages.Count -eq 0)) { + [IO.File]::WriteAllText((Join-Path $output 'previous-signature.txt'), $lastChange, [Text.Encoding]::UTF8) + $index = 0 + foreach ($id in @($pages.Keys | Sort-Object)) { + [IO.File]::WriteAllText((Join-Path $output ('unsettled-{0:d3}.xml' -f $index)), $pages[$id], [Text.Encoding]::UTF8) + $index++ + } + $hierarchy = '' + $app.GetHierarchy($notebookId, 4, [ref]$hierarchy, 1) + [IO.File]::WriteAllText((Join-Path $output 'unsettled-hierarchy.xml'), $hierarchy, [Text.Encoding]::UTF8) + throw "Expected $ExpectedPages stable pages; OneNote returned $($pages.Count), settled=$settled." + } + $index = 0 + $payloads = @() + foreach ($id in @($pages.Keys | Sort-Object)) { + [IO.File]::WriteAllText((Join-Path $output ('page-{0:d3}.xml' -f $index)), $pages[$id], [Text.Encoding]::UTF8) + if ($Pdf) { + $pdfPath = Join-Path $output ('page-{0:d3}.pdf' -f $index) + $app.NavigateTo($id, '', $false) + $app.Publish($id, $pdfPath, 3, '') + if (-not (Test-Path $pdfPath) -or (Get-Item $pdfPath).Length -eq 0) { throw 'OneNote did not publish the page PDF.' } + } + [xml]$page = $pages[$id] + foreach ($file in $page.SelectNodes('//*[local-name()="InsertedFile" or local-name()="MediaFile"]')) { + $bytes = [IO.File]::ReadAllBytes($file.GetAttribute('pathCache')) + $hash = [BitConverter]::ToString([Security.Cryptography.SHA256]::Create().ComputeHash($bytes)).Replace('-', '').ToLowerInvariant() + [IO.File]::WriteAllBytes((Join-Path $output ($hash + '.attachment')), $bytes) + $payloads += @{ page = $id; object = $file.ParentNode.GetAttribute('objectID'); + kind = $file.LocalName; name = $file.GetAttribute('preferredName'); + sha256 = $hash; bytes = $bytes.Length } + } + $index++ + } + [IO.File]::WriteAllText((Join-Path $output 'payloads.json'), (ConvertTo-Json -InputObject $payloads -Depth 4), [Text.Encoding]::UTF8) + $all = '' + $app.GetHierarchy($notebookId, 4, [ref]$all, 1) + [xml]$finalTree = $all + $finalIds = @($finalTree.SelectNodes('//*[local-name()="Page"]') | ForEach-Object { $_.GetAttribute('ID') } | Sort-Object -Unique) + if ($finalIds.Count -ne $pages.Count -or @($finalIds | Where-Object { -not $pages.ContainsKey($_) }).Count -ne 0) { + throw 'The notebook hierarchy changed while collecting page evidence; repeat the cold read.' + } + [IO.File]::WriteAllText((Join-Path $output 'hierarchy.xml'), $all, [Text.Encoding]::UTF8) + Write-Output "Read $($sections.Count) sections and $($pages.Count) pages." +} catch { + $failure = $_ + [IO.File]::WriteAllText((Join-Path $output 'failure.txt'), ($_ | Out-String), [Text.Encoding]::UTF8) + throw +} finally { + try { + try { + if ($notebookId -and $CloneHost) { $app.SyncHierarchy($notebookId) } + if ($notebookId -and -not $KeepOpen -and (-not $UseCurrentCache -or $CloneHost)) { + $app.CloseNotebook($notebookId, $false) + } + } catch { + if ($null -eq $failure) { throw } + [IO.File]::WriteAllText((Join-Path $output 'cleanup-failure.txt'), ($_ | Out-String), [Text.Encoding]::UTF8) + } + } finally { + [void][Runtime.InteropServices.Marshal]::FinalReleaseComObject($app) + } + $app = $null + [GC]::Collect() + [GC]::WaitForPendingFinalizers() + if (-not $UseCurrentCache -and -not $CloneHost) { + Get-Process ONENOTE -ErrorAction SilentlyContinue | Wait-Process -Timeout 10 + } +} diff --git a/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/source.json b/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/source.json new file mode 100644 index 0000000000000000000000000000000000000000..679aeb87a572b2fb8f5f1abc76b1a89059699d2c --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/source.json @@ -0,0 +1,8 @@ +[ + { + "path": "Lifecycle.one", + "bytes": 70512, + "sha256": "f44639cf506727cfce4607d83a7ec231ee7daa04d918fdb9ff198094bf0c11a4", + "mtime_ns": 1789121646097525529 + } +] diff --git a/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/teardown.json b/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/teardown.json new file mode 100644 index 0000000000000000000000000000000000000000..05a47793de40f322e745c4c4183727e3590ecf70 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-06-promoted-level-two/cold/teardown.json @@ -0,0 +1 @@ +{"absent": true} diff --git a/corpus/page-lifecycle/offline-edits/group-07-promoted-root/candidate/Lifecycle.one b/corpus/page-lifecycle/offline-edits/group-07-promoted-root/candidate/Lifecycle.one index de29bf36f6123310faecad194e217a12ab0e6f6b..b4d74d068d14e0f0cbda21736d3b10356bacb387 100644 Binary files a/corpus/page-lifecycle/offline-edits/group-07-promoted-root/candidate/Lifecycle.one and b/corpus/page-lifecycle/offline-edits/group-07-promoted-root/candidate/Lifecycle.one differ diff --git a/corpus/page-lifecycle/offline-edits/group-07-promoted-root/candidate/manifest.json b/corpus/page-lifecycle/offline-edits/group-07-promoted-root/candidate/manifest.json index 3758d43618fe85fbe4fd7de5191e8361846448be..fd0677fdbed8696874b26b0526b1a1e1d9da2bc1 100644 --- a/corpus/page-lifecycle/offline-edits/group-07-promoted-root/candidate/manifest.json +++ b/corpus/page-lifecycle/offline-edits/group-07-promoted-root/candidate/manifest.json @@ -5,22 +5,22 @@ "original": [ { "guid": [ - 155, - 138, - 13, - 62, - 124, - 243, - 228, - 74, - 161, + 109, + 82, + 133, + 91, + 89, + 244, + 15, + 68, + 163, + 86, + 117, 125, - 95, - 246, - 248, - 243, - 219, - 170 + 55, + 88, + 37, + 250 ], "level": 1, "position": { @@ -30,22 +30,22 @@ }, { "guid": [ - 13, - 25, - 247, - 66, - 234, - 19, - 150, - 74, - 135, - 140, - 17, - 226, - 15, - 18, - 189, - 93 + 191, + 180, + 165, + 180, + 244, + 164, + 214, + 70, + 157, + 20, + 233, + 59, + 238, + 59, + 214, + 56 ], "level": 2, "position": { @@ -55,22 +55,22 @@ }, { "guid": [ - 91, - 125, + 86, + 181, + 85, + 145, + 231, + 51, + 251, + 75, + 133, 117, - 74, - 205, - 55, - 70, + 167, + 118, 73, - 176, - 8, - 196, - 33, - 10, - 8, - 124, - 28 + 97, + 118, + 185 ], "level": 3, "position": { @@ -79,28 +79,28 @@ "space": "{8A6DBA48-33BB-0681-2F02-2C73A811E8B8},1" } ], - "page_receipt": "Some(Published { revision: ExGuid { guid: [42, 89, 136, 237, 122, 6, 54, 72, 145, 166, 231, 104, 38, 49, 121, 133], n: 1 } })", + "page_receipt": "Some(Published { revision: ExGuid { guid: [121, 137, 10, 165, 118, 251, 54, 66, 154, 195, 112, 201, 50, 11, 150, 196], n: 1 } })", "phase": "07-promoted-root", "publications": 2, "reviewed": [ { "guid": [ - 155, - 138, - 13, - 62, - 124, - 243, - 228, - 74, - 161, + 109, + 82, + 133, + 91, + 89, + 244, + 15, + 68, + 163, + 86, + 117, 125, - 95, - 246, - 248, - 243, - 219, - 170 + 55, + 88, + 37, + 250 ], "level": 1, "position": { @@ -110,22 +110,22 @@ }, { "guid": [ - 13, - 25, - 247, - 66, - 234, - 19, - 150, - 74, - 135, - 140, - 17, - 226, - 15, - 18, - 189, - 93 + 191, + 180, + 165, + 180, + 244, + 164, + 214, + 70, + 157, + 20, + 233, + 59, + 238, + 59, + 214, + 56 ], "level": 2, "position": { @@ -135,22 +135,22 @@ }, { "guid": [ - 91, - 125, + 86, + 181, + 85, + 145, + 231, + 51, + 251, + 75, + 133, 117, - 74, - 205, - 55, - 70, + 167, + 118, 73, - 176, - 8, - 196, - 33, - 10, - 8, - 124, - 28 + 97, + 118, + 185 ], "level": 3, "position": { @@ -159,5 +159,5 @@ "space": "{8A6DBA48-33BB-0681-2F02-2C73A811E8B8},1" } ], - "text_receipt": "Some(Published { revision: ExGuid { guid: [49, 218, 252, 142, 98, 154, 225, 64, 133, 164, 9, 6, 69, 181, 239, 103], n: 1 } })" + "text_receipt": "Some(Published { revision: ExGuid { guid: [191, 237, 248, 124, 25, 15, 159, 77, 142, 218, 113, 74, 117, 144, 203, 115], n: 1 } })" } \ No newline at end of file diff --git a/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/commands.jsonl b/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/commands.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..c51ac0eac6134d55e1ec1d1bd77ec8f0715558d0 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/commands.jsonl @@ -0,0 +1,3 @@ +{"command": "powershell -NoProfile -Command \"Expand-Archive -LiteralPath C:\\one-tests\\transfer.zip -DestinationPath C:\\one-tests\\runs\\capture\\notebook\"", "exit": 0, "stdout": "", "stderr": "", "error": null} +{"command": "powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -File C:\\one-tests\\read-current.ps1 -Root C:\\one-tests\\runs\\capture -CloneHost ONE-M6-D8AC8BBF -ExpectedPages 9", "exit": 0, "stdout": "Read 1 sections and 9 pages.\r\n", "stderr": "", "error": null} +{"command": "powershell -NoProfile -Command \"Compress-Archive -Force -Path C:\\one-tests\\runs\\capture\\* -DestinationPath C:\\one-tests\\captured.zip\"", "exit": 0, "stdout": "", "stderr": "", "error": null} diff --git a/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/machine.json b/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/machine.json new file mode 100644 index 0000000000000000000000000000000000000000..16db158407641e6086707dc13bcb524dc459ef4b --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/machine.json @@ -0,0 +1 @@ +{"name": "m6-d8ac8bbf", "hostname": "ONE-M6-D8AC8BBF"} diff --git a/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/notebook/Lifecycle.one b/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/notebook/Lifecycle.one index bb5b87148b9f9bf18e4582924e3581ddeff61ecd..99114479fd09df01dccd48136aae0a44ac7e8a4e 100644 Binary files a/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/notebook/Lifecycle.one and b/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/notebook/Lifecycle.one differ diff --git a/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/notebook/Open Notebook.onetoc2 b/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/notebook/Open Notebook.onetoc2 new file mode 100644 index 0000000000000000000000000000000000000000..1cfa59c6c9bc17b91c13b8379523a70c9ea85438 Binary files /dev/null and b/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/notebook/Open Notebook.onetoc2 differ diff --git a/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/read/environment.json b/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/read/environment.json new file mode 100644 index 0000000000000000000000000000000000000000..1f9788cd412eb8bd5b48b23cd8784be6deb11be0 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/read/environment.json @@ -0,0 +1,7 @@ +{ + "powershell": "5.1.14409.1005", + "schema": "xs2010", + "hostname": "ONE-M6-D8AC8BBF", + "cold": true, + "onenote": "14.0.4763.1000" +} diff --git a/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/read/hierarchy.xml b/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/read/hierarchy.xml index c3424723c82d4908b2404fa23103d92e3b66841a..363b6b612f9f73b465f7a6af42d44b9489c5e4cf 100644 --- a/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/read/hierarchy.xml +++ b/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/read/hierarchy.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/read/page-000.xml b/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/read/page-000.xml index 3553c70f17c69fce246d097b504465d5963eb45b..de7b550bbc1eab7a37e800fe0587cd13dc044f19 100644 --- a/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/read/page-000.xml +++ b/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/read/page-000.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/read/page-001.xml b/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/read/page-001.xml index 2a7c71e6b1f9c495ba5e3cc414dd13b3ab0170f4..7ac82faccebbc3fa18eda06d9fa0ab81984e9836 100644 --- a/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/read/page-001.xml +++ b/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/read/page-001.xml @@ -1,4 +1,4 @@  -Body grandchild 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/read/page-002.xml b/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/read/page-002.xml index 289cd9a0fcd89bd53e213787caea05bcbdf47350..5c2a2419836b5aee7fb76573fc5d3e3d16d52ba7 100644 --- a/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/read/page-002.xml +++ b/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/read/page-002.xml @@ -1,4 +1,4 @@  -Offline Body parent 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/read/page-003.xml b/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/read/page-003.xml index af1c9da6f6089d17289d846c3a8add2093994abe..5f94215aaea2b204d2956e4db3c71c59f90721ab 100644 --- a/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/read/page-003.xml +++ b/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/read/page-003.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/read/page-004.xml b/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/read/page-004.xml index e47d053d03a5bec82284117e0b5569130210aa73..6e579bd097b5afbe4bfb602a2313af0ab544c251 100644 --- a/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/read/page-004.xml +++ b/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/read/page-004.xml @@ -1,2 +1,4 @@  - +Body child 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/read/page-005.xml b/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/read/page-005.xml index e04dc2d8efee949ac19d15797a78471585a119b1..b0f5a91e533685354370fb34f84d7f8c7ce7679a 100644 --- a/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/read/page-005.xml +++ b/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/read/page-005.xml @@ -1,4 +1,2 @@  -Body child 🦀 é preserved]]> + diff --git a/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/read/page-006.xml b/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/read/page-006.xml index 4edbbb4144a12903a51120c8309eb2d601f6aaaf..7a1a3877dd881b9e61cc4ee095cb1e19c2880f40 100644 --- a/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/read/page-006.xml +++ b/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/read/page-006.xml @@ -1,4 +1,4 @@  -Body trailing 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/read/page-007.xml b/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/read/page-007.xml index 1e27f5f82f040e40fa5cd3c5ee7985a2a9d2fa38..1ef1192019dead37d2089bc80453d65958670baa 100644 --- a/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/read/page-007.xml +++ b/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/read/page-007.xml @@ -1,4 +1,4 @@  -Body automatic 🦀 éBody duplicate 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/read/page-008.xml b/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/read/page-008.xml index cbe74728ae8462ad4ac4a1f837792ae3b0db959f..a27dc47f683302d25e10bb9fbf207fda0e7807f0 100644 --- a/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/read/page-008.xml +++ b/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/read/page-008.xml @@ -1,4 +1,4 @@  -Body duplicate 🦀 éBody automatic 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/read/payloads.json b/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/read/payloads.json new file mode 100644 index 0000000000000000000000000000000000000000..1ce91a413d6fff4d58765187b76756f0e97ae843 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/read/payloads.json @@ -0,0 +1,3 @@ +[ + +] \ No newline at end of file diff --git a/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/run.json b/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/run.json new file mode 100644 index 0000000000000000000000000000000000000000..c8da7e03ed189bc94d7db311495113562425c85d --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/run.json @@ -0,0 +1,18 @@ +{ + "notebook": "/private/var/folders/90/4f4rngds01j55ggdj_vglk_c0000gn/T/tmpmryvpdbi", + "expected_pages": 9, + "author": null, + "author_timeout_seconds": 600, + "inspect": false, + "collect_notebook": true, + "base": { + "file": "win7-office-base.qcow2", + "format": "qcow2", + "sha256": "a1a4f8fab782ee14885ff801ca2f6347c208fdcfc3513637096f314315c89346", + "virtual_size": 68719476736 + }, + "scripts": { + "cold.ps1": "c177fc72ae6c2634d186f5671a880de20b09f9716532c37c69cb13aa15c7e331", + "read.ps1": "04013bfcccee40a17e2a225f9b9e96f40a3a8daad9e350609654f8eda3ccbb41" + } +} diff --git a/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/scripts/cold.ps1 b/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/scripts/cold.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..a0b99e7aeb86f4dc10032537800501a52ad65b4f --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/scripts/cold.ps1 @@ -0,0 +1,27 @@ +param([Parameter(Mandatory=$true)][string]$Root, [string]$CloneHost = '') +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' +$root = [IO.Path]::GetFullPath($Root).TrimEnd('\') +if ([IO.Path]::GetDirectoryName($root) -ne 'C:\one-tests\runs') { + throw 'Choose a run directly below C:\one-tests\runs.' +} +if (Get-Process ONENOTE -ErrorAction SilentlyContinue) { throw 'Close OneNote before resetting its test cache.' } +$key = 'HKCU:\Software\Microsoft\Office\14.0\OneNote' +if ($CloneHost) { + if ($CloneHost -notmatch '^ONE-[A-Z0-9-]+$' -or [Environment]::MachineName -ne $CloneHost) { + throw 'The disposable clone hostname does not match this machine.' + } + New-Item "$key\Options\Paths" -Force | Out-Null + New-ItemProperty "$key\Options\Paths" -Name UnfiledNotesSection -PropertyType ExpandString -Value 'C:\one-tests\Loose.one' -Force | Out-Null +} elseif ((Get-ItemProperty "$key\Options\Paths").UnfiledNotesSection -ne 'C:\one-tests\Loose.one' -or + -not (Test-Path 'C:\one-tests\profile-original-cache')) { + throw 'Park the personal OneNote profile before resetting the test cache.' +} +$cache = Join-Path $env:LOCALAPPDATA 'Microsoft\OneNote\14.0' +$parked = Join-Path 'C:\one-tests\caches' ([IO.Path]::GetFileName($root)) +if (Test-Path $parked) { throw 'Choose a new run; its parked cache already exists.' } +New-Item -ItemType Directory -Path 'C:\one-tests\caches' -Force | Out-Null +if (Test-Path $cache) { Move-Item -LiteralPath $cache -Destination $parked } +if (Test-Path "$key\OpenNotebooks") { Remove-Item "$key\OpenNotebooks" -Recurse } +New-Item "$key\OpenNotebooks" | Out-Null +New-ItemProperty "$key\OpenNotebooks" -Name '1' -PropertyType String -Value "$root\notebook" | Out-Null diff --git a/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/scripts/read.ps1 b/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/scripts/read.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..476094ab1e0c47077988a6461db2080cf208642b --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/scripts/read.ps1 @@ -0,0 +1,142 @@ +param( + [Parameter(Mandatory=$true)][string]$Root, + [int]$ExpectedPages = -1, + [switch]$UseCurrentCache, + [switch]$Pdf, + [switch]$KeepOpen, + [string]$CloneHost = '' +) +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' +$root = [IO.Path]::GetFullPath($Root).TrimEnd('\') +if ([IO.Path]::GetDirectoryName($root) -ne 'C:\one-tests\runs') { + throw 'Choose a run directly below C:\one-tests\runs.' +} +$notebook = Join-Path $root 'notebook' +$output = Join-Path $root 'read' +if (Test-Path $output) { throw 'Choose a new read destination.' } +if ($UseCurrentCache) { + if ((Get-ItemProperty 'HKCU:\Software\Microsoft\Office\14.0\OneNote\Options\Paths').UnfiledNotesSection -ne 'C:\one-tests\Loose.one') { + throw 'Park the personal OneNote profile before reading test notebooks.' + } +} else { + & "$PSScriptRoot\cold-current.ps1" -Root $root -CloneHost $CloneHost +} +New-Item -ItemType Directory -Path $output | Out-Null +$app = New-Object -ComObject OneNote.Application +$notebookId = '' +$failure = $null +try { + $app.OpenHierarchy($notebook, '', [ref]$notebookId, 0) + $process = Get-Process ONENOTE + @{ hostname = [Environment]::MachineName; onenote = $process.MainModule.FileVersionInfo.FileVersion; + powershell = $PSVersionTable.PSVersion.ToString(); schema = 'xs2010'; cold = (-not $UseCurrentCache.IsPresent) } | + ConvertTo-Json | Set-Content (Join-Path $output 'environment.json') -Encoding UTF8 + $sections = @() + foreach ($file in @(Get-ChildItem $notebook -Recurse | Where-Object { $_.Extension -eq '.one' })) { + $id = '' + $app.OpenHierarchy($file.FullName, '', [ref]$id, 0) + $sections += $id + } + $deadline = [DateTime]::UtcNow.AddSeconds(300) + $previous = '' + $lastChange = '' + $stableSince = [DateTime]::UtcNow + $settled = $false + do { + $pages = @{} + foreach ($section in $sections) { + $hierarchy = '' + $app.GetHierarchy($section, 4, [ref]$hierarchy, 1) + [xml]$xml = $hierarchy + foreach ($node in $xml.SelectNodes('//*[@path]')) { + if (-not $node.GetAttribute('path').StartsWith("$notebook\", [StringComparison]::OrdinalIgnoreCase)) { + throw 'OneNote opened a section outside the copied notebook.' + } + } + foreach ($node in $xml.SelectNodes('//*[local-name()="Page"]')) { + $id = $node.GetAttribute('ID') + $content = '' + $app.GetPageContent($id, [ref]$content, 1, 1) + $pages[$id] = $content + } + } + $signature = [String]::Join('|', @($pages.Keys | Sort-Object | ForEach-Object { $_ + $pages[$_] })) + if ($signature -ne $previous) { + $lastChange = $previous + $previous = $signature + $stableSince = [DateTime]::UtcNow + } + if ((($ExpectedPages -ge 0 -and $pages.Count -eq $ExpectedPages) -or + ($ExpectedPages -lt 0 -and $pages.Count -gt 0)) -and + ([DateTime]::UtcNow - $stableSince).TotalSeconds -ge 2) { $settled = $true; break } + Start-Sleep -Milliseconds 250 + } while ([DateTime]::UtcNow -lt $deadline) + if (-not $settled -or ($ExpectedPages -ge 0 -and $pages.Count -ne $ExpectedPages) -or ($ExpectedPages -lt 0 -and $pages.Count -eq 0)) { + [IO.File]::WriteAllText((Join-Path $output 'previous-signature.txt'), $lastChange, [Text.Encoding]::UTF8) + $index = 0 + foreach ($id in @($pages.Keys | Sort-Object)) { + [IO.File]::WriteAllText((Join-Path $output ('unsettled-{0:d3}.xml' -f $index)), $pages[$id], [Text.Encoding]::UTF8) + $index++ + } + $hierarchy = '' + $app.GetHierarchy($notebookId, 4, [ref]$hierarchy, 1) + [IO.File]::WriteAllText((Join-Path $output 'unsettled-hierarchy.xml'), $hierarchy, [Text.Encoding]::UTF8) + throw "Expected $ExpectedPages stable pages; OneNote returned $($pages.Count), settled=$settled." + } + $index = 0 + $payloads = @() + foreach ($id in @($pages.Keys | Sort-Object)) { + [IO.File]::WriteAllText((Join-Path $output ('page-{0:d3}.xml' -f $index)), $pages[$id], [Text.Encoding]::UTF8) + if ($Pdf) { + $pdfPath = Join-Path $output ('page-{0:d3}.pdf' -f $index) + $app.NavigateTo($id, '', $false) + $app.Publish($id, $pdfPath, 3, '') + if (-not (Test-Path $pdfPath) -or (Get-Item $pdfPath).Length -eq 0) { throw 'OneNote did not publish the page PDF.' } + } + [xml]$page = $pages[$id] + foreach ($file in $page.SelectNodes('//*[local-name()="InsertedFile" or local-name()="MediaFile"]')) { + $bytes = [IO.File]::ReadAllBytes($file.GetAttribute('pathCache')) + $hash = [BitConverter]::ToString([Security.Cryptography.SHA256]::Create().ComputeHash($bytes)).Replace('-', '').ToLowerInvariant() + [IO.File]::WriteAllBytes((Join-Path $output ($hash + '.attachment')), $bytes) + $payloads += @{ page = $id; object = $file.ParentNode.GetAttribute('objectID'); + kind = $file.LocalName; name = $file.GetAttribute('preferredName'); + sha256 = $hash; bytes = $bytes.Length } + } + $index++ + } + [IO.File]::WriteAllText((Join-Path $output 'payloads.json'), (ConvertTo-Json -InputObject $payloads -Depth 4), [Text.Encoding]::UTF8) + $all = '' + $app.GetHierarchy($notebookId, 4, [ref]$all, 1) + [xml]$finalTree = $all + $finalIds = @($finalTree.SelectNodes('//*[local-name()="Page"]') | ForEach-Object { $_.GetAttribute('ID') } | Sort-Object -Unique) + if ($finalIds.Count -ne $pages.Count -or @($finalIds | Where-Object { -not $pages.ContainsKey($_) }).Count -ne 0) { + throw 'The notebook hierarchy changed while collecting page evidence; repeat the cold read.' + } + [IO.File]::WriteAllText((Join-Path $output 'hierarchy.xml'), $all, [Text.Encoding]::UTF8) + Write-Output "Read $($sections.Count) sections and $($pages.Count) pages." +} catch { + $failure = $_ + [IO.File]::WriteAllText((Join-Path $output 'failure.txt'), ($_ | Out-String), [Text.Encoding]::UTF8) + throw +} finally { + try { + try { + if ($notebookId -and $CloneHost) { $app.SyncHierarchy($notebookId) } + if ($notebookId -and -not $KeepOpen -and (-not $UseCurrentCache -or $CloneHost)) { + $app.CloseNotebook($notebookId, $false) + } + } catch { + if ($null -eq $failure) { throw } + [IO.File]::WriteAllText((Join-Path $output 'cleanup-failure.txt'), ($_ | Out-String), [Text.Encoding]::UTF8) + } + } finally { + [void][Runtime.InteropServices.Marshal]::FinalReleaseComObject($app) + } + $app = $null + [GC]::Collect() + [GC]::WaitForPendingFinalizers() + if (-not $UseCurrentCache -and -not $CloneHost) { + Get-Process ONENOTE -ErrorAction SilentlyContinue | Wait-Process -Timeout 10 + } +} diff --git a/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/source.json b/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/source.json new file mode 100644 index 0000000000000000000000000000000000000000..e21398a3bc4abef93fca4920bfccc96e7a6ae5ca --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/source.json @@ -0,0 +1,8 @@ +[ + { + "path": "Lifecycle.one", + "bytes": 73840, + "sha256": "aade5170cde10160d9f3840a8d0bad944c5bbd285b6efb79831ebd17a4cb5b72", + "mtime_ns": 1789121646529054140 + } +] diff --git a/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/teardown.json b/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/teardown.json new file mode 100644 index 0000000000000000000000000000000000000000..05a47793de40f322e745c4c4183727e3590ecf70 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-07-promoted-root/cold/teardown.json @@ -0,0 +1 @@ +{"absent": true} diff --git a/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/candidate/Lifecycle.one b/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/candidate/Lifecycle.one index 03799d8fb1b754c9d8fc2abf2ba8d241eeed9c0e..9b78b2086b040a5b732fed6ed531cc85bc0ee274 100644 Binary files a/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/candidate/Lifecycle.one and b/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/candidate/Lifecycle.one differ diff --git a/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/candidate/manifest.json b/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/candidate/manifest.json index caf701d28a230ae01671b70c8be59214e3372402..53eee08a10a219eac2a27172513535124c6d9849 100644 --- a/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/candidate/manifest.json +++ b/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/candidate/manifest.json @@ -5,47 +5,47 @@ "original": [ { "guid": [ - 19, - 199, + 98, + 178, 233, - 32, - 233, - 151, - 117, - 77, - 128, - 237, - 235, - 14, - 49, - 245, - 253, - 90 - ], - "level": 1, - "position": { - "Before": null - }, - "space": "{8A3D5318-2F37-02D8-0DC9-CC0BC689209F},1" - }, - { - "guid": [ - 11, - 59, - 230, - 216, - 152, - 34, - 39, 72, - 141, 162, 178, - 217, - 3, - 248, + 38, + 75, 183, - 124 + 61, + 206, + 30, + 120, + 160, + 217, + 193 + ], + "level": 1, + "position": { + "Before": null + }, + "space": "{8A3D5318-2F37-02D8-0DC9-CC0BC689209F},1" + }, + { + "guid": [ + 40, + 204, + 73, + 78, + 206, + 201, + 71, + 79, + 157, + 78, + 124, + 173, + 5, + 71, + 103, + 93 ], "level": 2, "position": { @@ -55,22 +55,22 @@ }, { "guid": [ - 131, - 53, - 255, - 252, - 76, - 246, - 212, - 70, - 142, - 200, - 250, - 254, - 150, - 118, - 235, - 6 + 119, + 22, + 65, + 38, + 106, + 133, + 214, + 66, + 177, + 67, + 66, + 192, + 227, + 0, + 98, + 77 ], "level": 3, "position": { @@ -79,53 +79,53 @@ "space": "{8A6DBA48-33BB-0681-2F02-2C73A811E8B8},1" } ], - "page_receipt": "Some(Published { revision: ExGuid { guid: [31, 59, 135, 227, 202, 4, 204, 77, 149, 2, 51, 50, 192, 123, 144, 152], n: 1 } })", + "page_receipt": "Some(Published { revision: ExGuid { guid: [80, 128, 224, 32, 182, 163, 75, 66, 160, 172, 65, 121, 87, 106, 59, 44], n: 1 } })", "phase": "08-collapsed-group-move", "publications": 2, "reviewed": [ { "guid": [ - 19, - 199, + 98, + 178, 233, - 32, - 233, - 151, - 117, - 77, - 128, - 237, - 235, - 14, - 49, - 245, - 253, - 90 - ], - "level": 1, - "position": { - "Before": null - }, - "space": "{8A3D5318-2F37-02D8-0DC9-CC0BC689209F},1" - }, - { - "guid": [ - 11, - 59, - 230, - 216, - 152, - 34, - 39, 72, - 141, 162, 178, - 217, - 3, - 248, + 38, + 75, 183, - 124 + 61, + 206, + 30, + 120, + 160, + 217, + 193 + ], + "level": 1, + "position": { + "Before": null + }, + "space": "{8A3D5318-2F37-02D8-0DC9-CC0BC689209F},1" + }, + { + "guid": [ + 40, + 204, + 73, + 78, + 206, + 201, + 71, + 79, + 157, + 78, + 124, + 173, + 5, + 71, + 103, + 93 ], "level": 2, "position": { @@ -135,22 +135,22 @@ }, { "guid": [ - 131, - 53, - 255, - 252, - 76, - 246, - 212, - 70, - 142, - 200, - 250, - 254, - 150, - 118, - 235, - 6 + 119, + 22, + 65, + 38, + 106, + 133, + 214, + 66, + 177, + 67, + 66, + 192, + 227, + 0, + 98, + 77 ], "level": 3, "position": { @@ -159,5 +159,5 @@ "space": "{8A6DBA48-33BB-0681-2F02-2C73A811E8B8},1" } ], - "text_receipt": "Some(Published { revision: ExGuid { guid: [177, 90, 34, 188, 147, 50, 135, 66, 186, 165, 239, 21, 214, 159, 188, 81], n: 1 } })" + "text_receipt": "Some(Published { revision: ExGuid { guid: [124, 183, 243, 169, 131, 153, 41, 68, 156, 113, 241, 68, 179, 84, 63, 144], n: 1 } })" } \ No newline at end of file diff --git a/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/commands.jsonl b/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/commands.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..08e7347390ce0720a4698cb9ccbfa9a7c0ae62af --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/commands.jsonl @@ -0,0 +1,3 @@ +{"command": "powershell -NoProfile -Command \"Expand-Archive -LiteralPath C:\\one-tests\\transfer.zip -DestinationPath C:\\one-tests\\runs\\capture\\notebook\"", "exit": 0, "stdout": "", "stderr": "", "error": null} +{"command": "powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -File C:\\one-tests\\read-current.ps1 -Root C:\\one-tests\\runs\\capture -CloneHost ONE-M6-89B4B25F -ExpectedPages 9", "exit": 0, "stdout": "Read 1 sections and 9 pages.\r\n", "stderr": "", "error": null} +{"command": "powershell -NoProfile -Command \"Compress-Archive -Force -Path C:\\one-tests\\runs\\capture\\* -DestinationPath C:\\one-tests\\captured.zip\"", "exit": 0, "stdout": "", "stderr": "", "error": null} diff --git a/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/machine.json b/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/machine.json new file mode 100644 index 0000000000000000000000000000000000000000..cd5b6c2f6e81ab1569a5f48f29ec09df27ad106b --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/machine.json @@ -0,0 +1 @@ +{"name": "m6-89b4b25f", "hostname": "ONE-M6-89B4B25F"} diff --git a/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/notebook/Lifecycle.one b/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/notebook/Lifecycle.one index 3afa054f65cb9ea344fa96af9d88646518899f8c..f17007693918f9f4d837e501463d5bb86b3df52f 100644 Binary files a/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/notebook/Lifecycle.one and b/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/notebook/Lifecycle.one differ diff --git a/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/notebook/Open Notebook.onetoc2 b/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/notebook/Open Notebook.onetoc2 new file mode 100644 index 0000000000000000000000000000000000000000..8bb666cd41e4c95cbc41d99b51a1ff7de92f66b7 Binary files /dev/null and b/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/notebook/Open Notebook.onetoc2 differ diff --git a/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/read/environment.json b/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/read/environment.json new file mode 100644 index 0000000000000000000000000000000000000000..c98c4b44f4fc61edccacb0d538eb46c6fea2c72b --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/read/environment.json @@ -0,0 +1,7 @@ +{ + "powershell": "5.1.14409.1005", + "schema": "xs2010", + "hostname": "ONE-M6-89B4B25F", + "cold": true, + "onenote": "14.0.4763.1000" +} diff --git a/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/read/hierarchy.xml b/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/read/hierarchy.xml index a5f391d3c28e56e3b14f485f63ce38f1cfbd9fd2..b66ad0fe985472ffd678726703bf1e7df802a645 100644 --- a/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/read/hierarchy.xml +++ b/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/read/hierarchy.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/read/page-000.xml b/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/read/page-000.xml index 22e7ee2a0615a449b452f4f99a9dbfce701fb25c..fe741b6200014bc1dd88da1a17d4d01fe3bf6144 100644 --- a/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/read/page-000.xml +++ b/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/read/page-000.xml @@ -1,2 +1,4 @@  - +Body grandchild 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/read/page-001.xml b/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/read/page-001.xml index 4db172a21b1890fef631c57beae1ab99ab83cb13..2fdd5ea44b3e08f3354823b1ca4d188e8aba28d8 100644 --- a/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/read/page-001.xml +++ b/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/read/page-001.xml @@ -1,4 +1,4 @@  -Body child 🦀 éOffline Body parent 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/read/page-002.xml b/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/read/page-002.xml index 823b251e26e2cb4da7e5b70c94eb54648611dda8..ed411d94ae090acfccc3b9cea01d9a92f80b91f8 100644 --- a/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/read/page-002.xml +++ b/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/read/page-002.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/read/page-003.xml b/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/read/page-003.xml index 388737348575b51f6900f2f02ac2c9b953017ec0..e40bd53067011955579069e27613fb8d6a8fa7d6 100644 --- a/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/read/page-003.xml +++ b/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/read/page-003.xml @@ -1,4 +1,2 @@  -Body grandchild 🦀 é preserved]]> + diff --git a/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/read/page-004.xml b/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/read/page-004.xml index 2f3602eabda6c615ae44c05bba7d06494ca14132..3aafcb69a7e4d7b17100b79ae5037025fd58ab26 100644 --- a/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/read/page-004.xml +++ b/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/read/page-004.xml @@ -1,4 +1,4 @@  -Offline Body parent 🦀 éBody child 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/read/page-005.xml b/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/read/page-005.xml index 4bb6531fd27a0faff6f2af3cf1f3525be42bfb45..caeedf22e54af8c879f63dfbcd9820a708be3d6a 100644 --- a/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/read/page-005.xml +++ b/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/read/page-005.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/read/page-006.xml b/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/read/page-006.xml index e926ab1fdc36a63521b452336ed7a88865e4556b..9b2525859a1861f282318004efde4607926b6d72 100644 --- a/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/read/page-006.xml +++ b/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/read/page-006.xml @@ -1,4 +1,4 @@  -Body automatic 🦀 éBody trailing 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/read/page-007.xml b/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/read/page-007.xml index 22880c399a2281975b80e0e5a12e21ae0fbd8429..816e813b24804d84730440b9b4a249ee8d8e64ea 100644 --- a/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/read/page-007.xml +++ b/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/read/page-007.xml @@ -1,4 +1,4 @@  -Body duplicate 🦀 éBody automatic 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/read/page-008.xml b/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/read/page-008.xml index c4ba10d560dc86dbabe4a084ffcfe4c8a4f2bb94..40ef5463210b9678b3d4a141aa345b5dee1a76e5 100644 --- a/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/read/page-008.xml +++ b/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/read/page-008.xml @@ -1,4 +1,4 @@  -Body trailing 🦀 éBody duplicate 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/read/payloads.json b/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/read/payloads.json new file mode 100644 index 0000000000000000000000000000000000000000..1ce91a413d6fff4d58765187b76756f0e97ae843 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/read/payloads.json @@ -0,0 +1,3 @@ +[ + +] \ No newline at end of file diff --git a/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/run.json b/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/run.json new file mode 100644 index 0000000000000000000000000000000000000000..fbee38a57b255701857487786f4d06e2330b284d --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/run.json @@ -0,0 +1,18 @@ +{ + "notebook": "/private/var/folders/90/4f4rngds01j55ggdj_vglk_c0000gn/T/tmp89aydbgy", + "expected_pages": 9, + "author": null, + "author_timeout_seconds": 600, + "inspect": false, + "collect_notebook": true, + "base": { + "file": "win7-office-base.qcow2", + "format": "qcow2", + "sha256": "a1a4f8fab782ee14885ff801ca2f6347c208fdcfc3513637096f314315c89346", + "virtual_size": 68719476736 + }, + "scripts": { + "cold.ps1": "c177fc72ae6c2634d186f5671a880de20b09f9716532c37c69cb13aa15c7e331", + "read.ps1": "04013bfcccee40a17e2a225f9b9e96f40a3a8daad9e350609654f8eda3ccbb41" + } +} diff --git a/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/scripts/cold.ps1 b/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/scripts/cold.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..a0b99e7aeb86f4dc10032537800501a52ad65b4f --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/scripts/cold.ps1 @@ -0,0 +1,27 @@ +param([Parameter(Mandatory=$true)][string]$Root, [string]$CloneHost = '') +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' +$root = [IO.Path]::GetFullPath($Root).TrimEnd('\') +if ([IO.Path]::GetDirectoryName($root) -ne 'C:\one-tests\runs') { + throw 'Choose a run directly below C:\one-tests\runs.' +} +if (Get-Process ONENOTE -ErrorAction SilentlyContinue) { throw 'Close OneNote before resetting its test cache.' } +$key = 'HKCU:\Software\Microsoft\Office\14.0\OneNote' +if ($CloneHost) { + if ($CloneHost -notmatch '^ONE-[A-Z0-9-]+$' -or [Environment]::MachineName -ne $CloneHost) { + throw 'The disposable clone hostname does not match this machine.' + } + New-Item "$key\Options\Paths" -Force | Out-Null + New-ItemProperty "$key\Options\Paths" -Name UnfiledNotesSection -PropertyType ExpandString -Value 'C:\one-tests\Loose.one' -Force | Out-Null +} elseif ((Get-ItemProperty "$key\Options\Paths").UnfiledNotesSection -ne 'C:\one-tests\Loose.one' -or + -not (Test-Path 'C:\one-tests\profile-original-cache')) { + throw 'Park the personal OneNote profile before resetting the test cache.' +} +$cache = Join-Path $env:LOCALAPPDATA 'Microsoft\OneNote\14.0' +$parked = Join-Path 'C:\one-tests\caches' ([IO.Path]::GetFileName($root)) +if (Test-Path $parked) { throw 'Choose a new run; its parked cache already exists.' } +New-Item -ItemType Directory -Path 'C:\one-tests\caches' -Force | Out-Null +if (Test-Path $cache) { Move-Item -LiteralPath $cache -Destination $parked } +if (Test-Path "$key\OpenNotebooks") { Remove-Item "$key\OpenNotebooks" -Recurse } +New-Item "$key\OpenNotebooks" | Out-Null +New-ItemProperty "$key\OpenNotebooks" -Name '1' -PropertyType String -Value "$root\notebook" | Out-Null diff --git a/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/scripts/read.ps1 b/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/scripts/read.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..476094ab1e0c47077988a6461db2080cf208642b --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/scripts/read.ps1 @@ -0,0 +1,142 @@ +param( + [Parameter(Mandatory=$true)][string]$Root, + [int]$ExpectedPages = -1, + [switch]$UseCurrentCache, + [switch]$Pdf, + [switch]$KeepOpen, + [string]$CloneHost = '' +) +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' +$root = [IO.Path]::GetFullPath($Root).TrimEnd('\') +if ([IO.Path]::GetDirectoryName($root) -ne 'C:\one-tests\runs') { + throw 'Choose a run directly below C:\one-tests\runs.' +} +$notebook = Join-Path $root 'notebook' +$output = Join-Path $root 'read' +if (Test-Path $output) { throw 'Choose a new read destination.' } +if ($UseCurrentCache) { + if ((Get-ItemProperty 'HKCU:\Software\Microsoft\Office\14.0\OneNote\Options\Paths').UnfiledNotesSection -ne 'C:\one-tests\Loose.one') { + throw 'Park the personal OneNote profile before reading test notebooks.' + } +} else { + & "$PSScriptRoot\cold-current.ps1" -Root $root -CloneHost $CloneHost +} +New-Item -ItemType Directory -Path $output | Out-Null +$app = New-Object -ComObject OneNote.Application +$notebookId = '' +$failure = $null +try { + $app.OpenHierarchy($notebook, '', [ref]$notebookId, 0) + $process = Get-Process ONENOTE + @{ hostname = [Environment]::MachineName; onenote = $process.MainModule.FileVersionInfo.FileVersion; + powershell = $PSVersionTable.PSVersion.ToString(); schema = 'xs2010'; cold = (-not $UseCurrentCache.IsPresent) } | + ConvertTo-Json | Set-Content (Join-Path $output 'environment.json') -Encoding UTF8 + $sections = @() + foreach ($file in @(Get-ChildItem $notebook -Recurse | Where-Object { $_.Extension -eq '.one' })) { + $id = '' + $app.OpenHierarchy($file.FullName, '', [ref]$id, 0) + $sections += $id + } + $deadline = [DateTime]::UtcNow.AddSeconds(300) + $previous = '' + $lastChange = '' + $stableSince = [DateTime]::UtcNow + $settled = $false + do { + $pages = @{} + foreach ($section in $sections) { + $hierarchy = '' + $app.GetHierarchy($section, 4, [ref]$hierarchy, 1) + [xml]$xml = $hierarchy + foreach ($node in $xml.SelectNodes('//*[@path]')) { + if (-not $node.GetAttribute('path').StartsWith("$notebook\", [StringComparison]::OrdinalIgnoreCase)) { + throw 'OneNote opened a section outside the copied notebook.' + } + } + foreach ($node in $xml.SelectNodes('//*[local-name()="Page"]')) { + $id = $node.GetAttribute('ID') + $content = '' + $app.GetPageContent($id, [ref]$content, 1, 1) + $pages[$id] = $content + } + } + $signature = [String]::Join('|', @($pages.Keys | Sort-Object | ForEach-Object { $_ + $pages[$_] })) + if ($signature -ne $previous) { + $lastChange = $previous + $previous = $signature + $stableSince = [DateTime]::UtcNow + } + if ((($ExpectedPages -ge 0 -and $pages.Count -eq $ExpectedPages) -or + ($ExpectedPages -lt 0 -and $pages.Count -gt 0)) -and + ([DateTime]::UtcNow - $stableSince).TotalSeconds -ge 2) { $settled = $true; break } + Start-Sleep -Milliseconds 250 + } while ([DateTime]::UtcNow -lt $deadline) + if (-not $settled -or ($ExpectedPages -ge 0 -and $pages.Count -ne $ExpectedPages) -or ($ExpectedPages -lt 0 -and $pages.Count -eq 0)) { + [IO.File]::WriteAllText((Join-Path $output 'previous-signature.txt'), $lastChange, [Text.Encoding]::UTF8) + $index = 0 + foreach ($id in @($pages.Keys | Sort-Object)) { + [IO.File]::WriteAllText((Join-Path $output ('unsettled-{0:d3}.xml' -f $index)), $pages[$id], [Text.Encoding]::UTF8) + $index++ + } + $hierarchy = '' + $app.GetHierarchy($notebookId, 4, [ref]$hierarchy, 1) + [IO.File]::WriteAllText((Join-Path $output 'unsettled-hierarchy.xml'), $hierarchy, [Text.Encoding]::UTF8) + throw "Expected $ExpectedPages stable pages; OneNote returned $($pages.Count), settled=$settled." + } + $index = 0 + $payloads = @() + foreach ($id in @($pages.Keys | Sort-Object)) { + [IO.File]::WriteAllText((Join-Path $output ('page-{0:d3}.xml' -f $index)), $pages[$id], [Text.Encoding]::UTF8) + if ($Pdf) { + $pdfPath = Join-Path $output ('page-{0:d3}.pdf' -f $index) + $app.NavigateTo($id, '', $false) + $app.Publish($id, $pdfPath, 3, '') + if (-not (Test-Path $pdfPath) -or (Get-Item $pdfPath).Length -eq 0) { throw 'OneNote did not publish the page PDF.' } + } + [xml]$page = $pages[$id] + foreach ($file in $page.SelectNodes('//*[local-name()="InsertedFile" or local-name()="MediaFile"]')) { + $bytes = [IO.File]::ReadAllBytes($file.GetAttribute('pathCache')) + $hash = [BitConverter]::ToString([Security.Cryptography.SHA256]::Create().ComputeHash($bytes)).Replace('-', '').ToLowerInvariant() + [IO.File]::WriteAllBytes((Join-Path $output ($hash + '.attachment')), $bytes) + $payloads += @{ page = $id; object = $file.ParentNode.GetAttribute('objectID'); + kind = $file.LocalName; name = $file.GetAttribute('preferredName'); + sha256 = $hash; bytes = $bytes.Length } + } + $index++ + } + [IO.File]::WriteAllText((Join-Path $output 'payloads.json'), (ConvertTo-Json -InputObject $payloads -Depth 4), [Text.Encoding]::UTF8) + $all = '' + $app.GetHierarchy($notebookId, 4, [ref]$all, 1) + [xml]$finalTree = $all + $finalIds = @($finalTree.SelectNodes('//*[local-name()="Page"]') | ForEach-Object { $_.GetAttribute('ID') } | Sort-Object -Unique) + if ($finalIds.Count -ne $pages.Count -or @($finalIds | Where-Object { -not $pages.ContainsKey($_) }).Count -ne 0) { + throw 'The notebook hierarchy changed while collecting page evidence; repeat the cold read.' + } + [IO.File]::WriteAllText((Join-Path $output 'hierarchy.xml'), $all, [Text.Encoding]::UTF8) + Write-Output "Read $($sections.Count) sections and $($pages.Count) pages." +} catch { + $failure = $_ + [IO.File]::WriteAllText((Join-Path $output 'failure.txt'), ($_ | Out-String), [Text.Encoding]::UTF8) + throw +} finally { + try { + try { + if ($notebookId -and $CloneHost) { $app.SyncHierarchy($notebookId) } + if ($notebookId -and -not $KeepOpen -and (-not $UseCurrentCache -or $CloneHost)) { + $app.CloseNotebook($notebookId, $false) + } + } catch { + if ($null -eq $failure) { throw } + [IO.File]::WriteAllText((Join-Path $output 'cleanup-failure.txt'), ($_ | Out-String), [Text.Encoding]::UTF8) + } + } finally { + [void][Runtime.InteropServices.Marshal]::FinalReleaseComObject($app) + } + $app = $null + [GC]::Collect() + [GC]::WaitForPendingFinalizers() + if (-not $UseCurrentCache -and -not $CloneHost) { + Get-Process ONENOTE -ErrorAction SilentlyContinue | Wait-Process -Timeout 10 + } +} diff --git a/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/source.json b/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/source.json new file mode 100644 index 0000000000000000000000000000000000000000..af4ac2241e03b61eca9132fec2e7c0c401857f67 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/source.json @@ -0,0 +1,8 @@ +[ + { + "path": "Lifecycle.one", + "bytes": 75656, + "sha256": "69eab3043565feb74c1242cd4b2407e83990feeec43c959c5aea61c9ea156337", + "mtime_ns": 1789121646959281959 + } +] diff --git a/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/teardown.json b/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/teardown.json new file mode 100644 index 0000000000000000000000000000000000000000..05a47793de40f322e745c4c4183727e3590ecf70 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-08-collapsed-group-move/cold/teardown.json @@ -0,0 +1 @@ +{"absent": true} diff --git a/corpus/page-lifecycle/offline-edits/group-single-page/candidate/Lifecycle.one b/corpus/page-lifecycle/offline-edits/group-single-page/candidate/Lifecycle.one index 68b9eda5d841c574768463be8ae8c995e9ef4865..34182c0486a6fcbe37a91eeb04d16bf7098160b4 100644 Binary files a/corpus/page-lifecycle/offline-edits/group-single-page/candidate/Lifecycle.one and b/corpus/page-lifecycle/offline-edits/group-single-page/candidate/Lifecycle.one differ diff --git a/corpus/page-lifecycle/offline-edits/group-single-page/candidate/manifest.json b/corpus/page-lifecycle/offline-edits/group-single-page/candidate/manifest.json index 082c1625a21744d940f99f41423fc3454ef9447f..952b54e1aa770c44d9516dee050d0b405d29d67f 100644 --- a/corpus/page-lifecycle/offline-edits/group-single-page/candidate/manifest.json +++ b/corpus/page-lifecycle/offline-edits/group-single-page/candidate/manifest.json @@ -5,22 +5,22 @@ "original": [ { "guid": [ - 17, - 13, - 99, - 39, - 16, - 219, - 3, - 75, + 136, + 250, + 25, 146, - 158, - 103, - 67, - 152, - 150, - 129, - 4 + 43, + 247, + 117, + 78, + 168, + 146, + 87, + 142, + 35, + 234, + 242, + 30 ], "level": 1, "position": { @@ -30,22 +30,22 @@ }, { "guid": [ - 99, - 139, - 226, + 220, + 151, + 106, 4, - 217, - 28, - 58, - 66, - 179, - 136, - 138, - 139, - 19, + 166, + 72, + 1, 67, - 135, - 234 + 152, + 202, + 233, + 150, + 7, + 236, + 206, + 24 ], "level": 2, "position": { @@ -55,22 +55,22 @@ }, { "guid": [ - 77, - 239, - 134, - 254, - 131, - 88, - 202, - 64, - 174, - 43, - 16, - 100, - 98, - 151, - 16, - 95 + 168, + 229, + 17, + 24, + 60, + 44, + 182, + 73, + 156, + 93, + 192, + 34, + 211, + 183, + 18, + 146 ], "level": 3, "position": { @@ -79,28 +79,28 @@ "space": "{8A6DBA48-33BB-0681-2F02-2C73A811E8B8},1" } ], - "page_receipt": "Some(Published { revision: ExGuid { guid: [44, 196, 75, 170, 155, 16, 195, 70, 129, 191, 203, 51, 52, 196, 196, 61], n: 1 } })", + "page_receipt": "Some(Published { revision: ExGuid { guid: [0, 97, 225, 121, 84, 127, 112, 71, 188, 235, 241, 45, 237, 105, 199, 183], n: 1 } })", "phase": "single-page", "publications": 2, "reviewed": [ { "guid": [ - 17, - 13, - 99, - 39, - 16, - 219, - 3, - 75, + 136, + 250, + 25, 146, - 158, - 103, - 67, - 152, - 150, - 129, - 4 + 43, + 247, + 117, + 78, + 168, + 146, + 87, + 142, + 35, + 234, + 242, + 30 ], "level": 1, "position": { @@ -110,22 +110,22 @@ }, { "guid": [ - 99, - 139, - 226, + 220, + 151, + 106, 4, - 217, - 28, - 58, - 66, - 179, - 136, - 138, - 139, - 19, + 166, + 72, + 1, 67, - 135, - 234 + 152, + 202, + 233, + 150, + 7, + 236, + 206, + 24 ], "level": 2, "position": { @@ -135,22 +135,22 @@ }, { "guid": [ - 77, - 239, - 134, - 254, - 131, - 88, - 202, - 64, - 174, - 43, - 16, - 100, - 98, - 151, - 16, - 95 + 168, + 229, + 17, + 24, + 60, + 44, + 182, + 73, + 156, + 93, + 192, + 34, + 211, + 183, + 18, + 146 ], "level": 3, "position": { @@ -159,5 +159,5 @@ "space": "{8A6DBA48-33BB-0681-2F02-2C73A811E8B8},1" } ], - "text_receipt": "Some(Published { revision: ExGuid { guid: [16, 25, 161, 195, 247, 106, 18, 79, 145, 52, 79, 155, 148, 117, 105, 144], n: 1 } })" + "text_receipt": "Some(Published { revision: ExGuid { guid: [119, 19, 237, 181, 110, 22, 146, 64, 155, 95, 228, 99, 72, 242, 118, 22], n: 1 } })" } \ No newline at end of file diff --git a/corpus/page-lifecycle/offline-edits/group-single-page/cold/commands.jsonl b/corpus/page-lifecycle/offline-edits/group-single-page/cold/commands.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..2a6780206b15658cd8c19aef2ee1beb0e85c0cc5 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-single-page/cold/commands.jsonl @@ -0,0 +1,3 @@ +{"command": "powershell -NoProfile -Command \"Expand-Archive -LiteralPath C:\\one-tests\\transfer.zip -DestinationPath C:\\one-tests\\runs\\capture\\notebook\"", "exit": 0, "stdout": "", "stderr": "", "error": null} +{"command": "powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -File C:\\one-tests\\read-current.ps1 -Root C:\\one-tests\\runs\\capture -CloneHost ONE-M6-133773F4 -ExpectedPages 9", "exit": 0, "stdout": "Read 1 sections and 9 pages.\r\n", "stderr": "", "error": null} +{"command": "powershell -NoProfile -Command \"Compress-Archive -Force -Path C:\\one-tests\\runs\\capture\\* -DestinationPath C:\\one-tests\\captured.zip\"", "exit": 0, "stdout": "", "stderr": "", "error": null} diff --git a/corpus/page-lifecycle/offline-edits/group-single-page/cold/machine.json b/corpus/page-lifecycle/offline-edits/group-single-page/cold/machine.json new file mode 100644 index 0000000000000000000000000000000000000000..f12be025238f674a4205db461f2ccc479e9ab5f0 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-single-page/cold/machine.json @@ -0,0 +1 @@ +{"name": "m6-133773f4", "hostname": "ONE-M6-133773F4"} diff --git a/corpus/page-lifecycle/offline-edits/group-single-page/cold/notebook/Lifecycle.one b/corpus/page-lifecycle/offline-edits/group-single-page/cold/notebook/Lifecycle.one index a7d1c8cd2ee3498fea9e95436dd205df703dca87..8bd68e73fcf6e06902dd05a379380295e51371d4 100644 Binary files a/corpus/page-lifecycle/offline-edits/group-single-page/cold/notebook/Lifecycle.one and b/corpus/page-lifecycle/offline-edits/group-single-page/cold/notebook/Lifecycle.one differ diff --git a/corpus/page-lifecycle/offline-edits/group-single-page/cold/notebook/Open Notebook.onetoc2 b/corpus/page-lifecycle/offline-edits/group-single-page/cold/notebook/Open Notebook.onetoc2 new file mode 100644 index 0000000000000000000000000000000000000000..60dc5a020e9f10196635504512c5cd755db4aafd Binary files /dev/null and b/corpus/page-lifecycle/offline-edits/group-single-page/cold/notebook/Open Notebook.onetoc2 differ diff --git a/corpus/page-lifecycle/offline-edits/group-single-page/cold/read/environment.json b/corpus/page-lifecycle/offline-edits/group-single-page/cold/read/environment.json new file mode 100644 index 0000000000000000000000000000000000000000..d45063a6ae5cc0da3d4424b912e465c8a5eaef08 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-single-page/cold/read/environment.json @@ -0,0 +1,7 @@ +{ + "powershell": "5.1.14409.1005", + "schema": "xs2010", + "hostname": "ONE-M6-133773F4", + "cold": true, + "onenote": "14.0.4763.1000" +} diff --git a/corpus/page-lifecycle/offline-edits/group-single-page/cold/read/hierarchy.xml b/corpus/page-lifecycle/offline-edits/group-single-page/cold/read/hierarchy.xml index 31ab6ea3516975695579433603f358f0b113c7de..f35b6f71559fa991cc60f4f0430f6db3a346038b 100644 --- a/corpus/page-lifecycle/offline-edits/group-single-page/cold/read/hierarchy.xml +++ b/corpus/page-lifecycle/offline-edits/group-single-page/cold/read/hierarchy.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/group-single-page/cold/read/page-000.xml b/corpus/page-lifecycle/offline-edits/group-single-page/cold/read/page-000.xml index 8c56e657acab1e2645db0b7db0f439938d35edb5..c3c8e053c8d137c108587f3c359178b9316eddaf 100644 --- a/corpus/page-lifecycle/offline-edits/group-single-page/cold/read/page-000.xml +++ b/corpus/page-lifecycle/offline-edits/group-single-page/cold/read/page-000.xml @@ -1,4 +1,4 @@  -Body trailing 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/group-single-page/cold/read/page-001.xml b/corpus/page-lifecycle/offline-edits/group-single-page/cold/read/page-001.xml index 07d1abde47dcb058d2b8ce2f5d88295b0af9025f..6f4e5a299bc64b8feb8c59a20089f72af3fa7a6e 100644 --- a/corpus/page-lifecycle/offline-edits/group-single-page/cold/read/page-001.xml +++ b/corpus/page-lifecycle/offline-edits/group-single-page/cold/read/page-001.xml @@ -1,4 +1,4 @@  -Body automatic 🦀 éBody duplicate 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/group-single-page/cold/read/page-002.xml b/corpus/page-lifecycle/offline-edits/group-single-page/cold/read/page-002.xml index 75ce5c196b2c8f107467dac1b98b5412e5eb49fc..9e30700be89cb4072bad400d34b295878b8e614a 100644 --- a/corpus/page-lifecycle/offline-edits/group-single-page/cold/read/page-002.xml +++ b/corpus/page-lifecycle/offline-edits/group-single-page/cold/read/page-002.xml @@ -1,4 +1,4 @@  -Body duplicate 🦀 éBody automatic 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/group-single-page/cold/read/page-003.xml b/corpus/page-lifecycle/offline-edits/group-single-page/cold/read/page-003.xml index e1cdc9832cc62970e87e8f1e8e17d0201ea058fd..75aeccab92f9f16c58ad7fc6a9689928c31014d2 100644 --- a/corpus/page-lifecycle/offline-edits/group-single-page/cold/read/page-003.xml +++ b/corpus/page-lifecycle/offline-edits/group-single-page/cold/read/page-003.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/group-single-page/cold/read/page-004.xml b/corpus/page-lifecycle/offline-edits/group-single-page/cold/read/page-004.xml index f3e2f07d0b4998eb6538beb4e8fe7452c77199ce..730507e254e57ffb8c4be5762e94d9985fd3c56b 100644 --- a/corpus/page-lifecycle/offline-edits/group-single-page/cold/read/page-004.xml +++ b/corpus/page-lifecycle/offline-edits/group-single-page/cold/read/page-004.xml @@ -1,4 +1,2 @@  -Body grandchild 🦀 é preserved]]> + diff --git a/corpus/page-lifecycle/offline-edits/group-single-page/cold/read/page-005.xml b/corpus/page-lifecycle/offline-edits/group-single-page/cold/read/page-005.xml index 7faf3438e5bfe2cd65b5186b3f2d691fa5621240..6c0fb643464caf8fd7c0cd5c01f5f8d66dbdb6e4 100644 --- a/corpus/page-lifecycle/offline-edits/group-single-page/cold/read/page-005.xml +++ b/corpus/page-lifecycle/offline-edits/group-single-page/cold/read/page-005.xml @@ -1,4 +1,4 @@  -Offline Body parent 🦀 éBody grandchild 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/group-single-page/cold/read/page-006.xml b/corpus/page-lifecycle/offline-edits/group-single-page/cold/read/page-006.xml index bc6ed999c299b9cf092a1ef69de64ba88798ead7..e8d89cca384ffc3b10e29c3e621403b3cdae96bb 100644 --- a/corpus/page-lifecycle/offline-edits/group-single-page/cold/read/page-006.xml +++ b/corpus/page-lifecycle/offline-edits/group-single-page/cold/read/page-006.xml @@ -1,2 +1,4 @@  - +Offline Body parent 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/group-single-page/cold/read/page-007.xml b/corpus/page-lifecycle/offline-edits/group-single-page/cold/read/page-007.xml index 0ee2447c4511ff99381a18061d260d4602a8321c..93c070c7287d0e84bce328c336ac55311aae24db 100644 --- a/corpus/page-lifecycle/offline-edits/group-single-page/cold/read/page-007.xml +++ b/corpus/page-lifecycle/offline-edits/group-single-page/cold/read/page-007.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/group-single-page/cold/read/page-008.xml b/corpus/page-lifecycle/offline-edits/group-single-page/cold/read/page-008.xml index fd65d743951471d17467b4e8438893f7d4ebff7a..a016bf295ca2f11b89d523c03b4fa80eceaec408 100644 --- a/corpus/page-lifecycle/offline-edits/group-single-page/cold/read/page-008.xml +++ b/corpus/page-lifecycle/offline-edits/group-single-page/cold/read/page-008.xml @@ -1,4 +1,4 @@  -Body child 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/group-single-page/cold/read/payloads.json b/corpus/page-lifecycle/offline-edits/group-single-page/cold/read/payloads.json new file mode 100644 index 0000000000000000000000000000000000000000..1ce91a413d6fff4d58765187b76756f0e97ae843 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-single-page/cold/read/payloads.json @@ -0,0 +1,3 @@ +[ + +] \ No newline at end of file diff --git a/corpus/page-lifecycle/offline-edits/group-single-page/cold/run.json b/corpus/page-lifecycle/offline-edits/group-single-page/cold/run.json new file mode 100644 index 0000000000000000000000000000000000000000..8d1c9e93ea342fcd78d6458c40b65a213534d86e --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-single-page/cold/run.json @@ -0,0 +1,18 @@ +{ + "notebook": "/private/var/folders/90/4f4rngds01j55ggdj_vglk_c0000gn/T/tmp2iu0f00f", + "expected_pages": 9, + "author": null, + "author_timeout_seconds": 600, + "inspect": false, + "collect_notebook": true, + "base": { + "file": "win7-office-base.qcow2", + "format": "qcow2", + "sha256": "a1a4f8fab782ee14885ff801ca2f6347c208fdcfc3513637096f314315c89346", + "virtual_size": 68719476736 + }, + "scripts": { + "cold.ps1": "c177fc72ae6c2634d186f5671a880de20b09f9716532c37c69cb13aa15c7e331", + "read.ps1": "04013bfcccee40a17e2a225f9b9e96f40a3a8daad9e350609654f8eda3ccbb41" + } +} diff --git a/corpus/page-lifecycle/offline-edits/group-single-page/cold/scripts/cold.ps1 b/corpus/page-lifecycle/offline-edits/group-single-page/cold/scripts/cold.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..a0b99e7aeb86f4dc10032537800501a52ad65b4f --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-single-page/cold/scripts/cold.ps1 @@ -0,0 +1,27 @@ +param([Parameter(Mandatory=$true)][string]$Root, [string]$CloneHost = '') +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' +$root = [IO.Path]::GetFullPath($Root).TrimEnd('\') +if ([IO.Path]::GetDirectoryName($root) -ne 'C:\one-tests\runs') { + throw 'Choose a run directly below C:\one-tests\runs.' +} +if (Get-Process ONENOTE -ErrorAction SilentlyContinue) { throw 'Close OneNote before resetting its test cache.' } +$key = 'HKCU:\Software\Microsoft\Office\14.0\OneNote' +if ($CloneHost) { + if ($CloneHost -notmatch '^ONE-[A-Z0-9-]+$' -or [Environment]::MachineName -ne $CloneHost) { + throw 'The disposable clone hostname does not match this machine.' + } + New-Item "$key\Options\Paths" -Force | Out-Null + New-ItemProperty "$key\Options\Paths" -Name UnfiledNotesSection -PropertyType ExpandString -Value 'C:\one-tests\Loose.one' -Force | Out-Null +} elseif ((Get-ItemProperty "$key\Options\Paths").UnfiledNotesSection -ne 'C:\one-tests\Loose.one' -or + -not (Test-Path 'C:\one-tests\profile-original-cache')) { + throw 'Park the personal OneNote profile before resetting the test cache.' +} +$cache = Join-Path $env:LOCALAPPDATA 'Microsoft\OneNote\14.0' +$parked = Join-Path 'C:\one-tests\caches' ([IO.Path]::GetFileName($root)) +if (Test-Path $parked) { throw 'Choose a new run; its parked cache already exists.' } +New-Item -ItemType Directory -Path 'C:\one-tests\caches' -Force | Out-Null +if (Test-Path $cache) { Move-Item -LiteralPath $cache -Destination $parked } +if (Test-Path "$key\OpenNotebooks") { Remove-Item "$key\OpenNotebooks" -Recurse } +New-Item "$key\OpenNotebooks" | Out-Null +New-ItemProperty "$key\OpenNotebooks" -Name '1' -PropertyType String -Value "$root\notebook" | Out-Null diff --git a/corpus/page-lifecycle/offline-edits/group-single-page/cold/scripts/read.ps1 b/corpus/page-lifecycle/offline-edits/group-single-page/cold/scripts/read.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..476094ab1e0c47077988a6461db2080cf208642b --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-single-page/cold/scripts/read.ps1 @@ -0,0 +1,142 @@ +param( + [Parameter(Mandatory=$true)][string]$Root, + [int]$ExpectedPages = -1, + [switch]$UseCurrentCache, + [switch]$Pdf, + [switch]$KeepOpen, + [string]$CloneHost = '' +) +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' +$root = [IO.Path]::GetFullPath($Root).TrimEnd('\') +if ([IO.Path]::GetDirectoryName($root) -ne 'C:\one-tests\runs') { + throw 'Choose a run directly below C:\one-tests\runs.' +} +$notebook = Join-Path $root 'notebook' +$output = Join-Path $root 'read' +if (Test-Path $output) { throw 'Choose a new read destination.' } +if ($UseCurrentCache) { + if ((Get-ItemProperty 'HKCU:\Software\Microsoft\Office\14.0\OneNote\Options\Paths').UnfiledNotesSection -ne 'C:\one-tests\Loose.one') { + throw 'Park the personal OneNote profile before reading test notebooks.' + } +} else { + & "$PSScriptRoot\cold-current.ps1" -Root $root -CloneHost $CloneHost +} +New-Item -ItemType Directory -Path $output | Out-Null +$app = New-Object -ComObject OneNote.Application +$notebookId = '' +$failure = $null +try { + $app.OpenHierarchy($notebook, '', [ref]$notebookId, 0) + $process = Get-Process ONENOTE + @{ hostname = [Environment]::MachineName; onenote = $process.MainModule.FileVersionInfo.FileVersion; + powershell = $PSVersionTable.PSVersion.ToString(); schema = 'xs2010'; cold = (-not $UseCurrentCache.IsPresent) } | + ConvertTo-Json | Set-Content (Join-Path $output 'environment.json') -Encoding UTF8 + $sections = @() + foreach ($file in @(Get-ChildItem $notebook -Recurse | Where-Object { $_.Extension -eq '.one' })) { + $id = '' + $app.OpenHierarchy($file.FullName, '', [ref]$id, 0) + $sections += $id + } + $deadline = [DateTime]::UtcNow.AddSeconds(300) + $previous = '' + $lastChange = '' + $stableSince = [DateTime]::UtcNow + $settled = $false + do { + $pages = @{} + foreach ($section in $sections) { + $hierarchy = '' + $app.GetHierarchy($section, 4, [ref]$hierarchy, 1) + [xml]$xml = $hierarchy + foreach ($node in $xml.SelectNodes('//*[@path]')) { + if (-not $node.GetAttribute('path').StartsWith("$notebook\", [StringComparison]::OrdinalIgnoreCase)) { + throw 'OneNote opened a section outside the copied notebook.' + } + } + foreach ($node in $xml.SelectNodes('//*[local-name()="Page"]')) { + $id = $node.GetAttribute('ID') + $content = '' + $app.GetPageContent($id, [ref]$content, 1, 1) + $pages[$id] = $content + } + } + $signature = [String]::Join('|', @($pages.Keys | Sort-Object | ForEach-Object { $_ + $pages[$_] })) + if ($signature -ne $previous) { + $lastChange = $previous + $previous = $signature + $stableSince = [DateTime]::UtcNow + } + if ((($ExpectedPages -ge 0 -and $pages.Count -eq $ExpectedPages) -or + ($ExpectedPages -lt 0 -and $pages.Count -gt 0)) -and + ([DateTime]::UtcNow - $stableSince).TotalSeconds -ge 2) { $settled = $true; break } + Start-Sleep -Milliseconds 250 + } while ([DateTime]::UtcNow -lt $deadline) + if (-not $settled -or ($ExpectedPages -ge 0 -and $pages.Count -ne $ExpectedPages) -or ($ExpectedPages -lt 0 -and $pages.Count -eq 0)) { + [IO.File]::WriteAllText((Join-Path $output 'previous-signature.txt'), $lastChange, [Text.Encoding]::UTF8) + $index = 0 + foreach ($id in @($pages.Keys | Sort-Object)) { + [IO.File]::WriteAllText((Join-Path $output ('unsettled-{0:d3}.xml' -f $index)), $pages[$id], [Text.Encoding]::UTF8) + $index++ + } + $hierarchy = '' + $app.GetHierarchy($notebookId, 4, [ref]$hierarchy, 1) + [IO.File]::WriteAllText((Join-Path $output 'unsettled-hierarchy.xml'), $hierarchy, [Text.Encoding]::UTF8) + throw "Expected $ExpectedPages stable pages; OneNote returned $($pages.Count), settled=$settled." + } + $index = 0 + $payloads = @() + foreach ($id in @($pages.Keys | Sort-Object)) { + [IO.File]::WriteAllText((Join-Path $output ('page-{0:d3}.xml' -f $index)), $pages[$id], [Text.Encoding]::UTF8) + if ($Pdf) { + $pdfPath = Join-Path $output ('page-{0:d3}.pdf' -f $index) + $app.NavigateTo($id, '', $false) + $app.Publish($id, $pdfPath, 3, '') + if (-not (Test-Path $pdfPath) -or (Get-Item $pdfPath).Length -eq 0) { throw 'OneNote did not publish the page PDF.' } + } + [xml]$page = $pages[$id] + foreach ($file in $page.SelectNodes('//*[local-name()="InsertedFile" or local-name()="MediaFile"]')) { + $bytes = [IO.File]::ReadAllBytes($file.GetAttribute('pathCache')) + $hash = [BitConverter]::ToString([Security.Cryptography.SHA256]::Create().ComputeHash($bytes)).Replace('-', '').ToLowerInvariant() + [IO.File]::WriteAllBytes((Join-Path $output ($hash + '.attachment')), $bytes) + $payloads += @{ page = $id; object = $file.ParentNode.GetAttribute('objectID'); + kind = $file.LocalName; name = $file.GetAttribute('preferredName'); + sha256 = $hash; bytes = $bytes.Length } + } + $index++ + } + [IO.File]::WriteAllText((Join-Path $output 'payloads.json'), (ConvertTo-Json -InputObject $payloads -Depth 4), [Text.Encoding]::UTF8) + $all = '' + $app.GetHierarchy($notebookId, 4, [ref]$all, 1) + [xml]$finalTree = $all + $finalIds = @($finalTree.SelectNodes('//*[local-name()="Page"]') | ForEach-Object { $_.GetAttribute('ID') } | Sort-Object -Unique) + if ($finalIds.Count -ne $pages.Count -or @($finalIds | Where-Object { -not $pages.ContainsKey($_) }).Count -ne 0) { + throw 'The notebook hierarchy changed while collecting page evidence; repeat the cold read.' + } + [IO.File]::WriteAllText((Join-Path $output 'hierarchy.xml'), $all, [Text.Encoding]::UTF8) + Write-Output "Read $($sections.Count) sections and $($pages.Count) pages." +} catch { + $failure = $_ + [IO.File]::WriteAllText((Join-Path $output 'failure.txt'), ($_ | Out-String), [Text.Encoding]::UTF8) + throw +} finally { + try { + try { + if ($notebookId -and $CloneHost) { $app.SyncHierarchy($notebookId) } + if ($notebookId -and -not $KeepOpen -and (-not $UseCurrentCache -or $CloneHost)) { + $app.CloseNotebook($notebookId, $false) + } + } catch { + if ($null -eq $failure) { throw } + [IO.File]::WriteAllText((Join-Path $output 'cleanup-failure.txt'), ($_ | Out-String), [Text.Encoding]::UTF8) + } + } finally { + [void][Runtime.InteropServices.Marshal]::FinalReleaseComObject($app) + } + $app = $null + [GC]::Collect() + [GC]::WaitForPendingFinalizers() + if (-not $UseCurrentCache -and -not $CloneHost) { + Get-Process ONENOTE -ErrorAction SilentlyContinue | Wait-Process -Timeout 10 + } +} diff --git a/corpus/page-lifecycle/offline-edits/group-single-page/cold/source.json b/corpus/page-lifecycle/offline-edits/group-single-page/cold/source.json new file mode 100644 index 0000000000000000000000000000000000000000..3a1e9c4d96bde8fcefc7e18d21c3a1bec3afe7df --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-single-page/cold/source.json @@ -0,0 +1,8 @@ +[ + { + "path": "Lifecycle.one", + "bytes": 64016, + "sha256": "8f1d397cf23969ee336661f188879f1d418741878b506f6682a6f86d238c5c33", + "mtime_ns": 1789121647383619936 + } +] diff --git a/corpus/page-lifecycle/offline-edits/group-single-page/cold/teardown.json b/corpus/page-lifecycle/offline-edits/group-single-page/cold/teardown.json new file mode 100644 index 0000000000000000000000000000000000000000..05a47793de40f322e745c4c4183727e3590ecf70 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/group-single-page/cold/teardown.json @@ -0,0 +1 @@ +{"absent": true} diff --git a/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/candidate/Lifecycle.one b/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/candidate/Lifecycle.one index 2b6fd03c045ea6a2c4f665e41b995cd199b10e3b..dd8d8dfb990a896b60129574be3707e3cf112930 100644 Binary files a/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/candidate/Lifecycle.one and b/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/candidate/Lifecycle.one differ diff --git a/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/candidate/manifest.json b/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/candidate/manifest.json index ba631c1c9c546f93850c5fec398ed5e2bee4f114..d1ef731d1a178f39624bd2f468da296ba6859349 100644 --- a/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/candidate/manifest.json +++ b/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/candidate/manifest.json @@ -5,55 +5,55 @@ "original": [ { "guid": [ - 51, - 149, - 71, - 130, + 134, + 63, + 62, + 53, + 19, + 11, + 2, + 77, + 181, + 135, 35, - 40, - 136, - 73, - 174, - 150, - 88, - 198, - 236, - 138, - 233, - 46 + 119, + 101, + 81, + 244, + 16 ], "level": 3, "position": "Keep", "space": "{D7B1788B-A971-08DE-3324-F4DF82A3B46E},1" } ], - "page_receipt": "Some(Published { revision: ExGuid { guid: [251, 177, 210, 219, 141, 235, 29, 72, 144, 228, 193, 87, 108, 105, 221, 185], n: 1 } })", + "page_receipt": "Some(Published { revision: ExGuid { guid: [47, 88, 207, 136, 144, 44, 120, 66, 160, 221, 208, 207, 142, 185, 131, 44], n: 1 } })", "phase": "01-demoted-parent", "publications": 2, "reviewed": [ { "guid": [ - 51, - 149, - 71, - 130, + 134, + 63, + 62, + 53, + 19, + 11, + 2, + 77, + 181, + 135, 35, - 40, - 136, - 73, - 174, - 150, - 88, - 198, - 236, - 138, - 233, - 46 + 119, + 101, + 81, + 244, + 16 ], "level": 3, "position": "Keep", "space": "{D7B1788B-A971-08DE-3324-F4DF82A3B46E},1" } ], - "text_receipt": "Some(Published { revision: ExGuid { guid: [40, 101, 158, 170, 87, 244, 65, 66, 154, 49, 204, 137, 48, 37, 222, 151], n: 1 } })" + "text_receipt": "Some(Published { revision: ExGuid { guid: [75, 127, 20, 153, 134, 54, 125, 68, 174, 244, 225, 49, 193, 180, 107, 56], n: 1 } })" } \ No newline at end of file diff --git a/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/commands.jsonl b/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/commands.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..820d5f33953e33f0e4c708237673326ae7992c5f --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/commands.jsonl @@ -0,0 +1,3 @@ +{"command": "powershell -NoProfile -Command \"Expand-Archive -LiteralPath C:\\one-tests\\transfer.zip -DestinationPath C:\\one-tests\\runs\\capture\\notebook\"", "exit": 0, "stdout": "", "stderr": "", "error": null} +{"command": "powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -File C:\\one-tests\\read-current.ps1 -Root C:\\one-tests\\runs\\capture -CloneHost ONE-M6-B88A1AEC -ExpectedPages 9", "exit": 0, "stdout": "Read 1 sections and 9 pages.\r\n", "stderr": "", "error": null} +{"command": "powershell -NoProfile -Command \"Compress-Archive -Force -Path C:\\one-tests\\runs\\capture\\* -DestinationPath C:\\one-tests\\captured.zip\"", "exit": 0, "stdout": "", "stderr": "", "error": null} diff --git a/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/machine.json b/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/machine.json new file mode 100644 index 0000000000000000000000000000000000000000..947ca5763651dd6c25747777ed0a3fa017e77dfe --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/machine.json @@ -0,0 +1 @@ +{"name": "m6-b88a1aec", "hostname": "ONE-M6-B88A1AEC"} diff --git a/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/notebook/Lifecycle.one b/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/notebook/Lifecycle.one index 11e6db8793659abc789a12f4dce3b80fb1c3c898..8d6daa996ecd1f3651e16888f89fd5453d52d048 100644 Binary files a/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/notebook/Lifecycle.one and b/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/notebook/Lifecycle.one differ diff --git a/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/notebook/Open Notebook.onetoc2 b/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/notebook/Open Notebook.onetoc2 new file mode 100644 index 0000000000000000000000000000000000000000..9740e2a067d862954679b1dfa93055544c1f7619 Binary files /dev/null and b/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/notebook/Open Notebook.onetoc2 differ diff --git a/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/read/environment.json b/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/read/environment.json new file mode 100644 index 0000000000000000000000000000000000000000..029f15dee294d37daae6d14326c5503d23bc2cf6 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/read/environment.json @@ -0,0 +1,7 @@ +{ + "powershell": "5.1.14409.1005", + "schema": "xs2010", + "hostname": "ONE-M6-B88A1AEC", + "cold": true, + "onenote": "14.0.4763.1000" +} diff --git a/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/read/hierarchy.xml b/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/read/hierarchy.xml index 931b2160f5cbd5d36844575f84913826a88bf7d1..cdc72e381f3579853fe45cd7713ed3868abb3479 100644 --- a/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/read/hierarchy.xml +++ b/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/read/hierarchy.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/read/page-000.xml b/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/read/page-000.xml index 2c30288598dea46d0b8323ad293cbe6438e665dc..fb08253f054f6d0e25dc9acf606dcf2c4e497543 100644 --- a/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/read/page-000.xml +++ b/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/read/page-000.xml @@ -1,4 +1,2 @@  -Body child 🦀 é preserved]]> + diff --git a/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/read/page-001.xml b/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/read/page-001.xml index 7d5246520edd9f8682f15619d1726eec091621ee..36041a336f5cd8d9296174f43d14dd3a18600cf0 100644 --- a/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/read/page-001.xml +++ b/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/read/page-001.xml @@ -1,2 +1,4 @@  - +Body grandchild 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/read/page-002.xml b/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/read/page-002.xml index 7c74a10fa0c57c7559770738758ffc5447ac42e5..2660ded2eca5b1d595de4cd4fe446967b864693a 100644 --- a/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/read/page-002.xml +++ b/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/read/page-002.xml @@ -1,2 +1,4 @@  - +Offline Body parent 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/read/page-003.xml b/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/read/page-003.xml index 9ed998ad53a336229e907e219959cee82ae680d9..416eb80fd4c972698fd063d0fe60c66d4da6e8f9 100644 --- a/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/read/page-003.xml +++ b/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/read/page-003.xml @@ -1,4 +1,2 @@  -Body grandchild 🦀 é preserved]]> + diff --git a/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/read/page-004.xml b/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/read/page-004.xml index 334ab5c5228d33f8633a510696c4e89126b9ce5e..01d64ed29cccce49bc76385c031a94774e7e7efb 100644 --- a/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/read/page-004.xml +++ b/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/read/page-004.xml @@ -1,4 +1,2 @@  -Offline Body parent 🦀 é preserved]]> + diff --git a/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/read/page-005.xml b/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/read/page-005.xml index dd27e940f1ba049701745dc23b63a9185598d541..b2abfb252315cf937c35c0ebb2ef40efa06cf256 100644 --- a/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/read/page-005.xml +++ b/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/read/page-005.xml @@ -1,2 +1,4 @@  - +Body child 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/read/page-006.xml b/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/read/page-006.xml index aab84fd136b7e8e66ffa768e9e568988ef53ba9a..422eac44fe8bb0d730b087c3b624afd6a2cf8c0f 100644 --- a/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/read/page-006.xml +++ b/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/read/page-006.xml @@ -1,4 +1,4 @@  -Body duplicate 🦀 éBody trailing 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/read/page-007.xml b/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/read/page-007.xml index 175c837b65e99e0ad08d95b7dcc12384ad4912ac..dcd8a8c1d883258fecb71732058ed59656886184 100644 --- a/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/read/page-007.xml +++ b/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/read/page-007.xml @@ -1,4 +1,4 @@  -Body automatic 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/read/page-008.xml b/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/read/page-008.xml index 5110cb0954fb17374a767d57adf8f802a4815d6f..ddf1a6da0ae2346aa99269dbbf747b7b71508a8e 100644 --- a/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/read/page-008.xml +++ b/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/read/page-008.xml @@ -1,4 +1,4 @@  -Body trailing 🦀 éBody duplicate 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/read/payloads.json b/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/read/payloads.json new file mode 100644 index 0000000000000000000000000000000000000000..1ce91a413d6fff4d58765187b76756f0e97ae843 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/read/payloads.json @@ -0,0 +1,3 @@ +[ + +] \ No newline at end of file diff --git a/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/run.json b/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/run.json new file mode 100644 index 0000000000000000000000000000000000000000..776dda02130e9bbd0723d5d150583547acf2528d --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/run.json @@ -0,0 +1,18 @@ +{ + "notebook": "/private/var/folders/90/4f4rngds01j55ggdj_vglk_c0000gn/T/tmpzu_h46n7", + "expected_pages": 9, + "author": null, + "author_timeout_seconds": 600, + "inspect": false, + "collect_notebook": true, + "base": { + "file": "win7-office-base.qcow2", + "format": "qcow2", + "sha256": "a1a4f8fab782ee14885ff801ca2f6347c208fdcfc3513637096f314315c89346", + "virtual_size": 68719476736 + }, + "scripts": { + "cold.ps1": "c177fc72ae6c2634d186f5671a880de20b09f9716532c37c69cb13aa15c7e331", + "read.ps1": "04013bfcccee40a17e2a225f9b9e96f40a3a8daad9e350609654f8eda3ccbb41" + } +} diff --git a/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/scripts/cold.ps1 b/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/scripts/cold.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..a0b99e7aeb86f4dc10032537800501a52ad65b4f --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/scripts/cold.ps1 @@ -0,0 +1,27 @@ +param([Parameter(Mandatory=$true)][string]$Root, [string]$CloneHost = '') +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' +$root = [IO.Path]::GetFullPath($Root).TrimEnd('\') +if ([IO.Path]::GetDirectoryName($root) -ne 'C:\one-tests\runs') { + throw 'Choose a run directly below C:\one-tests\runs.' +} +if (Get-Process ONENOTE -ErrorAction SilentlyContinue) { throw 'Close OneNote before resetting its test cache.' } +$key = 'HKCU:\Software\Microsoft\Office\14.0\OneNote' +if ($CloneHost) { + if ($CloneHost -notmatch '^ONE-[A-Z0-9-]+$' -or [Environment]::MachineName -ne $CloneHost) { + throw 'The disposable clone hostname does not match this machine.' + } + New-Item "$key\Options\Paths" -Force | Out-Null + New-ItemProperty "$key\Options\Paths" -Name UnfiledNotesSection -PropertyType ExpandString -Value 'C:\one-tests\Loose.one' -Force | Out-Null +} elseif ((Get-ItemProperty "$key\Options\Paths").UnfiledNotesSection -ne 'C:\one-tests\Loose.one' -or + -not (Test-Path 'C:\one-tests\profile-original-cache')) { + throw 'Park the personal OneNote profile before resetting the test cache.' +} +$cache = Join-Path $env:LOCALAPPDATA 'Microsoft\OneNote\14.0' +$parked = Join-Path 'C:\one-tests\caches' ([IO.Path]::GetFileName($root)) +if (Test-Path $parked) { throw 'Choose a new run; its parked cache already exists.' } +New-Item -ItemType Directory -Path 'C:\one-tests\caches' -Force | Out-Null +if (Test-Path $cache) { Move-Item -LiteralPath $cache -Destination $parked } +if (Test-Path "$key\OpenNotebooks") { Remove-Item "$key\OpenNotebooks" -Recurse } +New-Item "$key\OpenNotebooks" | Out-Null +New-ItemProperty "$key\OpenNotebooks" -Name '1' -PropertyType String -Value "$root\notebook" | Out-Null diff --git a/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/scripts/read.ps1 b/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/scripts/read.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..476094ab1e0c47077988a6461db2080cf208642b --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/scripts/read.ps1 @@ -0,0 +1,142 @@ +param( + [Parameter(Mandatory=$true)][string]$Root, + [int]$ExpectedPages = -1, + [switch]$UseCurrentCache, + [switch]$Pdf, + [switch]$KeepOpen, + [string]$CloneHost = '' +) +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' +$root = [IO.Path]::GetFullPath($Root).TrimEnd('\') +if ([IO.Path]::GetDirectoryName($root) -ne 'C:\one-tests\runs') { + throw 'Choose a run directly below C:\one-tests\runs.' +} +$notebook = Join-Path $root 'notebook' +$output = Join-Path $root 'read' +if (Test-Path $output) { throw 'Choose a new read destination.' } +if ($UseCurrentCache) { + if ((Get-ItemProperty 'HKCU:\Software\Microsoft\Office\14.0\OneNote\Options\Paths').UnfiledNotesSection -ne 'C:\one-tests\Loose.one') { + throw 'Park the personal OneNote profile before reading test notebooks.' + } +} else { + & "$PSScriptRoot\cold-current.ps1" -Root $root -CloneHost $CloneHost +} +New-Item -ItemType Directory -Path $output | Out-Null +$app = New-Object -ComObject OneNote.Application +$notebookId = '' +$failure = $null +try { + $app.OpenHierarchy($notebook, '', [ref]$notebookId, 0) + $process = Get-Process ONENOTE + @{ hostname = [Environment]::MachineName; onenote = $process.MainModule.FileVersionInfo.FileVersion; + powershell = $PSVersionTable.PSVersion.ToString(); schema = 'xs2010'; cold = (-not $UseCurrentCache.IsPresent) } | + ConvertTo-Json | Set-Content (Join-Path $output 'environment.json') -Encoding UTF8 + $sections = @() + foreach ($file in @(Get-ChildItem $notebook -Recurse | Where-Object { $_.Extension -eq '.one' })) { + $id = '' + $app.OpenHierarchy($file.FullName, '', [ref]$id, 0) + $sections += $id + } + $deadline = [DateTime]::UtcNow.AddSeconds(300) + $previous = '' + $lastChange = '' + $stableSince = [DateTime]::UtcNow + $settled = $false + do { + $pages = @{} + foreach ($section in $sections) { + $hierarchy = '' + $app.GetHierarchy($section, 4, [ref]$hierarchy, 1) + [xml]$xml = $hierarchy + foreach ($node in $xml.SelectNodes('//*[@path]')) { + if (-not $node.GetAttribute('path').StartsWith("$notebook\", [StringComparison]::OrdinalIgnoreCase)) { + throw 'OneNote opened a section outside the copied notebook.' + } + } + foreach ($node in $xml.SelectNodes('//*[local-name()="Page"]')) { + $id = $node.GetAttribute('ID') + $content = '' + $app.GetPageContent($id, [ref]$content, 1, 1) + $pages[$id] = $content + } + } + $signature = [String]::Join('|', @($pages.Keys | Sort-Object | ForEach-Object { $_ + $pages[$_] })) + if ($signature -ne $previous) { + $lastChange = $previous + $previous = $signature + $stableSince = [DateTime]::UtcNow + } + if ((($ExpectedPages -ge 0 -and $pages.Count -eq $ExpectedPages) -or + ($ExpectedPages -lt 0 -and $pages.Count -gt 0)) -and + ([DateTime]::UtcNow - $stableSince).TotalSeconds -ge 2) { $settled = $true; break } + Start-Sleep -Milliseconds 250 + } while ([DateTime]::UtcNow -lt $deadline) + if (-not $settled -or ($ExpectedPages -ge 0 -and $pages.Count -ne $ExpectedPages) -or ($ExpectedPages -lt 0 -and $pages.Count -eq 0)) { + [IO.File]::WriteAllText((Join-Path $output 'previous-signature.txt'), $lastChange, [Text.Encoding]::UTF8) + $index = 0 + foreach ($id in @($pages.Keys | Sort-Object)) { + [IO.File]::WriteAllText((Join-Path $output ('unsettled-{0:d3}.xml' -f $index)), $pages[$id], [Text.Encoding]::UTF8) + $index++ + } + $hierarchy = '' + $app.GetHierarchy($notebookId, 4, [ref]$hierarchy, 1) + [IO.File]::WriteAllText((Join-Path $output 'unsettled-hierarchy.xml'), $hierarchy, [Text.Encoding]::UTF8) + throw "Expected $ExpectedPages stable pages; OneNote returned $($pages.Count), settled=$settled." + } + $index = 0 + $payloads = @() + foreach ($id in @($pages.Keys | Sort-Object)) { + [IO.File]::WriteAllText((Join-Path $output ('page-{0:d3}.xml' -f $index)), $pages[$id], [Text.Encoding]::UTF8) + if ($Pdf) { + $pdfPath = Join-Path $output ('page-{0:d3}.pdf' -f $index) + $app.NavigateTo($id, '', $false) + $app.Publish($id, $pdfPath, 3, '') + if (-not (Test-Path $pdfPath) -or (Get-Item $pdfPath).Length -eq 0) { throw 'OneNote did not publish the page PDF.' } + } + [xml]$page = $pages[$id] + foreach ($file in $page.SelectNodes('//*[local-name()="InsertedFile" or local-name()="MediaFile"]')) { + $bytes = [IO.File]::ReadAllBytes($file.GetAttribute('pathCache')) + $hash = [BitConverter]::ToString([Security.Cryptography.SHA256]::Create().ComputeHash($bytes)).Replace('-', '').ToLowerInvariant() + [IO.File]::WriteAllBytes((Join-Path $output ($hash + '.attachment')), $bytes) + $payloads += @{ page = $id; object = $file.ParentNode.GetAttribute('objectID'); + kind = $file.LocalName; name = $file.GetAttribute('preferredName'); + sha256 = $hash; bytes = $bytes.Length } + } + $index++ + } + [IO.File]::WriteAllText((Join-Path $output 'payloads.json'), (ConvertTo-Json -InputObject $payloads -Depth 4), [Text.Encoding]::UTF8) + $all = '' + $app.GetHierarchy($notebookId, 4, [ref]$all, 1) + [xml]$finalTree = $all + $finalIds = @($finalTree.SelectNodes('//*[local-name()="Page"]') | ForEach-Object { $_.GetAttribute('ID') } | Sort-Object -Unique) + if ($finalIds.Count -ne $pages.Count -or @($finalIds | Where-Object { -not $pages.ContainsKey($_) }).Count -ne 0) { + throw 'The notebook hierarchy changed while collecting page evidence; repeat the cold read.' + } + [IO.File]::WriteAllText((Join-Path $output 'hierarchy.xml'), $all, [Text.Encoding]::UTF8) + Write-Output "Read $($sections.Count) sections and $($pages.Count) pages." +} catch { + $failure = $_ + [IO.File]::WriteAllText((Join-Path $output 'failure.txt'), ($_ | Out-String), [Text.Encoding]::UTF8) + throw +} finally { + try { + try { + if ($notebookId -and $CloneHost) { $app.SyncHierarchy($notebookId) } + if ($notebookId -and -not $KeepOpen -and (-not $UseCurrentCache -or $CloneHost)) { + $app.CloseNotebook($notebookId, $false) + } + } catch { + if ($null -eq $failure) { throw } + [IO.File]::WriteAllText((Join-Path $output 'cleanup-failure.txt'), ($_ | Out-String), [Text.Encoding]::UTF8) + } + } finally { + [void][Runtime.InteropServices.Marshal]::FinalReleaseComObject($app) + } + $app = $null + [GC]::Collect() + [GC]::WaitForPendingFinalizers() + if (-not $UseCurrentCache -and -not $CloneHost) { + Get-Process ONENOTE -ErrorAction SilentlyContinue | Wait-Process -Timeout 10 + } +} diff --git a/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/source.json b/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/source.json new file mode 100644 index 0000000000000000000000000000000000000000..05d111f61afe35d542e3c4cfb21d52147fe51ee9 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/source.json @@ -0,0 +1,8 @@ +[ + { + "path": "Lifecycle.one", + "bytes": 60192, + "sha256": "edfc61dcb2e55d6bf3afccc72e523a1fa9d253fa5c5b947f36cbb152b9446fdf", + "mtime_ns": 1789121640873938491 + } +] diff --git a/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/teardown.json b/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/teardown.json new file mode 100644 index 0000000000000000000000000000000000000000..05a47793de40f322e745c4c4183727e3590ecf70 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-01-demoted-parent/cold/teardown.json @@ -0,0 +1 @@ +{"absent": true} diff --git a/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/candidate/Lifecycle.one b/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/candidate/Lifecycle.one index 4330b9e3a2bab05a122fea306ad64fb4cfb8f760..ed662cde10fd99f0522c007960db495c28580a78 100644 Binary files a/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/candidate/Lifecycle.one and b/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/candidate/Lifecycle.one differ diff --git a/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/candidate/manifest.json b/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/candidate/manifest.json index a59ec49aed2c95693afdac4bf47b7eaf08fc35d9..86ef4db19db43554c94ac6c05793df4b3050a758 100644 --- a/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/candidate/manifest.json +++ b/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/candidate/manifest.json @@ -5,55 +5,55 @@ "original": [ { "guid": [ - 74, - 104, - 251, - 59, - 244, - 179, - 135, - 76, - 167, - 255, - 40, - 223, - 194, - 18, - 10, - 190 + 32, + 235, + 90, + 209, + 129, + 195, + 33, + 65, + 173, + 207, + 182, + 84, + 31, + 81, + 88, + 138 ], "level": 3, "position": "Keep", "space": "{D7B1788B-A971-08DE-3324-F4DF82A3B46E},1" } ], - "page_receipt": "Some(Published { revision: ExGuid { guid: [23, 146, 135, 98, 153, 107, 107, 69, 187, 87, 31, 204, 225, 219, 112, 75], n: 1 } })", + "page_receipt": "Some(Published { revision: ExGuid { guid: [144, 235, 3, 148, 238, 183, 36, 79, 190, 229, 7, 46, 95, 79, 39, 167], n: 1 } })", "phase": "02-promoted-parent", "publications": 2, "reviewed": [ { "guid": [ - 74, - 104, - 251, - 59, - 244, - 179, - 135, - 76, - 167, - 255, - 40, - 223, - 194, - 18, - 10, - 190 + 32, + 235, + 90, + 209, + 129, + 195, + 33, + 65, + 173, + 207, + 182, + 84, + 31, + 81, + 88, + 138 ], "level": 3, "position": "Keep", "space": "{D7B1788B-A971-08DE-3324-F4DF82A3B46E},1" } ], - "text_receipt": "Some(Published { revision: ExGuid { guid: [94, 246, 254, 201, 85, 191, 7, 77, 186, 8, 10, 23, 229, 199, 73, 189], n: 1 } })" + "text_receipt": "Some(Published { revision: ExGuid { guid: [121, 19, 89, 2, 36, 85, 121, 75, 181, 191, 91, 180, 181, 186, 142, 127], n: 1 } })" } \ No newline at end of file diff --git a/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/commands.jsonl b/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/commands.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..e16fc0e235fa008fa70487c9fd783d89cf0c8e1c --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/commands.jsonl @@ -0,0 +1,3 @@ +{"command": "powershell -NoProfile -Command \"Expand-Archive -LiteralPath C:\\one-tests\\transfer.zip -DestinationPath C:\\one-tests\\runs\\capture\\notebook\"", "exit": 0, "stdout": "", "stderr": "", "error": null} +{"command": "powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -File C:\\one-tests\\read-current.ps1 -Root C:\\one-tests\\runs\\capture -CloneHost ONE-M6-6E03355E -ExpectedPages 9", "exit": 0, "stdout": "Read 1 sections and 9 pages.\r\n", "stderr": "", "error": null} +{"command": "powershell -NoProfile -Command \"Compress-Archive -Force -Path C:\\one-tests\\runs\\capture\\* -DestinationPath C:\\one-tests\\captured.zip\"", "exit": 0, "stdout": "", "stderr": "", "error": null} diff --git a/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/machine.json b/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/machine.json new file mode 100644 index 0000000000000000000000000000000000000000..05c92ca67edd8a7e1680dc6ff407afcd46f3f096 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/machine.json @@ -0,0 +1 @@ +{"name": "m6-6e03355e", "hostname": "ONE-M6-6E03355E"} diff --git a/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/notebook/Lifecycle.one b/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/notebook/Lifecycle.one index b85adfac4e8b9abba97bb1574bb7671b56927d50..baa52b52e739ae7632b1b863b60add172ac44467 100644 Binary files a/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/notebook/Lifecycle.one and b/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/notebook/Lifecycle.one differ diff --git a/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/notebook/Open Notebook.onetoc2 b/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/notebook/Open Notebook.onetoc2 new file mode 100644 index 0000000000000000000000000000000000000000..57258be81f3959ca36a8d3359abd1a337ebba65a Binary files /dev/null and b/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/notebook/Open Notebook.onetoc2 differ diff --git a/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/read/environment.json b/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/read/environment.json new file mode 100644 index 0000000000000000000000000000000000000000..465a588e5e8b1301c72d0b341aa06103d40f204f --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/read/environment.json @@ -0,0 +1,7 @@ +{ + "powershell": "5.1.14409.1005", + "schema": "xs2010", + "hostname": "ONE-M6-6E03355E", + "cold": true, + "onenote": "14.0.4763.1000" +} diff --git a/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/read/hierarchy.xml b/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/read/hierarchy.xml index f4f2f22ec5bc88cf1858377087c1ea5b7f303556..a5170479bf2c805d326fa8b871009df819386fdc 100644 --- a/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/read/hierarchy.xml +++ b/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/read/hierarchy.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/read/page-000.xml b/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/read/page-000.xml index 6a2cf37f0dc995fddf3dce1d21ced07d04a93728..ecfdc3416cbbd6b2c4a2e2047ffb48c87118dd26 100644 --- a/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/read/page-000.xml +++ b/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/read/page-000.xml @@ -1,4 +1,4 @@  -Body trailing 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/read/page-001.xml b/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/read/page-001.xml index fd57a53172293dfd132489b7401f86489b08b312..4c7064336984b01c04d04822d01a723f5c813044 100644 --- a/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/read/page-001.xml +++ b/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/read/page-001.xml @@ -1,4 +1,4 @@  -Body automatic 🦀 éBody duplicate 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/read/page-002.xml b/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/read/page-002.xml index 85e373ea826cbf125e1847169b6010895710a4f6..13a95614bb99347d40c1a6bf3668db4ac9098e56 100644 --- a/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/read/page-002.xml +++ b/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/read/page-002.xml @@ -1,4 +1,4 @@  -Body duplicate 🦀 éBody automatic 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/read/page-003.xml b/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/read/page-003.xml index 17d603bc2b1b5461c65ccb6e7fc223b87cc4fbd1..bdce7a8c2f7bcc54764b04b292f3add5773547c9 100644 --- a/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/read/page-003.xml +++ b/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/read/page-003.xml @@ -1,4 +1,2 @@  -Offline Body parent 🦀 é preserved]]> + diff --git a/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/read/page-004.xml b/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/read/page-004.xml index 346a62c243cefa74d6955bd65f1aa2e4964de3da..0b1d03dcf5411d6e85b531c6955c0e33fc73a2cf 100644 --- a/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/read/page-004.xml +++ b/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/read/page-004.xml @@ -1,4 +1,4 @@  -Body grandchild 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/read/page-005.xml b/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/read/page-005.xml index f74d51e74298a6798d4ced53cb226e9239278691..6772566e113aa0880776743f15e6c656000c232c 100644 --- a/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/read/page-005.xml +++ b/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/read/page-005.xml @@ -1,2 +1,4 @@  - +Offline Body parent 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/read/page-006.xml b/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/read/page-006.xml index 027a4073fd43d4094649fe264f8a421a0fad7fda..18d60f826724cfc3f5a0984a3431e818b4bf0068 100644 --- a/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/read/page-006.xml +++ b/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/read/page-006.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/read/page-007.xml b/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/read/page-007.xml index 4d73c1582b215bc94398d4f6980ecb2fbf24a7df..bf92465c772547b93014f415f1ad8bb66930a083 100644 --- a/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/read/page-007.xml +++ b/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/read/page-007.xml @@ -1,4 +1,4 @@  -Body child 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/read/page-008.xml b/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/read/page-008.xml index d8097dbaf961081b207a7e6244ef62537eee20fc..b9fabd6dd3abbdd10c1919b970695c5103f641c4 100644 --- a/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/read/page-008.xml +++ b/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/read/page-008.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/read/payloads.json b/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/read/payloads.json new file mode 100644 index 0000000000000000000000000000000000000000..1ce91a413d6fff4d58765187b76756f0e97ae843 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/read/payloads.json @@ -0,0 +1,3 @@ +[ + +] \ No newline at end of file diff --git a/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/run.json b/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/run.json new file mode 100644 index 0000000000000000000000000000000000000000..57a28bf3fc85833daf91470a6259801400d55a1f --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/run.json @@ -0,0 +1,18 @@ +{ + "notebook": "/private/var/folders/90/4f4rngds01j55ggdj_vglk_c0000gn/T/tmp5vi4lp1k", + "expected_pages": 9, + "author": null, + "author_timeout_seconds": 600, + "inspect": false, + "collect_notebook": true, + "base": { + "file": "win7-office-base.qcow2", + "format": "qcow2", + "sha256": "a1a4f8fab782ee14885ff801ca2f6347c208fdcfc3513637096f314315c89346", + "virtual_size": 68719476736 + }, + "scripts": { + "cold.ps1": "c177fc72ae6c2634d186f5671a880de20b09f9716532c37c69cb13aa15c7e331", + "read.ps1": "04013bfcccee40a17e2a225f9b9e96f40a3a8daad9e350609654f8eda3ccbb41" + } +} diff --git a/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/scripts/cold.ps1 b/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/scripts/cold.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..a0b99e7aeb86f4dc10032537800501a52ad65b4f --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/scripts/cold.ps1 @@ -0,0 +1,27 @@ +param([Parameter(Mandatory=$true)][string]$Root, [string]$CloneHost = '') +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' +$root = [IO.Path]::GetFullPath($Root).TrimEnd('\') +if ([IO.Path]::GetDirectoryName($root) -ne 'C:\one-tests\runs') { + throw 'Choose a run directly below C:\one-tests\runs.' +} +if (Get-Process ONENOTE -ErrorAction SilentlyContinue) { throw 'Close OneNote before resetting its test cache.' } +$key = 'HKCU:\Software\Microsoft\Office\14.0\OneNote' +if ($CloneHost) { + if ($CloneHost -notmatch '^ONE-[A-Z0-9-]+$' -or [Environment]::MachineName -ne $CloneHost) { + throw 'The disposable clone hostname does not match this machine.' + } + New-Item "$key\Options\Paths" -Force | Out-Null + New-ItemProperty "$key\Options\Paths" -Name UnfiledNotesSection -PropertyType ExpandString -Value 'C:\one-tests\Loose.one' -Force | Out-Null +} elseif ((Get-ItemProperty "$key\Options\Paths").UnfiledNotesSection -ne 'C:\one-tests\Loose.one' -or + -not (Test-Path 'C:\one-tests\profile-original-cache')) { + throw 'Park the personal OneNote profile before resetting the test cache.' +} +$cache = Join-Path $env:LOCALAPPDATA 'Microsoft\OneNote\14.0' +$parked = Join-Path 'C:\one-tests\caches' ([IO.Path]::GetFileName($root)) +if (Test-Path $parked) { throw 'Choose a new run; its parked cache already exists.' } +New-Item -ItemType Directory -Path 'C:\one-tests\caches' -Force | Out-Null +if (Test-Path $cache) { Move-Item -LiteralPath $cache -Destination $parked } +if (Test-Path "$key\OpenNotebooks") { Remove-Item "$key\OpenNotebooks" -Recurse } +New-Item "$key\OpenNotebooks" | Out-Null +New-ItemProperty "$key\OpenNotebooks" -Name '1' -PropertyType String -Value "$root\notebook" | Out-Null diff --git a/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/scripts/read.ps1 b/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/scripts/read.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..476094ab1e0c47077988a6461db2080cf208642b --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/scripts/read.ps1 @@ -0,0 +1,142 @@ +param( + [Parameter(Mandatory=$true)][string]$Root, + [int]$ExpectedPages = -1, + [switch]$UseCurrentCache, + [switch]$Pdf, + [switch]$KeepOpen, + [string]$CloneHost = '' +) +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' +$root = [IO.Path]::GetFullPath($Root).TrimEnd('\') +if ([IO.Path]::GetDirectoryName($root) -ne 'C:\one-tests\runs') { + throw 'Choose a run directly below C:\one-tests\runs.' +} +$notebook = Join-Path $root 'notebook' +$output = Join-Path $root 'read' +if (Test-Path $output) { throw 'Choose a new read destination.' } +if ($UseCurrentCache) { + if ((Get-ItemProperty 'HKCU:\Software\Microsoft\Office\14.0\OneNote\Options\Paths').UnfiledNotesSection -ne 'C:\one-tests\Loose.one') { + throw 'Park the personal OneNote profile before reading test notebooks.' + } +} else { + & "$PSScriptRoot\cold-current.ps1" -Root $root -CloneHost $CloneHost +} +New-Item -ItemType Directory -Path $output | Out-Null +$app = New-Object -ComObject OneNote.Application +$notebookId = '' +$failure = $null +try { + $app.OpenHierarchy($notebook, '', [ref]$notebookId, 0) + $process = Get-Process ONENOTE + @{ hostname = [Environment]::MachineName; onenote = $process.MainModule.FileVersionInfo.FileVersion; + powershell = $PSVersionTable.PSVersion.ToString(); schema = 'xs2010'; cold = (-not $UseCurrentCache.IsPresent) } | + ConvertTo-Json | Set-Content (Join-Path $output 'environment.json') -Encoding UTF8 + $sections = @() + foreach ($file in @(Get-ChildItem $notebook -Recurse | Where-Object { $_.Extension -eq '.one' })) { + $id = '' + $app.OpenHierarchy($file.FullName, '', [ref]$id, 0) + $sections += $id + } + $deadline = [DateTime]::UtcNow.AddSeconds(300) + $previous = '' + $lastChange = '' + $stableSince = [DateTime]::UtcNow + $settled = $false + do { + $pages = @{} + foreach ($section in $sections) { + $hierarchy = '' + $app.GetHierarchy($section, 4, [ref]$hierarchy, 1) + [xml]$xml = $hierarchy + foreach ($node in $xml.SelectNodes('//*[@path]')) { + if (-not $node.GetAttribute('path').StartsWith("$notebook\", [StringComparison]::OrdinalIgnoreCase)) { + throw 'OneNote opened a section outside the copied notebook.' + } + } + foreach ($node in $xml.SelectNodes('//*[local-name()="Page"]')) { + $id = $node.GetAttribute('ID') + $content = '' + $app.GetPageContent($id, [ref]$content, 1, 1) + $pages[$id] = $content + } + } + $signature = [String]::Join('|', @($pages.Keys | Sort-Object | ForEach-Object { $_ + $pages[$_] })) + if ($signature -ne $previous) { + $lastChange = $previous + $previous = $signature + $stableSince = [DateTime]::UtcNow + } + if ((($ExpectedPages -ge 0 -and $pages.Count -eq $ExpectedPages) -or + ($ExpectedPages -lt 0 -and $pages.Count -gt 0)) -and + ([DateTime]::UtcNow - $stableSince).TotalSeconds -ge 2) { $settled = $true; break } + Start-Sleep -Milliseconds 250 + } while ([DateTime]::UtcNow -lt $deadline) + if (-not $settled -or ($ExpectedPages -ge 0 -and $pages.Count -ne $ExpectedPages) -or ($ExpectedPages -lt 0 -and $pages.Count -eq 0)) { + [IO.File]::WriteAllText((Join-Path $output 'previous-signature.txt'), $lastChange, [Text.Encoding]::UTF8) + $index = 0 + foreach ($id in @($pages.Keys | Sort-Object)) { + [IO.File]::WriteAllText((Join-Path $output ('unsettled-{0:d3}.xml' -f $index)), $pages[$id], [Text.Encoding]::UTF8) + $index++ + } + $hierarchy = '' + $app.GetHierarchy($notebookId, 4, [ref]$hierarchy, 1) + [IO.File]::WriteAllText((Join-Path $output 'unsettled-hierarchy.xml'), $hierarchy, [Text.Encoding]::UTF8) + throw "Expected $ExpectedPages stable pages; OneNote returned $($pages.Count), settled=$settled." + } + $index = 0 + $payloads = @() + foreach ($id in @($pages.Keys | Sort-Object)) { + [IO.File]::WriteAllText((Join-Path $output ('page-{0:d3}.xml' -f $index)), $pages[$id], [Text.Encoding]::UTF8) + if ($Pdf) { + $pdfPath = Join-Path $output ('page-{0:d3}.pdf' -f $index) + $app.NavigateTo($id, '', $false) + $app.Publish($id, $pdfPath, 3, '') + if (-not (Test-Path $pdfPath) -or (Get-Item $pdfPath).Length -eq 0) { throw 'OneNote did not publish the page PDF.' } + } + [xml]$page = $pages[$id] + foreach ($file in $page.SelectNodes('//*[local-name()="InsertedFile" or local-name()="MediaFile"]')) { + $bytes = [IO.File]::ReadAllBytes($file.GetAttribute('pathCache')) + $hash = [BitConverter]::ToString([Security.Cryptography.SHA256]::Create().ComputeHash($bytes)).Replace('-', '').ToLowerInvariant() + [IO.File]::WriteAllBytes((Join-Path $output ($hash + '.attachment')), $bytes) + $payloads += @{ page = $id; object = $file.ParentNode.GetAttribute('objectID'); + kind = $file.LocalName; name = $file.GetAttribute('preferredName'); + sha256 = $hash; bytes = $bytes.Length } + } + $index++ + } + [IO.File]::WriteAllText((Join-Path $output 'payloads.json'), (ConvertTo-Json -InputObject $payloads -Depth 4), [Text.Encoding]::UTF8) + $all = '' + $app.GetHierarchy($notebookId, 4, [ref]$all, 1) + [xml]$finalTree = $all + $finalIds = @($finalTree.SelectNodes('//*[local-name()="Page"]') | ForEach-Object { $_.GetAttribute('ID') } | Sort-Object -Unique) + if ($finalIds.Count -ne $pages.Count -or @($finalIds | Where-Object { -not $pages.ContainsKey($_) }).Count -ne 0) { + throw 'The notebook hierarchy changed while collecting page evidence; repeat the cold read.' + } + [IO.File]::WriteAllText((Join-Path $output 'hierarchy.xml'), $all, [Text.Encoding]::UTF8) + Write-Output "Read $($sections.Count) sections and $($pages.Count) pages." +} catch { + $failure = $_ + [IO.File]::WriteAllText((Join-Path $output 'failure.txt'), ($_ | Out-String), [Text.Encoding]::UTF8) + throw +} finally { + try { + try { + if ($notebookId -and $CloneHost) { $app.SyncHierarchy($notebookId) } + if ($notebookId -and -not $KeepOpen -and (-not $UseCurrentCache -or $CloneHost)) { + $app.CloseNotebook($notebookId, $false) + } + } catch { + if ($null -eq $failure) { throw } + [IO.File]::WriteAllText((Join-Path $output 'cleanup-failure.txt'), ($_ | Out-String), [Text.Encoding]::UTF8) + } + } finally { + [void][Runtime.InteropServices.Marshal]::FinalReleaseComObject($app) + } + $app = $null + [GC]::Collect() + [GC]::WaitForPendingFinalizers() + if (-not $UseCurrentCache -and -not $CloneHost) { + Get-Process ONENOTE -ErrorAction SilentlyContinue | Wait-Process -Timeout 10 + } +} diff --git a/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/source.json b/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/source.json new file mode 100644 index 0000000000000000000000000000000000000000..affe4743f3cebe62b5d2c6b4f801871a29f0ecbd --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/source.json @@ -0,0 +1,8 @@ +[ + { + "path": "Lifecycle.one", + "bytes": 62680, + "sha256": "fc93aa64ff966e2f5557bac1e38c0768df378ee5865c0e527d672c6f31c76761", + "mtime_ns": 1789121641216798594 + } +] diff --git a/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/teardown.json b/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/teardown.json new file mode 100644 index 0000000000000000000000000000000000000000..05a47793de40f322e745c4c4183727e3590ecf70 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-02-promoted-parent/cold/teardown.json @@ -0,0 +1 @@ +{"absent": true} diff --git a/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/candidate/Lifecycle.one b/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/candidate/Lifecycle.one index b1b6616758663f23e9fb4116d4805be487ed04db..05515ba8f0616599798a4445c4f601e588bd1556 100644 Binary files a/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/candidate/Lifecycle.one and b/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/candidate/Lifecycle.one differ diff --git a/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/candidate/manifest.json b/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/candidate/manifest.json index e36b124cd8e575ee4180e7251be41e0b79682ea2..e268b4c10e075d23f4b908eb99b797b1c715a749 100644 --- a/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/candidate/manifest.json +++ b/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/candidate/manifest.json @@ -5,55 +5,55 @@ "original": [ { "guid": [ - 125, - 53, - 145, - 2, - 3, - 127, - 82, - 64, + 110, + 69, + 66, + 99, 167, - 187, - 251, - 62, - 162, - 162, - 161, - 216 + 190, + 20, + 72, + 155, + 148, + 109, + 0, + 93, + 84, + 216, + 44 ], "level": 3, "position": "Keep", "space": "{D7B1788B-A971-08DE-3324-F4DF82A3B46E},1" } ], - "page_receipt": "Some(Published { revision: ExGuid { guid: [79, 36, 83, 146, 51, 185, 231, 72, 147, 254, 0, 180, 206, 5, 30, 79], n: 1 } })", + "page_receipt": "Some(Published { revision: ExGuid { guid: [206, 245, 52, 158, 165, 94, 95, 72, 151, 84, 33, 16, 146, 78, 218, 136], n: 1 } })", "phase": "03-selected-group-move", "publications": 2, "reviewed": [ { "guid": [ - 125, - 53, - 145, - 2, - 3, - 127, - 82, - 64, + 110, + 69, + 66, + 99, 167, - 187, - 251, - 62, - 162, - 162, - 161, - 216 + 190, + 20, + 72, + 155, + 148, + 109, + 0, + 93, + 84, + 216, + 44 ], "level": 3, "position": "Keep", "space": "{D7B1788B-A971-08DE-3324-F4DF82A3B46E},1" } ], - "text_receipt": "Some(Published { revision: ExGuid { guid: [21, 35, 82, 67, 204, 139, 55, 78, 156, 40, 98, 53, 158, 180, 33, 141], n: 1 } })" + "text_receipt": "Some(Published { revision: ExGuid { guid: [139, 13, 130, 183, 108, 34, 87, 74, 131, 7, 187, 88, 129, 170, 226, 238], n: 1 } })" } \ No newline at end of file diff --git a/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/commands.jsonl b/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/commands.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..4a190f31b5109be6c6e81da187edefdf59c5a005 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/commands.jsonl @@ -0,0 +1,3 @@ +{"command": "powershell -NoProfile -Command \"Expand-Archive -LiteralPath C:\\one-tests\\transfer.zip -DestinationPath C:\\one-tests\\runs\\capture\\notebook\"", "exit": 0, "stdout": "", "stderr": "", "error": null} +{"command": "powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -File C:\\one-tests\\read-current.ps1 -Root C:\\one-tests\\runs\\capture -CloneHost ONE-M6-A3820EBF -ExpectedPages 9", "exit": 0, "stdout": "Read 1 sections and 9 pages.\r\n", "stderr": "", "error": null} +{"command": "powershell -NoProfile -Command \"Compress-Archive -Force -Path C:\\one-tests\\runs\\capture\\* -DestinationPath C:\\one-tests\\captured.zip\"", "exit": 0, "stdout": "", "stderr": "", "error": null} diff --git a/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/machine.json b/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/machine.json new file mode 100644 index 0000000000000000000000000000000000000000..181c2cf675f0a650aaae6b3b9ca684a6e8a21d19 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/machine.json @@ -0,0 +1 @@ +{"name": "m6-a3820ebf", "hostname": "ONE-M6-A3820EBF"} diff --git a/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/notebook/Lifecycle.one b/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/notebook/Lifecycle.one index d309acb210c66b940bfa64925c20e41b3e04663b..0b8ece35c4178a83203eec2e118d453c2c237d56 100644 Binary files a/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/notebook/Lifecycle.one and b/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/notebook/Lifecycle.one differ diff --git a/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/notebook/Open Notebook.onetoc2 b/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/notebook/Open Notebook.onetoc2 new file mode 100644 index 0000000000000000000000000000000000000000..72bfd612f1f572806763534cf923a6751b5dd03a Binary files /dev/null and b/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/notebook/Open Notebook.onetoc2 differ diff --git a/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/read/environment.json b/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/read/environment.json new file mode 100644 index 0000000000000000000000000000000000000000..faecd82d4628a453efadab3774f03fef19773fe1 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/read/environment.json @@ -0,0 +1,7 @@ +{ + "powershell": "5.1.14409.1005", + "schema": "xs2010", + "hostname": "ONE-M6-A3820EBF", + "cold": true, + "onenote": "14.0.4763.1000" +} diff --git a/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/read/hierarchy.xml b/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/read/hierarchy.xml index d522da966bcf290ef753f3dcbdf7186bc9a28316..d6263e603808665424a6644790724d3e85cdbb28 100644 --- a/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/read/hierarchy.xml +++ b/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/read/hierarchy.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/read/page-000.xml b/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/read/page-000.xml index c030175bbc038081b6ea818f014aca3f8d9f156c..d1a5e6a031f1d8f772248be0c72b698f0dde35cd 100644 --- a/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/read/page-000.xml +++ b/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/read/page-000.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/read/page-001.xml b/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/read/page-001.xml index 7daf73932bd87a60fd90402221f605519f7244ca..b90875f84c14fd2ee71a8290a5f1a90565e65d8c 100644 --- a/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/read/page-001.xml +++ b/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/read/page-001.xml @@ -1,4 +1,4 @@  -Offline Body parent 🦀 éBody grandchild 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/read/page-002.xml b/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/read/page-002.xml index 6e63b04c776b24eedd2c660266f2f6c15f345bda..a71dbde1c546424d1367f9d0e4fbb5b0086cc579 100644 --- a/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/read/page-002.xml +++ b/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/read/page-002.xml @@ -1,4 +1,4 @@  -Body grandchild 🦀 éOffline Body parent 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/read/page-003.xml b/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/read/page-003.xml index 0780350d99c7ddde66c3446517938fe7e3bbfc9c..0aa42bffe8f3295a71e9961fe06629cd533e4557 100644 --- a/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/read/page-003.xml +++ b/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/read/page-003.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/read/page-004.xml b/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/read/page-004.xml index a3f6da4a755147788360c3d0b49eb5910cd6b332..cfb18eeb2d452181d8f47999e9013a137a0f15e5 100644 --- a/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/read/page-004.xml +++ b/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/read/page-004.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/read/page-005.xml b/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/read/page-005.xml index 3f614e3eb7325b575bdf701553383f40d1ef916f..e7190e87d6fb2f43b7f88776477183c6b4128f3b 100644 --- a/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/read/page-005.xml +++ b/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/read/page-005.xml @@ -1,4 +1,4 @@  -Body child 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/read/page-006.xml b/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/read/page-006.xml index d31cc414ec99bcd8020c0458b55ad22e06016398..5cdfe59e70abd38080d4f6634d906a4a3864a5a8 100644 --- a/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/read/page-006.xml +++ b/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/read/page-006.xml @@ -1,4 +1,4 @@  -Body trailing 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/read/page-007.xml b/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/read/page-007.xml index 5f36954144d5fab9d197d825932dab04d7a7e851..67bbb03857f22a81e37cecb3bf331783d8da821f 100644 --- a/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/read/page-007.xml +++ b/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/read/page-007.xml @@ -1,4 +1,4 @@  -Body automatic 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/read/page-008.xml b/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/read/page-008.xml index 0666a6d29a3ea3e0c2c5a40088879ed3e79b186c..eecc121c44bb60f2a78e1e8ea4fe914a79c24810 100644 --- a/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/read/page-008.xml +++ b/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/read/page-008.xml @@ -1,4 +1,4 @@  -Body duplicate 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/read/payloads.json b/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/read/payloads.json new file mode 100644 index 0000000000000000000000000000000000000000..1ce91a413d6fff4d58765187b76756f0e97ae843 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/read/payloads.json @@ -0,0 +1,3 @@ +[ + +] \ No newline at end of file diff --git a/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/run.json b/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/run.json new file mode 100644 index 0000000000000000000000000000000000000000..bb4cb6bc9c49d26acb4f43f8cc8a69231c0519ca --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/run.json @@ -0,0 +1,18 @@ +{ + "notebook": "/private/var/folders/90/4f4rngds01j55ggdj_vglk_c0000gn/T/tmp41s5b9uu", + "expected_pages": 9, + "author": null, + "author_timeout_seconds": 600, + "inspect": false, + "collect_notebook": true, + "base": { + "file": "win7-office-base.qcow2", + "format": "qcow2", + "sha256": "a1a4f8fab782ee14885ff801ca2f6347c208fdcfc3513637096f314315c89346", + "virtual_size": 68719476736 + }, + "scripts": { + "cold.ps1": "c177fc72ae6c2634d186f5671a880de20b09f9716532c37c69cb13aa15c7e331", + "read.ps1": "04013bfcccee40a17e2a225f9b9e96f40a3a8daad9e350609654f8eda3ccbb41" + } +} diff --git a/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/scripts/cold.ps1 b/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/scripts/cold.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..a0b99e7aeb86f4dc10032537800501a52ad65b4f --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/scripts/cold.ps1 @@ -0,0 +1,27 @@ +param([Parameter(Mandatory=$true)][string]$Root, [string]$CloneHost = '') +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' +$root = [IO.Path]::GetFullPath($Root).TrimEnd('\') +if ([IO.Path]::GetDirectoryName($root) -ne 'C:\one-tests\runs') { + throw 'Choose a run directly below C:\one-tests\runs.' +} +if (Get-Process ONENOTE -ErrorAction SilentlyContinue) { throw 'Close OneNote before resetting its test cache.' } +$key = 'HKCU:\Software\Microsoft\Office\14.0\OneNote' +if ($CloneHost) { + if ($CloneHost -notmatch '^ONE-[A-Z0-9-]+$' -or [Environment]::MachineName -ne $CloneHost) { + throw 'The disposable clone hostname does not match this machine.' + } + New-Item "$key\Options\Paths" -Force | Out-Null + New-ItemProperty "$key\Options\Paths" -Name UnfiledNotesSection -PropertyType ExpandString -Value 'C:\one-tests\Loose.one' -Force | Out-Null +} elseif ((Get-ItemProperty "$key\Options\Paths").UnfiledNotesSection -ne 'C:\one-tests\Loose.one' -or + -not (Test-Path 'C:\one-tests\profile-original-cache')) { + throw 'Park the personal OneNote profile before resetting the test cache.' +} +$cache = Join-Path $env:LOCALAPPDATA 'Microsoft\OneNote\14.0' +$parked = Join-Path 'C:\one-tests\caches' ([IO.Path]::GetFileName($root)) +if (Test-Path $parked) { throw 'Choose a new run; its parked cache already exists.' } +New-Item -ItemType Directory -Path 'C:\one-tests\caches' -Force | Out-Null +if (Test-Path $cache) { Move-Item -LiteralPath $cache -Destination $parked } +if (Test-Path "$key\OpenNotebooks") { Remove-Item "$key\OpenNotebooks" -Recurse } +New-Item "$key\OpenNotebooks" | Out-Null +New-ItemProperty "$key\OpenNotebooks" -Name '1' -PropertyType String -Value "$root\notebook" | Out-Null diff --git a/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/scripts/read.ps1 b/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/scripts/read.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..476094ab1e0c47077988a6461db2080cf208642b --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/scripts/read.ps1 @@ -0,0 +1,142 @@ +param( + [Parameter(Mandatory=$true)][string]$Root, + [int]$ExpectedPages = -1, + [switch]$UseCurrentCache, + [switch]$Pdf, + [switch]$KeepOpen, + [string]$CloneHost = '' +) +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' +$root = [IO.Path]::GetFullPath($Root).TrimEnd('\') +if ([IO.Path]::GetDirectoryName($root) -ne 'C:\one-tests\runs') { + throw 'Choose a run directly below C:\one-tests\runs.' +} +$notebook = Join-Path $root 'notebook' +$output = Join-Path $root 'read' +if (Test-Path $output) { throw 'Choose a new read destination.' } +if ($UseCurrentCache) { + if ((Get-ItemProperty 'HKCU:\Software\Microsoft\Office\14.0\OneNote\Options\Paths').UnfiledNotesSection -ne 'C:\one-tests\Loose.one') { + throw 'Park the personal OneNote profile before reading test notebooks.' + } +} else { + & "$PSScriptRoot\cold-current.ps1" -Root $root -CloneHost $CloneHost +} +New-Item -ItemType Directory -Path $output | Out-Null +$app = New-Object -ComObject OneNote.Application +$notebookId = '' +$failure = $null +try { + $app.OpenHierarchy($notebook, '', [ref]$notebookId, 0) + $process = Get-Process ONENOTE + @{ hostname = [Environment]::MachineName; onenote = $process.MainModule.FileVersionInfo.FileVersion; + powershell = $PSVersionTable.PSVersion.ToString(); schema = 'xs2010'; cold = (-not $UseCurrentCache.IsPresent) } | + ConvertTo-Json | Set-Content (Join-Path $output 'environment.json') -Encoding UTF8 + $sections = @() + foreach ($file in @(Get-ChildItem $notebook -Recurse | Where-Object { $_.Extension -eq '.one' })) { + $id = '' + $app.OpenHierarchy($file.FullName, '', [ref]$id, 0) + $sections += $id + } + $deadline = [DateTime]::UtcNow.AddSeconds(300) + $previous = '' + $lastChange = '' + $stableSince = [DateTime]::UtcNow + $settled = $false + do { + $pages = @{} + foreach ($section in $sections) { + $hierarchy = '' + $app.GetHierarchy($section, 4, [ref]$hierarchy, 1) + [xml]$xml = $hierarchy + foreach ($node in $xml.SelectNodes('//*[@path]')) { + if (-not $node.GetAttribute('path').StartsWith("$notebook\", [StringComparison]::OrdinalIgnoreCase)) { + throw 'OneNote opened a section outside the copied notebook.' + } + } + foreach ($node in $xml.SelectNodes('//*[local-name()="Page"]')) { + $id = $node.GetAttribute('ID') + $content = '' + $app.GetPageContent($id, [ref]$content, 1, 1) + $pages[$id] = $content + } + } + $signature = [String]::Join('|', @($pages.Keys | Sort-Object | ForEach-Object { $_ + $pages[$_] })) + if ($signature -ne $previous) { + $lastChange = $previous + $previous = $signature + $stableSince = [DateTime]::UtcNow + } + if ((($ExpectedPages -ge 0 -and $pages.Count -eq $ExpectedPages) -or + ($ExpectedPages -lt 0 -and $pages.Count -gt 0)) -and + ([DateTime]::UtcNow - $stableSince).TotalSeconds -ge 2) { $settled = $true; break } + Start-Sleep -Milliseconds 250 + } while ([DateTime]::UtcNow -lt $deadline) + if (-not $settled -or ($ExpectedPages -ge 0 -and $pages.Count -ne $ExpectedPages) -or ($ExpectedPages -lt 0 -and $pages.Count -eq 0)) { + [IO.File]::WriteAllText((Join-Path $output 'previous-signature.txt'), $lastChange, [Text.Encoding]::UTF8) + $index = 0 + foreach ($id in @($pages.Keys | Sort-Object)) { + [IO.File]::WriteAllText((Join-Path $output ('unsettled-{0:d3}.xml' -f $index)), $pages[$id], [Text.Encoding]::UTF8) + $index++ + } + $hierarchy = '' + $app.GetHierarchy($notebookId, 4, [ref]$hierarchy, 1) + [IO.File]::WriteAllText((Join-Path $output 'unsettled-hierarchy.xml'), $hierarchy, [Text.Encoding]::UTF8) + throw "Expected $ExpectedPages stable pages; OneNote returned $($pages.Count), settled=$settled." + } + $index = 0 + $payloads = @() + foreach ($id in @($pages.Keys | Sort-Object)) { + [IO.File]::WriteAllText((Join-Path $output ('page-{0:d3}.xml' -f $index)), $pages[$id], [Text.Encoding]::UTF8) + if ($Pdf) { + $pdfPath = Join-Path $output ('page-{0:d3}.pdf' -f $index) + $app.NavigateTo($id, '', $false) + $app.Publish($id, $pdfPath, 3, '') + if (-not (Test-Path $pdfPath) -or (Get-Item $pdfPath).Length -eq 0) { throw 'OneNote did not publish the page PDF.' } + } + [xml]$page = $pages[$id] + foreach ($file in $page.SelectNodes('//*[local-name()="InsertedFile" or local-name()="MediaFile"]')) { + $bytes = [IO.File]::ReadAllBytes($file.GetAttribute('pathCache')) + $hash = [BitConverter]::ToString([Security.Cryptography.SHA256]::Create().ComputeHash($bytes)).Replace('-', '').ToLowerInvariant() + [IO.File]::WriteAllBytes((Join-Path $output ($hash + '.attachment')), $bytes) + $payloads += @{ page = $id; object = $file.ParentNode.GetAttribute('objectID'); + kind = $file.LocalName; name = $file.GetAttribute('preferredName'); + sha256 = $hash; bytes = $bytes.Length } + } + $index++ + } + [IO.File]::WriteAllText((Join-Path $output 'payloads.json'), (ConvertTo-Json -InputObject $payloads -Depth 4), [Text.Encoding]::UTF8) + $all = '' + $app.GetHierarchy($notebookId, 4, [ref]$all, 1) + [xml]$finalTree = $all + $finalIds = @($finalTree.SelectNodes('//*[local-name()="Page"]') | ForEach-Object { $_.GetAttribute('ID') } | Sort-Object -Unique) + if ($finalIds.Count -ne $pages.Count -or @($finalIds | Where-Object { -not $pages.ContainsKey($_) }).Count -ne 0) { + throw 'The notebook hierarchy changed while collecting page evidence; repeat the cold read.' + } + [IO.File]::WriteAllText((Join-Path $output 'hierarchy.xml'), $all, [Text.Encoding]::UTF8) + Write-Output "Read $($sections.Count) sections and $($pages.Count) pages." +} catch { + $failure = $_ + [IO.File]::WriteAllText((Join-Path $output 'failure.txt'), ($_ | Out-String), [Text.Encoding]::UTF8) + throw +} finally { + try { + try { + if ($notebookId -and $CloneHost) { $app.SyncHierarchy($notebookId) } + if ($notebookId -and -not $KeepOpen -and (-not $UseCurrentCache -or $CloneHost)) { + $app.CloseNotebook($notebookId, $false) + } + } catch { + if ($null -eq $failure) { throw } + [IO.File]::WriteAllText((Join-Path $output 'cleanup-failure.txt'), ($_ | Out-String), [Text.Encoding]::UTF8) + } + } finally { + [void][Runtime.InteropServices.Marshal]::FinalReleaseComObject($app) + } + $app = $null + [GC]::Collect() + [GC]::WaitForPendingFinalizers() + if (-not $UseCurrentCache -and -not $CloneHost) { + Get-Process ONENOTE -ErrorAction SilentlyContinue | Wait-Process -Timeout 10 + } +} diff --git a/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/source.json b/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/source.json new file mode 100644 index 0000000000000000000000000000000000000000..acd1861a1dfc67bc6200df9bb30a9732a1165bb7 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/source.json @@ -0,0 +1,8 @@ +[ + { + "path": "Lifecycle.one", + "bytes": 63752, + "sha256": "93548ad527574f6a19f2288b751746754bf78037b8229e5408aa1af8d5e4f94b", + "mtime_ns": 1789121641556517733 + } +] diff --git a/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/teardown.json b/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/teardown.json new file mode 100644 index 0000000000000000000000000000000000000000..05a47793de40f322e745c4c4183727e3590ecf70 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-03-selected-group-move/cold/teardown.json @@ -0,0 +1 @@ +{"absent": true} diff --git a/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/candidate/Lifecycle.one b/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/candidate/Lifecycle.one index 291421f083d3c89243c6ab3ed2d0f8e63a20d540..20478543a6c716a651d882f4d965a51c54811cf8 100644 Binary files a/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/candidate/Lifecycle.one and b/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/candidate/Lifecycle.one differ diff --git a/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/candidate/manifest.json b/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/candidate/manifest.json index d027db681b5abb182f96ccef427149401b8b9313..421237c90fb18961f00c4b3638fe44dff244b6fa 100644 --- a/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/candidate/manifest.json +++ b/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/candidate/manifest.json @@ -5,55 +5,55 @@ "original": [ { "guid": [ - 212, - 44, - 63, - 182, - 28, - 209, - 154, + 189, + 114, + 192, + 69, + 26, + 116, + 205, 72, - 154, - 49, - 110, - 172, - 24, - 52, - 11, - 197 + 173, + 213, + 46, + 56, + 71, + 151, + 228, + 150 ], "level": 3, "position": "Keep", "space": "{D7B1788B-A971-08DE-3324-F4DF82A3B46E},1" } ], - "page_receipt": "Some(Published { revision: ExGuid { guid: [8, 34, 143, 21, 222, 135, 177, 65, 143, 221, 51, 237, 136, 193, 187, 9], n: 1 } })", + "page_receipt": "Some(Published { revision: ExGuid { guid: [60, 217, 21, 216, 221, 92, 209, 67, 132, 47, 149, 197, 45, 203, 43, 15], n: 1 } })", "phase": "04-subpage-move", "publications": 2, "reviewed": [ { "guid": [ - 212, - 44, - 63, - 182, - 28, - 209, - 154, + 189, + 114, + 192, + 69, + 26, + 116, + 205, 72, - 154, - 49, - 110, - 172, - 24, - 52, - 11, - 197 + 173, + 213, + 46, + 56, + 71, + 151, + 228, + 150 ], "level": 3, "position": "Keep", "space": "{D7B1788B-A971-08DE-3324-F4DF82A3B46E},1" } ], - "text_receipt": "Some(Published { revision: ExGuid { guid: [80, 133, 66, 122, 158, 20, 64, 73, 176, 64, 170, 48, 196, 195, 216, 191], n: 1 } })" + "text_receipt": "Some(Published { revision: ExGuid { guid: [6, 84, 147, 153, 131, 45, 249, 72, 187, 81, 221, 9, 239, 29, 12, 182], n: 1 } })" } \ No newline at end of file diff --git a/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/commands.jsonl b/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/commands.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..f418228be6d47c01bda6e8ae35b94450ba8db6f4 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/commands.jsonl @@ -0,0 +1,3 @@ +{"command": "powershell -NoProfile -Command \"Expand-Archive -LiteralPath C:\\one-tests\\transfer.zip -DestinationPath C:\\one-tests\\runs\\capture\\notebook\"", "exit": 0, "stdout": "", "stderr": "", "error": null} +{"command": "powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -File C:\\one-tests\\read-current.ps1 -Root C:\\one-tests\\runs\\capture -CloneHost ONE-M6-32450AD0 -ExpectedPages 9", "exit": 0, "stdout": "Read 1 sections and 9 pages.\r\n", "stderr": "", "error": null} +{"command": "powershell -NoProfile -Command \"Compress-Archive -Force -Path C:\\one-tests\\runs\\capture\\* -DestinationPath C:\\one-tests\\captured.zip\"", "exit": 0, "stdout": "", "stderr": "", "error": null} diff --git a/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/machine.json b/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/machine.json new file mode 100644 index 0000000000000000000000000000000000000000..ce1ac8eb277df7135c878e02bdee8332e8f12bb7 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/machine.json @@ -0,0 +1 @@ +{"name": "m6-32450ad0", "hostname": "ONE-M6-32450AD0"} diff --git a/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/notebook/Lifecycle.one b/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/notebook/Lifecycle.one index 07a380363ee63a89b3498e20e0f81e45afcddc66..fdf99cb19594e7af408c0ae1abcd25ac01cde97b 100644 Binary files a/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/notebook/Lifecycle.one and b/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/notebook/Lifecycle.one differ diff --git a/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/notebook/Open Notebook.onetoc2 b/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/notebook/Open Notebook.onetoc2 new file mode 100644 index 0000000000000000000000000000000000000000..77514a32838795c349359e8555057fc9b010b1ea Binary files /dev/null and b/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/notebook/Open Notebook.onetoc2 differ diff --git a/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/read/environment.json b/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/read/environment.json new file mode 100644 index 0000000000000000000000000000000000000000..b7ece341eed0cd7440fb65fc2a1f9d42a139b19c --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/read/environment.json @@ -0,0 +1,7 @@ +{ + "powershell": "5.1.14409.1005", + "schema": "xs2010", + "hostname": "ONE-M6-32450AD0", + "cold": true, + "onenote": "14.0.4763.1000" +} diff --git a/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/read/hierarchy.xml b/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/read/hierarchy.xml index 86f30bb2f3d06cbf0dc09e0079cca4fa480ed607..aca1e1dd935976613e81e234d8291044312e333b 100644 --- a/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/read/hierarchy.xml +++ b/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/read/hierarchy.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/read/page-000.xml b/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/read/page-000.xml index ac51c79601f9b0ca5e666ba1f3df86ef85da19e3..3905cdd44fe78eabbeb92e72556bec219f408175 100644 --- a/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/read/page-000.xml +++ b/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/read/page-000.xml @@ -1,2 +1,4 @@  - +Body trailing 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/read/page-001.xml b/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/read/page-001.xml index 5e90fdfe9ae67add82c8757e364c83c126d154ec..1f6dc3503ecde60c37b6a60eb0c4b9c5e3bf1c00 100644 --- a/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/read/page-001.xml +++ b/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/read/page-001.xml @@ -1,4 +1,4 @@  -Body child 🦀 éBody automatic 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/read/page-002.xml b/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/read/page-002.xml index f86c556d436c5b97f60f62c5af905eb1ce34dfe1..db53db58906eab4bbd57388c944156a3d965c2b4 100644 --- a/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/read/page-002.xml +++ b/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/read/page-002.xml @@ -1,2 +1,4 @@  - +Body duplicate 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/read/page-003.xml b/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/read/page-003.xml index fbf05a32f682574e0765f7bed6ef6c5c59e791b8..3b55585734977e57ba4d5f3afd657c371bbdd6c2 100644 --- a/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/read/page-003.xml +++ b/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/read/page-003.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/read/page-004.xml b/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/read/page-004.xml index c335371bc9781e1778f7c9b43ce6817aa5a1e52d..b2c45102f72813296a353b3e0a547bfd731661c1 100644 --- a/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/read/page-004.xml +++ b/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/read/page-004.xml @@ -1,4 +1,4 @@  -Offline Body parent 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/read/page-005.xml b/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/read/page-005.xml index cf0bc30aedaa4705c27e598cd3972b7efba5fd8b..41bf81832bd49d0be62a36459fd76fea5bc84088 100644 --- a/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/read/page-005.xml +++ b/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/read/page-005.xml @@ -1,4 +1,4 @@  -Body grandchild 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/read/page-006.xml b/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/read/page-006.xml index ec651536ff45de4fe84ae556d7d79d52fd50e503..e359892258fef917981202f12fd6627d231dd27f 100644 --- a/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/read/page-006.xml +++ b/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/read/page-006.xml @@ -1,4 +1,2 @@  -Body duplicate 🦀 é preserved]]> + diff --git a/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/read/page-007.xml b/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/read/page-007.xml index 2309a54cf2af5e57de49cf7030e631446a13f490..a1b991b5a129d0742a12d654d6d1d0f087d978ba 100644 --- a/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/read/page-007.xml +++ b/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/read/page-007.xml @@ -1,4 +1,2 @@  -Body automatic 🦀 é preserved]]> + diff --git a/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/read/page-008.xml b/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/read/page-008.xml index db97e3f0c35ee2f348dec1f5ef48c79fb8fe87fe..8c0c00a181c8cc8342f95f4ccfec3153111b77f7 100644 --- a/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/read/page-008.xml +++ b/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/read/page-008.xml @@ -1,4 +1,4 @@  -Body trailing 🦀 éBody child 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/read/payloads.json b/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/read/payloads.json new file mode 100644 index 0000000000000000000000000000000000000000..1ce91a413d6fff4d58765187b76756f0e97ae843 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/read/payloads.json @@ -0,0 +1,3 @@ +[ + +] \ No newline at end of file diff --git a/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/run.json b/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/run.json new file mode 100644 index 0000000000000000000000000000000000000000..67eaf5644230589a5e31e64f029aff3fb12b51fb --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/run.json @@ -0,0 +1,18 @@ +{ + "notebook": "/private/var/folders/90/4f4rngds01j55ggdj_vglk_c0000gn/T/tmpz1pbk0ta", + "expected_pages": 9, + "author": null, + "author_timeout_seconds": 600, + "inspect": false, + "collect_notebook": true, + "base": { + "file": "win7-office-base.qcow2", + "format": "qcow2", + "sha256": "a1a4f8fab782ee14885ff801ca2f6347c208fdcfc3513637096f314315c89346", + "virtual_size": 68719476736 + }, + "scripts": { + "cold.ps1": "c177fc72ae6c2634d186f5671a880de20b09f9716532c37c69cb13aa15c7e331", + "read.ps1": "04013bfcccee40a17e2a225f9b9e96f40a3a8daad9e350609654f8eda3ccbb41" + } +} diff --git a/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/scripts/cold.ps1 b/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/scripts/cold.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..a0b99e7aeb86f4dc10032537800501a52ad65b4f --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/scripts/cold.ps1 @@ -0,0 +1,27 @@ +param([Parameter(Mandatory=$true)][string]$Root, [string]$CloneHost = '') +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' +$root = [IO.Path]::GetFullPath($Root).TrimEnd('\') +if ([IO.Path]::GetDirectoryName($root) -ne 'C:\one-tests\runs') { + throw 'Choose a run directly below C:\one-tests\runs.' +} +if (Get-Process ONENOTE -ErrorAction SilentlyContinue) { throw 'Close OneNote before resetting its test cache.' } +$key = 'HKCU:\Software\Microsoft\Office\14.0\OneNote' +if ($CloneHost) { + if ($CloneHost -notmatch '^ONE-[A-Z0-9-]+$' -or [Environment]::MachineName -ne $CloneHost) { + throw 'The disposable clone hostname does not match this machine.' + } + New-Item "$key\Options\Paths" -Force | Out-Null + New-ItemProperty "$key\Options\Paths" -Name UnfiledNotesSection -PropertyType ExpandString -Value 'C:\one-tests\Loose.one' -Force | Out-Null +} elseif ((Get-ItemProperty "$key\Options\Paths").UnfiledNotesSection -ne 'C:\one-tests\Loose.one' -or + -not (Test-Path 'C:\one-tests\profile-original-cache')) { + throw 'Park the personal OneNote profile before resetting the test cache.' +} +$cache = Join-Path $env:LOCALAPPDATA 'Microsoft\OneNote\14.0' +$parked = Join-Path 'C:\one-tests\caches' ([IO.Path]::GetFileName($root)) +if (Test-Path $parked) { throw 'Choose a new run; its parked cache already exists.' } +New-Item -ItemType Directory -Path 'C:\one-tests\caches' -Force | Out-Null +if (Test-Path $cache) { Move-Item -LiteralPath $cache -Destination $parked } +if (Test-Path "$key\OpenNotebooks") { Remove-Item "$key\OpenNotebooks" -Recurse } +New-Item "$key\OpenNotebooks" | Out-Null +New-ItemProperty "$key\OpenNotebooks" -Name '1' -PropertyType String -Value "$root\notebook" | Out-Null diff --git a/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/scripts/read.ps1 b/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/scripts/read.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..476094ab1e0c47077988a6461db2080cf208642b --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/scripts/read.ps1 @@ -0,0 +1,142 @@ +param( + [Parameter(Mandatory=$true)][string]$Root, + [int]$ExpectedPages = -1, + [switch]$UseCurrentCache, + [switch]$Pdf, + [switch]$KeepOpen, + [string]$CloneHost = '' +) +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' +$root = [IO.Path]::GetFullPath($Root).TrimEnd('\') +if ([IO.Path]::GetDirectoryName($root) -ne 'C:\one-tests\runs') { + throw 'Choose a run directly below C:\one-tests\runs.' +} +$notebook = Join-Path $root 'notebook' +$output = Join-Path $root 'read' +if (Test-Path $output) { throw 'Choose a new read destination.' } +if ($UseCurrentCache) { + if ((Get-ItemProperty 'HKCU:\Software\Microsoft\Office\14.0\OneNote\Options\Paths').UnfiledNotesSection -ne 'C:\one-tests\Loose.one') { + throw 'Park the personal OneNote profile before reading test notebooks.' + } +} else { + & "$PSScriptRoot\cold-current.ps1" -Root $root -CloneHost $CloneHost +} +New-Item -ItemType Directory -Path $output | Out-Null +$app = New-Object -ComObject OneNote.Application +$notebookId = '' +$failure = $null +try { + $app.OpenHierarchy($notebook, '', [ref]$notebookId, 0) + $process = Get-Process ONENOTE + @{ hostname = [Environment]::MachineName; onenote = $process.MainModule.FileVersionInfo.FileVersion; + powershell = $PSVersionTable.PSVersion.ToString(); schema = 'xs2010'; cold = (-not $UseCurrentCache.IsPresent) } | + ConvertTo-Json | Set-Content (Join-Path $output 'environment.json') -Encoding UTF8 + $sections = @() + foreach ($file in @(Get-ChildItem $notebook -Recurse | Where-Object { $_.Extension -eq '.one' })) { + $id = '' + $app.OpenHierarchy($file.FullName, '', [ref]$id, 0) + $sections += $id + } + $deadline = [DateTime]::UtcNow.AddSeconds(300) + $previous = '' + $lastChange = '' + $stableSince = [DateTime]::UtcNow + $settled = $false + do { + $pages = @{} + foreach ($section in $sections) { + $hierarchy = '' + $app.GetHierarchy($section, 4, [ref]$hierarchy, 1) + [xml]$xml = $hierarchy + foreach ($node in $xml.SelectNodes('//*[@path]')) { + if (-not $node.GetAttribute('path').StartsWith("$notebook\", [StringComparison]::OrdinalIgnoreCase)) { + throw 'OneNote opened a section outside the copied notebook.' + } + } + foreach ($node in $xml.SelectNodes('//*[local-name()="Page"]')) { + $id = $node.GetAttribute('ID') + $content = '' + $app.GetPageContent($id, [ref]$content, 1, 1) + $pages[$id] = $content + } + } + $signature = [String]::Join('|', @($pages.Keys | Sort-Object | ForEach-Object { $_ + $pages[$_] })) + if ($signature -ne $previous) { + $lastChange = $previous + $previous = $signature + $stableSince = [DateTime]::UtcNow + } + if ((($ExpectedPages -ge 0 -and $pages.Count -eq $ExpectedPages) -or + ($ExpectedPages -lt 0 -and $pages.Count -gt 0)) -and + ([DateTime]::UtcNow - $stableSince).TotalSeconds -ge 2) { $settled = $true; break } + Start-Sleep -Milliseconds 250 + } while ([DateTime]::UtcNow -lt $deadline) + if (-not $settled -or ($ExpectedPages -ge 0 -and $pages.Count -ne $ExpectedPages) -or ($ExpectedPages -lt 0 -and $pages.Count -eq 0)) { + [IO.File]::WriteAllText((Join-Path $output 'previous-signature.txt'), $lastChange, [Text.Encoding]::UTF8) + $index = 0 + foreach ($id in @($pages.Keys | Sort-Object)) { + [IO.File]::WriteAllText((Join-Path $output ('unsettled-{0:d3}.xml' -f $index)), $pages[$id], [Text.Encoding]::UTF8) + $index++ + } + $hierarchy = '' + $app.GetHierarchy($notebookId, 4, [ref]$hierarchy, 1) + [IO.File]::WriteAllText((Join-Path $output 'unsettled-hierarchy.xml'), $hierarchy, [Text.Encoding]::UTF8) + throw "Expected $ExpectedPages stable pages; OneNote returned $($pages.Count), settled=$settled." + } + $index = 0 + $payloads = @() + foreach ($id in @($pages.Keys | Sort-Object)) { + [IO.File]::WriteAllText((Join-Path $output ('page-{0:d3}.xml' -f $index)), $pages[$id], [Text.Encoding]::UTF8) + if ($Pdf) { + $pdfPath = Join-Path $output ('page-{0:d3}.pdf' -f $index) + $app.NavigateTo($id, '', $false) + $app.Publish($id, $pdfPath, 3, '') + if (-not (Test-Path $pdfPath) -or (Get-Item $pdfPath).Length -eq 0) { throw 'OneNote did not publish the page PDF.' } + } + [xml]$page = $pages[$id] + foreach ($file in $page.SelectNodes('//*[local-name()="InsertedFile" or local-name()="MediaFile"]')) { + $bytes = [IO.File]::ReadAllBytes($file.GetAttribute('pathCache')) + $hash = [BitConverter]::ToString([Security.Cryptography.SHA256]::Create().ComputeHash($bytes)).Replace('-', '').ToLowerInvariant() + [IO.File]::WriteAllBytes((Join-Path $output ($hash + '.attachment')), $bytes) + $payloads += @{ page = $id; object = $file.ParentNode.GetAttribute('objectID'); + kind = $file.LocalName; name = $file.GetAttribute('preferredName'); + sha256 = $hash; bytes = $bytes.Length } + } + $index++ + } + [IO.File]::WriteAllText((Join-Path $output 'payloads.json'), (ConvertTo-Json -InputObject $payloads -Depth 4), [Text.Encoding]::UTF8) + $all = '' + $app.GetHierarchy($notebookId, 4, [ref]$all, 1) + [xml]$finalTree = $all + $finalIds = @($finalTree.SelectNodes('//*[local-name()="Page"]') | ForEach-Object { $_.GetAttribute('ID') } | Sort-Object -Unique) + if ($finalIds.Count -ne $pages.Count -or @($finalIds | Where-Object { -not $pages.ContainsKey($_) }).Count -ne 0) { + throw 'The notebook hierarchy changed while collecting page evidence; repeat the cold read.' + } + [IO.File]::WriteAllText((Join-Path $output 'hierarchy.xml'), $all, [Text.Encoding]::UTF8) + Write-Output "Read $($sections.Count) sections and $($pages.Count) pages." +} catch { + $failure = $_ + [IO.File]::WriteAllText((Join-Path $output 'failure.txt'), ($_ | Out-String), [Text.Encoding]::UTF8) + throw +} finally { + try { + try { + if ($notebookId -and $CloneHost) { $app.SyncHierarchy($notebookId) } + if ($notebookId -and -not $KeepOpen -and (-not $UseCurrentCache -or $CloneHost)) { + $app.CloseNotebook($notebookId, $false) + } + } catch { + if ($null -eq $failure) { throw } + [IO.File]::WriteAllText((Join-Path $output 'cleanup-failure.txt'), ($_ | Out-String), [Text.Encoding]::UTF8) + } + } finally { + [void][Runtime.InteropServices.Marshal]::FinalReleaseComObject($app) + } + $app = $null + [GC]::Collect() + [GC]::WaitForPendingFinalizers() + if (-not $UseCurrentCache -and -not $CloneHost) { + Get-Process ONENOTE -ErrorAction SilentlyContinue | Wait-Process -Timeout 10 + } +} diff --git a/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/source.json b/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/source.json new file mode 100644 index 0000000000000000000000000000000000000000..84bfed985a375ef67cdb51be3f69ad25701015d8 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/source.json @@ -0,0 +1,8 @@ +[ + { + "path": "Lifecycle.one", + "bytes": 66856, + "sha256": "d566d07a037d5d3552ddd2d64f42f793c5823e4209dd340758c1847a21a5dc93", + "mtime_ns": 1789121641964058226 + } +] diff --git a/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/teardown.json b/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/teardown.json new file mode 100644 index 0000000000000000000000000000000000000000..05a47793de40f322e745c4c4183727e3590ecf70 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-04-subpage-move/cold/teardown.json @@ -0,0 +1 @@ +{"absent": true} diff --git a/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/candidate/Lifecycle.one b/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/candidate/Lifecycle.one index 969768a1f8d4056b64e51804f5378d787ca1375f..e6d7931a947a009982ebdd18b472f5ebc45e9af9 100644 Binary files a/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/candidate/Lifecycle.one and b/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/candidate/Lifecycle.one differ diff --git a/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/candidate/manifest.json b/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/candidate/manifest.json index 10c61eec17ce4bd0cbff75c5ebf057cef279536a..951345d03caeaaa35ac7d7821c74630bfa76de28 100644 --- a/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/candidate/manifest.json +++ b/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/candidate/manifest.json @@ -5,22 +5,22 @@ "original": [ { "guid": [ - 16, - 127, - 169, + 118, + 126, + 241, 184, - 6, - 197, - 46, - 76, - 132, - 6, - 229, - 69, - 101, - 216, - 82, - 122 + 224, + 14, + 140, + 75, + 163, + 245, + 140, + 231, + 16, + 33, + 198, + 176 ], "level": 3, "position": "Keep", @@ -33,27 +33,27 @@ "reviewed": [ { "guid": [ - 16, - 127, - 169, + 118, + 126, + 241, 184, - 6, - 197, - 46, - 76, - 132, - 6, - 229, - 69, - 101, - 216, - 82, - 122 + 224, + 14, + 140, + 75, + 163, + 245, + 140, + 231, + 16, + 33, + 198, + 176 ], "level": 3, "position": "Keep", "space": "{D7B1788B-A971-08DE-3324-F4DF82A3B46E},1" } ], - "text_receipt": "Some(Published { revision: ExGuid { guid: [136, 4, 115, 179, 47, 49, 9, 73, 170, 14, 74, 194, 41, 126, 181, 65], n: 1 } })" + "text_receipt": "Some(Published { revision: ExGuid { guid: [199, 99, 235, 255, 100, 250, 217, 68, 170, 162, 185, 91, 131, 217, 125, 222], n: 1 } })" } \ No newline at end of file diff --git a/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/commands.jsonl b/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/commands.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..457decedbcc495c0ad506d3ba0e3f4975d7a37b4 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/commands.jsonl @@ -0,0 +1,3 @@ +{"command": "powershell -NoProfile -Command \"Expand-Archive -LiteralPath C:\\one-tests\\transfer.zip -DestinationPath C:\\one-tests\\runs\\capture\\notebook\"", "exit": 0, "stdout": "", "stderr": "", "error": null} +{"command": "powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -File C:\\one-tests\\read-current.ps1 -Root C:\\one-tests\\runs\\capture -CloneHost ONE-M6-1B265F06 -ExpectedPages 9", "exit": 0, "stdout": "Read 1 sections and 9 pages.\r\n", "stderr": "", "error": null} +{"command": "powershell -NoProfile -Command \"Compress-Archive -Force -Path C:\\one-tests\\runs\\capture\\* -DestinationPath C:\\one-tests\\captured.zip\"", "exit": 0, "stdout": "", "stderr": "", "error": null} diff --git a/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/machine.json b/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/machine.json new file mode 100644 index 0000000000000000000000000000000000000000..aa832cdd273147ccea22dce01d4b264616e92394 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/machine.json @@ -0,0 +1 @@ +{"name": "m6-1b265f06", "hostname": "ONE-M6-1B265F06"} diff --git a/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/notebook/Lifecycle.one b/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/notebook/Lifecycle.one index 320a5b470afd4d6a61944f2474566201b852785d..18b1459a682f5c6ee0aa43e2accab1142899a58c 100644 Binary files a/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/notebook/Lifecycle.one and b/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/notebook/Lifecycle.one differ diff --git a/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/notebook/Open Notebook.onetoc2 b/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/notebook/Open Notebook.onetoc2 new file mode 100644 index 0000000000000000000000000000000000000000..fdd7b1363d1947de8975c95edd5368262f43fa86 Binary files /dev/null and b/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/notebook/Open Notebook.onetoc2 differ diff --git a/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/read/environment.json b/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/read/environment.json new file mode 100644 index 0000000000000000000000000000000000000000..0f5aeefa8aff8fd019232d1842f7d0945121c5bc --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/read/environment.json @@ -0,0 +1,7 @@ +{ + "powershell": "5.1.14409.1005", + "schema": "xs2010", + "hostname": "ONE-M6-1B265F06", + "cold": true, + "onenote": "14.0.4763.1000" +} diff --git a/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/read/hierarchy.xml b/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/read/hierarchy.xml index 6390daaec50eddbf5458665fd14e764cdfc0fc0f..1185c4ae2edd51f0003186836d9a674076d5435c 100644 --- a/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/read/hierarchy.xml +++ b/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/read/hierarchy.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/read/page-000.xml b/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/read/page-000.xml index 7e84ef75198876e79fda769b380b2b7a83eb9881..4b1430f609826b7e4d273105c71e7677b666a093 100644 --- a/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/read/page-000.xml +++ b/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/read/page-000.xml @@ -1,2 +1,4 @@  - +Body trailing 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/read/page-001.xml b/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/read/page-001.xml index 4b47688a009d181b55b97cbf34e8809b64d0fcb1..d440c62c4340abe70562ab6810dba76d4ecbba0b 100644 --- a/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/read/page-001.xml +++ b/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/read/page-001.xml @@ -1,2 +1,4 @@  - +Body automatic 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/read/page-002.xml b/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/read/page-002.xml index d0dd7d58d9ab21b24ab56047f76c6ba6e05b1b0d..ae64193fc29119f09051d88dbc92cb6cd33024f9 100644 --- a/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/read/page-002.xml +++ b/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/read/page-002.xml @@ -1,4 +1,4 @@  -Body grandchild 🦀 éBody duplicate 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/read/page-003.xml b/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/read/page-003.xml index 240091165437942b1c533c8bd07d7c153f39af16..99e5f55c7416f44bb5854afe4c94e22319997b33 100644 --- a/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/read/page-003.xml +++ b/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/read/page-003.xml @@ -1,4 +1,2 @@  -Offline Body parent 🦀 é preserved]]> + diff --git a/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/read/page-004.xml b/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/read/page-004.xml index 6f76f37c8dcaf1066d15a0b83bbd0cd70678f58a..036827ac0a4751d89e6539dc007d5cb69dac3d39 100644 --- a/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/read/page-004.xml +++ b/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/read/page-004.xml @@ -1,2 +1,4 @@  - +Offline Body parent 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/read/page-005.xml b/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/read/page-005.xml index 0b09402d89d37d14affa4e46ed2984a6661998de..7fc8765fd68401144ab68f5473459f2edda2226f 100644 --- a/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/read/page-005.xml +++ b/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/read/page-005.xml @@ -1,4 +1,4 @@  -Body child 🦀 éBody grandchild 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/read/page-006.xml b/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/read/page-006.xml index f6461edc278e5e4ad2facb700e916cdb6ab0d937..9ab4e6821968942838b79134a3ad1290ba46b354 100644 --- a/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/read/page-006.xml +++ b/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/read/page-006.xml @@ -1,4 +1,2 @@  -Body trailing 🦀 é preserved]]> + diff --git a/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/read/page-007.xml b/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/read/page-007.xml index 9ba63b947391203afc2ef75f8d898339b4a8cae3..f40b862dcc680613dc9d0bd1542a16d00d9004b7 100644 --- a/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/read/page-007.xml +++ b/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/read/page-007.xml @@ -1,4 +1,2 @@  -Body duplicate 🦀 é preserved]]> + diff --git a/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/read/page-008.xml b/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/read/page-008.xml index 340c7a7de1ed73627d6136e2a5c939aacc873b5d..b3f890242fba17c8cacc215a6a50239202958e8c 100644 --- a/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/read/page-008.xml +++ b/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/read/page-008.xml @@ -1,4 +1,4 @@  -Body automatic 🦀 éBody child 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/read/payloads.json b/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/read/payloads.json new file mode 100644 index 0000000000000000000000000000000000000000..1ce91a413d6fff4d58765187b76756f0e97ae843 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/read/payloads.json @@ -0,0 +1,3 @@ +[ + +] \ No newline at end of file diff --git a/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/run.json b/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/run.json new file mode 100644 index 0000000000000000000000000000000000000000..13032e26c4d6feef7b3532b521d0f1a8dee720d5 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/run.json @@ -0,0 +1,18 @@ +{ + "notebook": "/private/var/folders/90/4f4rngds01j55ggdj_vglk_c0000gn/T/tmpf5e2rlwx", + "expected_pages": 9, + "author": null, + "author_timeout_seconds": 600, + "inspect": false, + "collect_notebook": true, + "base": { + "file": "win7-office-base.qcow2", + "format": "qcow2", + "sha256": "a1a4f8fab782ee14885ff801ca2f6347c208fdcfc3513637096f314315c89346", + "virtual_size": 68719476736 + }, + "scripts": { + "cold.ps1": "c177fc72ae6c2634d186f5671a880de20b09f9716532c37c69cb13aa15c7e331", + "read.ps1": "04013bfcccee40a17e2a225f9b9e96f40a3a8daad9e350609654f8eda3ccbb41" + } +} diff --git a/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/scripts/cold.ps1 b/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/scripts/cold.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..a0b99e7aeb86f4dc10032537800501a52ad65b4f --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/scripts/cold.ps1 @@ -0,0 +1,27 @@ +param([Parameter(Mandatory=$true)][string]$Root, [string]$CloneHost = '') +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' +$root = [IO.Path]::GetFullPath($Root).TrimEnd('\') +if ([IO.Path]::GetDirectoryName($root) -ne 'C:\one-tests\runs') { + throw 'Choose a run directly below C:\one-tests\runs.' +} +if (Get-Process ONENOTE -ErrorAction SilentlyContinue) { throw 'Close OneNote before resetting its test cache.' } +$key = 'HKCU:\Software\Microsoft\Office\14.0\OneNote' +if ($CloneHost) { + if ($CloneHost -notmatch '^ONE-[A-Z0-9-]+$' -or [Environment]::MachineName -ne $CloneHost) { + throw 'The disposable clone hostname does not match this machine.' + } + New-Item "$key\Options\Paths" -Force | Out-Null + New-ItemProperty "$key\Options\Paths" -Name UnfiledNotesSection -PropertyType ExpandString -Value 'C:\one-tests\Loose.one' -Force | Out-Null +} elseif ((Get-ItemProperty "$key\Options\Paths").UnfiledNotesSection -ne 'C:\one-tests\Loose.one' -or + -not (Test-Path 'C:\one-tests\profile-original-cache')) { + throw 'Park the personal OneNote profile before resetting the test cache.' +} +$cache = Join-Path $env:LOCALAPPDATA 'Microsoft\OneNote\14.0' +$parked = Join-Path 'C:\one-tests\caches' ([IO.Path]::GetFileName($root)) +if (Test-Path $parked) { throw 'Choose a new run; its parked cache already exists.' } +New-Item -ItemType Directory -Path 'C:\one-tests\caches' -Force | Out-Null +if (Test-Path $cache) { Move-Item -LiteralPath $cache -Destination $parked } +if (Test-Path "$key\OpenNotebooks") { Remove-Item "$key\OpenNotebooks" -Recurse } +New-Item "$key\OpenNotebooks" | Out-Null +New-ItemProperty "$key\OpenNotebooks" -Name '1' -PropertyType String -Value "$root\notebook" | Out-Null diff --git a/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/scripts/read.ps1 b/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/scripts/read.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..476094ab1e0c47077988a6461db2080cf208642b --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/scripts/read.ps1 @@ -0,0 +1,142 @@ +param( + [Parameter(Mandatory=$true)][string]$Root, + [int]$ExpectedPages = -1, + [switch]$UseCurrentCache, + [switch]$Pdf, + [switch]$KeepOpen, + [string]$CloneHost = '' +) +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' +$root = [IO.Path]::GetFullPath($Root).TrimEnd('\') +if ([IO.Path]::GetDirectoryName($root) -ne 'C:\one-tests\runs') { + throw 'Choose a run directly below C:\one-tests\runs.' +} +$notebook = Join-Path $root 'notebook' +$output = Join-Path $root 'read' +if (Test-Path $output) { throw 'Choose a new read destination.' } +if ($UseCurrentCache) { + if ((Get-ItemProperty 'HKCU:\Software\Microsoft\Office\14.0\OneNote\Options\Paths').UnfiledNotesSection -ne 'C:\one-tests\Loose.one') { + throw 'Park the personal OneNote profile before reading test notebooks.' + } +} else { + & "$PSScriptRoot\cold-current.ps1" -Root $root -CloneHost $CloneHost +} +New-Item -ItemType Directory -Path $output | Out-Null +$app = New-Object -ComObject OneNote.Application +$notebookId = '' +$failure = $null +try { + $app.OpenHierarchy($notebook, '', [ref]$notebookId, 0) + $process = Get-Process ONENOTE + @{ hostname = [Environment]::MachineName; onenote = $process.MainModule.FileVersionInfo.FileVersion; + powershell = $PSVersionTable.PSVersion.ToString(); schema = 'xs2010'; cold = (-not $UseCurrentCache.IsPresent) } | + ConvertTo-Json | Set-Content (Join-Path $output 'environment.json') -Encoding UTF8 + $sections = @() + foreach ($file in @(Get-ChildItem $notebook -Recurse | Where-Object { $_.Extension -eq '.one' })) { + $id = '' + $app.OpenHierarchy($file.FullName, '', [ref]$id, 0) + $sections += $id + } + $deadline = [DateTime]::UtcNow.AddSeconds(300) + $previous = '' + $lastChange = '' + $stableSince = [DateTime]::UtcNow + $settled = $false + do { + $pages = @{} + foreach ($section in $sections) { + $hierarchy = '' + $app.GetHierarchy($section, 4, [ref]$hierarchy, 1) + [xml]$xml = $hierarchy + foreach ($node in $xml.SelectNodes('//*[@path]')) { + if (-not $node.GetAttribute('path').StartsWith("$notebook\", [StringComparison]::OrdinalIgnoreCase)) { + throw 'OneNote opened a section outside the copied notebook.' + } + } + foreach ($node in $xml.SelectNodes('//*[local-name()="Page"]')) { + $id = $node.GetAttribute('ID') + $content = '' + $app.GetPageContent($id, [ref]$content, 1, 1) + $pages[$id] = $content + } + } + $signature = [String]::Join('|', @($pages.Keys | Sort-Object | ForEach-Object { $_ + $pages[$_] })) + if ($signature -ne $previous) { + $lastChange = $previous + $previous = $signature + $stableSince = [DateTime]::UtcNow + } + if ((($ExpectedPages -ge 0 -and $pages.Count -eq $ExpectedPages) -or + ($ExpectedPages -lt 0 -and $pages.Count -gt 0)) -and + ([DateTime]::UtcNow - $stableSince).TotalSeconds -ge 2) { $settled = $true; break } + Start-Sleep -Milliseconds 250 + } while ([DateTime]::UtcNow -lt $deadline) + if (-not $settled -or ($ExpectedPages -ge 0 -and $pages.Count -ne $ExpectedPages) -or ($ExpectedPages -lt 0 -and $pages.Count -eq 0)) { + [IO.File]::WriteAllText((Join-Path $output 'previous-signature.txt'), $lastChange, [Text.Encoding]::UTF8) + $index = 0 + foreach ($id in @($pages.Keys | Sort-Object)) { + [IO.File]::WriteAllText((Join-Path $output ('unsettled-{0:d3}.xml' -f $index)), $pages[$id], [Text.Encoding]::UTF8) + $index++ + } + $hierarchy = '' + $app.GetHierarchy($notebookId, 4, [ref]$hierarchy, 1) + [IO.File]::WriteAllText((Join-Path $output 'unsettled-hierarchy.xml'), $hierarchy, [Text.Encoding]::UTF8) + throw "Expected $ExpectedPages stable pages; OneNote returned $($pages.Count), settled=$settled." + } + $index = 0 + $payloads = @() + foreach ($id in @($pages.Keys | Sort-Object)) { + [IO.File]::WriteAllText((Join-Path $output ('page-{0:d3}.xml' -f $index)), $pages[$id], [Text.Encoding]::UTF8) + if ($Pdf) { + $pdfPath = Join-Path $output ('page-{0:d3}.pdf' -f $index) + $app.NavigateTo($id, '', $false) + $app.Publish($id, $pdfPath, 3, '') + if (-not (Test-Path $pdfPath) -or (Get-Item $pdfPath).Length -eq 0) { throw 'OneNote did not publish the page PDF.' } + } + [xml]$page = $pages[$id] + foreach ($file in $page.SelectNodes('//*[local-name()="InsertedFile" or local-name()="MediaFile"]')) { + $bytes = [IO.File]::ReadAllBytes($file.GetAttribute('pathCache')) + $hash = [BitConverter]::ToString([Security.Cryptography.SHA256]::Create().ComputeHash($bytes)).Replace('-', '').ToLowerInvariant() + [IO.File]::WriteAllBytes((Join-Path $output ($hash + '.attachment')), $bytes) + $payloads += @{ page = $id; object = $file.ParentNode.GetAttribute('objectID'); + kind = $file.LocalName; name = $file.GetAttribute('preferredName'); + sha256 = $hash; bytes = $bytes.Length } + } + $index++ + } + [IO.File]::WriteAllText((Join-Path $output 'payloads.json'), (ConvertTo-Json -InputObject $payloads -Depth 4), [Text.Encoding]::UTF8) + $all = '' + $app.GetHierarchy($notebookId, 4, [ref]$all, 1) + [xml]$finalTree = $all + $finalIds = @($finalTree.SelectNodes('//*[local-name()="Page"]') | ForEach-Object { $_.GetAttribute('ID') } | Sort-Object -Unique) + if ($finalIds.Count -ne $pages.Count -or @($finalIds | Where-Object { -not $pages.ContainsKey($_) }).Count -ne 0) { + throw 'The notebook hierarchy changed while collecting page evidence; repeat the cold read.' + } + [IO.File]::WriteAllText((Join-Path $output 'hierarchy.xml'), $all, [Text.Encoding]::UTF8) + Write-Output "Read $($sections.Count) sections and $($pages.Count) pages." +} catch { + $failure = $_ + [IO.File]::WriteAllText((Join-Path $output 'failure.txt'), ($_ | Out-String), [Text.Encoding]::UTF8) + throw +} finally { + try { + try { + if ($notebookId -and $CloneHost) { $app.SyncHierarchy($notebookId) } + if ($notebookId -and -not $KeepOpen -and (-not $UseCurrentCache -or $CloneHost)) { + $app.CloseNotebook($notebookId, $false) + } + } catch { + if ($null -eq $failure) { throw } + [IO.File]::WriteAllText((Join-Path $output 'cleanup-failure.txt'), ($_ | Out-String), [Text.Encoding]::UTF8) + } + } finally { + [void][Runtime.InteropServices.Marshal]::FinalReleaseComObject($app) + } + $app = $null + [GC]::Collect() + [GC]::WaitForPendingFinalizers() + if (-not $UseCurrentCache -and -not $CloneHost) { + Get-Process ONENOTE -ErrorAction SilentlyContinue | Wait-Process -Timeout 10 + } +} diff --git a/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/source.json b/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/source.json new file mode 100644 index 0000000000000000000000000000000000000000..d352b433d43071d1dff9edc519905f17548ccc3a --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/source.json @@ -0,0 +1,8 @@ +[ + { + "path": "Lifecycle.one", + "bytes": 67160, + "sha256": "03715fdc38a5e3a369e49e5abe8e55fa82da4ffb90c304987ca5f66edf545f7b", + "mtime_ns": 1789121642301975530 + } +] diff --git a/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/teardown.json b/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/teardown.json new file mode 100644 index 0000000000000000000000000000000000000000..05a47793de40f322e745c4c4183727e3590ecf70 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-05-insert-before-subpage/cold/teardown.json @@ -0,0 +1 @@ +{"absent": true} diff --git a/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/candidate/Lifecycle.one b/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/candidate/Lifecycle.one index de93d19ed31f9874d68afcbe23d996a7346ebbf3..ccee9e37b3498ba9b9aa7f0b16a80caa8e84f99c 100644 Binary files a/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/candidate/Lifecycle.one and b/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/candidate/Lifecycle.one differ diff --git a/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/candidate/manifest.json b/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/candidate/manifest.json index c2778ea48b1942d49ad23a5a23c5849680d97151..cf55c1f74ef3baa6d4e4cc610310848c7fa1ee81 100644 --- a/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/candidate/manifest.json +++ b/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/candidate/manifest.json @@ -5,55 +5,55 @@ "original": [ { "guid": [ - 252, - 73, - 160, - 21, - 81, - 53, - 195, + 147, + 238, + 181, + 240, + 14, + 82, + 189, 79, - 136, - 194, - 167, - 121, - 5, - 123, - 19, - 178 + 148, + 51, + 37, + 25, + 98, + 116, + 82, + 98 ], "level": 3, "position": "Keep", "space": "{D7B1788B-A971-08DE-3324-F4DF82A3B46E},1" } ], - "page_receipt": "Some(Published { revision: ExGuid { guid: [221, 248, 102, 82, 242, 12, 194, 64, 138, 231, 128, 175, 67, 118, 169, 171], n: 1 } })", + "page_receipt": "Some(Published { revision: ExGuid { guid: [45, 141, 53, 241, 106, 0, 224, 77, 186, 100, 116, 169, 175, 169, 134, 76], n: 1 } })", "phase": "06-promoted-level-two", "publications": 2, "reviewed": [ { "guid": [ - 252, - 73, - 160, - 21, - 81, - 53, - 195, + 147, + 238, + 181, + 240, + 14, + 82, + 189, 79, - 136, - 194, - 167, - 121, - 5, - 123, - 19, - 178 + 148, + 51, + 37, + 25, + 98, + 116, + 82, + 98 ], "level": 3, "position": "Keep", "space": "{D7B1788B-A971-08DE-3324-F4DF82A3B46E},1" } ], - "text_receipt": "Some(Published { revision: ExGuid { guid: [230, 196, 113, 150, 161, 124, 235, 76, 179, 76, 159, 133, 104, 150, 52, 125], n: 1 } })" + "text_receipt": "Some(Published { revision: ExGuid { guid: [165, 191, 54, 227, 132, 189, 26, 78, 163, 96, 96, 9, 16, 198, 42, 229], n: 1 } })" } \ No newline at end of file diff --git a/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/commands.jsonl b/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/commands.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..6dd97e180ef83f2a9855c151c71eb359f249adfe --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/commands.jsonl @@ -0,0 +1,3 @@ +{"command": "powershell -NoProfile -Command \"Expand-Archive -LiteralPath C:\\one-tests\\transfer.zip -DestinationPath C:\\one-tests\\runs\\capture\\notebook\"", "exit": 0, "stdout": "", "stderr": "", "error": null} +{"command": "powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -File C:\\one-tests\\read-current.ps1 -Root C:\\one-tests\\runs\\capture -CloneHost ONE-M6-E0AC64B2 -ExpectedPages 9", "exit": 0, "stdout": "Read 1 sections and 9 pages.\r\n", "stderr": "", "error": null} +{"command": "powershell -NoProfile -Command \"Compress-Archive -Force -Path C:\\one-tests\\runs\\capture\\* -DestinationPath C:\\one-tests\\captured.zip\"", "exit": 0, "stdout": "", "stderr": "", "error": null} diff --git a/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/machine.json b/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/machine.json new file mode 100644 index 0000000000000000000000000000000000000000..3d569078bc76ac0aa6a230a547e802be11136a18 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/machine.json @@ -0,0 +1 @@ +{"name": "m6-e0ac64b2", "hostname": "ONE-M6-E0AC64B2"} diff --git a/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/notebook/Lifecycle.one b/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/notebook/Lifecycle.one index afe252a32a392191dee826fd1cdff713f4662e72..58d8425bb9da7a632ddd3a2542ad1cd1c00f2996 100644 Binary files a/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/notebook/Lifecycle.one and b/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/notebook/Lifecycle.one differ diff --git a/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/notebook/Open Notebook.onetoc2 b/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/notebook/Open Notebook.onetoc2 new file mode 100644 index 0000000000000000000000000000000000000000..bdc13d5a752af0891592f9a31a604d6ebd1b9f7d Binary files /dev/null and b/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/notebook/Open Notebook.onetoc2 differ diff --git a/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/read/environment.json b/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/read/environment.json new file mode 100644 index 0000000000000000000000000000000000000000..62abf0d853f82bb7b1833fd9bdfccc50c2d201f8 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/read/environment.json @@ -0,0 +1,7 @@ +{ + "powershell": "5.1.14409.1005", + "schema": "xs2010", + "hostname": "ONE-M6-E0AC64B2", + "cold": true, + "onenote": "14.0.4763.1000" +} diff --git a/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/read/hierarchy.xml b/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/read/hierarchy.xml index 5d365b5595db0d668ccff283ffbda2462f0a53d6..04e129ee775b76606405e5cc30d4ee7609eb2b05 100644 --- a/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/read/hierarchy.xml +++ b/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/read/hierarchy.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/read/page-000.xml b/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/read/page-000.xml index 2c820f22e2b956bd89527ebd153963b68de0ebb7..ce0cd3dcd4ddb57b19500cd4de580bdd87f1bc87 100644 --- a/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/read/page-000.xml +++ b/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/read/page-000.xml @@ -1,4 +1,2 @@  -Body trailing 🦀 é preserved]]> + diff --git a/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/read/page-001.xml b/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/read/page-001.xml index da92bd7180d3b8fe12c6d9c34b05e42dde30e4a5..8f2dcd9cdda6409312fc0882833644ac9d001e04 100644 --- a/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/read/page-001.xml +++ b/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/read/page-001.xml @@ -1,4 +1,4 @@  -Body duplicate 🦀 éBody grandchild 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/read/page-002.xml b/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/read/page-002.xml index 4907a264a7b149962315aebf6bebb16a84638191..13376bc639d14e2154c4df76af8346670d5b9d1c 100644 --- a/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/read/page-002.xml +++ b/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/read/page-002.xml @@ -1,4 +1,4 @@  -Body automatic 🦀 éOffline Body parent 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/read/page-003.xml b/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/read/page-003.xml index fc1c90bddbbf4d35da271ce2796a85964715b3e7..73467ebdccf8ace9397f8cffe405f0b08f08d89d 100644 --- a/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/read/page-003.xml +++ b/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/read/page-003.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/read/page-004.xml b/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/read/page-004.xml index 206f75cfae24571eb4f8c4e710add7e821926e34..e40f2ca9cf6091414aa4b6557f01484c283b2598 100644 --- a/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/read/page-004.xml +++ b/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/read/page-004.xml @@ -1,2 +1,4 @@  - +Body child 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/read/page-005.xml b/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/read/page-005.xml index c5c98de466b7e7d5e25a4ed3eec5b6e4e02db670..5265ddbd165f7227024964090b0e33b7c567d4ed 100644 --- a/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/read/page-005.xml +++ b/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/read/page-005.xml @@ -1,4 +1,2 @@  -Offline Body parent 🦀 é preserved]]> + diff --git a/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/read/page-006.xml b/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/read/page-006.xml index c4f4db853288afcd39c6db9b3965c2a2bbda9607..95ff09fc3bf573018f2c0ff7f00089850829ee00 100644 --- a/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/read/page-006.xml +++ b/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/read/page-006.xml @@ -1,4 +1,4 @@  -Body grandchild 🦀 éBody trailing 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/read/page-007.xml b/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/read/page-007.xml index 06485d3977b92b0952377ef2f1be6a2410e28d24..cfdfda2d10e0596e00114564a94a41c413215dce 100644 --- a/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/read/page-007.xml +++ b/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/read/page-007.xml @@ -1,2 +1,4 @@  - +Body duplicate 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/read/page-008.xml b/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/read/page-008.xml index c46c04873a5e6e988e06998e3abea272ef4300af..6d835912f4f48faa03a0bbf243dbc9a0a03bca47 100644 --- a/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/read/page-008.xml +++ b/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/read/page-008.xml @@ -1,4 +1,4 @@  -Body child 🦀 éBody automatic 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/read/payloads.json b/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/read/payloads.json new file mode 100644 index 0000000000000000000000000000000000000000..1ce91a413d6fff4d58765187b76756f0e97ae843 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/read/payloads.json @@ -0,0 +1,3 @@ +[ + +] \ No newline at end of file diff --git a/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/run.json b/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/run.json new file mode 100644 index 0000000000000000000000000000000000000000..735aa2176dd32427a1e5d54b213cb627e018323c --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/run.json @@ -0,0 +1,18 @@ +{ + "notebook": "/private/var/folders/90/4f4rngds01j55ggdj_vglk_c0000gn/T/tmplg_djgsc", + "expected_pages": 9, + "author": null, + "author_timeout_seconds": 600, + "inspect": false, + "collect_notebook": true, + "base": { + "file": "win7-office-base.qcow2", + "format": "qcow2", + "sha256": "a1a4f8fab782ee14885ff801ca2f6347c208fdcfc3513637096f314315c89346", + "virtual_size": 68719476736 + }, + "scripts": { + "cold.ps1": "c177fc72ae6c2634d186f5671a880de20b09f9716532c37c69cb13aa15c7e331", + "read.ps1": "04013bfcccee40a17e2a225f9b9e96f40a3a8daad9e350609654f8eda3ccbb41" + } +} diff --git a/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/scripts/cold.ps1 b/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/scripts/cold.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..a0b99e7aeb86f4dc10032537800501a52ad65b4f --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/scripts/cold.ps1 @@ -0,0 +1,27 @@ +param([Parameter(Mandatory=$true)][string]$Root, [string]$CloneHost = '') +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' +$root = [IO.Path]::GetFullPath($Root).TrimEnd('\') +if ([IO.Path]::GetDirectoryName($root) -ne 'C:\one-tests\runs') { + throw 'Choose a run directly below C:\one-tests\runs.' +} +if (Get-Process ONENOTE -ErrorAction SilentlyContinue) { throw 'Close OneNote before resetting its test cache.' } +$key = 'HKCU:\Software\Microsoft\Office\14.0\OneNote' +if ($CloneHost) { + if ($CloneHost -notmatch '^ONE-[A-Z0-9-]+$' -or [Environment]::MachineName -ne $CloneHost) { + throw 'The disposable clone hostname does not match this machine.' + } + New-Item "$key\Options\Paths" -Force | Out-Null + New-ItemProperty "$key\Options\Paths" -Name UnfiledNotesSection -PropertyType ExpandString -Value 'C:\one-tests\Loose.one' -Force | Out-Null +} elseif ((Get-ItemProperty "$key\Options\Paths").UnfiledNotesSection -ne 'C:\one-tests\Loose.one' -or + -not (Test-Path 'C:\one-tests\profile-original-cache')) { + throw 'Park the personal OneNote profile before resetting the test cache.' +} +$cache = Join-Path $env:LOCALAPPDATA 'Microsoft\OneNote\14.0' +$parked = Join-Path 'C:\one-tests\caches' ([IO.Path]::GetFileName($root)) +if (Test-Path $parked) { throw 'Choose a new run; its parked cache already exists.' } +New-Item -ItemType Directory -Path 'C:\one-tests\caches' -Force | Out-Null +if (Test-Path $cache) { Move-Item -LiteralPath $cache -Destination $parked } +if (Test-Path "$key\OpenNotebooks") { Remove-Item "$key\OpenNotebooks" -Recurse } +New-Item "$key\OpenNotebooks" | Out-Null +New-ItemProperty "$key\OpenNotebooks" -Name '1' -PropertyType String -Value "$root\notebook" | Out-Null diff --git a/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/scripts/read.ps1 b/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/scripts/read.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..476094ab1e0c47077988a6461db2080cf208642b --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/scripts/read.ps1 @@ -0,0 +1,142 @@ +param( + [Parameter(Mandatory=$true)][string]$Root, + [int]$ExpectedPages = -1, + [switch]$UseCurrentCache, + [switch]$Pdf, + [switch]$KeepOpen, + [string]$CloneHost = '' +) +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' +$root = [IO.Path]::GetFullPath($Root).TrimEnd('\') +if ([IO.Path]::GetDirectoryName($root) -ne 'C:\one-tests\runs') { + throw 'Choose a run directly below C:\one-tests\runs.' +} +$notebook = Join-Path $root 'notebook' +$output = Join-Path $root 'read' +if (Test-Path $output) { throw 'Choose a new read destination.' } +if ($UseCurrentCache) { + if ((Get-ItemProperty 'HKCU:\Software\Microsoft\Office\14.0\OneNote\Options\Paths').UnfiledNotesSection -ne 'C:\one-tests\Loose.one') { + throw 'Park the personal OneNote profile before reading test notebooks.' + } +} else { + & "$PSScriptRoot\cold-current.ps1" -Root $root -CloneHost $CloneHost +} +New-Item -ItemType Directory -Path $output | Out-Null +$app = New-Object -ComObject OneNote.Application +$notebookId = '' +$failure = $null +try { + $app.OpenHierarchy($notebook, '', [ref]$notebookId, 0) + $process = Get-Process ONENOTE + @{ hostname = [Environment]::MachineName; onenote = $process.MainModule.FileVersionInfo.FileVersion; + powershell = $PSVersionTable.PSVersion.ToString(); schema = 'xs2010'; cold = (-not $UseCurrentCache.IsPresent) } | + ConvertTo-Json | Set-Content (Join-Path $output 'environment.json') -Encoding UTF8 + $sections = @() + foreach ($file in @(Get-ChildItem $notebook -Recurse | Where-Object { $_.Extension -eq '.one' })) { + $id = '' + $app.OpenHierarchy($file.FullName, '', [ref]$id, 0) + $sections += $id + } + $deadline = [DateTime]::UtcNow.AddSeconds(300) + $previous = '' + $lastChange = '' + $stableSince = [DateTime]::UtcNow + $settled = $false + do { + $pages = @{} + foreach ($section in $sections) { + $hierarchy = '' + $app.GetHierarchy($section, 4, [ref]$hierarchy, 1) + [xml]$xml = $hierarchy + foreach ($node in $xml.SelectNodes('//*[@path]')) { + if (-not $node.GetAttribute('path').StartsWith("$notebook\", [StringComparison]::OrdinalIgnoreCase)) { + throw 'OneNote opened a section outside the copied notebook.' + } + } + foreach ($node in $xml.SelectNodes('//*[local-name()="Page"]')) { + $id = $node.GetAttribute('ID') + $content = '' + $app.GetPageContent($id, [ref]$content, 1, 1) + $pages[$id] = $content + } + } + $signature = [String]::Join('|', @($pages.Keys | Sort-Object | ForEach-Object { $_ + $pages[$_] })) + if ($signature -ne $previous) { + $lastChange = $previous + $previous = $signature + $stableSince = [DateTime]::UtcNow + } + if ((($ExpectedPages -ge 0 -and $pages.Count -eq $ExpectedPages) -or + ($ExpectedPages -lt 0 -and $pages.Count -gt 0)) -and + ([DateTime]::UtcNow - $stableSince).TotalSeconds -ge 2) { $settled = $true; break } + Start-Sleep -Milliseconds 250 + } while ([DateTime]::UtcNow -lt $deadline) + if (-not $settled -or ($ExpectedPages -ge 0 -and $pages.Count -ne $ExpectedPages) -or ($ExpectedPages -lt 0 -and $pages.Count -eq 0)) { + [IO.File]::WriteAllText((Join-Path $output 'previous-signature.txt'), $lastChange, [Text.Encoding]::UTF8) + $index = 0 + foreach ($id in @($pages.Keys | Sort-Object)) { + [IO.File]::WriteAllText((Join-Path $output ('unsettled-{0:d3}.xml' -f $index)), $pages[$id], [Text.Encoding]::UTF8) + $index++ + } + $hierarchy = '' + $app.GetHierarchy($notebookId, 4, [ref]$hierarchy, 1) + [IO.File]::WriteAllText((Join-Path $output 'unsettled-hierarchy.xml'), $hierarchy, [Text.Encoding]::UTF8) + throw "Expected $ExpectedPages stable pages; OneNote returned $($pages.Count), settled=$settled." + } + $index = 0 + $payloads = @() + foreach ($id in @($pages.Keys | Sort-Object)) { + [IO.File]::WriteAllText((Join-Path $output ('page-{0:d3}.xml' -f $index)), $pages[$id], [Text.Encoding]::UTF8) + if ($Pdf) { + $pdfPath = Join-Path $output ('page-{0:d3}.pdf' -f $index) + $app.NavigateTo($id, '', $false) + $app.Publish($id, $pdfPath, 3, '') + if (-not (Test-Path $pdfPath) -or (Get-Item $pdfPath).Length -eq 0) { throw 'OneNote did not publish the page PDF.' } + } + [xml]$page = $pages[$id] + foreach ($file in $page.SelectNodes('//*[local-name()="InsertedFile" or local-name()="MediaFile"]')) { + $bytes = [IO.File]::ReadAllBytes($file.GetAttribute('pathCache')) + $hash = [BitConverter]::ToString([Security.Cryptography.SHA256]::Create().ComputeHash($bytes)).Replace('-', '').ToLowerInvariant() + [IO.File]::WriteAllBytes((Join-Path $output ($hash + '.attachment')), $bytes) + $payloads += @{ page = $id; object = $file.ParentNode.GetAttribute('objectID'); + kind = $file.LocalName; name = $file.GetAttribute('preferredName'); + sha256 = $hash; bytes = $bytes.Length } + } + $index++ + } + [IO.File]::WriteAllText((Join-Path $output 'payloads.json'), (ConvertTo-Json -InputObject $payloads -Depth 4), [Text.Encoding]::UTF8) + $all = '' + $app.GetHierarchy($notebookId, 4, [ref]$all, 1) + [xml]$finalTree = $all + $finalIds = @($finalTree.SelectNodes('//*[local-name()="Page"]') | ForEach-Object { $_.GetAttribute('ID') } | Sort-Object -Unique) + if ($finalIds.Count -ne $pages.Count -or @($finalIds | Where-Object { -not $pages.ContainsKey($_) }).Count -ne 0) { + throw 'The notebook hierarchy changed while collecting page evidence; repeat the cold read.' + } + [IO.File]::WriteAllText((Join-Path $output 'hierarchy.xml'), $all, [Text.Encoding]::UTF8) + Write-Output "Read $($sections.Count) sections and $($pages.Count) pages." +} catch { + $failure = $_ + [IO.File]::WriteAllText((Join-Path $output 'failure.txt'), ($_ | Out-String), [Text.Encoding]::UTF8) + throw +} finally { + try { + try { + if ($notebookId -and $CloneHost) { $app.SyncHierarchy($notebookId) } + if ($notebookId -and -not $KeepOpen -and (-not $UseCurrentCache -or $CloneHost)) { + $app.CloseNotebook($notebookId, $false) + } + } catch { + if ($null -eq $failure) { throw } + [IO.File]::WriteAllText((Join-Path $output 'cleanup-failure.txt'), ($_ | Out-String), [Text.Encoding]::UTF8) + } + } finally { + [void][Runtime.InteropServices.Marshal]::FinalReleaseComObject($app) + } + $app = $null + [GC]::Collect() + [GC]::WaitForPendingFinalizers() + if (-not $UseCurrentCache -and -not $CloneHost) { + Get-Process ONENOTE -ErrorAction SilentlyContinue | Wait-Process -Timeout 10 + } +} diff --git a/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/source.json b/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/source.json new file mode 100644 index 0000000000000000000000000000000000000000..252e8d1ac27b903055990dd98fdb3561be114268 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/source.json @@ -0,0 +1,8 @@ +[ + { + "path": "Lifecycle.one", + "bytes": 71448, + "sha256": "f66bd60a8834f9770060ae457a30aff734bf1777b0b21a6de9d8d19570777b3e", + "mtime_ns": 1789121642659393696 + } +] diff --git a/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/teardown.json b/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/teardown.json new file mode 100644 index 0000000000000000000000000000000000000000..05a47793de40f322e745c4c4183727e3590ecf70 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-06-promoted-level-two/cold/teardown.json @@ -0,0 +1 @@ +{"absent": true} diff --git a/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/candidate/Lifecycle.one b/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/candidate/Lifecycle.one index 684d740175054374caed48d143b0c5deb67bf2c0..7a8e23af48c0ed86e48acb023bc24785f2c01b4f 100644 Binary files a/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/candidate/Lifecycle.one and b/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/candidate/Lifecycle.one differ diff --git a/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/candidate/manifest.json b/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/candidate/manifest.json index 8056cd45cd00611ac2ac4ef9fdcb8092d1d4f02b..abbd49fcfc945d14e61ca67b4104866233d974bf 100644 --- a/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/candidate/manifest.json +++ b/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/candidate/manifest.json @@ -5,55 +5,55 @@ "original": [ { "guid": [ - 210, - 210, - 26, - 68, - 171, - 53, - 125, - 65, - 151, - 57, - 103, - 167, - 162, - 188, - 127, - 168 + 175, + 123, + 97, + 206, + 108, + 194, + 220, + 77, + 138, + 28, + 55, + 201, + 86, + 156, + 94, + 55 ], "level": 3, "position": "Keep", "space": "{D7B1788B-A971-08DE-3324-F4DF82A3B46E},1" } ], - "page_receipt": "Some(Published { revision: ExGuid { guid: [7, 195, 77, 199, 152, 133, 125, 74, 184, 130, 191, 29, 82, 132, 119, 53], n: 1 } })", + "page_receipt": "Some(Published { revision: ExGuid { guid: [79, 120, 169, 56, 85, 216, 92, 66, 186, 168, 228, 172, 109, 233, 127, 146], n: 1 } })", "phase": "07-promoted-root", "publications": 2, "reviewed": [ { "guid": [ - 210, - 210, - 26, - 68, - 171, - 53, - 125, - 65, - 151, - 57, - 103, - 167, - 162, - 188, - 127, - 168 + 175, + 123, + 97, + 206, + 108, + 194, + 220, + 77, + 138, + 28, + 55, + 201, + 86, + 156, + 94, + 55 ], "level": 3, "position": "Keep", "space": "{D7B1788B-A971-08DE-3324-F4DF82A3B46E},1" } ], - "text_receipt": "Some(Published { revision: ExGuid { guid: [76, 22, 86, 93, 17, 98, 89, 75, 180, 244, 69, 64, 214, 23, 130, 101], n: 1 } })" + "text_receipt": "Some(Published { revision: ExGuid { guid: [75, 41, 188, 149, 7, 39, 180, 68, 170, 28, 205, 70, 206, 229, 18, 154], n: 1 } })" } \ No newline at end of file diff --git a/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/commands.jsonl b/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/commands.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..7101e1503e501eaf0a232c407db1ec7eaad600e9 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/commands.jsonl @@ -0,0 +1,3 @@ +{"command": "powershell -NoProfile -Command \"Expand-Archive -LiteralPath C:\\one-tests\\transfer.zip -DestinationPath C:\\one-tests\\runs\\capture\\notebook\"", "exit": 0, "stdout": "", "stderr": "", "error": null} +{"command": "powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -File C:\\one-tests\\read-current.ps1 -Root C:\\one-tests\\runs\\capture -CloneHost ONE-M6-167FB3CD -ExpectedPages 9", "exit": 0, "stdout": "Read 1 sections and 9 pages.\r\n", "stderr": "", "error": null} +{"command": "powershell -NoProfile -Command \"Compress-Archive -Force -Path C:\\one-tests\\runs\\capture\\* -DestinationPath C:\\one-tests\\captured.zip\"", "exit": 0, "stdout": "", "stderr": "", "error": null} diff --git a/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/machine.json b/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/machine.json new file mode 100644 index 0000000000000000000000000000000000000000..029669b93ce8c6cf9727fa5b73dd9cce64aa1dc0 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/machine.json @@ -0,0 +1 @@ +{"name": "m6-167fb3cd", "hostname": "ONE-M6-167FB3CD"} diff --git a/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/notebook/Lifecycle.one b/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/notebook/Lifecycle.one index 44489c86a8c941aec1d276ae595e05db95e675ff..558894810fe128760aac818ce5a433c6c6135247 100644 Binary files a/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/notebook/Lifecycle.one and b/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/notebook/Lifecycle.one differ diff --git a/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/notebook/Open Notebook.onetoc2 b/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/notebook/Open Notebook.onetoc2 new file mode 100644 index 0000000000000000000000000000000000000000..5ace9b9df226ff5fa11d6163af4f697287e07ff2 Binary files /dev/null and b/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/notebook/Open Notebook.onetoc2 differ diff --git a/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/read/environment.json b/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/read/environment.json new file mode 100644 index 0000000000000000000000000000000000000000..853c82ea692b24b296d3e2a005f627467fb023fd --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/read/environment.json @@ -0,0 +1,7 @@ +{ + "powershell": "5.1.14409.1005", + "schema": "xs2010", + "hostname": "ONE-M6-167FB3CD", + "cold": true, + "onenote": "14.0.4763.1000" +} diff --git a/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/read/hierarchy.xml b/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/read/hierarchy.xml index f464c4f9371f02ab41f5b4890425cfc13813aedc..4373e827881d84af6cf4ea5a0da0c4c4077694f4 100644 --- a/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/read/hierarchy.xml +++ b/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/read/hierarchy.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/read/page-000.xml b/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/read/page-000.xml index 2c8de41793179a2a6cb34149464e6caa8a2fbe85..65f161066512c9892c60b0548d6e954300801ea5 100644 --- a/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/read/page-000.xml +++ b/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/read/page-000.xml @@ -1,4 +1,4 @@  -Body trailing 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/read/page-001.xml b/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/read/page-001.xml index d34d3de9948549ac57a53696f907d5b0286bd5fb..e2f610785af96108eda59201c985a12482c7e809 100644 --- a/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/read/page-001.xml +++ b/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/read/page-001.xml @@ -1,4 +1,4 @@  -Body duplicate 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/read/page-002.xml b/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/read/page-002.xml index 0962294e321b89491a8b0fe94c66f3d4126d1719..f4e5001e74771fbbdcbded50887ffabcfbd18e75 100644 --- a/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/read/page-002.xml +++ b/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/read/page-002.xml @@ -1,4 +1,4 @@  -Body automatic 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/read/page-003.xml b/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/read/page-003.xml index 6b7dff0a785f95904084cba7b26337061a9ed8e8..1c51d370fb8ce9f8d735cc1ec7ed708cffb40cfe 100644 --- a/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/read/page-003.xml +++ b/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/read/page-003.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/read/page-004.xml b/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/read/page-004.xml index ffd74309e7121732443d89c4822e978ac3c12bea..2ce08db703c28561135f2144af2fb0bf47c56b22 100644 --- a/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/read/page-004.xml +++ b/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/read/page-004.xml @@ -1,4 +1,4 @@  -Body grandchild 🦀 éOffline Body parent 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/read/page-005.xml b/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/read/page-005.xml index bda9a32d0e2d6a834a028a7fb73f1b39ca62b478..8d7cc733ef6edf2e0bae078dc974d4ee94d39735 100644 --- a/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/read/page-005.xml +++ b/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/read/page-005.xml @@ -1,4 +1,4 @@  -Offline Body parent 🦀 éBody grandchild 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/read/page-006.xml b/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/read/page-006.xml index 9b65f28b3324a4cdc4fc9940cc6ce89103c5b73b..df7fb31488b7f69d6bdc649574ad9773b9435372 100644 --- a/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/read/page-006.xml +++ b/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/read/page-006.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/read/page-007.xml b/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/read/page-007.xml index 7cc29f161b7df2b0672bd088e4cea23544a4d3ba..5455b63da21e09c2eb29c8f8f0cef241be58daad 100644 --- a/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/read/page-007.xml +++ b/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/read/page-007.xml @@ -1,4 +1,4 @@  -Body child 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/read/page-008.xml b/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/read/page-008.xml index b5d4452da63a2d7c43633d995410f9147db98ac7..e79a645a377d9e4d93274a446b5733405d44e983 100644 --- a/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/read/page-008.xml +++ b/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/read/page-008.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/read/payloads.json b/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/read/payloads.json new file mode 100644 index 0000000000000000000000000000000000000000..1ce91a413d6fff4d58765187b76756f0e97ae843 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/read/payloads.json @@ -0,0 +1,3 @@ +[ + +] \ No newline at end of file diff --git a/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/run.json b/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/run.json new file mode 100644 index 0000000000000000000000000000000000000000..24e96394c7f20126b7d5792187e2d2a2764dd52f --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/run.json @@ -0,0 +1,18 @@ +{ + "notebook": "/private/var/folders/90/4f4rngds01j55ggdj_vglk_c0000gn/T/tmpksr_pqio", + "expected_pages": 9, + "author": null, + "author_timeout_seconds": 600, + "inspect": false, + "collect_notebook": true, + "base": { + "file": "win7-office-base.qcow2", + "format": "qcow2", + "sha256": "a1a4f8fab782ee14885ff801ca2f6347c208fdcfc3513637096f314315c89346", + "virtual_size": 68719476736 + }, + "scripts": { + "cold.ps1": "c177fc72ae6c2634d186f5671a880de20b09f9716532c37c69cb13aa15c7e331", + "read.ps1": "04013bfcccee40a17e2a225f9b9e96f40a3a8daad9e350609654f8eda3ccbb41" + } +} diff --git a/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/scripts/cold.ps1 b/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/scripts/cold.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..a0b99e7aeb86f4dc10032537800501a52ad65b4f --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/scripts/cold.ps1 @@ -0,0 +1,27 @@ +param([Parameter(Mandatory=$true)][string]$Root, [string]$CloneHost = '') +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' +$root = [IO.Path]::GetFullPath($Root).TrimEnd('\') +if ([IO.Path]::GetDirectoryName($root) -ne 'C:\one-tests\runs') { + throw 'Choose a run directly below C:\one-tests\runs.' +} +if (Get-Process ONENOTE -ErrorAction SilentlyContinue) { throw 'Close OneNote before resetting its test cache.' } +$key = 'HKCU:\Software\Microsoft\Office\14.0\OneNote' +if ($CloneHost) { + if ($CloneHost -notmatch '^ONE-[A-Z0-9-]+$' -or [Environment]::MachineName -ne $CloneHost) { + throw 'The disposable clone hostname does not match this machine.' + } + New-Item "$key\Options\Paths" -Force | Out-Null + New-ItemProperty "$key\Options\Paths" -Name UnfiledNotesSection -PropertyType ExpandString -Value 'C:\one-tests\Loose.one' -Force | Out-Null +} elseif ((Get-ItemProperty "$key\Options\Paths").UnfiledNotesSection -ne 'C:\one-tests\Loose.one' -or + -not (Test-Path 'C:\one-tests\profile-original-cache')) { + throw 'Park the personal OneNote profile before resetting the test cache.' +} +$cache = Join-Path $env:LOCALAPPDATA 'Microsoft\OneNote\14.0' +$parked = Join-Path 'C:\one-tests\caches' ([IO.Path]::GetFileName($root)) +if (Test-Path $parked) { throw 'Choose a new run; its parked cache already exists.' } +New-Item -ItemType Directory -Path 'C:\one-tests\caches' -Force | Out-Null +if (Test-Path $cache) { Move-Item -LiteralPath $cache -Destination $parked } +if (Test-Path "$key\OpenNotebooks") { Remove-Item "$key\OpenNotebooks" -Recurse } +New-Item "$key\OpenNotebooks" | Out-Null +New-ItemProperty "$key\OpenNotebooks" -Name '1' -PropertyType String -Value "$root\notebook" | Out-Null diff --git a/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/scripts/read.ps1 b/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/scripts/read.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..476094ab1e0c47077988a6461db2080cf208642b --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/scripts/read.ps1 @@ -0,0 +1,142 @@ +param( + [Parameter(Mandatory=$true)][string]$Root, + [int]$ExpectedPages = -1, + [switch]$UseCurrentCache, + [switch]$Pdf, + [switch]$KeepOpen, + [string]$CloneHost = '' +) +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' +$root = [IO.Path]::GetFullPath($Root).TrimEnd('\') +if ([IO.Path]::GetDirectoryName($root) -ne 'C:\one-tests\runs') { + throw 'Choose a run directly below C:\one-tests\runs.' +} +$notebook = Join-Path $root 'notebook' +$output = Join-Path $root 'read' +if (Test-Path $output) { throw 'Choose a new read destination.' } +if ($UseCurrentCache) { + if ((Get-ItemProperty 'HKCU:\Software\Microsoft\Office\14.0\OneNote\Options\Paths').UnfiledNotesSection -ne 'C:\one-tests\Loose.one') { + throw 'Park the personal OneNote profile before reading test notebooks.' + } +} else { + & "$PSScriptRoot\cold-current.ps1" -Root $root -CloneHost $CloneHost +} +New-Item -ItemType Directory -Path $output | Out-Null +$app = New-Object -ComObject OneNote.Application +$notebookId = '' +$failure = $null +try { + $app.OpenHierarchy($notebook, '', [ref]$notebookId, 0) + $process = Get-Process ONENOTE + @{ hostname = [Environment]::MachineName; onenote = $process.MainModule.FileVersionInfo.FileVersion; + powershell = $PSVersionTable.PSVersion.ToString(); schema = 'xs2010'; cold = (-not $UseCurrentCache.IsPresent) } | + ConvertTo-Json | Set-Content (Join-Path $output 'environment.json') -Encoding UTF8 + $sections = @() + foreach ($file in @(Get-ChildItem $notebook -Recurse | Where-Object { $_.Extension -eq '.one' })) { + $id = '' + $app.OpenHierarchy($file.FullName, '', [ref]$id, 0) + $sections += $id + } + $deadline = [DateTime]::UtcNow.AddSeconds(300) + $previous = '' + $lastChange = '' + $stableSince = [DateTime]::UtcNow + $settled = $false + do { + $pages = @{} + foreach ($section in $sections) { + $hierarchy = '' + $app.GetHierarchy($section, 4, [ref]$hierarchy, 1) + [xml]$xml = $hierarchy + foreach ($node in $xml.SelectNodes('//*[@path]')) { + if (-not $node.GetAttribute('path').StartsWith("$notebook\", [StringComparison]::OrdinalIgnoreCase)) { + throw 'OneNote opened a section outside the copied notebook.' + } + } + foreach ($node in $xml.SelectNodes('//*[local-name()="Page"]')) { + $id = $node.GetAttribute('ID') + $content = '' + $app.GetPageContent($id, [ref]$content, 1, 1) + $pages[$id] = $content + } + } + $signature = [String]::Join('|', @($pages.Keys | Sort-Object | ForEach-Object { $_ + $pages[$_] })) + if ($signature -ne $previous) { + $lastChange = $previous + $previous = $signature + $stableSince = [DateTime]::UtcNow + } + if ((($ExpectedPages -ge 0 -and $pages.Count -eq $ExpectedPages) -or + ($ExpectedPages -lt 0 -and $pages.Count -gt 0)) -and + ([DateTime]::UtcNow - $stableSince).TotalSeconds -ge 2) { $settled = $true; break } + Start-Sleep -Milliseconds 250 + } while ([DateTime]::UtcNow -lt $deadline) + if (-not $settled -or ($ExpectedPages -ge 0 -and $pages.Count -ne $ExpectedPages) -or ($ExpectedPages -lt 0 -and $pages.Count -eq 0)) { + [IO.File]::WriteAllText((Join-Path $output 'previous-signature.txt'), $lastChange, [Text.Encoding]::UTF8) + $index = 0 + foreach ($id in @($pages.Keys | Sort-Object)) { + [IO.File]::WriteAllText((Join-Path $output ('unsettled-{0:d3}.xml' -f $index)), $pages[$id], [Text.Encoding]::UTF8) + $index++ + } + $hierarchy = '' + $app.GetHierarchy($notebookId, 4, [ref]$hierarchy, 1) + [IO.File]::WriteAllText((Join-Path $output 'unsettled-hierarchy.xml'), $hierarchy, [Text.Encoding]::UTF8) + throw "Expected $ExpectedPages stable pages; OneNote returned $($pages.Count), settled=$settled." + } + $index = 0 + $payloads = @() + foreach ($id in @($pages.Keys | Sort-Object)) { + [IO.File]::WriteAllText((Join-Path $output ('page-{0:d3}.xml' -f $index)), $pages[$id], [Text.Encoding]::UTF8) + if ($Pdf) { + $pdfPath = Join-Path $output ('page-{0:d3}.pdf' -f $index) + $app.NavigateTo($id, '', $false) + $app.Publish($id, $pdfPath, 3, '') + if (-not (Test-Path $pdfPath) -or (Get-Item $pdfPath).Length -eq 0) { throw 'OneNote did not publish the page PDF.' } + } + [xml]$page = $pages[$id] + foreach ($file in $page.SelectNodes('//*[local-name()="InsertedFile" or local-name()="MediaFile"]')) { + $bytes = [IO.File]::ReadAllBytes($file.GetAttribute('pathCache')) + $hash = [BitConverter]::ToString([Security.Cryptography.SHA256]::Create().ComputeHash($bytes)).Replace('-', '').ToLowerInvariant() + [IO.File]::WriteAllBytes((Join-Path $output ($hash + '.attachment')), $bytes) + $payloads += @{ page = $id; object = $file.ParentNode.GetAttribute('objectID'); + kind = $file.LocalName; name = $file.GetAttribute('preferredName'); + sha256 = $hash; bytes = $bytes.Length } + } + $index++ + } + [IO.File]::WriteAllText((Join-Path $output 'payloads.json'), (ConvertTo-Json -InputObject $payloads -Depth 4), [Text.Encoding]::UTF8) + $all = '' + $app.GetHierarchy($notebookId, 4, [ref]$all, 1) + [xml]$finalTree = $all + $finalIds = @($finalTree.SelectNodes('//*[local-name()="Page"]') | ForEach-Object { $_.GetAttribute('ID') } | Sort-Object -Unique) + if ($finalIds.Count -ne $pages.Count -or @($finalIds | Where-Object { -not $pages.ContainsKey($_) }).Count -ne 0) { + throw 'The notebook hierarchy changed while collecting page evidence; repeat the cold read.' + } + [IO.File]::WriteAllText((Join-Path $output 'hierarchy.xml'), $all, [Text.Encoding]::UTF8) + Write-Output "Read $($sections.Count) sections and $($pages.Count) pages." +} catch { + $failure = $_ + [IO.File]::WriteAllText((Join-Path $output 'failure.txt'), ($_ | Out-String), [Text.Encoding]::UTF8) + throw +} finally { + try { + try { + if ($notebookId -and $CloneHost) { $app.SyncHierarchy($notebookId) } + if ($notebookId -and -not $KeepOpen -and (-not $UseCurrentCache -or $CloneHost)) { + $app.CloseNotebook($notebookId, $false) + } + } catch { + if ($null -eq $failure) { throw } + [IO.File]::WriteAllText((Join-Path $output 'cleanup-failure.txt'), ($_ | Out-String), [Text.Encoding]::UTF8) + } + } finally { + [void][Runtime.InteropServices.Marshal]::FinalReleaseComObject($app) + } + $app = $null + [GC]::Collect() + [GC]::WaitForPendingFinalizers() + if (-not $UseCurrentCache -and -not $CloneHost) { + Get-Process ONENOTE -ErrorAction SilentlyContinue | Wait-Process -Timeout 10 + } +} diff --git a/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/source.json b/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/source.json new file mode 100644 index 0000000000000000000000000000000000000000..621e90f83cf59c0839412fc247f801f25c87cc72 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/source.json @@ -0,0 +1,8 @@ +[ + { + "path": "Lifecycle.one", + "bytes": 73840, + "sha256": "0d48cefd731266249f136cf48bf70e1899942e390a3c40bec04b058c8b20c738", + "mtime_ns": 1789121643082641295 + } +] diff --git a/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/teardown.json b/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/teardown.json new file mode 100644 index 0000000000000000000000000000000000000000..05a47793de40f322e745c4c4183727e3590ecf70 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-07-promoted-root/cold/teardown.json @@ -0,0 +1 @@ +{"absent": true} diff --git a/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/candidate/Lifecycle.one b/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/candidate/Lifecycle.one index bdc11818051de98d9b52000a661dff0fbfdfbadf..9131addd8bfd2ad0c09b3f873a82a3b989bf024d 100644 Binary files a/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/candidate/Lifecycle.one and b/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/candidate/Lifecycle.one differ diff --git a/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/candidate/manifest.json b/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/candidate/manifest.json index b5d7635092313496e7c077a420f258ac6743c478..cf5587fbaf067d17baedcdd54fa69dc5a9085584 100644 --- a/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/candidate/manifest.json +++ b/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/candidate/manifest.json @@ -5,22 +5,22 @@ "original": [ { "guid": [ - 88, - 101, - 118, - 0, - 26, - 164, - 204, - 65, - 188, - 144, - 52, - 96, - 130, - 42, - 72, - 63 + 171, + 248, + 136, + 129, + 212, + 11, + 108, + 77, + 149, + 248, + 22, + 152, + 9, + 109, + 139, + 211 ], "level": 3, "position": "Keep", @@ -33,27 +33,27 @@ "reviewed": [ { "guid": [ - 88, - 101, - 118, - 0, - 26, - 164, - 204, - 65, - 188, - 144, - 52, - 96, - 130, - 42, - 72, - 63 + 171, + 248, + 136, + 129, + 212, + 11, + 108, + 77, + 149, + 248, + 22, + 152, + 9, + 109, + 139, + 211 ], "level": 1, "position": "Keep", "space": "{D7B1788B-A971-08DE-3324-F4DF82A3B46E},1" } ], - "text_receipt": "Some(Published { revision: ExGuid { guid: [63, 218, 209, 6, 29, 105, 228, 72, 152, 18, 66, 236, 91, 189, 126, 66], n: 1 } })" + "text_receipt": "Some(Published { revision: ExGuid { guid: [42, 58, 126, 229, 35, 58, 169, 74, 188, 104, 21, 241, 204, 28, 207, 39], n: 1 } })" } \ No newline at end of file diff --git a/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/commands.jsonl b/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/commands.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..fce0989edbcda9fe3de0ff24531aed698b20c2c9 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/commands.jsonl @@ -0,0 +1,3 @@ +{"command": "powershell -NoProfile -Command \"Expand-Archive -LiteralPath C:\\one-tests\\transfer.zip -DestinationPath C:\\one-tests\\runs\\capture\\notebook\"", "exit": 0, "stdout": "", "stderr": "", "error": null} +{"command": "powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -File C:\\one-tests\\read-current.ps1 -Root C:\\one-tests\\runs\\capture -CloneHost ONE-M6-9D58611A -ExpectedPages 9", "exit": 0, "stdout": "Read 1 sections and 9 pages.\r\n", "stderr": "", "error": null} +{"command": "powershell -NoProfile -Command \"Compress-Archive -Force -Path C:\\one-tests\\runs\\capture\\* -DestinationPath C:\\one-tests\\captured.zip\"", "exit": 0, "stdout": "", "stderr": "", "error": null} diff --git a/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/machine.json b/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/machine.json new file mode 100644 index 0000000000000000000000000000000000000000..439f28a034bd42eed165cb7cb8832460f42fd91b --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/machine.json @@ -0,0 +1 @@ +{"name": "m6-9d58611a", "hostname": "ONE-M6-9D58611A"} diff --git a/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/notebook/Lifecycle.one b/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/notebook/Lifecycle.one index 71f96c1dfc2ff71c4b401f0055ccff4777513c3e..3e87f2afc4b140ccd8705dab28060a2875fcee3e 100644 Binary files a/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/notebook/Lifecycle.one and b/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/notebook/Lifecycle.one differ diff --git a/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/notebook/Open Notebook.onetoc2 b/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/notebook/Open Notebook.onetoc2 new file mode 100644 index 0000000000000000000000000000000000000000..90b5889be625b1db32df4c14bd21878dd252b6b9 Binary files /dev/null and b/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/notebook/Open Notebook.onetoc2 differ diff --git a/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/read/environment.json b/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/read/environment.json new file mode 100644 index 0000000000000000000000000000000000000000..0b840965d26cee7c4bae004b01c8ff871fd8ce55 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/read/environment.json @@ -0,0 +1,7 @@ +{ + "powershell": "5.1.14409.1005", + "schema": "xs2010", + "hostname": "ONE-M6-9D58611A", + "cold": true, + "onenote": "14.0.4763.1000" +} diff --git a/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/read/hierarchy.xml b/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/read/hierarchy.xml index 5719aa26227e2c14f74e014ad355e044c8815449..e8ffec2d29bea629550393532fc365b9368d3549 100644 --- a/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/read/hierarchy.xml +++ b/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/read/hierarchy.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/read/page-000.xml b/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/read/page-000.xml index 51299b44b7a94a0c682cd2c9c960cd4846650195..56e73e5d6b9a0440368828b05432229cc8be96a3 100644 --- a/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/read/page-000.xml +++ b/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/read/page-000.xml @@ -1,4 +1,4 @@  -Body duplicate 🦀 éBody trailing 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/read/page-001.xml b/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/read/page-001.xml index e7361b989c43e0f1513ed106c50c1107b15f6447..feb30185e34fa53327cb296302751683520edd73 100644 --- a/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/read/page-001.xml +++ b/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/read/page-001.xml @@ -1,4 +1,4 @@  -Body automatic 🦀 éBody duplicate 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/read/page-002.xml b/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/read/page-002.xml index d6e89b60ca4a0a122b7e401330ce08c3e3edae46..612f077bd98e100059bc5738170c79c305789450 100644 --- a/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/read/page-002.xml +++ b/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/read/page-002.xml @@ -1,4 +1,4 @@  -Body trailing 🦀 éBody automatic 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/read/page-003.xml b/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/read/page-003.xml index d1185a10588878ac61679697e79a4cb46f5bf611..a809d8b795d71659699429627f3ddbd610059ad7 100644 --- a/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/read/page-003.xml +++ b/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/read/page-003.xml @@ -1,4 +1,2 @@  -Body child 🦀 é preserved]]> + diff --git a/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/read/page-004.xml b/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/read/page-004.xml index f740f86068f16965989e32574c8d4c7f5a1c358d..3aee5a97d214b5da9a124004d5b1a9eabbc637ab 100644 --- a/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/read/page-004.xml +++ b/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/read/page-004.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/read/page-005.xml b/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/read/page-005.xml index b78519adb1eadd14afb1fa5276c585ee24d7c862..b46710a47ec47e7d5723c50214ecb19a06f576cf 100644 --- a/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/read/page-005.xml +++ b/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/read/page-005.xml @@ -1,2 +1,4 @@  - +Offline Body parent 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/read/page-006.xml b/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/read/page-006.xml index ff20ffaa509355ba4e87e9764ed2acb68f3d454b..6cedc8afdc3e2da08169868c7a6d6e7e41bfebad 100644 --- a/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/read/page-006.xml +++ b/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/read/page-006.xml @@ -1,4 +1,4 @@  -Body grandchild 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/read/page-007.xml b/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/read/page-007.xml index be9c65c3b53e2228702629fa2fbb20227520b660..1b87ab56e1830834fa4ff8e58632ec5853573e8c 100644 --- a/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/read/page-007.xml +++ b/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/read/page-007.xml @@ -1,4 +1,2 @@  -Offline Body parent 🦀 é preserved]]> + diff --git a/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/read/page-008.xml b/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/read/page-008.xml index f28319de24b583552f7a9dbb73e47a5bbf5546de..3629078679ce43fd4e72b7610f4b232b5a3f253e 100644 --- a/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/read/page-008.xml +++ b/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/read/page-008.xml @@ -1,2 +1,4 @@  - +Body child 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/read/payloads.json b/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/read/payloads.json new file mode 100644 index 0000000000000000000000000000000000000000..1ce91a413d6fff4d58765187b76756f0e97ae843 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/read/payloads.json @@ -0,0 +1,3 @@ +[ + +] \ No newline at end of file diff --git a/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/run.json b/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/run.json new file mode 100644 index 0000000000000000000000000000000000000000..344c3194decb95ca5eace5fb833fe1c7fd372765 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/run.json @@ -0,0 +1,18 @@ +{ + "notebook": "/private/var/folders/90/4f4rngds01j55ggdj_vglk_c0000gn/T/tmp9pe3v7df", + "expected_pages": 9, + "author": null, + "author_timeout_seconds": 600, + "inspect": false, + "collect_notebook": true, + "base": { + "file": "win7-office-base.qcow2", + "format": "qcow2", + "sha256": "a1a4f8fab782ee14885ff801ca2f6347c208fdcfc3513637096f314315c89346", + "virtual_size": 68719476736 + }, + "scripts": { + "cold.ps1": "c177fc72ae6c2634d186f5671a880de20b09f9716532c37c69cb13aa15c7e331", + "read.ps1": "04013bfcccee40a17e2a225f9b9e96f40a3a8daad9e350609654f8eda3ccbb41" + } +} diff --git a/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/scripts/cold.ps1 b/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/scripts/cold.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..a0b99e7aeb86f4dc10032537800501a52ad65b4f --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/scripts/cold.ps1 @@ -0,0 +1,27 @@ +param([Parameter(Mandatory=$true)][string]$Root, [string]$CloneHost = '') +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' +$root = [IO.Path]::GetFullPath($Root).TrimEnd('\') +if ([IO.Path]::GetDirectoryName($root) -ne 'C:\one-tests\runs') { + throw 'Choose a run directly below C:\one-tests\runs.' +} +if (Get-Process ONENOTE -ErrorAction SilentlyContinue) { throw 'Close OneNote before resetting its test cache.' } +$key = 'HKCU:\Software\Microsoft\Office\14.0\OneNote' +if ($CloneHost) { + if ($CloneHost -notmatch '^ONE-[A-Z0-9-]+$' -or [Environment]::MachineName -ne $CloneHost) { + throw 'The disposable clone hostname does not match this machine.' + } + New-Item "$key\Options\Paths" -Force | Out-Null + New-ItemProperty "$key\Options\Paths" -Name UnfiledNotesSection -PropertyType ExpandString -Value 'C:\one-tests\Loose.one' -Force | Out-Null +} elseif ((Get-ItemProperty "$key\Options\Paths").UnfiledNotesSection -ne 'C:\one-tests\Loose.one' -or + -not (Test-Path 'C:\one-tests\profile-original-cache')) { + throw 'Park the personal OneNote profile before resetting the test cache.' +} +$cache = Join-Path $env:LOCALAPPDATA 'Microsoft\OneNote\14.0' +$parked = Join-Path 'C:\one-tests\caches' ([IO.Path]::GetFileName($root)) +if (Test-Path $parked) { throw 'Choose a new run; its parked cache already exists.' } +New-Item -ItemType Directory -Path 'C:\one-tests\caches' -Force | Out-Null +if (Test-Path $cache) { Move-Item -LiteralPath $cache -Destination $parked } +if (Test-Path "$key\OpenNotebooks") { Remove-Item "$key\OpenNotebooks" -Recurse } +New-Item "$key\OpenNotebooks" | Out-Null +New-ItemProperty "$key\OpenNotebooks" -Name '1' -PropertyType String -Value "$root\notebook" | Out-Null diff --git a/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/scripts/read.ps1 b/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/scripts/read.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..476094ab1e0c47077988a6461db2080cf208642b --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/scripts/read.ps1 @@ -0,0 +1,142 @@ +param( + [Parameter(Mandatory=$true)][string]$Root, + [int]$ExpectedPages = -1, + [switch]$UseCurrentCache, + [switch]$Pdf, + [switch]$KeepOpen, + [string]$CloneHost = '' +) +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' +$root = [IO.Path]::GetFullPath($Root).TrimEnd('\') +if ([IO.Path]::GetDirectoryName($root) -ne 'C:\one-tests\runs') { + throw 'Choose a run directly below C:\one-tests\runs.' +} +$notebook = Join-Path $root 'notebook' +$output = Join-Path $root 'read' +if (Test-Path $output) { throw 'Choose a new read destination.' } +if ($UseCurrentCache) { + if ((Get-ItemProperty 'HKCU:\Software\Microsoft\Office\14.0\OneNote\Options\Paths').UnfiledNotesSection -ne 'C:\one-tests\Loose.one') { + throw 'Park the personal OneNote profile before reading test notebooks.' + } +} else { + & "$PSScriptRoot\cold-current.ps1" -Root $root -CloneHost $CloneHost +} +New-Item -ItemType Directory -Path $output | Out-Null +$app = New-Object -ComObject OneNote.Application +$notebookId = '' +$failure = $null +try { + $app.OpenHierarchy($notebook, '', [ref]$notebookId, 0) + $process = Get-Process ONENOTE + @{ hostname = [Environment]::MachineName; onenote = $process.MainModule.FileVersionInfo.FileVersion; + powershell = $PSVersionTable.PSVersion.ToString(); schema = 'xs2010'; cold = (-not $UseCurrentCache.IsPresent) } | + ConvertTo-Json | Set-Content (Join-Path $output 'environment.json') -Encoding UTF8 + $sections = @() + foreach ($file in @(Get-ChildItem $notebook -Recurse | Where-Object { $_.Extension -eq '.one' })) { + $id = '' + $app.OpenHierarchy($file.FullName, '', [ref]$id, 0) + $sections += $id + } + $deadline = [DateTime]::UtcNow.AddSeconds(300) + $previous = '' + $lastChange = '' + $stableSince = [DateTime]::UtcNow + $settled = $false + do { + $pages = @{} + foreach ($section in $sections) { + $hierarchy = '' + $app.GetHierarchy($section, 4, [ref]$hierarchy, 1) + [xml]$xml = $hierarchy + foreach ($node in $xml.SelectNodes('//*[@path]')) { + if (-not $node.GetAttribute('path').StartsWith("$notebook\", [StringComparison]::OrdinalIgnoreCase)) { + throw 'OneNote opened a section outside the copied notebook.' + } + } + foreach ($node in $xml.SelectNodes('//*[local-name()="Page"]')) { + $id = $node.GetAttribute('ID') + $content = '' + $app.GetPageContent($id, [ref]$content, 1, 1) + $pages[$id] = $content + } + } + $signature = [String]::Join('|', @($pages.Keys | Sort-Object | ForEach-Object { $_ + $pages[$_] })) + if ($signature -ne $previous) { + $lastChange = $previous + $previous = $signature + $stableSince = [DateTime]::UtcNow + } + if ((($ExpectedPages -ge 0 -and $pages.Count -eq $ExpectedPages) -or + ($ExpectedPages -lt 0 -and $pages.Count -gt 0)) -and + ([DateTime]::UtcNow - $stableSince).TotalSeconds -ge 2) { $settled = $true; break } + Start-Sleep -Milliseconds 250 + } while ([DateTime]::UtcNow -lt $deadline) + if (-not $settled -or ($ExpectedPages -ge 0 -and $pages.Count -ne $ExpectedPages) -or ($ExpectedPages -lt 0 -and $pages.Count -eq 0)) { + [IO.File]::WriteAllText((Join-Path $output 'previous-signature.txt'), $lastChange, [Text.Encoding]::UTF8) + $index = 0 + foreach ($id in @($pages.Keys | Sort-Object)) { + [IO.File]::WriteAllText((Join-Path $output ('unsettled-{0:d3}.xml' -f $index)), $pages[$id], [Text.Encoding]::UTF8) + $index++ + } + $hierarchy = '' + $app.GetHierarchy($notebookId, 4, [ref]$hierarchy, 1) + [IO.File]::WriteAllText((Join-Path $output 'unsettled-hierarchy.xml'), $hierarchy, [Text.Encoding]::UTF8) + throw "Expected $ExpectedPages stable pages; OneNote returned $($pages.Count), settled=$settled." + } + $index = 0 + $payloads = @() + foreach ($id in @($pages.Keys | Sort-Object)) { + [IO.File]::WriteAllText((Join-Path $output ('page-{0:d3}.xml' -f $index)), $pages[$id], [Text.Encoding]::UTF8) + if ($Pdf) { + $pdfPath = Join-Path $output ('page-{0:d3}.pdf' -f $index) + $app.NavigateTo($id, '', $false) + $app.Publish($id, $pdfPath, 3, '') + if (-not (Test-Path $pdfPath) -or (Get-Item $pdfPath).Length -eq 0) { throw 'OneNote did not publish the page PDF.' } + } + [xml]$page = $pages[$id] + foreach ($file in $page.SelectNodes('//*[local-name()="InsertedFile" or local-name()="MediaFile"]')) { + $bytes = [IO.File]::ReadAllBytes($file.GetAttribute('pathCache')) + $hash = [BitConverter]::ToString([Security.Cryptography.SHA256]::Create().ComputeHash($bytes)).Replace('-', '').ToLowerInvariant() + [IO.File]::WriteAllBytes((Join-Path $output ($hash + '.attachment')), $bytes) + $payloads += @{ page = $id; object = $file.ParentNode.GetAttribute('objectID'); + kind = $file.LocalName; name = $file.GetAttribute('preferredName'); + sha256 = $hash; bytes = $bytes.Length } + } + $index++ + } + [IO.File]::WriteAllText((Join-Path $output 'payloads.json'), (ConvertTo-Json -InputObject $payloads -Depth 4), [Text.Encoding]::UTF8) + $all = '' + $app.GetHierarchy($notebookId, 4, [ref]$all, 1) + [xml]$finalTree = $all + $finalIds = @($finalTree.SelectNodes('//*[local-name()="Page"]') | ForEach-Object { $_.GetAttribute('ID') } | Sort-Object -Unique) + if ($finalIds.Count -ne $pages.Count -or @($finalIds | Where-Object { -not $pages.ContainsKey($_) }).Count -ne 0) { + throw 'The notebook hierarchy changed while collecting page evidence; repeat the cold read.' + } + [IO.File]::WriteAllText((Join-Path $output 'hierarchy.xml'), $all, [Text.Encoding]::UTF8) + Write-Output "Read $($sections.Count) sections and $($pages.Count) pages." +} catch { + $failure = $_ + [IO.File]::WriteAllText((Join-Path $output 'failure.txt'), ($_ | Out-String), [Text.Encoding]::UTF8) + throw +} finally { + try { + try { + if ($notebookId -and $CloneHost) { $app.SyncHierarchy($notebookId) } + if ($notebookId -and -not $KeepOpen -and (-not $UseCurrentCache -or $CloneHost)) { + $app.CloseNotebook($notebookId, $false) + } + } catch { + if ($null -eq $failure) { throw } + [IO.File]::WriteAllText((Join-Path $output 'cleanup-failure.txt'), ($_ | Out-String), [Text.Encoding]::UTF8) + } + } finally { + [void][Runtime.InteropServices.Marshal]::FinalReleaseComObject($app) + } + $app = $null + [GC]::Collect() + [GC]::WaitForPendingFinalizers() + if (-not $UseCurrentCache -and -not $CloneHost) { + Get-Process ONENOTE -ErrorAction SilentlyContinue | Wait-Process -Timeout 10 + } +} diff --git a/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/source.json b/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/source.json new file mode 100644 index 0000000000000000000000000000000000000000..7d97bed80d9d1bc20e03a606a485b78ad526bbec --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/source.json @@ -0,0 +1,8 @@ +[ + { + "path": "Lifecycle.one", + "bytes": 74056, + "sha256": "c4ff8e01f64f3ad05e44ae4ff1dd65286985d7b3ffee478d42e7e0ea41d55024", + "mtime_ns": 1789121643503140348 + } +] diff --git a/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/teardown.json b/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/teardown.json new file mode 100644 index 0000000000000000000000000000000000000000..05a47793de40f322e745c4c4183727e3590ecf70 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-08-collapsed-group-move/cold/teardown.json @@ -0,0 +1 @@ +{"absent": true} diff --git a/corpus/page-lifecycle/offline-edits/indent-single-page/candidate/Lifecycle.one b/corpus/page-lifecycle/offline-edits/indent-single-page/candidate/Lifecycle.one index 1866250830de0a4bb4f3013d6d6d2e312eacb029..fc561d753d7f98a3fde10c33a45229cdab44530a 100644 Binary files a/corpus/page-lifecycle/offline-edits/indent-single-page/candidate/Lifecycle.one and b/corpus/page-lifecycle/offline-edits/indent-single-page/candidate/Lifecycle.one differ diff --git a/corpus/page-lifecycle/offline-edits/indent-single-page/candidate/manifest.json b/corpus/page-lifecycle/offline-edits/indent-single-page/candidate/manifest.json index 76f934ad647c703e08c2e778d81e1c99f09f3cc7..837cbf1f4eea36e9f2c00761934d462a16aedb70 100644 --- a/corpus/page-lifecycle/offline-edits/indent-single-page/candidate/manifest.json +++ b/corpus/page-lifecycle/offline-edits/indent-single-page/candidate/manifest.json @@ -5,55 +5,55 @@ "original": [ { "guid": [ - 28, - 199, - 140, - 70, - 240, - 153, - 168, - 68, - 147, - 100, - 233, - 168, - 206, - 231, - 7, - 109 + 195, + 198, + 205, + 15, + 12, + 195, + 184, + 78, + 130, + 137, + 235, + 43, + 156, + 203, + 38, + 183 ], "level": 3, "position": "Keep", "space": "{D7B1788B-A971-08DE-3324-F4DF82A3B46E},1" } ], - "page_receipt": "Some(Published { revision: ExGuid { guid: [213, 111, 188, 48, 141, 241, 142, 66, 179, 253, 171, 140, 78, 79, 80, 17], n: 1 } })", + "page_receipt": "Some(Published { revision: ExGuid { guid: [61, 138, 189, 185, 241, 139, 240, 68, 161, 198, 230, 134, 1, 178, 224, 153], n: 1 } })", "phase": "single-page", "publications": 2, "reviewed": [ { "guid": [ - 28, - 199, - 140, - 70, - 240, - 153, - 168, - 68, - 147, - 100, - 233, - 168, - 206, - 231, - 7, - 109 + 195, + 198, + 205, + 15, + 12, + 195, + 184, + 78, + 130, + 137, + 235, + 43, + 156, + 203, + 38, + 183 ], "level": 3, "position": "Keep", "space": "{D7B1788B-A971-08DE-3324-F4DF82A3B46E},1" } ], - "text_receipt": "Some(Published { revision: ExGuid { guid: [158, 3, 104, 164, 172, 85, 63, 67, 179, 78, 186, 177, 165, 15, 164, 158], n: 1 } })" + "text_receipt": "Some(Published { revision: ExGuid { guid: [186, 78, 164, 233, 201, 228, 178, 71, 173, 26, 186, 189, 209, 102, 0, 202], n: 1 } })" } \ No newline at end of file diff --git a/corpus/page-lifecycle/offline-edits/indent-single-page/cold/commands.jsonl b/corpus/page-lifecycle/offline-edits/indent-single-page/cold/commands.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..5dd5b71b21b1d962e43a410b23c1dd668d0b8c6e --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-single-page/cold/commands.jsonl @@ -0,0 +1,3 @@ +{"command": "powershell -NoProfile -Command \"Expand-Archive -LiteralPath C:\\one-tests\\transfer.zip -DestinationPath C:\\one-tests\\runs\\capture\\notebook\"", "exit": 0, "stdout": "", "stderr": "", "error": null} +{"command": "powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -File C:\\one-tests\\read-current.ps1 -Root C:\\one-tests\\runs\\capture -CloneHost ONE-M6-060E8528 -ExpectedPages 9", "exit": 0, "stdout": "Read 1 sections and 9 pages.\r\n", "stderr": "", "error": null} +{"command": "powershell -NoProfile -Command \"Compress-Archive -Force -Path C:\\one-tests\\runs\\capture\\* -DestinationPath C:\\one-tests\\captured.zip\"", "exit": 0, "stdout": "", "stderr": "", "error": null} diff --git a/corpus/page-lifecycle/offline-edits/indent-single-page/cold/machine.json b/corpus/page-lifecycle/offline-edits/indent-single-page/cold/machine.json new file mode 100644 index 0000000000000000000000000000000000000000..2bb11facd1d5f4c2faeba7e3aa4ef7101bb8c064 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-single-page/cold/machine.json @@ -0,0 +1 @@ +{"name": "m6-060e8528", "hostname": "ONE-M6-060E8528"} diff --git a/corpus/page-lifecycle/offline-edits/indent-single-page/cold/notebook/Lifecycle.one b/corpus/page-lifecycle/offline-edits/indent-single-page/cold/notebook/Lifecycle.one index b6c5b9b115073afe02dcc47768bfca3787fcb8f0..ee8d26a82023af9db2d5344fda73c006ad219618 100644 Binary files a/corpus/page-lifecycle/offline-edits/indent-single-page/cold/notebook/Lifecycle.one and b/corpus/page-lifecycle/offline-edits/indent-single-page/cold/notebook/Lifecycle.one differ diff --git a/corpus/page-lifecycle/offline-edits/indent-single-page/cold/notebook/Open Notebook.onetoc2 b/corpus/page-lifecycle/offline-edits/indent-single-page/cold/notebook/Open Notebook.onetoc2 new file mode 100644 index 0000000000000000000000000000000000000000..5329e2757d718396297753e2ae1417c84436fe85 Binary files /dev/null and b/corpus/page-lifecycle/offline-edits/indent-single-page/cold/notebook/Open Notebook.onetoc2 differ diff --git a/corpus/page-lifecycle/offline-edits/indent-single-page/cold/read/environment.json b/corpus/page-lifecycle/offline-edits/indent-single-page/cold/read/environment.json new file mode 100644 index 0000000000000000000000000000000000000000..c89a0ee56a7fd5c8d0696fdad5768c4e0b99f6ca --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-single-page/cold/read/environment.json @@ -0,0 +1,7 @@ +{ + "powershell": "5.1.14409.1005", + "schema": "xs2010", + "hostname": "ONE-M6-060E8528", + "cold": true, + "onenote": "14.0.4763.1000" +} diff --git a/corpus/page-lifecycle/offline-edits/indent-single-page/cold/read/hierarchy.xml b/corpus/page-lifecycle/offline-edits/indent-single-page/cold/read/hierarchy.xml index b4925c33e29a7ed92d9d464c09d473267a5b2fa2..75a31bd668dba122923d54bce22a463b5c773e56 100644 --- a/corpus/page-lifecycle/offline-edits/indent-single-page/cold/read/hierarchy.xml +++ b/corpus/page-lifecycle/offline-edits/indent-single-page/cold/read/hierarchy.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/indent-single-page/cold/read/page-000.xml b/corpus/page-lifecycle/offline-edits/indent-single-page/cold/read/page-000.xml index 2fad3bcc8986f48cf03cfc898cc68cf86863acd6..c76898bb57e77d2d59f6a232506d978a3d3953ef 100644 --- a/corpus/page-lifecycle/offline-edits/indent-single-page/cold/read/page-000.xml +++ b/corpus/page-lifecycle/offline-edits/indent-single-page/cold/read/page-000.xml @@ -1,4 +1,2 @@  -Body child 🦀 é preserved]]> + diff --git a/corpus/page-lifecycle/offline-edits/indent-single-page/cold/read/page-001.xml b/corpus/page-lifecycle/offline-edits/indent-single-page/cold/read/page-001.xml index 74ee05b496a37a4498a375473a5f632d4f2088e1..5e28ec1948ee77ed02c44b2e7f9a44c93719b7b0 100644 --- a/corpus/page-lifecycle/offline-edits/indent-single-page/cold/read/page-001.xml +++ b/corpus/page-lifecycle/offline-edits/indent-single-page/cold/read/page-001.xml @@ -1,2 +1,4 @@  - +Offline Body parent 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/indent-single-page/cold/read/page-002.xml b/corpus/page-lifecycle/offline-edits/indent-single-page/cold/read/page-002.xml index 02566225479a211c5af801b132ad85ae26103547..c32295709a1ef8664ddf692f3e5c7e78e6af6864 100644 --- a/corpus/page-lifecycle/offline-edits/indent-single-page/cold/read/page-002.xml +++ b/corpus/page-lifecycle/offline-edits/indent-single-page/cold/read/page-002.xml @@ -1,4 +1,4 @@  -Offline Body parent 🦀 éBody grandchild 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/indent-single-page/cold/read/page-003.xml b/corpus/page-lifecycle/offline-edits/indent-single-page/cold/read/page-003.xml index c54bafd9f900c1fa83c87c3ab5cd70248b8f3cf6..85040b087c85c964bc6810744ab2600693e37461 100644 --- a/corpus/page-lifecycle/offline-edits/indent-single-page/cold/read/page-003.xml +++ b/corpus/page-lifecycle/offline-edits/indent-single-page/cold/read/page-003.xml @@ -1,4 +1,2 @@  -Body grandchild 🦀 é preserved]]> + diff --git a/corpus/page-lifecycle/offline-edits/indent-single-page/cold/read/page-004.xml b/corpus/page-lifecycle/offline-edits/indent-single-page/cold/read/page-004.xml index 9dd340e4be7f2510745aa68f1f0c45d93114ff89..d7f407f6a5985fcf3566750f925308a913793f72 100644 --- a/corpus/page-lifecycle/offline-edits/indent-single-page/cold/read/page-004.xml +++ b/corpus/page-lifecycle/offline-edits/indent-single-page/cold/read/page-004.xml @@ -1,2 +1,4 @@  - +Body child 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/indent-single-page/cold/read/page-005.xml b/corpus/page-lifecycle/offline-edits/indent-single-page/cold/read/page-005.xml index 821141b64b52ed4dc856337a4bf88c17ff9a00c8..2cbf463f0384bfdc9eae94f10c7061ccabda4df9 100644 --- a/corpus/page-lifecycle/offline-edits/indent-single-page/cold/read/page-005.xml +++ b/corpus/page-lifecycle/offline-edits/indent-single-page/cold/read/page-005.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/indent-single-page/cold/read/page-006.xml b/corpus/page-lifecycle/offline-edits/indent-single-page/cold/read/page-006.xml index ecb0e0214d1823e1a1fee5401341b5ebc17bf8dc..fe1aacd918e9c0e924568b0f29e2ed90ad473e32 100644 --- a/corpus/page-lifecycle/offline-edits/indent-single-page/cold/read/page-006.xml +++ b/corpus/page-lifecycle/offline-edits/indent-single-page/cold/read/page-006.xml @@ -1,4 +1,4 @@  -Body automatic 🦀 éBody trailing 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/indent-single-page/cold/read/page-007.xml b/corpus/page-lifecycle/offline-edits/indent-single-page/cold/read/page-007.xml index b9ac7efa88d60f73d8118bed77f95e6b38b12ce8..0a8f73a67566a6226265313e33a4138cfc5c5f62 100644 --- a/corpus/page-lifecycle/offline-edits/indent-single-page/cold/read/page-007.xml +++ b/corpus/page-lifecycle/offline-edits/indent-single-page/cold/read/page-007.xml @@ -1,4 +1,4 @@  -Body duplicate 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/indent-single-page/cold/read/page-008.xml b/corpus/page-lifecycle/offline-edits/indent-single-page/cold/read/page-008.xml index 560fe366effd777b9662921cf89120b13cacb515..d72195dbbe2ce3f613bc42ca5fce037726e89004 100644 --- a/corpus/page-lifecycle/offline-edits/indent-single-page/cold/read/page-008.xml +++ b/corpus/page-lifecycle/offline-edits/indent-single-page/cold/read/page-008.xml @@ -1,4 +1,4 @@  -Body trailing 🦀 éBody automatic 🦀 é preserved]]> diff --git a/corpus/page-lifecycle/offline-edits/indent-single-page/cold/read/payloads.json b/corpus/page-lifecycle/offline-edits/indent-single-page/cold/read/payloads.json new file mode 100644 index 0000000000000000000000000000000000000000..1ce91a413d6fff4d58765187b76756f0e97ae843 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-single-page/cold/read/payloads.json @@ -0,0 +1,3 @@ +[ + +] \ No newline at end of file diff --git a/corpus/page-lifecycle/offline-edits/indent-single-page/cold/run.json b/corpus/page-lifecycle/offline-edits/indent-single-page/cold/run.json new file mode 100644 index 0000000000000000000000000000000000000000..021acfed520e0fe1487b2a9de93cfdf529d6f9f7 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-single-page/cold/run.json @@ -0,0 +1,18 @@ +{ + "notebook": "/private/var/folders/90/4f4rngds01j55ggdj_vglk_c0000gn/T/tmp9_ggdkk6", + "expected_pages": 9, + "author": null, + "author_timeout_seconds": 600, + "inspect": false, + "collect_notebook": true, + "base": { + "file": "win7-office-base.qcow2", + "format": "qcow2", + "sha256": "a1a4f8fab782ee14885ff801ca2f6347c208fdcfc3513637096f314315c89346", + "virtual_size": 68719476736 + }, + "scripts": { + "cold.ps1": "c177fc72ae6c2634d186f5671a880de20b09f9716532c37c69cb13aa15c7e331", + "read.ps1": "04013bfcccee40a17e2a225f9b9e96f40a3a8daad9e350609654f8eda3ccbb41" + } +} diff --git a/corpus/page-lifecycle/offline-edits/indent-single-page/cold/scripts/cold.ps1 b/corpus/page-lifecycle/offline-edits/indent-single-page/cold/scripts/cold.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..a0b99e7aeb86f4dc10032537800501a52ad65b4f --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-single-page/cold/scripts/cold.ps1 @@ -0,0 +1,27 @@ +param([Parameter(Mandatory=$true)][string]$Root, [string]$CloneHost = '') +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' +$root = [IO.Path]::GetFullPath($Root).TrimEnd('\') +if ([IO.Path]::GetDirectoryName($root) -ne 'C:\one-tests\runs') { + throw 'Choose a run directly below C:\one-tests\runs.' +} +if (Get-Process ONENOTE -ErrorAction SilentlyContinue) { throw 'Close OneNote before resetting its test cache.' } +$key = 'HKCU:\Software\Microsoft\Office\14.0\OneNote' +if ($CloneHost) { + if ($CloneHost -notmatch '^ONE-[A-Z0-9-]+$' -or [Environment]::MachineName -ne $CloneHost) { + throw 'The disposable clone hostname does not match this machine.' + } + New-Item "$key\Options\Paths" -Force | Out-Null + New-ItemProperty "$key\Options\Paths" -Name UnfiledNotesSection -PropertyType ExpandString -Value 'C:\one-tests\Loose.one' -Force | Out-Null +} elseif ((Get-ItemProperty "$key\Options\Paths").UnfiledNotesSection -ne 'C:\one-tests\Loose.one' -or + -not (Test-Path 'C:\one-tests\profile-original-cache')) { + throw 'Park the personal OneNote profile before resetting the test cache.' +} +$cache = Join-Path $env:LOCALAPPDATA 'Microsoft\OneNote\14.0' +$parked = Join-Path 'C:\one-tests\caches' ([IO.Path]::GetFileName($root)) +if (Test-Path $parked) { throw 'Choose a new run; its parked cache already exists.' } +New-Item -ItemType Directory -Path 'C:\one-tests\caches' -Force | Out-Null +if (Test-Path $cache) { Move-Item -LiteralPath $cache -Destination $parked } +if (Test-Path "$key\OpenNotebooks") { Remove-Item "$key\OpenNotebooks" -Recurse } +New-Item "$key\OpenNotebooks" | Out-Null +New-ItemProperty "$key\OpenNotebooks" -Name '1' -PropertyType String -Value "$root\notebook" | Out-Null diff --git a/corpus/page-lifecycle/offline-edits/indent-single-page/cold/scripts/read.ps1 b/corpus/page-lifecycle/offline-edits/indent-single-page/cold/scripts/read.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..476094ab1e0c47077988a6461db2080cf208642b --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-single-page/cold/scripts/read.ps1 @@ -0,0 +1,142 @@ +param( + [Parameter(Mandatory=$true)][string]$Root, + [int]$ExpectedPages = -1, + [switch]$UseCurrentCache, + [switch]$Pdf, + [switch]$KeepOpen, + [string]$CloneHost = '' +) +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' +$root = [IO.Path]::GetFullPath($Root).TrimEnd('\') +if ([IO.Path]::GetDirectoryName($root) -ne 'C:\one-tests\runs') { + throw 'Choose a run directly below C:\one-tests\runs.' +} +$notebook = Join-Path $root 'notebook' +$output = Join-Path $root 'read' +if (Test-Path $output) { throw 'Choose a new read destination.' } +if ($UseCurrentCache) { + if ((Get-ItemProperty 'HKCU:\Software\Microsoft\Office\14.0\OneNote\Options\Paths').UnfiledNotesSection -ne 'C:\one-tests\Loose.one') { + throw 'Park the personal OneNote profile before reading test notebooks.' + } +} else { + & "$PSScriptRoot\cold-current.ps1" -Root $root -CloneHost $CloneHost +} +New-Item -ItemType Directory -Path $output | Out-Null +$app = New-Object -ComObject OneNote.Application +$notebookId = '' +$failure = $null +try { + $app.OpenHierarchy($notebook, '', [ref]$notebookId, 0) + $process = Get-Process ONENOTE + @{ hostname = [Environment]::MachineName; onenote = $process.MainModule.FileVersionInfo.FileVersion; + powershell = $PSVersionTable.PSVersion.ToString(); schema = 'xs2010'; cold = (-not $UseCurrentCache.IsPresent) } | + ConvertTo-Json | Set-Content (Join-Path $output 'environment.json') -Encoding UTF8 + $sections = @() + foreach ($file in @(Get-ChildItem $notebook -Recurse | Where-Object { $_.Extension -eq '.one' })) { + $id = '' + $app.OpenHierarchy($file.FullName, '', [ref]$id, 0) + $sections += $id + } + $deadline = [DateTime]::UtcNow.AddSeconds(300) + $previous = '' + $lastChange = '' + $stableSince = [DateTime]::UtcNow + $settled = $false + do { + $pages = @{} + foreach ($section in $sections) { + $hierarchy = '' + $app.GetHierarchy($section, 4, [ref]$hierarchy, 1) + [xml]$xml = $hierarchy + foreach ($node in $xml.SelectNodes('//*[@path]')) { + if (-not $node.GetAttribute('path').StartsWith("$notebook\", [StringComparison]::OrdinalIgnoreCase)) { + throw 'OneNote opened a section outside the copied notebook.' + } + } + foreach ($node in $xml.SelectNodes('//*[local-name()="Page"]')) { + $id = $node.GetAttribute('ID') + $content = '' + $app.GetPageContent($id, [ref]$content, 1, 1) + $pages[$id] = $content + } + } + $signature = [String]::Join('|', @($pages.Keys | Sort-Object | ForEach-Object { $_ + $pages[$_] })) + if ($signature -ne $previous) { + $lastChange = $previous + $previous = $signature + $stableSince = [DateTime]::UtcNow + } + if ((($ExpectedPages -ge 0 -and $pages.Count -eq $ExpectedPages) -or + ($ExpectedPages -lt 0 -and $pages.Count -gt 0)) -and + ([DateTime]::UtcNow - $stableSince).TotalSeconds -ge 2) { $settled = $true; break } + Start-Sleep -Milliseconds 250 + } while ([DateTime]::UtcNow -lt $deadline) + if (-not $settled -or ($ExpectedPages -ge 0 -and $pages.Count -ne $ExpectedPages) -or ($ExpectedPages -lt 0 -and $pages.Count -eq 0)) { + [IO.File]::WriteAllText((Join-Path $output 'previous-signature.txt'), $lastChange, [Text.Encoding]::UTF8) + $index = 0 + foreach ($id in @($pages.Keys | Sort-Object)) { + [IO.File]::WriteAllText((Join-Path $output ('unsettled-{0:d3}.xml' -f $index)), $pages[$id], [Text.Encoding]::UTF8) + $index++ + } + $hierarchy = '' + $app.GetHierarchy($notebookId, 4, [ref]$hierarchy, 1) + [IO.File]::WriteAllText((Join-Path $output 'unsettled-hierarchy.xml'), $hierarchy, [Text.Encoding]::UTF8) + throw "Expected $ExpectedPages stable pages; OneNote returned $($pages.Count), settled=$settled." + } + $index = 0 + $payloads = @() + foreach ($id in @($pages.Keys | Sort-Object)) { + [IO.File]::WriteAllText((Join-Path $output ('page-{0:d3}.xml' -f $index)), $pages[$id], [Text.Encoding]::UTF8) + if ($Pdf) { + $pdfPath = Join-Path $output ('page-{0:d3}.pdf' -f $index) + $app.NavigateTo($id, '', $false) + $app.Publish($id, $pdfPath, 3, '') + if (-not (Test-Path $pdfPath) -or (Get-Item $pdfPath).Length -eq 0) { throw 'OneNote did not publish the page PDF.' } + } + [xml]$page = $pages[$id] + foreach ($file in $page.SelectNodes('//*[local-name()="InsertedFile" or local-name()="MediaFile"]')) { + $bytes = [IO.File]::ReadAllBytes($file.GetAttribute('pathCache')) + $hash = [BitConverter]::ToString([Security.Cryptography.SHA256]::Create().ComputeHash($bytes)).Replace('-', '').ToLowerInvariant() + [IO.File]::WriteAllBytes((Join-Path $output ($hash + '.attachment')), $bytes) + $payloads += @{ page = $id; object = $file.ParentNode.GetAttribute('objectID'); + kind = $file.LocalName; name = $file.GetAttribute('preferredName'); + sha256 = $hash; bytes = $bytes.Length } + } + $index++ + } + [IO.File]::WriteAllText((Join-Path $output 'payloads.json'), (ConvertTo-Json -InputObject $payloads -Depth 4), [Text.Encoding]::UTF8) + $all = '' + $app.GetHierarchy($notebookId, 4, [ref]$all, 1) + [xml]$finalTree = $all + $finalIds = @($finalTree.SelectNodes('//*[local-name()="Page"]') | ForEach-Object { $_.GetAttribute('ID') } | Sort-Object -Unique) + if ($finalIds.Count -ne $pages.Count -or @($finalIds | Where-Object { -not $pages.ContainsKey($_) }).Count -ne 0) { + throw 'The notebook hierarchy changed while collecting page evidence; repeat the cold read.' + } + [IO.File]::WriteAllText((Join-Path $output 'hierarchy.xml'), $all, [Text.Encoding]::UTF8) + Write-Output "Read $($sections.Count) sections and $($pages.Count) pages." +} catch { + $failure = $_ + [IO.File]::WriteAllText((Join-Path $output 'failure.txt'), ($_ | Out-String), [Text.Encoding]::UTF8) + throw +} finally { + try { + try { + if ($notebookId -and $CloneHost) { $app.SyncHierarchy($notebookId) } + if ($notebookId -and -not $KeepOpen -and (-not $UseCurrentCache -or $CloneHost)) { + $app.CloseNotebook($notebookId, $false) + } + } catch { + if ($null -eq $failure) { throw } + [IO.File]::WriteAllText((Join-Path $output 'cleanup-failure.txt'), ($_ | Out-String), [Text.Encoding]::UTF8) + } + } finally { + [void][Runtime.InteropServices.Marshal]::FinalReleaseComObject($app) + } + $app = $null + [GC]::Collect() + [GC]::WaitForPendingFinalizers() + if (-not $UseCurrentCache -and -not $CloneHost) { + Get-Process ONENOTE -ErrorAction SilentlyContinue | Wait-Process -Timeout 10 + } +} diff --git a/corpus/page-lifecycle/offline-edits/indent-single-page/cold/source.json b/corpus/page-lifecycle/offline-edits/indent-single-page/cold/source.json new file mode 100644 index 0000000000000000000000000000000000000000..d31b3494bd54638d5a76d64dd1f414c72be6ed68 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-single-page/cold/source.json @@ -0,0 +1,8 @@ +[ + { + "path": "Lifecycle.one", + "bytes": 64312, + "sha256": "3dadcab935fa149e6d732f3c8fc29e44006197a76572212eafbcd7f5b09cda59", + "mtime_ns": 1789121643843763906 + } +] diff --git a/corpus/page-lifecycle/offline-edits/indent-single-page/cold/teardown.json b/corpus/page-lifecycle/offline-edits/indent-single-page/cold/teardown.json new file mode 100644 index 0000000000000000000000000000000000000000..05a47793de40f322e745c4c4183727e3590ecf70 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/indent-single-page/cold/teardown.json @@ -0,0 +1 @@ +{"absent": true} diff --git a/corpus/page-lifecycle/offline-edits/provenance.json b/corpus/page-lifecycle/offline-edits/provenance.json index 634b8edb4df2be275431104f59aecbf730558e0d..ae245465bbd18b4b6b21b86cbe05f39631e8dd27 100644 --- a/corpus/page-lifecycle/offline-edits/provenance.json +++ b/corpus/page-lifecycle/offline-edits/provenance.json @@ -2,7 +2,7 @@ "cases": { "group-01-demoted-parent": { "run": { - "notebook": "/private/var/folders/90/4f4rngds01j55ggdj_vglk_c0000gn/T/tmp25ua0uma", + "notebook": "/private/var/folders/90/4f4rngds01j55ggdj_vglk_c0000gn/T/tmpbu44alfu", "expected_pages": 9, "author": null, "author_timeout_seconds": 600, @@ -20,8 +20,8 @@ } }, "machine": { - "name": "m6-b441c6ce", - "hostname": "ONE-M6-B441C6CE" + "name": "m6-e8220f62", + "hostname": "ONE-M6-E8220F62" }, "teardown": { "absent": true @@ -30,14 +30,14 @@ { "path": "Lifecycle.one", "bytes": 61168, - "sha256": "b824f43c0f789519771dcaabd0d7b84549ccc01629c19a64bd3bba9bb70b75df", - "mtime_ns": 1788941881049079637 + "sha256": "b0fd7dc60d8bb7d26310e363f8ec9269651bf1c6bccce6465b292978e6c932ce", + "mtime_ns": 1789121644250856649 } ] }, "group-02-promoted-parent": { "run": { - "notebook": "/private/var/folders/90/4f4rngds01j55ggdj_vglk_c0000gn/T/tmpbtvm7zy4", + "notebook": "/private/var/folders/90/4f4rngds01j55ggdj_vglk_c0000gn/T/tmpzv4zdwuu", "expected_pages": 9, "author": null, "author_timeout_seconds": 600, @@ -55,8 +55,8 @@ } }, "machine": { - "name": "m6-a937eee4", - "hostname": "ONE-M6-A937EEE4" + "name": "m6-529c1cbc", + "hostname": "ONE-M6-529C1CBC" }, "teardown": { "absent": true @@ -65,14 +65,14 @@ { "path": "Lifecycle.one", "bytes": 62200, - "sha256": "904bf500864584bff80c83dfbdf957de109836964a1dd7e97810df042cee0efa", - "mtime_ns": 1788941881329857761 + "sha256": "1799f81b54d3d38ff66e420e83d4a242711cae40e52c8c3a2fb8d7886c43fd6b", + "mtime_ns": 1789121644594396710 } ] }, "group-03-selected-group-move": { "run": { - "notebook": "/private/var/folders/90/4f4rngds01j55ggdj_vglk_c0000gn/T/tmpqpnmdqos", + "notebook": "/private/var/folders/90/4f4rngds01j55ggdj_vglk_c0000gn/T/tmpukazpfqa", "expected_pages": 9, "author": null, "author_timeout_seconds": 600, @@ -90,8 +90,8 @@ } }, "machine": { - "name": "m6-1b35b14a", - "hostname": "ONE-M6-1B35B14A" + "name": "m6-757551a0", + "hostname": "ONE-M6-757551A0" }, "teardown": { "absent": true @@ -100,14 +100,14 @@ { "path": "Lifecycle.one", "bytes": 62664, - "sha256": "5a3d665f5da9a1c8aee3339d368bb1fdcb2e00e7aa0422478758bce84f5646f0", - "mtime_ns": 1788941881601421859 + "sha256": "7f9d34875babd03e06d9c1c19e308651a32f60128a82fc3ebe4ceb7c26b4ff8d", + "mtime_ns": 1789121644927702132 } ] }, "group-04-subpage-move": { "run": { - "notebook": "/private/var/folders/90/4f4rngds01j55ggdj_vglk_c0000gn/T/tmp93masgxw", + "notebook": "/private/var/folders/90/4f4rngds01j55ggdj_vglk_c0000gn/T/tmphwmxgpck", "expected_pages": 9, "author": null, "author_timeout_seconds": 600, @@ -125,8 +125,8 @@ } }, "machine": { - "name": "m6-390f4ff1", - "hostname": "ONE-M6-390F4FF1" + "name": "m6-7b82f5fd", + "hostname": "ONE-M6-7B82F5FD" }, "teardown": { "absent": true @@ -135,14 +135,14 @@ { "path": "Lifecycle.one", "bytes": 66464, - "sha256": "f758f4f74f21734349275e839e78a39454d00e1c546dd6b29f936ed9adef752a", - "mtime_ns": 1788941881947544959 + "sha256": "698e65aec54d2096cb78fe19daf07002cd4cff49139cbe2a8ae515cb8a07f75d", + "mtime_ns": 1789121645336160751 } ] }, "group-05-insert-before-subpage": { "run": { - "notebook": "/private/var/folders/90/4f4rngds01j55ggdj_vglk_c0000gn/T/tmph61roaik", + "notebook": "/private/var/folders/90/4f4rngds01j55ggdj_vglk_c0000gn/T/tmpq5zb96wg", "expected_pages": 9, "author": null, "author_timeout_seconds": 600, @@ -160,8 +160,8 @@ } }, "machine": { - "name": "m6-c13e29ae", - "hostname": "ONE-M6-C13E29AE" + "name": "m6-797c5e28", + "hostname": "ONE-M6-797C5E28" }, "teardown": { "absent": true @@ -170,14 +170,14 @@ { "path": "Lifecycle.one", "bytes": 68104, - "sha256": "fbacddf7e10d230f3ffc4e28a967cfa43d378e598bff5dc5d2a532f8cb64091d", - "mtime_ns": 1788941882292841519 + "sha256": "6d156380c9a4fe2be62662f6cb18fb2dad0423c4baf6c7ff7cc74a0fb6f39ec7", + "mtime_ns": 1789121645747767832 } ] }, "group-06-promoted-level-two": { "run": { - "notebook": "/private/var/folders/90/4f4rngds01j55ggdj_vglk_c0000gn/T/tmpyvldz7f2", + "notebook": "/private/var/folders/90/4f4rngds01j55ggdj_vglk_c0000gn/T/tmp8h8axamn", "expected_pages": 9, "author": null, "author_timeout_seconds": 600, @@ -195,8 +195,8 @@ } }, "machine": { - "name": "m6-84bacce5", - "hostname": "ONE-M6-84BACCE5" + "name": "m6-5f2ea96f", + "hostname": "ONE-M6-5F2EA96F" }, "teardown": { "absent": true @@ -205,14 +205,14 @@ { "path": "Lifecycle.one", "bytes": 70512, - "sha256": "89163b8a78ef94dc540ef00d3d05fca2014fa9e3b88a7e73e6a574c11e6d39bd", - "mtime_ns": 1788941882577853637 + "sha256": "f44639cf506727cfce4607d83a7ec231ee7daa04d918fdb9ff198094bf0c11a4", + "mtime_ns": 1789121646097525529 } ] }, "group-07-promoted-root": { "run": { - "notebook": "/private/var/folders/90/4f4rngds01j55ggdj_vglk_c0000gn/T/tmpw7p2frw3", + "notebook": "/private/var/folders/90/4f4rngds01j55ggdj_vglk_c0000gn/T/tmpmryvpdbi", "expected_pages": 9, "author": null, "author_timeout_seconds": 600, @@ -230,8 +230,8 @@ } }, "machine": { - "name": "m6-0e532964", - "hostname": "ONE-M6-0E532964" + "name": "m6-d8ac8bbf", + "hostname": "ONE-M6-D8AC8BBF" }, "teardown": { "absent": true @@ -240,14 +240,14 @@ { "path": "Lifecycle.one", "bytes": 73840, - "sha256": "7952a0e1d9211af424cb5af2745171d8e745f7583d0e748762d7e34314bdb1c8", - "mtime_ns": 1788941882943040331 + "sha256": "aade5170cde10160d9f3840a8d0bad944c5bbd285b6efb79831ebd17a4cb5b72", + "mtime_ns": 1789121646529054140 } ] }, "group-08-collapsed-group-move": { "run": { - "notebook": "/private/var/folders/90/4f4rngds01j55ggdj_vglk_c0000gn/T/tmpopp2ih5l", + "notebook": "/private/var/folders/90/4f4rngds01j55ggdj_vglk_c0000gn/T/tmp89aydbgy", "expected_pages": 9, "author": null, "author_timeout_seconds": 600, @@ -265,8 +265,8 @@ } }, "machine": { - "name": "m6-8da7d856", - "hostname": "ONE-M6-8DA7D856" + "name": "m6-89b4b25f", + "hostname": "ONE-M6-89B4B25F" }, "teardown": { "absent": true @@ -275,14 +275,14 @@ { "path": "Lifecycle.one", "bytes": 75656, - "sha256": "0be5eaca3172c3455b9b85946e0425e62cff0f61ab8fee75d8d0c4b0f6706248", - "mtime_ns": 1788941883308990065 + "sha256": "69eab3043565feb74c1242cd4b2407e83990feeec43c959c5aea61c9ea156337", + "mtime_ns": 1789121646959281959 } ] }, "group-single-page": { "run": { - "notebook": "/private/var/folders/90/4f4rngds01j55ggdj_vglk_c0000gn/T/tmpyqtm83w3", + "notebook": "/private/var/folders/90/4f4rngds01j55ggdj_vglk_c0000gn/T/tmp2iu0f00f", "expected_pages": 9, "author": null, "author_timeout_seconds": 600, @@ -300,8 +300,8 @@ } }, "machine": { - "name": "m6-2e6f3792", - "hostname": "ONE-M6-2E6F3792" + "name": "m6-133773f4", + "hostname": "ONE-M6-133773F4" }, "teardown": { "absent": true @@ -310,14 +310,14 @@ { "path": "Lifecycle.one", "bytes": 64016, - "sha256": "a256c8f761cfe6465ccbe37852794c5760bbd46a6993a821e535ced69c38d510", - "mtime_ns": 1788941883672568012 + "sha256": "8f1d397cf23969ee336661f188879f1d418741878b506f6682a6f86d238c5c33", + "mtime_ns": 1789121647383619936 } ] }, "indent-01-demoted-parent": { "run": { - "notebook": "/private/var/folders/90/4f4rngds01j55ggdj_vglk_c0000gn/T/tmpono2kv8d", + "notebook": "/private/var/folders/90/4f4rngds01j55ggdj_vglk_c0000gn/T/tmpzu_h46n7", "expected_pages": 9, "author": null, "author_timeout_seconds": 600, @@ -335,8 +335,8 @@ } }, "machine": { - "name": "m6-12ecb7c4", - "hostname": "ONE-M6-12ECB7C4" + "name": "m6-b88a1aec", + "hostname": "ONE-M6-B88A1AEC" }, "teardown": { "absent": true @@ -345,14 +345,14 @@ { "path": "Lifecycle.one", "bytes": 60192, - "sha256": "7d65268efd6ff873d370ff776062c378674b760d6adbeac4a19dc9fd28cb61c1", - "mtime_ns": 1788941878214798774 + "sha256": "edfc61dcb2e55d6bf3afccc72e523a1fa9d253fa5c5b947f36cbb152b9446fdf", + "mtime_ns": 1789121640873938491 } ] }, "indent-02-promoted-parent": { "run": { - "notebook": "/private/var/folders/90/4f4rngds01j55ggdj_vglk_c0000gn/T/tmpu3zp0wxf", + "notebook": "/private/var/folders/90/4f4rngds01j55ggdj_vglk_c0000gn/T/tmp5vi4lp1k", "expected_pages": 9, "author": null, "author_timeout_seconds": 600, @@ -370,8 +370,8 @@ } }, "machine": { - "name": "m6-8695a32c", - "hostname": "ONE-M6-8695A32C" + "name": "m6-6e03355e", + "hostname": "ONE-M6-6E03355E" }, "teardown": { "absent": true @@ -380,14 +380,14 @@ { "path": "Lifecycle.one", "bytes": 62680, - "sha256": "bb97693bb9b9ee756b71b46ec9f8236994af5ebcd17b4162b799d25687c03bae", - "mtime_ns": 1788941878501070348 + "sha256": "fc93aa64ff966e2f5557bac1e38c0768df378ee5865c0e527d672c6f31c76761", + "mtime_ns": 1789121641216798594 } ] }, "indent-03-selected-group-move": { "run": { - "notebook": "/private/var/folders/90/4f4rngds01j55ggdj_vglk_c0000gn/T/tmpkkgri9eo", + "notebook": "/private/var/folders/90/4f4rngds01j55ggdj_vglk_c0000gn/T/tmp41s5b9uu", "expected_pages": 9, "author": null, "author_timeout_seconds": 600, @@ -405,8 +405,8 @@ } }, "machine": { - "name": "m6-79f79370", - "hostname": "ONE-M6-79F79370" + "name": "m6-a3820ebf", + "hostname": "ONE-M6-A3820EBF" }, "teardown": { "absent": true @@ -415,14 +415,14 @@ { "path": "Lifecycle.one", "bytes": 63752, - "sha256": "38e4a1ea6410eb097653c8d3bd74abdc5ac28f4616ebd04eb32e332e9a34179a", - "mtime_ns": 1788941878785592590 + "sha256": "93548ad527574f6a19f2288b751746754bf78037b8229e5408aa1af8d5e4f94b", + "mtime_ns": 1789121641556517733 } ] }, "indent-04-subpage-move": { "run": { - "notebook": "/private/var/folders/90/4f4rngds01j55ggdj_vglk_c0000gn/T/tmpnaob6ged", + "notebook": "/private/var/folders/90/4f4rngds01j55ggdj_vglk_c0000gn/T/tmpz1pbk0ta", "expected_pages": 9, "author": null, "author_timeout_seconds": 600, @@ -440,8 +440,8 @@ } }, "machine": { - "name": "m6-24815dc0", - "hostname": "ONE-M6-24815DC0" + "name": "m6-32450ad0", + "hostname": "ONE-M6-32450AD0" }, "teardown": { "absent": true @@ -450,14 +450,14 @@ { "path": "Lifecycle.one", "bytes": 66856, - "sha256": "beeb72e90c663376bf6f378c256b44a58f74adcd7efa75b685ab163521cb899c", - "mtime_ns": 1788941879132236190 + "sha256": "d566d07a037d5d3552ddd2d64f42f793c5823e4209dd340758c1847a21a5dc93", + "mtime_ns": 1789121641964058226 } ] }, "indent-05-insert-before-subpage": { "run": { - "notebook": "/private/var/folders/90/4f4rngds01j55ggdj_vglk_c0000gn/T/tmp4c2gwxhe", + "notebook": "/private/var/folders/90/4f4rngds01j55ggdj_vglk_c0000gn/T/tmpf5e2rlwx", "expected_pages": 9, "author": null, "author_timeout_seconds": 600, @@ -475,8 +475,8 @@ } }, "machine": { - "name": "m6-bf5daf50", - "hostname": "ONE-M6-BF5DAF50" + "name": "m6-1b265f06", + "hostname": "ONE-M6-1B265F06" }, "teardown": { "absent": true @@ -485,14 +485,14 @@ { "path": "Lifecycle.one", "bytes": 67160, - "sha256": "eebeea1c5b675eb9114dc1ab096ccd71536e6b077a6bb4cfbac6ca8c0b674c71", - "mtime_ns": 1788941879409552027 + "sha256": "03715fdc38a5e3a369e49e5abe8e55fa82da4ffb90c304987ca5f66edf545f7b", + "mtime_ns": 1789121642301975530 } ] }, "indent-06-promoted-level-two": { "run": { - "notebook": "/private/var/folders/90/4f4rngds01j55ggdj_vglk_c0000gn/T/tmpkdhy5hsi", + "notebook": "/private/var/folders/90/4f4rngds01j55ggdj_vglk_c0000gn/T/tmplg_djgsc", "expected_pages": 9, "author": null, "author_timeout_seconds": 600, @@ -510,8 +510,8 @@ } }, "machine": { - "name": "m6-7cb23bfd", - "hostname": "ONE-M6-7CB23BFD" + "name": "m6-e0ac64b2", + "hostname": "ONE-M6-E0AC64B2" }, "teardown": { "absent": true @@ -520,14 +520,14 @@ { "path": "Lifecycle.one", "bytes": 71448, - "sha256": "fe37a1b0a3691daf93b172d42f929905a5c9c9b5caba4e6e3b67e6a59f5f7de5", - "mtime_ns": 1788941879701176676 + "sha256": "f66bd60a8834f9770060ae457a30aff734bf1777b0b21a6de9d8d19570777b3e", + "mtime_ns": 1789121642659393696 } ] }, "indent-07-promoted-root": { "run": { - "notebook": "/private/var/folders/90/4f4rngds01j55ggdj_vglk_c0000gn/T/tmpi18ckmh6", + "notebook": "/private/var/folders/90/4f4rngds01j55ggdj_vglk_c0000gn/T/tmpksr_pqio", "expected_pages": 9, "author": null, "author_timeout_seconds": 600, @@ -545,8 +545,8 @@ } }, "machine": { - "name": "m6-d1a70cb9", - "hostname": "ONE-M6-D1A70CB9" + "name": "m6-167fb3cd", + "hostname": "ONE-M6-167FB3CD" }, "teardown": { "absent": true @@ -555,14 +555,14 @@ { "path": "Lifecycle.one", "bytes": 73840, - "sha256": "276195070618d102292a0455590ceb9bbf6d26106b4887cda73252fa149d1b63", - "mtime_ns": 1788941880070772321 + "sha256": "0d48cefd731266249f136cf48bf70e1899942e390a3c40bec04b058c8b20c738", + "mtime_ns": 1789121643082641295 } ] }, "indent-08-collapsed-group-move": { "run": { - "notebook": "/private/var/folders/90/4f4rngds01j55ggdj_vglk_c0000gn/T/tmpqphw6cgh", + "notebook": "/private/var/folders/90/4f4rngds01j55ggdj_vglk_c0000gn/T/tmp9pe3v7df", "expected_pages": 9, "author": null, "author_timeout_seconds": 600, @@ -580,8 +580,8 @@ } }, "machine": { - "name": "m6-d141faaf", - "hostname": "ONE-M6-D141FAAF" + "name": "m6-9d58611a", + "hostname": "ONE-M6-9D58611A" }, "teardown": { "absent": true @@ -590,14 +590,14 @@ { "path": "Lifecycle.one", "bytes": 74056, - "sha256": "250a938806af76fc3ed8b917fcbd6161694000f2d287eb491ad134586b7a2fa2", - "mtime_ns": 1788941880425063366 + "sha256": "c4ff8e01f64f3ad05e44ae4ff1dd65286985d7b3ffee478d42e7e0ea41d55024", + "mtime_ns": 1789121643503140348 } ] }, "indent-single-page": { "run": { - "notebook": "/private/var/folders/90/4f4rngds01j55ggdj_vglk_c0000gn/T/tmpey9_i1nq", + "notebook": "/private/var/folders/90/4f4rngds01j55ggdj_vglk_c0000gn/T/tmp9_ggdkk6", "expected_pages": 9, "author": null, "author_timeout_seconds": 600, @@ -615,8 +615,8 @@ } }, "machine": { - "name": "m6-809753e8", - "hostname": "ONE-M6-809753E8" + "name": "m6-060e8528", + "hostname": "ONE-M6-060E8528" }, "teardown": { "absent": true @@ -625,15 +625,15 @@ { "path": "Lifecycle.one", "bytes": 64312, - "sha256": "19c5d537b172a6ceeceffb8aa72e370c08584a55f18619aef5bdcbb0c7cca935", - "mtime_ns": 1788941880706173615 + "sha256": "3dadcab935fa149e6d732f3c8fc29e44006197a76572212eafbcd7f5b09cda59", + "mtime_ns": 1789121643843763906 } ] } }, "twelve-clients": { "run": { - "notebook": "/private/var/folders/90/4f4rngds01j55ggdj_vglk_c0000gn/T/tmpauflzr4r", + "notebook": "/private/tmp/m33/page-clients2/candidate", "expected_pages": 37, "author": null, "author_timeout_seconds": 600, @@ -651,8 +651,8 @@ } }, "machine": { - "name": "m6-87535bf3", - "hostname": "ONE-M6-87535BF3" + "name": "m6-16c2e4d4", + "hostname": "ONE-M6-16C2E4D4" }, "teardown": { "absent": true @@ -660,9 +660,9 @@ "source": [ { "path": "pages.one", - "bytes": 149680, - "sha256": "c1f90ad7adb5568be651fdf59009c8ccbb11ca772973155d93caa45b14f79665", - "mtime_ns": 1788941460936854212 + "bytes": 155344, + "sha256": "623ade8b5ee6fc837ae63d5293791039ecd17da9cb8bc5e243ea20cadf37958c", + "mtime_ns": 1789124063040528117 } ] }, diff --git a/corpus/page-lifecycle/offline-edits/twelve-clients/candidate/manifest.json b/corpus/page-lifecycle/offline-edits/twelve-clients/candidate/manifest.json index 82e0c6e06d029c1ed259f92743ef1a3ae3ed66ba..6848c514d3c0d4f1149f35c3bf02604813bc5116 100644 --- a/corpus/page-lifecycle/offline-edits/twelve-clients/candidate/manifest.json +++ b/corpus/page-lifecycle/offline-edits/twelve-clients/candidate/manifest.json @@ -1,151 +1,151 @@ { "expected_order": [ [ - "{90D67E9A-BEC2-43C9-973C-1B927FE5FCD4},1", + "{869D5929-6E5E-4EDB-9639-4C56977DD447},1", 1 ], [ - "{EED86E95-3017-46A7-B26B-991C815839B7},1", + "{0E98EE82-B78F-4872-8BD9-5D9B23A817C5},1", 1 ], [ - "{7D896A2D-61C9-42B2-AECF-B3C979B88BEB},1", + "{B0B53F94-0105-4C59-B65B-9473F49BFF41},1", 1 ], [ - "{0E8EA7AB-946D-461C-B571-96CCDC183FDC},1", + "{C837A033-F055-4455-B45F-17D82016921C},1", 2 ], [ - "{F61E497B-25BB-426E-BC73-320A7B6D2E9E},1", + "{57E835EA-2799-4118-B55C-7BB1E51C6941},1", 1 ], [ - "{BE25CAF8-690F-4947-8683-3A37A7D52CCA},1", + "{89D86121-BF5C-418B-BB92-CBFFA8EF545F},1", 1 ], [ - "{E53F33D2-F3FC-42C9-8DC8-B47261D1BDED},1", + "{F7EECCCF-B6B4-44F2-A543-36837EC18B8A},1", 2 ], [ - "{F0E8692A-3CBB-47A6-81D6-7B6E2A125A7F},1", + "{EB3940F1-F255-42BE-8C31-DD09E86DBAAF},1", 1 ], [ - "{7FDAAAE9-CD33-42AA-A8AA-F87CE3BC8CD6},1", + "{361A0F09-EA63-4F2D-9620-C061D4E4707E},1", 1 ], [ - "{71B566DF-DBD8-43B2-AD96-265FDB789E07},1", + "{C2870D07-8ADC-44BB-9F12-15D6C3708689},1", 2 ], [ - "{914C89B2-A95E-4992-8D2B-B533C7326D57},1", + "{ED9769DD-99D6-4BE2-B980-580DA9C4DFCE},1", 1 ], [ - "{9C56CBC3-690B-4900-8A07-A43600F7477B},1", + "{1E0C6331-32C9-4EF9-8087-150A8669FA91},1", 1 ], [ - "{2CA7400B-F732-4FAF-811B-AAFA91C480DF},1", + "{17C30054-7129-4A10-9D00-4D5545E4F4BA},1", 2 ], [ - "{B6C1B618-B721-49CD-B224-45DDFF38C8FC},1", + "{BD0EF658-4D0F-42A7-B546-B4F4A77D246B},1", 1 ], [ - "{73479EE6-9FC0-4474-A702-E22C734FC42B},1", + "{4C5FBA5B-E348-4750-ACE4-E9694D527BFF},1", 1 ], [ - "{CED8C7D5-5AC4-4553-B9F7-A02A1F599692},1", + "{6FEA70FA-1451-4A27-8A8E-C4CC3B713CF6},1", 2 ], [ - "{EC0D40A0-9E0D-4262-9B4D-D075704938C9},1", + "{7E9041BD-301B-4B5B-9456-1C92050E4914},1", 1 ], [ - "{D260D973-E2FB-4654-89A2-13BAFC23AEDE},1", + "{68A1E0E1-7A39-4AB6-AD71-4D8A18878D79},1", 1 ], [ - "{8E47F53D-F24F-4B3B-942F-390A8F0F31E7},1", + "{EFA77BAE-8A98-4176-B536-B615D1D2ED2B},1", 2 ], [ - "{A3909E43-E7FE-40C8-9222-0B60EA8CE89B},1", + "{C50BF7FC-F848-4B91-B8C8-743D0AA5F195},1", 1 ], [ - "{1FBF8DA5-01E9-4248-BBB9-90B5C4ADFA58},1", + "{87AC0239-51A5-47C6-BAF4-926CCF56385C},1", 1 ], [ - "{925E4C70-2C3F-480D-BB44-D3BF4A0FB985},1", + "{FD8D07D0-C447-4516-A7DB-F8522B77D4A7},1", 2 ], [ - "{39716E7C-28A0-4770-BBD2-BB4018DBE93F},1", + "{7F6702B3-C977-436F-82AF-403E2BE950E7},1", 1 ], [ - "{1792331E-BA2E-4B60-B150-6AAF41BC488D},1", + "{D2E1FE57-F45D-49C3-B388-95222ACA3886},1", 1 ], [ - "{D30FD954-4DA9-4B85-8950-12B85AFA12CB},1", + "{688C4EA1-80F5-4D85-B9BB-F8633FF3C0CA},1", 2 ], [ - "{574D9093-179F-46A3-B3F9-F7EB4345FADA},1", + "{D2197C55-D962-4DF0-8B14-26F88C06D6FA},1", 1 ], [ - "{0F4D72D3-20B0-4884-BF56-08BA4DBFB6FF},1", + "{754FA957-C432-4502-A5CF-EE44449462C0},1", 1 ], [ - "{12C643DD-9593-4641-B945-124257947ADD},1", + "{87B83BA8-A906-4F71-A6CA-3E8133A75D34},1", 2 ], [ - "{37EF05A5-C2D9-44A2-84C0-BCA93ACB9048},1", + "{406687D7-F9E9-491B-85DA-166DE6CD5A60},1", 1 ], [ - "{C4850841-2A3C-4402-BF11-7499914F9024},1", + "{F2D6AEBB-98EA-4F10-991F-5243E74AF450},1", 1 ], [ - "{27C692F0-F79D-4390-AB44-CB8B10E2B49E},1", + "{1F73BF36-9FC2-495D-844D-B370D5C47DE7},1", 2 ], [ - "{858FEBAE-05A2-4B49-92D2-96C28376330D},1", + "{189EA744-BE13-467A-95BA-2667A134C0B0},1", 1 ], [ - "{B1F28022-58CF-49CF-BC6F-D77A1A034AAC},1", + "{E9BD343F-4A66-4DE2-81F9-3789CCA22818},1", 1 ], [ - "{806A80BF-45E8-4188-B782-66A0DAA26E5A},1", + "{017F5881-F818-4C7C-B9F9-6BCB4085F1D0},1", 2 ], [ - "{D106259D-D139-4DAB-87BE-50AC5E5BEF80},1", + "{CCBB5969-BCE8-498B-BE1A-98FD3A44DB1A},1", 1 ], [ - "{940E7901-6EF0-43ED-BD42-E0C7658185B1},1", + "{CD0D17F4-25D8-4076-9AF7-47D9CDEFCF0A},1", 1 ], [ - "{A8883FF6-F53C-46B7-912C-779F9300FA77},1", + "{2B736B19-2D9C-4E76-A732-478D533D717A},1", 2 ] ], @@ -158,1472 +158,1204 @@ "edits": [ { "guid": [ - 66, - 8, - 214, - 26, - 163, - 202, - 186, - 65, - 133, - 85, - 205, - 48, - 31, 86, - 240, - 18 - ], - "level": 1, - "position": { - "Before": "{7D896A2D-61C9-42B2-AECF-B3C979B88BEB},1" - }, - "space": "{EED86E95-3017-46A7-B26B-991C815839B7},1" - }, - { - "guid": [ - 175, - 129, - 69, - 10, - 173, - 37, - 210, - 68, - 143, - 124, - 194, - 27, - 84, - 67, - 127, - 64 - ], - "level": 2, - "position": "Keep", - "space": "{0E8EA7AB-946D-461C-B571-96CCDC183FDC},1" - } - ], - "observed": [ - [ - "{90D67E9A-BEC2-43C9-973C-1B927FE5FCD4},1", - 1 - ], - [ - "{7D896A2D-61C9-42B2-AECF-B3C979B88BEB},1", - 1 - ], - [ - "{EED86E95-3017-46A7-B26B-991C815839B7},1", - 1 - ], - [ - "{0E8EA7AB-946D-461C-B571-96CCDC183FDC},1", - 1 - ], - [ - "{BE25CAF8-690F-4947-8683-3A37A7D52CCA},1", - 1 - ], - [ - "{F61E497B-25BB-426E-BC73-320A7B6D2E9E},1", - 1 - ], - [ - "{E53F33D2-F3FC-42C9-8DC8-B47261D1BDED},1", - 1 - ], - [ - "{7FDAAAE9-CD33-42AA-A8AA-F87CE3BC8CD6},1", - 1 - ], - [ - "{F0E8692A-3CBB-47A6-81D6-7B6E2A125A7F},1", - 1 - ], - [ - "{71B566DF-DBD8-43B2-AD96-265FDB789E07},1", - 1 - ], - [ - "{9C56CBC3-690B-4900-8A07-A43600F7477B},1", - 1 - ], - [ - "{914C89B2-A95E-4992-8D2B-B533C7326D57},1", - 1 - ], - [ - "{2CA7400B-F732-4FAF-811B-AAFA91C480DF},1", - 1 - ], - [ - "{73479EE6-9FC0-4474-A702-E22C734FC42B},1", - 1 - ], - [ - "{B6C1B618-B721-49CD-B224-45DDFF38C8FC},1", - 1 - ], - [ - "{CED8C7D5-5AC4-4553-B9F7-A02A1F599692},1", - 1 - ], - [ - "{D260D973-E2FB-4654-89A2-13BAFC23AEDE},1", - 1 - ], - [ - "{EC0D40A0-9E0D-4262-9B4D-D075704938C9},1", - 1 - ], - [ - "{8E47F53D-F24F-4B3B-942F-390A8F0F31E7},1", - 1 - ], - [ - "{1FBF8DA5-01E9-4248-BBB9-90B5C4ADFA58},1", - 1 - ], - [ - "{A3909E43-E7FE-40C8-9222-0B60EA8CE89B},1", - 1 - ], - [ - "{925E4C70-2C3F-480D-BB44-D3BF4A0FB985},1", - 1 - ], - [ - "{1792331E-BA2E-4B60-B150-6AAF41BC488D},1", - 1 - ], - [ - "{39716E7C-28A0-4770-BBD2-BB4018DBE93F},1", - 1 - ], - [ - "{D30FD954-4DA9-4B85-8950-12B85AFA12CB},1", - 1 - ], - [ - "{0F4D72D3-20B0-4884-BF56-08BA4DBFB6FF},1", - 1 - ], - [ - "{574D9093-179F-46A3-B3F9-F7EB4345FADA},1", - 1 - ], - [ - "{12C643DD-9593-4641-B945-124257947ADD},1", - 1 - ], - [ - "{C4850841-2A3C-4402-BF11-7499914F9024},1", - 1 - ], - [ - "{37EF05A5-C2D9-44A2-84C0-BCA93ACB9048},1", - 1 - ], - [ - "{27C692F0-F79D-4390-AB44-CB8B10E2B49E},1", - 1 - ], - [ - "{B1F28022-58CF-49CF-BC6F-D77A1A034AAC},1", - 1 - ], - [ - "{858FEBAE-05A2-4B49-92D2-96C28376330D},1", - 1 - ], - [ - "{806A80BF-45E8-4188-B782-66A0DAA26E5A},1", - 1 - ], - [ - "{940E7901-6EF0-43ED-BD42-E0C7658185B1},1", - 1 - ], - [ - "{D106259D-D139-4DAB-87BE-50AC5E5BEF80},1", - 1 - ], - [ - "{A8883FF6-F53C-46B7-912C-779F9300FA77},1", - 1 - ] - ] - } - }, - "space": "{31C1BA26-B092-43F4-B346-A5147633ACB5},1" - }, - { - "id": 2, - "operation": { - "Insert": { - "author": "Author", - "created": 1473408656, - "guid": [ - 169, - 96, - 38, - 145, - 180, - 69, - 222, - 67, - 132, - 192, - 3, - 247, - 73, - 62, - 35, - 159 - ], - "parent": "{EED86E95-3017-46A7-B26B-991C815839B7},12", - "placement": { - "Outline": { - "x": 36.0, - "y": 36.0 - } - }, - "text": "Actor 0 🦀 é" - } - }, - "space": "{EED86E95-3017-46A7-B26B-991C815839B7},1" - } - ], - [ - { - "id": 1, - "operation": { - "Pages": { - "edits": [ - { - "guid": [ - 172, - 161, - 73, - 98, - 42, - 175, - 7, - 71, - 172, - 34, - 169, - 112, - 203, - 118, - 56, - 125 - ], - "level": 1, - "position": { - "Before": "{BE25CAF8-690F-4947-8683-3A37A7D52CCA},1" - }, - "space": "{F61E497B-25BB-426E-BC73-320A7B6D2E9E},1" - }, - { - "guid": [ - 192, 0, - 119, - 124, - 245, - 45, - 114, - 68, - 165, - 167, - 212, - 208, - 73, - 144, - 1, - 1 - ], - "level": 2, - "position": "Keep", - "space": "{E53F33D2-F3FC-42C9-8DC8-B47261D1BDED},1" - } - ], - "observed": [ - [ - "{90D67E9A-BEC2-43C9-973C-1B927FE5FCD4},1", - 1 - ], - [ - "{7D896A2D-61C9-42B2-AECF-B3C979B88BEB},1", - 1 - ], - [ - "{EED86E95-3017-46A7-B26B-991C815839B7},1", - 1 - ], - [ - "{0E8EA7AB-946D-461C-B571-96CCDC183FDC},1", - 1 - ], - [ - "{BE25CAF8-690F-4947-8683-3A37A7D52CCA},1", - 1 - ], - [ - "{F61E497B-25BB-426E-BC73-320A7B6D2E9E},1", - 1 - ], - [ - "{E53F33D2-F3FC-42C9-8DC8-B47261D1BDED},1", - 1 - ], - [ - "{7FDAAAE9-CD33-42AA-A8AA-F87CE3BC8CD6},1", - 1 - ], - [ - "{F0E8692A-3CBB-47A6-81D6-7B6E2A125A7F},1", - 1 - ], - [ - "{71B566DF-DBD8-43B2-AD96-265FDB789E07},1", - 1 - ], - [ - "{9C56CBC3-690B-4900-8A07-A43600F7477B},1", - 1 - ], - [ - "{914C89B2-A95E-4992-8D2B-B533C7326D57},1", - 1 - ], - [ - "{2CA7400B-F732-4FAF-811B-AAFA91C480DF},1", - 1 - ], - [ - "{73479EE6-9FC0-4474-A702-E22C734FC42B},1", - 1 - ], - [ - "{B6C1B618-B721-49CD-B224-45DDFF38C8FC},1", - 1 - ], - [ - "{CED8C7D5-5AC4-4553-B9F7-A02A1F599692},1", - 1 - ], - [ - "{D260D973-E2FB-4654-89A2-13BAFC23AEDE},1", - 1 - ], - [ - "{EC0D40A0-9E0D-4262-9B4D-D075704938C9},1", - 1 - ], - [ - "{8E47F53D-F24F-4B3B-942F-390A8F0F31E7},1", - 1 - ], - [ - "{1FBF8DA5-01E9-4248-BBB9-90B5C4ADFA58},1", - 1 - ], - [ - "{A3909E43-E7FE-40C8-9222-0B60EA8CE89B},1", - 1 - ], - [ - "{925E4C70-2C3F-480D-BB44-D3BF4A0FB985},1", - 1 - ], - [ - "{1792331E-BA2E-4B60-B150-6AAF41BC488D},1", - 1 - ], - [ - "{39716E7C-28A0-4770-BBD2-BB4018DBE93F},1", - 1 - ], - [ - "{D30FD954-4DA9-4B85-8950-12B85AFA12CB},1", - 1 - ], - [ - "{0F4D72D3-20B0-4884-BF56-08BA4DBFB6FF},1", - 1 - ], - [ - "{574D9093-179F-46A3-B3F9-F7EB4345FADA},1", - 1 - ], - [ - "{12C643DD-9593-4641-B945-124257947ADD},1", - 1 - ], - [ - "{C4850841-2A3C-4402-BF11-7499914F9024},1", - 1 - ], - [ - "{37EF05A5-C2D9-44A2-84C0-BCA93ACB9048},1", - 1 - ], - [ - "{27C692F0-F79D-4390-AB44-CB8B10E2B49E},1", - 1 - ], - [ - "{B1F28022-58CF-49CF-BC6F-D77A1A034AAC},1", - 1 - ], - [ - "{858FEBAE-05A2-4B49-92D2-96C28376330D},1", - 1 - ], - [ - "{806A80BF-45E8-4188-B782-66A0DAA26E5A},1", - 1 - ], - [ - "{940E7901-6EF0-43ED-BD42-E0C7658185B1},1", - 1 - ], - [ - "{D106259D-D139-4DAB-87BE-50AC5E5BEF80},1", - 1 - ], - [ - "{A8883FF6-F53C-46B7-912C-779F9300FA77},1", - 1 - ] - ] - } - }, - "space": "{31C1BA26-B092-43F4-B346-A5147633ACB5},1" - }, - { - "id": 2, - "operation": { - "Insert": { - "author": "Author", - "created": 1473408656, - "guid": [ - 103, - 211, - 55, - 116, - 145, - 175, - 246, - 72, - 188, - 193, - 248, - 191, - 133, - 8, - 103, - 251 - ], - "parent": "{F61E497B-25BB-426E-BC73-320A7B6D2E9E},12", - "placement": { - "Outline": { - "x": 36.0, - "y": 36.0 - } - }, - "text": "Actor 1 🦀 é" - } - }, - "space": "{F61E497B-25BB-426E-BC73-320A7B6D2E9E},1" - } - ], - [ - { - "id": 1, - "operation": { - "Pages": { - "edits": [ - { - "guid": [ - 186, - 235, - 251, - 180, - 99, - 157, - 152, - 66, - 133, - 236, - 95, - 58, - 75, - 235, - 31, - 11 - ], - "level": 1, - "position": { - "Before": "{7FDAAAE9-CD33-42AA-A8AA-F87CE3BC8CD6},1" - }, - "space": "{F0E8692A-3CBB-47A6-81D6-7B6E2A125A7F},1" - }, - { - "guid": [ - 212, - 110, - 96, - 109, - 211, - 163, - 247, - 70, - 139, - 235, - 189, - 123, - 151, - 176, - 53, - 248 - ], - "level": 2, - "position": "Keep", - "space": "{71B566DF-DBD8-43B2-AD96-265FDB789E07},1" - } - ], - "observed": [ - [ - "{90D67E9A-BEC2-43C9-973C-1B927FE5FCD4},1", - 1 - ], - [ - "{7D896A2D-61C9-42B2-AECF-B3C979B88BEB},1", - 1 - ], - [ - "{EED86E95-3017-46A7-B26B-991C815839B7},1", - 1 - ], - [ - "{0E8EA7AB-946D-461C-B571-96CCDC183FDC},1", - 1 - ], - [ - "{BE25CAF8-690F-4947-8683-3A37A7D52CCA},1", - 1 - ], - [ - "{F61E497B-25BB-426E-BC73-320A7B6D2E9E},1", - 1 - ], - [ - "{E53F33D2-F3FC-42C9-8DC8-B47261D1BDED},1", - 1 - ], - [ - "{7FDAAAE9-CD33-42AA-A8AA-F87CE3BC8CD6},1", - 1 - ], - [ - "{F0E8692A-3CBB-47A6-81D6-7B6E2A125A7F},1", - 1 - ], - [ - "{71B566DF-DBD8-43B2-AD96-265FDB789E07},1", - 1 - ], - [ - "{9C56CBC3-690B-4900-8A07-A43600F7477B},1", - 1 - ], - [ - "{914C89B2-A95E-4992-8D2B-B533C7326D57},1", - 1 - ], - [ - "{2CA7400B-F732-4FAF-811B-AAFA91C480DF},1", - 1 - ], - [ - "{73479EE6-9FC0-4474-A702-E22C734FC42B},1", - 1 - ], - [ - "{B6C1B618-B721-49CD-B224-45DDFF38C8FC},1", - 1 - ], - [ - "{CED8C7D5-5AC4-4553-B9F7-A02A1F599692},1", - 1 - ], - [ - "{D260D973-E2FB-4654-89A2-13BAFC23AEDE},1", - 1 - ], - [ - "{EC0D40A0-9E0D-4262-9B4D-D075704938C9},1", - 1 - ], - [ - "{8E47F53D-F24F-4B3B-942F-390A8F0F31E7},1", - 1 - ], - [ - "{1FBF8DA5-01E9-4248-BBB9-90B5C4ADFA58},1", - 1 - ], - [ - "{A3909E43-E7FE-40C8-9222-0B60EA8CE89B},1", - 1 - ], - [ - "{925E4C70-2C3F-480D-BB44-D3BF4A0FB985},1", - 1 - ], - [ - "{1792331E-BA2E-4B60-B150-6AAF41BC488D},1", - 1 - ], - [ - "{39716E7C-28A0-4770-BBD2-BB4018DBE93F},1", - 1 - ], - [ - "{D30FD954-4DA9-4B85-8950-12B85AFA12CB},1", - 1 - ], - [ - "{0F4D72D3-20B0-4884-BF56-08BA4DBFB6FF},1", - 1 - ], - [ - "{574D9093-179F-46A3-B3F9-F7EB4345FADA},1", - 1 - ], - [ - "{12C643DD-9593-4641-B945-124257947ADD},1", - 1 - ], - [ - "{C4850841-2A3C-4402-BF11-7499914F9024},1", - 1 - ], - [ - "{37EF05A5-C2D9-44A2-84C0-BCA93ACB9048},1", - 1 - ], - [ - "{27C692F0-F79D-4390-AB44-CB8B10E2B49E},1", - 1 - ], - [ - "{B1F28022-58CF-49CF-BC6F-D77A1A034AAC},1", - 1 - ], - [ - "{858FEBAE-05A2-4B49-92D2-96C28376330D},1", - 1 - ], - [ - "{806A80BF-45E8-4188-B782-66A0DAA26E5A},1", - 1 - ], - [ - "{940E7901-6EF0-43ED-BD42-E0C7658185B1},1", - 1 - ], - [ - "{D106259D-D139-4DAB-87BE-50AC5E5BEF80},1", - 1 - ], - [ - "{A8883FF6-F53C-46B7-912C-779F9300FA77},1", - 1 - ] - ] - } - }, - "space": "{31C1BA26-B092-43F4-B346-A5147633ACB5},1" - }, - { - "id": 2, - "operation": { - "Insert": { - "author": "Author", - "created": 1473408656, - "guid": [ - 171, - 143, - 40, - 139, - 204, - 11, - 117, - 64, - 133, - 104, - 4, - 206, - 154, - 151, - 142, - 27 - ], - "parent": "{F0E8692A-3CBB-47A6-81D6-7B6E2A125A7F},12", - "placement": { - "Outline": { - "x": 36.0, - "y": 36.0 - } - }, - "text": "Actor 2 🦀 é" - } - }, - "space": "{F0E8692A-3CBB-47A6-81D6-7B6E2A125A7F},1" - } - ], - [ - { - "id": 1, - "operation": { - "Pages": { - "edits": [ - { - "guid": [ - 188, - 81, + 111, + 192, 138, - 165, - 126, - 205, - 194, - 74, - 131, + 101, + 192, + 76, 185, - 205, - 113, - 158, - 13, - 18, - 70 - ], - "level": 1, - "position": { - "Before": "{9C56CBC3-690B-4900-8A07-A43600F7477B},1" - }, - "space": "{914C89B2-A95E-4992-8D2B-B533C7326D57},1" - }, - { - "guid": [ - 55, - 235, - 66, - 120, - 1, - 129, - 35, - 79, - 158, - 92, - 115, - 100, - 177, - 222, - 61, - 141 - ], - "level": 2, - "position": "Keep", - "space": "{2CA7400B-F732-4FAF-811B-AAFA91C480DF},1" - } - ], - "observed": [ - [ - "{90D67E9A-BEC2-43C9-973C-1B927FE5FCD4},1", - 1 - ], - [ - "{7D896A2D-61C9-42B2-AECF-B3C979B88BEB},1", - 1 - ], - [ - "{EED86E95-3017-46A7-B26B-991C815839B7},1", - 1 - ], - [ - "{0E8EA7AB-946D-461C-B571-96CCDC183FDC},1", - 1 - ], - [ - "{BE25CAF8-690F-4947-8683-3A37A7D52CCA},1", - 1 - ], - [ - "{F61E497B-25BB-426E-BC73-320A7B6D2E9E},1", - 1 - ], - [ - "{E53F33D2-F3FC-42C9-8DC8-B47261D1BDED},1", - 1 - ], - [ - "{7FDAAAE9-CD33-42AA-A8AA-F87CE3BC8CD6},1", - 1 - ], - [ - "{F0E8692A-3CBB-47A6-81D6-7B6E2A125A7F},1", - 1 - ], - [ - "{71B566DF-DBD8-43B2-AD96-265FDB789E07},1", - 1 - ], - [ - "{9C56CBC3-690B-4900-8A07-A43600F7477B},1", - 1 - ], - [ - "{914C89B2-A95E-4992-8D2B-B533C7326D57},1", - 1 - ], - [ - "{2CA7400B-F732-4FAF-811B-AAFA91C480DF},1", - 1 - ], - [ - "{73479EE6-9FC0-4474-A702-E22C734FC42B},1", - 1 - ], - [ - "{B6C1B618-B721-49CD-B224-45DDFF38C8FC},1", - 1 - ], - [ - "{CED8C7D5-5AC4-4553-B9F7-A02A1F599692},1", - 1 - ], - [ - "{D260D973-E2FB-4654-89A2-13BAFC23AEDE},1", - 1 - ], - [ - "{EC0D40A0-9E0D-4262-9B4D-D075704938C9},1", - 1 - ], - [ - "{8E47F53D-F24F-4B3B-942F-390A8F0F31E7},1", - 1 - ], - [ - "{1FBF8DA5-01E9-4248-BBB9-90B5C4ADFA58},1", - 1 - ], - [ - "{A3909E43-E7FE-40C8-9222-0B60EA8CE89B},1", - 1 - ], - [ - "{925E4C70-2C3F-480D-BB44-D3BF4A0FB985},1", - 1 - ], - [ - "{1792331E-BA2E-4B60-B150-6AAF41BC488D},1", - 1 - ], - [ - "{39716E7C-28A0-4770-BBD2-BB4018DBE93F},1", - 1 - ], - [ - "{D30FD954-4DA9-4B85-8950-12B85AFA12CB},1", - 1 - ], - [ - "{0F4D72D3-20B0-4884-BF56-08BA4DBFB6FF},1", - 1 - ], - [ - "{574D9093-179F-46A3-B3F9-F7EB4345FADA},1", - 1 - ], - [ - "{12C643DD-9593-4641-B945-124257947ADD},1", - 1 - ], - [ - "{C4850841-2A3C-4402-BF11-7499914F9024},1", - 1 - ], - [ - "{37EF05A5-C2D9-44A2-84C0-BCA93ACB9048},1", - 1 - ], - [ - "{27C692F0-F79D-4390-AB44-CB8B10E2B49E},1", - 1 - ], - [ - "{B1F28022-58CF-49CF-BC6F-D77A1A034AAC},1", - 1 - ], - [ - "{858FEBAE-05A2-4B49-92D2-96C28376330D},1", - 1 - ], - [ - "{806A80BF-45E8-4188-B782-66A0DAA26E5A},1", - 1 - ], - [ - "{940E7901-6EF0-43ED-BD42-E0C7658185B1},1", - 1 - ], - [ - "{D106259D-D139-4DAB-87BE-50AC5E5BEF80},1", - 1 - ], - [ - "{A8883FF6-F53C-46B7-912C-779F9300FA77},1", - 1 - ] - ] - } - }, - "space": "{31C1BA26-B092-43F4-B346-A5147633ACB5},1" - }, - { - "id": 2, - "operation": { - "Insert": { - "author": "Author", - "created": 1473408656, - "guid": [ - 143, - 233, - 248, - 215, - 61, - 12, - 0, - 79, - 148, - 136, - 19, - 105, - 195, - 219, - 117, - 136 - ], - "parent": "{914C89B2-A95E-4992-8D2B-B533C7326D57},12", - "placement": { - "Outline": { - "x": 36.0, - "y": 36.0 - } - }, - "text": "Actor 3 🦀 é" - } - }, - "space": "{914C89B2-A95E-4992-8D2B-B533C7326D57},1" - } - ], - [ - { - "id": 1, - "operation": { - "Pages": { - "edits": [ - { - "guid": [ - 34, - 42, - 214, - 244, - 21, - 119, - 161, - 72, - 138, - 36, - 0, + 152, + 225, 226, - 83, - 220, - 182, - 42 + 79, + 192, + 46, + 40 ], "level": 1, "position": { - "Before": "{73479EE6-9FC0-4474-A702-E22C734FC42B},1" + "Before": "{B0B53F94-0105-4C59-B65B-9473F49BFF41},1" }, - "space": "{B6C1B618-B721-49CD-B224-45DDFF38C8FC},1" + "space": "{0E98EE82-B78F-4872-8BD9-5D9B23A817C5},1" }, { "guid": [ - 4, - 175, - 37, - 45, - 204, - 188, - 216, - 74, - 162, - 17, - 48, - 219, - 8, - 158, - 57, - 248 - ], - "level": 2, - "position": "Keep", - "space": "{CED8C7D5-5AC4-4553-B9F7-A02A1F599692},1" - } - ], - "observed": [ - [ - "{90D67E9A-BEC2-43C9-973C-1B927FE5FCD4},1", - 1 - ], - [ - "{7D896A2D-61C9-42B2-AECF-B3C979B88BEB},1", - 1 - ], - [ - "{EED86E95-3017-46A7-B26B-991C815839B7},1", - 1 - ], - [ - "{0E8EA7AB-946D-461C-B571-96CCDC183FDC},1", - 1 - ], - [ - "{BE25CAF8-690F-4947-8683-3A37A7D52CCA},1", - 1 - ], - [ - "{F61E497B-25BB-426E-BC73-320A7B6D2E9E},1", - 1 - ], - [ - "{E53F33D2-F3FC-42C9-8DC8-B47261D1BDED},1", - 1 - ], - [ - "{7FDAAAE9-CD33-42AA-A8AA-F87CE3BC8CD6},1", - 1 - ], - [ - "{F0E8692A-3CBB-47A6-81D6-7B6E2A125A7F},1", - 1 - ], - [ - "{71B566DF-DBD8-43B2-AD96-265FDB789E07},1", - 1 - ], - [ - "{9C56CBC3-690B-4900-8A07-A43600F7477B},1", - 1 - ], - [ - "{914C89B2-A95E-4992-8D2B-B533C7326D57},1", - 1 - ], - [ - "{2CA7400B-F732-4FAF-811B-AAFA91C480DF},1", - 1 - ], - [ - "{73479EE6-9FC0-4474-A702-E22C734FC42B},1", - 1 - ], - [ - "{B6C1B618-B721-49CD-B224-45DDFF38C8FC},1", - 1 - ], - [ - "{CED8C7D5-5AC4-4553-B9F7-A02A1F599692},1", - 1 - ], - [ - "{D260D973-E2FB-4654-89A2-13BAFC23AEDE},1", - 1 - ], - [ - "{EC0D40A0-9E0D-4262-9B4D-D075704938C9},1", - 1 - ], - [ - "{8E47F53D-F24F-4B3B-942F-390A8F0F31E7},1", - 1 - ], - [ - "{1FBF8DA5-01E9-4248-BBB9-90B5C4ADFA58},1", - 1 - ], - [ - "{A3909E43-E7FE-40C8-9222-0B60EA8CE89B},1", - 1 - ], - [ - "{925E4C70-2C3F-480D-BB44-D3BF4A0FB985},1", - 1 - ], - [ - "{1792331E-BA2E-4B60-B150-6AAF41BC488D},1", - 1 - ], - [ - "{39716E7C-28A0-4770-BBD2-BB4018DBE93F},1", - 1 - ], - [ - "{D30FD954-4DA9-4B85-8950-12B85AFA12CB},1", - 1 - ], - [ - "{0F4D72D3-20B0-4884-BF56-08BA4DBFB6FF},1", - 1 - ], - [ - "{574D9093-179F-46A3-B3F9-F7EB4345FADA},1", - 1 - ], - [ - "{12C643DD-9593-4641-B945-124257947ADD},1", - 1 - ], - [ - "{C4850841-2A3C-4402-BF11-7499914F9024},1", - 1 - ], - [ - "{37EF05A5-C2D9-44A2-84C0-BCA93ACB9048},1", - 1 - ], - [ - "{27C692F0-F79D-4390-AB44-CB8B10E2B49E},1", - 1 - ], - [ - "{B1F28022-58CF-49CF-BC6F-D77A1A034AAC},1", - 1 - ], - [ - "{858FEBAE-05A2-4B49-92D2-96C28376330D},1", - 1 - ], - [ - "{806A80BF-45E8-4188-B782-66A0DAA26E5A},1", - 1 - ], - [ - "{940E7901-6EF0-43ED-BD42-E0C7658185B1},1", - 1 - ], - [ - "{D106259D-D139-4DAB-87BE-50AC5E5BEF80},1", - 1 - ], - [ - "{A8883FF6-F53C-46B7-912C-779F9300FA77},1", - 1 - ] - ] - } - }, - "space": "{31C1BA26-B092-43F4-B346-A5147633ACB5},1" - }, - { - "id": 2, - "operation": { - "Insert": { - "author": "Author", - "created": 1473408656, - "guid": [ - 85, - 203, - 251, - 4, - 53, - 54, - 25, - 75, - 131, - 132, - 88, - 128, - 39, - 160, - 107, - 23 - ], - "parent": "{B6C1B618-B721-49CD-B224-45DDFF38C8FC},12", - "placement": { - "Outline": { - "x": 36.0, - "y": 36.0 - } - }, - "text": "Actor 4 🦀 é" - } - }, - "space": "{B6C1B618-B721-49CD-B224-45DDFF38C8FC},1" - } - ], - [ - { - "id": 1, - "operation": { - "Pages": { - "edits": [ - { - "guid": [ + 133, + 52, + 67, 104, - 223, - 221, - 220, - 195, - 253, - 140, - 73, - 138, - 112, - 221, - 253, - 145, - 92, - 153, + 247, + 13, + 120, + 79, + 190, + 78, + 126, + 126, + 12, + 116, + 230, 238 ], + "level": 2, + "position": "Keep", + "space": "{C837A033-F055-4455-B45F-17D82016921C},1" + } + ], + "observed": [ + [ + "{869D5929-6E5E-4EDB-9639-4C56977DD447},1", + 1 + ], + [ + "{B0B53F94-0105-4C59-B65B-9473F49BFF41},1", + 1 + ], + [ + "{0E98EE82-B78F-4872-8BD9-5D9B23A817C5},1", + 1 + ], + [ + "{C837A033-F055-4455-B45F-17D82016921C},1", + 1 + ], + [ + "{89D86121-BF5C-418B-BB92-CBFFA8EF545F},1", + 1 + ], + [ + "{57E835EA-2799-4118-B55C-7BB1E51C6941},1", + 1 + ], + [ + "{F7EECCCF-B6B4-44F2-A543-36837EC18B8A},1", + 1 + ], + [ + "{361A0F09-EA63-4F2D-9620-C061D4E4707E},1", + 1 + ], + [ + "{EB3940F1-F255-42BE-8C31-DD09E86DBAAF},1", + 1 + ], + [ + "{C2870D07-8ADC-44BB-9F12-15D6C3708689},1", + 1 + ], + [ + "{1E0C6331-32C9-4EF9-8087-150A8669FA91},1", + 1 + ], + [ + "{ED9769DD-99D6-4BE2-B980-580DA9C4DFCE},1", + 1 + ], + [ + "{17C30054-7129-4A10-9D00-4D5545E4F4BA},1", + 1 + ], + [ + "{4C5FBA5B-E348-4750-ACE4-E9694D527BFF},1", + 1 + ], + [ + "{BD0EF658-4D0F-42A7-B546-B4F4A77D246B},1", + 1 + ], + [ + "{6FEA70FA-1451-4A27-8A8E-C4CC3B713CF6},1", + 1 + ], + [ + "{68A1E0E1-7A39-4AB6-AD71-4D8A18878D79},1", + 1 + ], + [ + "{7E9041BD-301B-4B5B-9456-1C92050E4914},1", + 1 + ], + [ + "{EFA77BAE-8A98-4176-B536-B615D1D2ED2B},1", + 1 + ], + [ + "{87AC0239-51A5-47C6-BAF4-926CCF56385C},1", + 1 + ], + [ + "{C50BF7FC-F848-4B91-B8C8-743D0AA5F195},1", + 1 + ], + [ + "{FD8D07D0-C447-4516-A7DB-F8522B77D4A7},1", + 1 + ], + [ + "{D2E1FE57-F45D-49C3-B388-95222ACA3886},1", + 1 + ], + [ + "{7F6702B3-C977-436F-82AF-403E2BE950E7},1", + 1 + ], + [ + "{688C4EA1-80F5-4D85-B9BB-F8633FF3C0CA},1", + 1 + ], + [ + "{754FA957-C432-4502-A5CF-EE44449462C0},1", + 1 + ], + [ + "{D2197C55-D962-4DF0-8B14-26F88C06D6FA},1", + 1 + ], + [ + "{87B83BA8-A906-4F71-A6CA-3E8133A75D34},1", + 1 + ], + [ + "{F2D6AEBB-98EA-4F10-991F-5243E74AF450},1", + 1 + ], + [ + "{406687D7-F9E9-491B-85DA-166DE6CD5A60},1", + 1 + ], + [ + "{1F73BF36-9FC2-495D-844D-B370D5C47DE7},1", + 1 + ], + [ + "{E9BD343F-4A66-4DE2-81F9-3789CCA22818},1", + 1 + ], + [ + "{189EA744-BE13-467A-95BA-2667A134C0B0},1", + 1 + ], + [ + "{017F5881-F818-4C7C-B9F9-6BCB4085F1D0},1", + 1 + ], + [ + "{CD0D17F4-25D8-4076-9AF7-47D9CDEFCF0A},1", + 1 + ], + [ + "{CCBB5969-BCE8-498B-BE1A-98FD3A44DB1A},1", + 1 + ], + [ + "{2B736B19-2D9C-4E76-A732-478D533D717A},1", + 1 + ] + ] + } + }, + "space": "{90FCDB0C-36AE-422F-B4FE-67676826FE36},1" + }, + { + "id": 2, + "operation": { + "Page": { + "after": { + "created": 134335976560000000, + "definitions": { + "{0E98EE82-B78F-4872-8BD9-5D9B23A817C5},18": { + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": "Calibri", + "font_size": 17.0, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": null, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + }, + "kind": { + "name": "PageTitle", + "type": "Style" + } + } + }, + "margin_origin": [ + 0.0, + 0.0 + ], + "objects": [ + { + "Outline": { + "id": "{3517C5BC-B40B-45E6-8324-BAB9403F7F3B},0", + "indents": [], + "layout": { + "max_height": null, + "max_width": null, + "reserved_width": null, + "width_set_by_user": null, + "x": 36.0, + "y": 36.0 + }, + "min_width": null, + "paragraphs": [ + { + "collapsed": false, + "content": { + "Text": { + "date_field": null, + "id": "{D76D17C9-C3D7-49A2-A78E-305604ABA8AF},0", + "tags": [], + "text": { + "spans": [ + { + "end": 16, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": "Calibri", + "font_size": 11.0, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": 1033, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + } + } + ], + "text": "Actor 0 🦀 é" + } + } + }, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": null, + "font_size": null, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": null, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + }, + "id": "{1A80E3C3-180F-42AB-B946-1A365F043826},0", + "level": 1, + "lists": [], + "parent": null, + "style": null, + "tags": [] + } + ], + "title": false, + "unsupported": [] + } + }, + { + "Title": { + "date": null, + "id": "{0E98EE82-B78F-4872-8BD9-5D9B23A817C5},13", + "layout": { + "max_height": null, + "max_width": null, + "reserved_width": null, + "width_set_by_user": null, + "x": 0.0, + "y": 0.0 + }, + "outlines": [ + { + "id": "{0E98EE82-B78F-4872-8BD9-5D9B23A817C5},14", + "indents": [], + "layout": { + "max_height": null, + "max_width": null, + "reserved_width": null, + "width_set_by_user": null, + "x": null, + "y": null + }, + "min_width": null, + "paragraphs": [ + { + "collapsed": false, + "content": { + "Text": { + "date_field": null, + "id": "{0E98EE82-B78F-4872-8BD9-5D9B23A817C5},16", + "tags": [], + "text": { + "spans": [ + { + "end": 10, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": "Calibri", + "font_size": 17.0, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": 1033, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + } + } + ], + "text": "Same title" + } + } + }, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": null, + "font_size": null, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": null, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + }, + "id": "{0E98EE82-B78F-4872-8BD9-5D9B23A817C5},15", + "level": 1, + "lists": [], + "parent": null, + "style": "{0E98EE82-B78F-4872-8BD9-5D9B23A817C5},18", + "tags": [] + } + ], + "title": false, + "unsupported": [] + } + ] + } + } + ], + "title": "Same title" + }, + "author": "Author", + "before": { + "created": 134335976560000000, + "definitions": { + "{0E98EE82-B78F-4872-8BD9-5D9B23A817C5},18": { + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": "Calibri", + "font_size": 17.0, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": null, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + }, + "kind": { + "name": "PageTitle", + "type": "Style" + } + } + }, + "margin_origin": [ + 0.0, + 0.0 + ], + "objects": [ + { + "Title": { + "date": null, + "id": "{0E98EE82-B78F-4872-8BD9-5D9B23A817C5},13", + "layout": { + "max_height": null, + "max_width": null, + "reserved_width": null, + "width_set_by_user": null, + "x": 0.0, + "y": 0.0 + }, + "outlines": [ + { + "id": "{0E98EE82-B78F-4872-8BD9-5D9B23A817C5},14", + "indents": [], + "layout": { + "max_height": null, + "max_width": null, + "reserved_width": null, + "width_set_by_user": null, + "x": null, + "y": null + }, + "min_width": null, + "paragraphs": [ + { + "collapsed": false, + "content": { + "Text": { + "date_field": null, + "id": "{0E98EE82-B78F-4872-8BD9-5D9B23A817C5},16", + "tags": [], + "text": { + "spans": [ + { + "end": 10, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": "Calibri", + "font_size": 17.0, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": 1033, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + } + } + ], + "text": "Same title" + } + } + }, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": null, + "font_size": null, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": null, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + }, + "id": "{0E98EE82-B78F-4872-8BD9-5D9B23A817C5},15", + "level": 1, + "lists": [], + "parent": null, + "style": "{0E98EE82-B78F-4872-8BD9-5D9B23A817C5},18", + "tags": [] + } + ], + "title": false, + "unsupported": [] + } + ] + } + } + ], + "title": "Same title" + } + } + }, + "space": "{0E98EE82-B78F-4872-8BD9-5D9B23A817C5},1" + } + ], + [ + { + "id": 1, + "operation": { + "Pages": { + "edits": [ + { + "guid": [ + 183, + 11, + 130, + 190, + 141, + 83, + 119, + 77, + 133, + 112, + 123, + 250, + 37, + 199, + 26, + 252 + ], "level": 1, "position": { - "Before": "{D260D973-E2FB-4654-89A2-13BAFC23AEDE},1" + "Before": "{89D86121-BF5C-418B-BB92-CBFFA8EF545F},1" }, - "space": "{EC0D40A0-9E0D-4262-9B4D-D075704938C9},1" + "space": "{57E835EA-2799-4118-B55C-7BB1E51C6941},1" }, { "guid": [ - 120, - 153, - 169, - 147, - 181, - 108, - 47, - 66, - 154, - 71, - 185, - 89, - 106, - 88, - 140, - 240 + 252, + 97, + 42, + 186, + 167, + 236, + 97, + 65, + 143, + 137, + 54, + 20, + 165, + 72, + 170, + 170 ], "level": 2, "position": "Keep", - "space": "{8E47F53D-F24F-4B3B-942F-390A8F0F31E7},1" + "space": "{F7EECCCF-B6B4-44F2-A543-36837EC18B8A},1" } ], "observed": [ [ - "{90D67E9A-BEC2-43C9-973C-1B927FE5FCD4},1", + "{869D5929-6E5E-4EDB-9639-4C56977DD447},1", 1 ], [ - "{7D896A2D-61C9-42B2-AECF-B3C979B88BEB},1", + "{B0B53F94-0105-4C59-B65B-9473F49BFF41},1", 1 ], [ - "{EED86E95-3017-46A7-B26B-991C815839B7},1", + "{0E98EE82-B78F-4872-8BD9-5D9B23A817C5},1", 1 ], [ - "{0E8EA7AB-946D-461C-B571-96CCDC183FDC},1", + "{C837A033-F055-4455-B45F-17D82016921C},1", 1 ], [ - "{BE25CAF8-690F-4947-8683-3A37A7D52CCA},1", + "{89D86121-BF5C-418B-BB92-CBFFA8EF545F},1", 1 ], [ - "{F61E497B-25BB-426E-BC73-320A7B6D2E9E},1", + "{57E835EA-2799-4118-B55C-7BB1E51C6941},1", 1 ], [ - "{E53F33D2-F3FC-42C9-8DC8-B47261D1BDED},1", + "{F7EECCCF-B6B4-44F2-A543-36837EC18B8A},1", 1 ], [ - "{7FDAAAE9-CD33-42AA-A8AA-F87CE3BC8CD6},1", + "{361A0F09-EA63-4F2D-9620-C061D4E4707E},1", 1 ], [ - "{F0E8692A-3CBB-47A6-81D6-7B6E2A125A7F},1", + "{EB3940F1-F255-42BE-8C31-DD09E86DBAAF},1", 1 ], [ - "{71B566DF-DBD8-43B2-AD96-265FDB789E07},1", + "{C2870D07-8ADC-44BB-9F12-15D6C3708689},1", 1 ], [ - "{9C56CBC3-690B-4900-8A07-A43600F7477B},1", + "{1E0C6331-32C9-4EF9-8087-150A8669FA91},1", 1 ], [ - "{914C89B2-A95E-4992-8D2B-B533C7326D57},1", + "{ED9769DD-99D6-4BE2-B980-580DA9C4DFCE},1", 1 ], [ - "{2CA7400B-F732-4FAF-811B-AAFA91C480DF},1", + "{17C30054-7129-4A10-9D00-4D5545E4F4BA},1", 1 ], [ - "{73479EE6-9FC0-4474-A702-E22C734FC42B},1", + "{4C5FBA5B-E348-4750-ACE4-E9694D527BFF},1", 1 ], [ - "{B6C1B618-B721-49CD-B224-45DDFF38C8FC},1", + "{BD0EF658-4D0F-42A7-B546-B4F4A77D246B},1", 1 ], [ - "{CED8C7D5-5AC4-4553-B9F7-A02A1F599692},1", + "{6FEA70FA-1451-4A27-8A8E-C4CC3B713CF6},1", 1 ], [ - "{D260D973-E2FB-4654-89A2-13BAFC23AEDE},1", + "{68A1E0E1-7A39-4AB6-AD71-4D8A18878D79},1", 1 ], [ - "{EC0D40A0-9E0D-4262-9B4D-D075704938C9},1", + "{7E9041BD-301B-4B5B-9456-1C92050E4914},1", 1 ], [ - "{8E47F53D-F24F-4B3B-942F-390A8F0F31E7},1", + "{EFA77BAE-8A98-4176-B536-B615D1D2ED2B},1", 1 ], [ - "{1FBF8DA5-01E9-4248-BBB9-90B5C4ADFA58},1", + "{87AC0239-51A5-47C6-BAF4-926CCF56385C},1", 1 ], [ - "{A3909E43-E7FE-40C8-9222-0B60EA8CE89B},1", + "{C50BF7FC-F848-4B91-B8C8-743D0AA5F195},1", 1 ], [ - "{925E4C70-2C3F-480D-BB44-D3BF4A0FB985},1", + "{FD8D07D0-C447-4516-A7DB-F8522B77D4A7},1", 1 ], [ - "{1792331E-BA2E-4B60-B150-6AAF41BC488D},1", + "{D2E1FE57-F45D-49C3-B388-95222ACA3886},1", 1 ], [ - "{39716E7C-28A0-4770-BBD2-BB4018DBE93F},1", + "{7F6702B3-C977-436F-82AF-403E2BE950E7},1", 1 ], [ - "{D30FD954-4DA9-4B85-8950-12B85AFA12CB},1", + "{688C4EA1-80F5-4D85-B9BB-F8633FF3C0CA},1", 1 ], [ - "{0F4D72D3-20B0-4884-BF56-08BA4DBFB6FF},1", + "{754FA957-C432-4502-A5CF-EE44449462C0},1", 1 ], [ - "{574D9093-179F-46A3-B3F9-F7EB4345FADA},1", + "{D2197C55-D962-4DF0-8B14-26F88C06D6FA},1", 1 ], [ - "{12C643DD-9593-4641-B945-124257947ADD},1", + "{87B83BA8-A906-4F71-A6CA-3E8133A75D34},1", 1 ], [ - "{C4850841-2A3C-4402-BF11-7499914F9024},1", + "{F2D6AEBB-98EA-4F10-991F-5243E74AF450},1", 1 ], [ - "{37EF05A5-C2D9-44A2-84C0-BCA93ACB9048},1", + "{406687D7-F9E9-491B-85DA-166DE6CD5A60},1", 1 ], [ - "{27C692F0-F79D-4390-AB44-CB8B10E2B49E},1", + "{1F73BF36-9FC2-495D-844D-B370D5C47DE7},1", 1 ], [ - "{B1F28022-58CF-49CF-BC6F-D77A1A034AAC},1", + "{E9BD343F-4A66-4DE2-81F9-3789CCA22818},1", 1 ], [ - "{858FEBAE-05A2-4B49-92D2-96C28376330D},1", + "{189EA744-BE13-467A-95BA-2667A134C0B0},1", 1 ], [ - "{806A80BF-45E8-4188-B782-66A0DAA26E5A},1", + "{017F5881-F818-4C7C-B9F9-6BCB4085F1D0},1", 1 ], [ - "{940E7901-6EF0-43ED-BD42-E0C7658185B1},1", + "{CD0D17F4-25D8-4076-9AF7-47D9CDEFCF0A},1", 1 ], [ - "{D106259D-D139-4DAB-87BE-50AC5E5BEF80},1", + "{CCBB5969-BCE8-498B-BE1A-98FD3A44DB1A},1", 1 ], [ - "{A8883FF6-F53C-46B7-912C-779F9300FA77},1", + "{2B736B19-2D9C-4E76-A732-478D533D717A},1", 1 ] ] } }, - "space": "{31C1BA26-B092-43F4-B346-A5147633ACB5},1" + "space": "{90FCDB0C-36AE-422F-B4FE-67676826FE36},1" }, { "id": 2, "operation": { - "Insert": { - "author": "Author", - "created": 1473408656, - "guid": [ - 255, - 149, - 116, - 40, - 154, - 131, - 139, - 73, - 186, - 135, - 152, - 112, - 107, - 42, - 81, - 135 - ], - "parent": "{EC0D40A0-9E0D-4262-9B4D-D075704938C9},12", - "placement": { - "Outline": { - "x": 36.0, - "y": 36.0 - } + "Page": { + "after": { + "created": 134335976560000000, + "definitions": { + "{57E835EA-2799-4118-B55C-7BB1E51C6941},18": { + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": "Calibri", + "font_size": 17.0, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": null, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + }, + "kind": { + "name": "PageTitle", + "type": "Style" + } + } + }, + "margin_origin": [ + 0.0, + 0.0 + ], + "objects": [ + { + "Outline": { + "id": "{0817794A-7E1B-41EF-A811-A0F65EE1CE99},0", + "indents": [], + "layout": { + "max_height": null, + "max_width": null, + "reserved_width": null, + "width_set_by_user": null, + "x": 36.0, + "y": 36.0 + }, + "min_width": null, + "paragraphs": [ + { + "collapsed": false, + "content": { + "Text": { + "date_field": null, + "id": "{BB519837-B3F7-4C9B-A428-3D9696CA0070},0", + "tags": [], + "text": { + "spans": [ + { + "end": 16, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": "Calibri", + "font_size": 11.0, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": 1033, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + } + } + ], + "text": "Actor 1 🦀 é" + } + } + }, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": null, + "font_size": null, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": null, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + }, + "id": "{88AA1A5C-2020-4249-BF25-62D5B4957CC6},0", + "level": 1, + "lists": [], + "parent": null, + "style": null, + "tags": [] + } + ], + "title": false, + "unsupported": [] + } + }, + { + "Title": { + "date": null, + "id": "{57E835EA-2799-4118-B55C-7BB1E51C6941},13", + "layout": { + "max_height": null, + "max_width": null, + "reserved_width": null, + "width_set_by_user": null, + "x": 0.0, + "y": 0.0 + }, + "outlines": [ + { + "id": "{57E835EA-2799-4118-B55C-7BB1E51C6941},14", + "indents": [], + "layout": { + "max_height": null, + "max_width": null, + "reserved_width": null, + "width_set_by_user": null, + "x": null, + "y": null + }, + "min_width": null, + "paragraphs": [ + { + "collapsed": false, + "content": { + "Text": { + "date_field": null, + "id": "{57E835EA-2799-4118-B55C-7BB1E51C6941},16", + "tags": [], + "text": { + "spans": [ + { + "end": 10, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": "Calibri", + "font_size": 17.0, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": 1033, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + } + } + ], + "text": "Same title" + } + } + }, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": null, + "font_size": null, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": null, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + }, + "id": "{57E835EA-2799-4118-B55C-7BB1E51C6941},15", + "level": 1, + "lists": [], + "parent": null, + "style": "{57E835EA-2799-4118-B55C-7BB1E51C6941},18", + "tags": [] + } + ], + "title": false, + "unsupported": [] + } + ] + } + } + ], + "title": "Same title" }, - "text": "Actor 5 🦀 é" + "author": "Author", + "before": { + "created": 134335976560000000, + "definitions": { + "{57E835EA-2799-4118-B55C-7BB1E51C6941},18": { + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": "Calibri", + "font_size": 17.0, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": null, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + }, + "kind": { + "name": "PageTitle", + "type": "Style" + } + } + }, + "margin_origin": [ + 0.0, + 0.0 + ], + "objects": [ + { + "Title": { + "date": null, + "id": "{57E835EA-2799-4118-B55C-7BB1E51C6941},13", + "layout": { + "max_height": null, + "max_width": null, + "reserved_width": null, + "width_set_by_user": null, + "x": 0.0, + "y": 0.0 + }, + "outlines": [ + { + "id": "{57E835EA-2799-4118-B55C-7BB1E51C6941},14", + "indents": [], + "layout": { + "max_height": null, + "max_width": null, + "reserved_width": null, + "width_set_by_user": null, + "x": null, + "y": null + }, + "min_width": null, + "paragraphs": [ + { + "collapsed": false, + "content": { + "Text": { + "date_field": null, + "id": "{57E835EA-2799-4118-B55C-7BB1E51C6941},16", + "tags": [], + "text": { + "spans": [ + { + "end": 10, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": "Calibri", + "font_size": 17.0, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": 1033, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + } + } + ], + "text": "Same title" + } + } + }, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": null, + "font_size": null, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": null, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + }, + "id": "{57E835EA-2799-4118-B55C-7BB1E51C6941},15", + "level": 1, + "lists": [], + "parent": null, + "style": "{57E835EA-2799-4118-B55C-7BB1E51C6941},18", + "tags": [] + } + ], + "title": false, + "unsupported": [] + } + ] + } + } + ], + "title": "Same title" + } } }, - "space": "{EC0D40A0-9E0D-4262-9B4D-D075704938C9},1" + "space": "{57E835EA-2799-4118-B55C-7BB1E51C6941},1" } ], [ @@ -1634,980 +1366,4828 @@ "edits": [ { "guid": [ + 172, 90, - 196, - 10, - 13, - 157, - 154, + 29, + 103, + 245, + 250, + 220, + 74, + 178, + 30, + 220, + 119, + 124, + 185, + 174, + 198 + ], + "level": 1, + "position": { + "Before": "{361A0F09-EA63-4F2D-9620-C061D4E4707E},1" + }, + "space": "{EB3940F1-F255-42BE-8C31-DD09E86DBAAF},1" + }, + { + "guid": [ + 43, + 65, + 11, + 224, + 49, + 201, + 193, + 78, + 183, + 88, + 16, + 59, + 113, + 75, + 60, + 236 + ], + "level": 2, + "position": "Keep", + "space": "{C2870D07-8ADC-44BB-9F12-15D6C3708689},1" + } + ], + "observed": [ + [ + "{869D5929-6E5E-4EDB-9639-4C56977DD447},1", + 1 + ], + [ + "{B0B53F94-0105-4C59-B65B-9473F49BFF41},1", + 1 + ], + [ + "{0E98EE82-B78F-4872-8BD9-5D9B23A817C5},1", + 1 + ], + [ + "{C837A033-F055-4455-B45F-17D82016921C},1", + 1 + ], + [ + "{89D86121-BF5C-418B-BB92-CBFFA8EF545F},1", + 1 + ], + [ + "{57E835EA-2799-4118-B55C-7BB1E51C6941},1", + 1 + ], + [ + "{F7EECCCF-B6B4-44F2-A543-36837EC18B8A},1", + 1 + ], + [ + "{361A0F09-EA63-4F2D-9620-C061D4E4707E},1", + 1 + ], + [ + "{EB3940F1-F255-42BE-8C31-DD09E86DBAAF},1", + 1 + ], + [ + "{C2870D07-8ADC-44BB-9F12-15D6C3708689},1", + 1 + ], + [ + "{1E0C6331-32C9-4EF9-8087-150A8669FA91},1", + 1 + ], + [ + "{ED9769DD-99D6-4BE2-B980-580DA9C4DFCE},1", + 1 + ], + [ + "{17C30054-7129-4A10-9D00-4D5545E4F4BA},1", + 1 + ], + [ + "{4C5FBA5B-E348-4750-ACE4-E9694D527BFF},1", + 1 + ], + [ + "{BD0EF658-4D0F-42A7-B546-B4F4A77D246B},1", + 1 + ], + [ + "{6FEA70FA-1451-4A27-8A8E-C4CC3B713CF6},1", + 1 + ], + [ + "{68A1E0E1-7A39-4AB6-AD71-4D8A18878D79},1", + 1 + ], + [ + "{7E9041BD-301B-4B5B-9456-1C92050E4914},1", + 1 + ], + [ + "{EFA77BAE-8A98-4176-B536-B615D1D2ED2B},1", + 1 + ], + [ + "{87AC0239-51A5-47C6-BAF4-926CCF56385C},1", + 1 + ], + [ + "{C50BF7FC-F848-4B91-B8C8-743D0AA5F195},1", + 1 + ], + [ + "{FD8D07D0-C447-4516-A7DB-F8522B77D4A7},1", + 1 + ], + [ + "{D2E1FE57-F45D-49C3-B388-95222ACA3886},1", + 1 + ], + [ + "{7F6702B3-C977-436F-82AF-403E2BE950E7},1", + 1 + ], + [ + "{688C4EA1-80F5-4D85-B9BB-F8633FF3C0CA},1", + 1 + ], + [ + "{754FA957-C432-4502-A5CF-EE44449462C0},1", + 1 + ], + [ + "{D2197C55-D962-4DF0-8B14-26F88C06D6FA},1", + 1 + ], + [ + "{87B83BA8-A906-4F71-A6CA-3E8133A75D34},1", + 1 + ], + [ + "{F2D6AEBB-98EA-4F10-991F-5243E74AF450},1", + 1 + ], + [ + "{406687D7-F9E9-491B-85DA-166DE6CD5A60},1", + 1 + ], + [ + "{1F73BF36-9FC2-495D-844D-B370D5C47DE7},1", + 1 + ], + [ + "{E9BD343F-4A66-4DE2-81F9-3789CCA22818},1", + 1 + ], + [ + "{189EA744-BE13-467A-95BA-2667A134C0B0},1", + 1 + ], + [ + "{017F5881-F818-4C7C-B9F9-6BCB4085F1D0},1", + 1 + ], + [ + "{CD0D17F4-25D8-4076-9AF7-47D9CDEFCF0A},1", + 1 + ], + [ + "{CCBB5969-BCE8-498B-BE1A-98FD3A44DB1A},1", + 1 + ], + [ + "{2B736B19-2D9C-4E76-A732-478D533D717A},1", + 1 + ] + ] + } + }, + "space": "{90FCDB0C-36AE-422F-B4FE-67676826FE36},1" + }, + { + "id": 2, + "operation": { + "Page": { + "after": { + "created": 134335976560000000, + "definitions": { + "{EB3940F1-F255-42BE-8C31-DD09E86DBAAF},18": { + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": "Calibri", + "font_size": 17.0, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": null, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + }, + "kind": { + "name": "PageTitle", + "type": "Style" + } + } + }, + "margin_origin": [ + 0.0, + 0.0 + ], + "objects": [ + { + "Outline": { + "id": "{5C473AF1-9E02-4E9A-BFC8-9E9CBBB289E1},0", + "indents": [], + "layout": { + "max_height": null, + "max_width": null, + "reserved_width": null, + "width_set_by_user": null, + "x": 36.0, + "y": 36.0 + }, + "min_width": null, + "paragraphs": [ + { + "collapsed": false, + "content": { + "Text": { + "date_field": null, + "id": "{B412B53F-86FF-4462-8750-FB4D73532A63},0", + "tags": [], + "text": { + "spans": [ + { + "end": 16, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": "Calibri", + "font_size": 11.0, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": 1033, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + } + } + ], + "text": "Actor 2 🦀 é" + } + } + }, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": null, + "font_size": null, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": null, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + }, + "id": "{ADE09A18-DF3F-4995-BF31-D453831561D7},0", + "level": 1, + "lists": [], + "parent": null, + "style": null, + "tags": [] + } + ], + "title": false, + "unsupported": [] + } + }, + { + "Title": { + "date": null, + "id": "{EB3940F1-F255-42BE-8C31-DD09E86DBAAF},13", + "layout": { + "max_height": null, + "max_width": null, + "reserved_width": null, + "width_set_by_user": null, + "x": 0.0, + "y": 0.0 + }, + "outlines": [ + { + "id": "{EB3940F1-F255-42BE-8C31-DD09E86DBAAF},14", + "indents": [], + "layout": { + "max_height": null, + "max_width": null, + "reserved_width": null, + "width_set_by_user": null, + "x": null, + "y": null + }, + "min_width": null, + "paragraphs": [ + { + "collapsed": false, + "content": { + "Text": { + "date_field": null, + "id": "{EB3940F1-F255-42BE-8C31-DD09E86DBAAF},16", + "tags": [], + "text": { + "spans": [ + { + "end": 10, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": "Calibri", + "font_size": 17.0, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": 1033, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + } + } + ], + "text": "Same title" + } + } + }, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": null, + "font_size": null, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": null, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + }, + "id": "{EB3940F1-F255-42BE-8C31-DD09E86DBAAF},15", + "level": 1, + "lists": [], + "parent": null, + "style": "{EB3940F1-F255-42BE-8C31-DD09E86DBAAF},18", + "tags": [] + } + ], + "title": false, + "unsupported": [] + } + ] + } + } + ], + "title": "Same title" + }, + "author": "Author", + "before": { + "created": 134335976560000000, + "definitions": { + "{EB3940F1-F255-42BE-8C31-DD09E86DBAAF},18": { + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": "Calibri", + "font_size": 17.0, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": null, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + }, + "kind": { + "name": "PageTitle", + "type": "Style" + } + } + }, + "margin_origin": [ + 0.0, + 0.0 + ], + "objects": [ + { + "Title": { + "date": null, + "id": "{EB3940F1-F255-42BE-8C31-DD09E86DBAAF},13", + "layout": { + "max_height": null, + "max_width": null, + "reserved_width": null, + "width_set_by_user": null, + "x": 0.0, + "y": 0.0 + }, + "outlines": [ + { + "id": "{EB3940F1-F255-42BE-8C31-DD09E86DBAAF},14", + "indents": [], + "layout": { + "max_height": null, + "max_width": null, + "reserved_width": null, + "width_set_by_user": null, + "x": null, + "y": null + }, + "min_width": null, + "paragraphs": [ + { + "collapsed": false, + "content": { + "Text": { + "date_field": null, + "id": "{EB3940F1-F255-42BE-8C31-DD09E86DBAAF},16", + "tags": [], + "text": { + "spans": [ + { + "end": 10, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": "Calibri", + "font_size": 17.0, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": 1033, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + } + } + ], + "text": "Same title" + } + } + }, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": null, + "font_size": null, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": null, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + }, + "id": "{EB3940F1-F255-42BE-8C31-DD09E86DBAAF},15", + "level": 1, + "lists": [], + "parent": null, + "style": "{EB3940F1-F255-42BE-8C31-DD09E86DBAAF},18", + "tags": [] + } + ], + "title": false, + "unsupported": [] + } + ] + } + } + ], + "title": "Same title" + } + } + }, + "space": "{EB3940F1-F255-42BE-8C31-DD09E86DBAAF},1" + } + ], + [ + { + "id": 1, + "operation": { + "Pages": { + "edits": [ + { + "guid": [ + 220, + 22, + 109, + 148, + 199, + 94, + 248, + 76, + 168, + 183, + 186, + 119, + 172, + 76, + 100, + 21 + ], + "level": 1, + "position": { + "Before": "{1E0C6331-32C9-4EF9-8087-150A8669FA91},1" + }, + "space": "{ED9769DD-99D6-4BE2-B980-580DA9C4DFCE},1" + }, + { + "guid": [ + 177, + 33, + 19, + 250, + 24, + 200, + 209, + 74, + 175, + 22, + 210, + 214, + 251, + 44, + 125, + 123 + ], + "level": 2, + "position": "Keep", + "space": "{17C30054-7129-4A10-9D00-4D5545E4F4BA},1" + } + ], + "observed": [ + [ + "{869D5929-6E5E-4EDB-9639-4C56977DD447},1", + 1 + ], + [ + "{B0B53F94-0105-4C59-B65B-9473F49BFF41},1", + 1 + ], + [ + "{0E98EE82-B78F-4872-8BD9-5D9B23A817C5},1", + 1 + ], + [ + "{C837A033-F055-4455-B45F-17D82016921C},1", + 1 + ], + [ + "{89D86121-BF5C-418B-BB92-CBFFA8EF545F},1", + 1 + ], + [ + "{57E835EA-2799-4118-B55C-7BB1E51C6941},1", + 1 + ], + [ + "{F7EECCCF-B6B4-44F2-A543-36837EC18B8A},1", + 1 + ], + [ + "{361A0F09-EA63-4F2D-9620-C061D4E4707E},1", + 1 + ], + [ + "{EB3940F1-F255-42BE-8C31-DD09E86DBAAF},1", + 1 + ], + [ + "{C2870D07-8ADC-44BB-9F12-15D6C3708689},1", + 1 + ], + [ + "{1E0C6331-32C9-4EF9-8087-150A8669FA91},1", + 1 + ], + [ + "{ED9769DD-99D6-4BE2-B980-580DA9C4DFCE},1", + 1 + ], + [ + "{17C30054-7129-4A10-9D00-4D5545E4F4BA},1", + 1 + ], + [ + "{4C5FBA5B-E348-4750-ACE4-E9694D527BFF},1", + 1 + ], + [ + "{BD0EF658-4D0F-42A7-B546-B4F4A77D246B},1", + 1 + ], + [ + "{6FEA70FA-1451-4A27-8A8E-C4CC3B713CF6},1", + 1 + ], + [ + "{68A1E0E1-7A39-4AB6-AD71-4D8A18878D79},1", + 1 + ], + [ + "{7E9041BD-301B-4B5B-9456-1C92050E4914},1", + 1 + ], + [ + "{EFA77BAE-8A98-4176-B536-B615D1D2ED2B},1", + 1 + ], + [ + "{87AC0239-51A5-47C6-BAF4-926CCF56385C},1", + 1 + ], + [ + "{C50BF7FC-F848-4B91-B8C8-743D0AA5F195},1", + 1 + ], + [ + "{FD8D07D0-C447-4516-A7DB-F8522B77D4A7},1", + 1 + ], + [ + "{D2E1FE57-F45D-49C3-B388-95222ACA3886},1", + 1 + ], + [ + "{7F6702B3-C977-436F-82AF-403E2BE950E7},1", + 1 + ], + [ + "{688C4EA1-80F5-4D85-B9BB-F8633FF3C0CA},1", + 1 + ], + [ + "{754FA957-C432-4502-A5CF-EE44449462C0},1", + 1 + ], + [ + "{D2197C55-D962-4DF0-8B14-26F88C06D6FA},1", + 1 + ], + [ + "{87B83BA8-A906-4F71-A6CA-3E8133A75D34},1", + 1 + ], + [ + "{F2D6AEBB-98EA-4F10-991F-5243E74AF450},1", + 1 + ], + [ + "{406687D7-F9E9-491B-85DA-166DE6CD5A60},1", + 1 + ], + [ + "{1F73BF36-9FC2-495D-844D-B370D5C47DE7},1", + 1 + ], + [ + "{E9BD343F-4A66-4DE2-81F9-3789CCA22818},1", + 1 + ], + [ + "{189EA744-BE13-467A-95BA-2667A134C0B0},1", + 1 + ], + [ + "{017F5881-F818-4C7C-B9F9-6BCB4085F1D0},1", + 1 + ], + [ + "{CD0D17F4-25D8-4076-9AF7-47D9CDEFCF0A},1", + 1 + ], + [ + "{CCBB5969-BCE8-498B-BE1A-98FD3A44DB1A},1", + 1 + ], + [ + "{2B736B19-2D9C-4E76-A732-478D533D717A},1", + 1 + ] + ] + } + }, + "space": "{90FCDB0C-36AE-422F-B4FE-67676826FE36},1" + }, + { + "id": 2, + "operation": { + "Page": { + "after": { + "created": 134335976560000000, + "definitions": { + "{ED9769DD-99D6-4BE2-B980-580DA9C4DFCE},18": { + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": "Calibri", + "font_size": 17.0, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": null, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + }, + "kind": { + "name": "PageTitle", + "type": "Style" + } + } + }, + "margin_origin": [ + 0.0, + 0.0 + ], + "objects": [ + { + "Outline": { + "id": "{930570FE-0B42-4598-A6B7-74E90CE526D4},0", + "indents": [], + "layout": { + "max_height": null, + "max_width": null, + "reserved_width": null, + "width_set_by_user": null, + "x": 36.0, + "y": 36.0 + }, + "min_width": null, + "paragraphs": [ + { + "collapsed": false, + "content": { + "Text": { + "date_field": null, + "id": "{917ABDDE-781F-45C9-90B5-A63A0FBCAEE4},0", + "tags": [], + "text": { + "spans": [ + { + "end": 16, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": "Calibri", + "font_size": 11.0, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": 1033, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + } + } + ], + "text": "Actor 3 🦀 é" + } + } + }, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": null, + "font_size": null, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": null, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + }, + "id": "{A4C1F94C-C7D9-4C9A-8F97-D7437FF3F499},0", + "level": 1, + "lists": [], + "parent": null, + "style": null, + "tags": [] + } + ], + "title": false, + "unsupported": [] + } + }, + { + "Title": { + "date": null, + "id": "{ED9769DD-99D6-4BE2-B980-580DA9C4DFCE},13", + "layout": { + "max_height": null, + "max_width": null, + "reserved_width": null, + "width_set_by_user": null, + "x": 0.0, + "y": 0.0 + }, + "outlines": [ + { + "id": "{ED9769DD-99D6-4BE2-B980-580DA9C4DFCE},14", + "indents": [], + "layout": { + "max_height": null, + "max_width": null, + "reserved_width": null, + "width_set_by_user": null, + "x": null, + "y": null + }, + "min_width": null, + "paragraphs": [ + { + "collapsed": false, + "content": { + "Text": { + "date_field": null, + "id": "{ED9769DD-99D6-4BE2-B980-580DA9C4DFCE},16", + "tags": [], + "text": { + "spans": [ + { + "end": 10, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": "Calibri", + "font_size": 17.0, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": 1033, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + } + } + ], + "text": "Same title" + } + } + }, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": null, + "font_size": null, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": null, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + }, + "id": "{ED9769DD-99D6-4BE2-B980-580DA9C4DFCE},15", + "level": 1, + "lists": [], + "parent": null, + "style": "{ED9769DD-99D6-4BE2-B980-580DA9C4DFCE},18", + "tags": [] + } + ], + "title": false, + "unsupported": [] + } + ] + } + } + ], + "title": "Same title" + }, + "author": "Author", + "before": { + "created": 134335976560000000, + "definitions": { + "{ED9769DD-99D6-4BE2-B980-580DA9C4DFCE},18": { + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": "Calibri", + "font_size": 17.0, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": null, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + }, + "kind": { + "name": "PageTitle", + "type": "Style" + } + } + }, + "margin_origin": [ + 0.0, + 0.0 + ], + "objects": [ + { + "Title": { + "date": null, + "id": "{ED9769DD-99D6-4BE2-B980-580DA9C4DFCE},13", + "layout": { + "max_height": null, + "max_width": null, + "reserved_width": null, + "width_set_by_user": null, + "x": 0.0, + "y": 0.0 + }, + "outlines": [ + { + "id": "{ED9769DD-99D6-4BE2-B980-580DA9C4DFCE},14", + "indents": [], + "layout": { + "max_height": null, + "max_width": null, + "reserved_width": null, + "width_set_by_user": null, + "x": null, + "y": null + }, + "min_width": null, + "paragraphs": [ + { + "collapsed": false, + "content": { + "Text": { + "date_field": null, + "id": "{ED9769DD-99D6-4BE2-B980-580DA9C4DFCE},16", + "tags": [], + "text": { + "spans": [ + { + "end": 10, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": "Calibri", + "font_size": 17.0, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": 1033, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + } + } + ], + "text": "Same title" + } + } + }, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": null, + "font_size": null, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": null, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + }, + "id": "{ED9769DD-99D6-4BE2-B980-580DA9C4DFCE},15", + "level": 1, + "lists": [], + "parent": null, + "style": "{ED9769DD-99D6-4BE2-B980-580DA9C4DFCE},18", + "tags": [] + } + ], + "title": false, + "unsupported": [] + } + ] + } + } + ], + "title": "Same title" + } + } + }, + "space": "{ED9769DD-99D6-4BE2-B980-580DA9C4DFCE},1" + } + ], + [ + { + "id": 1, + "operation": { + "Pages": { + "edits": [ + { + "guid": [ + 240, + 213, + 212, + 204, + 25, + 156, + 182, + 67, + 143, + 206, + 96, + 209, + 2, + 198, + 208, + 94 + ], + "level": 1, + "position": { + "Before": "{4C5FBA5B-E348-4750-ACE4-E9694D527BFF},1" + }, + "space": "{BD0EF658-4D0F-42A7-B546-B4F4A77D246B},1" + }, + { + "guid": [ + 82, + 173, + 19, + 143, + 3, + 17, + 177, + 66, + 183, + 218, + 131, + 72, + 199, + 191, 233, - 79, - 148, - 125, + 214 + ], + "level": 2, + "position": "Keep", + "space": "{6FEA70FA-1451-4A27-8A8E-C4CC3B713CF6},1" + } + ], + "observed": [ + [ + "{869D5929-6E5E-4EDB-9639-4C56977DD447},1", + 1 + ], + [ + "{B0B53F94-0105-4C59-B65B-9473F49BFF41},1", + 1 + ], + [ + "{0E98EE82-B78F-4872-8BD9-5D9B23A817C5},1", + 1 + ], + [ + "{C837A033-F055-4455-B45F-17D82016921C},1", + 1 + ], + [ + "{89D86121-BF5C-418B-BB92-CBFFA8EF545F},1", + 1 + ], + [ + "{57E835EA-2799-4118-B55C-7BB1E51C6941},1", + 1 + ], + [ + "{F7EECCCF-B6B4-44F2-A543-36837EC18B8A},1", + 1 + ], + [ + "{361A0F09-EA63-4F2D-9620-C061D4E4707E},1", + 1 + ], + [ + "{EB3940F1-F255-42BE-8C31-DD09E86DBAAF},1", + 1 + ], + [ + "{C2870D07-8ADC-44BB-9F12-15D6C3708689},1", + 1 + ], + [ + "{1E0C6331-32C9-4EF9-8087-150A8669FA91},1", + 1 + ], + [ + "{ED9769DD-99D6-4BE2-B980-580DA9C4DFCE},1", + 1 + ], + [ + "{17C30054-7129-4A10-9D00-4D5545E4F4BA},1", + 1 + ], + [ + "{4C5FBA5B-E348-4750-ACE4-E9694D527BFF},1", + 1 + ], + [ + "{BD0EF658-4D0F-42A7-B546-B4F4A77D246B},1", + 1 + ], + [ + "{6FEA70FA-1451-4A27-8A8E-C4CC3B713CF6},1", + 1 + ], + [ + "{68A1E0E1-7A39-4AB6-AD71-4D8A18878D79},1", + 1 + ], + [ + "{7E9041BD-301B-4B5B-9456-1C92050E4914},1", + 1 + ], + [ + "{EFA77BAE-8A98-4176-B536-B615D1D2ED2B},1", + 1 + ], + [ + "{87AC0239-51A5-47C6-BAF4-926CCF56385C},1", + 1 + ], + [ + "{C50BF7FC-F848-4B91-B8C8-743D0AA5F195},1", + 1 + ], + [ + "{FD8D07D0-C447-4516-A7DB-F8522B77D4A7},1", + 1 + ], + [ + "{D2E1FE57-F45D-49C3-B388-95222ACA3886},1", + 1 + ], + [ + "{7F6702B3-C977-436F-82AF-403E2BE950E7},1", + 1 + ], + [ + "{688C4EA1-80F5-4D85-B9BB-F8633FF3C0CA},1", + 1 + ], + [ + "{754FA957-C432-4502-A5CF-EE44449462C0},1", + 1 + ], + [ + "{D2197C55-D962-4DF0-8B14-26F88C06D6FA},1", + 1 + ], + [ + "{87B83BA8-A906-4F71-A6CA-3E8133A75D34},1", + 1 + ], + [ + "{F2D6AEBB-98EA-4F10-991F-5243E74AF450},1", + 1 + ], + [ + "{406687D7-F9E9-491B-85DA-166DE6CD5A60},1", + 1 + ], + [ + "{1F73BF36-9FC2-495D-844D-B370D5C47DE7},1", + 1 + ], + [ + "{E9BD343F-4A66-4DE2-81F9-3789CCA22818},1", + 1 + ], + [ + "{189EA744-BE13-467A-95BA-2667A134C0B0},1", + 1 + ], + [ + "{017F5881-F818-4C7C-B9F9-6BCB4085F1D0},1", + 1 + ], + [ + "{CD0D17F4-25D8-4076-9AF7-47D9CDEFCF0A},1", + 1 + ], + [ + "{CCBB5969-BCE8-498B-BE1A-98FD3A44DB1A},1", + 1 + ], + [ + "{2B736B19-2D9C-4E76-A732-478D533D717A},1", + 1 + ] + ] + } + }, + "space": "{90FCDB0C-36AE-422F-B4FE-67676826FE36},1" + }, + { + "id": 2, + "operation": { + "Page": { + "after": { + "created": 134335976560000000, + "definitions": { + "{BD0EF658-4D0F-42A7-B546-B4F4A77D246B},18": { + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": "Calibri", + "font_size": 17.0, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": null, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + }, + "kind": { + "name": "PageTitle", + "type": "Style" + } + } + }, + "margin_origin": [ + 0.0, + 0.0 + ], + "objects": [ + { + "Outline": { + "id": "{6A6E0E73-D2A2-4C82-B0B4-E8A3695B4D5A},0", + "indents": [], + "layout": { + "max_height": null, + "max_width": null, + "reserved_width": null, + "width_set_by_user": null, + "x": 36.0, + "y": 36.0 + }, + "min_width": null, + "paragraphs": [ + { + "collapsed": false, + "content": { + "Text": { + "date_field": null, + "id": "{A11F6C01-70A2-44C7-90E9-91C455D075E7},0", + "tags": [], + "text": { + "spans": [ + { + "end": 16, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": "Calibri", + "font_size": 11.0, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": 1033, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + } + } + ], + "text": "Actor 4 🦀 é" + } + } + }, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": null, + "font_size": null, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": null, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + }, + "id": "{1B1F5EFD-3EE8-4031-BEB2-C3D27A332144},0", + "level": 1, + "lists": [], + "parent": null, + "style": null, + "tags": [] + } + ], + "title": false, + "unsupported": [] + } + }, + { + "Title": { + "date": null, + "id": "{BD0EF658-4D0F-42A7-B546-B4F4A77D246B},13", + "layout": { + "max_height": null, + "max_width": null, + "reserved_width": null, + "width_set_by_user": null, + "x": 0.0, + "y": 0.0 + }, + "outlines": [ + { + "id": "{BD0EF658-4D0F-42A7-B546-B4F4A77D246B},14", + "indents": [], + "layout": { + "max_height": null, + "max_width": null, + "reserved_width": null, + "width_set_by_user": null, + "x": null, + "y": null + }, + "min_width": null, + "paragraphs": [ + { + "collapsed": false, + "content": { + "Text": { + "date_field": null, + "id": "{BD0EF658-4D0F-42A7-B546-B4F4A77D246B},16", + "tags": [], + "text": { + "spans": [ + { + "end": 10, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": "Calibri", + "font_size": 17.0, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": 1033, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + } + } + ], + "text": "Same title" + } + } + }, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": null, + "font_size": null, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": null, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + }, + "id": "{BD0EF658-4D0F-42A7-B546-B4F4A77D246B},15", + "level": 1, + "lists": [], + "parent": null, + "style": "{BD0EF658-4D0F-42A7-B546-B4F4A77D246B},18", + "tags": [] + } + ], + "title": false, + "unsupported": [] + } + ] + } + } + ], + "title": "Same title" + }, + "author": "Author", + "before": { + "created": 134335976560000000, + "definitions": { + "{BD0EF658-4D0F-42A7-B546-B4F4A77D246B},18": { + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": "Calibri", + "font_size": 17.0, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": null, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + }, + "kind": { + "name": "PageTitle", + "type": "Style" + } + } + }, + "margin_origin": [ + 0.0, + 0.0 + ], + "objects": [ + { + "Title": { + "date": null, + "id": "{BD0EF658-4D0F-42A7-B546-B4F4A77D246B},13", + "layout": { + "max_height": null, + "max_width": null, + "reserved_width": null, + "width_set_by_user": null, + "x": 0.0, + "y": 0.0 + }, + "outlines": [ + { + "id": "{BD0EF658-4D0F-42A7-B546-B4F4A77D246B},14", + "indents": [], + "layout": { + "max_height": null, + "max_width": null, + "reserved_width": null, + "width_set_by_user": null, + "x": null, + "y": null + }, + "min_width": null, + "paragraphs": [ + { + "collapsed": false, + "content": { + "Text": { + "date_field": null, + "id": "{BD0EF658-4D0F-42A7-B546-B4F4A77D246B},16", + "tags": [], + "text": { + "spans": [ + { + "end": 10, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": "Calibri", + "font_size": 17.0, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": 1033, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + } + } + ], + "text": "Same title" + } + } + }, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": null, + "font_size": null, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": null, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + }, + "id": "{BD0EF658-4D0F-42A7-B546-B4F4A77D246B},15", + "level": 1, + "lists": [], + "parent": null, + "style": "{BD0EF658-4D0F-42A7-B546-B4F4A77D246B},18", + "tags": [] + } + ], + "title": false, + "unsupported": [] + } + ] + } + } + ], + "title": "Same title" + } + } + }, + "space": "{BD0EF658-4D0F-42A7-B546-B4F4A77D246B},1" + } + ], + [ + { + "id": 1, + "operation": { + "Pages": { + "edits": [ + { + "guid": [ 170, - 133, - 213, - 12, - 242, - 187 - ], - "level": 1, - "position": { - "Before": "{1FBF8DA5-01E9-4248-BBB9-90B5C4ADFA58},1" - }, - "space": "{A3909E43-E7FE-40C8-9222-0B60EA8CE89B},1" - }, - { - "guid": [ - 158, - 142, - 245, - 209, - 34, - 112, - 75, - 79, - 157, - 220, - 50, - 10, + 199, + 91, + 6, + 149, + 108, + 28, + 78, + 169, + 241, 201, - 168, + 191, + 131, + 111, + 13, + 167 + ], + "level": 1, + "position": { + "Before": "{68A1E0E1-7A39-4AB6-AD71-4D8A18878D79},1" + }, + "space": "{7E9041BD-301B-4B5B-9456-1C92050E4914},1" + }, + { + "guid": [ + 18, + 19, + 211, + 10, + 209, + 7, + 195, + 66, + 172, + 223, + 64, + 131, + 73, + 37, + 59, + 187 + ], + "level": 2, + "position": "Keep", + "space": "{EFA77BAE-8A98-4176-B536-B615D1D2ED2B},1" + } + ], + "observed": [ + [ + "{869D5929-6E5E-4EDB-9639-4C56977DD447},1", + 1 + ], + [ + "{B0B53F94-0105-4C59-B65B-9473F49BFF41},1", + 1 + ], + [ + "{0E98EE82-B78F-4872-8BD9-5D9B23A817C5},1", + 1 + ], + [ + "{C837A033-F055-4455-B45F-17D82016921C},1", + 1 + ], + [ + "{89D86121-BF5C-418B-BB92-CBFFA8EF545F},1", + 1 + ], + [ + "{57E835EA-2799-4118-B55C-7BB1E51C6941},1", + 1 + ], + [ + "{F7EECCCF-B6B4-44F2-A543-36837EC18B8A},1", + 1 + ], + [ + "{361A0F09-EA63-4F2D-9620-C061D4E4707E},1", + 1 + ], + [ + "{EB3940F1-F255-42BE-8C31-DD09E86DBAAF},1", + 1 + ], + [ + "{C2870D07-8ADC-44BB-9F12-15D6C3708689},1", + 1 + ], + [ + "{1E0C6331-32C9-4EF9-8087-150A8669FA91},1", + 1 + ], + [ + "{ED9769DD-99D6-4BE2-B980-580DA9C4DFCE},1", + 1 + ], + [ + "{17C30054-7129-4A10-9D00-4D5545E4F4BA},1", + 1 + ], + [ + "{4C5FBA5B-E348-4750-ACE4-E9694D527BFF},1", + 1 + ], + [ + "{BD0EF658-4D0F-42A7-B546-B4F4A77D246B},1", + 1 + ], + [ + "{6FEA70FA-1451-4A27-8A8E-C4CC3B713CF6},1", + 1 + ], + [ + "{68A1E0E1-7A39-4AB6-AD71-4D8A18878D79},1", + 1 + ], + [ + "{7E9041BD-301B-4B5B-9456-1C92050E4914},1", + 1 + ], + [ + "{EFA77BAE-8A98-4176-B536-B615D1D2ED2B},1", + 1 + ], + [ + "{87AC0239-51A5-47C6-BAF4-926CCF56385C},1", + 1 + ], + [ + "{C50BF7FC-F848-4B91-B8C8-743D0AA5F195},1", + 1 + ], + [ + "{FD8D07D0-C447-4516-A7DB-F8522B77D4A7},1", + 1 + ], + [ + "{D2E1FE57-F45D-49C3-B388-95222ACA3886},1", + 1 + ], + [ + "{7F6702B3-C977-436F-82AF-403E2BE950E7},1", + 1 + ], + [ + "{688C4EA1-80F5-4D85-B9BB-F8633FF3C0CA},1", + 1 + ], + [ + "{754FA957-C432-4502-A5CF-EE44449462C0},1", + 1 + ], + [ + "{D2197C55-D962-4DF0-8B14-26F88C06D6FA},1", + 1 + ], + [ + "{87B83BA8-A906-4F71-A6CA-3E8133A75D34},1", + 1 + ], + [ + "{F2D6AEBB-98EA-4F10-991F-5243E74AF450},1", + 1 + ], + [ + "{406687D7-F9E9-491B-85DA-166DE6CD5A60},1", + 1 + ], + [ + "{1F73BF36-9FC2-495D-844D-B370D5C47DE7},1", + 1 + ], + [ + "{E9BD343F-4A66-4DE2-81F9-3789CCA22818},1", + 1 + ], + [ + "{189EA744-BE13-467A-95BA-2667A134C0B0},1", + 1 + ], + [ + "{017F5881-F818-4C7C-B9F9-6BCB4085F1D0},1", + 1 + ], + [ + "{CD0D17F4-25D8-4076-9AF7-47D9CDEFCF0A},1", + 1 + ], + [ + "{CCBB5969-BCE8-498B-BE1A-98FD3A44DB1A},1", + 1 + ], + [ + "{2B736B19-2D9C-4E76-A732-478D533D717A},1", + 1 + ] + ] + } + }, + "space": "{90FCDB0C-36AE-422F-B4FE-67676826FE36},1" + }, + { + "id": 2, + "operation": { + "Page": { + "after": { + "created": 134335976560000000, + "definitions": { + "{7E9041BD-301B-4B5B-9456-1C92050E4914},18": { + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": "Calibri", + "font_size": 17.0, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": null, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + }, + "kind": { + "name": "PageTitle", + "type": "Style" + } + } + }, + "margin_origin": [ + 0.0, + 0.0 + ], + "objects": [ + { + "Outline": { + "id": "{9D60419E-FC09-4547-8A45-5083DF888B11},0", + "indents": [], + "layout": { + "max_height": null, + "max_width": null, + "reserved_width": null, + "width_set_by_user": null, + "x": 36.0, + "y": 36.0 + }, + "min_width": null, + "paragraphs": [ + { + "collapsed": false, + "content": { + "Text": { + "date_field": null, + "id": "{A30B6C43-D76B-4629-B1C4-AC8F2FF6CBEE},0", + "tags": [], + "text": { + "spans": [ + { + "end": 16, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": "Calibri", + "font_size": 11.0, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": 1033, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + } + } + ], + "text": "Actor 5 🦀 é" + } + } + }, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": null, + "font_size": null, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": null, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + }, + "id": "{AD6C0452-3D66-42DF-8865-A679E80B3F05},0", + "level": 1, + "lists": [], + "parent": null, + "style": null, + "tags": [] + } + ], + "title": false, + "unsupported": [] + } + }, + { + "Title": { + "date": null, + "id": "{7E9041BD-301B-4B5B-9456-1C92050E4914},13", + "layout": { + "max_height": null, + "max_width": null, + "reserved_width": null, + "width_set_by_user": null, + "x": 0.0, + "y": 0.0 + }, + "outlines": [ + { + "id": "{7E9041BD-301B-4B5B-9456-1C92050E4914},14", + "indents": [], + "layout": { + "max_height": null, + "max_width": null, + "reserved_width": null, + "width_set_by_user": null, + "x": null, + "y": null + }, + "min_width": null, + "paragraphs": [ + { + "collapsed": false, + "content": { + "Text": { + "date_field": null, + "id": "{7E9041BD-301B-4B5B-9456-1C92050E4914},16", + "tags": [], + "text": { + "spans": [ + { + "end": 10, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": "Calibri", + "font_size": 17.0, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": 1033, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + } + } + ], + "text": "Same title" + } + } + }, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": null, + "font_size": null, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": null, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + }, + "id": "{7E9041BD-301B-4B5B-9456-1C92050E4914},15", + "level": 1, + "lists": [], + "parent": null, + "style": "{7E9041BD-301B-4B5B-9456-1C92050E4914},18", + "tags": [] + } + ], + "title": false, + "unsupported": [] + } + ] + } + } + ], + "title": "Same title" + }, + "author": "Author", + "before": { + "created": 134335976560000000, + "definitions": { + "{7E9041BD-301B-4B5B-9456-1C92050E4914},18": { + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": "Calibri", + "font_size": 17.0, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": null, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + }, + "kind": { + "name": "PageTitle", + "type": "Style" + } + } + }, + "margin_origin": [ + 0.0, + 0.0 + ], + "objects": [ + { + "Title": { + "date": null, + "id": "{7E9041BD-301B-4B5B-9456-1C92050E4914},13", + "layout": { + "max_height": null, + "max_width": null, + "reserved_width": null, + "width_set_by_user": null, + "x": 0.0, + "y": 0.0 + }, + "outlines": [ + { + "id": "{7E9041BD-301B-4B5B-9456-1C92050E4914},14", + "indents": [], + "layout": { + "max_height": null, + "max_width": null, + "reserved_width": null, + "width_set_by_user": null, + "x": null, + "y": null + }, + "min_width": null, + "paragraphs": [ + { + "collapsed": false, + "content": { + "Text": { + "date_field": null, + "id": "{7E9041BD-301B-4B5B-9456-1C92050E4914},16", + "tags": [], + "text": { + "spans": [ + { + "end": 10, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": "Calibri", + "font_size": 17.0, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": 1033, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + } + } + ], + "text": "Same title" + } + } + }, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": null, + "font_size": null, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": null, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + }, + "id": "{7E9041BD-301B-4B5B-9456-1C92050E4914},15", + "level": 1, + "lists": [], + "parent": null, + "style": "{7E9041BD-301B-4B5B-9456-1C92050E4914},18", + "tags": [] + } + ], + "title": false, + "unsupported": [] + } + ] + } + } + ], + "title": "Same title" + } + } + }, + "space": "{7E9041BD-301B-4B5B-9456-1C92050E4914},1" + } + ], + [ + { + "id": 1, + "operation": { + "Pages": { + "edits": [ + { + "guid": [ + 235, + 237, + 5, + 138, + 5, 243, - 47 - ], - "level": 2, - "position": "Keep", - "space": "{925E4C70-2C3F-480D-BB44-D3BF4A0FB985},1" - } - ], - "observed": [ - [ - "{90D67E9A-BEC2-43C9-973C-1B927FE5FCD4},1", - 1 - ], - [ - "{7D896A2D-61C9-42B2-AECF-B3C979B88BEB},1", - 1 - ], - [ - "{EED86E95-3017-46A7-B26B-991C815839B7},1", - 1 - ], - [ - "{0E8EA7AB-946D-461C-B571-96CCDC183FDC},1", - 1 - ], - [ - "{BE25CAF8-690F-4947-8683-3A37A7D52CCA},1", - 1 - ], - [ - "{F61E497B-25BB-426E-BC73-320A7B6D2E9E},1", - 1 - ], - [ - "{E53F33D2-F3FC-42C9-8DC8-B47261D1BDED},1", - 1 - ], - [ - "{7FDAAAE9-CD33-42AA-A8AA-F87CE3BC8CD6},1", - 1 - ], - [ - "{F0E8692A-3CBB-47A6-81D6-7B6E2A125A7F},1", - 1 - ], - [ - "{71B566DF-DBD8-43B2-AD96-265FDB789E07},1", - 1 - ], - [ - "{9C56CBC3-690B-4900-8A07-A43600F7477B},1", - 1 - ], - [ - "{914C89B2-A95E-4992-8D2B-B533C7326D57},1", - 1 - ], - [ - "{2CA7400B-F732-4FAF-811B-AAFA91C480DF},1", - 1 - ], - [ - "{73479EE6-9FC0-4474-A702-E22C734FC42B},1", - 1 - ], - [ - "{B6C1B618-B721-49CD-B224-45DDFF38C8FC},1", - 1 - ], - [ - "{CED8C7D5-5AC4-4553-B9F7-A02A1F599692},1", - 1 - ], - [ - "{D260D973-E2FB-4654-89A2-13BAFC23AEDE},1", - 1 - ], - [ - "{EC0D40A0-9E0D-4262-9B4D-D075704938C9},1", - 1 - ], - [ - "{8E47F53D-F24F-4B3B-942F-390A8F0F31E7},1", - 1 - ], - [ - "{1FBF8DA5-01E9-4248-BBB9-90B5C4ADFA58},1", - 1 - ], - [ - "{A3909E43-E7FE-40C8-9222-0B60EA8CE89B},1", - 1 - ], - [ - "{925E4C70-2C3F-480D-BB44-D3BF4A0FB985},1", - 1 - ], - [ - "{1792331E-BA2E-4B60-B150-6AAF41BC488D},1", - 1 - ], - [ - "{39716E7C-28A0-4770-BBD2-BB4018DBE93F},1", - 1 - ], - [ - "{D30FD954-4DA9-4B85-8950-12B85AFA12CB},1", - 1 - ], - [ - "{0F4D72D3-20B0-4884-BF56-08BA4DBFB6FF},1", - 1 - ], - [ - "{574D9093-179F-46A3-B3F9-F7EB4345FADA},1", - 1 - ], - [ - "{12C643DD-9593-4641-B945-124257947ADD},1", - 1 - ], - [ - "{C4850841-2A3C-4402-BF11-7499914F9024},1", - 1 - ], - [ - "{37EF05A5-C2D9-44A2-84C0-BCA93ACB9048},1", - 1 - ], - [ - "{27C692F0-F79D-4390-AB44-CB8B10E2B49E},1", - 1 - ], - [ - "{B1F28022-58CF-49CF-BC6F-D77A1A034AAC},1", - 1 - ], - [ - "{858FEBAE-05A2-4B49-92D2-96C28376330D},1", - 1 - ], - [ - "{806A80BF-45E8-4188-B782-66A0DAA26E5A},1", - 1 - ], - [ - "{940E7901-6EF0-43ED-BD42-E0C7658185B1},1", - 1 - ], - [ - "{D106259D-D139-4DAB-87BE-50AC5E5BEF80},1", - 1 - ], - [ - "{A8883FF6-F53C-46B7-912C-779F9300FA77},1", - 1 - ] - ] - } - }, - "space": "{31C1BA26-B092-43F4-B346-A5147633ACB5},1" - }, - { - "id": 2, - "operation": { - "Insert": { - "author": "Author", - "created": 1473408656, - "guid": [ - 229, - 132, - 181, - 220, - 244, - 135, - 183, - 77, - 159, - 236, - 219, - 238, - 255, - 87, - 152, - 224 - ], - "parent": "{A3909E43-E7FE-40C8-9222-0B60EA8CE89B},12", - "placement": { - "Outline": { - "x": 36.0, - "y": 36.0 - } - }, - "text": "Actor 6 🦀 é" - } - }, - "space": "{A3909E43-E7FE-40C8-9222-0B60EA8CE89B},1" - } - ], - [ - { - "id": 1, - "operation": { - "Pages": { - "edits": [ - { - "guid": [ - 72, - 57, - 163, - 131, - 240, - 229, + 246, + 64, + 171, + 74, + 60, + 18, 85, - 76, + 228, + 190, + 225 + ], + "level": 1, + "position": { + "Before": "{87AC0239-51A5-47C6-BAF4-926CCF56385C},1" + }, + "space": "{C50BF7FC-F848-4B91-B8C8-743D0AA5F195},1" + }, + { + "guid": [ + 154, + 175, + 180, + 52, + 102, + 86, + 241, + 66, + 129, + 168, + 227, + 222, + 69, + 213, + 66, + 187 + ], + "level": 2, + "position": "Keep", + "space": "{FD8D07D0-C447-4516-A7DB-F8522B77D4A7},1" + } + ], + "observed": [ + [ + "{869D5929-6E5E-4EDB-9639-4C56977DD447},1", + 1 + ], + [ + "{B0B53F94-0105-4C59-B65B-9473F49BFF41},1", + 1 + ], + [ + "{0E98EE82-B78F-4872-8BD9-5D9B23A817C5},1", + 1 + ], + [ + "{C837A033-F055-4455-B45F-17D82016921C},1", + 1 + ], + [ + "{89D86121-BF5C-418B-BB92-CBFFA8EF545F},1", + 1 + ], + [ + "{57E835EA-2799-4118-B55C-7BB1E51C6941},1", + 1 + ], + [ + "{F7EECCCF-B6B4-44F2-A543-36837EC18B8A},1", + 1 + ], + [ + "{361A0F09-EA63-4F2D-9620-C061D4E4707E},1", + 1 + ], + [ + "{EB3940F1-F255-42BE-8C31-DD09E86DBAAF},1", + 1 + ], + [ + "{C2870D07-8ADC-44BB-9F12-15D6C3708689},1", + 1 + ], + [ + "{1E0C6331-32C9-4EF9-8087-150A8669FA91},1", + 1 + ], + [ + "{ED9769DD-99D6-4BE2-B980-580DA9C4DFCE},1", + 1 + ], + [ + "{17C30054-7129-4A10-9D00-4D5545E4F4BA},1", + 1 + ], + [ + "{4C5FBA5B-E348-4750-ACE4-E9694D527BFF},1", + 1 + ], + [ + "{BD0EF658-4D0F-42A7-B546-B4F4A77D246B},1", + 1 + ], + [ + "{6FEA70FA-1451-4A27-8A8E-C4CC3B713CF6},1", + 1 + ], + [ + "{68A1E0E1-7A39-4AB6-AD71-4D8A18878D79},1", + 1 + ], + [ + "{7E9041BD-301B-4B5B-9456-1C92050E4914},1", + 1 + ], + [ + "{EFA77BAE-8A98-4176-B536-B615D1D2ED2B},1", + 1 + ], + [ + "{87AC0239-51A5-47C6-BAF4-926CCF56385C},1", + 1 + ], + [ + "{C50BF7FC-F848-4B91-B8C8-743D0AA5F195},1", + 1 + ], + [ + "{FD8D07D0-C447-4516-A7DB-F8522B77D4A7},1", + 1 + ], + [ + "{D2E1FE57-F45D-49C3-B388-95222ACA3886},1", + 1 + ], + [ + "{7F6702B3-C977-436F-82AF-403E2BE950E7},1", + 1 + ], + [ + "{688C4EA1-80F5-4D85-B9BB-F8633FF3C0CA},1", + 1 + ], + [ + "{754FA957-C432-4502-A5CF-EE44449462C0},1", + 1 + ], + [ + "{D2197C55-D962-4DF0-8B14-26F88C06D6FA},1", + 1 + ], + [ + "{87B83BA8-A906-4F71-A6CA-3E8133A75D34},1", + 1 + ], + [ + "{F2D6AEBB-98EA-4F10-991F-5243E74AF450},1", + 1 + ], + [ + "{406687D7-F9E9-491B-85DA-166DE6CD5A60},1", + 1 + ], + [ + "{1F73BF36-9FC2-495D-844D-B370D5C47DE7},1", + 1 + ], + [ + "{E9BD343F-4A66-4DE2-81F9-3789CCA22818},1", + 1 + ], + [ + "{189EA744-BE13-467A-95BA-2667A134C0B0},1", + 1 + ], + [ + "{017F5881-F818-4C7C-B9F9-6BCB4085F1D0},1", + 1 + ], + [ + "{CD0D17F4-25D8-4076-9AF7-47D9CDEFCF0A},1", + 1 + ], + [ + "{CCBB5969-BCE8-498B-BE1A-98FD3A44DB1A},1", + 1 + ], + [ + "{2B736B19-2D9C-4E76-A732-478D533D717A},1", + 1 + ] + ] + } + }, + "space": "{90FCDB0C-36AE-422F-B4FE-67676826FE36},1" + }, + { + "id": 2, + "operation": { + "Page": { + "after": { + "created": 134335976560000000, + "definitions": { + "{C50BF7FC-F848-4B91-B8C8-743D0AA5F195},18": { + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": "Calibri", + "font_size": 17.0, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": null, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + }, + "kind": { + "name": "PageTitle", + "type": "Style" + } + } + }, + "margin_origin": [ + 0.0, + 0.0 + ], + "objects": [ + { + "Outline": { + "id": "{69602664-892F-4537-9BFE-860DAD71A595},0", + "indents": [], + "layout": { + "max_height": null, + "max_width": null, + "reserved_width": null, + "width_set_by_user": null, + "x": 36.0, + "y": 36.0 + }, + "min_width": null, + "paragraphs": [ + { + "collapsed": false, + "content": { + "Text": { + "date_field": null, + "id": "{C533D56B-11C4-4867-B1E2-3E7520E7939A},0", + "tags": [], + "text": { + "spans": [ + { + "end": 16, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": "Calibri", + "font_size": 11.0, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": 1033, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + } + } + ], + "text": "Actor 6 🦀 é" + } + } + }, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": null, + "font_size": null, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": null, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + }, + "id": "{FB8451BB-46B9-44F1-972F-A543F55F06B5},0", + "level": 1, + "lists": [], + "parent": null, + "style": null, + "tags": [] + } + ], + "title": false, + "unsupported": [] + } + }, + { + "Title": { + "date": null, + "id": "{C50BF7FC-F848-4B91-B8C8-743D0AA5F195},13", + "layout": { + "max_height": null, + "max_width": null, + "reserved_width": null, + "width_set_by_user": null, + "x": 0.0, + "y": 0.0 + }, + "outlines": [ + { + "id": "{C50BF7FC-F848-4B91-B8C8-743D0AA5F195},14", + "indents": [], + "layout": { + "max_height": null, + "max_width": null, + "reserved_width": null, + "width_set_by_user": null, + "x": null, + "y": null + }, + "min_width": null, + "paragraphs": [ + { + "collapsed": false, + "content": { + "Text": { + "date_field": null, + "id": "{C50BF7FC-F848-4B91-B8C8-743D0AA5F195},16", + "tags": [], + "text": { + "spans": [ + { + "end": 10, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": "Calibri", + "font_size": 17.0, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": 1033, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + } + } + ], + "text": "Same title" + } + } + }, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": null, + "font_size": null, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": null, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + }, + "id": "{C50BF7FC-F848-4B91-B8C8-743D0AA5F195},15", + "level": 1, + "lists": [], + "parent": null, + "style": "{C50BF7FC-F848-4B91-B8C8-743D0AA5F195},18", + "tags": [] + } + ], + "title": false, + "unsupported": [] + } + ] + } + } + ], + "title": "Same title" + }, + "author": "Author", + "before": { + "created": 134335976560000000, + "definitions": { + "{C50BF7FC-F848-4B91-B8C8-743D0AA5F195},18": { + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": "Calibri", + "font_size": 17.0, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": null, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + }, + "kind": { + "name": "PageTitle", + "type": "Style" + } + } + }, + "margin_origin": [ + 0.0, + 0.0 + ], + "objects": [ + { + "Title": { + "date": null, + "id": "{C50BF7FC-F848-4B91-B8C8-743D0AA5F195},13", + "layout": { + "max_height": null, + "max_width": null, + "reserved_width": null, + "width_set_by_user": null, + "x": 0.0, + "y": 0.0 + }, + "outlines": [ + { + "id": "{C50BF7FC-F848-4B91-B8C8-743D0AA5F195},14", + "indents": [], + "layout": { + "max_height": null, + "max_width": null, + "reserved_width": null, + "width_set_by_user": null, + "x": null, + "y": null + }, + "min_width": null, + "paragraphs": [ + { + "collapsed": false, + "content": { + "Text": { + "date_field": null, + "id": "{C50BF7FC-F848-4B91-B8C8-743D0AA5F195},16", + "tags": [], + "text": { + "spans": [ + { + "end": 10, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": "Calibri", + "font_size": 17.0, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": 1033, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + } + } + ], + "text": "Same title" + } + } + }, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": null, + "font_size": null, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": null, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + }, + "id": "{C50BF7FC-F848-4B91-B8C8-743D0AA5F195},15", + "level": 1, + "lists": [], + "parent": null, + "style": "{C50BF7FC-F848-4B91-B8C8-743D0AA5F195},18", + "tags": [] + } + ], + "title": false, + "unsupported": [] + } + ] + } + } + ], + "title": "Same title" + } + } + }, + "space": "{C50BF7FC-F848-4B91-B8C8-743D0AA5F195},1" + } + ], + [ + { + "id": 1, + "operation": { + "Pages": { + "edits": [ + { + "guid": [ + 133, + 13, + 22, + 96, + 19, + 247, + 50, + 69, + 147, + 11, 146, - 253, - 111, - 184, - 27, + 207, + 6, + 153, + 24, + 94 + ], + "level": 1, + "position": { + "Before": "{D2E1FE57-F45D-49C3-B388-95222ACA3886},1" + }, + "space": "{7F6702B3-C977-436F-82AF-403E2BE950E7},1" + }, + { + "guid": [ 159, + 110, + 141, + 39, + 253, + 156, + 37, 64, - 117 + 172, + 95, + 144, + 82, + 194, + 61, + 40, + 198 + ], + "level": 2, + "position": "Keep", + "space": "{688C4EA1-80F5-4D85-B9BB-F8633FF3C0CA},1" + } + ], + "observed": [ + [ + "{869D5929-6E5E-4EDB-9639-4C56977DD447},1", + 1 + ], + [ + "{B0B53F94-0105-4C59-B65B-9473F49BFF41},1", + 1 + ], + [ + "{0E98EE82-B78F-4872-8BD9-5D9B23A817C5},1", + 1 + ], + [ + "{C837A033-F055-4455-B45F-17D82016921C},1", + 1 + ], + [ + "{89D86121-BF5C-418B-BB92-CBFFA8EF545F},1", + 1 + ], + [ + "{57E835EA-2799-4118-B55C-7BB1E51C6941},1", + 1 + ], + [ + "{F7EECCCF-B6B4-44F2-A543-36837EC18B8A},1", + 1 + ], + [ + "{361A0F09-EA63-4F2D-9620-C061D4E4707E},1", + 1 + ], + [ + "{EB3940F1-F255-42BE-8C31-DD09E86DBAAF},1", + 1 + ], + [ + "{C2870D07-8ADC-44BB-9F12-15D6C3708689},1", + 1 + ], + [ + "{1E0C6331-32C9-4EF9-8087-150A8669FA91},1", + 1 + ], + [ + "{ED9769DD-99D6-4BE2-B980-580DA9C4DFCE},1", + 1 + ], + [ + "{17C30054-7129-4A10-9D00-4D5545E4F4BA},1", + 1 + ], + [ + "{4C5FBA5B-E348-4750-ACE4-E9694D527BFF},1", + 1 + ], + [ + "{BD0EF658-4D0F-42A7-B546-B4F4A77D246B},1", + 1 + ], + [ + "{6FEA70FA-1451-4A27-8A8E-C4CC3B713CF6},1", + 1 + ], + [ + "{68A1E0E1-7A39-4AB6-AD71-4D8A18878D79},1", + 1 + ], + [ + "{7E9041BD-301B-4B5B-9456-1C92050E4914},1", + 1 + ], + [ + "{EFA77BAE-8A98-4176-B536-B615D1D2ED2B},1", + 1 + ], + [ + "{87AC0239-51A5-47C6-BAF4-926CCF56385C},1", + 1 + ], + [ + "{C50BF7FC-F848-4B91-B8C8-743D0AA5F195},1", + 1 + ], + [ + "{FD8D07D0-C447-4516-A7DB-F8522B77D4A7},1", + 1 + ], + [ + "{D2E1FE57-F45D-49C3-B388-95222ACA3886},1", + 1 + ], + [ + "{7F6702B3-C977-436F-82AF-403E2BE950E7},1", + 1 + ], + [ + "{688C4EA1-80F5-4D85-B9BB-F8633FF3C0CA},1", + 1 + ], + [ + "{754FA957-C432-4502-A5CF-EE44449462C0},1", + 1 + ], + [ + "{D2197C55-D962-4DF0-8B14-26F88C06D6FA},1", + 1 + ], + [ + "{87B83BA8-A906-4F71-A6CA-3E8133A75D34},1", + 1 + ], + [ + "{F2D6AEBB-98EA-4F10-991F-5243E74AF450},1", + 1 + ], + [ + "{406687D7-F9E9-491B-85DA-166DE6CD5A60},1", + 1 + ], + [ + "{1F73BF36-9FC2-495D-844D-B370D5C47DE7},1", + 1 + ], + [ + "{E9BD343F-4A66-4DE2-81F9-3789CCA22818},1", + 1 + ], + [ + "{189EA744-BE13-467A-95BA-2667A134C0B0},1", + 1 + ], + [ + "{017F5881-F818-4C7C-B9F9-6BCB4085F1D0},1", + 1 + ], + [ + "{CD0D17F4-25D8-4076-9AF7-47D9CDEFCF0A},1", + 1 + ], + [ + "{CCBB5969-BCE8-498B-BE1A-98FD3A44DB1A},1", + 1 + ], + [ + "{2B736B19-2D9C-4E76-A732-478D533D717A},1", + 1 + ] + ] + } + }, + "space": "{90FCDB0C-36AE-422F-B4FE-67676826FE36},1" + }, + { + "id": 2, + "operation": { + "Page": { + "after": { + "created": 134335976560000000, + "definitions": { + "{7F6702B3-C977-436F-82AF-403E2BE950E7},18": { + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": "Calibri", + "font_size": 17.0, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": null, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + }, + "kind": { + "name": "PageTitle", + "type": "Style" + } + } + }, + "margin_origin": [ + 0.0, + 0.0 + ], + "objects": [ + { + "Outline": { + "id": "{F5ABCB2B-29D3-411E-A836-02A85749FF09},0", + "indents": [], + "layout": { + "max_height": null, + "max_width": null, + "reserved_width": null, + "width_set_by_user": null, + "x": 36.0, + "y": 36.0 + }, + "min_width": null, + "paragraphs": [ + { + "collapsed": false, + "content": { + "Text": { + "date_field": null, + "id": "{3500B3EC-E613-4C17-8520-F7B22DB266FD},0", + "tags": [], + "text": { + "spans": [ + { + "end": 16, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": "Calibri", + "font_size": 11.0, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": 1033, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + } + } + ], + "text": "Actor 7 🦀 é" + } + } + }, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": null, + "font_size": null, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": null, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + }, + "id": "{DFF3BBDE-C14D-4D31-8E0D-CBCED9BB1195},0", + "level": 1, + "lists": [], + "parent": null, + "style": null, + "tags": [] + } + ], + "title": false, + "unsupported": [] + } + }, + { + "Title": { + "date": null, + "id": "{7F6702B3-C977-436F-82AF-403E2BE950E7},13", + "layout": { + "max_height": null, + "max_width": null, + "reserved_width": null, + "width_set_by_user": null, + "x": 0.0, + "y": 0.0 + }, + "outlines": [ + { + "id": "{7F6702B3-C977-436F-82AF-403E2BE950E7},14", + "indents": [], + "layout": { + "max_height": null, + "max_width": null, + "reserved_width": null, + "width_set_by_user": null, + "x": null, + "y": null + }, + "min_width": null, + "paragraphs": [ + { + "collapsed": false, + "content": { + "Text": { + "date_field": null, + "id": "{7F6702B3-C977-436F-82AF-403E2BE950E7},16", + "tags": [], + "text": { + "spans": [ + { + "end": 10, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": "Calibri", + "font_size": 17.0, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": 1033, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + } + } + ], + "text": "Same title" + } + } + }, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": null, + "font_size": null, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": null, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + }, + "id": "{7F6702B3-C977-436F-82AF-403E2BE950E7},15", + "level": 1, + "lists": [], + "parent": null, + "style": "{7F6702B3-C977-436F-82AF-403E2BE950E7},18", + "tags": [] + } + ], + "title": false, + "unsupported": [] + } + ] + } + } + ], + "title": "Same title" + }, + "author": "Author", + "before": { + "created": 134335976560000000, + "definitions": { + "{7F6702B3-C977-436F-82AF-403E2BE950E7},18": { + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": "Calibri", + "font_size": 17.0, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": null, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + }, + "kind": { + "name": "PageTitle", + "type": "Style" + } + } + }, + "margin_origin": [ + 0.0, + 0.0 + ], + "objects": [ + { + "Title": { + "date": null, + "id": "{7F6702B3-C977-436F-82AF-403E2BE950E7},13", + "layout": { + "max_height": null, + "max_width": null, + "reserved_width": null, + "width_set_by_user": null, + "x": 0.0, + "y": 0.0 + }, + "outlines": [ + { + "id": "{7F6702B3-C977-436F-82AF-403E2BE950E7},14", + "indents": [], + "layout": { + "max_height": null, + "max_width": null, + "reserved_width": null, + "width_set_by_user": null, + "x": null, + "y": null + }, + "min_width": null, + "paragraphs": [ + { + "collapsed": false, + "content": { + "Text": { + "date_field": null, + "id": "{7F6702B3-C977-436F-82AF-403E2BE950E7},16", + "tags": [], + "text": { + "spans": [ + { + "end": 10, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": "Calibri", + "font_size": 17.0, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": 1033, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + } + } + ], + "text": "Same title" + } + } + }, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": null, + "font_size": null, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": null, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + }, + "id": "{7F6702B3-C977-436F-82AF-403E2BE950E7},15", + "level": 1, + "lists": [], + "parent": null, + "style": "{7F6702B3-C977-436F-82AF-403E2BE950E7},18", + "tags": [] + } + ], + "title": false, + "unsupported": [] + } + ] + } + } + ], + "title": "Same title" + } + } + }, + "space": "{7F6702B3-C977-436F-82AF-403E2BE950E7},1" + } + ], + [ + { + "id": 1, + "operation": { + "Pages": { + "edits": [ + { + "guid": [ + 60, + 96, + 70, + 223, + 197, + 137, + 63, + 78, + 170, + 199, + 81, + 158, + 99, + 18, + 163, + 133 ], "level": 1, "position": { - "Before": "{1792331E-BA2E-4B60-B150-6AAF41BC488D},1" + "Before": "{754FA957-C432-4502-A5CF-EE44449462C0},1" }, - "space": "{39716E7C-28A0-4770-BBD2-BB4018DBE93F},1" + "space": "{D2197C55-D962-4DF0-8B14-26F88C06D6FA},1" }, { "guid": [ - 22, - 244, - 53, - 252, + 218, + 181, 208, - 13, - 123, + 213, + 72, + 152, + 253, + 76, + 176, + 213, + 138, + 85, + 141, + 127, + 170, + 160 + ], + "level": 2, + "position": "Keep", + "space": "{87B83BA8-A906-4F71-A6CA-3E8133A75D34},1" + } + ], + "observed": [ + [ + "{869D5929-6E5E-4EDB-9639-4C56977DD447},1", + 1 + ], + [ + "{B0B53F94-0105-4C59-B65B-9473F49BFF41},1", + 1 + ], + [ + "{0E98EE82-B78F-4872-8BD9-5D9B23A817C5},1", + 1 + ], + [ + "{C837A033-F055-4455-B45F-17D82016921C},1", + 1 + ], + [ + "{89D86121-BF5C-418B-BB92-CBFFA8EF545F},1", + 1 + ], + [ + "{57E835EA-2799-4118-B55C-7BB1E51C6941},1", + 1 + ], + [ + "{F7EECCCF-B6B4-44F2-A543-36837EC18B8A},1", + 1 + ], + [ + "{361A0F09-EA63-4F2D-9620-C061D4E4707E},1", + 1 + ], + [ + "{EB3940F1-F255-42BE-8C31-DD09E86DBAAF},1", + 1 + ], + [ + "{C2870D07-8ADC-44BB-9F12-15D6C3708689},1", + 1 + ], + [ + "{1E0C6331-32C9-4EF9-8087-150A8669FA91},1", + 1 + ], + [ + "{ED9769DD-99D6-4BE2-B980-580DA9C4DFCE},1", + 1 + ], + [ + "{17C30054-7129-4A10-9D00-4D5545E4F4BA},1", + 1 + ], + [ + "{4C5FBA5B-E348-4750-ACE4-E9694D527BFF},1", + 1 + ], + [ + "{BD0EF658-4D0F-42A7-B546-B4F4A77D246B},1", + 1 + ], + [ + "{6FEA70FA-1451-4A27-8A8E-C4CC3B713CF6},1", + 1 + ], + [ + "{68A1E0E1-7A39-4AB6-AD71-4D8A18878D79},1", + 1 + ], + [ + "{7E9041BD-301B-4B5B-9456-1C92050E4914},1", + 1 + ], + [ + "{EFA77BAE-8A98-4176-B536-B615D1D2ED2B},1", + 1 + ], + [ + "{87AC0239-51A5-47C6-BAF4-926CCF56385C},1", + 1 + ], + [ + "{C50BF7FC-F848-4B91-B8C8-743D0AA5F195},1", + 1 + ], + [ + "{FD8D07D0-C447-4516-A7DB-F8522B77D4A7},1", + 1 + ], + [ + "{D2E1FE57-F45D-49C3-B388-95222ACA3886},1", + 1 + ], + [ + "{7F6702B3-C977-436F-82AF-403E2BE950E7},1", + 1 + ], + [ + "{688C4EA1-80F5-4D85-B9BB-F8633FF3C0CA},1", + 1 + ], + [ + "{754FA957-C432-4502-A5CF-EE44449462C0},1", + 1 + ], + [ + "{D2197C55-D962-4DF0-8B14-26F88C06D6FA},1", + 1 + ], + [ + "{87B83BA8-A906-4F71-A6CA-3E8133A75D34},1", + 1 + ], + [ + "{F2D6AEBB-98EA-4F10-991F-5243E74AF450},1", + 1 + ], + [ + "{406687D7-F9E9-491B-85DA-166DE6CD5A60},1", + 1 + ], + [ + "{1F73BF36-9FC2-495D-844D-B370D5C47DE7},1", + 1 + ], + [ + "{E9BD343F-4A66-4DE2-81F9-3789CCA22818},1", + 1 + ], + [ + "{189EA744-BE13-467A-95BA-2667A134C0B0},1", + 1 + ], + [ + "{017F5881-F818-4C7C-B9F9-6BCB4085F1D0},1", + 1 + ], + [ + "{CD0D17F4-25D8-4076-9AF7-47D9CDEFCF0A},1", + 1 + ], + [ + "{CCBB5969-BCE8-498B-BE1A-98FD3A44DB1A},1", + 1 + ], + [ + "{2B736B19-2D9C-4E76-A732-478D533D717A},1", + 1 + ] + ] + } + }, + "space": "{90FCDB0C-36AE-422F-B4FE-67676826FE36},1" + }, + { + "id": 2, + "operation": { + "Page": { + "after": { + "created": 134335976560000000, + "definitions": { + "{D2197C55-D962-4DF0-8B14-26F88C06D6FA},18": { + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": "Calibri", + "font_size": 17.0, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": null, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + }, + "kind": { + "name": "PageTitle", + "type": "Style" + } + } + }, + "margin_origin": [ + 0.0, + 0.0 + ], + "objects": [ + { + "Outline": { + "id": "{5A041F4B-D387-4A35-8723-9F16A833AC7E},0", + "indents": [], + "layout": { + "max_height": null, + "max_width": null, + "reserved_width": null, + "width_set_by_user": null, + "x": 36.0, + "y": 36.0 + }, + "min_width": null, + "paragraphs": [ + { + "collapsed": false, + "content": { + "Text": { + "date_field": null, + "id": "{8A12422A-9108-4831-9889-D95B1B47F85A},0", + "tags": [], + "text": { + "spans": [ + { + "end": 16, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": "Calibri", + "font_size": 11.0, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": 1033, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + } + } + ], + "text": "Actor 8 🦀 é" + } + } + }, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": null, + "font_size": null, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": null, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + }, + "id": "{8906C7DF-89B1-40E4-9D47-6C794C39F974},0", + "level": 1, + "lists": [], + "parent": null, + "style": null, + "tags": [] + } + ], + "title": false, + "unsupported": [] + } + }, + { + "Title": { + "date": null, + "id": "{D2197C55-D962-4DF0-8B14-26F88C06D6FA},13", + "layout": { + "max_height": null, + "max_width": null, + "reserved_width": null, + "width_set_by_user": null, + "x": 0.0, + "y": 0.0 + }, + "outlines": [ + { + "id": "{D2197C55-D962-4DF0-8B14-26F88C06D6FA},14", + "indents": [], + "layout": { + "max_height": null, + "max_width": null, + "reserved_width": null, + "width_set_by_user": null, + "x": null, + "y": null + }, + "min_width": null, + "paragraphs": [ + { + "collapsed": false, + "content": { + "Text": { + "date_field": null, + "id": "{D2197C55-D962-4DF0-8B14-26F88C06D6FA},16", + "tags": [], + "text": { + "spans": [ + { + "end": 10, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": "Calibri", + "font_size": 17.0, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": 1033, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + } + } + ], + "text": "Same title" + } + } + }, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": null, + "font_size": null, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": null, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + }, + "id": "{D2197C55-D962-4DF0-8B14-26F88C06D6FA},15", + "level": 1, + "lists": [], + "parent": null, + "style": "{D2197C55-D962-4DF0-8B14-26F88C06D6FA},18", + "tags": [] + } + ], + "title": false, + "unsupported": [] + } + ] + } + } + ], + "title": "Same title" + }, + "author": "Author", + "before": { + "created": 134335976560000000, + "definitions": { + "{D2197C55-D962-4DF0-8B14-26F88C06D6FA},18": { + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": "Calibri", + "font_size": 17.0, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": null, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + }, + "kind": { + "name": "PageTitle", + "type": "Style" + } + } + }, + "margin_origin": [ + 0.0, + 0.0 + ], + "objects": [ + { + "Title": { + "date": null, + "id": "{D2197C55-D962-4DF0-8B14-26F88C06D6FA},13", + "layout": { + "max_height": null, + "max_width": null, + "reserved_width": null, + "width_set_by_user": null, + "x": 0.0, + "y": 0.0 + }, + "outlines": [ + { + "id": "{D2197C55-D962-4DF0-8B14-26F88C06D6FA},14", + "indents": [], + "layout": { + "max_height": null, + "max_width": null, + "reserved_width": null, + "width_set_by_user": null, + "x": null, + "y": null + }, + "min_width": null, + "paragraphs": [ + { + "collapsed": false, + "content": { + "Text": { + "date_field": null, + "id": "{D2197C55-D962-4DF0-8B14-26F88C06D6FA},16", + "tags": [], + "text": { + "spans": [ + { + "end": 10, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": "Calibri", + "font_size": 17.0, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": 1033, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + } + } + ], + "text": "Same title" + } + } + }, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": null, + "font_size": null, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": null, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + }, + "id": "{D2197C55-D962-4DF0-8B14-26F88C06D6FA},15", + "level": 1, + "lists": [], + "parent": null, + "style": "{D2197C55-D962-4DF0-8B14-26F88C06D6FA},18", + "tags": [] + } + ], + "title": false, + "unsupported": [] + } + ] + } + } + ], + "title": "Same title" + } + } + }, + "space": "{D2197C55-D962-4DF0-8B14-26F88C06D6FA},1" + } + ], + [ + { + "id": 1, + "operation": { + "Pages": { + "edits": [ + { + "guid": [ + 99, + 82, + 79, 67, 136, - 101, - 93, - 39, + 178, 110, - 39, - 190, - 158 - ], - "level": 2, - "position": "Keep", - "space": "{D30FD954-4DA9-4B85-8950-12B85AFA12CB},1" - } - ], - "observed": [ - [ - "{90D67E9A-BEC2-43C9-973C-1B927FE5FCD4},1", - 1 - ], - [ - "{7D896A2D-61C9-42B2-AECF-B3C979B88BEB},1", - 1 - ], - [ - "{EED86E95-3017-46A7-B26B-991C815839B7},1", - 1 - ], - [ - "{0E8EA7AB-946D-461C-B571-96CCDC183FDC},1", - 1 - ], - [ - "{BE25CAF8-690F-4947-8683-3A37A7D52CCA},1", - 1 - ], - [ - "{F61E497B-25BB-426E-BC73-320A7B6D2E9E},1", - 1 - ], - [ - "{E53F33D2-F3FC-42C9-8DC8-B47261D1BDED},1", - 1 - ], - [ - "{7FDAAAE9-CD33-42AA-A8AA-F87CE3BC8CD6},1", - 1 - ], - [ - "{F0E8692A-3CBB-47A6-81D6-7B6E2A125A7F},1", - 1 - ], - [ - "{71B566DF-DBD8-43B2-AD96-265FDB789E07},1", - 1 - ], - [ - "{9C56CBC3-690B-4900-8A07-A43600F7477B},1", - 1 - ], - [ - "{914C89B2-A95E-4992-8D2B-B533C7326D57},1", - 1 - ], - [ - "{2CA7400B-F732-4FAF-811B-AAFA91C480DF},1", - 1 - ], - [ - "{73479EE6-9FC0-4474-A702-E22C734FC42B},1", - 1 - ], - [ - "{B6C1B618-B721-49CD-B224-45DDFF38C8FC},1", - 1 - ], - [ - "{CED8C7D5-5AC4-4553-B9F7-A02A1F599692},1", - 1 - ], - [ - "{D260D973-E2FB-4654-89A2-13BAFC23AEDE},1", - 1 - ], - [ - "{EC0D40A0-9E0D-4262-9B4D-D075704938C9},1", - 1 - ], - [ - "{8E47F53D-F24F-4B3B-942F-390A8F0F31E7},1", - 1 - ], - [ - "{1FBF8DA5-01E9-4248-BBB9-90B5C4ADFA58},1", - 1 - ], - [ - "{A3909E43-E7FE-40C8-9222-0B60EA8CE89B},1", - 1 - ], - [ - "{925E4C70-2C3F-480D-BB44-D3BF4A0FB985},1", - 1 - ], - [ - "{1792331E-BA2E-4B60-B150-6AAF41BC488D},1", - 1 - ], - [ - "{39716E7C-28A0-4770-BBD2-BB4018DBE93F},1", - 1 - ], - [ - "{D30FD954-4DA9-4B85-8950-12B85AFA12CB},1", - 1 - ], - [ - "{0F4D72D3-20B0-4884-BF56-08BA4DBFB6FF},1", - 1 - ], - [ - "{574D9093-179F-46A3-B3F9-F7EB4345FADA},1", - 1 - ], - [ - "{12C643DD-9593-4641-B945-124257947ADD},1", - 1 - ], - [ - "{C4850841-2A3C-4402-BF11-7499914F9024},1", - 1 - ], - [ - "{37EF05A5-C2D9-44A2-84C0-BCA93ACB9048},1", - 1 - ], - [ - "{27C692F0-F79D-4390-AB44-CB8B10E2B49E},1", - 1 - ], - [ - "{B1F28022-58CF-49CF-BC6F-D77A1A034AAC},1", - 1 - ], - [ - "{858FEBAE-05A2-4B49-92D2-96C28376330D},1", - 1 - ], - [ - "{806A80BF-45E8-4188-B782-66A0DAA26E5A},1", - 1 - ], - [ - "{940E7901-6EF0-43ED-BD42-E0C7658185B1},1", - 1 - ], - [ - "{D106259D-D139-4DAB-87BE-50AC5E5BEF80},1", - 1 - ], - [ - "{A8883FF6-F53C-46B7-912C-779F9300FA77},1", - 1 - ] - ] - } - }, - "space": "{31C1BA26-B092-43F4-B346-A5147633ACB5},1" - }, - { - "id": 2, - "operation": { - "Insert": { - "author": "Author", - "created": 1473408656, - "guid": [ - 6, - 12, - 136, - 31, - 34, - 131, - 43, - 75, - 140, - 243, - 250, - 229, - 197, - 110, - 135, - 127 - ], - "parent": "{39716E7C-28A0-4770-BBD2-BB4018DBE93F},12", - "placement": { - "Outline": { - "x": 36.0, - "y": 36.0 - } - }, - "text": "Actor 7 🦀 é" - } - }, - "space": "{39716E7C-28A0-4770-BBD2-BB4018DBE93F},1" - } - ], - [ - { - "id": 1, - "operation": { - "Pages": { - "edits": [ - { - "guid": [ - 92, + 79, + 138, + 9, + 172, 171, - 163, - 41, - 66, + 67, + 243, + 71, + 142 + ], + "level": 1, + "position": { + "Before": "{F2D6AEBB-98EA-4F10-991F-5243E74AF450},1" + }, + "space": "{406687D7-F9E9-491B-85DA-166DE6CD5A60},1" + }, + { + "guid": [ + 198, + 58, + 35, + 75, + 157, + 18, + 195, + 77, + 154, 80, - 115, - 70, - 155, - 131, - 144, + 148, + 1, 210, - 175, - 109, - 142, - 183 - ], - "level": 1, - "position": { - "Before": "{0F4D72D3-20B0-4884-BF56-08BA4DBFB6FF},1" - }, - "space": "{574D9093-179F-46A3-B3F9-F7EB4345FADA},1" - }, - { - "guid": [ - 72, - 112, - 149, - 65, - 108, - 25, - 248, - 69, - 165, - 205, - 164, - 179, - 32, - 249, - 230, - 107 - ], - "level": 2, - "position": "Keep", - "space": "{12C643DD-9593-4641-B945-124257947ADD},1" - } - ], - "observed": [ - [ - "{90D67E9A-BEC2-43C9-973C-1B927FE5FCD4},1", - 1 - ], - [ - "{7D896A2D-61C9-42B2-AECF-B3C979B88BEB},1", - 1 - ], - [ - "{EED86E95-3017-46A7-B26B-991C815839B7},1", - 1 - ], - [ - "{0E8EA7AB-946D-461C-B571-96CCDC183FDC},1", - 1 - ], - [ - "{BE25CAF8-690F-4947-8683-3A37A7D52CCA},1", - 1 - ], - [ - "{F61E497B-25BB-426E-BC73-320A7B6D2E9E},1", - 1 - ], - [ - "{E53F33D2-F3FC-42C9-8DC8-B47261D1BDED},1", - 1 - ], - [ - "{7FDAAAE9-CD33-42AA-A8AA-F87CE3BC8CD6},1", - 1 - ], - [ - "{F0E8692A-3CBB-47A6-81D6-7B6E2A125A7F},1", - 1 - ], - [ - "{71B566DF-DBD8-43B2-AD96-265FDB789E07},1", - 1 - ], - [ - "{9C56CBC3-690B-4900-8A07-A43600F7477B},1", - 1 - ], - [ - "{914C89B2-A95E-4992-8D2B-B533C7326D57},1", - 1 - ], - [ - "{2CA7400B-F732-4FAF-811B-AAFA91C480DF},1", - 1 - ], - [ - "{73479EE6-9FC0-4474-A702-E22C734FC42B},1", - 1 - ], - [ - "{B6C1B618-B721-49CD-B224-45DDFF38C8FC},1", - 1 - ], - [ - "{CED8C7D5-5AC4-4553-B9F7-A02A1F599692},1", - 1 - ], - [ - "{D260D973-E2FB-4654-89A2-13BAFC23AEDE},1", - 1 - ], - [ - "{EC0D40A0-9E0D-4262-9B4D-D075704938C9},1", - 1 - ], - [ - "{8E47F53D-F24F-4B3B-942F-390A8F0F31E7},1", - 1 - ], - [ - "{1FBF8DA5-01E9-4248-BBB9-90B5C4ADFA58},1", - 1 - ], - [ - "{A3909E43-E7FE-40C8-9222-0B60EA8CE89B},1", - 1 - ], - [ - "{925E4C70-2C3F-480D-BB44-D3BF4A0FB985},1", - 1 - ], - [ - "{1792331E-BA2E-4B60-B150-6AAF41BC488D},1", - 1 - ], - [ - "{39716E7C-28A0-4770-BBD2-BB4018DBE93F},1", - 1 - ], - [ - "{D30FD954-4DA9-4B85-8950-12B85AFA12CB},1", - 1 - ], - [ - "{0F4D72D3-20B0-4884-BF56-08BA4DBFB6FF},1", - 1 - ], - [ - "{574D9093-179F-46A3-B3F9-F7EB4345FADA},1", - 1 - ], - [ - "{12C643DD-9593-4641-B945-124257947ADD},1", - 1 - ], - [ - "{C4850841-2A3C-4402-BF11-7499914F9024},1", - 1 - ], - [ - "{37EF05A5-C2D9-44A2-84C0-BCA93ACB9048},1", - 1 - ], - [ - "{27C692F0-F79D-4390-AB44-CB8B10E2B49E},1", - 1 - ], - [ - "{B1F28022-58CF-49CF-BC6F-D77A1A034AAC},1", - 1 - ], - [ - "{858FEBAE-05A2-4B49-92D2-96C28376330D},1", - 1 - ], - [ - "{806A80BF-45E8-4188-B782-66A0DAA26E5A},1", - 1 - ], - [ - "{940E7901-6EF0-43ED-BD42-E0C7658185B1},1", - 1 - ], - [ - "{D106259D-D139-4DAB-87BE-50AC5E5BEF80},1", - 1 - ], - [ - "{A8883FF6-F53C-46B7-912C-779F9300FA77},1", - 1 - ] - ] - } - }, - "space": "{31C1BA26-B092-43F4-B346-A5147633ACB5},1" - }, - { - "id": 2, - "operation": { - "Insert": { - "author": "Author", - "created": 1473408657, - "guid": [ - 32, - 217, - 98, - 198, - 139, - 74, - 200, - 79, - 184, - 88, - 19, - 17, - 198, - 122, - 217, - 139 - ], - "parent": "{574D9093-179F-46A3-B3F9-F7EB4345FADA},12", - "placement": { - "Outline": { - "x": 36.0, - "y": 36.0 - } - }, - "text": "Actor 8 🦀 é" - } - }, - "space": "{574D9093-179F-46A3-B3F9-F7EB4345FADA},1" - } - ], - [ - { - "id": 1, - "operation": { - "Pages": { - "edits": [ - { - "guid": [ - 87, - 93, - 187, - 190, 118, - 231, - 12, - 73, - 171, - 89, - 199, - 95, - 48, - 205, - 34, - 65 - ], - "level": 1, - "position": { - "Before": "{C4850841-2A3C-4402-BF11-7499914F9024},1" - }, - "space": "{37EF05A5-C2D9-44A2-84C0-BCA93ACB9048},1" - }, - { - "guid": [ - 231, - 156, - 210, - 109, - 117, - 247, - 23, - 73, - 150, - 139, - 247, - 223, - 39, - 173, - 106, - 66 + 195, + 115 ], "level": 2, "position": "Keep", - "space": "{27C692F0-F79D-4390-AB44-CB8B10E2B49E},1" + "space": "{1F73BF36-9FC2-495D-844D-B370D5C47DE7},1" } ], "observed": [ [ - "{90D67E9A-BEC2-43C9-973C-1B927FE5FCD4},1", + "{869D5929-6E5E-4EDB-9639-4C56977DD447},1", 1 ], [ - "{7D896A2D-61C9-42B2-AECF-B3C979B88BEB},1", + "{B0B53F94-0105-4C59-B65B-9473F49BFF41},1", 1 ], [ - "{EED86E95-3017-46A7-B26B-991C815839B7},1", + "{0E98EE82-B78F-4872-8BD9-5D9B23A817C5},1", 1 ], [ - "{0E8EA7AB-946D-461C-B571-96CCDC183FDC},1", + "{C837A033-F055-4455-B45F-17D82016921C},1", 1 ], [ - "{BE25CAF8-690F-4947-8683-3A37A7D52CCA},1", + "{89D86121-BF5C-418B-BB92-CBFFA8EF545F},1", 1 ], [ - "{F61E497B-25BB-426E-BC73-320A7B6D2E9E},1", + "{57E835EA-2799-4118-B55C-7BB1E51C6941},1", 1 ], [ - "{E53F33D2-F3FC-42C9-8DC8-B47261D1BDED},1", + "{F7EECCCF-B6B4-44F2-A543-36837EC18B8A},1", 1 ], [ - "{7FDAAAE9-CD33-42AA-A8AA-F87CE3BC8CD6},1", + "{361A0F09-EA63-4F2D-9620-C061D4E4707E},1", 1 ], [ - "{F0E8692A-3CBB-47A6-81D6-7B6E2A125A7F},1", + "{EB3940F1-F255-42BE-8C31-DD09E86DBAAF},1", 1 ], [ - "{71B566DF-DBD8-43B2-AD96-265FDB789E07},1", + "{C2870D07-8ADC-44BB-9F12-15D6C3708689},1", 1 ], [ - "{9C56CBC3-690B-4900-8A07-A43600F7477B},1", + "{1E0C6331-32C9-4EF9-8087-150A8669FA91},1", 1 ], [ - "{914C89B2-A95E-4992-8D2B-B533C7326D57},1", + "{ED9769DD-99D6-4BE2-B980-580DA9C4DFCE},1", 1 ], [ - "{2CA7400B-F732-4FAF-811B-AAFA91C480DF},1", + "{17C30054-7129-4A10-9D00-4D5545E4F4BA},1", 1 ], [ - "{73479EE6-9FC0-4474-A702-E22C734FC42B},1", + "{4C5FBA5B-E348-4750-ACE4-E9694D527BFF},1", 1 ], [ - "{B6C1B618-B721-49CD-B224-45DDFF38C8FC},1", + "{BD0EF658-4D0F-42A7-B546-B4F4A77D246B},1", 1 ], [ - "{CED8C7D5-5AC4-4553-B9F7-A02A1F599692},1", + "{6FEA70FA-1451-4A27-8A8E-C4CC3B713CF6},1", 1 ], [ - "{D260D973-E2FB-4654-89A2-13BAFC23AEDE},1", + "{68A1E0E1-7A39-4AB6-AD71-4D8A18878D79},1", 1 ], [ - "{EC0D40A0-9E0D-4262-9B4D-D075704938C9},1", + "{7E9041BD-301B-4B5B-9456-1C92050E4914},1", 1 ], [ - "{8E47F53D-F24F-4B3B-942F-390A8F0F31E7},1", + "{EFA77BAE-8A98-4176-B536-B615D1D2ED2B},1", 1 ], [ - "{1FBF8DA5-01E9-4248-BBB9-90B5C4ADFA58},1", + "{87AC0239-51A5-47C6-BAF4-926CCF56385C},1", 1 ], [ - "{A3909E43-E7FE-40C8-9222-0B60EA8CE89B},1", + "{C50BF7FC-F848-4B91-B8C8-743D0AA5F195},1", 1 ], [ - "{925E4C70-2C3F-480D-BB44-D3BF4A0FB985},1", + "{FD8D07D0-C447-4516-A7DB-F8522B77D4A7},1", 1 ], [ - "{1792331E-BA2E-4B60-B150-6AAF41BC488D},1", + "{D2E1FE57-F45D-49C3-B388-95222ACA3886},1", 1 ], [ - "{39716E7C-28A0-4770-BBD2-BB4018DBE93F},1", + "{7F6702B3-C977-436F-82AF-403E2BE950E7},1", 1 ], [ - "{D30FD954-4DA9-4B85-8950-12B85AFA12CB},1", + "{688C4EA1-80F5-4D85-B9BB-F8633FF3C0CA},1", 1 ], [ - "{0F4D72D3-20B0-4884-BF56-08BA4DBFB6FF},1", + "{754FA957-C432-4502-A5CF-EE44449462C0},1", 1 ], [ - "{574D9093-179F-46A3-B3F9-F7EB4345FADA},1", + "{D2197C55-D962-4DF0-8B14-26F88C06D6FA},1", 1 ], [ - "{12C643DD-9593-4641-B945-124257947ADD},1", + "{87B83BA8-A906-4F71-A6CA-3E8133A75D34},1", 1 ], [ - "{C4850841-2A3C-4402-BF11-7499914F9024},1", + "{F2D6AEBB-98EA-4F10-991F-5243E74AF450},1", 1 ], [ - "{37EF05A5-C2D9-44A2-84C0-BCA93ACB9048},1", + "{406687D7-F9E9-491B-85DA-166DE6CD5A60},1", 1 ], [ - "{27C692F0-F79D-4390-AB44-CB8B10E2B49E},1", + "{1F73BF36-9FC2-495D-844D-B370D5C47DE7},1", 1 ], [ - "{B1F28022-58CF-49CF-BC6F-D77A1A034AAC},1", + "{E9BD343F-4A66-4DE2-81F9-3789CCA22818},1", 1 ], [ - "{858FEBAE-05A2-4B49-92D2-96C28376330D},1", + "{189EA744-BE13-467A-95BA-2667A134C0B0},1", 1 ], [ - "{806A80BF-45E8-4188-B782-66A0DAA26E5A},1", + "{017F5881-F818-4C7C-B9F9-6BCB4085F1D0},1", 1 ], [ - "{940E7901-6EF0-43ED-BD42-E0C7658185B1},1", + "{CD0D17F4-25D8-4076-9AF7-47D9CDEFCF0A},1", 1 ], [ - "{D106259D-D139-4DAB-87BE-50AC5E5BEF80},1", + "{CCBB5969-BCE8-498B-BE1A-98FD3A44DB1A},1", 1 ], [ - "{A8883FF6-F53C-46B7-912C-779F9300FA77},1", + "{2B736B19-2D9C-4E76-A732-478D533D717A},1", 1 ] ] } }, - "space": "{31C1BA26-B092-43F4-B346-A5147633ACB5},1" + "space": "{90FCDB0C-36AE-422F-B4FE-67676826FE36},1" }, { "id": 2, "operation": { - "Insert": { - "author": "Author", - "created": 1473408657, - "guid": [ - 212, - 210, - 78, - 209, - 125, - 10, - 236, - 68, - 149, - 82, - 106, - 62, - 189, - 231, - 83, - 255 - ], - "parent": "{37EF05A5-C2D9-44A2-84C0-BCA93ACB9048},12", - "placement": { - "Outline": { - "x": 36.0, - "y": 36.0 - } + "Page": { + "after": { + "created": 134335976560000000, + "definitions": { + "{406687D7-F9E9-491B-85DA-166DE6CD5A60},18": { + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": "Calibri", + "font_size": 17.0, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": null, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + }, + "kind": { + "name": "PageTitle", + "type": "Style" + } + } + }, + "margin_origin": [ + 0.0, + 0.0 + ], + "objects": [ + { + "Outline": { + "id": "{69906E37-5C35-4F2F-B74F-B5D45950739B},0", + "indents": [], + "layout": { + "max_height": null, + "max_width": null, + "reserved_width": null, + "width_set_by_user": null, + "x": 36.0, + "y": 36.0 + }, + "min_width": null, + "paragraphs": [ + { + "collapsed": false, + "content": { + "Text": { + "date_field": null, + "id": "{3A6E4FCA-F6C5-4418-ADF4-9E92782F26CD},0", + "tags": [], + "text": { + "spans": [ + { + "end": 16, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": "Calibri", + "font_size": 11.0, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": 1033, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + } + } + ], + "text": "Actor 9 🦀 é" + } + } + }, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": null, + "font_size": null, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": null, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + }, + "id": "{FFE94E14-C2A1-4CB1-BBDB-0D72059C0A9D},0", + "level": 1, + "lists": [], + "parent": null, + "style": null, + "tags": [] + } + ], + "title": false, + "unsupported": [] + } + }, + { + "Title": { + "date": null, + "id": "{406687D7-F9E9-491B-85DA-166DE6CD5A60},13", + "layout": { + "max_height": null, + "max_width": null, + "reserved_width": null, + "width_set_by_user": null, + "x": 0.0, + "y": 0.0 + }, + "outlines": [ + { + "id": "{406687D7-F9E9-491B-85DA-166DE6CD5A60},14", + "indents": [], + "layout": { + "max_height": null, + "max_width": null, + "reserved_width": null, + "width_set_by_user": null, + "x": null, + "y": null + }, + "min_width": null, + "paragraphs": [ + { + "collapsed": false, + "content": { + "Text": { + "date_field": null, + "id": "{406687D7-F9E9-491B-85DA-166DE6CD5A60},16", + "tags": [], + "text": { + "spans": [ + { + "end": 10, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": "Calibri", + "font_size": 17.0, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": 1033, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + } + } + ], + "text": "Same title" + } + } + }, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": null, + "font_size": null, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": null, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + }, + "id": "{406687D7-F9E9-491B-85DA-166DE6CD5A60},15", + "level": 1, + "lists": [], + "parent": null, + "style": "{406687D7-F9E9-491B-85DA-166DE6CD5A60},18", + "tags": [] + } + ], + "title": false, + "unsupported": [] + } + ] + } + } + ], + "title": "Same title" }, - "text": "Actor 9 🦀 é" + "author": "Author", + "before": { + "created": 134335976560000000, + "definitions": { + "{406687D7-F9E9-491B-85DA-166DE6CD5A60},18": { + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": "Calibri", + "font_size": 17.0, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": null, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + }, + "kind": { + "name": "PageTitle", + "type": "Style" + } + } + }, + "margin_origin": [ + 0.0, + 0.0 + ], + "objects": [ + { + "Title": { + "date": null, + "id": "{406687D7-F9E9-491B-85DA-166DE6CD5A60},13", + "layout": { + "max_height": null, + "max_width": null, + "reserved_width": null, + "width_set_by_user": null, + "x": 0.0, + "y": 0.0 + }, + "outlines": [ + { + "id": "{406687D7-F9E9-491B-85DA-166DE6CD5A60},14", + "indents": [], + "layout": { + "max_height": null, + "max_width": null, + "reserved_width": null, + "width_set_by_user": null, + "x": null, + "y": null + }, + "min_width": null, + "paragraphs": [ + { + "collapsed": false, + "content": { + "Text": { + "date_field": null, + "id": "{406687D7-F9E9-491B-85DA-166DE6CD5A60},16", + "tags": [], + "text": { + "spans": [ + { + "end": 10, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": "Calibri", + "font_size": 17.0, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": 1033, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + } + } + ], + "text": "Same title" + } + } + }, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": null, + "font_size": null, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": null, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + }, + "id": "{406687D7-F9E9-491B-85DA-166DE6CD5A60},15", + "level": 1, + "lists": [], + "parent": null, + "style": "{406687D7-F9E9-491B-85DA-166DE6CD5A60},18", + "tags": [] + } + ], + "title": false, + "unsupported": [] + } + ] + } + } + ], + "title": "Same title" + } } }, - "space": "{37EF05A5-C2D9-44A2-84C0-BCA93ACB9048},1" + "space": "{406687D7-F9E9-491B-85DA-166DE6CD5A60},1" } ], [ @@ -2618,242 +6198,600 @@ "edits": [ { "guid": [ - 32, - 165, - 164, - 162, - 23, - 231, + 99, + 113, + 79, + 243, + 201, + 17, + 203, + 78, + 185, 122, - 69, - 137, - 205, - 124, - 4, - 250, - 9, - 150, - 110 - ], - "level": 1, - "position": { - "Before": "{B1F28022-58CF-49CF-BC6F-D77A1A034AAC},1" - }, - "space": "{858FEBAE-05A2-4B49-92D2-96C28376330D},1" - }, - { - "guid": [ - 136, - 28, - 174, - 50, - 180, - 184, + 45, 83, - 67, - 167, - 99, - 194, - 10, - 250, - 255, - 69, - 239 + 216, + 140, + 115, + 52 + ], + "level": 1, + "position": { + "Before": "{E9BD343F-4A66-4DE2-81F9-3789CCA22818},1" + }, + "space": "{189EA744-BE13-467A-95BA-2667A134C0B0},1" + }, + { + "guid": [ + 240, + 160, + 93, + 114, + 5, + 25, + 128, + 75, + 161, + 252, + 39, + 123, + 203, + 137, + 98, + 106 ], "level": 2, "position": "Keep", - "space": "{806A80BF-45E8-4188-B782-66A0DAA26E5A},1" + "space": "{017F5881-F818-4C7C-B9F9-6BCB4085F1D0},1" } ], "observed": [ [ - "{90D67E9A-BEC2-43C9-973C-1B927FE5FCD4},1", + "{869D5929-6E5E-4EDB-9639-4C56977DD447},1", 1 ], [ - "{7D896A2D-61C9-42B2-AECF-B3C979B88BEB},1", + "{B0B53F94-0105-4C59-B65B-9473F49BFF41},1", 1 ], [ - "{EED86E95-3017-46A7-B26B-991C815839B7},1", + "{0E98EE82-B78F-4872-8BD9-5D9B23A817C5},1", 1 ], [ - "{0E8EA7AB-946D-461C-B571-96CCDC183FDC},1", + "{C837A033-F055-4455-B45F-17D82016921C},1", 1 ], [ - "{BE25CAF8-690F-4947-8683-3A37A7D52CCA},1", + "{89D86121-BF5C-418B-BB92-CBFFA8EF545F},1", 1 ], [ - "{F61E497B-25BB-426E-BC73-320A7B6D2E9E},1", + "{57E835EA-2799-4118-B55C-7BB1E51C6941},1", 1 ], [ - "{E53F33D2-F3FC-42C9-8DC8-B47261D1BDED},1", + "{F7EECCCF-B6B4-44F2-A543-36837EC18B8A},1", 1 ], [ - "{7FDAAAE9-CD33-42AA-A8AA-F87CE3BC8CD6},1", + "{361A0F09-EA63-4F2D-9620-C061D4E4707E},1", 1 ], [ - "{F0E8692A-3CBB-47A6-81D6-7B6E2A125A7F},1", + "{EB3940F1-F255-42BE-8C31-DD09E86DBAAF},1", 1 ], [ - "{71B566DF-DBD8-43B2-AD96-265FDB789E07},1", + "{C2870D07-8ADC-44BB-9F12-15D6C3708689},1", 1 ], [ - "{9C56CBC3-690B-4900-8A07-A43600F7477B},1", + "{1E0C6331-32C9-4EF9-8087-150A8669FA91},1", 1 ], [ - "{914C89B2-A95E-4992-8D2B-B533C7326D57},1", + "{ED9769DD-99D6-4BE2-B980-580DA9C4DFCE},1", 1 ], [ - "{2CA7400B-F732-4FAF-811B-AAFA91C480DF},1", + "{17C30054-7129-4A10-9D00-4D5545E4F4BA},1", 1 ], [ - "{73479EE6-9FC0-4474-A702-E22C734FC42B},1", + "{4C5FBA5B-E348-4750-ACE4-E9694D527BFF},1", 1 ], [ - "{B6C1B618-B721-49CD-B224-45DDFF38C8FC},1", + "{BD0EF658-4D0F-42A7-B546-B4F4A77D246B},1", 1 ], [ - "{CED8C7D5-5AC4-4553-B9F7-A02A1F599692},1", + "{6FEA70FA-1451-4A27-8A8E-C4CC3B713CF6},1", 1 ], [ - "{D260D973-E2FB-4654-89A2-13BAFC23AEDE},1", + "{68A1E0E1-7A39-4AB6-AD71-4D8A18878D79},1", 1 ], [ - "{EC0D40A0-9E0D-4262-9B4D-D075704938C9},1", + "{7E9041BD-301B-4B5B-9456-1C92050E4914},1", 1 ], [ - "{8E47F53D-F24F-4B3B-942F-390A8F0F31E7},1", + "{EFA77BAE-8A98-4176-B536-B615D1D2ED2B},1", 1 ], [ - "{1FBF8DA5-01E9-4248-BBB9-90B5C4ADFA58},1", + "{87AC0239-51A5-47C6-BAF4-926CCF56385C},1", 1 ], [ - "{A3909E43-E7FE-40C8-9222-0B60EA8CE89B},1", + "{C50BF7FC-F848-4B91-B8C8-743D0AA5F195},1", 1 ], [ - "{925E4C70-2C3F-480D-BB44-D3BF4A0FB985},1", + "{FD8D07D0-C447-4516-A7DB-F8522B77D4A7},1", 1 ], [ - "{1792331E-BA2E-4B60-B150-6AAF41BC488D},1", + "{D2E1FE57-F45D-49C3-B388-95222ACA3886},1", 1 ], [ - "{39716E7C-28A0-4770-BBD2-BB4018DBE93F},1", + "{7F6702B3-C977-436F-82AF-403E2BE950E7},1", 1 ], [ - "{D30FD954-4DA9-4B85-8950-12B85AFA12CB},1", + "{688C4EA1-80F5-4D85-B9BB-F8633FF3C0CA},1", 1 ], [ - "{0F4D72D3-20B0-4884-BF56-08BA4DBFB6FF},1", + "{754FA957-C432-4502-A5CF-EE44449462C0},1", 1 ], [ - "{574D9093-179F-46A3-B3F9-F7EB4345FADA},1", + "{D2197C55-D962-4DF0-8B14-26F88C06D6FA},1", 1 ], [ - "{12C643DD-9593-4641-B945-124257947ADD},1", + "{87B83BA8-A906-4F71-A6CA-3E8133A75D34},1", 1 ], [ - "{C4850841-2A3C-4402-BF11-7499914F9024},1", + "{F2D6AEBB-98EA-4F10-991F-5243E74AF450},1", 1 ], [ - "{37EF05A5-C2D9-44A2-84C0-BCA93ACB9048},1", + "{406687D7-F9E9-491B-85DA-166DE6CD5A60},1", 1 ], [ - "{27C692F0-F79D-4390-AB44-CB8B10E2B49E},1", + "{1F73BF36-9FC2-495D-844D-B370D5C47DE7},1", 1 ], [ - "{B1F28022-58CF-49CF-BC6F-D77A1A034AAC},1", + "{E9BD343F-4A66-4DE2-81F9-3789CCA22818},1", 1 ], [ - "{858FEBAE-05A2-4B49-92D2-96C28376330D},1", + "{189EA744-BE13-467A-95BA-2667A134C0B0},1", 1 ], [ - "{806A80BF-45E8-4188-B782-66A0DAA26E5A},1", + "{017F5881-F818-4C7C-B9F9-6BCB4085F1D0},1", 1 ], [ - "{940E7901-6EF0-43ED-BD42-E0C7658185B1},1", + "{CD0D17F4-25D8-4076-9AF7-47D9CDEFCF0A},1", 1 ], [ - "{D106259D-D139-4DAB-87BE-50AC5E5BEF80},1", + "{CCBB5969-BCE8-498B-BE1A-98FD3A44DB1A},1", 1 ], [ - "{A8883FF6-F53C-46B7-912C-779F9300FA77},1", + "{2B736B19-2D9C-4E76-A732-478D533D717A},1", 1 ] ] } }, - "space": "{31C1BA26-B092-43F4-B346-A5147633ACB5},1" + "space": "{90FCDB0C-36AE-422F-B4FE-67676826FE36},1" }, { "id": 2, "operation": { - "Insert": { - "author": "Author", - "created": 1473408657, - "guid": [ - 235, - 68, - 225, - 150, - 90, - 167, - 26, - 78, - 157, - 185, - 155, - 48, - 227, - 111, - 93, - 87 - ], - "parent": "{858FEBAE-05A2-4B49-92D2-96C28376330D},12", - "placement": { - "Outline": { - "x": 36.0, - "y": 36.0 - } + "Page": { + "after": { + "created": 134335976560000000, + "definitions": { + "{189EA744-BE13-467A-95BA-2667A134C0B0},18": { + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": "Calibri", + "font_size": 17.0, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": null, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + }, + "kind": { + "name": "PageTitle", + "type": "Style" + } + } + }, + "margin_origin": [ + 0.0, + 0.0 + ], + "objects": [ + { + "Outline": { + "id": "{A05DF797-7FAA-4593-A1F4-7E35812A5257},0", + "indents": [], + "layout": { + "max_height": null, + "max_width": null, + "reserved_width": null, + "width_set_by_user": null, + "x": 36.0, + "y": 36.0 + }, + "min_width": null, + "paragraphs": [ + { + "collapsed": false, + "content": { + "Text": { + "date_field": null, + "id": "{D134F5D0-A81E-4663-9AE8-5FF66C8882F1},0", + "tags": [], + "text": { + "spans": [ + { + "end": 17, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": "Calibri", + "font_size": 11.0, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": 1033, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + } + } + ], + "text": "Actor 10 🦀 é" + } + } + }, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": null, + "font_size": null, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": null, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + }, + "id": "{D783BABC-D1D5-45A9-86F8-1169830488FC},0", + "level": 1, + "lists": [], + "parent": null, + "style": null, + "tags": [] + } + ], + "title": false, + "unsupported": [] + } + }, + { + "Title": { + "date": null, + "id": "{189EA744-BE13-467A-95BA-2667A134C0B0},13", + "layout": { + "max_height": null, + "max_width": null, + "reserved_width": null, + "width_set_by_user": null, + "x": 0.0, + "y": 0.0 + }, + "outlines": [ + { + "id": "{189EA744-BE13-467A-95BA-2667A134C0B0},14", + "indents": [], + "layout": { + "max_height": null, + "max_width": null, + "reserved_width": null, + "width_set_by_user": null, + "x": null, + "y": null + }, + "min_width": null, + "paragraphs": [ + { + "collapsed": false, + "content": { + "Text": { + "date_field": null, + "id": "{189EA744-BE13-467A-95BA-2667A134C0B0},16", + "tags": [], + "text": { + "spans": [ + { + "end": 10, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": "Calibri", + "font_size": 17.0, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": 1033, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + } + } + ], + "text": "Same title" + } + } + }, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": null, + "font_size": null, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": null, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + }, + "id": "{189EA744-BE13-467A-95BA-2667A134C0B0},15", + "level": 1, + "lists": [], + "parent": null, + "style": "{189EA744-BE13-467A-95BA-2667A134C0B0},18", + "tags": [] + } + ], + "title": false, + "unsupported": [] + } + ] + } + } + ], + "title": "Same title" }, - "text": "Actor 10 🦀 é" + "author": "Author", + "before": { + "created": 134335976560000000, + "definitions": { + "{189EA744-BE13-467A-95BA-2667A134C0B0},18": { + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": "Calibri", + "font_size": 17.0, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": null, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + }, + "kind": { + "name": "PageTitle", + "type": "Style" + } + } + }, + "margin_origin": [ + 0.0, + 0.0 + ], + "objects": [ + { + "Title": { + "date": null, + "id": "{189EA744-BE13-467A-95BA-2667A134C0B0},13", + "layout": { + "max_height": null, + "max_width": null, + "reserved_width": null, + "width_set_by_user": null, + "x": 0.0, + "y": 0.0 + }, + "outlines": [ + { + "id": "{189EA744-BE13-467A-95BA-2667A134C0B0},14", + "indents": [], + "layout": { + "max_height": null, + "max_width": null, + "reserved_width": null, + "width_set_by_user": null, + "x": null, + "y": null + }, + "min_width": null, + "paragraphs": [ + { + "collapsed": false, + "content": { + "Text": { + "date_field": null, + "id": "{189EA744-BE13-467A-95BA-2667A134C0B0},16", + "tags": [], + "text": { + "spans": [ + { + "end": 10, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": "Calibri", + "font_size": 17.0, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": 1033, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + } + } + ], + "text": "Same title" + } + } + }, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": null, + "font_size": null, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": null, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + }, + "id": "{189EA744-BE13-467A-95BA-2667A134C0B0},15", + "level": 1, + "lists": [], + "parent": null, + "style": "{189EA744-BE13-467A-95BA-2667A134C0B0},18", + "tags": [] + } + ], + "title": false, + "unsupported": [] + } + ] + } + } + ], + "title": "Same title" + } } }, - "space": "{858FEBAE-05A2-4B49-92D2-96C28376330D},1" + "space": "{189EA744-BE13-467A-95BA-2667A134C0B0},1" } ], [ @@ -2864,242 +6802,600 @@ "edits": [ { "guid": [ - 181, - 53, - 220, - 27, - 175, - 42, - 75, - 67, - 172, - 247, - 88, - 164, - 222, - 89, - 204, - 82 - ], - "level": 1, - "position": { - "Before": "{940E7901-6EF0-43ED-BD42-E0C7658185B1},1" - }, - "space": "{D106259D-D139-4DAB-87BE-50AC5E5BEF80},1" - }, - { - "guid": [ - 66, - 14, - 221, - 210, - 177, - 93, - 236, - 75, - 161, - 135, - 67, + 137, + 150, + 22, + 112, + 113, + 130, + 213, + 65, + 143, 6, + 73, + 88, + 176, + 192, + 23, + 119 + ], + "level": 1, + "position": { + "Before": "{CD0D17F4-25D8-4076-9AF7-47D9CDEFCF0A},1" + }, + "space": "{CCBB5969-BCE8-498B-BE1A-98FD3A44DB1A},1" + }, + { + "guid": [ + 65, + 77, + 116, + 151, + 20, + 16, + 115, 66, - 129, - 52, - 199 + 138, + 169, + 25, + 24, + 111, + 125, + 154, + 123 ], "level": 2, "position": "Keep", - "space": "{A8883FF6-F53C-46B7-912C-779F9300FA77},1" + "space": "{2B736B19-2D9C-4E76-A732-478D533D717A},1" } ], "observed": [ [ - "{90D67E9A-BEC2-43C9-973C-1B927FE5FCD4},1", + "{869D5929-6E5E-4EDB-9639-4C56977DD447},1", 1 ], [ - "{7D896A2D-61C9-42B2-AECF-B3C979B88BEB},1", + "{B0B53F94-0105-4C59-B65B-9473F49BFF41},1", 1 ], [ - "{EED86E95-3017-46A7-B26B-991C815839B7},1", + "{0E98EE82-B78F-4872-8BD9-5D9B23A817C5},1", 1 ], [ - "{0E8EA7AB-946D-461C-B571-96CCDC183FDC},1", + "{C837A033-F055-4455-B45F-17D82016921C},1", 1 ], [ - "{BE25CAF8-690F-4947-8683-3A37A7D52CCA},1", + "{89D86121-BF5C-418B-BB92-CBFFA8EF545F},1", 1 ], [ - "{F61E497B-25BB-426E-BC73-320A7B6D2E9E},1", + "{57E835EA-2799-4118-B55C-7BB1E51C6941},1", 1 ], [ - "{E53F33D2-F3FC-42C9-8DC8-B47261D1BDED},1", + "{F7EECCCF-B6B4-44F2-A543-36837EC18B8A},1", 1 ], [ - "{7FDAAAE9-CD33-42AA-A8AA-F87CE3BC8CD6},1", + "{361A0F09-EA63-4F2D-9620-C061D4E4707E},1", 1 ], [ - "{F0E8692A-3CBB-47A6-81D6-7B6E2A125A7F},1", + "{EB3940F1-F255-42BE-8C31-DD09E86DBAAF},1", 1 ], [ - "{71B566DF-DBD8-43B2-AD96-265FDB789E07},1", + "{C2870D07-8ADC-44BB-9F12-15D6C3708689},1", 1 ], [ - "{9C56CBC3-690B-4900-8A07-A43600F7477B},1", + "{1E0C6331-32C9-4EF9-8087-150A8669FA91},1", 1 ], [ - "{914C89B2-A95E-4992-8D2B-B533C7326D57},1", + "{ED9769DD-99D6-4BE2-B980-580DA9C4DFCE},1", 1 ], [ - "{2CA7400B-F732-4FAF-811B-AAFA91C480DF},1", + "{17C30054-7129-4A10-9D00-4D5545E4F4BA},1", 1 ], [ - "{73479EE6-9FC0-4474-A702-E22C734FC42B},1", + "{4C5FBA5B-E348-4750-ACE4-E9694D527BFF},1", 1 ], [ - "{B6C1B618-B721-49CD-B224-45DDFF38C8FC},1", + "{BD0EF658-4D0F-42A7-B546-B4F4A77D246B},1", 1 ], [ - "{CED8C7D5-5AC4-4553-B9F7-A02A1F599692},1", + "{6FEA70FA-1451-4A27-8A8E-C4CC3B713CF6},1", 1 ], [ - "{D260D973-E2FB-4654-89A2-13BAFC23AEDE},1", + "{68A1E0E1-7A39-4AB6-AD71-4D8A18878D79},1", 1 ], [ - "{EC0D40A0-9E0D-4262-9B4D-D075704938C9},1", + "{7E9041BD-301B-4B5B-9456-1C92050E4914},1", 1 ], [ - "{8E47F53D-F24F-4B3B-942F-390A8F0F31E7},1", + "{EFA77BAE-8A98-4176-B536-B615D1D2ED2B},1", 1 ], [ - "{1FBF8DA5-01E9-4248-BBB9-90B5C4ADFA58},1", + "{87AC0239-51A5-47C6-BAF4-926CCF56385C},1", 1 ], [ - "{A3909E43-E7FE-40C8-9222-0B60EA8CE89B},1", + "{C50BF7FC-F848-4B91-B8C8-743D0AA5F195},1", 1 ], [ - "{925E4C70-2C3F-480D-BB44-D3BF4A0FB985},1", + "{FD8D07D0-C447-4516-A7DB-F8522B77D4A7},1", 1 ], [ - "{1792331E-BA2E-4B60-B150-6AAF41BC488D},1", + "{D2E1FE57-F45D-49C3-B388-95222ACA3886},1", 1 ], [ - "{39716E7C-28A0-4770-BBD2-BB4018DBE93F},1", + "{7F6702B3-C977-436F-82AF-403E2BE950E7},1", 1 ], [ - "{D30FD954-4DA9-4B85-8950-12B85AFA12CB},1", + "{688C4EA1-80F5-4D85-B9BB-F8633FF3C0CA},1", 1 ], [ - "{0F4D72D3-20B0-4884-BF56-08BA4DBFB6FF},1", + "{754FA957-C432-4502-A5CF-EE44449462C0},1", 1 ], [ - "{574D9093-179F-46A3-B3F9-F7EB4345FADA},1", + "{D2197C55-D962-4DF0-8B14-26F88C06D6FA},1", 1 ], [ - "{12C643DD-9593-4641-B945-124257947ADD},1", + "{87B83BA8-A906-4F71-A6CA-3E8133A75D34},1", 1 ], [ - "{C4850841-2A3C-4402-BF11-7499914F9024},1", + "{F2D6AEBB-98EA-4F10-991F-5243E74AF450},1", 1 ], [ - "{37EF05A5-C2D9-44A2-84C0-BCA93ACB9048},1", + "{406687D7-F9E9-491B-85DA-166DE6CD5A60},1", 1 ], [ - "{27C692F0-F79D-4390-AB44-CB8B10E2B49E},1", + "{1F73BF36-9FC2-495D-844D-B370D5C47DE7},1", 1 ], [ - "{B1F28022-58CF-49CF-BC6F-D77A1A034AAC},1", + "{E9BD343F-4A66-4DE2-81F9-3789CCA22818},1", 1 ], [ - "{858FEBAE-05A2-4B49-92D2-96C28376330D},1", + "{189EA744-BE13-467A-95BA-2667A134C0B0},1", 1 ], [ - "{806A80BF-45E8-4188-B782-66A0DAA26E5A},1", + "{017F5881-F818-4C7C-B9F9-6BCB4085F1D0},1", 1 ], [ - "{940E7901-6EF0-43ED-BD42-E0C7658185B1},1", + "{CD0D17F4-25D8-4076-9AF7-47D9CDEFCF0A},1", 1 ], [ - "{D106259D-D139-4DAB-87BE-50AC5E5BEF80},1", + "{CCBB5969-BCE8-498B-BE1A-98FD3A44DB1A},1", 1 ], [ - "{A8883FF6-F53C-46B7-912C-779F9300FA77},1", + "{2B736B19-2D9C-4E76-A732-478D533D717A},1", 1 ] ] } }, - "space": "{31C1BA26-B092-43F4-B346-A5147633ACB5},1" + "space": "{90FCDB0C-36AE-422F-B4FE-67676826FE36},1" }, { "id": 2, "operation": { - "Insert": { - "author": "Author", - "created": 1473408657, - "guid": [ - 142, - 193, - 242, - 223, - 29, - 246, - 57, - 70, - 180, - 43, - 87, - 35, - 54, - 147, - 219, - 200 - ], - "parent": "{D106259D-D139-4DAB-87BE-50AC5E5BEF80},12", - "placement": { - "Outline": { - "x": 36.0, - "y": 36.0 - } + "Page": { + "after": { + "created": 134335976560000000, + "definitions": { + "{CCBB5969-BCE8-498B-BE1A-98FD3A44DB1A},18": { + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": "Calibri", + "font_size": 17.0, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": null, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + }, + "kind": { + "name": "PageTitle", + "type": "Style" + } + } + }, + "margin_origin": [ + 0.0, + 0.0 + ], + "objects": [ + { + "Outline": { + "id": "{00E55A56-1362-4A11-ACD3-2117BCCE619E},0", + "indents": [], + "layout": { + "max_height": null, + "max_width": null, + "reserved_width": null, + "width_set_by_user": null, + "x": 36.0, + "y": 36.0 + }, + "min_width": null, + "paragraphs": [ + { + "collapsed": false, + "content": { + "Text": { + "date_field": null, + "id": "{AD3FBA83-B057-48DF-9731-DEBD6F95BDBE},0", + "tags": [], + "text": { + "spans": [ + { + "end": 17, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": "Calibri", + "font_size": 11.0, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": 1033, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + } + } + ], + "text": "Actor 11 🦀 é" + } + } + }, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": null, + "font_size": null, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": null, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + }, + "id": "{77E85A17-9EF5-4C79-B11B-48A5CE7FE0FD},0", + "level": 1, + "lists": [], + "parent": null, + "style": null, + "tags": [] + } + ], + "title": false, + "unsupported": [] + } + }, + { + "Title": { + "date": null, + "id": "{CCBB5969-BCE8-498B-BE1A-98FD3A44DB1A},13", + "layout": { + "max_height": null, + "max_width": null, + "reserved_width": null, + "width_set_by_user": null, + "x": 0.0, + "y": 0.0 + }, + "outlines": [ + { + "id": "{CCBB5969-BCE8-498B-BE1A-98FD3A44DB1A},14", + "indents": [], + "layout": { + "max_height": null, + "max_width": null, + "reserved_width": null, + "width_set_by_user": null, + "x": null, + "y": null + }, + "min_width": null, + "paragraphs": [ + { + "collapsed": false, + "content": { + "Text": { + "date_field": null, + "id": "{CCBB5969-BCE8-498B-BE1A-98FD3A44DB1A},16", + "tags": [], + "text": { + "spans": [ + { + "end": 10, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": "Calibri", + "font_size": 17.0, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": 1033, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + } + } + ], + "text": "Same title" + } + } + }, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": null, + "font_size": null, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": null, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + }, + "id": "{CCBB5969-BCE8-498B-BE1A-98FD3A44DB1A},15", + "level": 1, + "lists": [], + "parent": null, + "style": "{CCBB5969-BCE8-498B-BE1A-98FD3A44DB1A},18", + "tags": [] + } + ], + "title": false, + "unsupported": [] + } + ] + } + } + ], + "title": "Same title" }, - "text": "Actor 11 🦀 é" + "author": "Author", + "before": { + "created": 134335976560000000, + "definitions": { + "{CCBB5969-BCE8-498B-BE1A-98FD3A44DB1A},18": { + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": "Calibri", + "font_size": 17.0, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": null, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + }, + "kind": { + "name": "PageTitle", + "type": "Style" + } + } + }, + "margin_origin": [ + 0.0, + 0.0 + ], + "objects": [ + { + "Title": { + "date": null, + "id": "{CCBB5969-BCE8-498B-BE1A-98FD3A44DB1A},13", + "layout": { + "max_height": null, + "max_width": null, + "reserved_width": null, + "width_set_by_user": null, + "x": 0.0, + "y": 0.0 + }, + "outlines": [ + { + "id": "{CCBB5969-BCE8-498B-BE1A-98FD3A44DB1A},14", + "indents": [], + "layout": { + "max_height": null, + "max_width": null, + "reserved_width": null, + "width_set_by_user": null, + "x": null, + "y": null + }, + "min_width": null, + "paragraphs": [ + { + "collapsed": false, + "content": { + "Text": { + "date_field": null, + "id": "{CCBB5969-BCE8-498B-BE1A-98FD3A44DB1A},16", + "tags": [], + "text": { + "spans": [ + { + "end": 10, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": "Calibri", + "font_size": 17.0, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": 1033, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + } + } + ], + "text": "Same title" + } + } + }, + "format": { + "alignment": null, + "bold": null, + "color": null, + "embedded_object": null, + "font": null, + "font_size": null, + "hidden": null, + "highlight": null, + "hyperlink": null, + "hyperlink_label": null, + "italic": null, + "language": null, + "line_spacing": null, + "list_spacing": null, + "math": null, + "rtl": null, + "space_after": null, + "space_before": null, + "strike": null, + "subscript": null, + "superscript": null, + "underline": null + }, + "id": "{CCBB5969-BCE8-498B-BE1A-98FD3A44DB1A},15", + "level": 1, + "lists": [], + "parent": null, + "style": "{CCBB5969-BCE8-498B-BE1A-98FD3A44DB1A},18", + "tags": [] + } + ], + "title": false, + "unsupported": [] + } + ] + } + } + ], + "title": "Same title" + } } }, - "space": "{D106259D-D139-4DAB-87BE-50AC5E5BEF80},1" + "space": "{CCBB5969-BCE8-498B-BE1A-98FD3A44DB1A},1" } ] ], diff --git a/corpus/page-lifecycle/offline-edits/twelve-clients/candidate/pages.one b/corpus/page-lifecycle/offline-edits/twelve-clients/candidate/pages.one index 1b5234be824491c10496e749049b25836b704808..2eeab58e5d1fbb41822281555635300f75e4b5b6 100644 Binary files a/corpus/page-lifecycle/offline-edits/twelve-clients/candidate/pages.one and b/corpus/page-lifecycle/offline-edits/twelve-clients/candidate/pages.one differ diff --git a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/commands.jsonl b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/commands.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..39cb578ade0cf61be05f9d640e0e5b37c168fc0a --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/commands.jsonl @@ -0,0 +1,3 @@ +{"command": "powershell -NoProfile -Command \"Expand-Archive -LiteralPath C:\\one-tests\\transfer.zip -DestinationPath C:\\one-tests\\runs\\capture\\notebook\"", "exit": 0, "stdout": "", "stderr": "", "error": null} +{"command": "powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -File C:\\one-tests\\read-current.ps1 -Root C:\\one-tests\\runs\\capture -CloneHost ONE-M6-16C2E4D4 -ExpectedPages 37", "exit": 0, "stdout": "Read 1 sections and 37 pages.\r\n", "stderr": "", "error": null} +{"command": "powershell -NoProfile -Command \"Compress-Archive -Force -Path C:\\one-tests\\runs\\capture\\* -DestinationPath C:\\one-tests\\captured.zip\"", "exit": 0, "stdout": "", "stderr": "", "error": null} diff --git a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/machine.json b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/machine.json new file mode 100644 index 0000000000000000000000000000000000000000..f3647d86a305f6004b3249b3cb1cea0accb16037 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/machine.json @@ -0,0 +1 @@ +{"name": "m6-16c2e4d4", "hostname": "ONE-M6-16C2E4D4"} diff --git a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/notebook/Open Notebook.onetoc2 b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/notebook/Open Notebook.onetoc2 new file mode 100644 index 0000000000000000000000000000000000000000..3d74ced3a87a8c55ef5f637d4a211d3c0717d838 Binary files /dev/null and b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/notebook/Open Notebook.onetoc2 differ diff --git a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/notebook/pages.one b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/notebook/pages.one index 274d65ef695ac53f5138b85182b722ba6ec98316..629137c244ba6e9c8c0f461e46d2551adae3d066 100644 Binary files a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/notebook/pages.one and b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/notebook/pages.one differ diff --git a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/environment.json b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/environment.json new file mode 100644 index 0000000000000000000000000000000000000000..747e291e640b73db771af0151c2ebe1ecb3627e6 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/environment.json @@ -0,0 +1,7 @@ +{ + "powershell": "5.1.14409.1005", + "schema": "xs2010", + "hostname": "ONE-M6-16C2E4D4", + "cold": true, + "onenote": "14.0.4763.1000" +} diff --git a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/hierarchy.xml b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/hierarchy.xml index 0ee77a03aafb8eeaeb2733d618080544bd2ea97f..569bd9d2624ab7dc4f36e751f769b5ed2b492d19 100644 --- a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/hierarchy.xml +++ b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/hierarchy.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-000.xml b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-000.xml index 0f15ae2965b2c5801066502cc65fb2971d3d6f79..ddc49e628e7e1f06935c6038502eecf01489308e 100644 --- a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-000.xml +++ b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-000.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-001.xml b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-001.xml index 3c5a328c51edce7c2dc83cd5a92c18bc587a106c..ea93ab8f4c1d76eaf9c633fbf2ab1a8a58b18e51 100644 --- a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-001.xml +++ b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-001.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-002.xml b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-002.xml index a195845e5111f9473c8e51a137c52a816bad177b..2d8525d02868d0f1287b344cc030bac1f5798efe 100644 --- a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-002.xml +++ b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-002.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-003.xml b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-003.xml index baee1e0e41db2b8970d5ebf6874ced610c5605fb..6a6d89afdf7796f811b0cd05a0dc0124da540dac 100644 --- a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-003.xml +++ b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-003.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-004.xml b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-004.xml index f44afff85ab2f639498e454230ad684fe477fbf6..91ca1b13844bddd0066ef9b4b51502b034f3003d 100644 --- a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-004.xml +++ b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-004.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-005.xml b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-005.xml index f6e72bd83473e6564ec0fff5a02f177df8bf0645..54244aa786c49bd758072198f180fa18e428f132 100644 --- a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-005.xml +++ b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-005.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-006.xml b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-006.xml index 7a8518e4307ec050749e07f20cfc60e669106ef5..0b65c27a4cb7593a90534f1ae39f8ac2034e0e1c 100644 --- a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-006.xml +++ b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-006.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-007.xml b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-007.xml index 7bd5e8573a299047e1a443e9c48e7656f3fd4cc4..ab512d7f8beab5e69ca851b04ef0c4822431cf42 100644 --- a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-007.xml +++ b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-007.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-008.xml b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-008.xml index b6fe52b23f3a5dba69811943143175555fb768be..8bbea50d74a13c69d55e0804031265973456d572 100644 --- a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-008.xml +++ b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-008.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-009.xml b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-009.xml index 0858743ad9424999de876ec95ebb3248a6a6bdf9..045fcb701b9f60ea1d82b63dfbbd936c10a0d91d 100644 --- a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-009.xml +++ b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-009.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-010.xml b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-010.xml index 11a009ba37b0b56e694a634af3d0e8004ce9d891..3d16a64f844515662eb47ca89db8eaca383f37bd 100644 --- a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-010.xml +++ b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-010.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-011.xml b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-011.xml index 7b24ebb857bc900c9e2b592c479099b227d34cd3..04b3240f657876147e0982ee8a4e828930d92df9 100644 --- a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-011.xml +++ b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-011.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-012.xml b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-012.xml index 9d24b783aaefac29d5cdcd4a31f24ae4350e8cf1..8b383a7af0f74c659ebf68f068b3e660c3d58d06 100644 --- a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-012.xml +++ b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-012.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-013.xml b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-013.xml index a0b537ecdf3fdbe4dad19b16940ec5b2b81a1328..8c1d476171c64a10f1465826b3e4208ed2d13d7a 100644 --- a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-013.xml +++ b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-013.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-014.xml b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-014.xml index a732b77292318a35e0043268b077c55e62718d14..08c872d0ad481307923505f968cc3683259b630c 100644 --- a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-014.xml +++ b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-014.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-015.xml b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-015.xml index 954bc03f039bf5fe5d329e2f645d7360bd26d705..6f61dc1a76e074e554a5c25d23137ac02d203390 100644 --- a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-015.xml +++ b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-015.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-016.xml b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-016.xml index b5d495c4a6dd601c2d85aab3b59447958047a59c..0c0d0e6ad4ea243067b5114bc23658cb70fb9a7e 100644 --- a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-016.xml +++ b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-016.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-017.xml b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-017.xml index 6605ca79c45634598f5ce40064057da6816f4609..9814cd630806eefc93ee9efa5e1d18fa17a524d9 100644 --- a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-017.xml +++ b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-017.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-018.xml b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-018.xml index 90b13e7d6aee11a437d57de33a4a0018feb9d4c9..c5070fd54278cf962a0213a7016a096db7ddf28b 100644 --- a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-018.xml +++ b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-018.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-019.xml b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-019.xml index ed2088a46488b1d864cc197db28d717da87c7a37..e8fa05da717a35ae9070c0754343dcbcb6cd760d 100644 --- a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-019.xml +++ b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-019.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-020.xml b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-020.xml index 4b846972581daad7f772f3e9cf9c9a94c9f920d6..b31abf3925f0c62ba09ce2c11b22f566ec63a0dd 100644 --- a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-020.xml +++ b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-020.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-021.xml b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-021.xml index 0fbc487ff677d2ea1c5fc1486f9a0b07cc2a6475..a21a4dd734a31553b4c6a69ccd8542ed6f80f834 100644 --- a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-021.xml +++ b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-021.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-022.xml b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-022.xml index 7f858dac0099b526675ffdb5ab01ab6da1d33691..e44c331c3277c2a6cf462b78082895a1ae6265c3 100644 --- a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-022.xml +++ b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-022.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-023.xml b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-023.xml index 0a8a90d9ebdb7e7a59a3974d7cad9ce6090de2c5..7c314f860d8a9b791be5c9d6421d67b5751f3674 100644 --- a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-023.xml +++ b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-023.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-024.xml b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-024.xml index 9853ca9969f3b84d42d3cd09ae46998e6a647a29..c6e2f5e91f62380a0aa8245e28fce80bf5523fa6 100644 --- a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-024.xml +++ b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-024.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-025.xml b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-025.xml index 906efaf6bca54f0ab49f8b1bb800048142964fc3..2463cde990f11f382f3e5cf07b844396ebe3f1d9 100644 --- a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-025.xml +++ b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-025.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-026.xml b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-026.xml index 8bbe68696dd02386a2cf7779fd753c7f01c996c3..da1e7da17cd18a1e94fbb4fd3175f186c1d12eea 100644 --- a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-026.xml +++ b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-026.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-027.xml b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-027.xml index cc544f47a39d6a8c3327a84b2769965ca0a882bf..126f6719eb016d3e246dd0e921b97e7e94634d4f 100644 --- a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-027.xml +++ b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-027.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-028.xml b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-028.xml index 70ab187afc832d956614e01d0af09fa5d6d1f4cb..c258afb97ddcaccf28f6faca8c9aec7c2c80925b 100644 --- a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-028.xml +++ b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-028.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-029.xml b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-029.xml index 1758fdbfe166a84f89b01fe06f116e6c302db6ea..8a4e8bae89e5afdbcc79408532e77f0d30e65726 100644 --- a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-029.xml +++ b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-029.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-030.xml b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-030.xml index 700ebcae96d598eee2625e5fed1f666da0a3b1c4..f8f903f4ce64e3b1ca3bd9cf6e3afba2d34b6f73 100644 --- a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-030.xml +++ b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-030.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-031.xml b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-031.xml index e495a2d21ac63dd38b6d09d900e67f2eacc2575c..2b25bc0ee284254da60a0fa8afb549b0d17705b7 100644 --- a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-031.xml +++ b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-031.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-032.xml b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-032.xml index d5b8a086d20f562201b4434f21a709704a633a03..365f61997ffcc80c2cf7f2766f40d546333596c8 100644 --- a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-032.xml +++ b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-032.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-033.xml b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-033.xml index 3cd0c6e82ab8d68f29e1404827790b08c5647b2e..a666cdc6381ff2f08d9e4a612fb678d27ed8e31b 100644 --- a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-033.xml +++ b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-033.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-034.xml b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-034.xml index 3b6e3be1405b02b3bfc6f65e430ef3131457e9c6..34923dd48e15d94c96eb55cefbd03f4d70737607 100644 --- a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-034.xml +++ b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-034.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-035.xml b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-035.xml index 7df2f70b29e740529a7fea08d8f6d69f395dba6b..0220fa4fc4bac580f38180ac4ac58a5c419533a5 100644 --- a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-035.xml +++ b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-035.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-036.xml b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-036.xml index c0741ad9b38c722243acfd6dd81afdf090e9780e..1ebc46fdbeb645acc7f5e0c820039c95253bbd48 100644 --- a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-036.xml +++ b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/page-036.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/payloads.json b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/payloads.json new file mode 100644 index 0000000000000000000000000000000000000000..1ce91a413d6fff4d58765187b76756f0e97ae843 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/read/payloads.json @@ -0,0 +1,3 @@ +[ + +] \ No newline at end of file diff --git a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/run.json b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/run.json new file mode 100644 index 0000000000000000000000000000000000000000..6c89101554490de6bed888dd5cc6762ec72d1559 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/run.json @@ -0,0 +1,18 @@ +{ + "notebook": "/private/tmp/m33/page-clients2/candidate", + "expected_pages": 37, + "author": null, + "author_timeout_seconds": 600, + "inspect": false, + "collect_notebook": true, + "base": { + "file": "win7-office-base.qcow2", + "format": "qcow2", + "sha256": "a1a4f8fab782ee14885ff801ca2f6347c208fdcfc3513637096f314315c89346", + "virtual_size": 68719476736 + }, + "scripts": { + "cold.ps1": "c177fc72ae6c2634d186f5671a880de20b09f9716532c37c69cb13aa15c7e331", + "read.ps1": "04013bfcccee40a17e2a225f9b9e96f40a3a8daad9e350609654f8eda3ccbb41" + } +} diff --git a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/scripts/cold.ps1 b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/scripts/cold.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..a0b99e7aeb86f4dc10032537800501a52ad65b4f --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/scripts/cold.ps1 @@ -0,0 +1,27 @@ +param([Parameter(Mandatory=$true)][string]$Root, [string]$CloneHost = '') +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' +$root = [IO.Path]::GetFullPath($Root).TrimEnd('\') +if ([IO.Path]::GetDirectoryName($root) -ne 'C:\one-tests\runs') { + throw 'Choose a run directly below C:\one-tests\runs.' +} +if (Get-Process ONENOTE -ErrorAction SilentlyContinue) { throw 'Close OneNote before resetting its test cache.' } +$key = 'HKCU:\Software\Microsoft\Office\14.0\OneNote' +if ($CloneHost) { + if ($CloneHost -notmatch '^ONE-[A-Z0-9-]+$' -or [Environment]::MachineName -ne $CloneHost) { + throw 'The disposable clone hostname does not match this machine.' + } + New-Item "$key\Options\Paths" -Force | Out-Null + New-ItemProperty "$key\Options\Paths" -Name UnfiledNotesSection -PropertyType ExpandString -Value 'C:\one-tests\Loose.one' -Force | Out-Null +} elseif ((Get-ItemProperty "$key\Options\Paths").UnfiledNotesSection -ne 'C:\one-tests\Loose.one' -or + -not (Test-Path 'C:\one-tests\profile-original-cache')) { + throw 'Park the personal OneNote profile before resetting the test cache.' +} +$cache = Join-Path $env:LOCALAPPDATA 'Microsoft\OneNote\14.0' +$parked = Join-Path 'C:\one-tests\caches' ([IO.Path]::GetFileName($root)) +if (Test-Path $parked) { throw 'Choose a new run; its parked cache already exists.' } +New-Item -ItemType Directory -Path 'C:\one-tests\caches' -Force | Out-Null +if (Test-Path $cache) { Move-Item -LiteralPath $cache -Destination $parked } +if (Test-Path "$key\OpenNotebooks") { Remove-Item "$key\OpenNotebooks" -Recurse } +New-Item "$key\OpenNotebooks" | Out-Null +New-ItemProperty "$key\OpenNotebooks" -Name '1' -PropertyType String -Value "$root\notebook" | Out-Null diff --git a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/scripts/read.ps1 b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/scripts/read.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..476094ab1e0c47077988a6461db2080cf208642b --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/scripts/read.ps1 @@ -0,0 +1,142 @@ +param( + [Parameter(Mandatory=$true)][string]$Root, + [int]$ExpectedPages = -1, + [switch]$UseCurrentCache, + [switch]$Pdf, + [switch]$KeepOpen, + [string]$CloneHost = '' +) +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' +$root = [IO.Path]::GetFullPath($Root).TrimEnd('\') +if ([IO.Path]::GetDirectoryName($root) -ne 'C:\one-tests\runs') { + throw 'Choose a run directly below C:\one-tests\runs.' +} +$notebook = Join-Path $root 'notebook' +$output = Join-Path $root 'read' +if (Test-Path $output) { throw 'Choose a new read destination.' } +if ($UseCurrentCache) { + if ((Get-ItemProperty 'HKCU:\Software\Microsoft\Office\14.0\OneNote\Options\Paths').UnfiledNotesSection -ne 'C:\one-tests\Loose.one') { + throw 'Park the personal OneNote profile before reading test notebooks.' + } +} else { + & "$PSScriptRoot\cold-current.ps1" -Root $root -CloneHost $CloneHost +} +New-Item -ItemType Directory -Path $output | Out-Null +$app = New-Object -ComObject OneNote.Application +$notebookId = '' +$failure = $null +try { + $app.OpenHierarchy($notebook, '', [ref]$notebookId, 0) + $process = Get-Process ONENOTE + @{ hostname = [Environment]::MachineName; onenote = $process.MainModule.FileVersionInfo.FileVersion; + powershell = $PSVersionTable.PSVersion.ToString(); schema = 'xs2010'; cold = (-not $UseCurrentCache.IsPresent) } | + ConvertTo-Json | Set-Content (Join-Path $output 'environment.json') -Encoding UTF8 + $sections = @() + foreach ($file in @(Get-ChildItem $notebook -Recurse | Where-Object { $_.Extension -eq '.one' })) { + $id = '' + $app.OpenHierarchy($file.FullName, '', [ref]$id, 0) + $sections += $id + } + $deadline = [DateTime]::UtcNow.AddSeconds(300) + $previous = '' + $lastChange = '' + $stableSince = [DateTime]::UtcNow + $settled = $false + do { + $pages = @{} + foreach ($section in $sections) { + $hierarchy = '' + $app.GetHierarchy($section, 4, [ref]$hierarchy, 1) + [xml]$xml = $hierarchy + foreach ($node in $xml.SelectNodes('//*[@path]')) { + if (-not $node.GetAttribute('path').StartsWith("$notebook\", [StringComparison]::OrdinalIgnoreCase)) { + throw 'OneNote opened a section outside the copied notebook.' + } + } + foreach ($node in $xml.SelectNodes('//*[local-name()="Page"]')) { + $id = $node.GetAttribute('ID') + $content = '' + $app.GetPageContent($id, [ref]$content, 1, 1) + $pages[$id] = $content + } + } + $signature = [String]::Join('|', @($pages.Keys | Sort-Object | ForEach-Object { $_ + $pages[$_] })) + if ($signature -ne $previous) { + $lastChange = $previous + $previous = $signature + $stableSince = [DateTime]::UtcNow + } + if ((($ExpectedPages -ge 0 -and $pages.Count -eq $ExpectedPages) -or + ($ExpectedPages -lt 0 -and $pages.Count -gt 0)) -and + ([DateTime]::UtcNow - $stableSince).TotalSeconds -ge 2) { $settled = $true; break } + Start-Sleep -Milliseconds 250 + } while ([DateTime]::UtcNow -lt $deadline) + if (-not $settled -or ($ExpectedPages -ge 0 -and $pages.Count -ne $ExpectedPages) -or ($ExpectedPages -lt 0 -and $pages.Count -eq 0)) { + [IO.File]::WriteAllText((Join-Path $output 'previous-signature.txt'), $lastChange, [Text.Encoding]::UTF8) + $index = 0 + foreach ($id in @($pages.Keys | Sort-Object)) { + [IO.File]::WriteAllText((Join-Path $output ('unsettled-{0:d3}.xml' -f $index)), $pages[$id], [Text.Encoding]::UTF8) + $index++ + } + $hierarchy = '' + $app.GetHierarchy($notebookId, 4, [ref]$hierarchy, 1) + [IO.File]::WriteAllText((Join-Path $output 'unsettled-hierarchy.xml'), $hierarchy, [Text.Encoding]::UTF8) + throw "Expected $ExpectedPages stable pages; OneNote returned $($pages.Count), settled=$settled." + } + $index = 0 + $payloads = @() + foreach ($id in @($pages.Keys | Sort-Object)) { + [IO.File]::WriteAllText((Join-Path $output ('page-{0:d3}.xml' -f $index)), $pages[$id], [Text.Encoding]::UTF8) + if ($Pdf) { + $pdfPath = Join-Path $output ('page-{0:d3}.pdf' -f $index) + $app.NavigateTo($id, '', $false) + $app.Publish($id, $pdfPath, 3, '') + if (-not (Test-Path $pdfPath) -or (Get-Item $pdfPath).Length -eq 0) { throw 'OneNote did not publish the page PDF.' } + } + [xml]$page = $pages[$id] + foreach ($file in $page.SelectNodes('//*[local-name()="InsertedFile" or local-name()="MediaFile"]')) { + $bytes = [IO.File]::ReadAllBytes($file.GetAttribute('pathCache')) + $hash = [BitConverter]::ToString([Security.Cryptography.SHA256]::Create().ComputeHash($bytes)).Replace('-', '').ToLowerInvariant() + [IO.File]::WriteAllBytes((Join-Path $output ($hash + '.attachment')), $bytes) + $payloads += @{ page = $id; object = $file.ParentNode.GetAttribute('objectID'); + kind = $file.LocalName; name = $file.GetAttribute('preferredName'); + sha256 = $hash; bytes = $bytes.Length } + } + $index++ + } + [IO.File]::WriteAllText((Join-Path $output 'payloads.json'), (ConvertTo-Json -InputObject $payloads -Depth 4), [Text.Encoding]::UTF8) + $all = '' + $app.GetHierarchy($notebookId, 4, [ref]$all, 1) + [xml]$finalTree = $all + $finalIds = @($finalTree.SelectNodes('//*[local-name()="Page"]') | ForEach-Object { $_.GetAttribute('ID') } | Sort-Object -Unique) + if ($finalIds.Count -ne $pages.Count -or @($finalIds | Where-Object { -not $pages.ContainsKey($_) }).Count -ne 0) { + throw 'The notebook hierarchy changed while collecting page evidence; repeat the cold read.' + } + [IO.File]::WriteAllText((Join-Path $output 'hierarchy.xml'), $all, [Text.Encoding]::UTF8) + Write-Output "Read $($sections.Count) sections and $($pages.Count) pages." +} catch { + $failure = $_ + [IO.File]::WriteAllText((Join-Path $output 'failure.txt'), ($_ | Out-String), [Text.Encoding]::UTF8) + throw +} finally { + try { + try { + if ($notebookId -and $CloneHost) { $app.SyncHierarchy($notebookId) } + if ($notebookId -and -not $KeepOpen -and (-not $UseCurrentCache -or $CloneHost)) { + $app.CloseNotebook($notebookId, $false) + } + } catch { + if ($null -eq $failure) { throw } + [IO.File]::WriteAllText((Join-Path $output 'cleanup-failure.txt'), ($_ | Out-String), [Text.Encoding]::UTF8) + } + } finally { + [void][Runtime.InteropServices.Marshal]::FinalReleaseComObject($app) + } + $app = $null + [GC]::Collect() + [GC]::WaitForPendingFinalizers() + if (-not $UseCurrentCache -and -not $CloneHost) { + Get-Process ONENOTE -ErrorAction SilentlyContinue | Wait-Process -Timeout 10 + } +} diff --git a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/source.json b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/source.json new file mode 100644 index 0000000000000000000000000000000000000000..5a7b7bdc33c9835a75ee62c9515d3481b0c6c5ae --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/source.json @@ -0,0 +1,8 @@ +[ + { + "path": "pages.one", + "bytes": 155344, + "sha256": "623ade8b5ee6fc837ae63d5293791039ecd17da9cb8bc5e243ea20cadf37958c", + "mtime_ns": 1789124063040528117 + } +] diff --git a/corpus/page-lifecycle/offline-edits/twelve-clients/cold/teardown.json b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/teardown.json new file mode 100644 index 0000000000000000000000000000000000000000..05a47793de40f322e745c4c4183727e3590ecf70 --- /dev/null +++ b/corpus/page-lifecycle/offline-edits/twelve-clients/cold/teardown.json @@ -0,0 +1 @@ +{"absent": true} diff --git a/corpus/paragraph-edit/README.md b/corpus/paragraph-edit/README.md index a8ed082d25ee9a53dda45247767161dabf90562a..c37d217f2c67e340b184f342ea562b514b76feb0 100644 --- a/corpus/paragraph-edit/README.md +++ b/corpus/paragraph-edit/README.md @@ -62,9 +62,13 @@ the native-rendered result to the corresponding keyboard-generated control. by `ONESTORE_PARAGRAPH_JOIN_OUTPUT`. `offline` retains reconciled split/join candidates and cold native captures. -The cache queues edits before observing independent remote `☂` prefixes, reopens -between acknowledgements, and confirms modeled lost replies without replaying -operations. Tests compare native text/styles to the original keyboard controls, -account for the remote prefixes, and retain exact graph identities after reopening. +The cache queues each recorded split or join as a page-model save before +observing an independent remote `☂` prefix, reopens between acknowledgements, +and confirms modeled lost replies without replaying a publication. The +`inheritance` group has four cases: `Join inherited styles` joins runs whose +language or spacing differ, which the page model cannot express, and is +recorded as refused. Tests compare native text/styles to the original keyboard +controls, account for the remote prefixes, and retain exact graph identities +after reopening. The ignored offline test `export_native_offline_paragraphs` regenerates candidates in a new directory specified by `ONESTORE_OFFLINE_PARAGRAPH_OUTPUT`. diff --git a/corpus/paragraph-edit/offline/inheritance/candidate/synthetic.one b/corpus/paragraph-edit/offline/inheritance/candidate/synthetic.one index e64cafc0ec2e467c73f2709679fe0acfda707323..b7e7057f82bb773e828603c5be2adcc74e2058b3 100644 Binary files a/corpus/paragraph-edit/offline/inheritance/candidate/synthetic.one and b/corpus/paragraph-edit/offline/inheritance/candidate/synthetic.one differ diff --git a/corpus/paragraph-edit/offline/inheritance/manifest.json b/corpus/paragraph-edit/offline/inheritance/manifest.json index 8905aa0adf6878941da6efe2ffbf7aebf840af61..4f737ac77e12890f38c762b389c275b661bd4dba 100644 --- a/corpus/paragraph-edit/offline/inheritance/manifest.json +++ b/corpus/paragraph-edit/offline/inheritance/manifest.json @@ -1,62 +1,50 @@ [ - { - "case": "Join inherited styles", - "id": 1, - "intent": { - "author": "Rust join author", - "left": "{10952FC5-A849-0DE5-03A7-5D9304627DA7},44", - "right": "{10952FC5-A849-0DE5-03A7-5D9304627DA7},50" - }, - "remote_prefix": true, - "revision": "{E109048E-057D-41DC-B2A8-B9F11839B9C9},1", - "space": "{D6CEB12D-D1B7-033B-20A2-E9B6FF501602},1" - }, { "case": "Join empty left tag", - "id": 2, + "id": 1, "intent": { "author": "Rust join author", "left": "{8BAFC64A-8457-0253-3906-57D27F8546B7},45", "right": "{8BAFC64A-8457-0253-3906-57D27F8546B7},51" }, "remote_prefix": false, - "revision": "{19A52AE8-D897-467C-956F-26CA42CEDA1B},1", + "revision": "{5DBF2F05-0AF6-4659-86E6-249D81CDFBB0},1", "space": "{F6E7A6F0-805F-0858-2B5A-4B1260940CF9},1" }, { "case": "Join right tag", - "id": 3, + "id": 2, "intent": { "author": "Rust join author", "left": "{2E9A20A9-1E0E-0F04-0FCE-8497CF032068},44", "right": "{2E9A20A9-1E0E-0F04-0FCE-8497CF032068},49" }, "remote_prefix": true, - "revision": "{BDDFFFE4-439A-4466-9D85-20B88D5A5E61},1", + "revision": "{BAED8622-0129-4BD1-971A-D437EB3E7B21},1", "space": "{04EE80E5-584B-04E0-1F05-07D86902DFA1},1" }, { "case": "Join both tags", - "id": 4, + "id": 3, "intent": { "author": "Rust join author", "left": "{7A5195E3-F792-0C49-1F3C-EBBFCE774FE6},44", "right": "{7A5195E3-F792-0C49-1F3C-EBBFCE774FE6},50" }, "remote_prefix": true, - "revision": "{694A9A93-E1AA-48DD-AD67-6BD2C0EF5D6F},1", + "revision": "{247AE1FD-D8B5-439A-B39E-0B7F34E26187},1", "space": "{631A0B54-DBB1-0988-22E1-96E8B1202B59},1" }, { "case": "Join both children", - "id": 5, + "id": 4, "intent": { "author": "Rust join author", "left": "{0384F5F6-5F0B-0164-32C6-6E97A4F1B661},49", "right": "{0384F5F6-5F0B-0164-32C6-6E97A4F1B661},54" }, "remote_prefix": true, - "revision": "{B3100F21-58B5-4417-9797-B397AC0F7BE3},1", + "revision": "{11FD3066-617C-4D68-8FF8-101C471B40DE},1", "space": "{D7D982D1-A3D3-0690-1181-A9703CF717E5},1" } ] \ No newline at end of file diff --git a/corpus/paragraph-edit/offline/inheritance/native/commands.jsonl b/corpus/paragraph-edit/offline/inheritance/native/commands.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..12e54c1e750450b68ab21e28e37a5a753df450fa --- /dev/null +++ b/corpus/paragraph-edit/offline/inheritance/native/commands.jsonl @@ -0,0 +1,3 @@ +{"command": "powershell -NoProfile -Command \"Expand-Archive -LiteralPath C:\\one-tests\\transfer.zip -DestinationPath C:\\one-tests\\runs\\capture\\notebook\"", "exit": 0, "stdout": "", "stderr": "", "error": null} +{"command": "powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -File C:\\one-tests\\read-current.ps1 -Root C:\\one-tests\\runs\\capture -CloneHost ONE-M6-349DE309 -ExpectedPages 6", "exit": 0, "stdout": "Read 1 sections and 6 pages.\r\n", "stderr": "", "error": null} +{"command": "powershell -NoProfile -Command \"Compress-Archive -Force -Path C:\\one-tests\\runs\\capture\\* -DestinationPath C:\\one-tests\\captured.zip\"", "exit": 0, "stdout": "", "stderr": "", "error": null} diff --git a/corpus/paragraph-edit/offline/inheritance/native/machine.json b/corpus/paragraph-edit/offline/inheritance/native/machine.json new file mode 100644 index 0000000000000000000000000000000000000000..1c982078cc08ec3a1b5c7461e08a2516bad33396 --- /dev/null +++ b/corpus/paragraph-edit/offline/inheritance/native/machine.json @@ -0,0 +1 @@ +{"name": "m6-349de309", "hostname": "ONE-M6-349DE309"} diff --git a/corpus/paragraph-edit/offline/inheritance/native/notebook/Open Notebook.onetoc2 b/corpus/paragraph-edit/offline/inheritance/native/notebook/Open Notebook.onetoc2 index 8ecc576e8f13a07ffe261f2fdbe028a37cb11351..1ac43867e2ad91b9486ba6958f22ec31cb90cbaf 100644 Binary files a/corpus/paragraph-edit/offline/inheritance/native/notebook/Open Notebook.onetoc2 and b/corpus/paragraph-edit/offline/inheritance/native/notebook/Open Notebook.onetoc2 differ diff --git a/corpus/paragraph-edit/offline/inheritance/native/notebook/synthetic.one b/corpus/paragraph-edit/offline/inheritance/native/notebook/synthetic.one index 8b4bece77818ba8f070380e73523c35b9ab5b19a..89f16e347fe10daeda55392cfacfa61a34cb30db 100644 Binary files a/corpus/paragraph-edit/offline/inheritance/native/notebook/synthetic.one and b/corpus/paragraph-edit/offline/inheritance/native/notebook/synthetic.one differ diff --git a/corpus/paragraph-edit/offline/inheritance/native/read/environment.json b/corpus/paragraph-edit/offline/inheritance/native/read/environment.json index 9ce6d758f071c4bb49737eb8104c0ee15ce86363..a232435e6e8caa9818629e63b30faccd773bf034 100644 --- a/corpus/paragraph-edit/offline/inheritance/native/read/environment.json +++ b/corpus/paragraph-edit/offline/inheritance/native/read/environment.json @@ -1,7 +1,7 @@ { "powershell": "5.1.14409.1005", "schema": "xs2010", - "hostname": "ONE-M6-6061365E", + "hostname": "ONE-M6-349DE309", "cold": true, "onenote": "14.0.4763.1000" } diff --git a/corpus/paragraph-edit/offline/inheritance/native/read/hierarchy.xml b/corpus/paragraph-edit/offline/inheritance/native/read/hierarchy.xml index 92079e1969cd7a99c75f19db52f7e085a591b431..fc9be4401f4cd19beae233e0ee13860db5be842f 100644 --- a/corpus/paragraph-edit/offline/inheritance/native/read/hierarchy.xml +++ b/corpus/paragraph-edit/offline/inheritance/native/read/hierarchy.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/paragraph-edit/offline/inheritance/native/read/page-000.xml b/corpus/paragraph-edit/offline/inheritance/native/read/page-000.xml index 7ec799793802bacdd3ab47100a46821273f490bd..e338a3e9e5cb4829a6aa64aeefd964f5d5cd039b 100644 --- a/corpus/paragraph-edit/offline/inheritance/native/read/page-000.xml +++ b/corpus/paragraph-edit/offline/inheritance/native/read/page-000.xml @@ -1,5 +1,5 @@  -☂LeftBold italic 🦀 é tail]]> +lang=en-US> 🦀 é tail]]> diff --git a/corpus/paragraph-edit/offline/inheritance/native/read/page-001.xml b/corpus/paragraph-edit/offline/inheritance/native/read/page-001.xml index e7da941a9f1ab49daedf6b4599443ae39a0269b6..e4ee444148f4866ab925b96836a21107fec510d2 100644 --- a/corpus/paragraph-edit/offline/inheritance/native/read/page-001.xml +++ b/corpus/paragraph-edit/offline/inheritance/native/read/page-001.xml @@ -1,5 +1,20 @@  -☂LeftBold italic 🦀 é tail]]> +Bold 🦀 italic é color 東京
+End
]]>
Fictitious: café, 東京, مرحبا]]>
diff --git a/corpus/paragraph-edit/offline/inheritance/native/read/page-002.xml b/corpus/paragraph-edit/offline/inheritance/native/read/page-002.xml index 9f7ebac7baae2c38efceca18ccd5d33d6fa668e9..64216ad68e92b2a9671434d86ddb8f56abe2d69f 100644 --- a/corpus/paragraph-edit/offline/inheritance/native/read/page-002.xml +++ b/corpus/paragraph-edit/offline/inheritance/native/read/page-002.xml @@ -1,20 +1,5 @@  -Bold 🦀 italic é color 東京
-End
]]>
Fictitious: café, 東京, مرحبا]]>
+☂LeftBold italic 🦀 é tail]]> diff --git a/corpus/paragraph-edit/offline/inheritance/native/read/page-003.xml b/corpus/paragraph-edit/offline/inheritance/native/read/page-003.xml index b4d1f59c82406908740081c4710a489002085ac2..f2cdc96ba344390eb5402f0f2b6ac05374623913 100644 --- a/corpus/paragraph-edit/offline/inheritance/native/read/page-003.xml +++ b/corpus/paragraph-edit/offline/inheritance/native/read/page-003.xml @@ -1,5 +1,4 @@  -☂LeftRight italic]]> +Right italic]]> diff --git a/corpus/paragraph-edit/offline/inheritance/native/read/page-004.xml b/corpus/paragraph-edit/offline/inheritance/native/read/page-004.xml index 2f7e50d49be4739acae06d0e4fb7c70663d60644..4ad01c8a34062259208e79234a2d54325f8925c0 100644 --- a/corpus/paragraph-edit/offline/inheritance/native/read/page-004.xml +++ b/corpus/paragraph-edit/offline/inheritance/native/read/page-004.xml @@ -1,5 +1,4 @@  -☂Left childBold italic 🦀 é tail]]> +Bold italic 🦀 é tail]]> diff --git a/corpus/paragraph-edit/offline/inheritance/native/read/page-005.xml b/corpus/paragraph-edit/offline/inheritance/native/read/page-005.xml index 82c73e5a1daf3735d8e9a40de6251a3f839b6a89..18b152e8fa3356af22aa2a926195c172cce73b30 100644 --- a/corpus/paragraph-edit/offline/inheritance/native/read/page-005.xml +++ b/corpus/paragraph-edit/offline/inheritance/native/read/page-005.xml @@ -1,5 +1,5 @@  -Bold italic 🦀 é tail]]> +style='color:#123456' lang=x-none>tail]]> diff --git a/corpus/paragraph-edit/offline/inheritance/native/read/payloads.json b/corpus/paragraph-edit/offline/inheritance/native/read/payloads.json deleted file mode 120000 index 787b4bae85038cda922f8befac6c8ed361fa8035..0000000000000000000000000000000000000000 --- a/corpus/paragraph-edit/offline/inheritance/native/read/payloads.json +++ /dev/null @@ -1 +0,0 @@ -../../../../before/read/payloads.json \ No newline at end of file diff --git a/corpus/paragraph-edit/offline/inheritance/native/read/payloads.json b/corpus/paragraph-edit/offline/inheritance/native/read/payloads.json new file mode 100644 index 0000000000000000000000000000000000000000..1ce91a413d6fff4d58765187b76756f0e97ae843 --- /dev/null +++ b/corpus/paragraph-edit/offline/inheritance/native/read/payloads.json @@ -0,0 +1,3 @@ +[ + +] \ No newline at end of file diff --git a/corpus/paragraph-edit/offline/inheritance/native/run.json b/corpus/paragraph-edit/offline/inheritance/native/run.json index 2fbf78ac8b624e29cbc1ef5a140dc7bb0c388002..be00e60c20fb973a28ae46047369310ed5a99e56 100644 --- a/corpus/paragraph-edit/offline/inheritance/native/run.json +++ b/corpus/paragraph-edit/offline/inheritance/native/run.json @@ -1,5 +1,5 @@ { - "notebook": "/Users/clo/dev/one/evidence/m10/offline-paragraph-native-01/inheritance/candidate", + "notebook": "/private/tmp/m33/offline-paragraph/inheritance/candidate", "expected_pages": 6, "author": null, "author_timeout_seconds": 600, diff --git a/corpus/paragraph-edit/offline/inheritance/native/scripts/cold.ps1 b/corpus/paragraph-edit/offline/inheritance/native/scripts/cold.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..a0b99e7aeb86f4dc10032537800501a52ad65b4f --- /dev/null +++ b/corpus/paragraph-edit/offline/inheritance/native/scripts/cold.ps1 @@ -0,0 +1,27 @@ +param([Parameter(Mandatory=$true)][string]$Root, [string]$CloneHost = '') +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' +$root = [IO.Path]::GetFullPath($Root).TrimEnd('\') +if ([IO.Path]::GetDirectoryName($root) -ne 'C:\one-tests\runs') { + throw 'Choose a run directly below C:\one-tests\runs.' +} +if (Get-Process ONENOTE -ErrorAction SilentlyContinue) { throw 'Close OneNote before resetting its test cache.' } +$key = 'HKCU:\Software\Microsoft\Office\14.0\OneNote' +if ($CloneHost) { + if ($CloneHost -notmatch '^ONE-[A-Z0-9-]+$' -or [Environment]::MachineName -ne $CloneHost) { + throw 'The disposable clone hostname does not match this machine.' + } + New-Item "$key\Options\Paths" -Force | Out-Null + New-ItemProperty "$key\Options\Paths" -Name UnfiledNotesSection -PropertyType ExpandString -Value 'C:\one-tests\Loose.one' -Force | Out-Null +} elseif ((Get-ItemProperty "$key\Options\Paths").UnfiledNotesSection -ne 'C:\one-tests\Loose.one' -or + -not (Test-Path 'C:\one-tests\profile-original-cache')) { + throw 'Park the personal OneNote profile before resetting the test cache.' +} +$cache = Join-Path $env:LOCALAPPDATA 'Microsoft\OneNote\14.0' +$parked = Join-Path 'C:\one-tests\caches' ([IO.Path]::GetFileName($root)) +if (Test-Path $parked) { throw 'Choose a new run; its parked cache already exists.' } +New-Item -ItemType Directory -Path 'C:\one-tests\caches' -Force | Out-Null +if (Test-Path $cache) { Move-Item -LiteralPath $cache -Destination $parked } +if (Test-Path "$key\OpenNotebooks") { Remove-Item "$key\OpenNotebooks" -Recurse } +New-Item "$key\OpenNotebooks" | Out-Null +New-ItemProperty "$key\OpenNotebooks" -Name '1' -PropertyType String -Value "$root\notebook" | Out-Null diff --git a/corpus/paragraph-edit/offline/inheritance/native/scripts/read.ps1 b/corpus/paragraph-edit/offline/inheritance/native/scripts/read.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..476094ab1e0c47077988a6461db2080cf208642b --- /dev/null +++ b/corpus/paragraph-edit/offline/inheritance/native/scripts/read.ps1 @@ -0,0 +1,142 @@ +param( + [Parameter(Mandatory=$true)][string]$Root, + [int]$ExpectedPages = -1, + [switch]$UseCurrentCache, + [switch]$Pdf, + [switch]$KeepOpen, + [string]$CloneHost = '' +) +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' +$root = [IO.Path]::GetFullPath($Root).TrimEnd('\') +if ([IO.Path]::GetDirectoryName($root) -ne 'C:\one-tests\runs') { + throw 'Choose a run directly below C:\one-tests\runs.' +} +$notebook = Join-Path $root 'notebook' +$output = Join-Path $root 'read' +if (Test-Path $output) { throw 'Choose a new read destination.' } +if ($UseCurrentCache) { + if ((Get-ItemProperty 'HKCU:\Software\Microsoft\Office\14.0\OneNote\Options\Paths').UnfiledNotesSection -ne 'C:\one-tests\Loose.one') { + throw 'Park the personal OneNote profile before reading test notebooks.' + } +} else { + & "$PSScriptRoot\cold-current.ps1" -Root $root -CloneHost $CloneHost +} +New-Item -ItemType Directory -Path $output | Out-Null +$app = New-Object -ComObject OneNote.Application +$notebookId = '' +$failure = $null +try { + $app.OpenHierarchy($notebook, '', [ref]$notebookId, 0) + $process = Get-Process ONENOTE + @{ hostname = [Environment]::MachineName; onenote = $process.MainModule.FileVersionInfo.FileVersion; + powershell = $PSVersionTable.PSVersion.ToString(); schema = 'xs2010'; cold = (-not $UseCurrentCache.IsPresent) } | + ConvertTo-Json | Set-Content (Join-Path $output 'environment.json') -Encoding UTF8 + $sections = @() + foreach ($file in @(Get-ChildItem $notebook -Recurse | Where-Object { $_.Extension -eq '.one' })) { + $id = '' + $app.OpenHierarchy($file.FullName, '', [ref]$id, 0) + $sections += $id + } + $deadline = [DateTime]::UtcNow.AddSeconds(300) + $previous = '' + $lastChange = '' + $stableSince = [DateTime]::UtcNow + $settled = $false + do { + $pages = @{} + foreach ($section in $sections) { + $hierarchy = '' + $app.GetHierarchy($section, 4, [ref]$hierarchy, 1) + [xml]$xml = $hierarchy + foreach ($node in $xml.SelectNodes('//*[@path]')) { + if (-not $node.GetAttribute('path').StartsWith("$notebook\", [StringComparison]::OrdinalIgnoreCase)) { + throw 'OneNote opened a section outside the copied notebook.' + } + } + foreach ($node in $xml.SelectNodes('//*[local-name()="Page"]')) { + $id = $node.GetAttribute('ID') + $content = '' + $app.GetPageContent($id, [ref]$content, 1, 1) + $pages[$id] = $content + } + } + $signature = [String]::Join('|', @($pages.Keys | Sort-Object | ForEach-Object { $_ + $pages[$_] })) + if ($signature -ne $previous) { + $lastChange = $previous + $previous = $signature + $stableSince = [DateTime]::UtcNow + } + if ((($ExpectedPages -ge 0 -and $pages.Count -eq $ExpectedPages) -or + ($ExpectedPages -lt 0 -and $pages.Count -gt 0)) -and + ([DateTime]::UtcNow - $stableSince).TotalSeconds -ge 2) { $settled = $true; break } + Start-Sleep -Milliseconds 250 + } while ([DateTime]::UtcNow -lt $deadline) + if (-not $settled -or ($ExpectedPages -ge 0 -and $pages.Count -ne $ExpectedPages) -or ($ExpectedPages -lt 0 -and $pages.Count -eq 0)) { + [IO.File]::WriteAllText((Join-Path $output 'previous-signature.txt'), $lastChange, [Text.Encoding]::UTF8) + $index = 0 + foreach ($id in @($pages.Keys | Sort-Object)) { + [IO.File]::WriteAllText((Join-Path $output ('unsettled-{0:d3}.xml' -f $index)), $pages[$id], [Text.Encoding]::UTF8) + $index++ + } + $hierarchy = '' + $app.GetHierarchy($notebookId, 4, [ref]$hierarchy, 1) + [IO.File]::WriteAllText((Join-Path $output 'unsettled-hierarchy.xml'), $hierarchy, [Text.Encoding]::UTF8) + throw "Expected $ExpectedPages stable pages; OneNote returned $($pages.Count), settled=$settled." + } + $index = 0 + $payloads = @() + foreach ($id in @($pages.Keys | Sort-Object)) { + [IO.File]::WriteAllText((Join-Path $output ('page-{0:d3}.xml' -f $index)), $pages[$id], [Text.Encoding]::UTF8) + if ($Pdf) { + $pdfPath = Join-Path $output ('page-{0:d3}.pdf' -f $index) + $app.NavigateTo($id, '', $false) + $app.Publish($id, $pdfPath, 3, '') + if (-not (Test-Path $pdfPath) -or (Get-Item $pdfPath).Length -eq 0) { throw 'OneNote did not publish the page PDF.' } + } + [xml]$page = $pages[$id] + foreach ($file in $page.SelectNodes('//*[local-name()="InsertedFile" or local-name()="MediaFile"]')) { + $bytes = [IO.File]::ReadAllBytes($file.GetAttribute('pathCache')) + $hash = [BitConverter]::ToString([Security.Cryptography.SHA256]::Create().ComputeHash($bytes)).Replace('-', '').ToLowerInvariant() + [IO.File]::WriteAllBytes((Join-Path $output ($hash + '.attachment')), $bytes) + $payloads += @{ page = $id; object = $file.ParentNode.GetAttribute('objectID'); + kind = $file.LocalName; name = $file.GetAttribute('preferredName'); + sha256 = $hash; bytes = $bytes.Length } + } + $index++ + } + [IO.File]::WriteAllText((Join-Path $output 'payloads.json'), (ConvertTo-Json -InputObject $payloads -Depth 4), [Text.Encoding]::UTF8) + $all = '' + $app.GetHierarchy($notebookId, 4, [ref]$all, 1) + [xml]$finalTree = $all + $finalIds = @($finalTree.SelectNodes('//*[local-name()="Page"]') | ForEach-Object { $_.GetAttribute('ID') } | Sort-Object -Unique) + if ($finalIds.Count -ne $pages.Count -or @($finalIds | Where-Object { -not $pages.ContainsKey($_) }).Count -ne 0) { + throw 'The notebook hierarchy changed while collecting page evidence; repeat the cold read.' + } + [IO.File]::WriteAllText((Join-Path $output 'hierarchy.xml'), $all, [Text.Encoding]::UTF8) + Write-Output "Read $($sections.Count) sections and $($pages.Count) pages." +} catch { + $failure = $_ + [IO.File]::WriteAllText((Join-Path $output 'failure.txt'), ($_ | Out-String), [Text.Encoding]::UTF8) + throw +} finally { + try { + try { + if ($notebookId -and $CloneHost) { $app.SyncHierarchy($notebookId) } + if ($notebookId -and -not $KeepOpen -and (-not $UseCurrentCache -or $CloneHost)) { + $app.CloseNotebook($notebookId, $false) + } + } catch { + if ($null -eq $failure) { throw } + [IO.File]::WriteAllText((Join-Path $output 'cleanup-failure.txt'), ($_ | Out-String), [Text.Encoding]::UTF8) + } + } finally { + [void][Runtime.InteropServices.Marshal]::FinalReleaseComObject($app) + } + $app = $null + [GC]::Collect() + [GC]::WaitForPendingFinalizers() + if (-not $UseCurrentCache -and -not $CloneHost) { + Get-Process ONENOTE -ErrorAction SilentlyContinue | Wait-Process -Timeout 10 + } +} diff --git a/corpus/paragraph-edit/offline/inheritance/native/source.json b/corpus/paragraph-edit/offline/inheritance/native/source.json index 02e8e0326bf665e52ba695484dafd587f263b7c0..f8b9b6c762434d633360b146a5c3050fce928a62 100644 --- a/corpus/paragraph-edit/offline/inheritance/native/source.json +++ b/corpus/paragraph-edit/offline/inheritance/native/source.json @@ -1,8 +1,8 @@ [ { "path": "synthetic.one", - "bytes": 59016, - "sha256": "828e330b0dfda41ecd5ade77ea65398cf5a070170757b3f650ca4600520d99bb", - "mtime_ns": 1788863184799153800 + "bytes": 58696, + "sha256": "30d43d92bf2100adc4138134854ce5be30a56877f288fc42f2ee2cf685c188b6", + "mtime_ns": 1789121621674421867 } ] diff --git a/corpus/paragraph-edit/offline/inheritance/native/teardown.json b/corpus/paragraph-edit/offline/inheritance/native/teardown.json deleted file mode 120000 index 47a1192a30ea7da90676d631bb9a2687d829b43e..0000000000000000000000000000000000000000 --- a/corpus/paragraph-edit/offline/inheritance/native/teardown.json +++ /dev/null @@ -1 +0,0 @@ -../../../joined/teardown.json \ No newline at end of file diff --git a/corpus/paragraph-edit/offline/inheritance/native/teardown.json b/corpus/paragraph-edit/offline/inheritance/native/teardown.json new file mode 100644 index 0000000000000000000000000000000000000000..05a47793de40f322e745c4c4183727e3590ecf70 --- /dev/null +++ b/corpus/paragraph-edit/offline/inheritance/native/teardown.json @@ -0,0 +1 @@ +{"absent": true} diff --git a/corpus/paragraph-edit/offline/joins/candidate/synthetic.one b/corpus/paragraph-edit/offline/joins/candidate/synthetic.one index b3fefe96ad2e3c9de97a136f760b521bcb11bda4..882adba9ebd294c3d74ac0a1a0b967af1746f52a 100644 Binary files a/corpus/paragraph-edit/offline/joins/candidate/synthetic.one and b/corpus/paragraph-edit/offline/joins/candidate/synthetic.one differ diff --git a/corpus/paragraph-edit/offline/joins/manifest.json b/corpus/paragraph-edit/offline/joins/manifest.json index 9931ce4a575276ec439d92ff937a49dfcf9b79f1..a959933585fa5b849fa53c4c05bfa07ee9cfea1d 100644 --- a/corpus/paragraph-edit/offline/joins/manifest.json +++ b/corpus/paragraph-edit/offline/joins/manifest.json @@ -8,7 +8,7 @@ "right": "{0BA342F5-0690-087C-24FE-8EE6D81C2041},12" }, "remote_prefix": true, - "revision": "{D3E40C30-D3F7-48FC-8163-10191C9874A2},1", + "revision": "{86FC01C5-5257-4294-9FBE-7ACCA408F2A3},1", "space": "{FE224563-B517-023E-0D75-9904B1952A26},1" }, { @@ -20,7 +20,7 @@ "right": "{051BC1DE-5AE6-0D04-0CEF-9D05F53C8EAE},12" }, "remote_prefix": true, - "revision": "{B4AD652D-1152-4BFB-9F7C-3F5A37D526CC},1", + "revision": "{89344F8C-FF9F-4E56-B5F7-3DE89F7814BD},1", "space": "{DED48A05-0DB1-0712-086D-09237C982341},1" }, { @@ -32,7 +32,7 @@ "right": "{B230A510-9428-0CE7-1B89-7CA970F8F676},12" }, "remote_prefix": false, - "revision": "{14C83ACF-0D2F-4D6C-8A85-D4B883407F57},1", + "revision": "{5058FDEB-1EAD-4258-8C10-C96839E5E1D1},1", "space": "{7919E933-0809-00D8-1754-A21684215860},1" }, { @@ -44,7 +44,7 @@ "right": "{601DAE0A-2A53-0C28-3077-1FE8FCB26FC2},12" }, "remote_prefix": true, - "revision": "{BAE72407-55A9-4703-922B-67E6B8ADE435},1", + "revision": "{8A62B1D0-2FE8-4C2D-8879-82896B813802},1", "space": "{927F2809-173C-036E-37B6-60A6568F7723},1" }, { @@ -56,7 +56,7 @@ "right": "{EACB4A2C-2444-0A1F-03D6-68187F2FB345},12" }, "remote_prefix": false, - "revision": "{28937B4C-67BC-4ED8-A531-E63A6FB99F38},1", + "revision": "{3EA4BE86-EF2A-4AA7-9401-110629923CCF},1", "space": "{E4D8C4CC-508B-04D2-36CE-C5B8C9D2FEC4},1" }, { @@ -68,7 +68,7 @@ "right": "{C84CA5DB-61A8-0F9B-3F91-D6E0C74536F7},12" }, "remote_prefix": true, - "revision": "{E154B8F7-C84E-4AED-B436-D610448E37F1},1", + "revision": "{B1FFABB3-16FC-4B1A-89BD-2A813F383CBD},1", "space": "{7A363D4C-73C2-0ABE-0931-E6F62A90B95E},1" }, { @@ -80,7 +80,7 @@ "right": "{DC240C63-FC8E-0267-0AFD-A53062C25702},12" }, "remote_prefix": true, - "revision": "{01D54762-D53E-4DF2-AD44-7789FAE785CE},1", + "revision": "{CC45AF8B-4B50-413D-B45D-368304E4A105},1", "space": "{3CC2C4DC-651A-07C9-2F7B-375C6663F3CA},1" }, { @@ -92,7 +92,7 @@ "right": "{28F3F5EC-E687-02CA-2CFD-E73A184B875F},12" }, "remote_prefix": true, - "revision": "{BE53841B-A5D6-447A-B1F3-C1E2D11EBBCE},1", + "revision": "{6739FA8A-A364-47D3-9E4C-06F652AEB344},1", "space": "{942EF5E4-FFD1-0FE4-23D2-7429899577BD},1" }, { @@ -104,7 +104,7 @@ "right": "{DD3FA0E7-15A6-01C4-1B77-F85F779BCBC8},12" }, "remote_prefix": true, - "revision": "{53CAB283-B0D5-4D3A-B325-9FD8B214FE21},1", + "revision": "{64D8773A-C74A-44B4-A5CD-B9F3437A589E},1", "space": "{A4AE40FF-DD80-0003-2856-17D8295C1B91},1" }, { @@ -116,7 +116,7 @@ "right": "{1480427A-E9ED-04EC-0409-0653AE11FF78},12" }, "remote_prefix": true, - "revision": "{BC2C9E0D-BA56-48ED-8510-CFBF7FCBDEED},1", + "revision": "{1AA0429E-38E9-4394-9052-4206CF62E438},1", "space": "{739DB38B-4239-0A7C-2652-4E525D219638},1" }, { @@ -128,7 +128,7 @@ "right": "{1E353497-5C26-0459-3C0C-0E8D29ED8C5A},12" }, "remote_prefix": true, - "revision": "{392FD304-233C-4A9C-A90E-16EA8F916073},1", + "revision": "{0E2E842D-E24A-44FA-A912-C3FD5335F9ED},1", "space": "{4432E3EC-5E5F-0A04-2108-E9A2C17BDBEC},1" }, { @@ -140,7 +140,7 @@ "right": "{C1568E82-003F-016B-041A-CA304E1A5138},12" }, "remote_prefix": true, - "revision": "{D3D41323-E06E-4253-BAA5-B69A3AAA40E5},1", + "revision": "{FA703CCC-F9E3-4EAB-9DB4-57CBEA6D0DB7},1", "space": "{D8E15673-A45E-0914-291A-7767C3222F19},1" } ] \ No newline at end of file diff --git a/corpus/paragraph-edit/offline/joins/native/commands.jsonl b/corpus/paragraph-edit/offline/joins/native/commands.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..5d6916e1bf2572b6c7dba1439c39222e602f680a --- /dev/null +++ b/corpus/paragraph-edit/offline/joins/native/commands.jsonl @@ -0,0 +1,3 @@ +{"command": "powershell -NoProfile -Command \"Expand-Archive -LiteralPath C:\\one-tests\\transfer.zip -DestinationPath C:\\one-tests\\runs\\capture\\notebook\"", "exit": 0, "stdout": "", "stderr": "", "error": null} +{"command": "powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -File C:\\one-tests\\read-current.ps1 -Root C:\\one-tests\\runs\\capture -CloneHost ONE-M6-DA41E6F9 -ExpectedPages 14", "exit": 0, "stdout": "Read 1 sections and 14 pages.\r\n", "stderr": "", "error": null} +{"command": "powershell -NoProfile -Command \"Compress-Archive -Force -Path C:\\one-tests\\runs\\capture\\* -DestinationPath C:\\one-tests\\captured.zip\"", "exit": 0, "stdout": "", "stderr": "", "error": null} diff --git a/corpus/paragraph-edit/offline/joins/native/machine.json b/corpus/paragraph-edit/offline/joins/native/machine.json new file mode 100644 index 0000000000000000000000000000000000000000..c35b9a737d00ad9db99ab41a180f86f224348e3d --- /dev/null +++ b/corpus/paragraph-edit/offline/joins/native/machine.json @@ -0,0 +1 @@ +{"name": "m6-da41e6f9", "hostname": "ONE-M6-DA41E6F9"} diff --git a/corpus/paragraph-edit/offline/joins/native/notebook/Open Notebook.onetoc2 b/corpus/paragraph-edit/offline/joins/native/notebook/Open Notebook.onetoc2 index dbc25757edc4679de12642bd8cb897bfff94488f..59ec4e9b7e9927aca108c69b192405587dbcca82 100644 Binary files a/corpus/paragraph-edit/offline/joins/native/notebook/Open Notebook.onetoc2 and b/corpus/paragraph-edit/offline/joins/native/notebook/Open Notebook.onetoc2 differ diff --git a/corpus/paragraph-edit/offline/joins/native/notebook/synthetic.one b/corpus/paragraph-edit/offline/joins/native/notebook/synthetic.one index 58dbfc67d9a1df59104476713767fd5062c96b2f..278d6b738b70284baa73778cee1caa75e2ddc2d9 100644 Binary files a/corpus/paragraph-edit/offline/joins/native/notebook/synthetic.one and b/corpus/paragraph-edit/offline/joins/native/notebook/synthetic.one differ diff --git a/corpus/paragraph-edit/offline/joins/native/read/environment.json b/corpus/paragraph-edit/offline/joins/native/read/environment.json index 552ef9a6189225c2022dccd1e57702c7939ff4da..d52ab315b60cf6e158ce347705ca1ca67bfdaf68 100644 --- a/corpus/paragraph-edit/offline/joins/native/read/environment.json +++ b/corpus/paragraph-edit/offline/joins/native/read/environment.json @@ -1,7 +1,7 @@ { "powershell": "5.1.14409.1005", "schema": "xs2010", - "hostname": "ONE-M6-37FF299E", + "hostname": "ONE-M6-DA41E6F9", "cold": true, "onenote": "14.0.4763.1000" } diff --git a/corpus/paragraph-edit/offline/joins/native/read/hierarchy.xml b/corpus/paragraph-edit/offline/joins/native/read/hierarchy.xml index 9a5218400d4c87069f2b31b2c580618a7d756a3d..e217dd01a9634e6e51fdd10874aefaac0b678bff 100644 --- a/corpus/paragraph-edit/offline/joins/native/read/hierarchy.xml +++ b/corpus/paragraph-edit/offline/joins/native/read/hierarchy.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/paragraph-edit/offline/joins/native/read/page-000.xml b/corpus/paragraph-edit/offline/joins/native/read/page-000.xml index 9201082b94066f46a988d536c2ef7494840dfbf2..78e95f3219e0cc256757aebddbabd429779dcc48 100644 --- a/corpus/paragraph-edit/offline/joins/native/read/page-000.xml +++ b/corpus/paragraph-edit/offline/joins/native/read/page-000.xml @@ -1,5 +1,4 @@  -☂Bold italic 🦀 é tail]]> +☂Bold italic 🦀 é tail]]> diff --git a/corpus/paragraph-edit/offline/joins/native/read/page-001.xml b/corpus/paragraph-edit/offline/joins/native/read/page-001.xml index 62fe84b91cb277cec1462d1a02afd2446f6dee21..fb88b1168d684e4a324fcbc4777f6c28f88a8c6a 100644 --- a/corpus/paragraph-edit/offline/joins/native/read/page-001.xml +++ b/corpus/paragraph-edit/offline/joins/native/read/page-001.xml @@ -1,3 +1,5 @@  - -soft break]]> +☂Bold italic 🦀 é tail]]> diff --git a/corpus/paragraph-edit/offline/joins/native/read/page-002.xml b/corpus/paragraph-edit/offline/joins/native/read/page-002.xml index bf17bb70560f2566974524307321791177e331a1..a0ed9129161fc0c25d549bed24ab9954c93a194d 100644 --- a/corpus/paragraph-edit/offline/joins/native/read/page-002.xml +++ b/corpus/paragraph-edit/offline/joins/native/read/page-002.xml @@ -1,2 +1,5 @@  - +☂Bold italic 🦀 é tail]]> diff --git a/corpus/paragraph-edit/offline/joins/native/read/page-003.xml b/corpus/paragraph-edit/offline/joins/native/read/page-003.xml index adec3d788188349daf59a08d4d872658c04ef724..a990e699c33c933588e1ad2bdba704aebe95ae78 100644 --- a/corpus/paragraph-edit/offline/joins/native/read/page-003.xml +++ b/corpus/paragraph-edit/offline/joins/native/read/page-003.xml @@ -1,5 +1,5 @@  -☂Bold italic 🦀 é tail]]> +style='color:#123456' lang=x-none>tail]]> diff --git a/corpus/paragraph-edit/offline/joins/native/read/page-004.xml b/corpus/paragraph-edit/offline/joins/native/read/page-004.xml index fe7660933a9e562a29e298825fb22266375d80c8..0bce9f7388e5dc06ea1ce9931063c11e4052ff86 100644 --- a/corpus/paragraph-edit/offline/joins/native/read/page-004.xml +++ b/corpus/paragraph-edit/offline/joins/native/read/page-004.xml @@ -1,5 +1,3 @@  -☂Bold italic 🦀 é tail]]> + +soft break]]> diff --git a/corpus/paragraph-edit/offline/joins/native/read/page-005.xml b/corpus/paragraph-edit/offline/joins/native/read/page-005.xml index 4227be5eb03a241bf6ce0dfe0fbb1ece9965dade..7a74cc2b4d6e80a9b4ac6340aff82d173922cc1d 100644 --- a/corpus/paragraph-edit/offline/joins/native/read/page-005.xml +++ b/corpus/paragraph-edit/offline/joins/native/read/page-005.xml @@ -1,6 +1,5 @@  -☂Bold italic 🦀 é tail]]> +style='color:#123456' lang=x-none>tail]]> diff --git a/corpus/paragraph-edit/offline/joins/native/read/page-006.xml b/corpus/paragraph-edit/offline/joins/native/read/page-006.xml index 167287870795f4b510eebf42241cafb673ad0940..189d2238572ec195d87d6b71858fadf14ad37120 100644 --- a/corpus/paragraph-edit/offline/joins/native/read/page-006.xml +++ b/corpus/paragraph-edit/offline/joins/native/read/page-006.xml @@ -1,5 +1,2 @@  -☂Bold italic 🦀 é tail]]> + diff --git a/corpus/paragraph-edit/offline/joins/native/read/page-007.xml b/corpus/paragraph-edit/offline/joins/native/read/page-007.xml index 402252d7c06456b9a4f6d4461f03bcbd71640661..c79ceef1d7a7127453cf5e173465933f41a7e637 100644 --- a/corpus/paragraph-edit/offline/joins/native/read/page-007.xml +++ b/corpus/paragraph-edit/offline/joins/native/read/page-007.xml @@ -1,5 +1,5 @@  -☂Bold italic 🦀 é tail]]> +style='color:#123456' lang=x-none>tail]]> diff --git a/corpus/paragraph-edit/offline/joins/native/read/page-008.xml b/corpus/paragraph-edit/offline/joins/native/read/page-008.xml index 552b927b47f79cfc1a3d1cd2e2b46c2c79adcff7..cf3bb536206ff2da13af6633f9ce1380ab6eb289 100644 --- a/corpus/paragraph-edit/offline/joins/native/read/page-008.xml +++ b/corpus/paragraph-edit/offline/joins/native/read/page-008.xml @@ -1,20 +1,5 @@  -Bold 🦀 italic é color 東京
-End
]]>
Fictitious: café, 東京, مرحبا]]>
+☂Bold italic 🦀 é tail]]> diff --git a/corpus/paragraph-edit/offline/joins/native/read/page-009.xml b/corpus/paragraph-edit/offline/joins/native/read/page-009.xml index 4301ba0550eaa621005b78bc9e7aeba3f76a2f6e..260a6362f229d99fe275d456106ad3d60a8adb70 100644 --- a/corpus/paragraph-edit/offline/joins/native/read/page-009.xml +++ b/corpus/paragraph-edit/offline/joins/native/read/page-009.xml @@ -1,5 +1,3 @@  -☂Bold italic 🦀 é tail]]> +Link label tail]]> diff --git a/corpus/paragraph-edit/offline/joins/native/read/page-010.xml b/corpus/paragraph-edit/offline/joins/native/read/page-010.xml index dae5fdb3cbcd6aaa85cd91b2ab029238544058b3..c1663401df7a3a41fcb334d5bc043b00fd2651fb 100644 --- a/corpus/paragraph-edit/offline/joins/native/read/page-010.xml +++ b/corpus/paragraph-edit/offline/joins/native/read/page-010.xml @@ -1,3 +1,5 @@  -Link label tail]]> +☂Bold italic 🦀 é tail]]> diff --git a/corpus/paragraph-edit/offline/joins/native/read/page-011.xml b/corpus/paragraph-edit/offline/joins/native/read/page-011.xml index b31bc7ec4baddcf2e98da0146a56658a8ad390f8..565c9411ac198a987f354397167b19311ae21807 100644 --- a/corpus/paragraph-edit/offline/joins/native/read/page-011.xml +++ b/corpus/paragraph-edit/offline/joins/native/read/page-011.xml @@ -1,5 +1,4 @@  -☂Bold italic 🦀 é tail]]> +☂Bold italic 🦀 é tail]]> diff --git a/corpus/paragraph-edit/offline/joins/native/read/page-012.xml b/corpus/paragraph-edit/offline/joins/native/read/page-012.xml index 9fcb04f0bd3028c095bfaaab0c8cbf2add4e8c6c..afb58a8062f9df825bc3b19712b23eb437599156 100644 --- a/corpus/paragraph-edit/offline/joins/native/read/page-012.xml +++ b/corpus/paragraph-edit/offline/joins/native/read/page-012.xml @@ -1,5 +1,5 @@  -Bold italic 🦀 é tail]]> +style='color:#123456' lang=x-none>tail]]> diff --git a/corpus/paragraph-edit/offline/joins/native/read/page-013.xml b/corpus/paragraph-edit/offline/joins/native/read/page-013.xml index 6dd7d0276272223468796769d7447b6b7d25fc04..19ae27bf32dfe0a0daf87a8fc850fc5237891bf2 100644 --- a/corpus/paragraph-edit/offline/joins/native/read/page-013.xml +++ b/corpus/paragraph-edit/offline/joins/native/read/page-013.xml @@ -1,5 +1,20 @@  -☂Bold italic 🦀 é tail]]> +Bold 🦀 italic é color 東京
+End
]]>
Fictitious: café, 東京, مرحبا]]>
diff --git a/corpus/paragraph-edit/offline/joins/native/read/payloads.json b/corpus/paragraph-edit/offline/joins/native/read/payloads.json deleted file mode 120000 index 787b4bae85038cda922f8befac6c8ed361fa8035..0000000000000000000000000000000000000000 --- a/corpus/paragraph-edit/offline/joins/native/read/payloads.json +++ /dev/null @@ -1 +0,0 @@ -../../../../before/read/payloads.json \ No newline at end of file diff --git a/corpus/paragraph-edit/offline/joins/native/read/payloads.json b/corpus/paragraph-edit/offline/joins/native/read/payloads.json new file mode 100644 index 0000000000000000000000000000000000000000..1ce91a413d6fff4d58765187b76756f0e97ae843 --- /dev/null +++ b/corpus/paragraph-edit/offline/joins/native/read/payloads.json @@ -0,0 +1,3 @@ +[ + +] \ No newline at end of file diff --git a/corpus/paragraph-edit/offline/joins/native/run.json b/corpus/paragraph-edit/offline/joins/native/run.json index d6d739820dca141e877c521937893a9db95b9010..d26cc27ccaa75ddc7c18e46302cf1f5f5d5df763 100644 --- a/corpus/paragraph-edit/offline/joins/native/run.json +++ b/corpus/paragraph-edit/offline/joins/native/run.json @@ -1,5 +1,5 @@ { - "notebook": "/Users/clo/dev/one/evidence/m10/offline-paragraph-native-01/joins/candidate", + "notebook": "/private/tmp/m33/offline-paragraph/joins/candidate", "expected_pages": 14, "author": null, "author_timeout_seconds": 600, diff --git a/corpus/paragraph-edit/offline/joins/native/scripts/cold.ps1 b/corpus/paragraph-edit/offline/joins/native/scripts/cold.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..a0b99e7aeb86f4dc10032537800501a52ad65b4f --- /dev/null +++ b/corpus/paragraph-edit/offline/joins/native/scripts/cold.ps1 @@ -0,0 +1,27 @@ +param([Parameter(Mandatory=$true)][string]$Root, [string]$CloneHost = '') +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' +$root = [IO.Path]::GetFullPath($Root).TrimEnd('\') +if ([IO.Path]::GetDirectoryName($root) -ne 'C:\one-tests\runs') { + throw 'Choose a run directly below C:\one-tests\runs.' +} +if (Get-Process ONENOTE -ErrorAction SilentlyContinue) { throw 'Close OneNote before resetting its test cache.' } +$key = 'HKCU:\Software\Microsoft\Office\14.0\OneNote' +if ($CloneHost) { + if ($CloneHost -notmatch '^ONE-[A-Z0-9-]+$' -or [Environment]::MachineName -ne $CloneHost) { + throw 'The disposable clone hostname does not match this machine.' + } + New-Item "$key\Options\Paths" -Force | Out-Null + New-ItemProperty "$key\Options\Paths" -Name UnfiledNotesSection -PropertyType ExpandString -Value 'C:\one-tests\Loose.one' -Force | Out-Null +} elseif ((Get-ItemProperty "$key\Options\Paths").UnfiledNotesSection -ne 'C:\one-tests\Loose.one' -or + -not (Test-Path 'C:\one-tests\profile-original-cache')) { + throw 'Park the personal OneNote profile before resetting the test cache.' +} +$cache = Join-Path $env:LOCALAPPDATA 'Microsoft\OneNote\14.0' +$parked = Join-Path 'C:\one-tests\caches' ([IO.Path]::GetFileName($root)) +if (Test-Path $parked) { throw 'Choose a new run; its parked cache already exists.' } +New-Item -ItemType Directory -Path 'C:\one-tests\caches' -Force | Out-Null +if (Test-Path $cache) { Move-Item -LiteralPath $cache -Destination $parked } +if (Test-Path "$key\OpenNotebooks") { Remove-Item "$key\OpenNotebooks" -Recurse } +New-Item "$key\OpenNotebooks" | Out-Null +New-ItemProperty "$key\OpenNotebooks" -Name '1' -PropertyType String -Value "$root\notebook" | Out-Null diff --git a/corpus/paragraph-edit/offline/joins/native/scripts/read.ps1 b/corpus/paragraph-edit/offline/joins/native/scripts/read.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..476094ab1e0c47077988a6461db2080cf208642b --- /dev/null +++ b/corpus/paragraph-edit/offline/joins/native/scripts/read.ps1 @@ -0,0 +1,142 @@ +param( + [Parameter(Mandatory=$true)][string]$Root, + [int]$ExpectedPages = -1, + [switch]$UseCurrentCache, + [switch]$Pdf, + [switch]$KeepOpen, + [string]$CloneHost = '' +) +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' +$root = [IO.Path]::GetFullPath($Root).TrimEnd('\') +if ([IO.Path]::GetDirectoryName($root) -ne 'C:\one-tests\runs') { + throw 'Choose a run directly below C:\one-tests\runs.' +} +$notebook = Join-Path $root 'notebook' +$output = Join-Path $root 'read' +if (Test-Path $output) { throw 'Choose a new read destination.' } +if ($UseCurrentCache) { + if ((Get-ItemProperty 'HKCU:\Software\Microsoft\Office\14.0\OneNote\Options\Paths').UnfiledNotesSection -ne 'C:\one-tests\Loose.one') { + throw 'Park the personal OneNote profile before reading test notebooks.' + } +} else { + & "$PSScriptRoot\cold-current.ps1" -Root $root -CloneHost $CloneHost +} +New-Item -ItemType Directory -Path $output | Out-Null +$app = New-Object -ComObject OneNote.Application +$notebookId = '' +$failure = $null +try { + $app.OpenHierarchy($notebook, '', [ref]$notebookId, 0) + $process = Get-Process ONENOTE + @{ hostname = [Environment]::MachineName; onenote = $process.MainModule.FileVersionInfo.FileVersion; + powershell = $PSVersionTable.PSVersion.ToString(); schema = 'xs2010'; cold = (-not $UseCurrentCache.IsPresent) } | + ConvertTo-Json | Set-Content (Join-Path $output 'environment.json') -Encoding UTF8 + $sections = @() + foreach ($file in @(Get-ChildItem $notebook -Recurse | Where-Object { $_.Extension -eq '.one' })) { + $id = '' + $app.OpenHierarchy($file.FullName, '', [ref]$id, 0) + $sections += $id + } + $deadline = [DateTime]::UtcNow.AddSeconds(300) + $previous = '' + $lastChange = '' + $stableSince = [DateTime]::UtcNow + $settled = $false + do { + $pages = @{} + foreach ($section in $sections) { + $hierarchy = '' + $app.GetHierarchy($section, 4, [ref]$hierarchy, 1) + [xml]$xml = $hierarchy + foreach ($node in $xml.SelectNodes('//*[@path]')) { + if (-not $node.GetAttribute('path').StartsWith("$notebook\", [StringComparison]::OrdinalIgnoreCase)) { + throw 'OneNote opened a section outside the copied notebook.' + } + } + foreach ($node in $xml.SelectNodes('//*[local-name()="Page"]')) { + $id = $node.GetAttribute('ID') + $content = '' + $app.GetPageContent($id, [ref]$content, 1, 1) + $pages[$id] = $content + } + } + $signature = [String]::Join('|', @($pages.Keys | Sort-Object | ForEach-Object { $_ + $pages[$_] })) + if ($signature -ne $previous) { + $lastChange = $previous + $previous = $signature + $stableSince = [DateTime]::UtcNow + } + if ((($ExpectedPages -ge 0 -and $pages.Count -eq $ExpectedPages) -or + ($ExpectedPages -lt 0 -and $pages.Count -gt 0)) -and + ([DateTime]::UtcNow - $stableSince).TotalSeconds -ge 2) { $settled = $true; break } + Start-Sleep -Milliseconds 250 + } while ([DateTime]::UtcNow -lt $deadline) + if (-not $settled -or ($ExpectedPages -ge 0 -and $pages.Count -ne $ExpectedPages) -or ($ExpectedPages -lt 0 -and $pages.Count -eq 0)) { + [IO.File]::WriteAllText((Join-Path $output 'previous-signature.txt'), $lastChange, [Text.Encoding]::UTF8) + $index = 0 + foreach ($id in @($pages.Keys | Sort-Object)) { + [IO.File]::WriteAllText((Join-Path $output ('unsettled-{0:d3}.xml' -f $index)), $pages[$id], [Text.Encoding]::UTF8) + $index++ + } + $hierarchy = '' + $app.GetHierarchy($notebookId, 4, [ref]$hierarchy, 1) + [IO.File]::WriteAllText((Join-Path $output 'unsettled-hierarchy.xml'), $hierarchy, [Text.Encoding]::UTF8) + throw "Expected $ExpectedPages stable pages; OneNote returned $($pages.Count), settled=$settled." + } + $index = 0 + $payloads = @() + foreach ($id in @($pages.Keys | Sort-Object)) { + [IO.File]::WriteAllText((Join-Path $output ('page-{0:d3}.xml' -f $index)), $pages[$id], [Text.Encoding]::UTF8) + if ($Pdf) { + $pdfPath = Join-Path $output ('page-{0:d3}.pdf' -f $index) + $app.NavigateTo($id, '', $false) + $app.Publish($id, $pdfPath, 3, '') + if (-not (Test-Path $pdfPath) -or (Get-Item $pdfPath).Length -eq 0) { throw 'OneNote did not publish the page PDF.' } + } + [xml]$page = $pages[$id] + foreach ($file in $page.SelectNodes('//*[local-name()="InsertedFile" or local-name()="MediaFile"]')) { + $bytes = [IO.File]::ReadAllBytes($file.GetAttribute('pathCache')) + $hash = [BitConverter]::ToString([Security.Cryptography.SHA256]::Create().ComputeHash($bytes)).Replace('-', '').ToLowerInvariant() + [IO.File]::WriteAllBytes((Join-Path $output ($hash + '.attachment')), $bytes) + $payloads += @{ page = $id; object = $file.ParentNode.GetAttribute('objectID'); + kind = $file.LocalName; name = $file.GetAttribute('preferredName'); + sha256 = $hash; bytes = $bytes.Length } + } + $index++ + } + [IO.File]::WriteAllText((Join-Path $output 'payloads.json'), (ConvertTo-Json -InputObject $payloads -Depth 4), [Text.Encoding]::UTF8) + $all = '' + $app.GetHierarchy($notebookId, 4, [ref]$all, 1) + [xml]$finalTree = $all + $finalIds = @($finalTree.SelectNodes('//*[local-name()="Page"]') | ForEach-Object { $_.GetAttribute('ID') } | Sort-Object -Unique) + if ($finalIds.Count -ne $pages.Count -or @($finalIds | Where-Object { -not $pages.ContainsKey($_) }).Count -ne 0) { + throw 'The notebook hierarchy changed while collecting page evidence; repeat the cold read.' + } + [IO.File]::WriteAllText((Join-Path $output 'hierarchy.xml'), $all, [Text.Encoding]::UTF8) + Write-Output "Read $($sections.Count) sections and $($pages.Count) pages." +} catch { + $failure = $_ + [IO.File]::WriteAllText((Join-Path $output 'failure.txt'), ($_ | Out-String), [Text.Encoding]::UTF8) + throw +} finally { + try { + try { + if ($notebookId -and $CloneHost) { $app.SyncHierarchy($notebookId) } + if ($notebookId -and -not $KeepOpen -and (-not $UseCurrentCache -or $CloneHost)) { + $app.CloseNotebook($notebookId, $false) + } + } catch { + if ($null -eq $failure) { throw } + [IO.File]::WriteAllText((Join-Path $output 'cleanup-failure.txt'), ($_ | Out-String), [Text.Encoding]::UTF8) + } + } finally { + [void][Runtime.InteropServices.Marshal]::FinalReleaseComObject($app) + } + $app = $null + [GC]::Collect() + [GC]::WaitForPendingFinalizers() + if (-not $UseCurrentCache -and -not $CloneHost) { + Get-Process ONENOTE -ErrorAction SilentlyContinue | Wait-Process -Timeout 10 + } +} diff --git a/corpus/paragraph-edit/offline/joins/native/source.json b/corpus/paragraph-edit/offline/joins/native/source.json index 699cc709a58444d4fb5d3cdaaf8e4edece01bf0c..d41fbf431d1fd6da34602a47e8a4aaccedc09d70 100644 --- a/corpus/paragraph-edit/offline/joins/native/source.json +++ b/corpus/paragraph-edit/offline/joins/native/source.json @@ -1,8 +1,8 @@ [ { "path": "synthetic.one", - "bytes": 150648, - "sha256": "2fd036cddb33de5e42f66cb6a6b7647cbfeac374a4055e9afc15bf3b0d6ec1b2", - "mtime_ns": 1788863184056850411 + "bytes": 152216, + "sha256": "976018f02ca0df2a273659c9d00820c9529578049282470ad89734c0dcf5219a", + "mtime_ns": 1789121620530249300 } ] diff --git a/corpus/paragraph-edit/offline/joins/native/teardown.json b/corpus/paragraph-edit/offline/joins/native/teardown.json deleted file mode 120000 index 47a1192a30ea7da90676d631bb9a2687d829b43e..0000000000000000000000000000000000000000 --- a/corpus/paragraph-edit/offline/joins/native/teardown.json +++ /dev/null @@ -1 +0,0 @@ -../../../joined/teardown.json \ No newline at end of file diff --git a/corpus/paragraph-edit/offline/joins/native/teardown.json b/corpus/paragraph-edit/offline/joins/native/teardown.json new file mode 100644 index 0000000000000000000000000000000000000000..05a47793de40f322e745c4c4183727e3590ecf70 --- /dev/null +++ b/corpus/paragraph-edit/offline/joins/native/teardown.json @@ -0,0 +1 @@ +{"absent": true} diff --git a/corpus/paragraph-edit/offline/splits/candidate/synthetic.one b/corpus/paragraph-edit/offline/splits/candidate/synthetic.one index 66148d4f93647580dd893d2c5fcdac50745a26bb..36022356cf1310d7b38d8adae9b7a0eaa6f11c00 100644 Binary files a/corpus/paragraph-edit/offline/splits/candidate/synthetic.one and b/corpus/paragraph-edit/offline/splits/candidate/synthetic.one differ diff --git a/corpus/paragraph-edit/offline/splits/manifest.json b/corpus/paragraph-edit/offline/splits/manifest.json index 262dff2900ded1a50e82606439626bb8b6212703..6ea2bb217c86b2c885e47e9423f5a29ae7899541 100644 --- a/corpus/paragraph-edit/offline/splits/manifest.json +++ b/corpus/paragraph-edit/offline/splits/manifest.json @@ -27,7 +27,7 @@ "text": "{DFE950EF-6BEB-0F5B-2403-7B74F1AE5002},44" }, "remote_prefix": true, - "revision": "{BF0EE2EB-19D1-47B7-B28D-A9ABD19EBAAE},1", + "revision": "{78BFFA33-F39C-4D01-A233-B095DDCB40A9},1", "space": "{FE224563-B517-023E-0D75-9904B1952A26},1" }, { @@ -58,7 +58,7 @@ "text": "{5FB484E2-1E3E-0A9D-1989-271A3EBBEC42},44" }, "remote_prefix": true, - "revision": "{167F0C99-70D5-4B0C-8339-4A5D4FA8D101},1", + "revision": "{56C648B5-7ABD-4BF0-8BF1-D3EE0B42E2EA},1", "space": "{DED48A05-0DB1-0712-086D-09237C982341},1" }, { @@ -89,7 +89,7 @@ "text": "{012ED94B-43B3-079A-3050-B1CBE25C1C09},44" }, "remote_prefix": false, - "revision": "{F45BB0FF-3E33-4039-B5DE-C436C126C52E},1", + "revision": "{CD5794A9-1908-4925-9825-5F65D135A838},1", "space": "{7919E933-0809-00D8-1754-A21684215860},1" }, { @@ -120,7 +120,7 @@ "text": "{DAF723A3-C2A3-0798-2EAB-34613166A794},44" }, "remote_prefix": true, - "revision": "{B408F227-A7DE-4350-8068-D91005E0B8E5},1", + "revision": "{589EE5DA-F344-4995-9CFD-709A0B531774},1", "space": "{927F2809-173C-036E-37B6-60A6568F7723},1" }, { @@ -151,7 +151,7 @@ "text": "{0B467F31-D287-08CD-09F4-A6FBB2F5418F},45" }, "remote_prefix": false, - "revision": "{4F8EB252-1808-40AA-9B37-DB3DE1C5C3F2},1", + "revision": "{3A8B2D38-4664-4CD8-A960-39CC16683FE0},1", "space": "{E4D8C4CC-508B-04D2-36CE-C5B8C9D2FEC4},1" }, { @@ -182,7 +182,7 @@ "text": "{3860EA13-D444-0598-35D6-CF96769C6A21},44" }, "remote_prefix": true, - "revision": "{A291D6A6-08A8-4E06-BF29-0479851E9E12},1", + "revision": "{E3C059AE-8C62-4859-A313-1387284EC436},1", "space": "{7A363D4C-73C2-0ABE-0931-E6F62A90B95E},1" }, { @@ -213,7 +213,7 @@ "text": "{B587CBC6-0BCC-0A23-16F6-E1B0B3C5D061},49" }, "remote_prefix": true, - "revision": "{FFE1F804-FA27-4EFD-B53C-9E1D07384DA6},1", + "revision": "{21DE1101-F7D5-4B21-A1E5-365611F2E002},1", "space": "{3CC2C4DC-651A-07C9-2F7B-375C6663F3CA},1" }, { @@ -244,7 +244,7 @@ "text": "{8C65E427-477C-02ED-1807-2F10E277019D},44" }, "remote_prefix": true, - "revision": "{822FBEAD-035E-47B5-9ED6-CDAE96AA5837},1", + "revision": "{5F644A5F-F718-46D6-AA1A-F5ECA91A8547},1", "space": "{942EF5E4-FFD1-0FE4-23D2-7429899577BD},1" }, { @@ -275,7 +275,7 @@ "text": "{D4ABBE4F-2165-0122-1F9F-ACE3FE92C703},44" }, "remote_prefix": true, - "revision": "{F5ABC207-F9C7-45A3-B213-AA675126A592},1", + "revision": "{B1AD2C82-008E-4DC4-BDA9-353080F82E97},1", "space": "{A4AE40FF-DD80-0003-2856-17D8295C1B91},1" }, { @@ -306,7 +306,7 @@ "text": "{37AA5877-2980-0227-169F-8B1E8EE0795A},44" }, "remote_prefix": true, - "revision": "{8021DAB3-4163-49C4-A7A1-898ACCAB3981},1", + "revision": "{38DCA61F-4B34-4130-B805-BA2419446483},1", "space": "{739DB38B-4239-0A7C-2652-4E525D219638},1" }, { @@ -337,7 +337,7 @@ "text": "{F0832BC9-1578-0A96-08AF-99344644FFB8},50" }, "remote_prefix": true, - "revision": "{0E8285DD-840A-4C8E-BFDB-CA3589436ECD},1", + "revision": "{E938BF0E-529A-4DDB-BCD4-92830E6054E5},1", "space": "{4432E3EC-5E5F-0A04-2108-E9A2C17BDBEC},1" }, { @@ -368,7 +368,7 @@ "text": "{88189BA1-2F19-0282-05ED-A0B83153F143},44" }, "remote_prefix": true, - "revision": "{89D96DD2-2D50-433E-B54B-50018E3C2108},1", + "revision": "{2B1EEBFC-1BAF-4062-B5AC-F345BE47556A},1", "space": "{D8E15673-A45E-0914-291A-7767C3222F19},1" } ] \ No newline at end of file diff --git a/corpus/paragraph-edit/offline/splits/native/commands.jsonl b/corpus/paragraph-edit/offline/splits/native/commands.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..2b79c4dcf2fc51fe74f386d00de0d5aaae220ab9 --- /dev/null +++ b/corpus/paragraph-edit/offline/splits/native/commands.jsonl @@ -0,0 +1,3 @@ +{"command": "powershell -NoProfile -Command \"Expand-Archive -LiteralPath C:\\one-tests\\transfer.zip -DestinationPath C:\\one-tests\\runs\\capture\\notebook\"", "exit": 0, "stdout": "", "stderr": "", "error": null} +{"command": "powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -File C:\\one-tests\\read-current.ps1 -Root C:\\one-tests\\runs\\capture -CloneHost ONE-M6-44FE2535 -ExpectedPages 14", "exit": 0, "stdout": "Read 1 sections and 14 pages.\r\n", "stderr": "", "error": null} +{"command": "powershell -NoProfile -Command \"Compress-Archive -Force -Path C:\\one-tests\\runs\\capture\\* -DestinationPath C:\\one-tests\\captured.zip\"", "exit": 0, "stdout": "", "stderr": "", "error": null} diff --git a/corpus/paragraph-edit/offline/splits/native/machine.json b/corpus/paragraph-edit/offline/splits/native/machine.json new file mode 100644 index 0000000000000000000000000000000000000000..080de4ebe5f47bba46c5fec3cef4ae5725a96868 --- /dev/null +++ b/corpus/paragraph-edit/offline/splits/native/machine.json @@ -0,0 +1 @@ +{"name": "m6-44fe2535", "hostname": "ONE-M6-44FE2535"} diff --git a/corpus/paragraph-edit/offline/splits/native/notebook/Open Notebook.onetoc2 b/corpus/paragraph-edit/offline/splits/native/notebook/Open Notebook.onetoc2 index e6462b78708e6fcff91d8fb9b4059776e8c1e932..8c552efcf552552f567c7c103140e07d4b29b2ed 100644 Binary files a/corpus/paragraph-edit/offline/splits/native/notebook/Open Notebook.onetoc2 and b/corpus/paragraph-edit/offline/splits/native/notebook/Open Notebook.onetoc2 differ diff --git a/corpus/paragraph-edit/offline/splits/native/notebook/synthetic.one b/corpus/paragraph-edit/offline/splits/native/notebook/synthetic.one index 82323b80ecdf4626a8e3d11bda99eb0013358efd..3abda985dd06d1e0f63afd72246b4edefc548abd 100644 Binary files a/corpus/paragraph-edit/offline/splits/native/notebook/synthetic.one and b/corpus/paragraph-edit/offline/splits/native/notebook/synthetic.one differ diff --git a/corpus/paragraph-edit/offline/splits/native/read/environment.json b/corpus/paragraph-edit/offline/splits/native/read/environment.json index f25cbe4815b561c24a9a6bdd4809e070238ab820..a0bf133698c2cdde961437ebcf45552a2e68f7e3 100644 --- a/corpus/paragraph-edit/offline/splits/native/read/environment.json +++ b/corpus/paragraph-edit/offline/splits/native/read/environment.json @@ -1,7 +1,7 @@ { "powershell": "5.1.14409.1005", "schema": "xs2010", - "hostname": "ONE-M6-97095A74", + "hostname": "ONE-M6-44FE2535", "cold": true, "onenote": "14.0.4763.1000" } diff --git a/corpus/paragraph-edit/offline/splits/native/read/hierarchy.xml b/corpus/paragraph-edit/offline/splits/native/read/hierarchy.xml index 569b27bb107f308aa2724d4e3d5a3f408803df0a..34cfcc93327e616d5aad22e2a32dd0228c716efe 100644 --- a/corpus/paragraph-edit/offline/splits/native/read/hierarchy.xml +++ b/corpus/paragraph-edit/offline/splits/native/read/hierarchy.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/paragraph-edit/offline/splits/native/read/page-000.xml b/corpus/paragraph-edit/offline/splits/native/read/page-000.xml index 552bdb1a543eab002e577f984ca924481b2c0415..b1faec9dab8d7655bc2420fb75f223d8b7c87a42 100644 --- a/corpus/paragraph-edit/offline/splits/native/read/page-000.xml +++ b/corpus/paragraph-edit/offline/splits/native/read/page-000.xml @@ -1,3 +1,6 @@  - -soft break]]> +☂Bo]]>ld italic 🦀 é tail]]> diff --git a/corpus/paragraph-edit/offline/splits/native/read/page-001.xml b/corpus/paragraph-edit/offline/splits/native/read/page-001.xml index d23d6f76d2f1ee76c8e096c59bacda45afb3626b..600ac843b8526ad507a9019d46e68314ed3049d9 100644 --- a/corpus/paragraph-edit/offline/splits/native/read/page-001.xml +++ b/corpus/paragraph-edit/offline/splits/native/read/page-001.xml @@ -1,5 +1,20 @@  -☂Bold]]> italic 🦀 é tail]]> +Bold 🦀 italic é color 東京
+End
]]>
Fictitious: café, 東京, مرحبا]]>
diff --git a/corpus/paragraph-edit/offline/splits/native/read/page-002.xml b/corpus/paragraph-edit/offline/splits/native/read/page-002.xml index 302f68bcfd20c4f470d4442980f39ff29626f744..2d23258654f53181a8228a43f941ac2587898421 100644 --- a/corpus/paragraph-edit/offline/splits/native/read/page-002.xml +++ b/corpus/paragraph-edit/offline/splits/native/read/page-002.xml @@ -1,6 +1,5 @@  -☂Bo]]>ld Bold italic 🦀 é tail]]> +style='color:#123456' lang=x-none>tail]]> diff --git a/corpus/paragraph-edit/offline/splits/native/read/page-003.xml b/corpus/paragraph-edit/offline/splits/native/read/page-003.xml index 8a6966323f4370b6414fa6d324ed432fc6dee0fd..7ffecd56d6d24e50bdbe6ffbbc377e61eb1ef565 100644 --- a/corpus/paragraph-edit/offline/splits/native/read/page-003.xml +++ b/corpus/paragraph-edit/offline/splits/native/read/page-003.xml @@ -1,2 +1,6 @@  - +☂Bo]]>ld italic 🦀 é tail]]> diff --git a/corpus/paragraph-edit/offline/splits/native/read/page-004.xml b/corpus/paragraph-edit/offline/splits/native/read/page-004.xml index 5f29ed91e8c01061ac3d14843d92c35a9d8a5024..f228a5dc3cd66dc24f3b69d421d329fa9a7c266e 100644 --- a/corpus/paragraph-edit/offline/splits/native/read/page-004.xml +++ b/corpus/paragraph-edit/offline/splits/native/read/page-004.xml @@ -1,5 +1,6 @@  -☂Bold ☂Bo]]>ld italic 🦀 é tail]]> +style='color:#123456' lang=x-none>tail]]> diff --git a/corpus/paragraph-edit/offline/splits/native/read/page-005.xml b/corpus/paragraph-edit/offline/splits/native/read/page-005.xml index 47a49619f20d80f0cd3ec8a191e25c3ae776898d..ae68430c85d445e7969cce56a67412658d3db6c4 100644 --- a/corpus/paragraph-edit/offline/splits/native/read/page-005.xml +++ b/corpus/paragraph-edit/offline/splits/native/read/page-005.xml @@ -1,6 +1,3 @@  -☂Bo]]>ld italic 🦀 é tail]]> +Link label tail]]> diff --git a/corpus/paragraph-edit/offline/splits/native/read/page-006.xml b/corpus/paragraph-edit/offline/splits/native/read/page-006.xml index 20a04fd89bdc80ba54ac6d41499b42fa651fa476..75f2a308582fb2e8d8ad2cb629088914935df8b7 100644 --- a/corpus/paragraph-edit/offline/splits/native/read/page-006.xml +++ b/corpus/paragraph-edit/offline/splits/native/read/page-006.xml @@ -1,6 +1,6 @@  -☂Bo]]>☂Bo]]>ld italic 🦀 é tail]]> +style='color:#123456' lang=x-none>tail]]> diff --git a/corpus/paragraph-edit/offline/splits/native/read/page-007.xml b/corpus/paragraph-edit/offline/splits/native/read/page-007.xml index e8e34a6b4409d0ca62fd300775ae8ab05e8e187e..32a35870d50cd31d28ab29626105efb56aa47f06 100644 --- a/corpus/paragraph-edit/offline/splits/native/read/page-007.xml +++ b/corpus/paragraph-edit/offline/splits/native/read/page-007.xml @@ -1,6 +1,6 @@  -☂Bo]]>☂Bo]]>ld italic 🦀 é tail]]> +style='color:#123456' lang=x-none>tail]]> diff --git a/corpus/paragraph-edit/offline/splits/native/read/page-008.xml b/corpus/paragraph-edit/offline/splits/native/read/page-008.xml index c98920929247120cedf4f5d8821acde295b9ddd8..2aa6dc258e62c8c98690f8458fa3bd740b23125e 100644 --- a/corpus/paragraph-edit/offline/splits/native/read/page-008.xml +++ b/corpus/paragraph-edit/offline/splits/native/read/page-008.xml @@ -1,5 +1,6 @@  -Bold ☂Bo]]>ld italic 🦀 é tail]]> +style='color:#123456' lang=x-none>tail]]> diff --git a/corpus/paragraph-edit/offline/splits/native/read/page-009.xml b/corpus/paragraph-edit/offline/splits/native/read/page-009.xml index 239094503552c6db3c0ad713177654e64e916fe3..13ebe8c874fbe8f2bbf36fcec60f6824664d99e5 100644 --- a/corpus/paragraph-edit/offline/splits/native/read/page-009.xml +++ b/corpus/paragraph-edit/offline/splits/native/read/page-009.xml @@ -1,6 +1,5 @@  -☂Bo]]>ld ☂Bold italic 🦀 é tail]]> +style='color:#123456' lang=x-none>tail]]> diff --git a/corpus/paragraph-edit/offline/splits/native/read/page-010.xml b/corpus/paragraph-edit/offline/splits/native/read/page-010.xml index 7589342d47d156ffa1b91da04b0d26bbb452e12a..d0ee05edb7264270e4b961c6d482b30b7103e13a 100644 --- a/corpus/paragraph-edit/offline/splits/native/read/page-010.xml +++ b/corpus/paragraph-edit/offline/splits/native/read/page-010.xml @@ -1,6 +1,2 @@  -☂Bo]]>ld italic 🦀 é tail]]> + diff --git a/corpus/paragraph-edit/offline/splits/native/read/page-011.xml b/corpus/paragraph-edit/offline/splits/native/read/page-011.xml index 44401c90c4c34eed1906e8886f606578698472d7..92b67475fa70156b5bb6bdbe6a315888fe6b9e7e 100644 --- a/corpus/paragraph-edit/offline/splits/native/read/page-011.xml +++ b/corpus/paragraph-edit/offline/splits/native/read/page-011.xml @@ -1,3 +1,6 @@  -Link label tail]]> +☂Bo]]>ld italic 🦀 é tail]]> diff --git a/corpus/paragraph-edit/offline/splits/native/read/page-012.xml b/corpus/paragraph-edit/offline/splits/native/read/page-012.xml index 94b7c097ba40e651efb699b7b83e8f31997e3fbc..43c03390a66282deace641d0f26ff1a2285e243b 100644 --- a/corpus/paragraph-edit/offline/splits/native/read/page-012.xml +++ b/corpus/paragraph-edit/offline/splits/native/read/page-012.xml @@ -1,20 +1,5 @@  -Bold 🦀 italic é color 東京
-End
]]>
Fictitious: café, 東京, مرحبا]]>
+☂Bold]]> italic 🦀 é tail]]> diff --git a/corpus/paragraph-edit/offline/splits/native/read/page-013.xml b/corpus/paragraph-edit/offline/splits/native/read/page-013.xml index b45f6367cbe094cff50050a691df1a253377e0df..5bc237449e4b32a66843869340db2f5e14ac83f2 100644 --- a/corpus/paragraph-edit/offline/splits/native/read/page-013.xml +++ b/corpus/paragraph-edit/offline/splits/native/read/page-013.xml @@ -1,6 +1,3 @@  -☂Bo]]>ld italic 🦀 é tail]]> + +soft break]]> diff --git a/corpus/paragraph-edit/offline/splits/native/read/payloads.json b/corpus/paragraph-edit/offline/splits/native/read/payloads.json deleted file mode 120000 index 787b4bae85038cda922f8befac6c8ed361fa8035..0000000000000000000000000000000000000000 --- a/corpus/paragraph-edit/offline/splits/native/read/payloads.json +++ /dev/null @@ -1 +0,0 @@ -../../../../before/read/payloads.json \ No newline at end of file diff --git a/corpus/paragraph-edit/offline/splits/native/read/payloads.json b/corpus/paragraph-edit/offline/splits/native/read/payloads.json new file mode 100644 index 0000000000000000000000000000000000000000..1ce91a413d6fff4d58765187b76756f0e97ae843 --- /dev/null +++ b/corpus/paragraph-edit/offline/splits/native/read/payloads.json @@ -0,0 +1,3 @@ +[ + +] \ No newline at end of file diff --git a/corpus/paragraph-edit/offline/splits/native/run.json b/corpus/paragraph-edit/offline/splits/native/run.json index b59c126e1d874ea3b45cc19732aef5e66ac457ba..d1e6b48380edf5319f629b2a83725526766b271e 100644 --- a/corpus/paragraph-edit/offline/splits/native/run.json +++ b/corpus/paragraph-edit/offline/splits/native/run.json @@ -1,5 +1,5 @@ { - "notebook": "/Users/clo/dev/one/evidence/m10/offline-paragraph-native-01/splits/candidate", + "notebook": "/private/tmp/m33/offline-paragraph2/splits/candidate", "expected_pages": 14, "author": null, "author_timeout_seconds": 600, diff --git a/corpus/paragraph-edit/offline/splits/native/scripts/cold.ps1 b/corpus/paragraph-edit/offline/splits/native/scripts/cold.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..a0b99e7aeb86f4dc10032537800501a52ad65b4f --- /dev/null +++ b/corpus/paragraph-edit/offline/splits/native/scripts/cold.ps1 @@ -0,0 +1,27 @@ +param([Parameter(Mandatory=$true)][string]$Root, [string]$CloneHost = '') +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' +$root = [IO.Path]::GetFullPath($Root).TrimEnd('\') +if ([IO.Path]::GetDirectoryName($root) -ne 'C:\one-tests\runs') { + throw 'Choose a run directly below C:\one-tests\runs.' +} +if (Get-Process ONENOTE -ErrorAction SilentlyContinue) { throw 'Close OneNote before resetting its test cache.' } +$key = 'HKCU:\Software\Microsoft\Office\14.0\OneNote' +if ($CloneHost) { + if ($CloneHost -notmatch '^ONE-[A-Z0-9-]+$' -or [Environment]::MachineName -ne $CloneHost) { + throw 'The disposable clone hostname does not match this machine.' + } + New-Item "$key\Options\Paths" -Force | Out-Null + New-ItemProperty "$key\Options\Paths" -Name UnfiledNotesSection -PropertyType ExpandString -Value 'C:\one-tests\Loose.one' -Force | Out-Null +} elseif ((Get-ItemProperty "$key\Options\Paths").UnfiledNotesSection -ne 'C:\one-tests\Loose.one' -or + -not (Test-Path 'C:\one-tests\profile-original-cache')) { + throw 'Park the personal OneNote profile before resetting the test cache.' +} +$cache = Join-Path $env:LOCALAPPDATA 'Microsoft\OneNote\14.0' +$parked = Join-Path 'C:\one-tests\caches' ([IO.Path]::GetFileName($root)) +if (Test-Path $parked) { throw 'Choose a new run; its parked cache already exists.' } +New-Item -ItemType Directory -Path 'C:\one-tests\caches' -Force | Out-Null +if (Test-Path $cache) { Move-Item -LiteralPath $cache -Destination $parked } +if (Test-Path "$key\OpenNotebooks") { Remove-Item "$key\OpenNotebooks" -Recurse } +New-Item "$key\OpenNotebooks" | Out-Null +New-ItemProperty "$key\OpenNotebooks" -Name '1' -PropertyType String -Value "$root\notebook" | Out-Null diff --git a/corpus/paragraph-edit/offline/splits/native/scripts/read.ps1 b/corpus/paragraph-edit/offline/splits/native/scripts/read.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..476094ab1e0c47077988a6461db2080cf208642b --- /dev/null +++ b/corpus/paragraph-edit/offline/splits/native/scripts/read.ps1 @@ -0,0 +1,142 @@ +param( + [Parameter(Mandatory=$true)][string]$Root, + [int]$ExpectedPages = -1, + [switch]$UseCurrentCache, + [switch]$Pdf, + [switch]$KeepOpen, + [string]$CloneHost = '' +) +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' +$root = [IO.Path]::GetFullPath($Root).TrimEnd('\') +if ([IO.Path]::GetDirectoryName($root) -ne 'C:\one-tests\runs') { + throw 'Choose a run directly below C:\one-tests\runs.' +} +$notebook = Join-Path $root 'notebook' +$output = Join-Path $root 'read' +if (Test-Path $output) { throw 'Choose a new read destination.' } +if ($UseCurrentCache) { + if ((Get-ItemProperty 'HKCU:\Software\Microsoft\Office\14.0\OneNote\Options\Paths').UnfiledNotesSection -ne 'C:\one-tests\Loose.one') { + throw 'Park the personal OneNote profile before reading test notebooks.' + } +} else { + & "$PSScriptRoot\cold-current.ps1" -Root $root -CloneHost $CloneHost +} +New-Item -ItemType Directory -Path $output | Out-Null +$app = New-Object -ComObject OneNote.Application +$notebookId = '' +$failure = $null +try { + $app.OpenHierarchy($notebook, '', [ref]$notebookId, 0) + $process = Get-Process ONENOTE + @{ hostname = [Environment]::MachineName; onenote = $process.MainModule.FileVersionInfo.FileVersion; + powershell = $PSVersionTable.PSVersion.ToString(); schema = 'xs2010'; cold = (-not $UseCurrentCache.IsPresent) } | + ConvertTo-Json | Set-Content (Join-Path $output 'environment.json') -Encoding UTF8 + $sections = @() + foreach ($file in @(Get-ChildItem $notebook -Recurse | Where-Object { $_.Extension -eq '.one' })) { + $id = '' + $app.OpenHierarchy($file.FullName, '', [ref]$id, 0) + $sections += $id + } + $deadline = [DateTime]::UtcNow.AddSeconds(300) + $previous = '' + $lastChange = '' + $stableSince = [DateTime]::UtcNow + $settled = $false + do { + $pages = @{} + foreach ($section in $sections) { + $hierarchy = '' + $app.GetHierarchy($section, 4, [ref]$hierarchy, 1) + [xml]$xml = $hierarchy + foreach ($node in $xml.SelectNodes('//*[@path]')) { + if (-not $node.GetAttribute('path').StartsWith("$notebook\", [StringComparison]::OrdinalIgnoreCase)) { + throw 'OneNote opened a section outside the copied notebook.' + } + } + foreach ($node in $xml.SelectNodes('//*[local-name()="Page"]')) { + $id = $node.GetAttribute('ID') + $content = '' + $app.GetPageContent($id, [ref]$content, 1, 1) + $pages[$id] = $content + } + } + $signature = [String]::Join('|', @($pages.Keys | Sort-Object | ForEach-Object { $_ + $pages[$_] })) + if ($signature -ne $previous) { + $lastChange = $previous + $previous = $signature + $stableSince = [DateTime]::UtcNow + } + if ((($ExpectedPages -ge 0 -and $pages.Count -eq $ExpectedPages) -or + ($ExpectedPages -lt 0 -and $pages.Count -gt 0)) -and + ([DateTime]::UtcNow - $stableSince).TotalSeconds -ge 2) { $settled = $true; break } + Start-Sleep -Milliseconds 250 + } while ([DateTime]::UtcNow -lt $deadline) + if (-not $settled -or ($ExpectedPages -ge 0 -and $pages.Count -ne $ExpectedPages) -or ($ExpectedPages -lt 0 -and $pages.Count -eq 0)) { + [IO.File]::WriteAllText((Join-Path $output 'previous-signature.txt'), $lastChange, [Text.Encoding]::UTF8) + $index = 0 + foreach ($id in @($pages.Keys | Sort-Object)) { + [IO.File]::WriteAllText((Join-Path $output ('unsettled-{0:d3}.xml' -f $index)), $pages[$id], [Text.Encoding]::UTF8) + $index++ + } + $hierarchy = '' + $app.GetHierarchy($notebookId, 4, [ref]$hierarchy, 1) + [IO.File]::WriteAllText((Join-Path $output 'unsettled-hierarchy.xml'), $hierarchy, [Text.Encoding]::UTF8) + throw "Expected $ExpectedPages stable pages; OneNote returned $($pages.Count), settled=$settled." + } + $index = 0 + $payloads = @() + foreach ($id in @($pages.Keys | Sort-Object)) { + [IO.File]::WriteAllText((Join-Path $output ('page-{0:d3}.xml' -f $index)), $pages[$id], [Text.Encoding]::UTF8) + if ($Pdf) { + $pdfPath = Join-Path $output ('page-{0:d3}.pdf' -f $index) + $app.NavigateTo($id, '', $false) + $app.Publish($id, $pdfPath, 3, '') + if (-not (Test-Path $pdfPath) -or (Get-Item $pdfPath).Length -eq 0) { throw 'OneNote did not publish the page PDF.' } + } + [xml]$page = $pages[$id] + foreach ($file in $page.SelectNodes('//*[local-name()="InsertedFile" or local-name()="MediaFile"]')) { + $bytes = [IO.File]::ReadAllBytes($file.GetAttribute('pathCache')) + $hash = [BitConverter]::ToString([Security.Cryptography.SHA256]::Create().ComputeHash($bytes)).Replace('-', '').ToLowerInvariant() + [IO.File]::WriteAllBytes((Join-Path $output ($hash + '.attachment')), $bytes) + $payloads += @{ page = $id; object = $file.ParentNode.GetAttribute('objectID'); + kind = $file.LocalName; name = $file.GetAttribute('preferredName'); + sha256 = $hash; bytes = $bytes.Length } + } + $index++ + } + [IO.File]::WriteAllText((Join-Path $output 'payloads.json'), (ConvertTo-Json -InputObject $payloads -Depth 4), [Text.Encoding]::UTF8) + $all = '' + $app.GetHierarchy($notebookId, 4, [ref]$all, 1) + [xml]$finalTree = $all + $finalIds = @($finalTree.SelectNodes('//*[local-name()="Page"]') | ForEach-Object { $_.GetAttribute('ID') } | Sort-Object -Unique) + if ($finalIds.Count -ne $pages.Count -or @($finalIds | Where-Object { -not $pages.ContainsKey($_) }).Count -ne 0) { + throw 'The notebook hierarchy changed while collecting page evidence; repeat the cold read.' + } + [IO.File]::WriteAllText((Join-Path $output 'hierarchy.xml'), $all, [Text.Encoding]::UTF8) + Write-Output "Read $($sections.Count) sections and $($pages.Count) pages." +} catch { + $failure = $_ + [IO.File]::WriteAllText((Join-Path $output 'failure.txt'), ($_ | Out-String), [Text.Encoding]::UTF8) + throw +} finally { + try { + try { + if ($notebookId -and $CloneHost) { $app.SyncHierarchy($notebookId) } + if ($notebookId -and -not $KeepOpen -and (-not $UseCurrentCache -or $CloneHost)) { + $app.CloseNotebook($notebookId, $false) + } + } catch { + if ($null -eq $failure) { throw } + [IO.File]::WriteAllText((Join-Path $output 'cleanup-failure.txt'), ($_ | Out-String), [Text.Encoding]::UTF8) + } + } finally { + [void][Runtime.InteropServices.Marshal]::FinalReleaseComObject($app) + } + $app = $null + [GC]::Collect() + [GC]::WaitForPendingFinalizers() + if (-not $UseCurrentCache -and -not $CloneHost) { + Get-Process ONENOTE -ErrorAction SilentlyContinue | Wait-Process -Timeout 10 + } +} diff --git a/corpus/paragraph-edit/offline/splits/native/source.json b/corpus/paragraph-edit/offline/splits/native/source.json index efa07a806149800f245ae2315d9a27dcb421ff6e..035e5e4b07b5680d3501927ff54bdeb7e043a992 100644 --- a/corpus/paragraph-edit/offline/splits/native/source.json +++ b/corpus/paragraph-edit/offline/splits/native/source.json @@ -1,8 +1,8 @@ [ { "path": "synthetic.one", - "bytes": 119736, - "sha256": "ea8264bf8df579b69755c47918ab45f77a7fdd4a4cc7564ab84813220def9322", - "mtime_ns": 1788863181033354746 + "bytes": 122856, + "sha256": "93816d43c1e4b1236186f05f706e520c9516a3a93109dba46e5242f694a0fcf2", + "mtime_ns": 1789124047655960208 } ] diff --git a/corpus/paragraph-edit/offline/splits/native/teardown.json b/corpus/paragraph-edit/offline/splits/native/teardown.json deleted file mode 120000 index 47a1192a30ea7da90676d631bb9a2687d829b43e..0000000000000000000000000000000000000000 --- a/corpus/paragraph-edit/offline/splits/native/teardown.json +++ /dev/null @@ -1 +0,0 @@ -../../../joined/teardown.json \ No newline at end of file diff --git a/corpus/paragraph-edit/offline/splits/native/teardown.json b/corpus/paragraph-edit/offline/splits/native/teardown.json new file mode 100644 index 0000000000000000000000000000000000000000..05a47793de40f322e745c4c4183727e3590ecf70 --- /dev/null +++ b/corpus/paragraph-edit/offline/splits/native/teardown.json @@ -0,0 +1 @@ +{"absent": true} diff --git a/corpus/paragraph-edit/offline/tags/candidate/synthetic.one b/corpus/paragraph-edit/offline/tags/candidate/synthetic.one index f14e719947b2b79e1a76d8c9e320f66d883af1c9..9c260887209dab4b05055e2015902a94cb3597fa 100644 Binary files a/corpus/paragraph-edit/offline/tags/candidate/synthetic.one and b/corpus/paragraph-edit/offline/tags/candidate/synthetic.one differ diff --git a/corpus/paragraph-edit/offline/tags/manifest.json b/corpus/paragraph-edit/offline/tags/manifest.json index 91e171dadf3b1b404da916620fe17ee5242e4838..ace8c996d69a73ed62881cc7183b8f9b56d43170 100644 --- a/corpus/paragraph-edit/offline/tags/manifest.json +++ b/corpus/paragraph-edit/offline/tags/manifest.json @@ -8,7 +8,7 @@ "right": "{0D11242E-6A38-0F74-261A-A6FC444FA262},50" }, "remote_prefix": false, - "revision": "{E906B028-AA9F-4772-877F-CCBED45A8645},1", + "revision": "{A1DD1531-1548-4526-9847-1BAD90106103},1", "space": "{FC64EF0A-5CCB-0557-20E0-6C847015B691},1" }, { @@ -20,7 +20,7 @@ "right": "{84061027-77E3-03F1-3E0D-A8F744B19C18},51" }, "remote_prefix": false, - "revision": "{98BB5C37-4F68-408F-AE2F-4D9EFD75022F},1", + "revision": "{BFC48BF7-8E82-4EE8-853A-EC915E6D86F8},1", "space": "{A05CB25D-C95D-043F-3B9A-CE333AD171AD},1" }, { @@ -32,7 +32,7 @@ "right": "{4FBF7D4A-6F4D-048E-0913-5BD9A184C25B},50" }, "remote_prefix": true, - "revision": "{AA6105EC-5A3B-4038-887A-DDADB2911713},1", + "revision": "{EC1A71A2-6DAF-450A-8E61-480EC6539505},1", "space": "{6F0F6556-17D3-03AF-20EF-C465A856A153},1" } ] \ No newline at end of file diff --git a/corpus/paragraph-edit/offline/tags/native/commands.jsonl b/corpus/paragraph-edit/offline/tags/native/commands.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..f37d3c73c9ea028a474f2e46d7f907d5e25760f9 --- /dev/null +++ b/corpus/paragraph-edit/offline/tags/native/commands.jsonl @@ -0,0 +1,3 @@ +{"command": "powershell -NoProfile -Command \"Expand-Archive -LiteralPath C:\\one-tests\\transfer.zip -DestinationPath C:\\one-tests\\runs\\capture\\notebook\"", "exit": 0, "stdout": "", "stderr": "", "error": null} +{"command": "powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -File C:\\one-tests\\read-current.ps1 -Root C:\\one-tests\\runs\\capture -CloneHost ONE-M6-C0520C56 -ExpectedPages 4", "exit": 0, "stdout": "Read 1 sections and 4 pages.\r\n", "stderr": "", "error": null} +{"command": "powershell -NoProfile -Command \"Compress-Archive -Force -Path C:\\one-tests\\runs\\capture\\* -DestinationPath C:\\one-tests\\captured.zip\"", "exit": 0, "stdout": "", "stderr": "", "error": null} diff --git a/corpus/paragraph-edit/offline/tags/native/machine.json b/corpus/paragraph-edit/offline/tags/native/machine.json new file mode 100644 index 0000000000000000000000000000000000000000..48f73f67ab9890e08535a3ae2b4917c9e828e129 --- /dev/null +++ b/corpus/paragraph-edit/offline/tags/native/machine.json @@ -0,0 +1 @@ +{"name": "m6-c0520c56", "hostname": "ONE-M6-C0520C56"} diff --git a/corpus/paragraph-edit/offline/tags/native/notebook/Open Notebook.onetoc2 b/corpus/paragraph-edit/offline/tags/native/notebook/Open Notebook.onetoc2 index 0dda8d5a7eefbb1b6b34b03bd871912e528d9d9a..5209ccc4ceb612ec2acc67f4e3a063c95af4f971 100644 Binary files a/corpus/paragraph-edit/offline/tags/native/notebook/Open Notebook.onetoc2 and b/corpus/paragraph-edit/offline/tags/native/notebook/Open Notebook.onetoc2 differ diff --git a/corpus/paragraph-edit/offline/tags/native/notebook/synthetic.one b/corpus/paragraph-edit/offline/tags/native/notebook/synthetic.one index abb666b9c89afffb0acebc1f74a94ffd641936e5..200fde6a781c6efe24e6b0b6773b4fc8c39d54f5 100644 Binary files a/corpus/paragraph-edit/offline/tags/native/notebook/synthetic.one and b/corpus/paragraph-edit/offline/tags/native/notebook/synthetic.one differ diff --git a/corpus/paragraph-edit/offline/tags/native/read/environment.json b/corpus/paragraph-edit/offline/tags/native/read/environment.json index b348dd06a6fd4897cb12c8e784c1cf7817fe7da6..35d52e8dcb2a0b248b215564415c9dfb676c9371 100644 --- a/corpus/paragraph-edit/offline/tags/native/read/environment.json +++ b/corpus/paragraph-edit/offline/tags/native/read/environment.json @@ -1,7 +1,7 @@ { "powershell": "5.1.14409.1005", "schema": "xs2010", - "hostname": "ONE-M6-C920A6E7", + "hostname": "ONE-M6-C0520C56", "cold": true, "onenote": "14.0.4763.1000" } diff --git a/corpus/paragraph-edit/offline/tags/native/read/hierarchy.xml b/corpus/paragraph-edit/offline/tags/native/read/hierarchy.xml index aae999471c108dab6b93ccdf7922138bcc4e42f4..f92ea5c0d6410f1fa7556ef11074cfa8a2ecddc0 100644 --- a/corpus/paragraph-edit/offline/tags/native/read/hierarchy.xml +++ b/corpus/paragraph-edit/offline/tags/native/read/hierarchy.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/paragraph-edit/offline/tags/native/read/page-000.xml b/corpus/paragraph-edit/offline/tags/native/read/page-000.xml index 9b852a0b5177c4b307766f1da26fd363570f79f2..bebd57b40de4d0664ebc0b669851eb57535460c4 100644 --- a/corpus/paragraph-edit/offline/tags/native/read/page-000.xml +++ b/corpus/paragraph-edit/offline/tags/native/read/page-000.xml @@ -1,20 +1,5 @@  -Bold 🦀 italic é color 東京
-End
]]>
Fictitious: café, 東京, مرحبا]]>
+Bold italic 🦀 é tail]]> diff --git a/corpus/paragraph-edit/offline/tags/native/read/page-001.xml b/corpus/paragraph-edit/offline/tags/native/read/page-001.xml index a518cfa62728716735c00eba3f549cd8ceed68ed..68ef3f6d1b15e91dac1929ba9c59023a2dc252c8 100644 --- a/corpus/paragraph-edit/offline/tags/native/read/page-001.xml +++ b/corpus/paragraph-edit/offline/tags/native/read/page-001.xml @@ -1,5 +1,5 @@  -☂LeftBold italic 🦀 é tail]]> +Bold italic 🦀 é tail]]> diff --git a/corpus/paragraph-edit/offline/tags/native/read/page-002.xml b/corpus/paragraph-edit/offline/tags/native/read/page-002.xml index 6c9bad30a1ce9ab4890efd523db2c4d8686fa73d..1c3243aa9fe4fd87aba7ba4f9fcb962358d86b05 100644 --- a/corpus/paragraph-edit/offline/tags/native/read/page-002.xml +++ b/corpus/paragraph-edit/offline/tags/native/read/page-002.xml @@ -1,5 +1,20 @@  -Bold italic 🦀 é tail]]> +Bold 🦀 italic é color 東京
+End
]]>
Fictitious: café, 東京, مرحبا]]>
diff --git a/corpus/paragraph-edit/offline/tags/native/read/page-003.xml b/corpus/paragraph-edit/offline/tags/native/read/page-003.xml index f8a75604a6d26a6ae036923d879551df7dbf6ee9..e4a5d558d47c71c2e4b5fa88f5d835384664bfda 100644 --- a/corpus/paragraph-edit/offline/tags/native/read/page-003.xml +++ b/corpus/paragraph-edit/offline/tags/native/read/page-003.xml @@ -1,5 +1,5 @@  -Bold italic 🦀 é tail]]> +☂LeftBold italic 🦀 é tail]]> diff --git a/corpus/paragraph-edit/offline/tags/native/read/payloads.json b/corpus/paragraph-edit/offline/tags/native/read/payloads.json deleted file mode 120000 index 787b4bae85038cda922f8befac6c8ed361fa8035..0000000000000000000000000000000000000000 --- a/corpus/paragraph-edit/offline/tags/native/read/payloads.json +++ /dev/null @@ -1 +0,0 @@ -../../../../before/read/payloads.json \ No newline at end of file diff --git a/corpus/paragraph-edit/offline/tags/native/read/payloads.json b/corpus/paragraph-edit/offline/tags/native/read/payloads.json new file mode 100644 index 0000000000000000000000000000000000000000..1ce91a413d6fff4d58765187b76756f0e97ae843 --- /dev/null +++ b/corpus/paragraph-edit/offline/tags/native/read/payloads.json @@ -0,0 +1,3 @@ +[ + +] \ No newline at end of file diff --git a/corpus/paragraph-edit/offline/tags/native/run.json b/corpus/paragraph-edit/offline/tags/native/run.json index 5a64074979038e3aff0716e3caf13ae9c03b43f3..d4b1988f68362444a06029d59a2b54a76c9276ad 100644 --- a/corpus/paragraph-edit/offline/tags/native/run.json +++ b/corpus/paragraph-edit/offline/tags/native/run.json @@ -1,5 +1,5 @@ { - "notebook": "/Users/clo/dev/one/evidence/m10/offline-paragraph-native-01/tags/candidate", + "notebook": "/private/tmp/m33/offline-paragraph/tags/candidate", "expected_pages": 4, "author": null, "author_timeout_seconds": 600, diff --git a/corpus/paragraph-edit/offline/tags/native/scripts/cold.ps1 b/corpus/paragraph-edit/offline/tags/native/scripts/cold.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..a0b99e7aeb86f4dc10032537800501a52ad65b4f --- /dev/null +++ b/corpus/paragraph-edit/offline/tags/native/scripts/cold.ps1 @@ -0,0 +1,27 @@ +param([Parameter(Mandatory=$true)][string]$Root, [string]$CloneHost = '') +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' +$root = [IO.Path]::GetFullPath($Root).TrimEnd('\') +if ([IO.Path]::GetDirectoryName($root) -ne 'C:\one-tests\runs') { + throw 'Choose a run directly below C:\one-tests\runs.' +} +if (Get-Process ONENOTE -ErrorAction SilentlyContinue) { throw 'Close OneNote before resetting its test cache.' } +$key = 'HKCU:\Software\Microsoft\Office\14.0\OneNote' +if ($CloneHost) { + if ($CloneHost -notmatch '^ONE-[A-Z0-9-]+$' -or [Environment]::MachineName -ne $CloneHost) { + throw 'The disposable clone hostname does not match this machine.' + } + New-Item "$key\Options\Paths" -Force | Out-Null + New-ItemProperty "$key\Options\Paths" -Name UnfiledNotesSection -PropertyType ExpandString -Value 'C:\one-tests\Loose.one' -Force | Out-Null +} elseif ((Get-ItemProperty "$key\Options\Paths").UnfiledNotesSection -ne 'C:\one-tests\Loose.one' -or + -not (Test-Path 'C:\one-tests\profile-original-cache')) { + throw 'Park the personal OneNote profile before resetting the test cache.' +} +$cache = Join-Path $env:LOCALAPPDATA 'Microsoft\OneNote\14.0' +$parked = Join-Path 'C:\one-tests\caches' ([IO.Path]::GetFileName($root)) +if (Test-Path $parked) { throw 'Choose a new run; its parked cache already exists.' } +New-Item -ItemType Directory -Path 'C:\one-tests\caches' -Force | Out-Null +if (Test-Path $cache) { Move-Item -LiteralPath $cache -Destination $parked } +if (Test-Path "$key\OpenNotebooks") { Remove-Item "$key\OpenNotebooks" -Recurse } +New-Item "$key\OpenNotebooks" | Out-Null +New-ItemProperty "$key\OpenNotebooks" -Name '1' -PropertyType String -Value "$root\notebook" | Out-Null diff --git a/corpus/paragraph-edit/offline/tags/native/scripts/read.ps1 b/corpus/paragraph-edit/offline/tags/native/scripts/read.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..476094ab1e0c47077988a6461db2080cf208642b --- /dev/null +++ b/corpus/paragraph-edit/offline/tags/native/scripts/read.ps1 @@ -0,0 +1,142 @@ +param( + [Parameter(Mandatory=$true)][string]$Root, + [int]$ExpectedPages = -1, + [switch]$UseCurrentCache, + [switch]$Pdf, + [switch]$KeepOpen, + [string]$CloneHost = '' +) +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' +$root = [IO.Path]::GetFullPath($Root).TrimEnd('\') +if ([IO.Path]::GetDirectoryName($root) -ne 'C:\one-tests\runs') { + throw 'Choose a run directly below C:\one-tests\runs.' +} +$notebook = Join-Path $root 'notebook' +$output = Join-Path $root 'read' +if (Test-Path $output) { throw 'Choose a new read destination.' } +if ($UseCurrentCache) { + if ((Get-ItemProperty 'HKCU:\Software\Microsoft\Office\14.0\OneNote\Options\Paths').UnfiledNotesSection -ne 'C:\one-tests\Loose.one') { + throw 'Park the personal OneNote profile before reading test notebooks.' + } +} else { + & "$PSScriptRoot\cold-current.ps1" -Root $root -CloneHost $CloneHost +} +New-Item -ItemType Directory -Path $output | Out-Null +$app = New-Object -ComObject OneNote.Application +$notebookId = '' +$failure = $null +try { + $app.OpenHierarchy($notebook, '', [ref]$notebookId, 0) + $process = Get-Process ONENOTE + @{ hostname = [Environment]::MachineName; onenote = $process.MainModule.FileVersionInfo.FileVersion; + powershell = $PSVersionTable.PSVersion.ToString(); schema = 'xs2010'; cold = (-not $UseCurrentCache.IsPresent) } | + ConvertTo-Json | Set-Content (Join-Path $output 'environment.json') -Encoding UTF8 + $sections = @() + foreach ($file in @(Get-ChildItem $notebook -Recurse | Where-Object { $_.Extension -eq '.one' })) { + $id = '' + $app.OpenHierarchy($file.FullName, '', [ref]$id, 0) + $sections += $id + } + $deadline = [DateTime]::UtcNow.AddSeconds(300) + $previous = '' + $lastChange = '' + $stableSince = [DateTime]::UtcNow + $settled = $false + do { + $pages = @{} + foreach ($section in $sections) { + $hierarchy = '' + $app.GetHierarchy($section, 4, [ref]$hierarchy, 1) + [xml]$xml = $hierarchy + foreach ($node in $xml.SelectNodes('//*[@path]')) { + if (-not $node.GetAttribute('path').StartsWith("$notebook\", [StringComparison]::OrdinalIgnoreCase)) { + throw 'OneNote opened a section outside the copied notebook.' + } + } + foreach ($node in $xml.SelectNodes('//*[local-name()="Page"]')) { + $id = $node.GetAttribute('ID') + $content = '' + $app.GetPageContent($id, [ref]$content, 1, 1) + $pages[$id] = $content + } + } + $signature = [String]::Join('|', @($pages.Keys | Sort-Object | ForEach-Object { $_ + $pages[$_] })) + if ($signature -ne $previous) { + $lastChange = $previous + $previous = $signature + $stableSince = [DateTime]::UtcNow + } + if ((($ExpectedPages -ge 0 -and $pages.Count -eq $ExpectedPages) -or + ($ExpectedPages -lt 0 -and $pages.Count -gt 0)) -and + ([DateTime]::UtcNow - $stableSince).TotalSeconds -ge 2) { $settled = $true; break } + Start-Sleep -Milliseconds 250 + } while ([DateTime]::UtcNow -lt $deadline) + if (-not $settled -or ($ExpectedPages -ge 0 -and $pages.Count -ne $ExpectedPages) -or ($ExpectedPages -lt 0 -and $pages.Count -eq 0)) { + [IO.File]::WriteAllText((Join-Path $output 'previous-signature.txt'), $lastChange, [Text.Encoding]::UTF8) + $index = 0 + foreach ($id in @($pages.Keys | Sort-Object)) { + [IO.File]::WriteAllText((Join-Path $output ('unsettled-{0:d3}.xml' -f $index)), $pages[$id], [Text.Encoding]::UTF8) + $index++ + } + $hierarchy = '' + $app.GetHierarchy($notebookId, 4, [ref]$hierarchy, 1) + [IO.File]::WriteAllText((Join-Path $output 'unsettled-hierarchy.xml'), $hierarchy, [Text.Encoding]::UTF8) + throw "Expected $ExpectedPages stable pages; OneNote returned $($pages.Count), settled=$settled." + } + $index = 0 + $payloads = @() + foreach ($id in @($pages.Keys | Sort-Object)) { + [IO.File]::WriteAllText((Join-Path $output ('page-{0:d3}.xml' -f $index)), $pages[$id], [Text.Encoding]::UTF8) + if ($Pdf) { + $pdfPath = Join-Path $output ('page-{0:d3}.pdf' -f $index) + $app.NavigateTo($id, '', $false) + $app.Publish($id, $pdfPath, 3, '') + if (-not (Test-Path $pdfPath) -or (Get-Item $pdfPath).Length -eq 0) { throw 'OneNote did not publish the page PDF.' } + } + [xml]$page = $pages[$id] + foreach ($file in $page.SelectNodes('//*[local-name()="InsertedFile" or local-name()="MediaFile"]')) { + $bytes = [IO.File]::ReadAllBytes($file.GetAttribute('pathCache')) + $hash = [BitConverter]::ToString([Security.Cryptography.SHA256]::Create().ComputeHash($bytes)).Replace('-', '').ToLowerInvariant() + [IO.File]::WriteAllBytes((Join-Path $output ($hash + '.attachment')), $bytes) + $payloads += @{ page = $id; object = $file.ParentNode.GetAttribute('objectID'); + kind = $file.LocalName; name = $file.GetAttribute('preferredName'); + sha256 = $hash; bytes = $bytes.Length } + } + $index++ + } + [IO.File]::WriteAllText((Join-Path $output 'payloads.json'), (ConvertTo-Json -InputObject $payloads -Depth 4), [Text.Encoding]::UTF8) + $all = '' + $app.GetHierarchy($notebookId, 4, [ref]$all, 1) + [xml]$finalTree = $all + $finalIds = @($finalTree.SelectNodes('//*[local-name()="Page"]') | ForEach-Object { $_.GetAttribute('ID') } | Sort-Object -Unique) + if ($finalIds.Count -ne $pages.Count -or @($finalIds | Where-Object { -not $pages.ContainsKey($_) }).Count -ne 0) { + throw 'The notebook hierarchy changed while collecting page evidence; repeat the cold read.' + } + [IO.File]::WriteAllText((Join-Path $output 'hierarchy.xml'), $all, [Text.Encoding]::UTF8) + Write-Output "Read $($sections.Count) sections and $($pages.Count) pages." +} catch { + $failure = $_ + [IO.File]::WriteAllText((Join-Path $output 'failure.txt'), ($_ | Out-String), [Text.Encoding]::UTF8) + throw +} finally { + try { + try { + if ($notebookId -and $CloneHost) { $app.SyncHierarchy($notebookId) } + if ($notebookId -and -not $KeepOpen -and (-not $UseCurrentCache -or $CloneHost)) { + $app.CloseNotebook($notebookId, $false) + } + } catch { + if ($null -eq $failure) { throw } + [IO.File]::WriteAllText((Join-Path $output 'cleanup-failure.txt'), ($_ | Out-String), [Text.Encoding]::UTF8) + } + } finally { + [void][Runtime.InteropServices.Marshal]::FinalReleaseComObject($app) + } + $app = $null + [GC]::Collect() + [GC]::WaitForPendingFinalizers() + if (-not $UseCurrentCache -and -not $CloneHost) { + Get-Process ONENOTE -ErrorAction SilentlyContinue | Wait-Process -Timeout 10 + } +} diff --git a/corpus/paragraph-edit/offline/tags/native/source.json b/corpus/paragraph-edit/offline/tags/native/source.json index 5253d2f66a6d0335f7eac687493ecba83043724c..67a904481d512f560fc5f2a66c5abc45bc0270fc 100644 --- a/corpus/paragraph-edit/offline/tags/native/source.json +++ b/corpus/paragraph-edit/offline/tags/native/source.json @@ -2,7 +2,7 @@ { "path": "synthetic.one", "bytes": 42688, - "sha256": "4d6efc70b84628a281d1a64dbb3cf96d7c682d558ed7fbef708b493c51b01794", - "mtime_ns": 1788863185189921064 + "sha256": "dd0e8e02e4c47ef4a210769e0e7f2a461f453b7c5215bef335ae315ed0798c7d", + "mtime_ns": 1789121622241377768 } ] diff --git a/corpus/paragraph-edit/offline/tags/native/teardown.json b/corpus/paragraph-edit/offline/tags/native/teardown.json deleted file mode 120000 index 47a1192a30ea7da90676d631bb9a2687d829b43e..0000000000000000000000000000000000000000 --- a/corpus/paragraph-edit/offline/tags/native/teardown.json +++ /dev/null @@ -1 +0,0 @@ -../../../joined/teardown.json \ No newline at end of file diff --git a/corpus/paragraph-edit/offline/tags/native/teardown.json b/corpus/paragraph-edit/offline/tags/native/teardown.json new file mode 100644 index 0000000000000000000000000000000000000000..05a47793de40f322e745c4c4183727e3590ecf70 --- /dev/null +++ b/corpus/paragraph-edit/offline/tags/native/teardown.json @@ -0,0 +1 @@ +{"absent": true} diff --git a/corpus/paragraph-edit/reconciliation/README.md b/corpus/paragraph-edit/reconciliation/README.md index 66f2d1bb8e4dd97316f8c026464ff90f2e368457..d9e71ba59c4cf5aba88e49af2b352dd9874c4487 100644 --- a/corpus/paragraph-edit/reconciliation/README.md +++ b/corpus/paragraph-edit/reconciliation/README.md @@ -13,22 +13,24 @@ changes. Bullets alter ancestry: the first paragraph gains an outline group, and a later bullet becomes a child of its preceding paragraph. Replacing a whole selected sibling creates a new paragraph; the split/join targets retain identity. -`reconciled` retains Rust output and a fresh OneNote cold-open. Six cases publish -automatically; eight publish after explicit review. Each includes a dependent -text edit, with SQLite reopen between local acknowledgements and publications. -The changed empty-left survivor and nonadjacent bulleted join retain conflicts. -Public tests check all 28 receipts, exact active graph/child levels, native -characters/styles, and the saved graph's identities. COM replacement controls -also retain all sixteen local branches across reopen without publishing. +`reconciled` retains Rust output and a fresh OneNote cold-open. Each local +split or join is a page-model save with a dependent text edit, with SQLite +reopen between local acknowledgements and publications. Six cases merge +automatically against the keyboard changes; ten publish after the conflicting +page is reviewed against the remote page. Public tests check all 32 receipts, +exact active graph/child levels, native characters/styles, and the saved +graph's identities. COM replacement controls retain all sixteen local branches +across reopen without publishing. Regenerate keyboard controls with `tools/native_runner.py` on `before/notebook`, using `--expected-pages 17 --inspect --collect-notebook`. Once inspection is ready, run `tools/native_paragraph_reconciliation.py OUTPUT`; it records actions and requests final capture. The runner removes its owned clone. The ignored -Rust test `paragraph::export_native_reconciliation` generates reconciled output +Rust test `export_native_reconciliation` in `crates/notebook/tests/sync_paragraph.rs` +generates reconciled output at a new absolute `ONESTORE_NATIVE_RECONCILIATION_OUTPUT` directory. Cold-open its `candidate` with the same runner, without inspection. Verification lives in -`tools/test_paragraph_edit.py` and the offline crate's `tests/sync.rs`. +`tools/test_paragraph_edit.py` and `crates/notebook/tests/sync_paragraph.rs`. The original COM pass stopped at its fifth case because its tag definition followed page settings. The recorded continuation fixes the schema order and diff --git a/corpus/paragraph-edit/reconciliation/reconciled/candidate/synthetic.one b/corpus/paragraph-edit/reconciliation/reconciled/candidate/synthetic.one index 1d8e772b17c02f0800c4007232b3e463f018afd2..b7b4cfc4be91f37edf05375b0a6f8010ed310d1d 100644 Binary files a/corpus/paragraph-edit/reconciliation/reconciled/candidate/synthetic.one and b/corpus/paragraph-edit/reconciliation/reconciled/candidate/synthetic.one differ diff --git a/corpus/paragraph-edit/reconciliation/reconciled/manifest.json b/corpus/paragraph-edit/reconciliation/reconciled/manifest.json index 8b9e4249a69e21b98eb28554ee01660413e1874c..4043cf9d474af1b56c831209656a7445aaea1313 100644 --- a/corpus/paragraph-edit/reconciliation/reconciled/manifest.json +++ b/corpus/paragraph-edit/reconciliation/reconciled/manifest.json @@ -1,323 +1,320 @@ [ { "case": "Split remote prefix", - "dependent_receipt": "{CE7388B9-8702-4628-B5FD-1CB0A86C7579},1", + "dependent_receipt": "{624D42D9-7CE1-4674-8366-6F415872530A},1", "intent": { "author": "Offline author", - "created": 1473355695, "guid": [ - 72, - 3, - 21, - 225, - 173, - 175, - 163, - 66, - 181, - 182, - 27, - 215, - 235, - 175, - 30, - 101 + 10, + 220, + 116, + 136, + 157, + 253, + 179, + 71, + 167, + 131, + 207, + 16, + 211, + 127, + 73, + 37 ], "offset": 2, "text": "{C4C5964A-00F6-06E5-1947-EF9DD9BFF93E},44" }, "outcome": "automatic", - "receipt": "{32C8046A-B530-44D9-932E-964D583CE2DC},1", + "receipt": "{DA0B7BE8-0AFE-48DB-9C72-C1F82CA0BCB6},1", "space": "{A65F69BB-E7E1-008D-3482-4FC58FF0A3B0},1" }, { "case": "Split remote boundary", - "dependent_receipt": "{BA2BDF8F-DCC0-4065-90F1-6983A1F37E15},1", + "dependent_receipt": "{F766B80E-E0EB-4E63-B68B-80B7B28EDE3B},1", "intent": { "author": "Offline author", - "created": 1473355696, "guid": [ - 121, - 163, - 49, - 221, - 144, + 6, + 79, + 119, 2, + 233, + 174, + 171, 69, + 180, + 107, + 226, 72, - 145, - 115, - 17, - 231, - 77, - 231, - 13, - 167 + 157, + 76, + 124, + 140 ], "offset": 2, "text": "{B0EA7EA0-AE25-0921-1069-CBBA308ECFA0},44" }, - "outcome": "reviewed", - "receipt": "{EE6FDF11-A1B9-402D-B1BE-F7EE9004909F},1", + "outcome": "automatic", + "receipt": "{78100DCA-4BA7-42D5-A343-51E7FBCB10F7},1", "space": "{CCEE4619-CA65-0DE0-0D46-E176E0F2DBA1},1" }, { "case": "Split remote child", - "dependent_receipt": "{FFEEB215-51E2-44B6-8D3B-475400347A22},1", + "dependent_receipt": "{AE9BE202-1C1E-4966-B452-0A0080E23DA4},1", "intent": { "author": "Offline author", - "created": 1473355696, "guid": [ - 229, - 160, - 224, - 139, - 80, - 49, - 248, - 79, - 147, - 199, - 22, + 231, + 140, + 15, + 124, + 208, + 58, + 168, + 72, + 176, + 200, + 212, 222, - 227, - 116, - 32, - 195 + 137, + 245, + 202, + 57 ], "offset": 2, "text": "{104C2D57-3EE2-0EAB-30A2-0FC6C9266E5B},44" }, "outcome": "reviewed", - "receipt": "{B3E8433E-8363-4424-8B20-C0F3A9712D81},1", + "receipt": "{D58EDEBC-5061-4CAF-8E2B-888E24934FD1},1", "space": "{285A5A8A-A525-0F77-1A76-DA3EDFB1DA1A},1" }, { "case": "Split remote list", - "dependent_receipt": "{A50CB64F-C580-43E9-B1DF-522FB18B6B51},1", + "dependent_receipt": "{C4328AEA-161E-4527-9BFA-9DA85837DF20},1", "intent": { "author": "Offline author", - "created": 1473355697, "guid": [ - 6, - 118, - 122, - 220, - 71, - 210, - 164, - 79, - 154, - 8, - 22, - 195, - 142, - 16, - 93, - 166 + 29, + 245, + 132, + 230, + 75, + 108, + 5, + 75, + 181, + 91, + 65, + 226, + 219, + 187, + 252, + 161 ], "offset": 2, "text": "{F6421F33-2FD5-0666-003F-813B1C563A01},44" }, - "outcome": "reviewed", - "receipt": "{967507AF-A4FC-4593-85DA-DB4BDB215CB8},1", + "outcome": "automatic", + "receipt": "{664E7D3E-0E87-465A-9D85-D51BCBB7B81E},1", "space": "{7A86454E-A11A-0B10-299D-79506B4F857D},1" }, { "case": "Split remote tag", - "dependent_receipt": "{8C68C1BF-FA7C-414C-B4C8-6D6330816B67},1", + "dependent_receipt": "{B561B184-AACB-4988-AE38-A3E279A6C365},1", "intent": { "author": "Offline author", - "created": 1473355698, "guid": [ - 190, - 238, - 93, - 84, - 186, + 133, + 169, + 135, + 123, + 80, + 219, + 172, + 74, + 134, 28, - 195, - 65, - 140, - 108, - 184, - 101, - 128, - 188, - 55, - 19 + 194, + 231, + 9, + 41, + 107, + 83 ], "offset": 2, "text": "{7DA1F20C-3C1E-0B74-1075-5794C1B3798D},44" }, - "outcome": "reviewed", - "receipt": "{ABF29E0E-5267-416D-BCDC-C6A5E7378D30},1", + "outcome": "automatic", + "receipt": "{AA95BF3E-3113-49F1-A31E-E428CDAE2625},1", "space": "{A08B780C-24AB-0A98-3E62-FB34B130968D},1" }, { "case": "Split remote format", - "dependent_receipt": "{D9948EA1-D7AA-450F-949C-1489C5B37D92},1", + "dependent_receipt": "{1C80B35A-76A0-41F3-A708-FF90718AFF56},1", "intent": { "author": "Offline author", - "created": 1473355698, "guid": [ - 56, - 178, - 113, - 83, - 197, - 69, - 46, - 64, - 181, - 97, - 8, - 109, - 138, - 17, - 10, - 110 + 105, + 214, + 110, + 67, + 145, + 55, + 18, + 70, + 132, + 243, + 118, + 74, + 169, + 169, + 100, + 168 ], "offset": 2, "text": "{902B0337-F0C5-0BBE-0498-8BD6026F456B},44" }, - "outcome": "automatic", - "receipt": "{C93BEE05-161E-45D1-90A7-9EBCB1889577},1", + "outcome": "reviewed", + "receipt": "{1FD6F098-47C7-4675-8646-8CE2156EE47F},1", "space": "{D539675B-7392-04A3-2878-44BCC3D1B3F0},1" }, { "case": "Split remote sibling", - "dependent_receipt": "{971EC3CC-2FD5-4A40-A9DF-A7E250057BF6},1", + "dependent_receipt": "{E61BDF53-29C6-4880-8424-677687E51F09},1", "intent": { "author": "Offline author", - "created": 1473355699, "guid": [ - 29, + 216, + 219, + 151, + 5, + 67, + 148, 215, - 155, - 66, - 220, - 243, - 26, 76, - 178, - 203, - 57, - 141, - 56, - 243, - 174, - 46 + 173, + 248, + 250, + 138, + 108, + 165, + 227, + 176 ], "offset": 2, "text": "{FD3FA68E-ED95-0917-2B3B-5C79ECEB2D0E},44" }, "outcome": "automatic", - "receipt": "{CF2A16BE-1BC9-4A42-BA60-EA637480552C},1", + "receipt": "{448A3901-3088-4212-9113-535221C53361},1", "space": "{21901482-DF06-003E-2716-4BA74B11BB0E},1" }, { "case": "Join remote prefix", - "dependent_receipt": "{2D17C528-B546-40FA-8485-16C9B0DABF6E},1", + "dependent_receipt": "{B3D05B77-033E-45E7-B8A1-6FBBF62BF5E0},1", "intent": { "author": "Offline author", "left": "{E0868E55-9B34-0920-0C68-41DAF36CBB7F},44", "right": "{E0868E55-9B34-0920-0C68-41DAF36CBB7F},50" }, - "outcome": "automatic", - "receipt": "{F63692D3-3D09-43A6-890D-10C65A159B16},1", + "outcome": "reviewed", + "receipt": "{C3AA6D00-CFF5-403D-98C4-EF0F260E0217},1", "space": "{5C69DFAE-0015-0129-319D-6ED27D45DC05},1" }, { "case": "Join left boundary", - "dependent_receipt": "{0CA7FB85-F492-47BD-919C-6A919CFB409E},1", + "dependent_receipt": "{BAA33FFF-9555-48CE-8D5F-8863DF4970EE},1", "intent": { "author": "Offline author", "left": "{27186905-3842-03DE-0E7D-CE7F31737984},44", "right": "{27186905-3842-03DE-0E7D-CE7F31737984},50" }, "outcome": "reviewed", - "receipt": "{166E0BE9-230F-43E9-8555-C6776B5D6183},1", + "receipt": "{7711053D-CAC3-4D4F-95B2-1BD1BB9DD4A5},1", "space": "{450673F7-0AD8-019F-3DEC-E68620129B08},1" }, { "case": "Join right boundary", - "dependent_receipt": "{F89D5093-F20C-4391-9F38-6C716922731D},1", + "dependent_receipt": "{F1A3437F-23AB-4C36-82BC-8D617A292956},1", "intent": { "author": "Offline author", "left": "{819B5D83-38B7-0A56-23F1-11036FB61114},44", "right": "{819B5D83-38B7-0A56-23F1-11036FB61114},50" }, "outcome": "reviewed", - "receipt": "{084D104B-CB74-492A-8EAF-0D9E8E6F6099},1", + "receipt": "{396CA92E-B80A-4DAC-BB86-18972F52E123},1", "space": "{E25678DE-0A10-04EB-3970-C9AC1F1B04C9},1" }, { "case": "Join remote child", - "dependent_receipt": "{2196E1EA-49A6-4A1C-B0FE-3CCBCD1EA993},1", + "dependent_receipt": "{5A43945C-5367-430E-AABB-47CAC7588B09},1", "intent": { "author": "Offline author", "left": "{6BBF566E-180E-0C79-0D86-935FBEE2A4E3},44", "right": "{6BBF566E-180E-0C79-0D86-935FBEE2A4E3},50" }, "outcome": "reviewed", - "receipt": "{69B85C08-6FD0-4756-B20A-39A342BA516C},1", + "receipt": "{8653E3A4-BA68-4FBF-BC76-815C1E4E88FC},1", "space": "{2FE6E22D-9416-0685-182D-8AC8747108BB},1" }, { "case": "Join remote list", + "dependent_receipt": "{8F7BB49D-F28F-45BA-9B24-C33E6D38F016},1", "intent": { "author": "Offline author", "left": "{A6081B82-7DFE-07D6-0C07-981653C0A151},44", "right": "{A6081B82-7DFE-07D6-0C07-981653C0A151},50" }, - "outcome": "retained_conflict", + "outcome": "reviewed", + "receipt": "{5BC4FA0D-45A3-4889-A70E-0422004A21A4},1", "space": "{F2EB9152-3D0C-0AE7-0CC2-ADD3039466B6},1" }, { "case": "Join remote tag", - "dependent_receipt": "{F4EB3C75-AB8C-4E7C-9A64-69593946321E},1", + "dependent_receipt": "{9D14BD20-E597-4EA3-ACD9-0ED56BB2EE12},1", "intent": { "author": "Offline author", "left": "{5AAEA398-E9D5-0C6E-23AD-EA8DBDF6F089},44", "right": "{5AAEA398-E9D5-0C6E-23AD-EA8DBDF6F089},50" }, "outcome": "reviewed", - "receipt": "{5AC635E3-AC61-41EF-9424-737AD0EAAF32},1", + "receipt": "{540BD622-A4FE-41B6-BD8C-8C1810836F27},1", "space": "{CBAD3AB0-2867-0C49-3674-2F3D59E3B4D3},1" }, { "case": "Join remote format", - "dependent_receipt": "{649CC682-7CCB-4A9E-9C26-06DDF3A7F49E},1", + "dependent_receipt": "{AECD8283-0DB5-4B83-A162-52905793BF92},1", "intent": { "author": "Offline author", "left": "{4BA6AC49-6DAB-0961-193C-599E93042581},44", "right": "{4BA6AC49-6DAB-0961-193C-599E93042581},50" }, - "outcome": "automatic", - "receipt": "{F63BD836-C10E-4928-890D-9BCB13C1C3F5},1", + "outcome": "reviewed", + "receipt": "{16C041EB-DEF7-4BB1-A91C-7441877A4C5B},1", "space": "{4DF04E8C-5A2A-0703-2F62-C2283C759F0E},1" }, { "case": "Join remote sibling", - "dependent_receipt": "{2A4C6024-4FF9-46A9-83A1-34F1A7EF62F2},1", + "dependent_receipt": "{D0F895AB-6814-43C9-86F2-06FA8BC7A98D},1", "intent": { "author": "Offline author", "left": "{B59E6ADF-31AD-0C77-1E3A-B6C5DC1FB260},44", "right": "{B59E6ADF-31AD-0C77-1E3A-B6C5DC1FB260},50" }, "outcome": "automatic", - "receipt": "{B29D40A5-BAE2-48BA-9028-25A1B14CF27F},1", + "receipt": "{20D66DD3-A173-4C77-9E56-CF5F6A81E617},1", "space": "{BCA661C5-E70D-076E-3034-C9F4B253A24B},1" }, { "case": "Join empty adoption", + "dependent_receipt": "{0AD9509F-34FE-4317-9606-BCE2079F6772},1", "intent": { "author": "Offline author", "left": "{F7F19A45-79BC-0FF0-3B34-A22033F38FB1},45", "right": "{F7F19A45-79BC-0FF0-3B34-A22033F38FB1},50" }, - "outcome": "retained_conflict", + "outcome": "reviewed", + "receipt": "{14312F31-1AA9-48E1-A133-F9C89B9D63C6},1", "space": "{B1520A77-074F-0821-0405-457528B96164},1" } ] \ No newline at end of file diff --git a/corpus/paragraph-edit/reconciliation/reconciled/native/commands.jsonl b/corpus/paragraph-edit/reconciliation/reconciled/native/commands.jsonl index cb3c2a111b21a7326b68fd579f1793e987266689..c79132acca06c265f17d6ec59d73b031459fe3f2 100644 --- a/corpus/paragraph-edit/reconciliation/reconciled/native/commands.jsonl +++ b/corpus/paragraph-edit/reconciliation/reconciled/native/commands.jsonl @@ -1,3 +1,3 @@ {"command": "powershell -NoProfile -Command \"Expand-Archive -LiteralPath C:\\one-tests\\transfer.zip -DestinationPath C:\\one-tests\\runs\\capture\\notebook\"", "exit": 0, "stdout": "", "stderr": "", "error": null} -{"command": "powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -File C:\\one-tests\\read-current.ps1 -Root C:\\one-tests\\runs\\capture -CloneHost ONE-M6-C4BC54FD -ExpectedPages 17", "exit": 0, "stdout": "Read 1 sections and 17 pages.\r\n", "stderr": "", "error": null} +{"command": "powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -File C:\\one-tests\\read-current.ps1 -Root C:\\one-tests\\runs\\capture -CloneHost ONE-M6-7EAD48EB -ExpectedPages 17", "exit": 0, "stdout": "Read 1 sections and 17 pages.\r\n", "stderr": "", "error": null} {"command": "powershell -NoProfile -Command \"Compress-Archive -Force -Path C:\\one-tests\\runs\\capture\\* -DestinationPath C:\\one-tests\\captured.zip\"", "exit": 0, "stdout": "", "stderr": "", "error": null} diff --git a/corpus/paragraph-edit/reconciliation/reconciled/native/machine.json b/corpus/paragraph-edit/reconciliation/reconciled/native/machine.json new file mode 100644 index 0000000000000000000000000000000000000000..b1ce04ed60fad3d86ae50076daefab69e468d1d3 --- /dev/null +++ b/corpus/paragraph-edit/reconciliation/reconciled/native/machine.json @@ -0,0 +1 @@ +{"name": "m6-7ead48eb", "hostname": "ONE-M6-7EAD48EB"} diff --git a/corpus/paragraph-edit/reconciliation/reconciled/native/notebook/Open Notebook.onetoc2 b/corpus/paragraph-edit/reconciliation/reconciled/native/notebook/Open Notebook.onetoc2 index b9bab8c52537429d44220695235ee851fb06b25f..c56b4c48e64c367efd87418b511f64fd4d8aaa3a 100644 Binary files a/corpus/paragraph-edit/reconciliation/reconciled/native/notebook/Open Notebook.onetoc2 and b/corpus/paragraph-edit/reconciliation/reconciled/native/notebook/Open Notebook.onetoc2 differ diff --git a/corpus/paragraph-edit/reconciliation/reconciled/native/notebook/synthetic.one b/corpus/paragraph-edit/reconciliation/reconciled/native/notebook/synthetic.one index 936b9ab9cb382a5f778585b059c36bb42ec3cfd7..77ab52f16bf12d9d90188483ad76d80236907c48 100644 Binary files a/corpus/paragraph-edit/reconciliation/reconciled/native/notebook/synthetic.one and b/corpus/paragraph-edit/reconciliation/reconciled/native/notebook/synthetic.one differ diff --git a/corpus/paragraph-edit/reconciliation/reconciled/native/read/environment.json b/corpus/paragraph-edit/reconciliation/reconciled/native/read/environment.json index 65aa2c11c1ebdbd6f42f5804c7aab2e333b85de8..5009213eb33754b0ed4ce5ad9fc7cdaabc6866bb 100644 --- a/corpus/paragraph-edit/reconciliation/reconciled/native/read/environment.json +++ b/corpus/paragraph-edit/reconciliation/reconciled/native/read/environment.json @@ -1,7 +1,7 @@ { "powershell": "5.1.14409.1005", "schema": "xs2010", - "hostname": "ONE-M6-C4BC54FD", + "hostname": "ONE-M6-7EAD48EB", "cold": true, "onenote": "14.0.4763.1000" } diff --git a/corpus/paragraph-edit/reconciliation/reconciled/native/read/hierarchy.xml b/corpus/paragraph-edit/reconciliation/reconciled/native/read/hierarchy.xml index 0441bcc4c362b34c6f9558ee8700e0455d3b0dbf..1acf349e6834af967b346441e8072978329395a0 100644 --- a/corpus/paragraph-edit/reconciliation/reconciled/native/read/hierarchy.xml +++ b/corpus/paragraph-edit/reconciliation/reconciled/native/read/hierarchy.xml @@ -1,2 +1,2 @@  - + diff --git a/corpus/paragraph-edit/reconciliation/reconciled/native/read/page-000.xml b/corpus/paragraph-edit/reconciliation/reconciled/native/read/page-000.xml index 81c1ddb53e5bf54933e0d631bcd218afca494a83..026a1eebe8bd2aea1669097386e11c027cb78d94 100644 --- a/corpus/paragraph-edit/reconciliation/reconciled/native/read/page-000.xml +++ b/corpus/paragraph-edit/reconciliation/reconciled/native/read/page-000.xml @@ -1,4 +1,4 @@  -Xab]]>🦀Cd]]> +ab]]>🦀Cd]]> diff --git a/corpus/paragraph-edit/reconciliation/reconciled/native/read/page-001.xml b/corpus/paragraph-edit/reconciliation/reconciled/native/read/page-001.xml index 1e3c0a44d06f38f8164cd0599202c8bc0e71ae26..e617287e7eb72af365274f1f75a628ca1744aa0e 100644 --- a/corpus/paragraph-edit/reconciliation/reconciled/native/read/page-001.xml +++ b/corpus/paragraph-edit/reconciliation/reconciled/native/read/page-001.xml @@ -1,4 +1,4 @@  -ab]]>🦀Cd]]> +ab🦀CdRight]]>Native child]]> diff --git a/corpus/paragraph-edit/reconciliation/reconciled/native/read/page-002.xml b/corpus/paragraph-edit/reconciliation/reconciled/native/read/page-002.xml index d3fc936e7fe651db0077215d8b151acaec9f3a81..1391a910ec80e9533dc0b2413ee11a8378bfa181 100644 --- a/corpus/paragraph-edit/reconciliation/reconciled/native/read/page-002.xml +++ b/corpus/paragraph-edit/reconciliation/reconciled/native/read/page-002.xml @@ -1,3 +1,5 @@  -Right]]> +ab]]>🦀Cd]]>Native child]]> diff --git a/corpus/paragraph-edit/reconciliation/reconciled/native/read/page-003.xml b/corpus/paragraph-edit/reconciliation/reconciled/native/read/page-003.xml index 74ac54b851bf4c5a248faac016ae80a3491f38d8..cd570350009397ee1ee8b4a68bba8452cd56a132 100644 --- a/corpus/paragraph-edit/reconciliation/reconciled/native/read/page-003.xml +++ b/corpus/paragraph-edit/reconciliation/reconciled/native/read/page-003.xml @@ -1,3 +1,3 @@  -ab🦀CdRight]]> +Xab🦀CdRightY]]> diff --git a/corpus/paragraph-edit/reconciliation/reconciled/native/read/page-004.xml b/corpus/paragraph-edit/reconciliation/reconciled/native/read/page-004.xml index 7f704143d0cd08864436d46fc2d9c435b3b7224c..b5fb5f43a157ccad7de6984d51b25be6821ef5bb 100644 --- a/corpus/paragraph-edit/reconciliation/reconciled/native/read/page-004.xml +++ b/corpus/paragraph-edit/reconciliation/reconciled/native/read/page-004.xml @@ -1,3 +1,3 @@  -ab🦀CdXRight]]> +ab🦀CdXRight]]> diff --git a/corpus/paragraph-edit/reconciliation/reconciled/native/read/page-005.xml b/corpus/paragraph-edit/reconciliation/reconciled/native/read/page-005.xml index 73e4802abc70716f755ab5abcda28d93156d84b6..c9e44049873f1462e5c0e25bd1146a5b7abbb39c 100644 --- a/corpus/paragraph-edit/reconciliation/reconciled/native/read/page-005.xml +++ b/corpus/paragraph-edit/reconciliation/reconciled/native/read/page-005.xml @@ -1,4 +1,4 @@  -ab🦀cd]]>Right]]> +ab🦀CdRight]]> diff --git a/corpus/paragraph-edit/reconciliation/reconciled/native/read/page-006.xml b/corpus/paragraph-edit/reconciliation/reconciled/native/read/page-006.xml index 8c186c2049b406f4d2988b54dc6c4ab768fa1a63..bd9f801d6ccc0915ebfb7a88a192786dcc212bbb 100644 --- a/corpus/paragraph-edit/reconciliation/reconciled/native/read/page-006.xml +++ b/corpus/paragraph-edit/reconciliation/reconciled/native/read/page-006.xml @@ -1,4 +1,4 @@  -abX]]>🦀Cd]]> +ab]]>🦀Cd]]> diff --git a/corpus/paragraph-edit/reconciliation/reconciled/native/read/page-007.xml b/corpus/paragraph-edit/reconciliation/reconciled/native/read/page-007.xml index 6caf646c16101926c31bf4e183e22b1a71fe0bc8..925d7d5dbeb13c73a9bb5863321ab6a062be2ef3 100644 --- a/corpus/paragraph-edit/reconciliation/reconciled/native/read/page-007.xml +++ b/corpus/paragraph-edit/reconciliation/reconciled/native/read/page-007.xml @@ -1,3 +1,20 @@  -ab🦀CdRight]]> +Bold 🦀 italic é color 東京
+End
]]>
Fictitious: café, 東京, مرحبا]]>
diff --git a/corpus/paragraph-edit/reconciliation/reconciled/native/read/page-008.xml b/corpus/paragraph-edit/reconciliation/reconciled/native/read/page-008.xml index a64bd030159d49e5a39d1dea87b50737558f004d..d64db444507a0b48b3447043a29e5ca11702ad54 100644 --- a/corpus/paragraph-edit/reconciliation/reconciled/native/read/page-008.xml +++ b/corpus/paragraph-edit/reconciliation/reconciled/native/read/page-008.xml @@ -1,4 +1,3 @@  -ab]]>🦀Cd]]> +Iight]]> diff --git a/corpus/paragraph-edit/reconciliation/reconciled/native/read/page-009.xml b/corpus/paragraph-edit/reconciliation/reconciled/native/read/page-009.xml index 574e842905eee4665974e53774334610e01e604d..02c7c9993a6c62ea5281c4618a80e649189085a9 100644 --- a/corpus/paragraph-edit/reconciliation/reconciled/native/read/page-009.xml +++ b/corpus/paragraph-edit/reconciliation/reconciled/native/read/page-009.xml @@ -1,4 +1,3 @@  -ab]]>🦀Cd]]> +ab🦀CdRight]]> diff --git a/corpus/paragraph-edit/reconciliation/reconciled/native/read/page-010.xml b/corpus/paragraph-edit/reconciliation/reconciled/native/read/page-010.xml index 53ce13775c9a4597cacd837f842cdc5c766c9f57..c9bc66ef04a92a736260f160e44dab73afa5c70d 100644 --- a/corpus/paragraph-edit/reconciliation/reconciled/native/read/page-010.xml +++ b/corpus/paragraph-edit/reconciliation/reconciled/native/read/page-010.xml @@ -1,4 +1,4 @@  -ab🦀CdRight]]>Native child]]> +Xab]]>🦀Cd]]> diff --git a/corpus/paragraph-edit/reconciliation/reconciled/native/read/page-011.xml b/corpus/paragraph-edit/reconciliation/reconciled/native/read/page-011.xml index 5f9da940793a81e5edd9793998588904f3761844..1e696b47c66d1e600164795ac0692f16e30e3791 100644 --- a/corpus/paragraph-edit/reconciliation/reconciled/native/read/page-011.xml +++ b/corpus/paragraph-edit/reconciliation/reconciled/native/read/page-011.xml @@ -1,5 +1,4 @@  -ab]]>🦀Cd]]>Native child]]> +ab]]>🦀Cd]]> diff --git a/corpus/paragraph-edit/reconciliation/reconciled/native/read/page-012.xml b/corpus/paragraph-edit/reconciliation/reconciled/native/read/page-012.xml index e0f5b22e79144bbc918089e91c4c232a4304ca4a..9a4942af480e2f18d3bbebbc62c1a6409e906305 100644 --- a/corpus/paragraph-edit/reconciliation/reconciled/native/read/page-012.xml +++ b/corpus/paragraph-edit/reconciliation/reconciled/native/read/page-012.xml @@ -1,20 +1,4 @@  -Bold 🦀 italic é color 東京
-End
]]>
Fictitious: café, 東京, مرحبا]]>
+ab]]>🦀Cd]]> diff --git a/corpus/paragraph-edit/reconciliation/reconciled/native/read/page-013.xml b/corpus/paragraph-edit/reconciliation/reconciled/native/read/page-013.xml index 2674fc5835ded06fdb7c449ffa12c29ea2bad9d2..9a7221855e1e3a5a5f79328ae97679f7c4c0b8e7 100644 --- a/corpus/paragraph-edit/reconciliation/reconciled/native/read/page-013.xml +++ b/corpus/paragraph-edit/reconciliation/reconciled/native/read/page-013.xml @@ -1,4 +1,4 @@  -ab]]>🦀Cd]]> +abX]]>🦀Cd]]> diff --git a/corpus/paragraph-edit/reconciliation/reconciled/native/read/page-014.xml b/corpus/paragraph-edit/reconciliation/reconciled/native/read/page-014.xml index ea2d860a04647d8391d6e08fcb720119ceeeeb76..32a6c5f5408b45b3ed2017198d12a9a27cbefa75 100644 --- a/corpus/paragraph-edit/reconciliation/reconciled/native/read/page-014.xml +++ b/corpus/paragraph-edit/reconciliation/reconciled/native/read/page-014.xml @@ -1,3 +1,3 @@  -ab🦀CdXRight]]> +ab🦀CdRight]]> diff --git a/corpus/paragraph-edit/reconciliation/reconciled/native/read/page-015.xml b/corpus/paragraph-edit/reconciliation/reconciled/native/read/page-015.xml index 95b0b9ab9926bf25580ce122c42b43d21e5dbe21..c1169ab868689944ab3ab1d4017c5fc56551ef9d 100644 --- a/corpus/paragraph-edit/reconciliation/reconciled/native/read/page-015.xml +++ b/corpus/paragraph-edit/reconciliation/reconciled/native/read/page-015.xml @@ -1,4 +1,3 @@  -ab🦀CdRight]]> +ab🦀CdRight]]> diff --git a/corpus/paragraph-edit/reconciliation/reconciled/native/read/page-016.xml b/corpus/paragraph-edit/reconciliation/reconciled/native/read/page-016.xml index fba65e6542efe81eaa6b811b94f4d245b44bdf4c..eb0ba7644c5790a4f2ccbe39e4737b30083e12fb 100644 --- a/corpus/paragraph-edit/reconciliation/reconciled/native/read/page-016.xml +++ b/corpus/paragraph-edit/reconciliation/reconciled/native/read/page-016.xml @@ -1,3 +1,3 @@  -Xab🦀CdRightY]]> +ab🦀CdXRight]]> diff --git a/corpus/paragraph-edit/reconciliation/reconciled/native/read/payloads.json b/corpus/paragraph-edit/reconciliation/reconciled/native/read/payloads.json deleted file mode 120000 index 787b4bae85038cda922f8befac6c8ed361fa8035..0000000000000000000000000000000000000000 --- a/corpus/paragraph-edit/reconciliation/reconciled/native/read/payloads.json +++ /dev/null @@ -1 +0,0 @@ -../../../../before/read/payloads.json \ No newline at end of file diff --git a/corpus/paragraph-edit/reconciliation/reconciled/native/read/payloads.json b/corpus/paragraph-edit/reconciliation/reconciled/native/read/payloads.json new file mode 100644 index 0000000000000000000000000000000000000000..1ce91a413d6fff4d58765187b76756f0e97ae843 --- /dev/null +++ b/corpus/paragraph-edit/reconciliation/reconciled/native/read/payloads.json @@ -0,0 +1,3 @@ +[ + +] \ No newline at end of file diff --git a/corpus/paragraph-edit/reconciliation/reconciled/native/run.json b/corpus/paragraph-edit/reconciliation/reconciled/native/run.json index 546fce9d6b573ef588180ddb0b1e6da6b0b249c6..f7cb239882f1e38b23db896ef13ffeccbe352b2b 100644 --- a/corpus/paragraph-edit/reconciliation/reconciled/native/run.json +++ b/corpus/paragraph-edit/reconciliation/reconciled/native/run.json @@ -1,5 +1,5 @@ { - "notebook": "/Users/clo/dev/one/evidence/m10/paragraph-native-reconciled-01/candidate", + "notebook": "/private/tmp/m33/reconciliation2/candidate", "expected_pages": 17, "author": null, "author_timeout_seconds": 600, diff --git a/corpus/paragraph-edit/reconciliation/reconciled/native/scripts/cold.ps1 b/corpus/paragraph-edit/reconciliation/reconciled/native/scripts/cold.ps1 deleted file mode 120000 index 26b7b0452f69923a3f8cb748d6b5206dbee28c45..0000000000000000000000000000000000000000 --- a/corpus/paragraph-edit/reconciliation/reconciled/native/scripts/cold.ps1 +++ /dev/null @@ -1 +0,0 @@ -../../../keyboard/scripts/cold.ps1 \ No newline at end of file diff --git a/corpus/paragraph-edit/reconciliation/reconciled/native/scripts/cold.ps1 b/corpus/paragraph-edit/reconciliation/reconciled/native/scripts/cold.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..a0b99e7aeb86f4dc10032537800501a52ad65b4f --- /dev/null +++ b/corpus/paragraph-edit/reconciliation/reconciled/native/scripts/cold.ps1 @@ -0,0 +1,27 @@ +param([Parameter(Mandatory=$true)][string]$Root, [string]$CloneHost = '') +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' +$root = [IO.Path]::GetFullPath($Root).TrimEnd('\') +if ([IO.Path]::GetDirectoryName($root) -ne 'C:\one-tests\runs') { + throw 'Choose a run directly below C:\one-tests\runs.' +} +if (Get-Process ONENOTE -ErrorAction SilentlyContinue) { throw 'Close OneNote before resetting its test cache.' } +$key = 'HKCU:\Software\Microsoft\Office\14.0\OneNote' +if ($CloneHost) { + if ($CloneHost -notmatch '^ONE-[A-Z0-9-]+$' -or [Environment]::MachineName -ne $CloneHost) { + throw 'The disposable clone hostname does not match this machine.' + } + New-Item "$key\Options\Paths" -Force | Out-Null + New-ItemProperty "$key\Options\Paths" -Name UnfiledNotesSection -PropertyType ExpandString -Value 'C:\one-tests\Loose.one' -Force | Out-Null +} elseif ((Get-ItemProperty "$key\Options\Paths").UnfiledNotesSection -ne 'C:\one-tests\Loose.one' -or + -not (Test-Path 'C:\one-tests\profile-original-cache')) { + throw 'Park the personal OneNote profile before resetting the test cache.' +} +$cache = Join-Path $env:LOCALAPPDATA 'Microsoft\OneNote\14.0' +$parked = Join-Path 'C:\one-tests\caches' ([IO.Path]::GetFileName($root)) +if (Test-Path $parked) { throw 'Choose a new run; its parked cache already exists.' } +New-Item -ItemType Directory -Path 'C:\one-tests\caches' -Force | Out-Null +if (Test-Path $cache) { Move-Item -LiteralPath $cache -Destination $parked } +if (Test-Path "$key\OpenNotebooks") { Remove-Item "$key\OpenNotebooks" -Recurse } +New-Item "$key\OpenNotebooks" | Out-Null +New-ItemProperty "$key\OpenNotebooks" -Name '1' -PropertyType String -Value "$root\notebook" | Out-Null diff --git a/corpus/paragraph-edit/reconciliation/reconciled/native/scripts/read.ps1 b/corpus/paragraph-edit/reconciliation/reconciled/native/scripts/read.ps1 deleted file mode 120000 index 112acdbaf069e052b224eff502f91d8a6b8b626e..0000000000000000000000000000000000000000 --- a/corpus/paragraph-edit/reconciliation/reconciled/native/scripts/read.ps1 +++ /dev/null @@ -1 +0,0 @@ -../../../keyboard/scripts/read.ps1 \ No newline at end of file diff --git a/corpus/paragraph-edit/reconciliation/reconciled/native/scripts/read.ps1 b/corpus/paragraph-edit/reconciliation/reconciled/native/scripts/read.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..476094ab1e0c47077988a6461db2080cf208642b --- /dev/null +++ b/corpus/paragraph-edit/reconciliation/reconciled/native/scripts/read.ps1 @@ -0,0 +1,142 @@ +param( + [Parameter(Mandatory=$true)][string]$Root, + [int]$ExpectedPages = -1, + [switch]$UseCurrentCache, + [switch]$Pdf, + [switch]$KeepOpen, + [string]$CloneHost = '' +) +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' +$root = [IO.Path]::GetFullPath($Root).TrimEnd('\') +if ([IO.Path]::GetDirectoryName($root) -ne 'C:\one-tests\runs') { + throw 'Choose a run directly below C:\one-tests\runs.' +} +$notebook = Join-Path $root 'notebook' +$output = Join-Path $root 'read' +if (Test-Path $output) { throw 'Choose a new read destination.' } +if ($UseCurrentCache) { + if ((Get-ItemProperty 'HKCU:\Software\Microsoft\Office\14.0\OneNote\Options\Paths').UnfiledNotesSection -ne 'C:\one-tests\Loose.one') { + throw 'Park the personal OneNote profile before reading test notebooks.' + } +} else { + & "$PSScriptRoot\cold-current.ps1" -Root $root -CloneHost $CloneHost +} +New-Item -ItemType Directory -Path $output | Out-Null +$app = New-Object -ComObject OneNote.Application +$notebookId = '' +$failure = $null +try { + $app.OpenHierarchy($notebook, '', [ref]$notebookId, 0) + $process = Get-Process ONENOTE + @{ hostname = [Environment]::MachineName; onenote = $process.MainModule.FileVersionInfo.FileVersion; + powershell = $PSVersionTable.PSVersion.ToString(); schema = 'xs2010'; cold = (-not $UseCurrentCache.IsPresent) } | + ConvertTo-Json | Set-Content (Join-Path $output 'environment.json') -Encoding UTF8 + $sections = @() + foreach ($file in @(Get-ChildItem $notebook -Recurse | Where-Object { $_.Extension -eq '.one' })) { + $id = '' + $app.OpenHierarchy($file.FullName, '', [ref]$id, 0) + $sections += $id + } + $deadline = [DateTime]::UtcNow.AddSeconds(300) + $previous = '' + $lastChange = '' + $stableSince = [DateTime]::UtcNow + $settled = $false + do { + $pages = @{} + foreach ($section in $sections) { + $hierarchy = '' + $app.GetHierarchy($section, 4, [ref]$hierarchy, 1) + [xml]$xml = $hierarchy + foreach ($node in $xml.SelectNodes('//*[@path]')) { + if (-not $node.GetAttribute('path').StartsWith("$notebook\", [StringComparison]::OrdinalIgnoreCase)) { + throw 'OneNote opened a section outside the copied notebook.' + } + } + foreach ($node in $xml.SelectNodes('//*[local-name()="Page"]')) { + $id = $node.GetAttribute('ID') + $content = '' + $app.GetPageContent($id, [ref]$content, 1, 1) + $pages[$id] = $content + } + } + $signature = [String]::Join('|', @($pages.Keys | Sort-Object | ForEach-Object { $_ + $pages[$_] })) + if ($signature -ne $previous) { + $lastChange = $previous + $previous = $signature + $stableSince = [DateTime]::UtcNow + } + if ((($ExpectedPages -ge 0 -and $pages.Count -eq $ExpectedPages) -or + ($ExpectedPages -lt 0 -and $pages.Count -gt 0)) -and + ([DateTime]::UtcNow - $stableSince).TotalSeconds -ge 2) { $settled = $true; break } + Start-Sleep -Milliseconds 250 + } while ([DateTime]::UtcNow -lt $deadline) + if (-not $settled -or ($ExpectedPages -ge 0 -and $pages.Count -ne $ExpectedPages) -or ($ExpectedPages -lt 0 -and $pages.Count -eq 0)) { + [IO.File]::WriteAllText((Join-Path $output 'previous-signature.txt'), $lastChange, [Text.Encoding]::UTF8) + $index = 0 + foreach ($id in @($pages.Keys | Sort-Object)) { + [IO.File]::WriteAllText((Join-Path $output ('unsettled-{0:d3}.xml' -f $index)), $pages[$id], [Text.Encoding]::UTF8) + $index++ + } + $hierarchy = '' + $app.GetHierarchy($notebookId, 4, [ref]$hierarchy, 1) + [IO.File]::WriteAllText((Join-Path $output 'unsettled-hierarchy.xml'), $hierarchy, [Text.Encoding]::UTF8) + throw "Expected $ExpectedPages stable pages; OneNote returned $($pages.Count), settled=$settled." + } + $index = 0 + $payloads = @() + foreach ($id in @($pages.Keys | Sort-Object)) { + [IO.File]::WriteAllText((Join-Path $output ('page-{0:d3}.xml' -f $index)), $pages[$id], [Text.Encoding]::UTF8) + if ($Pdf) { + $pdfPath = Join-Path $output ('page-{0:d3}.pdf' -f $index) + $app.NavigateTo($id, '', $false) + $app.Publish($id, $pdfPath, 3, '') + if (-not (Test-Path $pdfPath) -or (Get-Item $pdfPath).Length -eq 0) { throw 'OneNote did not publish the page PDF.' } + } + [xml]$page = $pages[$id] + foreach ($file in $page.SelectNodes('//*[local-name()="InsertedFile" or local-name()="MediaFile"]')) { + $bytes = [IO.File]::ReadAllBytes($file.GetAttribute('pathCache')) + $hash = [BitConverter]::ToString([Security.Cryptography.SHA256]::Create().ComputeHash($bytes)).Replace('-', '').ToLowerInvariant() + [IO.File]::WriteAllBytes((Join-Path $output ($hash + '.attachment')), $bytes) + $payloads += @{ page = $id; object = $file.ParentNode.GetAttribute('objectID'); + kind = $file.LocalName; name = $file.GetAttribute('preferredName'); + sha256 = $hash; bytes = $bytes.Length } + } + $index++ + } + [IO.File]::WriteAllText((Join-Path $output 'payloads.json'), (ConvertTo-Json -InputObject $payloads -Depth 4), [Text.Encoding]::UTF8) + $all = '' + $app.GetHierarchy($notebookId, 4, [ref]$all, 1) + [xml]$finalTree = $all + $finalIds = @($finalTree.SelectNodes('//*[local-name()="Page"]') | ForEach-Object { $_.GetAttribute('ID') } | Sort-Object -Unique) + if ($finalIds.Count -ne $pages.Count -or @($finalIds | Where-Object { -not $pages.ContainsKey($_) }).Count -ne 0) { + throw 'The notebook hierarchy changed while collecting page evidence; repeat the cold read.' + } + [IO.File]::WriteAllText((Join-Path $output 'hierarchy.xml'), $all, [Text.Encoding]::UTF8) + Write-Output "Read $($sections.Count) sections and $($pages.Count) pages." +} catch { + $failure = $_ + [IO.File]::WriteAllText((Join-Path $output 'failure.txt'), ($_ | Out-String), [Text.Encoding]::UTF8) + throw +} finally { + try { + try { + if ($notebookId -and $CloneHost) { $app.SyncHierarchy($notebookId) } + if ($notebookId -and -not $KeepOpen -and (-not $UseCurrentCache -or $CloneHost)) { + $app.CloseNotebook($notebookId, $false) + } + } catch { + if ($null -eq $failure) { throw } + [IO.File]::WriteAllText((Join-Path $output 'cleanup-failure.txt'), ($_ | Out-String), [Text.Encoding]::UTF8) + } + } finally { + [void][Runtime.InteropServices.Marshal]::FinalReleaseComObject($app) + } + $app = $null + [GC]::Collect() + [GC]::WaitForPendingFinalizers() + if (-not $UseCurrentCache -and -not $CloneHost) { + Get-Process ONENOTE -ErrorAction SilentlyContinue | Wait-Process -Timeout 10 + } +} diff --git a/corpus/paragraph-edit/reconciliation/reconciled/native/source.json b/corpus/paragraph-edit/reconciliation/reconciled/native/source.json index 7840b52fea33cd3cbab2c8bfb2072069366e8215..97ef9fba64735f859982838c0aa9cb1cf802e21f 100644 --- a/corpus/paragraph-edit/reconciliation/reconciled/native/source.json +++ b/corpus/paragraph-edit/reconciliation/reconciled/native/source.json @@ -1,8 +1,8 @@ [ { "path": "synthetic.one", - "bytes": 171880, - "sha256": "1d35503a9b47fcd2f1e776e77f200a4d7390c6e1d3a63974f4e2b2cea7959692", - "mtime_ns": 1788888504006534380 + "bytes": 182880, + "sha256": "791445173b5bd8e72f6fa79a880ea5a2ad4be1a75e500d0a2ccb9275315bc541", + "mtime_ns": 1789122096097772289 } ] diff --git a/corpus/paragraph-edit/reconciliation/reconciled/native/teardown.json b/corpus/paragraph-edit/reconciliation/reconciled/native/teardown.json deleted file mode 120000 index 47a1192a30ea7da90676d631bb9a2687d829b43e..0000000000000000000000000000000000000000 --- a/corpus/paragraph-edit/reconciliation/reconciled/native/teardown.json +++ /dev/null @@ -1 +0,0 @@ -../../../joined/teardown.json \ No newline at end of file diff --git a/corpus/paragraph-edit/reconciliation/reconciled/native/teardown.json b/corpus/paragraph-edit/reconciliation/reconciled/native/teardown.json new file mode 100644 index 0000000000000000000000000000000000000000..05a47793de40f322e745c4c4183727e3590ecf70 --- /dev/null +++ b/corpus/paragraph-edit/reconciliation/reconciled/native/teardown.json @@ -0,0 +1 @@ +{"absent": true} diff --git a/crates/notebook/tests/support/model_ops.rs b/crates/notebook/tests/support/model_ops.rs index 6fe9d2af3b735cbd6b39cb367f61ee4d153df414..62fce890a5c9e3ada246348d6f57d53207befa82 100644 --- a/crates/notebook/tests/support/model_ops.rs +++ b/crates/notebook/tests/support/model_ops.rs @@ -75,10 +75,17 @@ fn text_mut(page: &mut Page, text: ExGuid) -> &mut TextObject { .expect("text object is on the page") } -/// Replaces a UTF-16 range of a text object in the model, inheriting the format at its start. +/// Replaces a UTF-16 range of a text object in the model; the replacement takes the format +/// of the first replaced character, or of the character before an insertion point. pub fn replace_text(page: &mut Page, text: ExGuid, range: Range, replacement: &str) { let target = text_mut(page, text); - let format = target.text.format_at(range.start).unwrap().clone(); + let format = if range.is_empty() { + target.text.format_at(range.start).unwrap().clone() + } else { + target.text.slice(range.clone()).unwrap().spans()[0] + .format + .clone() + }; target .text .apply(Edit { diff --git a/crates/notebook/tests/sync/tree.rs b/crates/notebook/tests/sync/tree.rs index 19f68d937adbc285e64deb251bfc531d51e0dc75..abd11b017dfc1385a44051dac995bd6976d97cde 100644 --- a/crates/notebook/tests/sync/tree.rs +++ b/crates/notebook/tests/sync/tree.rs @@ -613,7 +613,7 @@ fn native_tree_and_layout_changes_reconcile_without_discarding_unreviewed_conten std::fs::create_dir_all(output.join("candidate")).unwrap(); std::fs::write(output.join("candidate/synthetic.one"), &server.durable).unwrap(); std::fs::write( - output.join("manifest.json"), + output.join("cases.json"), serde_json::to_vec_pretty(&records).unwrap(), ) .unwrap(); diff --git a/crates/notebook/tests/sync_outline.rs b/crates/notebook/tests/sync_outline.rs index 763089e08800f434725ca5bd127333f747b43a5c..210b6f1f3519787f1c5ea440cba70863cd3f9281 100644 --- a/crates/notebook/tests/sync_outline.rs +++ b/crates/notebook/tests/sync_outline.rs @@ -7,6 +7,7 @@ use onestore::{ document::Document, page::{Outline, Page, PageObject, PageParagraph}, }; +use serde_json::json; #[path = "support/server.rs"] mod server; @@ -524,17 +525,37 @@ fn native_moves_deletions_and_layout_changes_merge_or_require_review() { let mut reapplied = durable.clone(); change(&mut reapplied); assert_eq!(reapplied, durable, "{name} keeps its reconciled change"); - records.push((name, if merged { "merged" } else { "reviewed" })); + let (object, change) = match name.as_str() { + "Move outline" => (outline, json!({"Position": {"x": 252.0, "y": 288.0}})), + "Resize outline" | "Automatic outline size" | "Delete outline" => ( + outline, + json!({"Width": {"points": 252.0, "user_set": true}}), + ), + _ => ( + paragraph_with(&page_of(BEFORE, space), target).unwrap().id, + json!({"Collapsed": name != "Expand subtree"}), + ), + }; + records.push(json!({ + "name": name, + "outcome": if merged { "merged" } else { "reviewed" }, + "object": object.to_string(), + "change": change, + "dependent_text": dependent.to_string(), + })); } - let reviewed = records.iter().filter(|(_, r)| *r == "reviewed").count(); + let reviewed = records + .iter() + .filter(|record| record["outcome"] == "reviewed") + .count(); assert_eq!((records.len(), reviewed), (14, 7), "{records:?}"); if let Some(output) = std::env::var_os("ONESTORE_OFFLINE_OUTLINE_OUTPUT") { let output = std::path::PathBuf::from(output); assert!(output.is_absolute()); - std::fs::create_dir(&output).unwrap(); - std::fs::write(output.join("synthetic.one"), &server.durable).unwrap(); + std::fs::create_dir_all(output.join("candidate")).unwrap(); + std::fs::write(output.join("candidate/synthetic.one"), &server.durable).unwrap(); std::fs::write( - output.with_extension("json"), + output.join("cases.json"), serde_json::to_vec_pretty(&records).unwrap(), ) .unwrap(); diff --git a/crates/notebook/tests/sync_pages.rs b/crates/notebook/tests/sync_pages.rs index 6d302efc42125e883e43e8adb250d64c5d4382e1..9110551c573e86f28ce274f524e89c45958c2de2 100644 --- a/crates/notebook/tests/sync_pages.rs +++ b/crates/notebook/tests/sync_pages.rs @@ -577,7 +577,7 @@ fn twelve_disjoint_page_batches_merge_with_dependent_bodies_without_review() { PageEdit::set_level(group[2].space(), 2).unwrap(), ]; cache.pages(&source, &edits).unwrap().unwrap(); - let body = format!("Actor {actor} 🦀 é"); + let body = format!("Actor {actor} 🦀 e\u{301}"); let local = cache.snapshot().unwrap(); let mut model = model_ops::page_of(&local, group[1].space()); let text = body_outline(&mut model, &body); diff --git a/crates/notebook/tests/sync_paragraph.rs b/crates/notebook/tests/sync_paragraph.rs index b7dadfba8d0fa8444381ca6543f30d0c35fe8a27..dc3e19bd3042cdd8128fd03f169c6a66f08e15cc 100644 --- a/crates/notebook/tests/sync_paragraph.rs +++ b/crates/notebook/tests/sync_paragraph.rs @@ -496,8 +496,13 @@ fn offline_paragraphs(output: Option<&Path>) { assert_eq!(actual, id); server.fault = Fault::None; reviewed.push(case.clone()); + // The reviewed split sits after the remote's one-unit prefix. + let mut placed = intent.clone(); + if split && entry["remote_prefix"] == true { + placed["offset"] = (intent["offset"].as_u64().unwrap() + 1).into(); + } review_page(&cache, id, origin(&intent, split), |page| { - replay(page, &intent, split) + replay(page, &placed, split) }); } other => panic!("{name} {}: {other:?}", entry["case"]), diff --git a/tools/test_outline_edit.py b/tools/test_outline_edit.py index 12fdc88c555309c8a11f530958b83f04d0c2a893..93b39115f59aaa873021ab4674f38500e47fef1c 100644 --- a/tools/test_outline_edit.py +++ b/tools/test_outline_edit.py @@ -1,4 +1,5 @@ import copy +import collections import json from pathlib import Path import runpy @@ -272,7 +273,7 @@ class OutlineEditTest(unittest.TestCase): models, _ = self.cold_layout(FIXTURE / 'offline') records = json.loads((FIXTURE / 'offline/cases.json').read_text()) self.assertEqual(len(records), 14) - self.assertEqual(sum(row['retained'] for row in records), 4) + self.assertEqual(collections.Counter(row['outcome'] for row in records), {'merged': 7, 'reviewed': 7}) records = {row['name']: row for row in records} with TemporaryDirectory() as temporary: folder = Path(temporary) @@ -290,7 +291,7 @@ class OutlineEditTest(unittest.TestCase): for key in ('children', 'content', 'structure', 'child_level'): self.assertEqual(node[key], before[key], (name, oid, key)) layout = dict(before['layout']) - if record and not record['retained'] and oid == record['object']: + if record and oid == record['object']: change = record['change'] if 'Position' in change: layout.update(change['Position']) @@ -305,11 +306,11 @@ class OutlineEditTest(unittest.TestCase): self.assertEqual(node['layout'], layout) if node['kind']['type'] == 'RichText': expected = before['kind']['text'] - if record and not record['retained'] and oid == record['dependent_text']: + if record and oid == record['dependent_text']: expected = 'Local ' + expected texts += 1 self.assertEqual(node['kind']['text'], expected) - self.assertEqual((changed, texts), (10, 10)) + self.assertEqual((changed, texts), (10, 14)) def preserved_node(self, old, new): expected = dict(old) diff --git a/tools/test_paragraph_edit.py b/tools/test_paragraph_edit.py index a2530729f3cfd50aed366d457775afc2511e60d0..33ea331f5c8c59b09d77163f7fe0b5e344f1b6e3 100644 --- a/tools/test_paragraph_edit.py +++ b/tools/test_paragraph_edit.py @@ -1,3 +1,4 @@ +import collections import json from pathlib import Path import runpy @@ -24,10 +25,10 @@ class ParagraphEditTest(unittest.TestCase): self.assert_cold_graph(result) manifest = json.loads((result / 'manifest.json').read_text()) self.assertEqual(len(manifest), 16) - self.assertEqual({case['case'] for case in manifest if case['outcome'] == 'retained_conflict'}, - {'Join remote list', 'Join empty adoption'}) + self.assertEqual(collections.Counter(case['outcome'] for case in manifest), + {'automatic': 6, 'reviewed': 10}) receipts = [case[key] for case in manifest for key in ('receipt', 'dependent_receipt') if key in case] - self.assertEqual(len(set(receipts)), 28) + self.assertEqual(len(set(receipts)), 32) models, captures = {}, {} with TemporaryDirectory() as temporary: for phase, notebook, read in [('remote', fixture / 'keyboard/notebook', fixture / 'keyboard/read'), @@ -68,12 +69,15 @@ class ParagraphEditTest(unittest.TestCase): left, right = intent['left'], intent['right'] a, = [oid for oid, (_, content, _) in graph.items() if content == [left]] b, = [oid for oid, (_, content, _) in graph.items() if content == [right]] - parent, = [oid for oid, (children, _, _) in graph.items() if a in children] + parent, = [oid for oid, (children, _, _) in graph.items() if b in children] graph[parent][0].remove(b) graph[a][0] += graph[b][0] del graph[b], graph[right] characters[:2] = [characters[0] + characters[1]] - characters[0] = [('C' if char == 'c' else char, style) for char, style in characters[0]] + if any(char == 'c' for char, _ in characters[0]): + characters[0] = [('C' if char == 'c' else char, style) for char, style in characters[0]] + else: + characters[0][1] = ('I', characters[0][1][1]) self.assertEqual(new['nodes'][left]['tags'], old['nodes'][left]['tags']) with self.subTest(case=name): self.assertEqual({oid: [node['children'], node['content'], node['child_level']] @@ -191,7 +195,7 @@ class ParagraphEditTest(unittest.TestCase): def test_offline_boundaries_retain_remote_edits_and_match_native_controls(self): groups = [('splits', 'cold-split/read', 12), ('joins', 'joined/read', 12), - ('inheritance', 'join-edges/joined/read', 5), ('tags', 'join-tags/joined/read', 3)] + ('inheritance', 'join-edges/joined/read', 4), ('tags', 'join-tags/joined/read', 3)] for name, control, count in groups: fixture = FIXTURE / 'offline' / name manifest = json.loads((fixture / 'manifest.json').read_text())