Skip to content

docx: the N0c2 partial-surgery planner has no production seam #499

Description

@bobzhang

Surfaced by review during the per-warning-id sweep (PR #497, id [0001]
unused_value).

plan_paragraph_text_edits in docx2html/docx/run_surgery_partial.mbt — the
N0c2 partial token-boundary surgery planner, roughly 900 lines plus its helper
graph — has no production caller. run_surgery_api.mbt documents the addressed
run-replacement boundary as the ONE public seam through which a shipped surface
reaches the surgery, and that seam reaches N0c1. So everything under
plan_paragraph_text_edits is live only under its whitebox and property suites.

The compiler says this as unused_value, and #497 suppresses the diagnostic —
deleting a complete, tested planner would be worse, and moving ~3200 lines of
whitebox tests inline to make it "used" is a test-reorganisation, not a fix. But
the suppression silences a message worth keeping: an implementation with no
seam. A comment at the declaration now records it; this issue tracks the
decision.

Three ways out, in the order they were suggested in review:

  1. Wire it up — give N0c2 a public seam the way N0c1 has one.
  2. Isolate it as explicitly experimental/test-only code, so its status is
    structural rather than a comment.
  3. Keep it as it is, with the status conspicuous, until (1) lands.

The same question applies to ParagraphTextEdit (its request type, tracked by
the struct_never_constructed suppression in PR #494) and to
PartialSurgeryLogicalEdit/PartialSurgeryReceipt (whose write-only fields PR
#496 deleted). All four are the same fact seen through different diagnostics.

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