Improve review accuracy: full-file context and confidence-aware prompts #28
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
WuMing agents currently receive only the unified diff. This causes false positives and speculative findings because the model lacks surrounding context — full class bodies, sibling functions, imports from other modules.\n\nTwo complementary fixes:\n\n1. Full-file context: For each file touched by the diff, fetch the complete file content from Forgejo and prepend it to the agent's user message. Gated by a new env var
WUMING_MAX_FILE_LINES(default 0 = disabled; set e.g. 500 to enable with a size limit).\n\n2. Confidence caveat: Append a standing instruction to every agent's user message telling it to only flag issues evident from the provided context and to avoid speculative findings.Plan of attack:
Key files:
src/wuming/diff.py— addfull_content: str | None = Nonefield toFileDiffdataclasssrc/wuming/config.py— addmax_file_lines: int, parse fromWUMING_MAX_FILE_LINES(default 0)src/wuming/forgejo.py— addget_file_content(path)usingGET /api/v1/repos/{owner}/{repo}/raw/{path}?ref={sha}; returnsNoneon 404src/wuming/main.py— after parse/filter/truncate, gather all file-content fetches concurrently; attach toFileDiffobjects viadataclasses.replace; skip whenmax_file_lines == 0src/wuming/agents/base.py— inBaseAgent.review(), prepend full file contents to the user message when present; append a module-level_CONFIDENCE_CAVEATconstant to every user message regardless.woodpecker/ai-review.yml— addWUMING_MAX_FILE_LINES: "500"README.md+CLAUDE.md— document the new env varSequence: TDD — failing tests for
get_file_contentand agent context first, then implementation, then docs.