Skip to content

[anolisa] refactor: unify plan, dry-run, and outcomes #2702

Description

@ikunkun-sys

背景

生命周期 planner 已返回 typed Plan,但 mutation handler 仍各自读取 dry_run、决定是否执行、构造结果并映射 warning/partial/failure。权限 policy 只能允许 preview 进入 handler,不能从结构上保证 preview 不取得 effect executor;human 与 JSON 也仍由各命令分别拼装结果语义。

目标

建立统一的 execution intent、plan disposition 和 typed outcome contract。保留现有 domain Plan/Step,让应用层明确区分 plan-only 与 apply,并逐步让 mutation command 从同一个 outcome 渲染现有 human/JSON 输出。

迁移切片

每个消费者使用独立 sub-issue、分支和 PR;contract 只随已选纵向切片扩展。

验收标准

  • plan-only intent 不进入 apply 分支。
  • 复用现有 typed planner output,不维护平行 step vocabulary。
  • completed、partial 和 failed outcome 保留 operation ID、typed changes 与 warnings。
  • human 与 JSON 迁移后从同一个 outcome 投影,保持现有 schema 和退出码。
  • dry-run 测试证明 filesystem、package、service 和 adapter effects 未被调用。

非目标

  • 不把所有 read-only command 塞入统一 enum。
  • 不立即迁移所有 mutation handler。
  • 不修改现有 JSON schema、human output 或退出码。
  • 不把 progress event 当作 durable operation log。

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions