---
phase: 03.1-remove-virtual-tracker
plan: 01
subsystem: driver
tags: [openvr, steamvr, proximity, hmd-property, cleanup]

# Dependency graph
requires:
  - phase: 03-proximity-component-spike
    provides: "Proof that SetBoolProperty on HMD container is the working standby/wake mechanism"
provides:
  - "Clean driver with no virtual tracker device registered"
  - "SetHmdProximity() as primary HMD property write mechanism"
  - "Pipe commands wired directly to HMD property writes"
  - "CLI tool with proximity on/off, status, fallback1 on/off"
affects: [03.1-02-verify-clean-driver, 04-hid-proximity-reports]

# Tech tracking
tech-stack:
  added: []
  patterns: [direct-hmd-property-write, state-change-guard]

key-files:
  created: []
  modified:
    - src/driver/device_provider.h
    - src/driver/device_provider.cpp
    - src/ctl/main.cpp
    - CMakeLists.txt

key-decisions:
  - "TryFallback1 renamed to SetHmdProximity as primary mechanism (no longer a fallback)"
  - "State-change guard (m_bProximity) prevents duplicate HMD property writes"
  - "SetHmdProximity(true) called on startup so HMD has proximity sensor from init"
  - "fallback1 on/off kept in CLI as legacy alias for backward compatibility"

patterns-established:
  - "Direct HMD property write: SetBoolProperty(Prop_ContainsProximitySensor_Bool) on HMD container"
  - "Proximity state local to DeviceProvider: bool m_bProximity with change guard"

requirements-completed: []

# Metrics
duration: 4min
completed: 2026-03-22
---

# Phase 03.1 Plan 01: Remove Virtual Tracker Summary

**Removed GenericTracker virtual device, promoted SetBoolProperty on HMD container as sole proximity mechanism via SetHmdProximity()**

## Performance

- **Duration:** 4 min
- **Started:** 2026-03-22T09:42:21Z
- **Completed:** 2026-03-22T09:46:00Z
- **Tasks:** 3
- **Files modified:** 5 (2 deleted, 3 modified)

## Accomplishments
- Deleted ProximityDevice class entirely (proximity_device.h, proximity_device.cpp) and removed from build
- Rewrote DeviceProvider to remove all tracker code, promote HMD property write as primary mechanism
- Eliminated TryFallback2 (CreateBooleanComponent on HMD) and TryFallback3 (VendorSpecificEvent) dead code
- Rewired pipe commands to call SetHmdProximity() directly instead of routing through ProximityDevice
- Driver builds cleanly with MSVC/CMake producing both DLL and CLI exe

## Task Commits

Each task was committed atomically:

1. **Task 1: Delete ProximityDevice and update CMakeLists.txt** - `d5411ee` (chore)
2. **Task 2: Rewrite DeviceProvider -- remove tracker, promote HMD property write, rewire pipe** - `d25cedc` (feat)
3. **Task 3: Update CLI tool and build** - `534dc8d` (feat)

## Files Created/Modified
- `src/driver/proximity_device.h` - DELETED (tracker device header)
- `src/driver/proximity_device.cpp` - DELETED (tracker device implementation)
- `src/driver/device_provider.h` - Cleaned: no ProximityDevice, no fallback2/3, added m_bProximity and SetHmdProximity
- `src/driver/device_provider.cpp` - Rewritten: no TrackedDeviceAdded, pipe commands call SetHmdProximity directly
- `src/ctl/main.cpp` - Removed fallback2/3 commands, kept fallback1 as legacy alias
- `CMakeLists.txt` - Removed proximity_device source entries from add_library

## Decisions Made
- Renamed TryFallback1 to SetHmdProximity -- it is the primary mechanism, not a fallback
- Added state-change guard (m_bProximity check) to prevent duplicate SetBoolProperty calls
- Call SetHmdProximity(true) in Init() after CreatePipeServer so HMD has proximity from startup
- Kept fallback1 on/off as CLI aliases for backward compatibility with existing scripts
- Status command now reports "hid=open/closed" instead of "fb2_created=true/false"

## Deviations from Plan

None - plan executed exactly as written.

## Issues Encountered

None

## User Setup Required

None - no external service configuration required.

## Next Phase Readiness
- Driver builds cleanly with no tracker code
- HMD property write is the sole proximity mechanism
- Ready for Plan 02 (verification) to confirm clean driver behavior in SteamVR

## Self-Check: PASSED

All files, commits, and build outputs verified.

---
*Phase: 03.1-remove-virtual-tracker*
*Completed: 2026-03-22*
