Commit Graph
3 Commits
Author SHA1 Message Date
Qiu Yuzhou d7169d9f01 refactor(runtime): route catalog sync through the convergence spine
- catalogDidCommit 的 deployed 分支体(派生 + 幂等跳过 + deployPrepared)
  与 deploy() 逐语义等价,改走 deploy();runtimeAlreadyConverged 独立机制
  删除,plan 空判定由 apply 层的 convergencePlanIsEmpty 统一承担。
- deploy/deployPrepared 返回 ConvergenceResult:被取代的派生按 .superseded
  呈现为 .revalidated,其余路径仍由状态面映射。
- reexpand 三-case 开关收敛为 convergeToReexpanded:convergeAgent /
  updateSettings / resyncOnLaunch 各变一行;catalogDidCommit 保留按 case
  的结构化 outcome 映射。
- 统一设置持久化 epilogue 为 persistSettings:setAgentEnabled /
  setSystemProxyEnabled / transitionMode 三处相同 save-fail 语义折叠
  (updateSettings 的 throw 变体与级联关闭的 return-nil 变体语义不同,
  保持原样)。
- SkeletonTests 运行时适配器豁免名单登记 +Convergence.swift。
2026-10-03 11:08:24 +08:00
Qiu Yuzhou 8587b2e80c refactor(runtime): unify apply/restore into the convergence spine
三份「执行 → 健康门 → 失败回滚」编排骨架(mode 切换 / rules 提交 /
deployPrepared)统一为收敛脊柱的 apply 层:

- apply:幂等跳过(派生契约与运行中运行时逐字节相同 → .unchanged,
  不闪 starting、不重走健康门)→ 计划执行 → 健康门(requiresReceipt /
  convergeProxyOnSuccess / preserveProxyOnFailure 逐路径参数照旧)→
  成功后按 proxyTail 收敛系统代理。
- restore:单一回滚例程 + RollbackPlan 两种载荷 policy(mode 的
  settings/mode 回退 + 意图变化强制重收敛;rules 的规则文档恢复)。
  restoreRuntimeDocument/relaunchPreviousInstance 删除——计划层对
  写契约/信号/注销重注的裁决与旧例程逐场景等价。
- 票据 inout 传参:execute 后的 flow 推进对调用方可见,rules 提交在
  apply 之后的时效检查使用推进过的票据。
- ModeTransitionSnapshotForRules 删除,rules 回滚计划在部署入口构建。

行为保持:.run 计划动作全部同步执行,starting 前置不可观测;mode/rules
路径到 apply 时计划必非空,幂等跳过只对 deploy 路径生效(与「有效值未
变的提交不做运行时收敛」不变量一致)。
2026-10-03 10:56:23 +08:00
Qiu Yuzhou dc35e70798 refactor(runtime): capture convergence tickets instead of hand-checked generations
execute 现在返回 RuntimeExecutionOutcome(成功与否 + 本次占用的并发流
代际),mode 与 rules 路径的 24 处手写代际 guard 收拢为 ConvergenceTicket
的 convergenceIsCurrent 检查;两处 flowGeneration + 1 手算随之消失。
行为逐字节保持:mode 路径的 mode 代际仍在派生前捕获、preparation 分量
在派生后推进;rules 路径四个代际事实全查不变。
2026-10-03 10:30:47 +08:00