# How Development Mode Affects Caching and CSV Export in the InterviewStreet Hiring Agent

> Learn how development mode in InterviewStreet Hiring Agent impacts caching and CSV export. Understand when to enable or disable these features for stateless execution.

- Repository: [HackerRank/hiring-agent](https://github.com/interviewstreet/hiring-agent)
- Tags: performance
- Published: 2026-07-02

---

**When `DEVELOPMENT_MODE` is set to `True` in [`config.py`](https://github.com/interviewstreet/hiring-agent/blob/main/config.py), the application caches resume and GitHub data to local JSON files and automatically appends evaluation results to `resume_evaluations.csv`; when set to `False`, it skips both caching and CSV generation to ensure stateless execution.**

The InterviewStreet hiring-agent repository uses a single global boolean flag to toggle between iterative development convenience and production-grade statelessness. Understanding how this flag manipulates file I/O behavior is essential for anyone running the evaluation pipeline locally versus deploying it to production environments.

## Configuration Source for Development Mode

The `DEVELOPMENT_MODE` flag lives in **[`config.py`](https://github.com/interviewstreet/hiring-agent/blob/main/config.py)** at the repository root. This module-level constant acts as the central authority that downstream modules check before executing file-system operations.

```python

# config.py

DEVELOPMENT_MODE = True  # Toggle this for production runs

```

All conditional logic in **[`score.py`](https://github.com/interviewstreet/hiring-agent/blob/main/score.py)** references this flag to decide whether to persist intermediate artifacts or operate entirely in memory.

## Resume and GitHub Caching Behavior

The caching mechanism prevents redundant PDF parsing and GitHub API calls across multiple runs. The implementation resides in the `main` function of **[`score.py`](https://github.com/interviewstreet/hiring-agent/blob/main/score.py)**, with distinct blocks handling resume extraction (lines 26–45) and GitHub profile fetching (lines 70–95).

### When Development Mode Is Enabled

If `DEVELOPMENT_MODE` is `True` and a cache file exists, the script bypasses expensive operations:

- **Resume caching**: After extracting text from a PDF, the resulting JSON is written to `cache/resumecache_<basename>.json`. On subsequent executions, the script checks for this file first and loads it directly instead of re-invoking the parser.
- **GitHub caching**: Fetched profile data is stored in `cache/githubcache_<basename>.json`. The script loads this cached version on future runs, eliminating redundant API requests.

```python

# Conceptual flow from score.py main function (lines 26-45, 70-95)

if DEVELOPMENT_MODE and os.path.exists(cache_path):
    data = json.load(open(cache_path))
else:
    data = expensive_operation()
    if DEVELOPMENT_MODE:
        json.dump(data, open(cache_path, 'w'))

```

### When Development Mode Is Disabled

Setting the flag to `False` causes the conditional guards `if DEVELOPMENT_MODE and os.path.exists(...)` to evaluate as falsy. Consequently:

- The PDF is parsed fresh on every execution.
- The GitHub API is queried every time.
- No files are written to the `cache/` directory.

This ensures deterministic, stateless behavior suitable for production pipelines where reproducibility and data freshness take priority over speed.

## CSV Export Control in Evaluation Pipeline

Beyond caching, the development mode flag governs whether the system generates a persistent audit trail. This logic appears in **[`score.py`](https://github.com/interviewstreet/hiring-agent/blob/main/score.py)** lines 41–63 and delegates row formatting to **[`transform.py`](https://github.com/interviewstreet/hiring-agent/blob/main/transform.py)**.

### Automatic CSV Generation

When `DEVELOPMENT_MODE` is active, the script:

1. Calls `transform_evaluation_response` from **[`transform.py`](https://github.com/interviewstreet/hiring-agent/blob/main/transform.py)** to convert the evaluation object into a dictionary representing one CSV row.
2. Appends that row to `resume_evaluations.csv`, creating the file and writing the header on the first run.

```python

# From score.py (lines 41-63)

if DEVELOPMENT_MODE:
    csv_row = transform_evaluation_response(evaluation_data)
    with open('resume_evaluations.csv', 'a', newline='') as f:
        writer = csv.DictWriter(f, fieldnames=csv_row.keys())
        if f.tell() == 0:
            writer.writeheader()
        writer.writerow(csv_row)

```

### Suppressing Output for Production

With `DEVELOPMENT_MODE = False`, the entire CSV-generation block is skipped. No file is created or updated, preventing disk pollution in production environments and keeping the execution strictly in-memory.

## Practical Configuration Examples

Toggle the flag via direct modification or runtime monkey-patching depending on your deployment strategy.

**Enable full debugging (default):**

```bash

# Edit config.py to set DEVELOPMENT_MODE = True

python score.py path/to/resume.pdf

```

**Disable for production:**

```python

# Option 1: Edit config.py

# DEVELOPMENT_MODE = False

# Option 2: Runtime override

import config
config.DEVELOPMENT_MODE = False
from score import main
main("path/to/resume.pdf")

```

## Summary

- **[`config.py`](https://github.com/interviewstreet/hiring-agent/blob/main/config.py)** houses the global `DEVELOPMENT_MODE` switch that dictates I/O behavior across the codebase.
- **Caching**: When enabled, JSON files are written to `cache/` for resumes and GitHub data; when disabled, the `main` function in **[`score.py`](https://github.com/interviewstreet/hiring-agent/blob/main/score.py)** bypasses these checks entirely.
- **CSV Export**: Enabled mode appends to `resume_evaluations.csv` via `transform_evaluation_response` in **[`transform.py`](https://github.com/interviewstreet/hiring-agent/blob/main/transform.py)**; disabled mode skips this block to ensure stateless execution.
- Use `True` for iterative local development to speed up debugging; use `False` for production to guarantee fresh data and no side effects.

## Frequently Asked Questions

### How do I completely disable caching in the hiring-agent?

Set `DEVELOPMENT_MODE = False` in **[`config.py`](https://github.com/interviewstreet/hiring-agent/blob/main/config.py)**. This causes the existence checks in **[`score.py`](https://github.com/interviewstreet/hiring-agent/blob/main/score.py)** (lines 26–45 and 70–95) to evaluate to `False`, forcing the script to parse the PDF and query the GitHub API on every run without writing cache files.

### Where are the cache files stored and what naming convention do they use?

Cache files are stored in a `cache/` directory relative to the execution path. Resume data is saved as `resumecache_<basename>.json` and GitHub data as `githubcache_<basename>.json`, where `<basename>` is derived from the input PDF filename.

### Does disabling development mode affect the evaluation logic or just the output?

Disabling development mode affects only the **persistence layer**. It suppresses cache reads/writes and CSV generation, but it does not alter the core scoring algorithm or the evaluation criteria applied to the candidate data.

### Can I generate CSV output without enabling the cache?

No. The current implementation in **[`score.py`](https://github.com/interviewstreet/hiring-agent/blob/main/score.py)** guards both features behind the same `if DEVELOPMENT_MODE:` block. There is no separate flag to decouple CSV generation from caching behavior; both are toggled simultaneously by the global flag in **[`config.py`](https://github.com/interviewstreet/hiring-agent/blob/main/config.py)**.