# BRIEFING — 2026-10-02T07:17:00Z

## Mission
Investigate the root cause and formulate the exact remediation strategy, code diffs, and verification tests for Spacebar dodge roll charge accounting defects (double-decrement from 3 to 1 and charge consumption during i-frame).

## 🔒 My Identity
- Archetype: teamwork_preview_explorer
- Roles: Controls & Charge Accounting Remediation Explorer
- Working directory: c:\Projects\FreeExile\.agents\teamwork\explorer_18_3
- Original parent: 75463099-5538-440a-8ff9-91c183526f7a
- Milestone: Remediation of Spacebar Dodge Charge Accounting Defect

## 🔒 Key Constraints
- Read-only investigation — do NOT implement
- Do NOT modify client/web_pc/js/pc_input_controller.js directly
- Keep .agents/teamwork/ purely for metadata

## Current Parent
- Conversation ID: 75463099-5538-440a-8ff9-91c183526f7a
- Updated: 2026-10-02T07:17:00Z

## Investigation State
- **Explored paths**:
  - `client/web_pc/js/pc_input_controller.js` (lines 40, 185-198)
  - `client/webapp/js/engine/combat_skills.js` (lines 276-305)
  - `client/webapp/js/ui/skill_bar_controller.js` (lines 48, 120-158, 167-179, 300-318)
  - `client/webapp/js/engine/canvas_renderer.js` (lines 207-222)
  - `client/web_pc/index.html` (lines 85-98, 340, 368)
  - `tests/unit/test_pc_input_controller.py`
  - `tests/e2e/test_pc_desktop_client_e2e.py`
  - `.agents/teamwork/challenger_18_1/test_targeted_findings.py`
- **Key findings**:
  - Root cause 1: Redundant `this.triggerUiCooldown('dodge', 3.0)` in `pc_input_controller.js:195` after `window.doDodge()` in `combat_skills.js:304` already invoked `skillBarController.triggerCooldown('dodge', 3.0)`.
  - Root cause 2: `skill_bar_controller.js:317` registers a duplicate bubbling keydown listener on `window`. When Space is pressed while `player.isIFrame === true`, `doDodge()` returns early without decrementing charges, but `skillBarController.activateSlot` detects no charge change and unconditionally invokes `triggerCooldown` anyway, wasting a charge.
  - Solution: In `pc_input_controller.js`, register `keydown` in the capture phase (`window.addEventListener('keydown', (e) => this.onKeyDown(e), true)`). On `e.code === 'Space'`, execute `e.preventDefault()`, `e.stopImmediatePropagation?.()`, guard `if (window.player && window.player.isIFrame) return;`, invoke `window.doDodge()` without duplicate cooldown, and only invoke `triggerUiCooldown` in fallback branch.
  - Companion Fix: Add `<div id="badge-iframe" class="hidden"></div>` to `client/web_pc/index.html` to eliminate `TypeError: Cannot read properties of null (reading 'classList')` upon 0.25s i-frame expiry.
  - Validated empirically with 100% pass across 6 stages in `test_proposed_fix.py`.
- **Unexplored areas**: None. Problem boundary fully mapped and empirically proven.

## Key Decisions Made
- Use capture phase (`true`) and `e.stopImmediatePropagation?.()` in `pc_input_controller.js` to ensure PC input controller has absolute priority over legacy mobile `skill_bar_controller._keyHandler`.
- Provide complete diffs and step-by-step instructions for worker agent in `handoff.md`.
- Formulate complete E2E test suite covering single tap decrement, i-frame spam protection, i-frame expiry without errors, sequential charge depletion, and depleted state lock.

## Artifact Index
- DISPATCH.md — Dispatch instructions from parent
- BRIEFING.md — Persistent working memory
- progress.md — Liveness heartbeat
- test_proposed_fix.py — Empirical reproduction and verification harness
- handoff.md — Comprehensive 5-component handoff report
