Extend estimate mode to multi-step commands where later LLM calls depend on earlier generated outputs.
Concrete files to investigate and update:
pdd/sync_orchestration.py
pdd/prompts/sync_orchestration_python.prompt
pdd/agentic_sync_runner.py
pdd/prompts/agentic_sync_runner_python.prompt
pdd/fix_code_loop.py
pdd/prompts/fix_code_loop_python.prompt
pdd/fix_error_loop.py
pdd/prompts/fix_error_loop_python.prompt
- related sync/agentic tests under
tests/
Scope:
- Make
pdd --estimate --output-cost run.csv sync <module> collect and print a per-step estimate breakdown.
- Label downstream multi-step estimates as approximate because later prompts depend on generated output.
- Estimate the first known step exactly from the actual built messages and extrapolate later steps using documented command ratios or one-round assumptions.
- Preserve the no-provider-call and no-file-write guarantees in estimate mode.
Interface Contract
This sub-issue depends on sub-issue 2. It must consume the estimate mode state exposed by pdd/core/cli.py and pdd/llm_invoke.py, including the per-run estimate collector and sentinel/short-circuit behavior. It must not introduce a second independent estimate-mode mechanism.
PDD Command Hint: change+sync
Acceptance criteria:
pdd --estimate --output-cost run.csv sync <module> prints a per-step breakdown and an approximate total.
- Multi-step output clearly labels heuristic downstream estimates and their assumption.
- Tests assert sync estimate mode avoids provider calls, generated files, and cost-log writes.
Split Contract
Command sequence: change → sync
Allowed write set:
pdd/sync_orchestration.py
pdd/prompts/sync_orchestration_python.prompt
pdd/agentic_sync_runner.py
pdd/prompts/agentic_sync_runner_python.prompt
pdd/fix_code_loop.py
pdd/prompts/fix_code_loop_python.prompt
pdd/fix_error_loop.py
pdd/prompts/fix_error_loop_python.prompt
tests/test_sync_orchestration.py
tests/test_agentic_sync_runner.py
Acceptance criteria:
- Sync estimate mode prints exact first-step estimates and labelled approximate downstream estimates.
- Estimate mode for sync avoids all provider calls and file writes.
- The output includes a total approximate cost and context usage summary.
Independently mergeable: True
Scope rule: Do not expand beyond this contract or implement sibling sub-issue work. If the contract is insufficient, report the gap instead.
PDD Command Hint: This is a new feature. Use change → sync (modify prompts, then generate and validate code).
Parent: #1347
Parent issue: #1347
Extend estimate mode to multi-step commands where later LLM calls depend on earlier generated outputs.
Concrete files to investigate and update:
pdd/sync_orchestration.pypdd/prompts/sync_orchestration_python.promptpdd/agentic_sync_runner.pypdd/prompts/agentic_sync_runner_python.promptpdd/fix_code_loop.pypdd/prompts/fix_code_loop_python.promptpdd/fix_error_loop.pypdd/prompts/fix_error_loop_python.prompttests/Scope:
pdd --estimate --output-cost run.csv sync <module>collect and print a per-step estimate breakdown.Interface Contract
This sub-issue depends on sub-issue 2. It must consume the estimate mode state exposed by
pdd/core/cli.pyandpdd/llm_invoke.py, including the per-run estimate collector and sentinel/short-circuit behavior. It must not introduce a second independent estimate-mode mechanism.PDD Command Hint: change+sync
Acceptance criteria:
pdd --estimate --output-cost run.csv sync <module>prints a per-step breakdown and an approximate total.Split Contract
Command sequence: change → sync
Allowed write set:
pdd/sync_orchestration.pypdd/prompts/sync_orchestration_python.promptpdd/agentic_sync_runner.pypdd/prompts/agentic_sync_runner_python.promptpdd/fix_code_loop.pypdd/prompts/fix_code_loop_python.promptpdd/fix_error_loop.pypdd/prompts/fix_error_loop_python.prompttests/test_sync_orchestration.pytests/test_agentic_sync_runner.pyAcceptance criteria:
Independently mergeable: True
Scope rule: Do not expand beyond this contract or implement sibling sub-issue work. If the contract is insufficient, report the gap instead.
PDD Command Hint: This is a new feature. Use
change → sync(modify prompts, then generate and validate code).Parent: #1347
Parent issue: #1347