feat: refine role expression and diagnose camera context in 0.5.2

This commit is contained in:
zenord
2026-10-12 14:02:14 +08:00
parent 18ec4c2104
commit 4d305ad0df
26 changed files with 461 additions and 123 deletions
+11 -9
View File
@@ -7,13 +7,16 @@ from pathlib import Path
import hashlib,json
root=Path.cwd();directory=root/'logs/voice-investigation'
load=lambda name:json.loads((directory/name).read_text())
deploy=load('gateway-emotion-deploy.json');probe=load('probe-emotion.json');client=load('client-emotion-tests.json');compat=load('reply-structure.json')
deploy=load('gateway-emotion-deploy.json');probe=load('probe-emotion.json');client=load('client-emotion-tests.json')
compat=json.loads((root/'logs/emotion-052/semantic-candidate.json').read_text())
assert deploy['applied'] and deploy['health']=='ok' and deploy['environment_unchanged']
assert probe['status']=='passed' and probe['downlink_bytes']>0 and probe['emotion_before_pcm'] and probe['drained_ack'] and probe['tts_requests']==1
assert compat['status']=='passed' and client['status']=='passed'
assert compat['status']=='passed' and compat['semantic_status']=='matched_fixed_cases' and client['status']=='passed'
for name,digest in deploy['hashes'].items():assert hashlib.sha256((root/'gateway'/name).read_bytes()).hexdigest()==digest,name
for name,digest in client['hashes'].items():assert hashlib.sha256((root/name).read_bytes()).hexdigest()==digest,name
assert not (root/'artifacts/lan-voice-v051-arm64-debug.apk').exists(), 'release artifact exists: refusing overwrite'
assert not (root/'artifacts/lan-voice-v052-arm64-debug.apk').exists(), 'release artifact exists: refusing overwrite'
assert (root/'artifacts/lan-voice-v051-arm64-debug.apk').is_file(), 'previous release required for signature comparison/rollback'
assert hashlib.sha256((root/'gateway/reply_emotion.py').read_bytes()).hexdigest()==compat['candidate_source_sha256'], 'semantic probe does not match candidate prompt source'
print('Verified tested client/provider source and successful deployed pipeline before APK build')
PY
./scripts/build.sh
@@ -29,20 +32,19 @@ from pathlib import Path
root=Path.cwd()
badging=(root/'logs/voice-investigation/release-emotion-badging.txt').read_text()
assert "name='com.gorios.lanvoice'" in badging
assert "versionCode='9'" in badging and "versionName='0.5.1'" in badging
assert "versionCode='10'" in badging and "versionName='0.5.2'" in badging
native=re.search(r'^native-code: (.+)$',badging,re.M)
assert native and native[1].strip()=="'arm64-v8a'", 'unexpected ABI'
source=root/'app/build/outputs/apk/debug/app-debug.apk'
previous=root/'artifacts/lan-voice-v040-arm64-debug.apk'
previous=root/'artifacts/lan-voice-v051-arm64-debug.apk'
if previous.exists():
old=subprocess.check_output(['/home/ubuntu/android-build/sdk/build-tools/34.0.0/apksigner','verify','--print-certs',str(previous)],text=True)
new=(root/'logs/voice-investigation/release-emotion-signature.txt').read_text()
pattern=r'Signer #1 certificate SHA-256 digest: (\w+)'
assert re.search(pattern,old)[1]==re.search(pattern,new)[1], 'signing certificate changed: update install would fail'
artifact=root/'artifacts/lan-voice-v051-arm64-debug.apk'
artifact=root/'artifacts/lan-voice-v052-arm64-debug.apk'
assert not artifact.exists(), 'release artifact exists: refusing overwrite'
assert hashlib.sha256((root/'artifacts/lan-voice-v040-arm64-debug.apk').read_bytes()).hexdigest()=='5a6f88cb2f825dbcd5c7b8c1f212b369534bc53c49533e196fb5e9287902e934'
assert hashlib.sha256((root/'artifacts/lan-voice-v050-arm64-debug.apk').read_bytes()).hexdigest()=='da47f7a08f63a68fbb6dbe7fb3d803ee58b402de393112a32f92a63ad50c1f33'
assert hashlib.sha256(previous.read_bytes()).hexdigest()=='7d089517cde3241d79c971d6260ed8f71af86851e2623fdc66e51fb1583ae77f'
shutil.copy2(source,artifact)
digest=hashlib.sha256(artifact.read_bytes()).hexdigest()
artifact.with_suffix('.apk.sha256').write_text(f'{digest} {artifact.name}\n')
@@ -60,7 +62,7 @@ for path in ('artifacts/'+artifact.name, artifact.name):
if downloaded==digest: url=base+path;break
except Exception: pass
assert url is not None, 'APK built, but existing HTTP server did not serve matching bytes'
result=dict(version_name='0.5.1',version_code=9,apk=str(artifact.relative_to(root)),bytes=artifact.stat().st_size,sha256=digest,url=url,download_http_status=200,download_bytes=len(content),signature='apksigner_verified',real_phone_playback='not_tested')
result=dict(version_name='0.5.2',version_code=10,apk=str(artifact.relative_to(root)),bytes=artifact.stat().st_size,sha256=digest,url=url,download_http_status=200,download_bytes=len(content),signature='apksigner_verified',same_signing_certificate_as='0.5.1',real_phone_playback='not_tested')
(root/'logs/voice-investigation/release-emotion.json').write_text(json.dumps(result,indent=2)+'\n')
print(json.dumps(result,indent=2))
PY