Skip to content

refactor: extract pdf-to-latex-swift + ocr-swift to PsychQuant repos; commit Tests/WordToMDTests fixtures (continues #78 pattern) #79

@kiki830621

Description

@kiki830621

Problem

From verification of #78 (#78 verify report, finding #3):
「Macdoc 的 clean-clone swift build 失敗 on HEAD because packages/pdf-to-latex-swift/ and Tests/WordToMDTests/ are gitignored/untracked (same pattern #78 fixed for note-* packages, applied to other paths).」
— Source: codex independent verifier, 2026-04-18

#78 successfully extracted the 3 note-* packages to independent PsychQuant/* repos so they could be properly version-controlled. That fix did not generalize to other gitignored/untracked paths in macdoc:

  • packages/pdf-to-latex-swift/ — declared as path: in Package.swift but matched by .gitignore blanket packages/ rule (no whitelist entry). Source files exist only on the developer's filesystem.
  • packages/ocr-swift/ — same pattern (just discovered while reviewing refactor: extract NoteCore / NoteToPDF as separate PsychQuant repos (packages 應該要是獨立套件) #78's PageOCRRunner.swift workstream)
  • Tests/WordToMDTests/ — referenced by macdoc's Package.swift .testTarget, but not tracked in git (git ls-tree HEAD Tests/ shows only MacDocCLITests and OCRTests)

A fresh git clone PsychQuant/macdoc.git && swift build would fail or silently use stale packages/note-*-swift/ directories that an existing developer machine already has.

Type

refactor

Expected

  • Each currently-gitignored package under packages/* either:
  • Tests/WordToMDTests/Fixtures/* either added to git or moved out of the macdoc repo.
  • A clean git clone … && swift build succeeds without any local-disk pre-state.

Actual

git -C macdoc ls-tree HEAD packages/  # missing pdf-to-latex-swift, ocr-swift, note-* (note-* is intentional after #78)
git -C macdoc ls-tree HEAD Tests/     # missing WordToMDTests
git -C macdoc check-ignore -v packages/pdf-to-latex-swift  # → matched by `packages/` rule

Strategy

Mirror #78's phased approach:

Related


Current Status

Phase: closed
Last updated: 2026-04-20 by idd-close (retroactive)

Key Decisions

  • Closed retroactively 2026-04-20 — PR refactor: extract pdf-to-latex-swift + ocr-swift + flip gitignore strategy (#79) #89 used Closes #79. trailer which auto-closed on merge, bypassing idd-close gate check. Retroactive Closing Summary posted to preserve audit trail.
  • 35/35 Spectra tasks done; all 5 body Strategy phases done; clean-clone git clone && swift build verified 95.80s (from zero pre-state)
  • Scope expansion: Track D audit surfaced 6 MORE packages with missing sources — fixed in-scope via extended .gitignore whitelist (48 files / 9,059 insertions in commit a380cfc)
  • Track A found PsychQuant/pdf-to-latex-swift already existed from earlier aborted extraction; diff -rq confirmed byte-identical → reconciliation collapsed to tag v0.1.0 + swap dep
  • Track B created PsychQuant/ocr-swift v0.1.0; verified PR fix: PageOCRRunner uses OCRCore.backend API (unblocks main build) #84's Qwen3-VL/OCRBackend wiring still compiles
  • Track C deleted empty WordToMDTests testTarget (0 Swift files, dead scaffolding)
  • All pre-existing dep pins preserved (note-core@0.1.3, note-to-pdf@0.1.2, word-builder@0.9.0, ooxml@0.7.0)
  • Complexity: SDD-warranted → discuss (5 assumptions correct after diff-verify) → propose → apply → retroactive close
  • Spectra change extract-remaining-packages ready for /spectra-archive

Scope Changes

  • Original scope: 2 packages + WordToMDTests decision
  • Actual scope: 2 remote extractions + testTarget delete + 6-package systemic in-tree rescue + CLAUDE.md docs = much larger than diagnosed
  • .gitignore "flip strategy" attempted mid-apply but didn't reach final merged commit — functionally equivalent, just verbose

Blocking

  • (none — closed)
  • Known follow-up (not blocking): .gitignore per-file whitelist is now 80+ lines; could simplify with packages/*/.build/ exclude-only pattern

Commits (squashed into d181090 via PR #89)

  • 9170093 Track A — pdf-to-latex-swift url dep
  • 3a2806a Track B — ocr-swift extraction to PsychQuant/ocr-swift
  • 6fd4880 Track C — delete empty WordToMDTests testTarget
  • a380cfc Track D — extend .gitignore whitelist + track 48 previously-missing package sources
  • fe1f2b9 Track E — CLAUDE.md Sub-Repositories table update

New Repos

Metadata

Metadata

Assignees

No one assigned

    Labels

    refactorCode refactoring

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions