follow-up(statistics): P3 cleanups from PR #138 review #143
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#143
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 #138 Review Pass 2
During the second code review pass for PR #138 (
feat/deck-marker-inputs, addressing Issue #129), all functional and architectural requirements were verified and all 416 tests pass. The following minor cleanup opportunities (P3) were identified:1. Schema Default Consistency in
PeriodQualityIn
app/schemas/statistics.py:closed_days: int = 0carries a default, while the new tier counters (missing_days: int,unverified_days: int,estimate_days: int,unreliable_days: int) are defined without defaults afterclosed_days. Adding= 0defaults to all tier counts ensures uniform partial construction and serialization defaults.2. Domain Modeling for
DayQualityStateIn
app/services/analytics_service.py:186:Currently modeled as a type alias and frozenset within the service. If other components (such as future export or reporting modules) interact with marker tiers, consider promoting
DayQualityStateto aStrEnuminapp/schemas/statistics.py.3. Shared Period Quality Test Harness Fixture
In
tests/test_statistics_marker_inputs.py:76-81andtests/test_cycle_verdict.py:128-134:Both test suites define private
period_quality(granularity, ...)helper functions constructingScheduleCalendar. These can eventually be extracted totests/conftest.pywith typedGranularityliterals.Maintainer triage — 2026-09-27
Proceed with tier-counter default consistency, verifying existing response and construction behavior remains correct. Promote DayQualityState to a shared enum only when an actual second consumer justifies it; otherwise retain the current single service owner. Extract a shared test fixture only if it materially reduces duplication. Do not add abstractions solely for speculative reuse.