Enable exact correct03 dialogue dance and add standalone camera diagnostics

This commit is contained in:
zenord
2026-10-13 22:25:58 +08:00
parent e4e063baa3
commit 34b1613046
19 changed files with 427 additions and 35 deletions
+13 -6
View File
@@ -358,8 +358,9 @@
},
"reviewed_action_packs.json": {
"source": "workspace:gateway/reviewed_action_packs.json",
"sha256": "830334cacf04bc488e7f07809a6defdcec481410b6bedb7b78cfa78f8ecf334e",
"bytes": 125
"sha256": "83ae8ab7dca27ffc329bfba3dd44a6b5b14ddf2716436e2844df46b7eb3228d3",
"bytes": 245,
"upstream_sha256": "830334cacf04bc488e7f07809a6defdcec481410b6bedb7b78cfa78f8ecf334e"
},
"tests/test_capabilities_ready.py": {
"source": "workspace:gateway/tests/test_capabilities_ready.py",
@@ -375,6 +376,11 @@
"source": "workspace:gateway/tests/test_presence.py",
"sha256": "c8e804680d99f05174d3feea32a4a7ecac7d49143fed897a107ff3d5dbacad86",
"bytes": 14050
},
"tests/test_correct03_admission.py": {
"source": "workspace:gateway/tests/test_correct03_admission.py",
"sha256": "1254cca0a33639890dba611d5a98b976687b15e5c5d55d9c834bc09388b4ee0d",
"bytes": 3133
}
},
"archive_baseline_commit": "19a7adccd9322986eb0646b165b9ce1cf2650cf2",
@@ -408,7 +414,8 @@
},
"release_baseline_commit": "d43c7d4e809a5a6b18ca9f28c8163a2f9ad34c7f",
"deployment_baseline": {
"source": "presence absent/appeared gateway 0.8.1; gateway-only hash/busy/backup deployment",
"source": "User-authorized correct03 debug normal-dialogue dance registry; gateway-only hash/busy/backup deployment",
"backup": "/home/gorios-spark-2/lan-voice/.runtime/backups/voice-gateway-20261013-221214",
"files": {
"action_protocol.py": "04c65ce27140da7757e0164983efe33800dddcff0139d16e8fe4c8a99a3b50ee",
"action_reply.py": "4d66164a6668a571dc861282a5c80e408b51dfcfd67f45141e8c6701f6b81364",
@@ -424,13 +431,14 @@
"presence.py": "56f20feb977da82e56c106d4a6862bbcbe92cf626391f8688ff9be8683c46f70",
"protocol.py": "d9f522d958935200002e56024949a12b71eb89b3f3241635c5c307b798ee71c5",
"reply_emotion.py": "080f04e368c5a7d26254f2b870803238941aa481d457227ba15a870fd4a4e3c0",
"reviewed_action_packs.json": "830334cacf04bc488e7f07809a6defdcec481410b6bedb7b78cfa78f8ecf334e",
"reviewed_action_packs.json": "83ae8ab7dca27ffc329bfba3dd44a6b5b14ddf2716436e2844df46b7eb3228d3",
"segmentation.py": "562ffc6e06f5b9f9072860b588feae3a5d7cd6eaa8577ac928d770071b06978d",
"server_clock.py": "dc46d79fd43c8b94f52acfdea0564058c47f3a3b8b43aa53fe6868a1821f3a0e",
"tests/test_action_protocol.py": "f1340c6c68674fc5d077003ca6be51746b31462ccc26acc0c092fbad01f629dc",
"tests/test_action_reply.py": "0c40a937be4c6545e04ed2268df1714c34dce982058f6b19daabf06b0fa30932",
"tests/test_capabilities_ready.py": "49b9cf64e6d30e389588014a3a1de04d1a7b98f20fbea036ace4dcf8debfe857",
"tests/test_continuity.py": "d8390238f390463a98f12b9909bb5846be65f5b6dc1b21b94338b4cd75aaafae",
"tests/test_correct03_admission.py": "1254cca0a33639890dba611d5a98b976687b15e5c5d55d9c834bc09388b4ee0d",
"tests/test_debug.py": "7d1d7876c4106f3df0b84cf8f7e479afb4a30ca51264fb94fa288fdd8155883e",
"tests/test_face_context.py": "c297866117fa7406b5fda95250b67ca7ebd7476486ddd5455935c140d31c9f6f",
"tests/test_gateway.py": "f22aa98f3d6f62a2949a9047ec97e6dd686cac807d989a314a95deca718a3104",
@@ -449,8 +457,7 @@
"tests_fake.py": "9a40f1948352f69f1dd20f8514baef58ae3d11eec240e1d2324d8990bad915d8",
"tts_debug.py": "d7b31b98a7f8ab688981873ef81decdf0b2f0167113c9103df039b7b24c9ccf2",
"vad.py": "3718ff9b296b2bba447100af520a631f221dcbfa322dd564cdc5809fb3675f23"
},
"backup": "/home/gorios-spark-2/lan-voice/.runtime/backups/voice-gateway-20261013-162856"
}
},
"server_capabilities": {
"structured_output_env": "LAN_LLM_STRUCTURED_OUTPUT",
+4
View File
@@ -2,5 +2,9 @@
"987e125a7d7a2cde99121b5f5246c82f4dbe36c4899d3d49eaffd1a68bafb887": {
"asset_01": 10042,
"asset_02": 10042
},
"208f703ed92bf795bfeb78a1cef89b67bed2e45da80038a56157fd1ecd4cfa93": {
"asset_01": 8042,
"asset_02": 8042
}
}
+40
View File
@@ -0,0 +1,40 @@
"""Exact user-authorized debug dialogue pack; no music/device/Pi approval inferred."""
import unittest
from unittest.mock import patch
from action_protocol import configured_packs,negotiate,pending_pin,ActionPlans
from gateway import Dialogue
from tests_fake import FakeModel
from test_gateway import Socket
PIN='208f703ed92bf795bfeb78a1cef89b67bed2e45da80038a56157fd1ecd4cfa93'
OLD='987e125a7d7a2cde99121b5f5246c82f4dbe36c4899d3d49eaffd1a68bafb887'
class Correct03Registry(unittest.TestCase):
def test_measured_durations_exact_pin_and_legacy_unknown_rejection(self):
with patch.dict('os.environ',{'LAN_ACTION_PACKS':'{}'}):
table=configured_packs();self.assertEqual(table[PIN],{'asset_01':8042,'asset_02':8042})
self.assertEqual(table[OLD],{'asset_01':10042,'asset_02':10042})
ready={'action_protocol':1,'action_kinds':['dance'],'action_pack_sha256':PIN}
self.assertEqual(negotiate(ready,table),(PIN,table[PIN]))
for offer in ({},{**ready,'action_kinds':[]},{**ready,'action_pack_sha256':'b'*64},
{**ready,'action_pack_sha256':'51847916d8fc16a489efe550ce8826f890274b78fadba6211b1560e3853662f5'}):
self.assertIsNone(negotiate(offer,table))
self.assertEqual(pending_pin({'action_protocol':1,'action_kinds':[],'action_pending_pack_sha256':PIN},table),PIN)
def test_correct03_completion_cannot_use_metadata_audio_end_timer(self):
now=[10.];p=ActionPlans('owner','conn',lambda:now[0]);ticket=p.create(7,None,(PIN,{'asset_01':8042,'asset_02':8042}))
p.drained(7)
started={'turn_id':7,'action_id':ticket.id,'status':'started','asset_id':'asset_01','mic_stopped':True}
self.assertEqual(p.status(started,7,'owner','conn')[0],'started')
done={**started,'status':'completed','video_ended':True,'audio_stopped':True,'idle_restored':True}
now[0]=18.;self.assertEqual(p.status(done,7,'owner','conn')[0],'too_early')
now[0]=18.042;self.assertEqual(p.status({**done,'audio_stopped':False},7,'owner','conn')[0],'ignored')
self.assertEqual(p.status(done,7,'owner','conn')[0],'completed');self.assertEqual(p.status(done,7,'owner','conn')[0],'ignored')
class Correct03Ready(unittest.IsolatedAsyncioTestCase):
async def test_pending_connection_upgrades_only_its_exact_pin_and_preserves_turn(self):
socket=Socket();d=Dialogue(socket,FakeModel(),None);d.pending_action_pin=PIN
ready={'action_protocol':1,'action_kinds':['dance'],'action_pack_sha256':PIN}
try:
with patch.dict('os.environ',{'LAN_ACTION_PACKS':'{}'}):
await d.capabilities_ready({**ready,'action_pack_sha256':OLD});self.assertIsNone(d.action_capability)
await d.capabilities_ready(ready);self.assertEqual(d.action_capability,(PIN,{'asset_01':8042,'asset_02':8042}))
cap=d.action_capability;await d.capabilities_ready(ready);self.assertEqual(d.action_capability,cap)
self.assertEqual(d.turn,0);self.assertIsNone(d.task);self.assertIsNone(d.action_plans.ticket)
finally:await d.close()