Audit research milestone completion against original research goals
Codex shell compatibility:
gpd on PATH.GPD_ACTIVE_RUNTIME=codex uv run gpd ....
</codex_runtime_notes>This command IS the orchestrator. Reads existing VERIFICATION.md files (phases already verified during execute-phase), aggregates open questions and deferred gaps, then spawns an integration checker for cross-phase consistency (e.g., do numerical results match analytical predictions? do approximations used in phase 3 remain valid given the parameter regime explored in phase 5?). </objective>
<execution_context>
<!-- [included: audit-milestone.md] --> <purpose> Verify research milestone achieved its definition of done by aggregating phase verifications, checking cross-phase consistency, and assessing research completeness. Reads existing VERIFICATION.md files (phases already verified during execute-phase), aggregates open questions and deferred analysis, then spawns consistency checker for cross-phase physics validation. <process>Key questions: Are all claims supported? All calculations verified? All comparisons made? Ready for publication or next research stage? </purpose>
<required_reading> Read all files referenced by the invoking prompt's execution_context before starting. </required_reading>
INIT=$(/home/qol/.gpd/venv/bin/python -m gpd.runtime_cli --runtime codex --config-dir ./.codex --install-scope local init milestone-op)
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: milestone_version, milestone_name, phase_count, completed_phases, commit_docs, project_exists.
Read mode settings:
AUTONOMY=$(/home/qol/.gpd/venv/bin/python -m gpd.runtime_cli --runtime codex --config-dir ./.codex --install-scope local --raw config get autonomy 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:
autonomy=supervised: Pause after each audit criterion for user discussion of gaps.autonomy=balanced (default): Complete the full audit and generate a gap-closure plan when needed. Pause only if critical gaps or milestone-scope questions need user judgment.autonomy=yolo: Complete audit, auto-approve milestone if > 80% criteria met.Run centralized context preflight before continuing:
CONTEXT=$(/home/qol/.gpd/venv/bin/python -m gpd.runtime_cli --runtime codex --config-dir ./.codex --install-scope local --raw validate command-context audit-milestone "$ARGUMENTS")
if [ $? -ne 0 ]; then
echo "$CONTEXT"
exit 1
fi
If milestone_version is null/empty:
ERROR: No active milestone found.
A milestone audit requires a project with phases.
Run $gpd-new-project first, then complete phases before auditing.
Exit.
Resolve consistency checker model:
CHECKER_MODEL=$(/home/qol/.gpd/venv/bin/python -m gpd.runtime_cli --runtime codex --config-dir ./.codex --install-scope local resolve-model gpd-consistency-checker)
# Get phases in milestone (sorted numerically, handles decimals)
/home/qol/.gpd/venv/bin/python -m gpd.runtime_cli --runtime codex --config-dir ./.codex --install-scope local phase list
For each phase directory, read the VERIFICATION.md:
cat .gpd/phases/01-*/*-VERIFICATION.md
cat .gpd/phases/02-*/*-VERIFICATION.md
# etc.
From each VERIFICATION.md, extract:
If a phase is missing VERIFICATION.md, flag it as "unverified phase" -- this is a blocker.
With phase context collected:
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.
task(
prompt="First, read ./.codex/agents/gpd-consistency-checker.md for your role and instructions.
Check cross-phase physics consistency and end-to-end research coherence.
Phases: {phase_dirs}
Phase results: {from SUMMARYs}
Key equations: {equations derived/used}
Parameters: {shared parameters and their values}
Verify:
- Notation consistency across phases (same symbols mean same things)
- Parameter values used consistently (no contradictory assumptions)
- Results from early phases correctly used in later phases
- Approximations compatible across phases (not contradictory limits)
- Physical units consistent throughout
- Overall narrative coherence (do the phases tell a complete story?)",
subagent_type="gpd-consistency-checker",
model="{checker_model}",
readonly=false
)
If the consistency checker agent fails to spawn or returns an error: Proceed without cross-phase consistency checks. Note in the audit report that consistency verification was skipped. The phase-level checks (step 2) still provide individual phase validation. The user should run $gpd-validate-conventions separately after the audit.
Combine:
For each requirement in REQUIREMENTS.md mapped to this milestone:
Create .gpd/v{version}-MILESTONE-AUDIT.md with:
---