fix(docx-compare): preserve aligned inline note reader bindings - #994
stevenobiajulu wants to merge 8 commits into
Conversation
LibreOffice Accept discarded revised inline footnote content when collision-safe original/revised anchors were reconciled to one shared tracked definition, even without copied footnote paragraphs. Retain side-specific definitions whenever both anchors are emitted, and normalize decimal-equivalent note IDs before collision resolution so lexical identity differences do not omit a definition or bind Reject to the revised body. Scoped copying remains fail-closed for section and annotation markers. Fifty-four focused tests pass including actual reader Accept/Reject against independent identities, mixed moved endnotes, lexical IDs, lone stable anchors, and duplicate-definition rejection. Word remains unverified; required root/corpus and review gates remain prerequisites to pushing. Fixes: #979
… edits Keeping both inline side definitions avoided a LibreOffice import loss but disabled all corresponding definition reconciliation and retained superseded note bodies. Preserve the existing copied-footnote fallback and restore one redlined definition for dedicated adjacent same-author, same-format aligned anchors. Publish one stable anchor in that bounded shape so resolving a deleted duplicate cannot make LibreOffice discard the shared revised body. Ambiguous or foreign history is not flattened. The raw aligned reference count intentionally changes from two tracked copies to one stable reference; both projections still bind once, definition-level redlining and unchanged-text granularity remain, and all 63 definition/actual-reader controls pass. Canonicalize note configuration IDs as well as definitions and anchors while leaving unrelated story IDs unchanged. Ref: #979, #763
…ning Review approved the aligned-anchor repair but requested that ambiguous anchor formatting/reference changes and counter part scope be explicit. Pin separate-definition fallback without calling it fine-grained history, and verify complete-package Accept/Reject prunes the superseded unreferenced footnote. Clarify counters derive from tagged main-story alignment before ancillary repairs, not a final package element inventory; numeric behavior is unchanged. Document the cost of declining consolidation rather than silently losing anchor Reject properties. Ref: #979
…ote-reader-bindings-20260917
A real public five-note input exposes a reader binding failure that lone-note synthetic controls cannot: editing the first definition leaves anchors numbered 6,2,3,4,5 and LibreOffice attaches later bodies to the wrong references. Reordering definitions alone does not repair it. Normalize anchors and definitions together through the existing conservative identity pass only after safe inline reconciliation and only when multiple unique anchors remain. Preserve the established collision-safe ID for a lone anchor, all unrelated unique documents, reserved definitions, scoped history, and the source-ID evidence mapping. New five-note native/package and actual-reader controls retain fine-grained definition history and independently compare both source projections. All 67 note/auxiliary reader controls pass; the repaired public NVCA control also passes native, AST and actual LibreOffice projections. Ref: #979, #990, #763
The required public corpus replay catches one stale ILPA row after safe aligned-note reconciliation. Regenerate through the existing SHA-pinned fixture updater, preserving all 23 source identities, text hashes, formatting scores, safety outcomes, divergence approvals and unrelated package parts. The only differences are main-story and footnote-part bytes plus the two projected XML hashes. A separate complete-package native and AST audit confirms every one of the 23 original and revised note bindings on both projections; this is a representation repair, not a waiver of the corpus gate. Ref: #979, #990, #992
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
LLM gate (advisory)All evaluated rules passed - 6 pass, 0 warn, 0 error, 10 skipped, 16 total FindingsNone. All 16 rules (6 evaluated, 10 skipped)
|
|
Shipping is held: required workspace-test (22) failed on the same existing aggregate ILPA hyperlink annotation test timeout (30000ms), also reproduced twice on PR993. Failure job: https://github.com/UseJunior/safe-docx/actions/runs/35269582431/job/105365705779 . A separate focused test-only fix preserves all four public source/destination combinations and every assertion, with independently named 30-second cases. Its local gates pass; independent Opus review and actual required CI remain mandatory. No automerge is armed, and no checks or protections will be bypassed. Once that fix ships, main will be normally integrated and final exact-head gates/review repeated. |
Preserve reviewed history while incorporating main's independently bounded public ILPA annotation cases. Repeat final integration gates and review before pushing this focused runtime repair; do not rewrite or bypass protected history. Ref: #979
|
Final independent dynamic Opus 5 review of local integrated head Two non-blocking precision/availability observations are explicitly accepted and recorded:
The six ILPA manifest leaves remain justified: 18 anchor positions stabilize, while five coarse pairs decline for verified formatting, relationship or adjacency reasons. Text/source hashes and the pre-existing formatting-divergence approval are unchanged; other 22 rows remain unchanged. Formatting-changing fine-grained history remains open #990, full ILPA snapshot XSD defects remain inherited #944, and Word projections remain UNVERIFIED. The integrated head is still held for complete required corpus and fresh CI/post-merge smoke evidence. This comment is review adjudication, not a shipping or full-ILPA XSD pass claim. Public/synthetic inputs only. |
|
Final local release evidence for head
Fresh required CI, Codecov and actual advisory/legacy deployment verdicts still required. Automerge remains unarmed; exact-merge own clean build/full tests/public feature smoke/local meaningful visuals/production SHA proof still required after merge. |
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
Verify the note reader repair against the latest independently shipped terminal-mark cleanup, retaining all existing review commits and repeating release gates before shipping. Ref: #979
Latest-main final-head verification and remaining scopeExact head Fresh independent dynamic Claude Opus5 APPROVE at this exact head: 100 required note/auxiliary/cleanup tests passed with zero skips, including 14 actual LibreOffice reader cases against independently imported original/revised controls. Additional independently extracted main-vs-head red/green controls, fresh byte-identical ILPA manifest-row replay and package interactions executed. Complete collected 19,596-byte analysis Fresh built real public API smoke: source SHA-verified against this head's NVCA Management Rights Letter manifest; its five genuine note anchors retain the corresponding native complete-package and AST bindings. Actual LibreOffice dispatches consume the unresolved tracked comparison and match all 33 paragraph/heading entries in each corresponding independent source control. All 5 main-document plus 10 explicitly extracted ancillary footnotes/endnotes XML instances schema-validate. No emitted XML/IDs/order postprocessed to force a pass. Local public-only proof Scope and open follow-ups: aligned edited footnote stabilization and moved unchanged endnotes are covered; general edited endnotes are not repaired. Reviewer independently reproduced edited-endnote reader misbinding beside stable endnotes on both main and this head; now tracked as #996: #996 . Its additional scratch probes are not claimed schema-certified or measured in Word. #990 property-changing anchor granularity, #992 widened fail-closed availability, #944 inherited full ILPA historical section-schema restriction and #973 terminal move ownership remain separate. Native/AST content and binding checks do not establish universal serialized empty-container parity. Stable-anchor activation can renumber unchanged anchors/definitions within the same main-story footnote kind when multiple unique anchors are present, not just the edited anchor; lone IDs/reserved/unreferenced definitions and unrelated note kinds are separately covered. Existing foreign-story identity checks intentionally fail closed on the newly stabilized path; no assertion about Word authoring is made. All Word projections remain UNVERIFIED. Normal push only. Automerge stays unarmed pending this head's full CI/legacy Vercel and actual advisory verdicts. Exact-merge own dependencies/clean full suite/real public reader/schema smoke and meaningful local renders/production exact-SHA proof still follow after merge. No hosted API, primary checkout or branch-protection mutation. |
Outcome
Keep safe aligned footnote anchors stable while retaining fine-grained definition history. When that reconciliation leaves multiple unique anchors, normalize references and definitions together so LibreOffice does not rotate note bodies. Preserve lone-anchor collision IDs, copied footnote/endnote separation, reserved definitions, source-ID evidence and foreign history.
Ambiguous or property-changing anchor edits retain the conservative existing fallback. Invalid reachability is fail-closed; this is not a general endnote-inline or arbitrary cross-story normalization.
Verification
Explicit limits
Word remains UNVERIFIED. The complete ILPA comparison is NOT claimed XSD-clean: tracked and native Reject fail the already-open #944 CT_SectPrBase historical header/footer-reference restriction on both built main ca61878 and this branch; both source packages and native Accept validate. New note repair does not introduce or solve it. Fresh characterization: #944 (comment) .
#990 tracks coarse history for property-changing note anchors. #992 tracks content-dependent reachability validation/availability; fail-closed is retained rather than returning a package with misbound notes. Public counters remain documented main-story pre-ancillary evidence, not final package wrapper totals.
The ILPA audit is non-regression evidence, not an ILPA binding-bug red/green test: baseline passes the same resolved content/order assertions. Its emitted shape improves redline quality (18 redundant anchor delete/reinsert pairs removed) and separates all anchors from shared definition identities. Equal-text definitions are not distinguished by that content-level audit. Actual reader misbinding red/green evidence comes from the synthetic five-note and real public NVCA controls, independently rerun by Opus.
Normal integration of PR988 is preserved; no force push, primary checkout mutation, hosted API work or branch-protection change.
Fixes: #979
Ref: #990, #992, #944, #763