How DEVELOPMENT_MODE Toggles Caching and CSV Export in the Hiring-Agent

Setting DEVELOPMENT_MODE = True in config.py enables local file caching for PDF parsing and GitHub API results while automatically appending evaluation data to resume_evaluations.csv, whereas False forces fresh processing and suppresses CSV output.

The interviewstreet/hiring-agent repository uses a single global configuration flag—DEVELOPMENT_MODE—to切换 between iterative development convenience and production-ready stateless execution. When activated, this boolean flag persists expensive operations to disk and generates debug-friendly CSV logs. Understanding this toggle is essential for optimizing development workflows and ensuring clean production deployments.

Where DEVELOPMENT_MODE Is Defined

The DEVELOPMENT_MODE flag lives in config.py at the repository root. This module-level constant acts as the single source of truth that downstream modules import and check before executing conditional logic. By centralizing the flag in one file, the codebase avoids scattered magic strings or environment variable lookups throughout the application.

How DEVELOPMENT_MODE Controls Resume and GitHub Caching

When DEVELOPMENT_MODE is enabled, the hiring-agent caches heavy-weight I/O operations to dramatically speed up repeated runs against the same candidate files. This logic resides in the main function within score.py.

Resume Caching Logic

For PDF processing, the code checks for existing cache files before re-parsing documents. According to lines 26–45 in score.py, when DEVELOPMENT_MODE is True:

  • After extracting data from a PDF resume, the resulting JSON is written to cache/resumecache_<basename>.json
  • On subsequent executions, the script checks if DEVELOPMENT_MODE and os.path.exists(cache_path): and loads the cached JSON instead of re-invoking the PDF parser

When the flag is False, this guard clause evaluates to False, forcing the application to re-parse the PDF on every run and never writing cache files to disk.

GitHub Profile Caching

Similarly, GitHub API calls are cached to avoid rate limits and network latency. Lines 70–95 in score.py implement this behavior:

  • Fetched GitHub profile data is stored in cache/githubcache_<basename>.json
  • The same conditional pattern—if DEVELOPMENT_MODE and os.path.exists(...)—determines whether to load from disk or query the GitHub API fresh

In production mode (DEVELOPMENT_MODE = False), the application bypasses these blocks entirely, ensuring no stale data and eliminating filesystem overhead.

How DEVELOPMENT_MODE Controls CSV Export Behavior

The flag also governs whether evaluation results persist to a CSV ledger. When enabled, the script calls transform_evaluation_response (defined in transform.py) to build a dictionary representing one CSV row, then appends it to resume_evaluations.csv.

This logic appears in lines 41–63 of score.py, guarded by if DEVELOPMENT_MODE:. On the first run, the code creates the file and writes a header; subsequent runs append new rows. When the flag is disabled, this block is skipped entirely—no CSV file is created, opened, or updated, resulting in a stateless execution that outputs only to stdout or the designated API response.

Practical Examples

To run the hiring-agent with full caching and CSV logging enabled (the default development configuration):


# score.py runs with DEVELOPMENT_MODE = True from config.py

python score.py path/to/resume.pdf

To disable development mode for a clean production run, either edit the configuration file or monkey-patch at runtime:


# Option 1: Edit config.py directly

# 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 houses the global DEVELOPMENT_MODE boolean that controls application behavior
  • Caching: When True, score.py writes and reads from cache/resumecache_<basename>.json and cache/githubcache_<basename>.json, skipping expensive PDF parsing and GitHub API calls on subsequent runs
  • CSV Export: When True, score.py appends evaluation data to resume_evaluations.csv using transform_evaluation_response from transform.py
  • Production Mode: Setting DEVELOPMENT_MODE = False disables all file I/O side effects, ensuring fresh data processing and no persistent logs

Frequently Asked Questions

What files does DEVELOPMENT_MODE create?

When enabled, the flag generates cache files in a cache/ directory (resumecache_<basename>.json and githubcache_<basename>.json) and a cumulative log file named resume_evaluations.csv in the project root. These files persist between script executions to speed up development workflows.

How do I force fresh processing without deleting cache files?

Set DEVELOPMENT_MODE = False in config.py or override it at runtime before importing score.py. This bypasses the cache lookup logic in lines 26–45 and 70–95 of score.py, forcing the application to re-parse PDFs and re-query the GitHub API regardless of existing cache files.

Why is my CSV file not updating?

The CSV export only executes when DEVELOPMENT_MODE is True. Check that you have not disabled the flag in config.py. Additionally, the CSV writing logic (lines 41–63 in score.py) silently skips when the flag is off, so verify your configuration if resume_evaluations.csv is missing or stale.

Is DEVELOPMENT_MODE suitable for production deployments?

No. For production use, set DEVELOPMENT_MODE = False to ensure stateless execution without side effects. The caching mechanism could serve stale candidate data, and the CSV generation creates unnecessary filesystem I/O and potential privacy concerns with persistent log files.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →