Skip to content

🐛 Add verify-before-asserting-existence rule to plan prompt#97

Merged
monkut merged 2 commits into
mainfrom
feature/95-plan-verify-existence
Apr 28, 2026
Merged

🐛 Add verify-before-asserting-existence rule to plan prompt#97
monkut merged 2 commits into
mainfrom
feature/95-plan-verify-existence

Conversation

@monkut

@monkut monkut commented Apr 28, 2026

Copy link
Copy Markdown
Owner

Summary

Tightens PLAN_AGENT_PROMPT to prevent the plan agent from claiming a symbol does not exist when it actually does — the failure mode reported in #95.

Why

The current prompt's "Do not speculate about unopened code" guidance is too soft. In a recent run on kiconiaworks/kippo#7 the agent emitted an AddField step for display_in_project_report, even though the field is already defined at kippo/projects/models.py:206. If implemented as written, the migration would fail at apply time (column ... already exists) and the duplicate Python attribute could silently overwrite verbose_name/help_text.

Changes

askcc/definitions.pyPLAN_AGENT_PROMPT:

  • New paragraph: "Verify before asserting existence" — for every symbol the plan proposes to add (field, function, class, setting, file), require a grep -n or Read-based confirmation of absence before writing "does not currently exist" or proposing AddField / "create new" steps.
  • Tightened item 1 (Current state): require file:line citation for existing symbols and a negative-grep citation for any "missing" claim.

Verification

  • uv run pytest — 225 passed
  • uv run poe check (ruff) — clean
  • uv run poe typecheck (pyright) — 0 errors

Test plan

  • Re-run askcc plan against an issue mentioning an existing model field; confirm the plan does not include an AddField step for that field.
  • Confirm the "Current state" section of generated plans cites file:line for referenced symbols.

Closes #95

Comment thread askcc/definitions.py Outdated
@monkut monkut merged commit 72cbaa0 into main Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

plan action hallucinates field absence; add "verify before asserting existence" rule to PLAN_AGENT_PROMPT

1 participant