Files
managed-portal/tasks/todo.md

3.4 KiB

Task Plan

Checklist

  • Verify the local managed config files already match the requested webhook, 30-minute window, 5-minute queue threshold, and 2-5 normal / >5 crowded defaults.
  • Restore any queue-level code or tests that still reflect the temporary >= threshold crowded behavior.
  • Run targeted validation for the touched queue-analytics logic.
  • Update tasks/todo.md review evidence and create a scoped git commit containing only the intended files.

Scope And Risks

  • Scope: restore repository-local managed-service defaults so webhook delivery remains enabled, people-flow reporting flushes every 30 minutes, queue threshold is 5 minutes, fewer than 2 qualifying people means 人少, 2-5 means 人数正常, and more than 5 means 人多, then commit the relevant changes.
  • Expected touch points: managed/people_flow_project/src/people_flow/queue_analytics.py, managed/people_flow_project/tests/test_queue_analytics.py, and verification of local config files under managed/*/config/ plus any generated OTA test output that should remain aligned.
  • Risk: the worktree already contains unrelated modified and untracked files, so the commit must be scoped carefully to avoid pulling in unrelated work.
  • Risk: store_dwell_alert still has a separate queue-level implementation with the same > crowded comparison, but the user asked specifically to restore local config defaults plus "the code"; if we only revert people-flow logic, we should be explicit about any remaining asymmetry.

Validation Intent

  • Prove the local config files already encode window_seconds: 1800, queue_time_threshold_seconds: 300, crowded_count_threshold: 5, normal_count_threshold: 2, and webhook URLs.
  • Prove the restored queue-level comparison classifies over_threshold_count == 5 as normal and only >5 as crowded.

Review

  • Status: completed.
  • Config verification: local repository configs already matched the requested defaults before code edits.
    • managed/people_flow_project/config/local.yaml: webhook.url points to managed queue, rtsp.window_seconds=1800, queue_time_threshold_seconds=300, crowded_count_threshold=5, normal_count_threshold=2.
    • managed/store_dwell_alert/config/local.yaml: webhook.url points to managed queue, queue_time_threshold_seconds=300, crowded_count_threshold=5, normal_count_threshold=2.
    • Generated OTA test configs under test_output/managed-portal-test-ota/managed/.../config/local.yaml were already aligned with the same values.
  • Code restoration: reverted managed/people_flow_project/src/people_flow/queue_analytics.py so queue_level="crowded" now requires over_threshold_count > crowded_count_threshold, which restores the requested 2-5 normal / >5 crowded behavior.
  • Test restoration: updated managed/people_flow_project/tests/test_queue_analytics.py so the preview-state coverage remains intact while the boundary assertion now proves over_threshold_count == crowded_count_threshold stays normal.
  • Validation:
    • PYTHONPATH=. pytest tests/test_queue_analytics.py in managed/people_flow_project
    • Result: 3 passed in 0.03s
  • Commit scope note: only managed/people_flow_project/src/people_flow/queue_analytics.py, managed/people_flow_project/tests/test_queue_analytics.py, and tasks/todo.md should be committed for this task because the worktree contains unrelated modified and untracked files.