Skip to content

Update stale plan document examples (docs/plans/phase-2-consistency-fixes.md Phase 2) #13

@JohnLudlow

Description

@JohnLudlow

Overview

Update docs/plans/phase-2-headless-adapter-development.md so that all code examples and description text match the current source implementation. Three locations in the document contain stale content from an earlier design:

  1. HeadlessAdapter class summary in the example (line 122) — still says "Records all provider calls" which no longer describes the implementation.
  2. HeadlessRenderProvider example block (lines 184–220) — shows the superseded List<object> _recordedCommands approach; actual implementation uses three separate typed lists.
  3. Technical Details prose (lines 90 and 94) — describes old Play/Stop method names and a single list.

No source code changes; this is a documentation correction only.

Plan issue

Plan status

Not started

Definition of terms

Term Meaning
Stale example A code block or description in a plan document that reflected an earlier design and was not updated when the source was refactored.

Architectural considerations and constraints

  • No source code changes. This phase edits only docs/plans/phase-2-headless-adapter-development.md.
  • The updated document must pass rumdl check . after edits.
  • All other sections of the plan document are unaffected.

Implementation guide

Plan requirements

  • (Not started) Plan document examples match source

    • GIVEN the updated plan document
    • WHEN compared to the current source files
    • THEN no code example or description contradicts the implementation
  • (Not started) Plan document passes linting

    • GIVEN the updated plan document
    • WHEN rumdl check . is run from the repository root
    • THEN no lint errors are reported

Phase 1 — Apply three targeted edits

Not started

Objective

Edit three locations in docs/plans/phase-2-headless-adapter-development.md to reflect the current source.

Technical details

Edit 1 — HeadlessAdapter class summary (line 122)

Current:

/// <summary>
/// Simulates engine operations for headless, deterministic testing.
/// Records all provider calls for verification.
/// </summary>

Replace with:

/// <summary>
/// Simulates engine operations for headless, deterministic testing.
/// Exposes provider instances; individual providers may record their own calls for verification.
/// </summary>

Edit 2 — HeadlessRenderProvider example block (lines 184–220)

Replace the entire code block (which shows List<object> _recordedCommands) with the current implementation using three typed lists:

// src/GameEngineAdapter.Headless/HeadlessRenderProvider.cs

public sealed class HeadlessRenderProvider : IRenderProvider
{
    private readonly List<SpriteDrawDto> _recordedSprites = [];
    private readonly List<TextDrawDto> _recordedTexts = [];
    private readonly List<MeshDrawDto> _recordedMeshes = [];

    public IReadOnlyList<SpriteDrawDto> RecordedSprites => _recordedSprites;
    public IReadOnlyList<TextDrawDto> RecordedTexts => _recordedTexts;
    public IReadOnlyList<MeshDrawDto> RecordedMeshes => _recordedMeshes;

    public FrameScope BeginFrame(in CameraDescriptor camera) => new();
    public void SubmitSprite(in SpriteDrawDto dto) => _recordedSprites.Add(dto);
    public void SubmitText(in TextDrawDto dto) => _recordedTexts.Add(dto);
    public void SubmitMesh(in MeshDrawDto dto) => _recordedMeshes.Add(dto);
    public void EndFrame() { }
    public void Present() { }

    public void Clear()
    {
        _recordedSprites.Clear();
        _recordedTexts.Clear();
        _recordedMeshes.Clear();
    }
}

Edit 3 — Technical Details prose (lines 90 and 94)

Line 90 — replace:

Records all render commands (SubmitSprite, SubmitText, SubmitMesh) to an in-memory list for later inspection.

With:

Records all render commands (SubmitSprite, SubmitText, SubmitMesh) to separate typed lists per draw type (RecordedSprites, RecordedTexts, RecordedMeshes) for later inspection.

Line 94 — replace:

Records calls (Play, Stop, SetVolume) for test assertion.

With:

Records calls (StartPlayback, StopPlayback, SetVolume) for test assertion.

Phase requirements

  • (Not started) HeadlessAdapter class summary updated

    • GIVEN the edited plan document
    • WHEN the class summary in the HeadlessAdapter example is read
    • THEN it does not mention "Records all provider calls"
  • (Not started) HeadlessRenderProvider example shows typed lists

    • GIVEN the edited plan document
    • WHEN the HeadlessRenderProvider code block is read
    • THEN it shows RecordedSprites, RecordedTexts, and RecordedMeshes
  • (Not started) Technical Details uses current method names

    • GIVEN the edited plan document
    • WHEN lines 90 and 94 are read
    • THEN method names are StartPlayback/StopPlayback and typed-list terminology is used

See also

Metadata

Metadata

Labels

area-libItems related to reusable librariesarea-technicalsystemsInternal systems to do with game developmentenhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions