r/Python • • 5h ago

Showcase Showcase Thread

Post all of your code/projects/showcases/AI slop here.

Recycles once a month.

8 Upvotes

19 comments sorted by

View all comments

1

u/BudgetRead4409 2h ago

LogicGuard v0.1.0 (MIT) — Diff-aware Tree-sitter AST + LLM security scanner for catching business-logic bugs in Python, JS, and TS.

What it does: Traditional linters/SAST handle syntax and taint well, while feeding whole repos to an LLM is slow and noisy. LogicGuard splits PR/diff scanning into two stages:

  1. Stage 1 (Tree-sitter AST, ~3ms): Parses only functions modified in git diff and filters for structural candidates (e.g., mutating routes without auth decorators, check-then-act balance updates without locks, bare except: pass swallowing state changes). Clean diffs exit immediately with zero API calls.

  2. Stage 2 (Structured LLM verification): Sends only matched candidates through Pydantic v2-validated verification using OpenRouter (works with openrouter/free at $0), Anthropic, or local Ollama—plus an --offline-only pure-AST mode.

Try it (no install needed):

  • uvx logicguard rules

  • uvx logicguard diff --base main --offline-only

Links:

Ships with 5 rules (auth_bypass, idor_ownership, race_toctou, silent_except, ai_hallucinated_guard) and a 2-file rule contract (CONTRIBUTING.md) with 8 open good first issue rule specs if anyone wants to add one.