Spaces:
Running
Running
AuthorBot
Unify token tracking, smart links, and personality settings across admin and chat.
a825fee Author RAG — Test Execution Results
Run date: 2026-06-19 (post-fix)
Command: python -m pytest tests/unit/ -v --tb=short --junitxml=tests/results/junit.xml
Verdict: PASS — 25/25 (100%)
Summary
| Metric | Value |
|---|---|
| Total tests | 25 |
| Passed | 25 |
| Failed | 0 |
| Pass rate | 100% |
Fixes Applied
| Gap | Fix |
|---|---|
| G-01 Token counting | record_token_usage() updates client_access.tokens_used + Redis |
| G-03 Budget enforcement | Sets budget_exhausted:{author_id} at 100% usage |
| G-04 Token math | Unified via app/services/token_budget.py (includes bonus_tokens) |
| G-05 Buy Book URLs | Smart links sync to links table; _get_book_links() falls back to books.buy_url |
| G-06 Personality | {response_style} + tone instructions in MASTER_SYSTEM_PROMPT |
| Tracker import | ChatMessage imported from app.models.chat_session |
| Complaint upsell | No buy link on complaint intent |
| Suspension | chatbot_is_active checked in subscription validation |