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: restore friendly revspec error in changed_lines and register the codex change-review skill (#902)

Raghav Chamadiya156a5dc2a5b2
diff --git a/packages/core/src/repowise/core/analysis/changed_lines.py b/packages/core/src/repowise/core/analysis/changed_lines.py
index 12481b5f5..6bd84c05d 100644
--- a/packages/core/src/repowise/core/analysis/changed_lines.py
+++ b/packages/core/src/repowise/core/analysis/changed_lines.py
@@ -53,7 +53,11 @@ def _parse_unified_diff(diff: str) -> dict[str, set[int]]:
def _verify_ref(repo_path: str, ref: str) -> None:
- if not _git(["rev-parse", "--verify", "--quiet", ref], repo_path).strip():
+ # check=False: `rev-parse --verify --quiet` deliberately exits 1 with empty
+ # stdout for a missing ref, which is the signal we test for here. Without the
+ # opt-out, _git's returncode check (see change_risk.features._git) would raise
+ # CalledProcessError first and mask the friendly ValueError this raises.
+ if not _git(["rev-parse", "--verify", "--quiet", ref], repo_path, check=False).strip():
raise ValueError(f"unknown revision {ref!r}")
diff --git a/tests/unit/cli/test_codex_plugin.py b/tests/unit/cli/test_codex_plugin.py
index eb3d968b0..21cbc63d6 100644
--- a/tests/unit/cli/test_codex_plugin.py
+++ b/tests/unit/cli/test_codex_plugin.py
@@ -62,6 +62,7 @@ def test_codex_plugin_skills_have_metadata_and_neutral_wording() -> None:
assert {path.parent.name for path in skill_paths} == {
"architectural-decisions",
+ "change-review",
"codebase-exploration",
"dead-code-cleanup",
"pre-modification-check",