Skip to content

Fix trust scoring so healthy homes can earn an A - #65

Merged
MaxDoubin merged 2 commits into
mainfrom
claude/continuing-work-lqzc3s
Oct 26, 2026
Merged

MaxDoubin merged 2 commits into
mainfrom
claude/continuing-work-lqzc3s

Conversation

@MaxDoubin

Copy link
Copy Markdown
Owner

Description

Two scoring problems made normal households look unhealthy:

  • Blocked advertising and analytics lookups come from the DNS filter flagged as warnings, so they were still counted as threat-intel matches (-7 each, up to -35) even after Home Radar 1.0: redesigned dashboard, live intruder demo, habit learning, and submission fixes #57 stopped counting them as blocked requests. They are now excluded from both factors.
  • A device could never score above 85, so a perfectly healthy home could never earn an A. Household-authorized devices with no blocked threats, open alerts, or unusually broad activity now get a +10 "clean recent activity" bonus.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • Backend: 421 tests pass (new tests for tracker warnings and the clean bonus); Ruff and Mypy clean

Generated by Claude Code

…vices

Blocked advertising and analytics lookups arrive from the DNS filter
flagged as warnings, so they were still being counted as threat-intel
matches (-7 each, up to -35) even after they stopped counting as blocked
requests. They are now excluded from both factors.

A device also could never score above 85, so a perfectly healthy home
could never earn an A. Household-authorized devices with no blocked
threats, open alerts, or unusually broad activity now get a +10 "clean
recent activity" bonus.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WH6rjxMVdiETELosD3ext
The window clause was interpolated into the query with an f-string.
It was a constant, but Bandit flags the pattern; write the queries out in full instead.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WH6rjxMVdiETELosD3ext
@MaxDoubin
MaxDoubin merged commit 9430905 into main Oct 26, 2026
35 checks passed
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.

2 participants