Skip to content

fix: CLI fallback, grep path leak, WAL log level#72

Open
Nelson Spence (Fieldnote-Echo) wants to merge 1 commit intomainfrom
fix/L3-code-defects
Open

fix: CLI fallback, grep path leak, WAL log level#72
Nelson Spence (Fieldnote-Echo) wants to merge 1 commit intomainfrom
fix/L3-code-defects

Conversation

@Fieldnote-Echo
Copy link
Member

Summary

  • F-CLI-01: Add user feedback before silent fallback to 'local' transport on invalid interactive input
  • F-CB-001: Line-anchored repo root prefix stripping in grep_code() output (prevents path leak to LLM)
  • F-GS-001: Upgrade WAL/FK pragma failure log level from WARNING to ERROR

Audit Context

  • Findings: F-CLI-01, F-CB-001, F-GS-001 (all LOW)
  • Lane: L3 (Code Defect Fixes) — Priority 2 in remediation plan
  • 3 single-file fixes, ~18 LOC total

Test plan

  • uv run pytest tests/ -v — full suite passes
  • Pre-commit hooks pass
  • uv run ruff check src/grippy/ tests/ — lint clean

🤖 Generated with Claude Code

…F-CB-001, F-GS-001)

F-CLI-01: Print message before falling back to 'local' transport on
invalid or out-of-range interactive input.

F-CB-001: Strip absolute repo root prefix from grep output lines using
line-anchored prefix removal — only the leading path segment is
relativized, matched content is preserved unchanged.

F-GS-001: Upgrade WAL mode and foreign key pragma failure log level
from WARNING to ERROR to make silent degradation visible.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Collaborator

@project-navi-bot project-navi-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All required CI checks passed. Auto-approved by navi-bot.

Copy link
Collaborator

@project-navi-bot project-navi-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All required CI checks passed. Auto-approved by navi-bot.

@@ -111,8 +111,14 @@ def _install_mcp(argv: list[str]) -> None:
print(f" {i}) {t}")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 LOW: Improved CLI feedback for invalid transport selection

Confidence: 92%

The PR adds explicit user feedback when a transport selection is out of range or cannot be parsed, before defaulting to 'local'. Previously, these silent fallbacks could cause confusion if a user supplied invalid input. The fix helps UX, but no logic bug existed in the fallback, only clarity.

Suggestion: No action needed, as this expands feedback for clarity. Optional: consolidate error messages if further simplification is desired.

— Not wrong, but there's a simpler way. This way's just fine.

@@ -714,7 +714,15 @@ def grep_code(pattern: str, glob: str = "*.py", context_lines: int = 2) -> str:
return "No matches found."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 LOW: Prevents absolute repo path leak in grep_code() output

Confidence: 93%

The grep_code() CLI tool previously outputted absolute repo-root paths, which could potentially leak internal path structure to LLMs or users. The fix strips the repo_root prefix for safety and privacy, producing relative paths in output.

Suggestion: No further action required. The fix is correct and scoped, but verify all output lines are covered-defense in depth.

— Works, but fragile-be sure to cover edge cases like symbolic links.

@@ -111,14 +111,14 @@ def _init_schema(self) -> None:
actual = str(cur.fetchone()[0])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 LOW: Upgrades WAL/FK pragma error logs to ERROR level

Confidence: 95%

Previously, failures to set or validate SQLite PRAGMA statements were only logged at WARNING level, which could let critical persistence problems slip by. This change raises such issues to log.error, improving visibility-impact is increased reliability of diagnosing storage problems.

Suggestion: No further action needed; the log level change is appropriate.

— Observable code is debuggable code. Good move.

@github-actions
Copy link
Contributor

✅ Grippy Review — PASS

Score: 94/100 | Findings: 3

Delta: 3 new


Commit: c0602bb

Copy link
Collaborator

@project-navi-bot project-navi-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All required CI checks passed. Auto-approved by navi-bot.

Copy link
Collaborator

@project-navi-bot project-navi-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All required CI checks passed. Auto-approved by navi-bot.

@codecov
Copy link

codecov bot commented Mar 15, 2026

Codecov Report

❌ Patch coverage is 75.00000% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/grippy/__main__.py 50.00% 3 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Collaborator

@project-navi-bot project-navi-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All required CI checks passed. Auto-approved by navi-bot.

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.

2 participants