<reasoning_content>
*   Task: Extend a `JobQueue` class with a `process_job` method.
    *    Input: `job_id` (str), `Processor` (Callable).
    *    Behavior:
        1.  Identify the data associated with `job_id` from `add_job`.
        2.   Call `processor(data)`.
        3.   On exception: Retry up to 4 times (1 initial + 3 retries).
        4.   Track retry count per job.
        5.   Use exponential backoff (1s, 2s, 4s).
        6.   *Constraint*: Do not actually `time.sleep()`. Record the delays as data.
        7.   Return `True` on success, `False` if all 4 attempts fail.
    *    Constraint: Only standard library.
    *    Constraint: Write *only* Python code, no explanations.

    *   The user didn't provide the original `JobQueue` class, but the prompt implies I need to define it or at least the structure of it to make `process_job` work.
    *   Since I need to "Extend" it, I should provide a base structure that includes `add_job`.

    *   `jobs`: A dictionary mapping `job_id` to a dictionary containing `data` and `retry_count`.
    *   `add_job(job_id, data)`: Store the data and initialize `retry_count`.
    *   `process_job(job_id, processor)`:
        *   Find the job record.
        *   Try calling `processor(data)`.
        *   Catch exceptions.
        *   If exception, increment `retry_count`.
        *   Check if `retry_count < 4`.
        *   If true, calculate delay (2^retry_count). Actually, the prompt says delays of 1s, 2s, 4s for retries 1, 2, 3.
        *   Record the delay in the job data.
        *   If it fails 4 times total, return `False`.

    *   Retry 1: 1s
    *   Retry 2: 2s
    *   Retry 3: 4s
    *   Total attempts: 4 (Attempt 1, Retry 1, Retry 2, Retry 3).

    ```python
    from typing import Callable, Dict, Any

    class JobQueue:
        def __init__(self):
            self.jobs: Dict[str, Dict[str, Any]] = {}

        def add_job(self, job_id: str, data: dict):
            self.jobs[job_id] = {
                "data": data,
                "retry_count": 0,
                "history": []
            }

        def process_job(self, job_id: str, processor: Callable[[dict], Any]) -> bool:
            if job_id not in self.jobs:
                return False

            job = self.jobs[job_id]
            data = job["data"]

            for attempt in range(4):
                try:
                    processor(data)
                    return True
                except Exception:
                    if attempt < 3:
                        job["retry_count"] += 1
                        # Exponential backoff: 1, 2, 4
                        delay = 2 ** (job["retry_count"] - 1)
                        job["history"].append(f"Retry {job['retry_count']} after {delay}s")
                        # Requirement says "record the delays as data"
                        # I'll store the delay in the record.
                        job["last_delay"] = delay
                    else:
                        break
            return False
    ```

    *   "Record the delays as data" - I should probably store the specific delay values in the dictionary structure.
    *   "Delay of 1s, 2s, 4s" corresponds to retry index 0, 1, 2.

    Refining `process_job`:
    ```python
    def process_job(self, job_id: str, processor: Callable[[dict], Any]) -> bool:
        if job_id not in self.jobs:
            return False

        job_record = self.jobs[job_id]
        data = job_record["data"]

        for attempt in range(4):
            try:
                processor(data)
                return True
            except Exception:
                if attempt < 3:
                    job_record["retry_count"] += 1
                    delay = 2 ** (job_record["retry_count"] - 1)
                    # Record delay in the data record
                    job_record["retries"] = job_record.get("retries", [])
                    job_record["retries"].append(delay)
                else:
                    break
        return False
    ```

    *   Standard library only? Yes.
    *   No explanation? Yes.
    *   Retry count per job? Yes.
    *   Exponential backoff? Yes.
    *   No sleep? Yes.
    *   Record delays? Yes.
    *   Return True/False? Yes.

    Wait, the prompt says "Call `processor(data)` where `data` is the dict passed to `add_job(job_id, data)`".
    And "Track the retry count per job".

    Let's make sure the class structure is clean.

    ```python
    from typing import Callable, Dict, Any

    class JobQueue:
        def __init__(self):
            self.jobs: Dict[str, Dict[str, Any]] = {}

        def add_job(self, job_id: str, data: dict):
            self.jobs[job_id] = {
                "data": data,
                "retry_count": 0,
                "delays": []
            }

        def process_job(self, job_id: str, processor: Callable[[dict], Any]) -> bool:
            if job_id not in self.jobs:
                return False

            job = self.jobs[job_id]
            data = job["data"]

            for attempt in range(4):
                try:
                    processor(data)
                    return True
                except Exception:
                    if attempt < 3:
                        job["retry_count"] += 1
                        delay = 2 ** (job["retry_count"] - 1)
                        job["delays"].append(delay)
                    else:
                        break
            return False
    ```

    Wait, if I record it as `job["delays"]`, that fulfills "record the delays as data".

    Final check on constraints:
    - "Do NOT actually sleep" -> check.
    - "Return True on first success" -> check.
    - "Return False if all 4 attempts raise" -> check.
    - "Retry count per job" -> check.

    I'll provide the complete class including the base `add_job` for context.
</reasoning_content>

<content>
```python
from typing import Callable, Dict, Any

class JobQueue:
    def __init__(self):
        self.jobs: Dict[str, Dict[str, Any]] = {}

    def add_job(self, job_id: str, data: dict):
        self.jobs[job_id] = {
            "data": data,
            "retry_count": 0,
            "delays": []
        }

    def process_job(self, job_id: str, processor: Callable[[dict], Any]) -> bool:
        if job_id not in self.jobs:
            return False

        job = self.jobs[job_id]
        data = job["data"]

        for attempt in range(4):
            try:
                processor(data)
                return True
            except Exception:
                if attempt < 3:
                    job["retry_count"] += 1
                    delay = 2 ** (job["retry_count"] - 1)
                    job["delays"].append(delay)
                else:
                    break
        return False
```
</content>