Skip to content

Commit f050abf

Browse files
committed
feat(github-sync): add same-case held-open terminal exit decision gate (OX-210)
Signed-off-by: Eli Ma <eli@patch.sh>
1 parent c8f8eb1 commit f050abf

5 files changed

Lines changed: 325 additions & 12 deletions

File tree

‎docs/plan/plan-20260920.md‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6023,19 +6023,19 @@ docker.yml tag build 双矩阵与 docker manifest job;本计划 REL-OX-01 全
60236023
### Task OX-210:原 held-open live case 的终态退出门(implementation)
60246024

60256025
**Task type:** `implementation`
6026-
**Lifecycle / Acceptance:** `pending` / 空
6026+
**Lifecycle / Acceptance:** `in-progress` / `locally-accepted`
60276027
**Description:** 以 mock 交付唯一终态判定:原顶层 case 等待同 UUID 的 key 缺席、repo 人工补偿观察与本地零残留三份受限结果;操作员 done 标记只唤醒。held-open 1800 秒计时与 marker schema/polling 由 OX-240 承接。本卡只产生 terminal decision/proof;OX-376 写入完整脱敏证据包并由 OX-379 验证后才允许原 invocation 退出,不改变 OX-39 保存的原推送失败。
60286028
**Current evidence:** 模板 ER-13 `docs/plan/plan-template.md:302-305`;OX-40/41 的远端只读核验;OX-212 的本地只读核验;OX-39 的故障捕获。
60296029
**Acceptance criteria:**
6030-
- [ ] AC-1:只接受同 UUID 的 OX-40 key 核验结果。
6031-
- [ ] AC-2:只接受同 UUID 的 OX-41 repo 核验结果。
6032-
- [ ] AC-3:只接受同 UUID 的 OX-212 本地零残留证明。
6033-
- [ ] AC-4:任一受限结果未取得前,原顶层 case 不退出。
6034-
- [ ] AC-5:操作员 done 标记仅唤醒,不生成任何受限结果。
6035-
- [ ] AC-6:三份结果齐备但原推送失败时,原进程仍以原 FAIL 退出。
6036-
- [ ] AC-7:三份结果齐备且原推送正结果完整时,才产生同 UUID terminal PASS proof candidate;进程 exit 0 另须满足 OX-376 durable archive 与 OX-379 安全退出门。
6030+
- [x] AC-1:只接受同 UUID 的 OX-40 key 核验结果。
6031+
- [x] AC-2:只接受同 UUID 的 OX-41 repo 核验结果。
6032+
- [x] AC-3:只接受同 UUID 的 OX-212 本地零残留证明。
6033+
- [x] AC-4:任一受限结果未取得前,原顶层 case 不退出。
6034+
- [x] AC-5:操作员 done 标记仅唤醒,不生成任何受限结果。
6035+
- [x] AC-6:三份结果齐备但原推送失败时,原进程仍以原 FAIL 退出。
6036+
- [x] AC-7:三份结果齐备且原推送正结果完整时,才产生同 UUID terminal PASS proof candidate;进程 exit 0 另须满足 OX-376 durable archive 与 OX-379 安全退出门。
60376037
**Verification:**
6038-
- [ ] VER-1:`source .env.test && cargo test -p mega2 --test integration_github_sync live_same_case_terminal_gate -- --exact --test-threads=1`(new;mock done 伪造、三份同/异 UUID 结果、原失败保留与正结果;不访问 GitHub)。
6038+
- [x] VER-1:`source .env.test && cargo test -p mega2 --test integration_github_sync live_same_case_terminal_gate -- --exact --test-threads=1`(new;mock done 伪造、三份同/异 UUID 结果、原失败保留与正结果;不访问 GitHub)。
60396039
**Dependencies:** `OX-39`、`OX-212`、`OX-40`、`OX-41`。
60406040
**Implementation write set:** `scripts/github-sync-live.sh`、`tests/integration_github_sync.rs`、`docs/refactoring/integration.md`、`docs/plan/plan-20260920.md`。
60416041
**Release write set:** `N/A`(REL-OX-01 plan release child;版本面只由 OX-284 修改)

‎docs/plan/plan-status.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
**2026-11-30 `plan-20260920.md` `OX-210`(原 held-open live case 的终态退出门)本地验收完成:** `in-progress / locally-accepted`(G-12)。在 `scripts/github-sync-live.sh` 新增纯离线终态判定门 `evaluate_same_case_terminal_gate_from_stdin`(`--evaluate-same-case-terminal-gate`):仅同时接受同 UUID 的 `OX-40` `KeyCleanupEvidence`、`OX-41` `RepoCleanupEvidence` 与 `OX-212` `LocalCleanupProof`,将操作员 done 标记严格限定为唤醒信号(零证明生成),缺项或跨 UUID 时持续 `hold_open`,三证齐备但原推送失败时保留 `OX-39` 原始 FAIL(exit 5),仅三证齐备且原推送正结果完整时产出 `TerminalPassProofCandidate`(最终 exit 0 交 `OX-376`/`OX-379` 门);同步更新 `docs/refactoring/integration.md`;VER-1(`live_same_case_terminal_gate`)与 `fmt --check` 全绿。下一卡:`OX-240`。
2+
13
**2026-11-30 `plan-20260920.md` `OX-41`(同一 live case 的私仓缺席核验)本地验收完成:** `in-progress / locally-accepted`(G-12)。在 `scripts/github-sync-live.sh` 新增只读私仓缺席核验入口 `verify_repo_absence_from_stdin`(`--verify-repo-absence`):消费同 UUID `OX-228` `RepoReadPermit`,复核连续操作员身份与双 scope,禁 redirect 观察原路径 `GET /repos/{owner}/{repo} == 404` 并以持久 `repo_node_id` 执行只读 GraphQL `node(id:)` 追查,仅全部成立且 GraphQL 返回 `null` 时签发 `RepoCleanupEvidence`(原 ID 仍可见、授权/scope 丢失、redirect、读写报错及裸 404/裸 null 均 blocked,runner 零 DELETE);同步更新 `docs/refactoring/integration.md`;VER-1(`live_same_case_repo_absence_verify`)与 `fmt --check` 全绿。下一卡:`OX-210`。
24

35
**2026-11-30 `plan-20260920.md` `OX-228`(仓库人工删除后的只读核验准入)本地验收完成:** `in-progress / locally-accepted`(G-12)。在 `scripts/github-sync-live.sh` 新增纯离线准入器 `admit_repo_post_delete_read_permit_from_stdin`(`--admit-repo-post-delete-read-permit`):聚合核对同 UUID `OX-40` `KeyCleanupEvidence`、`OX-219` `RepoDeleteTranscript`、仍有效的 `OX-211` 排他窗口与连续 `OX-203` 具名账号及 owner/admin 权限后签发 `RepoReadPermit`(`proves_repo_absent=false`,runner 零 REST DELETE);错 UUID、旧窗口、账号/权限漂移与伪 204 均返回 `null`;同步更新 `docs/refactoring/integration.md`;VER-1(`live_repo_post_delete_read_permit`)与 `fmt --check` 全绿。下一卡:`OX-41`。

0 commit comments

Comments
 (0)