Map existing research project — theoretical framework, computations, conventions, and open questions
Codex shell compatibility:
gpd on PATH.GPD_ACTIVE_RUNTIME=codex uv run gpd ....
</codex_runtime_notes>Each mapper agent explores a focus area and writes documents directly to .gpd/research-map/. The orchestrator only receives confirmations, keeping context usage minimal.
Maps the theoretical architecture of the research: formalism, computational implementations, conventions, validation status, and open questions.
Output: .gpd/research-map/ folder with 7 structured documents about the research project state. </objective>
<execution_context>
<!-- [included: map-research.md] --> <purpose> Orchestrate parallel research-mapper agents to analyze a physics research project and produce structured documents in .gpd/research-map/ <philosophy> **Why dedicated mapper agents:** - Fresh context per domain (no token contamination) - Agents write documents directly (no context transfer back to orchestrator) - Orchestrator only summarizes what was created (minimal context usage) - Faster execution (agents run simultaneously) <process> <step name="init_context" priority="first"> Load research mapping context: <step name="check_existing"> Check if .gpd/research-map/ already exists using `has_maps` from init context. <step name="create_structure"> Create .gpd/research-map/ directory: <step name="spawn_agents"> Spawn 4 parallel gpd-research-mapper agents.Each agent has fresh context, explores a specific focus area, and writes documents directly. The orchestrator only receives confirmation + line counts, then writes a summary.
Output: .gpd/research-map/ folder with 7 structured documents covering theoretical content, computational methods, data artifacts, conventions, and open questions. </purpose>
Document quality over length: Include enough detail to be useful as reference. Prioritize practical examples (key equations, code patterns, data formats) over arbitrary brevity.
Document templates: Mapper agents load templates from ./.codex/get-physics-done/references/templates/research-mapper/ (FORMALISM.md, CONVENTIONS.md, CONCERNS.md, etc.). These paths are deterministic across runtimes after install; if they are missing, treat that as a broken install and fall back to the agent's built-in structural guidance rather than searching alternate runtime-specific locations.
Always include file paths:
Documents are reference material for the AI when planning/executing. Always include actual file paths formatted with backticks: src/hamiltonian.py, notebooks/convergence_test.ipynb, latex/main.tex.
Map all project artifacts: A physics research project typically contains:
# Research-mapping initialization.
INIT=$(/home/qol/.gpd/venv/bin/python -m gpd.runtime_cli --runtime codex --config-dir ./.codex --install-scope local init map-research)
if [ $? -ne 0 ]; then
echo "ERROR: gpd initialization failed: $INIT"
# STOP — display the error to the user and do not proceed.
fi
Extract from init JSON: mapper_model, commit_docs, research_map_dir, existing_maps, has_maps, research_map_dir_exists, project_contract, contract_intake, effective_reference_intake, active_reference_context, reference_artifacts_content.
Read mode settings:
RESEARCH_MODE=$(/home/qol/.gpd/venv/bin/python -m gpd.runtime_cli --runtime codex --config-dir ./.codex --install-scope local --raw config get research_mode 2>/dev/null | /home/qol/.gpd/venv/bin/python -m gpd.runtime_cli --runtime codex --config-dir ./.codex --install-scope local json get .value --default balanced 2>/dev/null || echo "balanced")
Mode-aware behavior:
research_mode=explore: Map broadly — include alternative theoretical frameworks, speculative connections, open questions across related domains.research_mode=exploit: Map narrowly — focus on primary formalism, established results, direct computational needs.research_mode=adaptive: Start with primary framework, expand mapping if connections to other domains appear.effective_reference_intake as the machine-readable carry-forward registry for anchors, prior outputs, baselines, and unresolved gaps. Use active_reference_context to render and explain it, not to replace it.reference_artifacts_content when the existing literature/research-map artifacts already contain stable citations, prior-output paths, or benchmark wording that should be preserved verbatim.REFERENCES.md should carry a reusable Anchor ID and a concrete Source / Locator.Carry Forward To names workflow stages; if exact claim/deliverable IDs are known, record them in a dedicated Contract Subject IDs field instead of overloading the stage field.
</step>
If research_map_dir_exists is true:
ls -la .gpd/research-map/
If exists:
.gpd/research-map/ already exists with these documents:
[List files found]
What's next?
1. Refresh - Delete existing and remap research project
2. Update - Keep existing, only update specific documents
3. Skip - Use existing research map as-is
Wait for user response.
If "Refresh": Delete .gpd/research-map/, continue to create_structure If "Update": Ask which documents to update, continue to spawn_agents (filtered) If "Skip": Exit workflow
If doesn't exist: Continue to create_structure. </step>
mkdir -p .gpd/research-map
Expected output files:
Continue to spawn_agents. </step>
Use task tool with subagent_type="gpd-research-mapper", model="{mapper_model}", readonly=false, and run_in_background=true for parallel execution.
Runtime delegation: Spawn a subagent for the task below. Adapt the
task()call to your runtime's agent spawning mechanism. Ifmodelresolves tonullor an empty string, omit it so the runtime uses its default model. Always passreadonly=falsefor file-producing agents. If subagent spawning is unavailable, execute these steps sequentially in the main context.
CRITICAL: Use the dedicated gpd-research-mapper agent, NOT Explore. The mapper agent writes documents directly.
Agent 1: Theory Focus
task tool parameters:
subagent_type="gpd-research-mapper"