Skip to content

system prompt: guard against over-engineering the solution, not just the diff #516

Description

@Vasanthdev2004

Zero's editing discipline caps the diff ("prefer the smallest change that fully solves the problem") and the scope ("avoid unrelated rewrites, dependency churn"), but nothing curbs over-engineering the solution itself — the common LLM pitfall of adding speculative abstraction, unrequested configurability, or handling for cases that can't occur. A small diff can still be over-built.

Add a short guardrail to the Editing discipline section: solve the problem as posed, nothing the user didn't ask for, and "if a 200-line solution could be 50, rewrite it."

Validated with a before/after eval on 5 over-engineering-prone tasks (config loader, memoize cache, JSON POST, dict validator, CSV reader), each solved under the current rules vs the current rules + the guardrail, then judged for simplicity and correctness:

  • 3/5 treatment solutions were simpler, 0 were more complex, 0 broke correctness (avg 9 vs 11 non-blank lines).
  • The baseline gold-plated on the cache (an unrequested wrapper.cache introspection attribute) and the POST (unrequested header-merge configurability); the guardrail versions dropped both while staying correct.
  • On trivial tasks (word count, leap year) it's a harmless no-op — the baseline already produces minimal solutions there.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestissue-approvedReviewed and approved by the core team; community PRs may implement this issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions