Skip to content

confluence-mdx: validated patcher 경계를 분리합니다#1044

Open
jk-kim0 wants to merge 1 commit into
jk/refactor-reverse-sync-strategy-handlersfrom
jk/refactor-reverse-sync-validated-patcher
Open

confluence-mdx: validated patcher 경계를 분리합니다#1044
jk-kim0 wants to merge 1 commit into
jk/refactor-reverse-sync-strategy-handlersfrom
jk/refactor-reverse-sync-validated-patcher

Conversation

@jk-kim0

@jk-kim0 jk-kim0 commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Summary

publish candidate renderer와 offline diagnostic이 공유하던 boolean strict API를 분리해 validated operation 적용 경계를 명시합니다.

  • xhtml_patcher.py는 fail-closed apply_validated_patches()만 public API로 노출합니다.
  • lenient raw patch 호환 API를 legacy_xhtml_patcher.py로 분리합니다.
  • 공통 DOM mutation 구현을 xhtml_patch_engine.py로 격리합니다.
  • preserving publish renderer는 validated API만 호출하고, CLI offline diagnostic과 raw fixture는 legacy API를 사용합니다.
  • unresolved target, source mismatch, unknown action의 명시적 실패와 legacy skip 호환을 유지합니다.

Impact

  • publish code가 실수로 lenient mode를 선택할 수 없으며 strictness가 API 이름과 module boundary에 고정됩니다.
  • diagnostic fixture의 기존 관대한 동작은 별도 compatibility surface에서 유지됩니다.
  • Confluence PUT이나 production batch는 실행하지 않았습니다.

OpenSpec / stacked PR

  • 기준 change: openspec/changes/complete-reverse-sync
  • 수행 task: xhtml_patcher.py를 validated operation 적용에 집중시키고 legacy raw caller를 분리합니다.
  • Base PR: confluence-mdx: renderer strategy handler를 분리합니다 #1043
  • 열린 PR 확인 결과 같은 API 경계 분리를 다루는 중복 PR은 없습니다.
  • P2 capability 확대와 remote canary는 이번 PR에서 제외합니다.
  • 추가 blocker 또는 미해결 OpenSpec drift는 없습니다.

Test plan

  • focused patcher/planner/CLI tests — 309 passed
  • cd confluence-mdx && venv/bin/pytest -q tests/test_reverse_sync*.py — 792 passed
  • cd confluence-mdx && venv/bin/pytest -q — 1145 passed, 2 skipped
  • cd confluence-mdx/tests && make test-reverse-sync — golden 16 passed, regression 43 passed
  • cd confluence-mdx/tests && make test-convert — 21 passed
  • cd confluence-mdx/tests && make test-byte-verify — fast/splice 각각 21/21 passed
  • openspec validate complete-reverse-sync --strict
  • git diff --check

Related tickets & links

🤖 Generated with Codex

## Summary
publish renderer와 offline diagnostic의 XHTML patch API를 분리합니다.

- xhtml_patcher.py는 fail-closed apply_validated_patches만 노출합니다.
- lenient raw patch 호환 API를 legacy_xhtml_patcher.py로 이동합니다.
- 공통 DOM patch 알고리즘을 xhtml_patch_engine.py로 격리합니다.
- publish preserving renderer와 diagnostic fixture caller를 각 경계로 전환합니다.
- OpenSpec task와 전체 regression 결과를 갱신합니다.

🤖 Generated with Codex

Co-Authored-By: Atlas <atlas@jk.agent>
@vercel

vercel Bot commented Jul 24, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
querypie-docs Ready Ready Preview, Comment Jul 24, 2026 1:36pm

Request Review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f7356f4306

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

"""strict XHTML renderer가 operation을 정확히 적용하지 못했습니다."""
from reverse_sync.xhtml_patch_engine import (
XhtmlPatchError,
patch_xhtml_engine,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Hide the boolean engine from the validated facade

Because patch_xhtml_engine is imported as a normal module attribute, callers can still do from reverse_sync.xhtml_patcher import patch_xhtml_engine or reverse_sync.xhtml_patcher.patch_xhtml_engine(..., strict=False). That leaves the validated facade exposing the same lenient boolean switch this split is meant to remove, so the boundary is not actually fail-closed for code that imports through xhtml_patcher; alias this import to a private name or import it inside apply_validated_patches().

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant