Release digest
Fixed
- Corporate Trust Score Breakdown —
calculate_trust_score()now returns{score, breakdown}dict as canonical single source of truth. Eliminated hardcoded breakdown values (source_diversity: 5, consistency: 10) and hardcoded 60% sentiment across 7 callers in 4 files (agent_tools.py,chat_service.py,corporate_tools.py,db_utils.py). - Sentiment Column Drift — Normalized
sentiment→ai_sentiment_labelin SQL queries for schema consistency acrossagent_tools.pyandchat_service.py. - Review ID Instability — Replaced Python
hash()with deterministichashlib.sha256()[:16]ingoogle_reviews_harvester.pyandglassdoor_harvester.py. Prevents duplicate reviews on re-scrape across different Python processes. - Forensic Error Leak — Removed last
str(e)exposure inforensic_service.pycontract analysis error handler.
Internal
- Chat Prompt Weights — Corrected corporate weights from 30/25/20/15/10 to canonical 25/25/15/15/10/10. Fixed crypto weights from ranges to fixed 20/20/20/15/15/10.
- Risk Level Thresholds — Updated from 75/50/25 to canonical 80/60/40.
- Anti-Conditional Rule — Added "NEVER say 'if'" instruction to prevent speculative language.
- Forensic Score Clamping — AI-returned
trust_scorenow clamped to 0-100. Added_validate_risk_level()for canonical risk level normalization. - 4 new test files:
test_prompt_audit.py(23),test_forensic_validation.py(11),test_corporate_trust_score.py(22),test_review_id_stability.py(10) - Full regression: 66/66 tests passed
- Updated
PROJECT_CONTEXT.md§A2 Source Diversity mapping - Updated
knowledge-base/docs/features/trust-score.mdRuntime Contract