从 /Users/ar/Projects/ExcalidrawX/02-P/plan-progress.markdown 的 P-20260626-m4c-handshake-coordination 领取 Mindraw 侧 MD-H1-03,完成 Phase 3.8 External Write API / Document Lease 的 lease manager 垂直切片。
边界:
createAiResultFrame mutation。PM-* 或 H*。mindrawAcquireWriteLease()、mindrawReleaseWriteLease()、mindrawPeekWriteLease()。actor、documentId、packagePath、sourceFrameId、writePlanId、expectedWorkingRevision、mutationKind。createAiResultFrame mutation kind 作为 lease intent,不实现 mutation 本体。mindrawGetOpenDocumentState() 校验 live workingRevision。writePlanId guard。LEASE_NOT_FOUND、LEASE_EXPIRED、LEASE_ALREADY_HELD、WORKING_REVISION_MISMATCH、MUTATION_NOT_ALLOWED 等失败态测试。mindrawGetCapabilities() 仍保持 external lease / mutation capability unavailable,因为本轮没有暴露外部 transport。MD-H1-04 mutation 只能等待 PM 派发后再启动。src/lib/mindrawAppReadApi.tssrc/lib/mindrawAppWriteLease.tssrc/lib/mindrawAppWriteLease.test.tsCODEGRAPH.mdINDEX.md02-P/qa/mindraw-phase38-lease-manager-check.md02-P/plan-progress.markdown.codex-sessionhistory/2026-06-26-MDH103租约.mdnpm run test:run -- src/lib/mindrawAppWriteLease.test.tsnpm run test:run -- src/lib/mindrawAppWriteLease.test.ts src/lib/mindrawAppReadApi.test.ts src/store/useStore.test.ts src/lib/excalidrawFile.test.tsnpm run buildgit diff --check -- ...commit_write_result / createAiResultFrame mutation。MD-H1-04 后,再实现受控 createAiResultFrame mutation。MD-H1-04 应复用 mindrawPeekWriteLease() 做 commit 前 guard。PM-H5-GATE 继续等待 Mindraw mutation 证据和 m4c M4C-H5-02 证据齐备后再拆。