Skip to content

fix(docx-compare): repair inherited edited endnote reader misbinding beside stable notes #996

Description

@stevenobiajulu

Edited endnotes beside unchanged endnotes can still misbind in LibreOffice

Inherited, independently reproduced on main 9d82bab96ec3bd23c772a1bc2792cfbabc146652 and PR #994's updated reviewed head 40fc49a050aed0765bcdb8ad940534b68e7b5438. Not a regression of terminal cleanup or the aligned-footnote repair. The current reconciliation path is footnote-only; moved unchanged endnotes are covered, but edited endnotes alongside stable endnotes are not repaired.

Dynamic synthetic control: five aligned endnote anchors, first body edited. Current and independently extracted main source both produce anchor IDs [1,6,2,3,4,5]. Actual LibreOffice Accept/Reject dispatches on the unresolved comparison do not match independently imported revised/original identity controls: Accept binds anchor1 to stable body2 and anchor5 to the edited revised body; Reject also misbinds. Both projection parity checks are false on both versions. No private document or document upload.

Cause candidate: packages/docx-compare/src/tagged/pipeline.ts reconcileTaggedFootnotes is footnote-only; there is no corresponding endnote stabilization, so stabilizedNoteKinds never records an edited endnote and the coarse del(1)/ins(6) shape remains. This is a candidate bounded repair, not a measured Word policy.

  • Add native/AST/full-package and actual-reader red controls with independently loaded original/revised identity states.
  • Characterize a bounded endnote analogue, retaining fine-grained definition history, unchanged/orphan/reserved definitions and fail-closed ambiguity checks.
  • Cover lexical decimal IDs, multiple edits/moves, format-changing anchors and unrelated note kinds without blanket renumbering.
  • Validate complete inputs/outputs and distinguish schema/text fidelity from reader binding; no punctuation normalization or field locking.
  • Review and ship separately with full local/CI/corpus/exact-merge public smoke gates.

Word Accept/Reject remains UNVERIFIED. Schema validity of these additional scratch probes was not adjudicated by this finding; do not call them schema-certified controls.

Public/synthetic-only local reproduction: /private/tmp/safe-docx-979-note-reader-20260917/.peer-review/probe/edge.probe.test.ts, 979-edge-head.log, 979-edge-main.log, and complete actual Opus5 review 979-integration-993-opus5-20260917.review.txt §5c/6a. Reviewer model/trace and exit0 collected by the supervisor. Ref: #979, #990, #992, PR #994.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions