feat: improve ota packaging and people-flow runtime
This commit is contained in:
@@ -17,3 +17,15 @@
|
||||
- Trigger: the user required deployment to use `docker compose` only and explicitly disallowed host environment changes.
|
||||
- Rule: for remote rollout tasks in this repo, prefer repository-contained `docker compose` changes and do not install packages, edit host configs, or mutate global environment state unless the user explicitly approves it.
|
||||
- Preventive action: when a deployment is blocked, first fix Dockerfiles, compose files, env files, and mounted paths inside the repo before considering any host-level workaround.
|
||||
|
||||
## 2026-05-15
|
||||
|
||||
- Trigger: the `.11` OTA bundle host did not have a `zip` executable, and the current Python containers no longer exposed the historical `lap` overlay paths.
|
||||
- Rule: OTA bundle publication must not assume host archive tools or historical runtime overlay paths are present.
|
||||
- Preventive action: when cutting a release, package the ZIP with Python stdlib if `zip` is unavailable, treat overlay extraction as optional unless the paths are verified live in containers, and validate the final archive contents before upload.
|
||||
|
||||
## 2026-05-18
|
||||
|
||||
- Trigger: the user clarified that OTA installer updates should not keep repackaging and uploading the whole repository tree or fixed `people_flow_project` weights.
|
||||
- Rule: managed-portal OTA releases should ship a minimal ZIP with deploy metadata and managed config only; `people_flow_project` weights should be reused from a stable host location unless the weights themselves changed or the host is new.
|
||||
- Preventive action: when preparing OTA artifacts, use the minimal packaging script, exclude `managed/people_flow_project/weights` by default, and only publish a weights-bearing bundle for first-time installs or actual weight updates.
|
||||
|
||||
@@ -2,33 +2,31 @@
|
||||
|
||||
## Checklist
|
||||
|
||||
- [x] 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.
|
||||
- [x] Restore any queue-level code or tests that still reflect the temporary `>= threshold` crowded behavior.
|
||||
- [x] Run targeted validation for the touched queue-analytics logic.
|
||||
- [x] Update `tasks/todo.md` review evidence and create a scoped git commit containing only the intended files.
|
||||
- [x] Classify the remaining modified and untracked files into non-config code changes to commit versus local config/artifact files to exclude.
|
||||
- [x] Run targeted validation for the code and script changes that will be committed.
|
||||
- [x] Create a scoped git commit containing the non-config code changes only.
|
||||
- [ ] Push the scoped commit to `origin/main`.
|
||||
|
||||
## 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.
|
||||
- Scope: commit and push the remaining local non-config code changes in this repository while excluding local configuration files and generated artifacts.
|
||||
- Expected touch points: currently modified code/docs/scripts such as `README.md`, `deploy/install-managed-portal-ota.sh`, `deploy/package-managed-portal-ota.sh`, `managed/people_flow_project/src/people_flow/{models.py,pipeline.py}`, `managed/people_flow_project/tests/test_pipeline.py`, and `tasks/lessons.md`.
|
||||
- Risk: the worktree also contains local artifacts and config-adjacent outputs such as `test_output/`, `sim_workspace/`, `release-manifest.env`, `api_response.json`, and `output.txt`; these must not be swept into the commit by accident.
|
||||
- Risk: some modified files, especially docs and deployment scripts, are related to earlier OTA work and may need only narrow validation rather than full end-to-end execution.
|
||||
|
||||
## 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`.
|
||||
- Prove the selected commit excludes local config files and generated artifacts.
|
||||
- Run the narrowest meaningful checks for the people-flow pipeline/test changes and at least a syntax-level check for the OTA scripts.
|
||||
|
||||
## 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.
|
||||
- Status: in progress.
|
||||
- Commit set selected:
|
||||
- Included: `README.md`, `deploy/install-managed-portal-ota.sh`, `deploy/package-managed-portal-ota.sh`, `managed/people_flow_project/src/people_flow/models.py`, `managed/people_flow_project/src/people_flow/pipeline.py`, `managed/people_flow_project/tests/test_pipeline.py`, `tasks/lessons.md`, `tasks/todo.md`.
|
||||
- Excluded as local config or generated artifacts: `test_output/`, `sim_workspace/`, `release-manifest.env`, `api_response.json`, `output.txt`.
|
||||
- Validation completed:
|
||||
- `PYTHONPATH=. pytest tests/test_pipeline.py tests/test_queue_analytics.py` in `managed/people_flow_project`
|
||||
- Result: `9 passed in 0.66s`
|
||||
- `sh -n deploy/install-managed-portal-ota.sh`
|
||||
- `sh -n deploy/package-managed-portal-ota.sh`
|
||||
|
||||
Reference in New Issue
Block a user