Skip to content

Spectra: word-builder-swift lens-model migration (per ooxml-edit-isomorphism-foundation ADR-008) #101

@kiki830621

Description

@kiki830621

Problem

word-builder-swift 0.9.0 (#71) shipped a fluent Swift API for .docx generation using a struct-serialization model (Document(sections: [...]) builder calls). Per ooxml-edit-isomorphism-foundation ADR-008, this model must migrate to a lens-model architecture to fit the macdoc OOXML toolchain's architectural foundation (Word↔Swift edit-isomorphism, fully faithful functor).

Type

refactor (architectural migration)

Priority

P2 — non-blocking for current downstream work, but needed before word-builder-swift can participate in the Edit-algebra contract.

Context

See ooxml-edit-isomorphism-foundation design.md ADR-008 for the deferred migration documentation:

Migration path (from ADR-008)

  1. Add a LensDocument type alongside existing Document (coexistence period)
  2. Migrate Packer.toFile() callers in che-word-mcp and macdoc convert to optionally use LensDocument
  3. Deprecate the struct-serialization Document API
  4. Remove deprecated paths in word-builder-swift 1.0.0

Expected

A dedicated Spectra change opens within ~3 months that:

  • Implements LensDocument as alternative to Document
  • Migrates downstream callers atomically
  • Maintains backward compatibility during transition

Strategy

  • Open new Spectra change word-builder-swift-lens-migration citing this issue + ADR-008
  • Spec the LensDocument API surface (read access at minimum)
  • Plan migration window (probably aligned with ooxml-swift v1.0.0 cleanup per word-aligned-state-sync Phase 6)

Related

Refs #99

Current Status

Phase: verified
Last updated: 2026-05-25 by /idd-diagnose

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions