plan(O): Phase O implementation plan + spec layer-placement fix

Plan: 7 tasks decomposing spec T2..T9 with bite-sized TDD-style steps,
exact file paths, commit-message templates, and a T4 safety-check
branch (refactor in place if ObjectMeshManager._dats call sites <=20;
fall back to thin adapter otherwise).

Spec fix: §4.1 mesh-pipeline files now correctly placed under
src/AcDream.App/Rendering/Wb/ instead of Core (ObjectMeshManager uses
Silk.NET.OpenGL types from Managed* wrappers, and CLAUDE.md forbids
Core depending on GL). §4.2's layer split (TextureHelpers in Core,
rest in App) was already correct.

Plan task order: T2 (setup) -> T5 (Core helpers, lowest risk) ->
T3 (App GL infra) -> T4 (App mesh pipeline + dat-shim) -> T7 (drop
refs + cleanup) -> T8 (visual verification) -> T9 (ship). T5 moved
earlier than spec order to validate the namespace migration flow on
small-blast-radius files before the load-bearing T4.

Self-review: all 12 spec decisions (O-D1..O-D12) mapped to plan tasks;
placeholders intentional + explained (MIT license body fetched at T2
step 4; commit-message parameters filled at task close).

Spec: docs/superpowers/specs/2026-05-21-phase-o-dat-path-unification-design.md

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Erik 2026-05-21 14:49:19 +02:00
parent b9c111b80d
commit ff4164247a
2 changed files with 1063 additions and 7 deletions

File diff suppressed because it is too large Load diff

View file

@ -126,9 +126,11 @@ One reader, one cache, one source of dat truth.
### 4.1 Mesh pipeline (T4 — the load-bearing extraction)
> **Layer placement:** mesh-pipeline files live under `src/AcDream.App/Rendering/Wb/` (NOT Core), because `ObjectMeshManager` and its supports use `Silk.NET.OpenGL` types directly (ManagedGL*, GLSLShader, etc.) and CLAUDE.md forbids Core depending on GL.
| WB source | New acdream home | Adaptation |
|---|---|---|
| `Chorizite.OpenGLSDLBackend.Lib.ObjectMeshManager` | `src/AcDream.Core/Rendering/Wb/ObjectMeshManager.cs` | **Refactor**: replace `IDatReaderWriter` field/ctor-param with `DatCollection`. Update `_dats.X` call sites. Safety check at T4: if >20 sites, fall back to thin adapter. |
| `Chorizite.OpenGLSDLBackend.Lib.ObjectMeshManager` | `src/AcDream.App/Rendering/Wb/ObjectMeshManager.cs` | **Refactor**: replace `IDatReaderWriter` field/ctor-param with `DatCollection` (Core type — App can reference it). Update `_dats.X` call sites. Safety check at T4: if >20 sites, fall back to thin adapter. |
| `Chorizite.OpenGLSDLBackend.Lib.ObjectRenderBatch` + `ObjectRenderData` | Same directory | Verbatim copy. |
| Particle batcher + emitter (T4 supports) | Same | Verbatim copy. |
| `Chorizite.OpenGLSDLBackend.Lib.DebugRenderSettings` | Same | Verbatim copy (constructor parameter type only). |
@ -136,14 +138,16 @@ One reader, one cache, one source of dat truth.
### 4.2 Texture pipeline + GL infrastructure (T3)
> **Layer split:** `TextureHelpers` is pure (no GL, no dat) → goes to Core. All other GL infra → App.
| WB source | New acdream home | Adaptation |
|---|---|---|
| `Chorizite.OpenGLSDLBackend.Lib.TextureHelpers` | `src/AcDream.Core/Rendering/Wb/TextureHelpers.cs` | Verbatim. Pure functions — no dat dependency. |
| `Chorizite.OpenGLSDLBackend.OpenGLGraphicsDevice` | `src/AcDream.App/Rendering/Wb/OpenGLGraphicsDevice.cs` (stays in App because it talks to GL) | Verbatim. No dat dependency. |
| `ManagedGL{Texture,TextureArray,VertexBuffer,IndexBuffer,VertexArray,FrameBuffer,UniformBuffer}` | App `Wb/` directory | Verbatim. |
| `GLSLShader`, `GLHelpers`, `GLStateScope` | App `Wb/` directory | Verbatim. |
| `EmbeddedResourceReader` (internal → public) | Same | Promote `internal``public`. |
| `TextureFormatExtensions`, `BufferUsageExtensions` (internal → public) | Same | Promote `internal``public`. |
| `Chorizite.OpenGLSDLBackend.Lib.TextureHelpers` | `src/AcDream.Core/Rendering/Wb/TextureHelpers.cs` | Verbatim. Pure functions — no dat / no GL. |
| `Chorizite.OpenGLSDLBackend.OpenGLGraphicsDevice` | `src/AcDream.App/Rendering/Wb/OpenGLGraphicsDevice.cs` | Verbatim. Touches GL. |
| `ManagedGL{Texture,TextureArray,VertexBuffer,IndexBuffer,VertexArray,FrameBuffer,UniformBuffer}` | App `Wb/` directory | Verbatim. Touches GL. |
| `GLSLShader`, `GLHelpers`, `GLStateScope` | App `Wb/` directory | Verbatim. Touches GL. |
| `EmbeddedResourceReader` (internal → public) | App `Wb/` directory | Promote `internal``public`. |
| `TextureFormatExtensions`, `BufferUsageExtensions` (internal → public) | App `Wb/` directory | Promote `internal``public`. |
### 4.3 Stateless helpers (T5)