Skip to content

Code quality: pin dependencies, sanitize SQL, refresh tests, remove dead code#12

Open
BrandonS7 wants to merge 1 commit intoBirmingham-AI:mainfrom
BrandonS7:fix/code-quality
Open

Code quality: pin dependencies, sanitize SQL, refresh tests, remove dead code#12
BrandonS7 wants to merge 1 commit intoBirmingham-AI:mainfrom
BrandonS7:fix/code-quality

Conversation

@BrandonS7
Copy link
Copy Markdown

What this does

1. Pin unpinned dependency

openinference-instrumentation-openai-agents was completely unpinned in requirements.txt. Pinned to 0.1.14. An unpinned dependency means any upstream publish (including compromised ones) flows directly into builds.

2. SQL wildcard sanitization

Added escape_sql_wildcards() to rag_service.py to escape % and _ characters in user-provided search terms before they hit ilike queries. Prevents users from crafting wildcard patterns that bypass intended filtering.

3. Refreshed test file

Replaced the stale test_backend.py (referenced old APIs and required local embeddings) with a minimal smoke test that verifies the FastAPI app imports and initializes correctly. This at least catches import-time errors and missing dependencies.

4. Removed dead code

  • Deleted backend/actions/bundle.py (legacy embedding bundler, no longer imported anywhere)
  • Deleted backend/actions/embed.py (legacy embedder, no longer imported)
  • Updated README references to remove mentions of these deleted files

Net reduction of ~170 lines. No behavior changes to the running application.

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.

1 participant