Skip to content

Codebase intelligence for AI and humans: code health scores, auto-generated docs, git analytics, dead code detection, and architectural decisions via MCP.

fix(generation): give the short decision confirm command the evidence it needs (#4704)

Raghav Chamadiyaaa1fbcb23b57
diff --git a/packages/core/src/repowise/core/generation/templates/_editor_block.j2 b/packages/core/src/repowise/core/generation/templates/_editor_block.j2
index e0076d8f1..4a171a7e0 100644
--- a/packages/core/src/repowise/core/generation/templates/_editor_block.j2
+++ b/packages/core/src/repowise/core/generation/templates/_editor_block.j2
@@ -80,7 +80,7 @@ Fix first:
- **No model on this index.** `get_answer` replies are low confidence by design, so open its top `best_guesses` / `candidate_files` rows; `search_codebase` is full-text only, so `[fts]` hits are normal. The user adds a model with a provider key and `{{ data.model_command }}`; suggest it, do not run it.
{% endif %}
- **Noisy commands** (tests, builds, `git log`/`diff`): prefer `repowise distill <cmd>`, same exit code, errors first. Recover a `[repowise#<ref>: N lines omitted]` marker with `repowise expand <ref>` (`-q <regex>` filters); never re-run the command.
-- **Record a decision** you reasoned out: `repowise decision add --agent <your slug> --title T --decision D --rationale '<why>' --affects <path>` (lands as a candidate; accept candidates with `repowise decision confirm <id> --agent <your slug>`).
+- **Record a decision** you reasoned out: `repowise decision add --agent <your slug> --title T --decision D --rationale '<why>' --affects <path>` (lands as a candidate; accept candidates with `repowise decision confirm <id> --agent <your slug> --evidence <commit|file>`).
{% endif %}
{% if 'tools' in s %}
diff --git a/packages/server/src/repowise/server/mcp_server/_helpers.py b/packages/server/src/repowise/server/mcp_server/_helpers.py
index ceaab9ee1..a10751599 100644
--- a/packages/server/src/repowise/server/mcp_server/_helpers.py
+++ b/packages/server/src/repowise/server/mcp_server/_helpers.py
@@ -570,7 +570,8 @@ def _compute_alignment(
if currencies
else "This index holds no accepted decisions, so no file is governed "
"yet; review `repowise decision candidates` and accept one with "
- "`repowise decision confirm <id> --agent <your slug>`."
+ "`repowise decision confirm <id> --agent <your slug>`, adding "
+ "`--evidence <commit|file>` or `--reason` if it lacks them."
)
return {
"score": "none",
diff --git a/tests/unit/generation/test_editor_file_sections.py b/tests/unit/generation/test_editor_file_sections.py
index c6bc7ee2c..9efe998ec 100644
--- a/tests/unit/generation/test_editor_file_sections.py
+++ b/tests/unit/generation/test_editor_file_sections.py
@@ -218,3 +218,10 @@ def test_the_shared_body_differs_only_in_the_read_note():
"Claude Code requires a raw Read of any file you will Edit, and that Read is correct and expected.",
"Reading a file before you edit it is correct and expected.",
) == agents
+
+
+def test_the_short_confirm_command_supplies_evidence(gen):
+ # `decision add` records no evidence, so a bare confirm of that candidate is
+ # refused with "no evidence reference"; the copied command must carry it.
+ lean = gen.render(_full_data())
+ assert "`repowise decision confirm <id> --agent <your slug> --evidence <commit|file>`" in lean