3.5 KiB
3.5 KiB
Task Plan
Checklist
- Confirm the current
store_dwell_alerthalf-hour report path and identify the runtime control point. - Verify the plan covers behavior change, focused tests, deployment scope, and post-deploy validation.
- Update focused tests so
half_hour_reportis expected on rolling 1800-second windows from startup time. - Implement the rolling window behavior in
store_dwell_alertruntime code. - Run focused
store_dwell_alerttests for the changed slice. - Deploy the updated
store_dwell_alertcode toxiaozheng@10.8.0.11and restart only the affected service(s). - Validate the remote deployment and update the Review section with evidence.
Scope And Risks
- Scope: change
managed/store_dwell_alertsohalf_hour_reportuses rolling 1800-second windows from service startup instead of natural:00/:30boundaries, then deploy the change to10.8.0.11. - Expected touch points:
managed/store_dwell_alert/app/modules/dwell_engine.py,managed/store_dwell_alert/app/modules/reporter.py, and focused tests undermanaged/store_dwell_alert/tests/. - Risk: changing the window model can alter
window_startandwindow_endvalues consumed by downstream webhook receivers and manage APIs. - Risk: a delayed observation call may span more than one 30-minute window; the implementation should behave predictably and avoid duplicate emissions for the same window.
- Risk: deployment should be limited to
store-dwell-alertunless code or config diffs prove broader scope is required.
Validation Intent
- First pin the new expected behavior with focused tests.
- After the code change, run the narrowest
store_dwell_alerttests that cover report timing and report payloads. - After deployment, verify the remote service is healthy and that the deployed code matches local content.
Review
- Status: completed.
- Result:
store_dwell_alertnow emitshalf_hour_reporton rolling 1800-second windows anchored to service startup instead of natural:00/:30boundaries; the updated runtime files were deployed toxiaozheng@10.8.0.11, and the rebuiltstore-dwell-alertcontainer is healthy. - Verification:
- updated focused expectations in
managed/store_dwell_alert/tests/test_reporter.pyandmanaged/store_dwell_alert/tests/test_dwell_engine.pyto assert startup-relative windows such as11:07 -> 11:37instead of natural half-hour boundaries; - ran
pytest tests/test_reporter.py tests/test_dwell_engine.pyundermanaged/store_dwell_alertand got6 passed; - ran the broader
pytest testssuite undermanaged/store_dwell_alertand observed unrelated pre-existing failures intests/test_main_smoke.pyandtests/test_manage_api.pycaused by legacy config/test data issues such asThresholds.__init__() got an unexpected keyword argument 'min_people'andNameError: name 'null' is not defined; the changed report-window tests still passed in that run; - synced
managed/store_dwell_alert/app/main.py,managed/store_dwell_alert/app/modules/dwell_engine.py, andmanaged/store_dwell_alert/app/modules/reporter.pyto/home/xiaozheng/managed-portalon10.8.0.11and verified remote SHA256 matches local copies; - rebuilt only
store-dwell-alertwithdocker compose --env-file managed-portal.10.8.0.11.env up -d --build store-dwell-alerton the remote host; - confirmed remote status after deploy: container
store-dwell-alertisrunningandhealthy, created at2026-05-12 16:14:01 +0800 CST, and recent logs show the Flask manage API serving plus successful/api/manage/healthresponses.
- updated focused expectations in