Repository navigation
Conversation
Since 0.17.0 a reply has its own range crossing its parent's (tensorbee#434). The root moves of F-X279d moved only the root's range, so move_comment, move_comment_to_text and rdocx comment move left every reply on the old text, and removing that text then removed the replies with it. On 0.16.4 a reply had no range and followed its root. A root move now carries its thread on the same staged candidate. Once the root's range has moved, each reply with a complete range and reference leaves its old place and crosses its nearest anchored ancestor's new range through the reply authoring path, parents first and siblings in id order, so the markers are those reply_to writes. Its original reference run travels as the root's does. The selections run on the flushed candidate instead of fresh clones. A reply without markers, as 0.16 wrote them, follows through the thread metadata. A reply with any other anchor refuses the move before any edit, a reply that fails after the root moved refuses it naming the root and the reply, and a reply id still refuses, now naming its thread root. Moving a root onto its own range publishes nothing when every anchored reply already crosses it, and otherwise gathers the replies, which heals a thread that a 0.17.0 move split. Removal keeps its contract: a comment whose whole anchor goes is removed with its replies. Tests, regression_test comment_thread_operations_keep_every_reply_on_its_root_text, comment_thread_moves_carry_replies_across_story_owners and comment_thread_moves_heal_split_threads_and_refuse_untravelable_replies, comments unit issue446_root_moves_carry_crossing_replies_and_generic_pairing_strict which inverts the reply expectations of the F-X279d root move test, test_core issue446 thread move, CLI comment move with a reply Harness, unchanged, no sample moves a comment
Table::set_cell_grid_span_checked and set_row_grid_omissions consumed a cell only when its paragraph equaled an empty one and its properties held a width alone, while Table::merge_cells drops a lone paragraph whatever its paragraph properties and identity attributes (tensorbee#432 case 4). So set_cell_grid_span refused a cell whose only paragraph was right aligned, or carried the w14:paraId Word writes, that Cell.merge consumed. The three now share cell_is_consumable. Its content is one paragraph that only paragraph formatting or root identity attributes tell from an empty one. A tracked paragraph mark, a tracked paragraph property or numbering change and section properties count as content, so a merge now keeps such a paragraph where it dropped it, and a span or an omission refuses. The cell has no opaque cell, cell-property or border XML and no vertical merge ownership. Modeled formatting such as shading goes with the cell, as merge_cells and Word's merge already do. Spans and omissions also keep refusing a legacy hMerge cell, which merge_cells never reaches since its column-edit topology check refuses such a table. Spans and omissions now remove and restore cells through the row helpers that merge_cells uses, so row-level bookmark and permission markers keep their cell boundaries instead of being lost or moved to another cell. A restored cell goes before the markers that followed the span or closed the row, so a removal round trips. set_cell_vertical_merge only writes the property and removes no cell, so it keeps its own validation. Tests, table unit issue446_every_cell_consuming_edit_shares_one_rule over fifteen cell contents and five entry points, legacy hMerge cells and row-level markers through span, omissions and their restoration, test_formatting_tables issue446 grid span and merge Harness, unchanged, samples use the unchecked span builder
The rdocx and rdocx-cli archives grow with the issue 446 changes and their tests, on main eb980e9. They are the only crates whose member bytes change. Both rows take the measurement date 2026-11-16. Tests, python3 scripts/readme_doctests.py Harness, unchanged, measurements only
hadim
added a commit
to hadim/rdocx-skills
that referenced
this pull request
Nov 16, 2026
feat: pin integration/open-prs-2026-11-16 (tensorbee/rdocx#448 to #452 and #454)
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #446 (cases 2 and 3). Case 1, the word-granularity compare, is not in this pull request.
Context: why case 2 reverses a decision of F-X279d
This pull request changes what a root comment move does with the replies of its thread, which reverses the expectation of
issue434_root_moves_keep_crossing_replies_and_generic_pairing_strictand the HLD 03 sentence "Root moves select that comment's qualified markers ... preserving crossing reply anchors". The reason is a data loss, so here is the history first.reply_towrote no range and no reference for a reply. A reply was only a definition and acommentsExtendedrow, so it followed its root wherever the root moved..claude/plans/F-X279d-design.md:11-19made it select only the root's markers. That design says the extension "preserves root-only moves, thread metadata, unrelated reply anchors and atomic refusal". So the replies stayed on the old text by construction, not by an explicit product choice.What was verified, and how:
move_comment_to_text(root, "bearing positions")the reply has no anchor, and removing the old paragraph keeps both comments.Case 2: a root move carries its thread
Root cause.
move_comment_to_textand the comment branch ofmove_story_rangeincrates/rdocx/src/comments.rsmoved the root's three markers only.Rule now. The move runs on one staged candidate with one commit:
anchor_reply_crossing, whichreply_toalso uses). Parents go first and siblings in id order, so the markers are exactly thosereply_towrites. The unit test asserts that order.Other reply shapes:
move_commentonto the root's current range still publishes nothing when every anchored reply already crosses it. When a reply sits elsewhere, it now runs the move, which gathers the replies. That is the healing call for files that 0.17.0 already split (see below).The removal contract is unchanged. A comment whose whole anchor goes is removed with its replies, and a cut that would leave a reply anchor behind a removed root refuses. A thread-level refusal was tried and rejected: rejecting a compared reply insertion legitimately removes one reply's anchor while its root stays, and seven Python comparison tests rely on it.
Entry points.
Document::move_comment,move_comment_to_text,move_story_rangeon a comment range.Document.move_comment,Document.move_comment_to_text.rdocx comment move.Operation table.
comment_thread_operations_keep_every_reply_on_its_root_textruns 15 operations on a root with a reply, a sibling reply and a reply to the reply. Each row must keep every reply's own range and reference on its root's text, or remove the whole thread, or refuse without changing the bytes. It also checks that no marker outlives its comment, after save and reopen.move_comment_to_text, the same in one paragraph,move_comment, and move then remove the old text.remove_content,remove_content_range,remove_content_at(refused),Paragraph::set_text,try_replace_text,clone_content,move_content, compare then accept, compare then reject,import_fragmentof a whole body (the Pythoninsert_documentpath), and save and reopen.Further tests:
comment_thread_moves_carry_replies_across_story_owners: out of, and back into, a table cell, header, footer, footnote and text box.comment_thread_moves_heal_split_threads_and_refuse_untravelable_replies: healing, a reply with no marker, a reference-only reply, and a reply reference insidew:delthat fails after the root moved.Cost. Each anchored reply adds about half a root move. The reply selections run on the flushed candidate instead of fresh staging clones, which removed about 40 percent of the per-reply cost. Release builds,
move_comment_to_textat 800 paragraphs on a loaded machine:Going further would mean anchoring all replies in one source pass, which is a rewrite of the reply authoring path. It is not done here.
Case 3: one rule for every edit that consumes a cell
Root cause.
Table::set_cell_grid_span_checkedandTable::set_row_grid_omissionsconsumed a cell only when its paragraph equaledCT_P::new()and its properties held a width alone (cell_is_discardable_for_grid_edit).Table::merge_cellsonly. So a span refused a right-aligned empty paragraph, or thew14:paraIdWord writes on every paragraph, thatCell.mergeconsumed.Veccalls. So a row-levelw:bookmarkEndorw:permEndafter the last cell was lost, and a leading omission moved a row-level range onto another cell. v0.17.0 did the same on a bare<w:p/>cell.Rule now.
cell_is_consumableserves all three edits. A cell is consumed when two conditions hold.merge_cellsand in Word's merge.What each edit does with a cell that fails:
w:hMergecell.merge_cellsnever reaches that case, since its column-edit topology check refuses any table that holds one, on v0.17.0 too.Spans and omissions now remove cells through
remove_row_cell, asmerge_cellsdoes. A narrowing span and a trailing omission restore cells through a sibling that inserts after the row-level markers at that boundary, so a span or a trailing omission round trips. A leading restore keeps markers at the row start leading.Entry points.
Table::merge_cells,set_cell_grid_span_checked,set_row_grid_omissions.Cell.merge,Table.set_cell_grid_span.Tests.
issue446_every_cell_consuming_edit_shares_one_ruleruns 15 cell contents over 5 entry points (merge across, merge down, grid span, leading omission, trailing omission) with one expected outcome per row: consumed, kept by a merge and refused elsewhere, or refused everywhere.It also checks legacy hMerge cells, and row-level markers through a span, both omissions and their restoration.
test_issue446_grid_span_and_merge_consume_the_same_cellsruns the issue's script through Python.Behaviour changes
move_comment,move_comment_to_textandrdocx comment movemove every reply that has a range with its root. Replies with no marker are unchanged.A root move now refuses when a reply has one of six shapes that v0.17.0 moved the root past, leaving the reply behind:
w:del.No writer found produces them: LibreOffice 26.8 writes full nested ranges, 0.16.4 writes no marker and 0.17.0 writes full ranges.
move_commentonto the root's own range gathers replies left elsewhere, instead of returning early.Error wording:
comment 1 is a reply, not a movable root: it moves with its thread root 0comment 0 cannot move: reply 1 has an incomplete anchorcomment 0 cannot move: reply 1: <cause>set_cell_grid_spanandset_row_grid_omissionsconsume empty cells that carry paragraph formatting, identity attributes, modeled cell formatting or their owngridSpan, asCell.mergealready did.Cell.mergekeeps a paragraph with a tracked mark, a tracked property change or a tracked numbering change, where v0.17.0 dropped it and its revision. For section properties, the native merge keeps the paragraph, and the PythonCell.mergerefuses with "generic content operations cannot mutate a section-owning paragraph" instead of dropping the section.Spans and omissions keep row-level markers at their cell boundaries.
Not changed
move_comment(root, root.anchor), ormove_comment_to_textonto the root's current text, gathers them first. The heal test pins this.numPron an empty paragraph. It counts as formatting. A merge drops a numbered empty paragraph, as on v0.17.0, and a span or an omission now consumes it too, so its visible list number goes.Table::set_cell_vertical_merge. It only writes the property and removes no cell, so it keeps its own validation. Layout hides a continuation cell's content (rdocx-layout/src/table.rs), and clearing the merge shows it again.merge_cellsstays the content-aware vertical merge.Findings in no issue
Native Rust
Document::insert_document,appendandappend_with_breakimport the body only (HLD 03 says native insertion imports no companions), but they keep the source's comment markers and note references in that body. With a source holding one root, one reply and one footnote reference, all three calls give the same host:validate_comment_ownershipfails with "comment markers have no owned definitions part".w:footnoteReferencestays, whilefootnotes()is empty and the note text is not in the package.A single comment without replies behaves the same, on v0.17.0 too. The note references make this larger than dropping comment markers, so this pull request does not touch it.
Gates on the final tree
Run on 77c101e, macOS arm64, Poppler 26.09 through
pixi exec -s poppler.cargo fmt --all --checkandcargo clippy --workspace --all-targets --all-features -- -D warnings: clean.python3 scripts/prose_check.py: 0 violations.python3 scripts/sync_agent_skills.py --check: clean.python3 scripts/hash_harness.py --check: 49 entries match.python3 scripts/readme_doctests.py: passes, with therdocxandrdocx-cliarchive rows re-recorded in their own commit.cargo test -p rdocx --no-fail-fast(RUST_MIN_STACK=8388608): lib 1048 passed, 3 failed.integration_test557 passed, 5 failed.regression_test2534 passed. The 8 failures pin tool versions this machine does not have:large_word_and_presentation_pdfs_preserve_logical_reading_order(pdftotext 26.01.0),word_and_powerpoint_chart_pixels_are_identical(at the rasterizer version assert),fx195_variable_svg_paint_matches_independent_static_instances(HarfBuzz 14.4.0).odt_reader_matches_pinned_libreoffice_structure,public_authored_theme_and_fonts_match_pinned_word_resolution,section_page_semantics_match_pinned_libreoffice_renderandevery_conditional_table_region_matches_word(LibreOffice 26.2.5.2),sanitized_public_authoring_fixture_passes_every_conformance_stage(cargo run --offlinewithout the crate in the local registry).cargo test -p rdocx-cli --no-fail-fast: 120 passed.maturin develop --locked, debug assertions on), fullcrates/rdocx-py/tests: 1400 passed, 2 skipped, 61 failed. The 61 pin tools:test_issue_253_pdf_text_view(pdftotext 26.01.0),test_colour_inputs_and_nested_font_formats_reach_actual_rendering(pdftoppm 26.01.0),test_fx200_python_style_saved_output_paints_exact_expected_colours_with_deterministic_native_cli(RDOCX_CLIunset), and the 58 tests oftest_rendering_threads.py(Poppler 26.01.0 and installed fonts).mypy --strictontyping_smoke.pyand the package, no issues in 9 source files.mypy.stubtest rdocx: no issues in 8 modules.Veccall.