Skip to content

SourceGenerators: GenerateBuilderGenerator + Verify #290

Description

@Skymly

Parent

#287

What to build

A source generator that turns a [GenerateBuilder] schema holder into {Holder}Builder: generic type-state markers for required steps (ADR-010), at-most-once step methods, gated Build() that invokes the [BuilderAssemble] method with name-bound arguments (optional unset → null). Emit diagnostics allocated in #289 for cap, missing assemble, binding mismatch, mutex, partial order, and related schema errors. Lock behaviour with Verify snapshots.

Acceptance criteria

  • Generator emits {Holder}Builder with type-state markers; Build only on fully-set required markers (ADR-010)
  • Assemble method discovered via [BuilderAssemble]; parameters bind by name; product type from return type
  • Step methods are signature/schema only; state lives on the generated builder; steps at most once
  • Optional steps do not consume required markers; unset optional args pass as null-compatible values
  • Free order by default; After/Before and mutex groups reported as diagnostics (not type-state)
  • Required-step count > 8 is a generator Error; optional steps excluded from the cap
  • Verify covers happy path and diagnostic cases; no private-helper-only assertions
  • Sync-only MVP; no DI/Autofac emission

Blocked by

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agentFully specified, ready for an AFK agent

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions