Skip to content

feat: Consolidator — 機械 + Agent 整合引擎 #6

@kiki830621

Description

@kiki830621

概述

編排完整的 consolidation pipeline:先跑機械步驟(normalize → fix-envs → compile-check),再用 AI agent 修復剩餘錯誤。

檔案

  • 新增: packages/pdf-to-latex-swift/Sources/PDFToLaTeXCore/Consolidator.swift
  • 測試: packages/pdf-to-latex-swift/Tests/PDFToLaTeXCoreTests/ConsolidatorTests.swift

功能

  • runMechanicalSteps() — 依序執行 normalize、fix-envs、compile-check
  • buildAgentPrompt() — 根據剩餘錯誤生成 agent prompt
  • invokeAgent() — 呼叫 codex / claude / gemini CLI,最多重試 3 次
  • --dry-run — 只跑機械步驟,不呼叫 agent
  • 依賴 AIConfig 決定 agent 後端

依賴

需先完成:AIConfig (#2)、LaTeXNormalizer (#3)、LaTeXEnvChecker (#4)、TexCompileChecker (#5)

設計文件

詳見 docs/plans/2026-03-08-phase2-consolidation-design.md Part 3

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions