---
phase: 06.3
plan: "02"
subsystem: diagnostics
tags: [client, nameplate, player-renderer, telemetry, flicker]
requires:
  - phase: "06"
    provides: "PlayerRenderer remote simulation tick path and Nameplate.follow() positioning"
provides:
  - "D-45 first-remote nameplate history ring buffer on window.__rebno"
affects: [phase-06.3, D-45, Nameplate, PlayerRenderer]
tech-stack:
  added: []
  patterns: ["Capped diagnostic ring buffer published through unconditional globalThis.__rebno"]
key-files:
  created: []
  modified:
    - apps/client/src/render/Nameplate.ts
    - apps/client/src/render/PlayerRenderer.ts
key-decisions:
  - "Exported NAMETAG_OFFSET_Y so the diagnostic textY calculation tracks the Nameplate constant instead of duplicating a magic number."
patterns-established:
  - "First-remote diagnostics use Map insertion order via this.remotes.keys().next().value."
requirements-completed:
  - REQ-CLI-04
  - REQ-CLI-08
duration: 10 min
completed: 2026-05-14
---

# Phase 06.3 Plan 02: D-45 Flicker Ring Buffer Summary

**Remote nameplate flicker can now be diagnosed from a capped first-remote position history in `window.__rebno`**

## Performance

- **Duration:** 10 min
- **Started:** 2026-05-14T09:01:00Z
- **Completed:** 2026-05-14T09:11:00Z
- **Tasks:** 2
- **Files modified:** 2

## Accomplishments

- Extended `Nameplate.follow()` with an optional debug-info parameter without changing placement behavior.
- Added `window.__rebno.firstRemoteNameplateHistory`, capped at 60 entries and scoped to the first remote only.
- Captured nameplate Y, sprite Y, sprite height, display height, scaleY, originY, and timestamp per remote sim tick.

## Task Commits

1. **Task 1/2: Add and commit first-remote flicker diagnostics** - `8abb2a6` (`spike(06.3-02)`)

## Files Created/Modified

- `apps/client/src/render/Nameplate.ts` - Exported `NAMETAG_OFFSET_Y` and accepted optional debug info in `follow()`.
- `apps/client/src/render/PlayerRenderer.ts` - Published the first-remote nameplate history ring buffer during `onSimulationTickRemote()`.

## Decisions Made

- Exported and reused `NAMETAG_OFFSET_Y` rather than hardcoding `16` in `PlayerRenderer`; this keeps telemetry aligned when Plan 06.3-08 retunes the offset.

## Deviations from Plan

### Auto-fixed Issues

**1. [Rule 2 - Missing Critical] Avoided duplicating the nameplate offset constant**
- **Found during:** Task 1 implementation.
- **Issue:** The plan snippet used an inline `/* NAMETAG_OFFSET_Y */ 16`, which would drift after the upcoming offset retune.
- **Fix:** Exported `NAMETAG_OFFSET_Y` from `Nameplate.ts` and imported it in `PlayerRenderer.ts`.
- **Files modified:** `apps/client/src/render/Nameplate.ts`, `apps/client/src/render/PlayerRenderer.ts`
- **Verification:** Client tests passed.
- **Committed in:** `8abb2a6`

---

**Total deviations:** 1 auto-fixed (1 maintainability/correctness guard).
**Impact on plan:** Keeps the diagnostic more accurate across later Wave 1/2 changes without changing behavior.

## Issues Encountered

None.

## Verification

- `pnpm --filter @rebno/client test --run` - PASS, 26 test files passed, 190 tests passed, 4 todo.
- Acceptance grep confirmed `firstRemoteNameplateHistory`, first-remote guard, displayHeight/scaleY/originY capture, and 60-entry cap.

## User Setup Required

None - no external service configuration required.

## Next Phase Readiness

Ready for `06.3-11` to use the ring buffer while diagnosing/fixing remote nameplate flicker.

---
*Phase: 06.3*
*Completed: 2026-05-14*
