Repository navigation
Commit 1ace4be
authored
* feat: reconstruct revision groups at parse time — inferred groups for pre-existing revisions (ISSUES.md #46)
Revisions already in the file (previous sessions, foreign reviewers, Word
round-trips) now get inferred groups at RevisionManager construction:
maximal runs of contiguous same-paragraph revisions sharing identical raw
w:author + w:date become one group, so whole logical edits resolve as a
unit after reopen too. New Revision.group_source ("recorded" | "inferred")
reports provenance; split-off tails of own pre-session insertions are
adopted into their origin's inferred group; ungroupable revisions (missing
author/date, outside any paragraph, nonconforming ids) stay group_id=None
and break contiguity runs. Known imprecisions (same-paragraph same-second
over-merge, nested-paragraph over-split, rump groups) are documented and
pinned by tests.
* fix: review round 1 — freeze one w:date per edit, safe nonconforming-id listing, snapshot dataclass
- frozen_timestamp(): one logical operation now stamps all its revisions
with a single w:date (previously each injection call read the clock, so
a multi-hunk edit crossing a second boundary would reconstruct as
several inferred groups after reopen); adversarial ticking-clock test.
- list_revisions() no longer crashes on a non-numeric w:id (omitted:
unrepresentable by int-keyed operations); a duplicated w:id is now
wholly ungrouped — every occurrence — since id-keyed lookup cannot
tell occurrences apart. Docs aligned.
- _RegistrySnapshot is a named dataclass (CLAUDE.md: named objects over
3+-tuples); Revision.group_source reuses the _GroupSource alias.
* fix: review round 2 — duplicate-id pre-scan, doc parity for foreign split halves, public GroupSource alias
- _reconstruct_groups now pre-scans for duplicated w:ids independent of
groupability: an ungroupable occurrence (e.g. missing date) no longer
lets its groupable twin win a group that id-keyed lookup would report
for both elements; replaces the round-1 demotion surgery with a
simpler never-group-duplicates rule.
- docs/api.md and SKILL.md now list the fourth group_id=None case
(mid-session split half of a foreign insertion), matching the
Revision docstring.
- _GroupSource renamed to GroupSource: it types the public
Revision.group_source field (same convention as session.ExecStatus).
1 parent 818580a commit 1ace4be
7 files changed
Lines changed: 723 additions & 103 deletions
File tree
- docs
- docx_editor
- skills/docx
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
626 | 626 | | |
627 | 627 | | |
628 | 628 | | |
629 | | - | |
630 | | - | |
631 | | - | |
632 | | - | |
633 | | - | |
634 | | - | |
635 | | - | |
636 | | - | |
637 | | - | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
638 | 653 | | |
639 | 654 | | |
640 | 655 | | |
641 | 656 | | |
642 | 657 | | |
643 | 658 | | |
644 | 659 | | |
645 | | - | |
| 660 | + | |
646 | 661 | | |
647 | 662 | | |
648 | 663 | | |
| |||
656 | 671 | | |
657 | 672 | | |
658 | 673 | | |
659 | | - | |
| 674 | + | |
| 675 | + | |
660 | 676 | | |
661 | 677 | | |
662 | 678 | | |
| |||
806 | 822 | | |
807 | 823 | | |
808 | 824 | | |
809 | | - | |
| 825 | + | |
| 826 | + | |
810 | 827 | | |
811 | 828 | | |
812 | 829 | | |
| |||
890 | 907 | | |
891 | 908 | | |
892 | 909 | | |
893 | | - | |
| 910 | + | |
894 | 911 | | |
895 | 912 | | |
896 | 913 | | |
| |||
1085 | 1102 | | |
1086 | 1103 | | |
1087 | 1104 | | |
1088 | | - | |
| 1105 | + | |
1089 | 1106 | | |
1090 | 1107 | | |
1091 | 1108 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
73 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
74 | 76 | | |
75 | 77 | | |
76 | 78 | | |
| |||
1276 | 1278 | | |
1277 | 1279 | | |
1278 | 1280 | | |
1279 | | - | |
1280 | | - | |
1281 | | - | |
| 1281 | + | |
| 1282 | + | |
| 1283 | + | |
| 1284 | + | |
| 1285 | + | |
1282 | 1286 | | |
1283 | 1287 | | |
1284 | 1288 | | |
| |||
1343 | 1347 | | |
1344 | 1348 | | |
1345 | 1349 | | |
1346 | | - | |
1347 | | - | |
1348 | | - | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
1349 | 1359 | | |
1350 | 1360 | | |
1351 | 1361 | | |
| |||
1356 | 1366 | | |
1357 | 1367 | | |
1358 | 1368 | | |
1359 | | - | |
1360 | | - | |
| 1369 | + | |
1361 | 1370 | | |
1362 | 1371 | | |
1363 | 1372 | | |
| |||
1371 | 1380 | | |
1372 | 1381 | | |
1373 | 1382 | | |
1374 | | - | |
| 1383 | + | |
| 1384 | + | |
1375 | 1385 | | |
1376 | 1386 | | |
1377 | 1387 | | |
| |||
1382 | 1392 | | |
1383 | 1393 | | |
1384 | 1394 | | |
1385 | | - | |
1386 | | - | |
| 1395 | + | |
1387 | 1396 | | |
1388 | 1397 | | |
1389 | 1398 | | |
| |||
0 commit comments