refactor(telemetry): recent_activity exclusion filtering is duplicated across backend and frontend #42
Labels
No labels
blocked
bug
enhancement
high-priority
low-priority
needs-info
needs-triage
ready-for-agent
ready-for-human
referenced
research
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gabogg/hikcentral#42
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Raised in the round-1 and round-2 reviews of #37 and left standing at merge. Non-blocking.
Problem
Excluded doors are filtered out of the activity stream twice, independently:
app/services/door_service.py:1259-1268filtersrecent_cyclesand stampsexclude_from_rankingsonto each cycle dict.app/static/js/src/ui/command_deck_adapter.js:527-539builds aSetof excluded door codes fromsnapshot.doorsand re-filters, checking both the cycle's own flag and the door-code match.The frontend cross-check was added deliberately in #37 so that an unstamped or legacy cycle payload cannot leak an excluded door, which is a reasonable defensive position. The result is still two implementations of one rule that must agree, in two languages, with no shared test pinning them together.
Why it matters
The predicate has already drifted once:
is_door_excludedin Python andisDoorExcludedin JS diverged on flag precedence and had to be re-aligned mid-review in #37. Two filter sites is the same failure shape one level up.Proposed direction
Decide which layer owns the rule and make the other one thin:
CONTEXT.mdand add a test that feeds an unstamped cycle through the adapter.Acceptance criteria