Self-contained prompt for a fresh Claude Code session. The next session reads it once, has all the context it needs, produces the WB-usage closure audit at docs/research/2026-05-21-phase-o-t1-wb-audit.md, and stops before any extraction. Investigation-only (the /investigate skill applies). User reviews the audit before T2 begins. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
7.2 KiB
Phase O — Task O-T1 — Session Handoff Prompt
Copy everything below the line into a fresh Claude Code session. The prompt is self-contained — the new session reads it once and has all the context it needs.
You are starting Phase O — Task O-T1 on acdream. Phase O is active (pre-empts M1.5 by user direction 2026-05-21). The full phase spec is at:
docs/superpowers/specs/2026-05-21-phase-o-dat-path-unification-design.md
Read that spec first (sections 1-4 are the most relevant to this task). Also read the auto-loaded CLAUDE.md "Currently working toward: Phase O" block.
What you're doing
Phase O extracts the WorldBuilder code we actually use into our own repo
so we can drop the project references and run with one dat reader
(DatCollection) instead of two. Task O-T1 is the safety pass that
must happen BEFORE any extraction: produce a closure of every WB type
and file we transitively use, so T2–T7 don't miss a dependency and
break the build at the "drop project references" step.
This is the /investigate skill territory — REPORT-ONLY. Do not
move files, do not edit source, do not run dotnet build/test. Read
files, run read-only diagnostics (grep, git, find), and produce
a single markdown audit document. The user will review and approve
before any extraction starts in a later session.
Inputs available to you
- Our code that consumes WB:
src/AcDream.App/Rendering/Wb/*.cs— adapters that wrap WB. Start withWbMeshAdapter.csandWbDrawDispatcher.cs.src/AcDream.App/Rendering/TerrainModernRenderer.cs— uses some WB types but is our own renderer.- Anywhere else with
using WorldBuilder.*orusing Chorizite.OpenGLSDLBackend*. Grep for both.
- The WB source itself:
references/WorldBuilder/WorldBuilder.Shared/— types we use directlyreferences/WorldBuilder/Chorizite.OpenGLSDLBackend/— the rendering code we use (ObjectMeshManager,TextureHelpers,SceneryHelpers,LandSurfaceManager,OpenGLGraphicsDevice,Frustum, etc.)
- CSProj files (the formal dependency boundary):
src/AcDream.App/AcDream.App.csproj— has the WB ProjectReference entriessrc/AcDream.Core/AcDream.Core.csproj— same
Concrete steps
-
Direct-use enumeration. Find every
using WorldBuilder.*andusing Chorizite.OpenGLSDLBackend*line insrc/AcDream.*. For each file, list the specific WB types it references (e.g.,ObjectMeshManager,OpenGLGraphicsDevice,TextureKey,ObjectRenderBatch). Don't forgetnameof()and string references in tests. -
Transitive closure. For each WB type in the direct-use set, open its file in
references/WorldBuilder/and list its dependencies on other WB types. Walk the graph until closed. Be systematic —ObjectMeshManagerwill pull on a lot. -
Per-file inventory. For each WB file in the closure:
- Path (relative to
references/WorldBuilder/) - Line count (
wc -l) - One-line role description
- Direct callers in our codebase (if any) or in WB (if transitive)
- Whether it touches
IDatReaderWriter/DefaultDatReaderWriter(these become DatCollection-swap candidates) - Whether it touches GL state directly (matters for T3 — GL infra extraction has different risk than dat-touching code)
- Path (relative to
-
Categorize by extraction task. Bucket each file into one of:
- T3 candidate (texture / GL infrastructure, no dat dep)
- T4 candidate (mesh pipeline)
- T5 candidate (scenery / terrain blending)
- T6 candidate (EnvCell / portal)
- NOT EXTRACTED (we use it via project reference today but can drop entirely — e.g., the WB editor tools, anything not in our render path). Justify the "not extracted" call for each.
-
Hidden-dependency probes (the things that bite at T7):
- Does WB use any
internaltypes that are only accessible to classes inside the WB project? If so, we'll have to make thempublicor copy more. - Does WB use any source generators, .targets files, or build hooks that we'd need to replicate?
- Are there resource files (.png, .glsl, .shader) we need to copy?
- Does WB's
DefaultDatReaderWriterdiffer from ourDatCollectionin any behavioral way that would matter when we swap? (Caching, thread safety, the same-file-different-handle thing, etc.) Don't fully audit — just flag the questions.
- Does WB use any
-
Thread-model spot-check (open question O-Q1 in the spec):
- Is
ObjectMeshManagercalled from the render thread only, or does ourLandblockStreamerworker thread call into it?grepfor the call sites. If the worker thread reaches WB code, flag it — we may have a latent race today that becomes obvious after extraction.
- Is
Output
Write the audit to:
docs/research/2026-05-21-phase-o-t1-wb-audit.md
Suggested structure:
# Phase O — Task O-T1 — WB Usage Audit
## Direct use surface
(Table of (our file, WB types used))
## Transitive closure
(Tree or table walking from direct types through WB internals)
## Per-file inventory
(Table: path, LOC, role, dat-touch?, GL-touch?, target task bucket)
## Extraction-task mapping
- **T3 (GL infra):** N files, ~M LOC
- **T4 (mesh):** N files, ~M LOC
- **T5 (scenery/terrain):** N files, ~M LOC
- **T6 (EnvCell/portal):** N files, ~M LOC
- **NOT extracted:** N files, with justifications
## Hidden-dependency risks
(Bulleted list of things flagged in step 5)
## Thread-model finding
(Yes/no + evidence on whether WB is called from the worker thread)
## Open questions for user
(Anything unclear that the user needs to call before T2 starts)
Cap the audit doc at ~500 lines. If the closure is bigger than that, inline the per-file table for the top 30 files by LOC and link to a separate appendix file for the long tail.
Acceptance for O-T1
- Audit doc exists at the path above.
- Every file in the closure is bucketed (T3 / T4 / T5 / T6 / NOT).
- Hidden-dependency risks section has at least the four items in step 5 addressed (even if the answer is "none found").
- No source code edited. No
dotnet build/test. No project files touched. (Verify withgit statusat the end — only the new audit doc + maybegit ls-files | grep WorldBuilder | wc -l-style diagnostic output should appear.)
When you're done
Report back in chat with:
- Total LOC of the closure (the rough size of the extraction).
- The bucket breakdown (how many files / LOC per task).
- Any sharp edges flagged in the hidden-dependency risks section.
- Your honest read on whether the 7-8 day estimate in spec §5 is reasonable given what you found, or whether it needs a revision.
Then stop. Do not start T2. The user reviews the audit before extraction begins.
Reminders
- You are operating under the
/investigateskill rules (no edits). references/WorldBuilder/is the source to grep through, NOT to edit.- WB is MIT-licensed; the eventual extraction is license-clean. You don't need to think about that here.
- If something in the audit surfaces a reason Phase O shouldn't proceed (e.g., WB has a license clause we missed, or the closure is 50K LOC instead of 5K), say so clearly. We'd rather know now.