Insert urgent research work as decimal phase (e.g., 72.1) between existing phases
Codex shell compatibility:
gpd on PATH.GPD_ACTIVE_RUNTIME=codex uv run gpd ....
</codex_runtime_notes>Uses decimal numbering (72.1, 72.2, etc.) to preserve the logical sequence of planned phases while accommodating urgent insertions.
Purpose: Handle urgent research tasks discovered during execution without renumbering entire roadmap. Common triggers include:
<execution_context>
<required_reading> Read all files referenced by the invoking prompt's execution_context before starting.
Reference: ./.codex/get-physics-done/references/orchestration/agent-infrastructure.md — See the Decimal Phase Calculation section for the numbering rules and troubleshooting details.
</required_reading>
Example: $gpd-insert-phase 72 Regularize UV divergence in self-energy
-> after = 72
-> description = "Regularize UV divergence in self-energy"
If arguments missing:
ERROR: Both phase number and description required
Usage: $gpd-insert-phase <after> <description>
Example: $gpd-insert-phase 72 Regularize UV divergence in self-energy
Exit.
Validate first argument is an integer. </step>
INIT=$(/home/qol/.gpd/venv/bin/python -m gpd.runtime_cli --runtime codex --config-dir ./.codex --install-scope local init phase-op "${after_phase}")
if [ $? -ne 0 ]; then
echo "ERROR: gpd initialization failed: $INIT"
# STOP — display the error to the user and do not proceed.
fi
Check roadmap_exists from init JSON. If false:
ERROR: No roadmap found (.gpd/ROADMAP.md)
Exit. </step>
RESULT=$(/home/qol/.gpd/venv/bin/python -m gpd.runtime_cli --runtime codex --config-dir ./.codex --install-scope local phase insert "${after_phase}" "${description}")
if [ $? -ne 0 ]; then
echo "ERROR: phase insert failed: $RESULT"
# STOP — do not proceed.
fi
The CLI handles:
.gpd/phases/{N.M}-{slug}/)Extract from result: phase_number, after_phase, name, slug, directory.
</step>
/home/qol/.gpd/venv/bin/python -m gpd.runtime_cli --runtime codex --config-dir ./.codex --install-scope local state add-decision --phase "${decimal_phase}" --summary "Inserted Phase ${decimal_phase} after Phase ${after_phase}: ${description} (URGENT)" --rationale "Urgent work discovered mid-project requiring immediate attention"
/home/qol/.gpd/venv/bin/python -m gpd.runtime_cli --runtime codex --config-dir ./.codex --install-scope local state update "Last Activity" "$(date +%Y-%m-%d)"
This ensures STATE.md and state.json stay in sync. Do NOT edit STATE.md directly — always use gpd state commands. </step>
Phase {decimal_phase} inserted after Phase {after_phase}:
- Description: {description}
- Directory: .gpd/phases/{decimal-phase}-{slug}/
- Status: Not planned yet
- Marker: (INSERTED) - indicates urgent work
Roadmap updated: .gpd/ROADMAP.md
Project state updated: .gpd/STATE.md
---
## Next Up
**Phase {decimal_phase}: {description}** -- urgent insertion
`$gpd-plan-phase {decimal_phase}`
<sub>`/clear` first -> fresh context window</sub>
---
**Also available:**
- Review insertion impact: Check if Phase {next_integer} dependencies still make sense
- Review roadmap
---
<anti_patterns>
</anti_patterns>
<success_criteria> Phase insertion is complete when:
gpd phase insert executed successfullygpd state add-decision (STATE.md + state.json synced)</success_criteria>
</execution_context>
@.gpd/ROADMAP.md @.gpd/STATE.md </context>
Execute the insert-phase workflow from @./.codex/get-physics-done/workflows/insert-phase.md end-to-end. Preserve all validation gates (argument parsing, phase verification, decimal calculation, roadmap updates). </process>