Enable reviewed Liam dances and add playback-driven voice status

This commit is contained in:
zenord
2026-10-14 21:35:51 +08:00
parent 5c4ea077ee
commit 376e4a347e
14 changed files with 278 additions and 16 deletions
+10 -1
View File
@@ -20,10 +20,15 @@ parser=argparse.ArgumentParser(description=__doc__)
parser.add_argument('--gateway-source',type=Path,default=ROOT/'gateway',
help='Existing canonical source or read-only snapshot; never changes/deploys the gateway')
parser.add_argument('--unreviewed-index-sha',default='',help='Also replay actual no-action Liam HELLO and ready/pending offers of this unregistered pin')
parser.add_argument('--reviewed-index-sha',default='',help='Existing registered exact pin to offer in actual production HELLO; does not change the registry')
args=parser.parse_args()
if args.unreviewed_index_sha:
import re
assert re.fullmatch('[0-9a-f]{64}',args.unreviewed_index_sha)
if args.reviewed_index_sha:
import re
assert re.fullmatch('[0-9a-f]{64}',args.reviewed_index_sha)
assert args.reviewed_index_sha in json.loads((args.gateway_source/'reviewed_action_packs.json').read_text())
gateway_root=args.gateway_source.resolve(strict=True)
snapshot=gateway_root/'SNAPSHOT.json'
if snapshot.exists():
@@ -57,6 +62,7 @@ with tempfile.TemporaryDirectory(prefix='character-handshake-') as folder:
hello_file=stage/'hello.jsonl'
subprocess.run([ns['JAVA'],'-Dcharacter.helloFile='+str(hello_file),
'-Dcharacter.unreviewedPin='+args.unreviewed_index_sha,
'-Dcharacter.reviewedPin='+args.reviewed_index_sha,
'-Dcharacter.personas='+','.join(personas),'-cp',
str(stage/'classes')+':'+ns['cp'],'HandshakeCheckKt'],check=True,timeout=30)
hellos=[json.loads(row) for row in hello_file.read_text().splitlines()]
@@ -108,6 +114,9 @@ for hello in hellos:
assert profile.call_count==(1 if persona=='default' else 0)
assert ack['action_available']==bool(negotiate(hello,configured_packs()))
assert ack['action_pending']==bool(pending_pin(hello,configured_packs()))
if REVIEWED:
assert ack['action_available']==('action_pack_sha256' in hello)
assert ack['action_pending']==('action_pending_pack_sha256' in hello)
if hello.get('action_pack_sha256')==UNREVIEWED or hello.get('action_pending_pack_sha256')==UNREVIEWED:
assert not ack['action_available'] and not ack['action_pending']
assert ack['conversation_id'] not in ids;ids.append(ack['conversation_id'])
@@ -127,5 +136,5 @@ for persona in sorted({x['persona'] for x in hellos}-{'default'}):
ws.receive_json();ids.append(ack['conversation_id'])
assert state.busy is False
print('PASS: '+str(len(ids))+' canonical ASGI WS handshakes from actual Android HELLO; personas='+','.join(sorted({x["persona"] for x in hellos}))+'; explicit persona ignores active_profile, server-locks voice/language, fresh CID, ready/pending exact pin and disconnect busy cleanup; 0 ASR/LLM/TTS calls, synthetic-only')
'''.replace('UNREVIEWED',repr(args.unreviewed_index_sha))
'''.replace('UNREVIEWED',repr(args.unreviewed_index_sha)).replace('REVIEWED',repr(args.reviewed_index_sha))
subprocess.run([sys.executable,'-c',runner],cwd=stage,check=True,timeout=30)