Engineering Wish-Driven Programming: Implementation and Evaluation Methods
Wish-driven programming shifts code generation from next-line completion to project-level delivery: developers describe what they want, and the model decomposes requirements, plans structure, selects dependencies, generates code, runs and debugs it, and iterates toward a runnable project. This article explains how the paradigm differs from traditional coding assistance, which engineering metrics matter, how to read benchmarks without overtrusting them, how to calculate task-level cost, how to abstract retrieval and sandbox execution, and how to build a practical evaluation and rollout process with appropriate risk controls.
1. First, Define the Concept: What Is “Wish-Driven Programming”?
Traditional code completion solves “what should be written on the next line,” while wish-driven programming solves “what do I want.” A developer provides a short, conversational, even incomplete requirement description. The model then handles requirement decomposition, directory planning, dependency selection, code generation, execution and debugging, and iterative repair, ultimately delivering a runnable project as a whole.
Its differences from traditional coding assistance center on three points:
- Different granularity: The scope rises from function-level or file-level work to project-level work.
- Different loop: The model no longer produces only text; it follows a multi-round loop of “write—run—read errors—fix.”
- Different failure modes: Local completion errors are easy to spot, but once project-level generation goes in the wrong direction, rework costs are extremely high.
Therefore, evaluating this capability cannot stop at “can it generate.” It must examine three engineering metrics: first-pass success rate, runnable rate, and manual rework volume.
2. Why a Small Version Update Can Bring a Noticeable Leap
Many “small version” updates show large score changes not because of parameter-scale changes, but because of changes in the training paradigm. A common industry approach is self-feedback reinforcement learning: the model executes its own generated code in a sandbox environment, treats compilation errors, test failures, and runtime exceptions as verifiable reward signals, and iteratively updates its policy.
This paradigm is especially effective for “building a complete project from scratch” because:
- Project-level tasks naturally provide verifiable signals: whether the code compiles, whether it starts, and whether tests pass.
- Rewards are dense, which mitigates credit assignment problems in long-horizon tasks.
- Targets such as games and 3D scenes have clear visual and runtime acceptance criteria, so the feedback loop is short.
One caveat: gains from paradigm improvements are task-distribution dependent. The direction optimized during training determines which capabilities improve noticeably and which barely move. This directly means that model selection cannot rely only on aggregate scores.
3. How to Read Benchmark Scores: Structure, Limitations, and Correct Use
When facing a comparison table with more than a dozen benchmarks, it is better to group them by capability dimension before interpreting them:
| Dimension | Typical focus | Engineering meaning |
|---|---|---|
| Code generation | Single-file or multi-file function implementation | Everyday coding efficiency |
| Terminal and environment interaction | Command execution, dependency installation, log troubleshooting | Automated operations and repair |
| Long-horizon software engineering | Completing issues through multiple iterations | Project-level delivery capability |
| Knowledge and reasoning | Difficult comprehensive Q&A | Understanding complex problems |
When reading such a table, watch for four types of bias:
- Data contamination: Public benchmarks may enter training corpora, inflating scores.
- Prompt sensitivity: The same model with different prompt templates can differ by several percentage points.
- Variance: Small-sample benchmarks should report the mean and confidence interval over multiple runs, not a single best run.
- Aggregate scores masking weaknesses: A win-loss distribution with “leading on some items and clearly behind on others” is normal. It shows that model capabilities are uneven, so selection must return to your own task distribution.
The conclusion is direct: benchmarks are for exclusion, not for decision-making. Decisions should rely on a self-built evaluation set.
4. Calculate “Stronger and Cheaper” Clearly: Task-Level Cost Accounting
A “Pareto improvement in performance and cost” means some item improves without any item getting worse. To verify it, you must account for cost per task, not unit price:
Task cost = input tokens × input unit price + output tokens × output unit price+ tool/retrieval call fees + extra consumption from failed retries+ converted cost of manual rework
A reusable estimation script (illustrative):
def task_cost(inp, out, price_in, price_out, retries=0, tool_calls=0, tool_price=0.0):base = inp / 1e6 * price_in + out / 1e6 * price_outretry_factor = 1 + retriesreturn base * retry_factor + tool_calls * tool_price
The key insight is that reasoning tier and retry count often have more impact than unit price. A high-intensity reasoning tier consumes more per call, but if it improves first-pass success enough to reduce total retries, total cost may be lower. Therefore, evaluation must hold “same acceptance criteria, same tier, same retry cap” fixed; otherwise comparisons are invalid. Any billing and free-quota rules are commercial policies and should follow the latest official publication. Do not hardcode them in code.
5. Web Search and Fetching: Integrate Through a General Abstraction Layer
Project-level generation often needs external real-time information, such as version compatibility and API changes. It is better not to couple directly to a single search service. Instead, define your own abstraction:
class SearchProvider:def search(self, query: str, top_k: int = 5) -> list[dict]: ...def fetch(self, url: str) -> str: ...class CachedProvider(SearchProvider):def __init__(self, inner, cache, ttl=3600):self.inner, self.cache, self.ttl = inner, cache, ttldef search(self, query, top_k=5):key = f"{query}:{top_k}"if hit := self.cache.get(key):return hitres = self.inner.search(query, top_k)self.cache.set(key, res, self.ttl)return res
Engineering points include result caching and deduplication, concurrency rate limiting, timeouts and failure fallback (when retrieval is unavailable, fall back to the model’s internal knowledge and explicitly mark uncertainty), a trusted-domain allowlist for fetched content, and prompt-injection protection. Retrieved webpages are untrusted input and must be isolated from subsequent instruction channels.
6. Implementation Practice: Turn a “Wish” into a Deliverable
- Structure the prompt: Use a three-part format of intent + constraints + acceptance criteria. Constraints should specify the tech stack, dependency versions, and performance budget. Acceptance criteria should be written as executable commands.
Goal: a locally runnable offline to-do applicationConstraints: a single frontend framework, no external service dependency, first-screen assets < 500KBAcceptance: both build and test pass; core flows can be completed after startup
- Sandbox and rollback: All generation and execution should happen in isolated containers. Code should be committed to a separate branch, and failures should be discarded automatically to avoid polluting the main branch.
- Self-built evaluation set: Derive 20–50 tasks from real requirements, fix acceptance scripts, and run regression whenever the model or prompt changes. Record first-pass success rate and average time.
- Additional constraints for asset-heavy projects: For 3D and game projects, agree in advance on asset formats, polygon budgets, texture sizes, and target frame rates. Otherwise, the gap between “it runs” and “it is usable” can be enormous.
- Observability: Connect logs, metrics, and alerts from the generation process to general logging services and monitoring/alerting capabilities. Store artifacts in object storage for auditing and reproducibility. On cloud platforms, these capabilities are typically provided by a combination of model services, object storage, container platforms, and logging and monitoring services.
7. Selection Checklist and Risk Control
- Scenario fit first: Models that are strong in terminal interaction and long-horizon engineering may not lead in knowledge reasoning. Assign models by task.
- Cost control: Set per-task token and retry budget caps, and trip a circuit breaker when they are exceeded.
- Compliance and data security: Clarify whether code leaves your environment. For sensitive repositories, prioritize private deployment or open-weight options.
- Avoid lock-in: Route model calls, retrieval, and vector stores through your own abstraction layer so they remain replaceable.
- Human gates: Project-level generation must retain dual gates: human review and automated testing.
8. Conclusion
The value of wish-driven programming is not that “one sentence really generates everything,” but that it significantly shortens the distance from a requirement to a runnable project. The rational approach is: use benchmarks for initial screening, use a self-built evaluation set for decisions, use task-level cost for budgeting, and use sandboxes and abstraction layers as safeguards. When capability improvements and cost reductions appear together, the real benefits belong to teams that make evaluation and engineering constraints solid.
