# Session handoff — 2026-05-16

## What landed this session

**M1 — "Walkable + clickable world" — ✅ LANDED on main at `fb92122`.**

All four M1 demo targets work end-to-end retail-faithfully:
1. Walk through Holtburg without getting stuck (L.2 collision) — outdoor only verified
2. Open the inn door (B.4c)
3. Click an NPC and see dialogue (B.4b + Phase B.6)
4. Pick up an item from the ground (B.5 + Phase B.6)

**Important caveat:** the M1 demo specifically did NOT test:
- Walking around inside the inn (just the doorway)
- Going up stairs
- Indoor-to-indoor transitions
- Indoor lighting correctness

These were assumed to "probably work" because outdoor walking does. They likely don't.

## Main branch history (newest first)

| SHA | Title |
|---|---|
| `5d79dd3` | docs: session handoff 2026-05-16 (this doc; will be overwritten when you read this) |
| `fb92122` | milestone: M1 landed; flip "currently working toward" to M2 |
| `d640ed7` | feat(retail): Phase B.6 — server-driven auto-walk done right |
| `b5da17d` | feat(retail): Commit B — retail-faithful AP cadence + screen-rect picker |
| `e2bc3a9` | (base — docs(CLAUDE.md): document Ghidra MCP + WireMCP availability) |

## Phase B.6 (today's big landing) — what it actually did

Replaced the chain of Commit-B workarounds that compensated for ACE's `MoveToChain` getting cancelled by a leaked user-MoveToState packet during inbound auto-walk. The fix was architectural:

- **`ApplyAutoWalkOverlay → DriveServerAutoWalk`** — auto-walk drives the body's velocity + motion state + animation cycle DIRECTLY from the wire-supplied path data. No player-input synthesis. Mirrors retail's `MovementManager::PerformMovement` case 6 (decomp `0x00524440`) which never touches the user-input pipeline during server-controlled auto-walk.
- **Wire-layer guard retained** at `GameWindow.cs:6419` as a semantic statement (user-MoveToState packets are for user-driven motion intent), NOT as the band-aid the deleted 500ms grace period was.
- **Walk/run threshold = 1.0m** (matches user-observed retail behaviour; ACE's wire-default 15.0f is ignored — overridden in `BeginServerAutoWalk` via const `RetailWalkRunThresholdMeters`). Formula from decomp `0x0052aa00 MovementParameters::get_command`: `running = (initialDist - distance_to_object) >= threshold`, one-shot at chain start.
- **Animation cycle plumbed** for moving-forward (RunForward/WalkForward) AND turn-first phase (TurnLeft/TurnRight via `_autoWalkTurnDirectionThisFrame`).
- **Pickup gate** corrected to check `BF_STUCK` (`acclient.h:6435`, bit `0x4`) — signs (`pwd=0x14`) blocked; spell components (`pwd=0x10`) allowed.
- **R-key dispatches by target type** — creature → SendUse, pickupable → SendPickUp, useable → SendUse, else toast.
- **AP cadence reverted** to retail's two-branch `ShouldSendPositionEvent` gate (`acclient_2013_pseudo_c.txt:700233-700285`). Effective rates: 0 Hz idle, ~1 Hz smooth motion, per-event on cell/plane changes, 0 Hz airborne. `ApproxPlaneEqual` helper added.

Issues closed: **#63, #69, #74, #75**.

## New rules / preferences captured this session

1. **No workarounds without explicit approval.** CLAUDE.md "How to operate" + `memory/feedback_no_workarounds.md`. Band-aids, grace periods, suppression flags, retry loops forbidden unless the user explicitly approves or it's a deliberate new-feature design.

2. **No milestone demo videos.** CLAUDE.md "milestone discipline" rule #3 + `memory/feedback_no_demo_videos.md`. Milestones land via text-only artifacts.

3. **Graceful client shutdown via `CloseMainWindow`.** CLAUDE.md "Logout-before-reconnect" section. `Stop-Process` is a hard kill — leaves ACE's session marked logged-in for ~3+ min before timeout.

## Direction redirect at session end

The originally-planned **M2 — "Kill a drudge"** is being **deferred** in favor of fundamentals-first work. User's stated reasoning: indoor walking, physics correctness, and lighting are all untested or broken, and building combat on top of an unverified-indoor foundation would compound problems.

**New M2 candidate — "Indoor walkability."** Demo scenario candidate: walk into the Holtburg inn, climb to the second floor, look around, walk back out — all with sensible camera + correct indoor lighting + collision-clean. Three sub-phases proposed:

| Phase | Scope | Estimate |
|---|---|---|
| Camera correctness | Sphere-cast from player to camera position; snap to first wall hit; lerp recovery when clear. Prevent camera from dipping below ground. Indoor-specific but applies everywhere. | ~1 day |
| Indoor collision audit | Walk every floor of the Holtburg inn (and a nearby small dungeon if time). Document each off-feeling spot — stairs, narrow halls, EnvCell-to-EnvCell transitions, EnvCell-to-outdoor seams. Fix scoped per finding. | ~1 week |
| Indoor lighting basics | Tightly scoped: torch-light pools + proper indoor ambient (dim). Defer fire/lamp/glow particles + dynamic-light count optimization to M5. Touches shader pipeline (modern bindless path) + per-object light selection. | ~1-2 weeks |

Order matters: camera fix first (you can't honestly audit collision while the camera fights you), then collision audit (find the bugs), then lighting (the visual unlock).

**This milestone has not been formally renamed in `docs/plans/2026-05-12-milestones.md` yet.** The doc still says "M2 — Kill a drudge." The next session should brainstorm the new milestone (using `superpowers:brainstorming`), agree on the demo scenario, scope the sub-phases, then update the milestones doc + CLAUDE.md to reflect the reorder. Combat slides to M3.

## Test baseline

- Core.Net: 294/294 ✅
- Core: 1073/1081 (8 pre-existing Physics failures — BSPStepUp + MotionInterpreter; unchanged baseline)

## Environment reminders

- ACE running locally on `127.0.0.1:9000` (testaccount / testpassword / `+Acdream` at `0x5000000A`).
- DAT directory: `%USERPROFILE%\Documents\Asheron's Call`.
- Worktree branch `claude/vigilant-golick-9433e1` has the full 20-commit Phase B.6 history; main has one squashed commit (`d640ed7`).
- WorldBuilder submodule needs `git submodule update --init references/WorldBuilder` in fresh worktrees.

## Open issues worth tracking

- **#61** — AnimationSequencer link→cycle frame-0 flash on door swing. LOW.
- **#64** — Local-player pickup animation does not render. LOW.
- **#70** — Triangle apex/size DAT sprite. LOW.
- **#71** — WorldPicker Stage B polygon refine. LOW.
- **#72** — cdb probe to confirm `omega.z = π/2` base rate. LOW.
- **#73** — Retail-message centralization. Per-feature, ongoing.

None block the new indoor milestone. All M7 polish.
