# Task: WikiMap Performance Optimization

## Context
User expressed concern that the "Auto-Reconciliation" feature (which relies on `useWikiMap`) might cause excessive server data usage due to frequent checking.

## 9-Agent Meeting Analysis
- **Finding**: The original `useWikiMap` implementation used `onSnapshot` on the entire `documents` collection.
- **Risk**: Firestore Client SDK downloads the *full document* (including content) even if we only access the `title`.
- **Impact**: Multiplied by real-time updates (`onSnapshot`), this could lead to significant bandwidth usage if any document in the system is updated.

## Solution
- **Strategy**: Switch from "Real-time" to "Fetch-Once".
- **Implementation**:
    -   replaced `onSnapshot` with `getDocs` in `useWikiMap.ts`.
    -   The map is now built once when the component mounts (app load).
    -   **[Update]**: Added a 5-minute polling interval (`setInterval`) to handle long-running sessions, ensuring the map doesn't get too stale while keeping bandwidth low.

## Verification
- **Build**: `npm run build` passed.
- **Logic**: confirmed `getDocs` is used and `useEffect` dependency array is empty `[]`, ensuring single execution.
- **Safety Net**: Polling ensures eventual consistency.

## Status
- **Optimized**: bandwidth usage is now O(1) per session load instead of O(N) continuous streaming.
- **Deployed**: Pushed to master.
