# Static Word editable conversions and RTF annotation repair

Candidate for the next release after accepted98. **Production98 remains unchanged
until a verified deployment. The full CloudConvert coverage/quality goal is unmet.**

Six genuine common operations: DOCM/DOTX→DOC/RTF/ODT. No new formats or aliases.
Source packages must be static, unsigned and macro-free. Existing complete package
validation precedes a typed in-memory DOCX and the isolated native editor. Input
and prepared DOCX32MB, expanded64MB, each part8MB,2,000 ZIP entries, existing XML,
reference, active-content and path bounds remain. Desktop2GB required. Conversion
is free and browser-only, with no user-file uploads or engine CSP change.

The fresh doc5 adapter changes exactly one output-policy entry in doc4 to permit
native DOCX→ODT; all other worker bytes, native Office23 and fonts4 stay unchanged.
Existing public DOCX→ODT remains its body-reflow profile; this backend policy entry
is not another counted pair. `rtf-comments.ts` separately repairs delayed native
main-story annotations emitted inside footnotes. It moves the complete original
annotation group to its unique explicit main-story range end, preserving all
other bytes and complete RTF size. Existing preflight runs before and after repair;
ambiguous main anchors refuse. This also repairs the measured existing DOCX→RTF
cases. No new dependency, GPL/AGPL, ads, payments or account creation.

Microsoft's [RTF1.9.1 specification, page193](https://officeprotocoldoc.z19.web.core.windows.net/files/Archive_References/%5BMSFT-RTF%5D.pdf)
documents the unsupported placement of comments inside notes. The original raw
RTF, desktop readings and all failures remain retained.

## Evidence retained so far

- `qa/unit-full2.txt`:1,011 units/89 files pass, including two actual failed native
  RTF fixtures, explicit/duplicate anchors, multiple annotations, escaped literals
  and binary PNG payloads. App/browser types and full2,385-page local build pass.
- `qa/local2-browser.json`:52 new actual Chromium/WebKit cases/downloads pass.
  Cold codec loading, offline conversion/downloads, unsafe input refusal before
  native dispatch, cancellation/recovery for all three targets and isolated source
  frame conversion are tested. Three labeled explicit-space bodies, two wrappers,
  one UTF16 encoding variant and reused independent-writer inputs add zero new
  original body corpora. Browser/frame/recovery repetitions remain separate.
- `qa/local2-*-browser.json`:110 further cases pass:18 native/body-reflow DOCX
  regressions and92 prior note/body/package/formatting/property/source cases.
  Combined162 browser cases produce170 actual files.
- `read-local2.json`:52 files/836 independent source/output controls, zero required
  failures. ZIP/lxml for ODF and source XML, Apache POI5.4.1 for DOC, Pillow for
  original raster pixels, separate desktop LibreOfficeDev26.8 import for RTF.
  The desktop importer is a separate version of the same upstream family, not a
  neutral competitive-quality oracle. DOC note/comment text views do not prove
  author/range/anchor identity beyond their stated controls.
