Skip to content

[Foundation] Wrap IO/process/console statics behind injectable interfaces #91

Closed

Description

@ChrisonSimtian

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

Goal

Introduce minimal infrastructure interfaces for the cross-cutting concerns currently embedded as statics. Ship a default implementation of each that delegates to the current static behavior. Plumb them through DI so the orchestrator and executor can take fakes in tests.

Scope — interfaces

  • IFileSystem — file/directory existence, read/write text, enumerate. Default wraps System.IO.
  • IProcessRunner — sync and async process invocation with output capture. Default wraps the current ProcessTasks.StartProcess logic.
  • IConsoleHost — console writes with theming, log-block boundaries, terminal capability detection. Default wraps the current Host hierarchy.
  • IBuildStatePersistence — read/write the build-attempt resume file (currently inline in BuildExecutor). Default writes to <root>/.build/.

Statics on the surface stay (ProcessTasks.StartProcess, AbsolutePath.Exists, etc.) — they resolve the interface from a per-build ambient IServiceProvider. No consumer code changes.

Verification

  • Each interface has at least one fake test double used in a unit test.
  • New BuildExecutorTests: inject a fake IBuildStatePersistence and assert resume-file semantics without touching disk.
  • dotnet test tests/Fallout.Common.Tests still green.

Out of scope (tracked separately)

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: #310 (#FT-5: context-scope tool-path resolvers & process defaults). 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