follow-up(statistics): P3 cleanups from PR #137 review #142
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#142
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?
Summary of P3 Cleanups from PR #137 Review Pass 2
During the second code review pass for PR #137 (
fix/cycle-verdict-ranking, addressing Issue #128), all functional and architectural requirements were verified and all 408 tests pass. The following minor cleanup opportunities (P3) were identified across standards and spec reviews:1. Test helper naming clarity in
tests/test_statistics_baselines.pyIn
test_statistics_baselines.py:245-247, an offset reset is seeded usingadd_verdict(reset_on_untrusted, "MANUAL_ADMIN", True)right below the comment stating that an offset reset is not a verdict:Suggestion: Either rename
add_verdicttoseed_calibration_logor callrecord_calibration_log_asyncdirectly to avoid semantic dissonance between the comment and the helper name.2. Test helper type precision in
tests/test_cycle_verdict.pyIn
tests/test_cycle_verdict.py:128:Suggestion: Annotate
granularitywithLiteral["day", "week", "month"]or domain type rather than rawstr.3. SQL priority documentation for future calibration types
In
app/db/occupancy_repository.py:64-76,_CYCLE_VERDICT_PRIORITY_SQLuses a 2-branchCASE WHEN(RETROACTIVE_GUARD_AUDIT-> 1, else 0).Suggestion: If future audit types are added to
_CYCLE_VERDICT_TYPES_SQL, ensure their priority ordering is explicitly defined rather than implicitly falling through toELSE 0.4. Stale comment cleanup in
app/services/analytics_service.py(Deferred from #128)As noted in Issue #128:
Line ~230 in
analytics_service.py:'oldest first, as the range query expects; the trust verdict is then read only until enough days pass'. Both halves are now obsolete as the range query accepts any order and trust evaluation is batched. The comment and any unnecessary sort can be cleaned up.Maintainer triage — 2026-09-27
Proceed with concrete helper naming and granularity typing cleanups. Item 4 (stale oldest-first comment/sort) is already absent on current master: verify and mark complete rather than restoring or duplicating work. Document audit-priority requirements where helpful; introducing new audit types is outside scope.