Skip to content

confluence-mdx: reverse-sync typed plan 경계를 도입합니다#1033

Open
jk-kim0 wants to merge 1 commit into
jk/fix-reverse-sync-provenance-identityfrom
jk/refactor-reverse-sync-typed-plan
Open

confluence-mdx: reverse-sync typed plan 경계를 도입합니다#1033
jk-kim0 wants to merge 1 commit into
jk/fix-reverse-sync-provenance-identityfrom
jk/refactor-reverse-sync-typed-plan

Conversation

@jk-kim0

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

Copy link
Copy Markdown
Contributor

Summary

reverse-sync push 경로가 build_patches()의 raw dict를 직접 신뢰하지 않도록 typed planning과 renderer boundary를 도입합니다.

  • capabilities.py에 capability ID, support level, renderer owner, required proof, block reason registry를 추가합니다.
  • operations.py에 immutable ChangeIntent, TargetIdentity, PatchOperation, PatchPlan schema v2를 추가합니다.
  • planner.py가 기존 build_patches()legacy-patch-builder-v2 adapter로 감싸고 raw dict를 typed plan에 격리합니다.
  • MDX content hash와 line range가 모두 일치하는 유일한 sidecar provenance를 operation target과 결합합니다.
  • exact intent provenance가 없거나 하나의 intent가 여러 operation에 대응하면 intent_complete를 허용하지 않습니다.
  • push 경로의 raw_html_table_editunknown_macro_mutationunsupported_capability로 차단합니다.
  • source formatting용 empty block이 <p></p> insert mutation으로 바뀌지 않도록 제거합니다.
  • render_patch_plan_preserving()이 target fragment hash, sidecar MDX hash, line range를 base와 다시 비교한 뒤에만 raw renderer input을 복원합니다.
  • CLI와 local proof가 raw patch dict 대신 typed plan을 소비하도록 전환하고 tool version을 reverse-sync-cli-v5로 올립니다.

OpenSpec

  • 기준 change: openspec/changes/complete-reverse-sync
  • 완료: P1 typed PatchPlan/operation 및 raw patch boundary
  • 계속 남는 범위: patch_builder.py의 capability별 strategy 추출, visible model 확장, 모든 table/macro skip reason의 capability 표준화
  • 이 PR은 현재 migration adapter의 완료 범위를 design과 tasks에 정확히 기록합니다.

Safety impact

  • legacy builder가 target을 제안하더라도 strict plan의 exact provenance와 일치하지 않으면 renderer에서 실행하지 않습니다.
  • 검증 후 target identity가 바뀌거나 다른 base에 plan을 적용하면 PatchApplicationError로 차단합니다.
  • blocked capability는 candidate에 일부 적용하지 않고 stable reason code로 남깁니다.
  • offline diagnostic은 기존 text fallback과 renderer 호환성을 유지하지만 push eligibility를 부여하지 않습니다.

Test plan

  • 전체 Python test: 1096 passed, 2 skipped
  • reverse-sync Python test: 773 passed
  • make test-convert: 21 passed
  • make test-reverse-sync: golden 16 passed, regression 43 passed
  • make test-byte-verify: fast/splice 각각 21/21 passed
  • openspec validate complete-reverse-sync --strict
  • git diff --check
  • Python compileall

Stack

🤖 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 11:14am

Request Review

## Summary
reverse-sync push 경로가 raw patch dict를 직접 신뢰하지 않도록 typed planning과 renderer boundary를 도입합니다.

- capability registry와 immutable ChangeIntent, TargetIdentity, PatchOperation, PatchPlan을 추가합니다.
- exact sidecar provenance와 MDX intent가 대응하지 않는 operation을 missing_identity로 차단합니다.
- raw HTML table과 unknown macro mutation을 unsupported_capability로 차단합니다.
- empty source line이 p element mutation으로 바뀌는 legacy insert를 제거합니다.
- typed renderer가 target fragment hash, MDX hash, line range를 base sidecar와 다시 검증합니다.
- CLI와 local proof에서 raw patch dict를 제거하고 schema v2 plan을 사용하도록 전환합니다.
- tool version을 v5로 갱신하고 OpenSpec P1 task를 구현 결과와 동기화합니다.

## Test plan
- [x] 전체 Python test 1096 passed, 2 skipped
- [x] reverse-sync Python test 773 passed
- [x] make test-convert 21 passed
- [x] make test-reverse-sync golden 16 passed, regression 43 passed
- [x] make test-byte-verify fast/splice 각각 21/21 passed
- [x] openspec validate complete-reverse-sync --strict
- [x] git diff --check
- [x] Python compileall

🤖 Generated with Codex

Co-Authored-By: Atlas <atlas@jk.agent>
@jk-kim0
jk-kim0 force-pushed the jk/refactor-reverse-sync-typed-plan branch from 8188d3d to f39eecf Compare July 24, 2026 11:08

@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: 8188d3d22b

ℹ️ 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".

Comment on lines +191 to +193
intent = intent_by_ordinal.get(ordinal)
if intent is None or intent.provenance_xpath:
return ()

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 Skip already-covered added intents for inserts

When a replace is followed by an insert, such as splitting one paragraph into two, the first added change is already covered by the replace_fragment operation and therefore has provenance_xpath; this branch marks that ordinal as assigned and immediately returns no intent instead of continuing to the next added change. The subsequent real insert is then treated as missing_identity, so intent_complete fails and online push is blocked for valid multi-block replacement edits.

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