Skip to content

fix: resolve critical bugs from code review#1

Merged
sinonchum merged 1 commit into
mainfrom
fix/code-review-bugs
Apr 16, 2026
Merged

fix: resolve critical bugs from code review#1
sinonchum merged 1 commit into
mainfrom
fix/code-review-bugs

Conversation

@sinonchum

Copy link
Copy Markdown
Owner

Code Review Bug Fixes

🔴 Critical

  • src/api.py: Reconstructed corrupted _redis_url() function — lines 115-127 were garbled, merging the return statement with @app.post decorator. Restored _redis_client(), queue constants, and route decorator.
  • src/skills/verifier.py: Fixed warnings field passing nested list ([[str]]) instead of flat list ([str]), causing Pydantic validation error on CRITICAL/Warning translations.

⚠️ Warnings

  • src/api.py: global_exception_handler no longer returns str(exc) to clients (was leaking internal paths/stack traces). Errors now logged server-side only.
  • src/tasks.py: Removed hardcoded mock claim_text and prior_art_text — they silently overrode user input. Now defaults to empty string; mock OA file still loaded as fallback when no input provided.

💡 Improvements

  • docker-compose.yml: Added patentflow-data named volume to api and worker services, persisting data/ (SQLite DB, vector store, output) across container restarts.
  • tests/test_skills.py: Completely rewritten for current Skills API. 16 tests covering ClaimChartGenerator (tokenization, doc extraction, snippet extraction, full execute) and TranslationVerifier (safe/CRITICAL/missing terms/highlighting).

Test results: 20/20 passing

- Fix corrupted _redis_url() in api.py (lines 115-127 were garbled)
- Fix global_exception_handler to stop leaking stack traces to clients
- Fix TranslationVerifier warnings nesting bug (list of lists -> flat list)
- Remove hardcoded mock claim_text in tasks.py parse_docs()
- Rewrite tests/test_skills.py for current Skills API (16 tests, all passing)
- Add patentflow-data volume to docker-compose.yml for data persistence
@sinonchum sinonchum merged commit 952195d into main Apr 16, 2026
2 checks passed
@sinonchum sinonchum deleted the fix/code-review-bugs branch April 16, 2026 23:35
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