- `rtf-regression-before98/report.json`:six actual source-matched production98
  DOCX→RTF files,24 controls/**8 failed** note/comment associations retained.
  `rtf-regression-local2/report.json`:24 controls/zero failures after repair.
  These are two comment-bearing original bodies with browser repetitions, not
  eight independent documents. Combined fresh semantic observations860.
- `qa/legacy-comparison-local2.json`:100 prior outputs keep their complete bytes;
  no additional independent reader passes are inferred from that comparison.
- `comparison-local2-v2.json`:new cohort24 whole files unchanged,10 RTF files only
  relocate complete annotation groups,18 native ODT containers have separately
  recorded session/ZIP fields. Existing native cohort14 whole files unchanged,
  four RTF annotation relocations. All other RTF bytes/sizes remain exact.
- `pages-local2/report.json`:13 full pages across12 source/output documents
  inspected. The DOC note page is pixel-exact to the separate source-reader page.
  **One secondary RTF page-count agreement observation fails:** its endnotes move
  to a separate final page (two pages versus one). Link decoration, inline spacing
  and pagination differ between readers/formats. Host-source views also omit
  Japanese glyphs; CJK visual fidelity is unverified here, while required original
  XML/POI codepoint controls pass. These limitations are retained, not greenwashed
  into universal layout fidelity or CloudConvert parity.

## Reproduction and preserved failures

`generate-word-editable-fixtures.py` reuses three recorded explicit-space synthetic
bodies. It changes only the main content type for six DOCM/DOTX wrappers; a seventh
file is a labeled UTF16 encoding derivative. Original source files, hashes,
CC0/MIT provenance and earlier ambiguous handmade edge-space runs remain. This is
not a new corpus of independent original documents.

`run-word-editable-browser.mjs local2` and
`run-word-editable-regression.mjs local2` target strict local4781/4782 previews.
Use a fresh supported phase; never overwrite outputs. `StaticWordDocReader.java`
uses the retained developer-only POI5.4.1 jars. `read-static-word-rtf.py` imports the
18 actual RTF files with an isolated temporary desktop profile; then
`validate-static-word-editable.py` compares originals and actual decoded outputs.
`read-static-word-rtf-regression.py` handles the six same-input existing RTF cases.
`compare_native_odt.py` checks every other uncompressed ODT part byte while
separately recording exact observed Rsid/RsidRoot pairs, linked annotation names
and ZIP timestamps. It never rewrites outputs or calls those containers whole-byte
matches. `compare-static-word-legacy.mjs` checks the100 prior raw files.

Initial `local1`52 browser cases passed functional tests but its independent
`read-local1.json` retained792 observations/**10 failed** RTF note associations.
This is a material defect caught after functional passes, not competitive quality.
The shared repair was added before accepted local2. Initial targeted unit failure
used unsupported XPS outside the typed Format contract; corrected to inspect absent
registered pairs. Initial browser typecheck missed the current compiler's
`--ignoreConfig` flag; the diagnostic and corrected checks remain. An initial raw
comparison incorrectly assumed native ODT determinism; raw differences, failed
assumption, initial script and scope errata remain. Only observed volatile fields
are distinguished; unexplained part changes still fail.

## Sources, deployment and comparison limits

All139 accepted98 bindings were proven against accepted Git `deb6e640`, actual
published `/benchmarks/word-notes1/source/` bytes and current files before editing,
then copied into `baseline98-source/`. Its original proof and current-before-edits
receipt are in `qa/`. Never mutate published Office54/PDF43/MOBI22, Mammothtext2,
word-notes1 or older offers/evidence. Office55/PDF44/MOBI23 and doc5 are fresh draft
offers for this integration and become immutable at first rollout. The next proof
must own every prior139 current binding plus the new integration files.

`qa/candidate-coverage.json`:locally tested candidate2,160 normalized/2,203 raw
pairs,1,003 common/1,157 additional/**855 missing** provider pairs. Normalized
formats remain139. Live-only `coverage.json` still reports production98's2,154/
2,197 pairs and861 missing until deployment.140 FROM-only cards,10 outputs on each
DOCM/DOTX source page,2,203 outgoing links and matching schema are independently
checked locally; source converters remain at the top.

CutConvert's live web and connected catalogs were rechecked; no caption, subtitle,
timed-transcript, timecode or editing-project workflow is added. Provider comparison
access remains unavailable: retained CloudConvert tab49 is missing and the current
IAB has no tabs. No legitimate quota reset was verified. No conversion retry,
new session/profile/account, purchase or quota bypass occurred. Existing saved
provider outputs concern different inputs/operations and do not prove these six
pairs' quality. Same-input CloudConvert superiority remains **UNVERIFIED**. RTF
relocation improves measured retention at identical output size versus Tabmorph98,
not versus CloudConvert; no invented lossy quality-size curve for editable exports.

Remaining release gates: immutable expanded public/source proof, final production
build, verified Fly deployment, actual production conversions/readers, source UI,
full sitemap/canonical/runtime/source/evidence/engine-byte/CSP/redirect checks,
default-preview restoration, health and raw Git preservation. Goal remains active.
