-
Notifications
You must be signed in to change notification settings - Fork 38
[issue/1002] Fix and enhance singleton sensor tagging with cache persistence #1029
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
1109c30
d38b94e
93761c0
532562d
3da5a2c
58516fe
e9a557b
d012fd1
6af611f
e088838
56076b9
17b12cb
0b602a0
d465e5f
69284d1
0687112
0a17d9e
3444c53
fce470c
f8e5539
29d07a0
52a7dd3
2fe1eb8
a67d83c
e36622e
8b381dc
e0ca161
f6e541a
a22089b
45d301f
a97309b
d738628
d2c5b89
4cbe87f
79dc82a
aaafff0
78dfcf6
5708bc4
16bfb1d
e746441
ad6c6f7
2f97fcc
fee53b5
0d8d74f
ce7e571
623725a
9ead4be
b37427b
d11beea
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| <!-- | ||
| SPDX-FileCopyrightText: (C) 2026 Intel Corporation | ||
| SPDX-License-Identifier: Apache-2.0 | ||
| --> | ||
|
|
||
| # AI Agent Skill: Test Verification Gate | ||
|
|
||
| Use this skill whenever a task adds or modifies tests. | ||
|
|
||
| ## Goal | ||
|
|
||
| Ensure runtime verification is completed and reported consistently. | ||
|
|
||
| ## Required Checklist | ||
|
|
||
| 1. Select a repository Makefile target that covers the modified tests. | ||
| 2. Prefer a root target when practical (for example, `make run_unit_tests`). | ||
| 3. Otherwise select the narrowest scoped target in `tests/Makefile` | ||
| (for example, `make -C tests scenescape-unit`). | ||
| 4. If the selected target runs in a service `...-test` container image, | ||
| rebuild images for changed services before executing tests. | ||
| 5. Execute the target. | ||
| 6. If failures occur, confirm image freshness before code-level debugging: | ||
| - Rebuild the impacted service runtime and test images if not rebuilt. | ||
| - Rerun the same target once on fresh images. | ||
| 7. If still failing, fix and rerun the same target. | ||
| 8. Report exact command and concise pass/fail summary. | ||
|
|
||
| ## Image Freshness Mapping (Common) | ||
|
|
||
| - Changed `controller/src/**` + `make -C tests scene-unit`: | ||
| - `make controller` | ||
| - `make -C controller test-build` | ||
| - then run `make -C tests scene-unit SUPASS=<password>` | ||
|
|
||
| Apply the same pattern to other services: rebuild runtime + test image before | ||
| running containerized test targets. | ||
|
|
||
| ## Blocked Execution Policy | ||
|
|
||
| If execution is blocked (missing environment, skipped setup, unavailable | ||
| runtime), report: | ||
|
|
||
| 1. What is blocked. | ||
| 2. The exact command that should be run once unblocked. | ||
| 3. Whether task completion is partial. | ||
|
|
||
| ## Not Sufficient | ||
|
|
||
| - Lint success only | ||
| - Syntax-only checks | ||
| - IDE static errors only | ||
| - Repeated reruns against stale container images | ||
|
|
||
| These checks are useful but do not replace runtime test execution. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,21 +9,21 @@ | |
| from scene_common.timestamp import get_iso_time | ||
|
|
||
|
|
||
| def buildDetectionsDict(objects, scene): | ||
| def buildDetectionsDict(objects, scene, include_sensors=False): | ||
| result_dict = {} | ||
| for obj in objects: | ||
| obj_dict = prepareObjDict(scene, obj, False) | ||
| obj_dict = prepareObjDict(scene, obj, False, include_sensors) | ||
| result_dict[obj_dict['id']] = obj_dict | ||
| return result_dict | ||
|
|
||
| def buildDetectionsList(objects, scene, update_visibility=False): | ||
| def buildDetectionsList(objects, scene, update_visibility=False, include_sensors=False): | ||
| result_list = [] | ||
| for obj in objects: | ||
| obj_dict = prepareObjDict(scene, obj, update_visibility) | ||
| obj_dict = prepareObjDict(scene, obj, update_visibility, include_sensors) | ||
| result_list.append(obj_dict) | ||
| return result_list | ||
|
|
||
| def prepareObjDict(scene, obj, update_visibility): | ||
| def prepareObjDict(scene, obj, update_visibility, include_sensors=False): | ||
| aobj = obj | ||
| if isinstance(obj, TripwireEvent): | ||
| aobj = obj.object | ||
|
|
@@ -37,7 +37,9 @@ def prepareObjDict(scene, obj, update_visibility): | |
| if not velocity.is3D: | ||
| velocity = Point(velocity.x, velocity.y, DEFAULTZ) | ||
|
|
||
| obj_dict = aobj.info | ||
| # Build a fresh top-level dict per serialization so optional fields like | ||
| # sensors do not leak between scene, regulated, and external outputs. | ||
| obj_dict = dict(aobj.info) | ||
| obj_dict.update({ | ||
| 'id': aobj.gid, # gid is the global ID - computed by SceneScape server. | ||
| 'type': otype, | ||
|
|
@@ -83,11 +85,37 @@ def prepareObjDict(scene, obj, update_visibility): | |
| if update_visibility: | ||
| computeCameraBounds(scene, aobj, obj_dict) | ||
|
|
||
| chain_data = aobj.chain_data | ||
| if len(chain_data.regions): | ||
| obj_dict['regions'] = chain_data.regions | ||
| if len(chain_data.sensors): | ||
| obj_dict['sensors'] = chain_data.sensors | ||
| if hasattr(aobj, 'chain_data'): | ||
| chain_data = aobj.chain_data | ||
| if len(chain_data.regions): | ||
| obj_dict['regions'] = chain_data.regions | ||
|
|
||
| if include_sensors: | ||
| sensors_output = {} | ||
|
|
||
| # Copy sensor data while holding lock, then release | ||
| with chain_data._lock: | ||
| env_state_copy = dict(chain_data.env_sensor_state) | ||
| attr_events_copy = dict(chain_data.attr_sensor_events) | ||
|
|
||
| # Environmental sensors: timestamped readings | ||
| for sensor_id, state in env_state_copy.items(): | ||
| values = state['readings'] if 'readings' in state and state['readings'] else [] | ||
|
|
||
|
Comment on lines
+96
to
+104
|
||
| sensors_output[sensor_id] = { | ||
| 'values': values | ||
| } | ||
|
|
||
| # Attribute sensors: events as structured object | ||
| for sensor_id, events in attr_events_copy.items(): | ||
| if events: | ||
| sensors_output[sensor_id] = { | ||
| 'values': events | ||
| } | ||
|
|
||
| if sensors_output: | ||
| obj_dict['sensors'] = sensors_output | ||
|
|
||
| if hasattr(aobj, 'confidence'): | ||
| obj_dict['confidence'] = aobj.confidence | ||
| if hasattr(aobj, 'similarity'): | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.