Skip to content

Docs: ADR-011 + Step Builder Phase 2 async doc sync - #330

Merged
Skymly merged 1 commit into
mainfrom
feature/step-builder-async-docs
Sep 26, 2026
Merged

Skymly merged 1 commit into
mainfrom
feature/step-builder-async-docs

Conversation

@Skymly

@Skymly Skymly commented Sep 26, 2026

Copy link
Copy Markdown
Owner

Summary

Record Step Builder Phase 2 async assemble as ADR-011 and sync maintainer docs with the BuildAsync exit already shipped in #326 / #329.

ADR-010 remains the type-state decision and is not superseded. Async is assemble-exit only: sync T still emits Build(); BCL Task<T> / ValueTask<T> emit only BuildAsync. Product type is the inner T. Cancellation-token rules and the tightened DP086 contract are documented. ROADMAP no longer lists async as an open Phase 2 item; DI and step validation remain.

Related Issue

Closes #327

Relates to #324

Solution module

  • Runtime (DesignPatterns/)
  • Diagnostics (DesignPatterns.Diagnostics/)
  • SourceGenerators (DesignPatterns.SourceGenerators/)
  • Analyzers (DesignPatterns.Analyzers/ + DesignPatterns.CodeFixes/)
  • DependencyInjection (DesignPatterns.Extensions.DependencyInjection/)
  • Package (DesignPatterns.Package/)
  • Docs / Repository (README, docs/, .github/, AGENTS.md, build/)

Type of change

  • Bug fix
  • Feature
  • Source generator / diagnostic / CodeFix change
  • Refactor (no behavior change)
  • Docs / repo metadata only

Test plan

  • Checked ADR-011 and docs/design/StepBuilder.md against the merged generator behavior in SourceGenerators: Emit BuildAsync for async assemble #329: exclusive exit, direct task return, optional CancellationToken forwarding, DP086 illegal contracts
  • ./build.ps1 --target Ci --configuration Release — not run; docs and registry text only, no code or packaging change
  • Sibling samples — not in this PR. Async sample remains DesignPatterns.Samples#29

Breaking changes

  • None
  • Yes — describe migration steps (APIs may still be pre-stable):

Checklist

  • This PR touches only one solution module (see AGENTS.md)
  • Commit messages are in English (no AI/agent tooling mentions in commits)
  • PR description is English only — no AI/agent/Cursor tool attribution, no auto-generated summary blocks (e.g. CURSOR_SUMMARY, "Made with …")
  • No version bumps, tags, releases, or NuGet publish steps included unless explicitly requested
  • Public API / diagnostic / generated code changes are documented if user-visible

Documentation checklist

Keep ADR-010 as the type-state decision and document the BuildAsync exit already shipped so Phase 2 async is no longer listed as an open non-goal.

@Skymly Skymly left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto review (docs-only)

Overall this is a coherent maintainer-doc sync for Step Builder Phase 2 async: ADR-011, Design Doc, ROADMAP, indexes, CHANGELOG, and the DP086 registry line all tell the same story (exclusive Build / BuildAsync exit, product type = inner T, CT forwarding rules, no new diagnostic IDs). Scope matches the Docs module checkbox and the #325 → #326 → #327 slice order.

Findings

  1. ADR-010 vs ADR-011 process tension (should fix or explicitly decide) — docs/DOCUMENTATION.md §2 says Accepted ADR bodies are immutable and later changes go through Superseded by ADR-NNN. ADR-010 still states (decision §1/§5/§6) that only Build() is gated, product type = assemble return type, and async Build/assemble is an MVP non-goal. ADR-011 says it does not supersede ADR-010 while also “lifting” §6 and narrowing §5 for async. A reader who opens ADR-010 alone still gets the old contract. Prefer one of:

    • mark ADR-010’s status line as partially superseded for the async / product-type bullets (if status metadata is allowed to change), or
    • have ADR-011 explicitly supersede those bullets and restate that type-state / the required-step cap remain from ADR-010.
      Leaving both as Accepted with contradictory async wording is the main doc risk in this PR.
  2. AGENTS.md DP080 row not updated — DP086’s registry line was tightened for Task<T> / ValueTask<T> / bare task / multiple CancellationToken, but DP080 still reads only as “assemble 参数无法绑定到步骤”. docs/design/StepBuilder.md already notes the async CancellationToken exemption; the AGENTS diagnostic table should match so the registry stays the single source of truth.

  3. Nit (non-blocking) — Design Doc header version stays v0.2.4-preview1 while Phase 2 async content lands. Fine if you intentionally tie the doc stamp to the package train; otherwise a small doc revision note would make the Phase 2 sync obvious.

Looks good

  • ADR index next number → ADR-012; design index links both ADR-010 and ADR-011.
  • ROADMAP Top-2 and “已完成” bullets correctly move async out of open Phase 2 while leaving DI / step validation and Samples#29 open.
  • WorkGraph comparison row updated for BuildAsync.
  • Negative consequences in ADR-011 (split holder for dual exits; custom awaitable stays sync-shaped; token accepted but maybe not observed) are documented honestly.

No code or packaging changes; skipping CI for docs-only is reasonable. Not a merge blocker if you resolve (1) deliberately; (2) is a small follow-up in this PR or a tiny docs fix.

## 决策

Step Builder 的 **async 只发生在 assemble 出口**。ADR-010 仍是 type-state 与必填上限的决策,**不**被本 ADR 取代。本 ADR 解除 ADR-010 第 6 点里的 async `Build` / assemble 非目标,并只在 async 出口上收窄「产品类型 = assemble 返回类型」的表述。

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This paragraph both keeps ADR-010 as the type-state decision and “lifts” its §6 async non-goal / narrows §5 product-type wording. Under docs/DOCUMENTATION.md §2, Accepted ADR bodies are immutable and later changes are supposed to go through Superseded by. As written, ADR-010 §1/§5/§6 still contradict this page for anyone who does not also open ADR-011.

Please either (a) mark ADR-010’s status as partially superseded for those bullets, or (b) state here explicitly which ADR-010 bullets this ADR supersedes while type-state / the required-step cap remain. Silent coexistence of two Accepted ADRs with opposite async guidance is the main consistency risk.

Comment thread AGENTS.md
@@ -177,7 +177,7 @@ dotnet test DesignPatterns.slnx -c Release
| DP083 | GenerateBuilder 重复步骤(生成器;同名 `[BuilderStep]` 重复) |

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DP086 is updated for the Phase 2 assemble contract, but the DP080 row a few lines above still omits the async CancellationToken exemption that ADR-011 and docs/design/StepBuilder.md now document. Please align the DP080 registry wording (token skipped for step-name binding on async assemble) so AGENTS stays the single diagnostic registry.

@Skymly
Skymly merged commit c082f80 into main Sep 26, 2026
3 checks passed
@Skymly
Skymly deleted the feature/step-builder-async-docs branch September 26, 2026 07:07
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.

Docs: ADR-011 + Step Builder Phase 2 async doc sync

1 participant