Skip to content

[Foundation] Replace BuildManager statics with instance BuildOrchestrator #90

Closed

Description

@ChrisonSimtian

Part of the v11 internal-foundation workstream. See docs/roadmap.md and milestone #6.

Goal

Replace the static BuildManager orchestrator with an instance-based BuildOrchestrator. Execute<T>() stays the public static entrypoint — internally it builds the orchestrator from the DI container and runs it. Migrate the static cancellation-handler linked list to a handler interface registered through DI.

Scope

  • Create BuildOrchestrator (sealed, internal) in Fallout.Build/Execution/. Takes its dependencies (IServiceProvider, IExecutableTargetFactory, IExecutionPlanner, IBuildExecutor, IConsoleHost) via constructor.
  • Move the BuildManager.Execute body into BuildOrchestrator.Run. BuildManager.Execute<T>(...) becomes a thin static wrapper that builds the host and delegates.
  • Replace the static s_cancellationHandlers linked list with an ICancellationHandler singleton; the orchestrator subscribes to console cancel events and dispatches to handlers.
  • Preserve all observable behavior: same exit codes, logging output, resume-file semantics.

Verification

  • BuildOrchestrator has zero static state and can be instantiated multiple times in one process (add a test that does this).
  • Consumer builds still call Execute<T>(...) from Main() with no source changes.
  • Cancellation (Ctrl+C mid-build) still triggers cleanup targets. Manual smoke test: interrupt ./build.ps1 Compile with Ctrl+C.

Out of scope (tracked separately)

Blocks

Activity

  1. ChrisonSimtian commented on Jun 16, 2026

    @ChrisonSimtian
    CollaboratorAuthor

    Superseded by the [Foundation] FT-* series (epic #315), which re-decomposes this engine-foundation work with file:line findings and an explicitly backwards-compatible, facade-preserving scope (vs. the obsolete v11 "breaking" framing here). Tracked going forward by: #306 (static-leak fixes) + #307 (BuildContext) + #310 (context-scoped resolvers). Closing to avoid double-counting milestone #6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions