wip: phase_z2 evidence 파이프라인 + matching 실험(phase2~26) + 프론트 trace 패널 진행분 스냅샷
- src: phase_z2 composition/mapper/pipeline/placement_planner/retry, ai_fallback(prompts/schema/validate), mdx_text_atoms 신규 - Front: PipelineTracePanel 신규, FramePanel/SlideCanvas/Home/designAgentApi 등 갱신 + 테스트 4종 추가 - templates/phase_z2: catalog(component_expansion_registry, node_slot_mapping 신규), frames, families, slide_base 갱신 - tests/matching: phase2~26 매칭 실험 스크립트·리포트·온톨로지 전체 (미커밋 진행분) - tests: b4_v4 evidence, task5~28.5 시리즈, regression(imp95 baseline) 등 신규 테스트 대량 추가 - docs/reference: MDX 구조 인벤토리, MDX→Frame 구조 계약 문서 - scripts: mdx 계약/parity/coverage/viewport 체크, gitea comment, run sync 유틸 - .gitignore: tmp*.json, chromedriver, .orchestrator, *.pkl, Front_test* 등 임시/스냅샷 제외 미완성 작업의 보존용 스냅샷 커밋 (2026-07-02) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,82 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
from pathlib import Path
|
||||
import sys
|
||||
|
||||
sys.path.insert(0, str(Path(__file__).resolve().parent.parent))
|
||||
|
||||
from src.mdx_text_atoms import compare_atom_sets, extract_text_atoms
|
||||
|
||||
|
||||
DEFAULT_PAIRS = [
|
||||
(
|
||||
"samples/mdx/01. 건설산업 DX의 올바른 이해(0127)(원본).mdx",
|
||||
"samples/mdx/01. 건설산업 DX의 올바른 이해(0127).mdx",
|
||||
),
|
||||
(
|
||||
"samples/mdx/02. DX의 시행 목표 및 기대효과(원본).mdx",
|
||||
"samples/mdx/02. DX의 시행 목표 및 기대효과.mdx",
|
||||
),
|
||||
(
|
||||
"samples/mdx/04. DX 지연 요인(원본).mdx",
|
||||
"samples/mdx/04. DX 지연 요인.mdx",
|
||||
),
|
||||
(
|
||||
"samples/mdx/05. 설계 방식의 왜곡(원본).mdx",
|
||||
"samples/mdx/05. 설계 방식의 왜곡.mdx",
|
||||
),
|
||||
]
|
||||
|
||||
|
||||
def main() -> int:
|
||||
parser = argparse.ArgumentParser(description="Compare original MDX text atoms with standardized MDX text atoms.")
|
||||
parser.add_argument("--root", default=".", help="Repository root. Defaults to current directory.")
|
||||
parser.add_argument("--max-items", type=int, default=8, help="Max examples per mismatch category.")
|
||||
args = parser.parse_args()
|
||||
|
||||
root = Path(args.root).resolve()
|
||||
any_failed = False
|
||||
for original_rel, standardized_rel in DEFAULT_PAIRS:
|
||||
original = root / original_rel
|
||||
standardized = root / standardized_rel
|
||||
print(f"=== {standardized.name} ===")
|
||||
if not original.exists():
|
||||
print(f" ERROR original missing: {original_rel}")
|
||||
any_failed = True
|
||||
continue
|
||||
if not standardized.exists():
|
||||
print(f" ERROR standardized missing: {standardized_rel}")
|
||||
any_failed = True
|
||||
continue
|
||||
|
||||
original_atoms = extract_text_atoms(original)
|
||||
standardized_atoms = extract_text_atoms(standardized)
|
||||
comparison = compare_atom_sets(original_atoms, standardized_atoms)
|
||||
missing = comparison["missing_from_standardized"]
|
||||
added = comparison["added_in_standardized"]
|
||||
print(f" original_atoms : {len(original_atoms)}")
|
||||
print(f" standardized_atoms : {len(standardized_atoms)}")
|
||||
print(f" missing : {len(missing)}")
|
||||
print(f" added : {len(added)}")
|
||||
if missing or added:
|
||||
any_failed = True
|
||||
_print_examples("missing_from_standardized", missing, args.max_items)
|
||||
_print_examples("added_in_standardized", added, args.max_items)
|
||||
else:
|
||||
print(" OK text atom parity")
|
||||
print()
|
||||
|
||||
return 1 if any_failed else 0
|
||||
|
||||
|
||||
def _print_examples(label: str, atoms, max_items: int) -> None:
|
||||
if not atoms:
|
||||
return
|
||||
print(f" {label} examples:")
|
||||
for atom in atoms[:max_items]:
|
||||
print(f" L{atom.line_no} {atom.kind}: {atom.normalized}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
Reference in New Issue
Block a user