Integrate corrected char expressions into Liam code36
This commit is contained in:
@@ -13,4 +13,5 @@ __pycache__/
|
|||||||
app/src/main/assets/avatar/
|
app/src/main/assets/avatar/
|
||||||
app/src/main/res/drawable-nodpi/startup_poster.png
|
app/src/main/res/drawable-nodpi/startup_poster.png
|
||||||
app/src/main/res/drawable-nodpi/startup_black_tulle_poster.png
|
app/src/main/res/drawable-nodpi/startup_black_tulle_poster.png
|
||||||
|
app/src/characterAssets/
|
||||||
camera-probe/build/
|
camera-probe/build/
|
||||||
|
|||||||
+15
-5
@@ -40,7 +40,7 @@ def avatarPlaybackDiagnostic = providers.gradleProperty('avatarPlaybackDiagnosti
|
|||||||
def avatarRuntimeFix = providers.gradleProperty('avatarRuntimeFix').orNull == 'true'
|
def avatarRuntimeFix = providers.gradleProperty('avatarRuntimeFix').orNull == 'true'
|
||||||
def avatarFullActionCandidate = providers.gradleProperty('avatarFullActionCandidate').orNull == 'true'
|
def avatarFullActionCandidate = providers.gradleProperty('avatarFullActionCandidate').orNull == 'true'
|
||||||
def actionVersionCode = (providers.gradleProperty('actionVersionCode').orNull ?: '16').toInteger()
|
def actionVersionCode = (providers.gradleProperty('actionVersionCode').orNull ?: '16').toInteger()
|
||||||
if (characterProfileId != 'main' && (!avatarUserAssetCandidate || !avatarUserNetworkActions || actionVersionCode < characterProfile.minimumVersionCode)) throw new GradleException('Persona test requires existing exact black media/network flags and its minimum version code')
|
if (characterProfileId != 'main' && (!avatarUserAssetCandidate || actionVersionCode < characterProfile.minimumVersionCode)) throw new GradleException('Persona test requires authorized exact media and its minimum version code')
|
||||||
if (avatarActionCandidate && (!avatarMouthCandidate || actionVersionCode < 16)) {
|
if (avatarActionCandidate && (!avatarMouthCandidate || actionVersionCode < 16)) {
|
||||||
throw new GradleException('Action stage requires the existing mouth runtime and a fresh code >=16')
|
throw new GradleException('Action stage requires the existing mouth runtime and a fresh code >=16')
|
||||||
}
|
}
|
||||||
@@ -52,7 +52,11 @@ if (avatarUiCandidate && !avatarNatural) {
|
|||||||
}
|
}
|
||||||
def naturalManifestSha = providers.gradleProperty('naturalManifestSha').orNull ?: ''
|
def naturalManifestSha = providers.gradleProperty('naturalManifestSha').orNull ?: ''
|
||||||
def emotionManifestSha = providers.gradleProperty('emotionManifestSha').orNull ?: ''
|
def emotionManifestSha = providers.gradleProperty('emotionManifestSha').orNull ?: ''
|
||||||
def characterMedia = characterCatalog.mediaBundles[avatarUserAssetCandidate ? 'black-correct03' : 'white-full04']
|
def characterMediaId = providers.gradleProperty('characterMediaBundle').orNull ?: (avatarUserAssetCandidate ? 'black-correct03' : 'white-full04')
|
||||||
|
def characterMedia = characterCatalog.mediaBundles[characterMediaId]
|
||||||
|
def allowedMedia = characterProfile.mediaSelection == 'existing-build-flags' ? ['black-correct03','white-full04'] : [characterProfile.mediaSelection] + (characterProfile.additionalMediaSelections ?: [])
|
||||||
|
if (!characterMedia || !(characterMediaId in allowedMedia)) throw new GradleException('Profile/media selection is not authorized')
|
||||||
|
if (avatarUserNetworkActions && characterMedia.networkActionsAllowed != true) throw new GradleException('Network dance requires separate reviewed media registration')
|
||||||
if (emotionManifestSha && !(emotionManifestSha ==~ /[0-9a-f]{64}/)) throw new GradleException('Emotion graph requires exact external manifest SHA')
|
if (emotionManifestSha && !(emotionManifestSha ==~ /[0-9a-f]{64}/)) throw new GradleException('Emotion graph requires exact external manifest SHA')
|
||||||
if (emotionManifestSha && (!avatarActionCandidate || !avatarMouthCandidate || !avatarNatural || actionVersionCode < 17)) throw new GradleException('Emotion candidate requires own-mouth runtime and a fresh code >=17')
|
if (emotionManifestSha && (!avatarActionCandidate || !avatarMouthCandidate || !avatarNatural || actionVersionCode < 17)) throw new GradleException('Emotion candidate requires own-mouth runtime and a fresh code >=17')
|
||||||
if (avatarFullActionCandidate && (!emotionManifestSha || !avatarActionCandidate || actionVersionCode < 18)) throw new GradleException('Full candidate requires pinned emotion/action graph and fresh code >=18')
|
if (avatarFullActionCandidate && (!emotionManifestSha || !avatarActionCandidate || actionVersionCode < 18)) throw new GradleException('Full candidate requires pinned emotion/action graph and fresh code >=18')
|
||||||
@@ -64,7 +68,7 @@ if (faceDiagnosticsFix && (!presenceCandidate || actionVersionCode < 24)) throw
|
|||||||
if (presenceCandidate && (!avatarStartupFix || actionVersionCode < 23)) throw new GradleException('Presence candidate requires startup fix and fresh code >=23')
|
if (presenceCandidate && (!avatarStartupFix || actionVersionCode < 23)) throw new GradleException('Presence candidate requires startup fix and fresh code >=23')
|
||||||
if (avatarStartupFix && (!avatarPlaybackClockFix || actionVersionCode < 22)) throw new GradleException('Startup fix requires repaired playback and fresh code >=22')
|
if (avatarStartupFix && (!avatarPlaybackClockFix || actionVersionCode < 22)) throw new GradleException('Startup fix requires repaired playback and fresh code >=22')
|
||||||
if (avatarUserNetworkActions && (!avatarUserAssetCandidate || actionVersionCode < 32)) throw new GradleException('User network dance requires authorized exact asset mode and fresh code >=32')
|
if (avatarUserNetworkActions && (!avatarUserAssetCandidate || actionVersionCode < 32)) throw new GradleException('User network dance requires authorized exact asset mode and fresh code >=32')
|
||||||
if (avatarUserAssetCandidate && (!avatarStartupFix || !cameraProbeDiagnostic || actionVersionCode < 30 || emotionManifestSha != '208f703ed92bf795bfeb78a1cef89b67bed2e45da80038a56157fd1ecd4cfa93')) throw new GradleException('User asset debug candidate requires exact authorized correct03, startup and current diagnostics, fresh code >=30')
|
if (avatarUserAssetCandidate && (!avatarStartupFix || !cameraProbeDiagnostic || actionVersionCode < (characterMedia.minimumVersionCode ?: 30) || characterMedia.userAuthorizedDebug != true || emotionManifestSha != characterMedia.indexSha256)) throw new GradleException('User asset debug candidate requires exact authorized media, startup and current diagnostics, fresh code')
|
||||||
if (!avatarUserAssetCandidate && avatarPlaybackClockFix && (!avatarFullActionCandidate || actionVersionCode < 21 || emotionManifestSha != '987e125a7d7a2cde99121b5f5246c82f4dbe36c4899d3d49eaffd1a68bafb887')) throw new GradleException('Playback clock fix requires frozen full graph and fresh code >=21')
|
if (!avatarUserAssetCandidate && avatarPlaybackClockFix && (!avatarFullActionCandidate || actionVersionCode < 21 || emotionManifestSha != '987e125a7d7a2cde99121b5f5246c82f4dbe36c4899d3d49eaffd1a68bafb887')) throw new GradleException('Playback clock fix requires frozen full graph and fresh code >=21')
|
||||||
if (avatarPlaybackDiagnostic && (!avatarFullActionCandidate || actionVersionCode < 20 || emotionManifestSha != '987e125a7d7a2cde99121b5f5246c82f4dbe36c4899d3d49eaffd1a68bafb887')) throw new GradleException('Playback diagnostic requires frozen full graph and fresh code >=20')
|
if (avatarPlaybackDiagnostic && (!avatarFullActionCandidate || actionVersionCode < 20 || emotionManifestSha != '987e125a7d7a2cde99121b5f5246c82f4dbe36c4899d3d49eaffd1a68bafb887')) throw new GradleException('Playback diagnostic requires frozen full graph and fresh code >=20')
|
||||||
if (avatarRuntimeFix && (!avatarFullActionCandidate || actionVersionCode < 19)) throw new GradleException('Runtime fix requires full pinned graph and fresh code >=19')
|
if (avatarRuntimeFix && (!avatarFullActionCandidate || actionVersionCode < 19)) throw new GradleException('Runtime fix requires full pinned graph and fresh code >=19')
|
||||||
@@ -104,10 +108,12 @@ def stagePackagedAssets = tasks.register('stagePackagedAssets', Exec) {
|
|||||||
inputs.files(characterCatalogFile, rootProject.file('manifests/retained-avatar-files.json'), rootProject.file('scripts/select-character-assets.py'))
|
inputs.files(characterCatalogFile, rootProject.file('manifests/retained-avatar-files.json'), rootProject.file('scripts/select-character-assets.py'))
|
||||||
inputs.dir(file('src/main/assets'))
|
inputs.dir(file('src/main/assets'))
|
||||||
inputs.dir(file('src/main/res/drawable-nodpi'))
|
inputs.dir(file('src/main/res/drawable-nodpi'))
|
||||||
inputs.property('selection', [characterProfileId, emotionManifestSha, avatarUserAssetCandidate, avatarMouthCandidate, avatarStartupFix].toString())
|
if (characterMedia.resourceDirectory) inputs.dir(rootProject.file(characterMedia.resourceDirectory))
|
||||||
|
inputs.property('selection', [characterProfileId, characterMediaId, emotionManifestSha, avatarUserAssetCandidate, avatarMouthCandidate, avatarStartupFix].toString())
|
||||||
outputs.dir(packagedAssets)
|
outputs.dir(packagedAssets)
|
||||||
outputs.file(layout.buildDirectory.file('generated/character-selection.json'))
|
outputs.file(layout.buildDirectory.file('generated/character-selection.json'))
|
||||||
commandLine 'python3', rootProject.file('scripts/select-character-assets.py'), '--profile', characterProfileId,
|
commandLine 'python3', rootProject.file('scripts/select-character-assets.py'), '--profile', characterProfileId,
|
||||||
|
'--media-bundle', emotionManifestSha ? characterMediaId : '',
|
||||||
'--assets', file('src/main/assets'), '--emotion-sha', emotionManifestSha,
|
'--assets', file('src/main/assets'), '--emotion-sha', emotionManifestSha,
|
||||||
'--user-assets', avatarUserAssetCandidate.toString(), '--mouth', avatarMouthCandidate.toString(),
|
'--user-assets', avatarUserAssetCandidate.toString(), '--mouth', avatarMouthCandidate.toString(),
|
||||||
'--startup', avatarStartupFix.toString(), '--output', packagedAssets.get().asFile,
|
'--startup', avatarStartupFix.toString(), '--output', packagedAssets.get().asFile,
|
||||||
@@ -123,7 +129,7 @@ android {
|
|||||||
resValue 'string', 'character_app_name', characterProfile.appName
|
resValue 'string', 'character_app_name', characterProfile.appName
|
||||||
buildConfigField 'String', 'CHARACTER_PROFILE', groovy.json.JsonOutput.toJson(characterProfileId)
|
buildConfigField 'String', 'CHARACTER_PROFILE', groovy.json.JsonOutput.toJson(characterProfileId)
|
||||||
buildConfigField 'String', 'DIALOGUE_PERSONA', groovy.json.JsonOutput.toJson(characterProfile.persona)
|
buildConfigField 'String', 'DIALOGUE_PERSONA', groovy.json.JsonOutput.toJson(characterProfile.persona)
|
||||||
buildConfigField 'String', 'CHARACTER_NOTE', groovy.json.JsonOutput.toJson(characterProfile.settingsNote)
|
buildConfigField 'String', 'CHARACTER_NOTE', groovy.json.JsonOutput.toJson(characterMedia.settingsNote ?: characterProfile.settingsNote)
|
||||||
buildConfigField 'boolean', 'PERMISSION_CONNECTION_RETENTION', characterProfile.permissionConnectionRetention.toString()
|
buildConfigField 'boolean', 'PERMISSION_CONNECTION_RETENTION', characterProfile.permissionConnectionRetention.toString()
|
||||||
minSdk 26
|
minSdk 26
|
||||||
targetSdk 34
|
targetSdk 34
|
||||||
@@ -131,6 +137,7 @@ android {
|
|||||||
versionCode avatarActionCandidate ? actionVersionCode : (avatarMouthCandidate ? 15 : (avatarUiCandidate ? 14 : (avatarNatural ? 13 : 12)))
|
versionCode avatarActionCandidate ? actionVersionCode : (avatarMouthCandidate ? 15 : (avatarUiCandidate ? 14 : (avatarNatural ? 13 : 12)))
|
||||||
versionName = avatarUserNetworkActions ? '0.7.14' : avatarUserAssetCandidate ? '0.7.12' : cameraProbeDiagnostic ? '0.7.11' : cameraPreviewStream ? '0.7.9' : cameraDirectYuv ? '0.7.8' : cameraCompatibilityFix ? '0.7.7' : faceDiagnosticsFix ? '0.7.6' : presenceCandidate ? '0.7.5' : avatarStartupFix ? '0.7.4' : avatarPlaybackClockFix ? '0.7.3' : avatarPlaybackDiagnostic ? '0.7.2' : avatarRuntimeFix ? '0.7.1' : (avatarActionCandidate ? '0.7.0' : ((avatarUiCandidate || avatarMouthCandidate) ? '0.6.2' : '0.6.1'))
|
versionName = avatarUserNetworkActions ? '0.7.14' : avatarUserAssetCandidate ? '0.7.12' : cameraProbeDiagnostic ? '0.7.11' : cameraPreviewStream ? '0.7.9' : cameraDirectYuv ? '0.7.8' : cameraCompatibilityFix ? '0.7.7' : faceDiagnosticsFix ? '0.7.6' : presenceCandidate ? '0.7.5' : avatarStartupFix ? '0.7.4' : avatarPlaybackClockFix ? '0.7.3' : avatarPlaybackDiagnostic ? '0.7.2' : avatarRuntimeFix ? '0.7.1' : (avatarActionCandidate ? '0.7.0' : ((avatarUiCandidate || avatarMouthCandidate) ? '0.6.2' : '0.6.1'))
|
||||||
ndk { abiFilters 'arm64-v8a' }
|
ndk { abiFilters 'arm64-v8a' }
|
||||||
|
if (characterProfile.versionBase) versionName = characterProfile.versionBase
|
||||||
versionName += characterProfile.versionSuffix
|
versionName += characterProfile.versionSuffix
|
||||||
}
|
}
|
||||||
compileOptions { sourceCompatibility JavaVersion.VERSION_17; targetCompatibility JavaVersion.VERSION_17 }
|
compileOptions { sourceCompatibility JavaVersion.VERSION_17; targetCompatibility JavaVersion.VERSION_17 }
|
||||||
@@ -150,6 +157,7 @@ android {
|
|||||||
buildConfigField 'String', 'EMOTION_ASSET_ROOT', groovy.json.JsonOutput.toJson(characterMedia.assetRoot)
|
buildConfigField 'String', 'EMOTION_ASSET_ROOT', groovy.json.JsonOutput.toJson(characterMedia.assetRoot)
|
||||||
buildConfigField 'String', 'STARTUP_ASSET_ROOT', groovy.json.JsonOutput.toJson(characterMedia.bootstrapRoot)
|
buildConfigField 'String', 'STARTUP_ASSET_ROOT', groovy.json.JsonOutput.toJson(characterMedia.bootstrapRoot)
|
||||||
buildConfigField 'String', 'STARTUP_MANIFEST_SHA', groovy.json.JsonOutput.toJson(characterMedia.bootstrapSha256)
|
buildConfigField 'String', 'STARTUP_MANIFEST_SHA', groovy.json.JsonOutput.toJson(characterMedia.bootstrapSha256)
|
||||||
|
buildConfigField 'int', 'STARTUP_POSTER_RES_ID', 'com.gorios.lanvoice.R.drawable.' + characterMedia.posterResource
|
||||||
buildConfigField 'boolean', 'CAMERA_PROBE_DIAGNOSTIC', cameraProbeDiagnostic ? 'true' : 'false'
|
buildConfigField 'boolean', 'CAMERA_PROBE_DIAGNOSTIC', cameraProbeDiagnostic ? 'true' : 'false'
|
||||||
buildConfigField 'boolean', 'AVATAR_STARTUP_FIX', avatarStartupFix ? 'true' : 'false'
|
buildConfigField 'boolean', 'AVATAR_STARTUP_FIX', avatarStartupFix ? 'true' : 'false'
|
||||||
buildConfigField 'boolean', 'AVATAR_ENGINEERING', (avatarEngineering || avatarNatural) ? 'true' : 'false'
|
buildConfigField 'boolean', 'AVATAR_ENGINEERING', (avatarEngineering || avatarNatural) ? 'true' : 'false'
|
||||||
@@ -164,6 +172,7 @@ android {
|
|||||||
buildConfigField 'String', 'EMOTION_ASSET_ROOT', '"avatar/a01-expression-action-v1/"'
|
buildConfigField 'String', 'EMOTION_ASSET_ROOT', '"avatar/a01-expression-action-v1/"'
|
||||||
buildConfigField 'String', 'STARTUP_ASSET_ROOT', '"avatar/startup-white-01/"'
|
buildConfigField 'String', 'STARTUP_ASSET_ROOT', '"avatar/startup-white-01/"'
|
||||||
buildConfigField 'String', 'STARTUP_MANIFEST_SHA', '"461f5cfc10036de5f10ca3ce765fb8d9998697d3fd035aa9b1862d2ccfc3eaa2"'
|
buildConfigField 'String', 'STARTUP_MANIFEST_SHA', '"461f5cfc10036de5f10ca3ce765fb8d9998697d3fd035aa9b1862d2ccfc3eaa2"'
|
||||||
|
buildConfigField 'int', 'STARTUP_POSTER_RES_ID', 'com.gorios.lanvoice.R.drawable.startup_poster'
|
||||||
buildConfigField 'boolean', 'CAMERA_PROBE_DIAGNOSTIC', 'false'
|
buildConfigField 'boolean', 'CAMERA_PROBE_DIAGNOSTIC', 'false'
|
||||||
buildConfigField 'boolean', 'AVATAR_STARTUP_FIX', 'false'
|
buildConfigField 'boolean', 'AVATAR_STARTUP_FIX', 'false'
|
||||||
buildConfigField 'boolean', 'AVATAR_ENGINEERING', 'false'
|
buildConfigField 'boolean', 'AVATAR_ENGINEERING', 'false'
|
||||||
@@ -175,6 +184,7 @@ android {
|
|||||||
}
|
}
|
||||||
androidResources { noCompress += ['task', 'mp4'] }
|
androidResources { noCompress += ['task', 'mp4'] }
|
||||||
sourceSets.main.res.srcDir(networkSecurityResources)
|
sourceSets.main.res.srcDir(networkSecurityResources)
|
||||||
|
if (characterMedia.resourceDirectory) sourceSets.main.res.srcDir(rootProject.file(characterMedia.resourceDirectory))
|
||||||
// Retain private archived imports on disk, but never put old seated/arms-down
|
// Retain private archived imports on disk, but never put old seated/arms-down
|
||||||
// animation packs into the new graph APK.
|
// animation packs into the new graph APK.
|
||||||
sourceSets.main.assets.setSrcDirs([packagedAssets])
|
sourceSets.main.assets.setSrcDirs([packagedAssets])
|
||||||
|
|||||||
@@ -41,7 +41,10 @@ object StartupAvatarRepository {
|
|||||||
val json=JSONObject(String(raw,Charsets.UTF_8))
|
val json=JSONObject(String(raw,Charsets.UTF_8))
|
||||||
check(json.getString("sourceIndexSha256")==BuildConfig.EMOTION_MANIFEST_SHA)
|
check(json.getString("sourceIndexSha256")==BuildConfig.EMOTION_MANIFEST_SHA)
|
||||||
val b=json.getJSONObject("body")
|
val b=json.getJSONObject("body")
|
||||||
val path=b.getString("path");check(path==BuildConfig.EMOTION_ASSET_ROOT+"runtime/neutral/body/idle.mp4")
|
// BASIC_SHA pins this exact body reference; bundles may use different layouts.
|
||||||
|
val path=b.getString("path")
|
||||||
|
check(path.startsWith(BuildConfig.EMOTION_ASSET_ROOT) && path.matches(Regex("[A-Za-z0-9_./-]+")) &&
|
||||||
|
path.split('/').none { it in setOf("", ".", "..") })
|
||||||
val bytes=readBounded(app.assets.open(path),64_000_000);check(bytes.size<=64_000_000 && sha(bytes)==b.getString("sha256"))
|
val bytes=readBounded(app.assets.open(path),64_000_000);check(bytes.size<=64_000_000 && sha(bytes)==b.getString("sha256"))
|
||||||
val poster=readBounded(app.assets.open(ROOT+"poster.png"),100_000);check(poster.size<=100_000 && sha(poster)==json.getString("posterSha256"))
|
val poster=readBounded(app.assets.open(ROOT+"poster.png"),100_000);check(poster.size<=100_000 && sha(poster)==json.getString("posterSha256"))
|
||||||
val pts=b.getJSONArray("ptsUs");val timeline=List(pts.length()) { pts.getLong(it) }
|
val pts=b.getJSONArray("ptsUs");val timeline=List(pts.length()) { pts.getLong(it) }
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import android.view.Surface
|
|||||||
import android.view.TextureView
|
import android.view.TextureView
|
||||||
import android.widget.FrameLayout
|
import android.widget.FrameLayout
|
||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
import com.gorios.lanvoice.R
|
|
||||||
import com.gorios.lanvoice.diag.StartupTrace
|
import com.gorios.lanvoice.diag.StartupTrace
|
||||||
|
|
||||||
/** One stable host. Only real matching neutral sourceframe0 can hand off the base loop.
|
/** One stable host. Only real matching neutral sourceframe0 can hand off the base loop.
|
||||||
@@ -15,7 +14,7 @@ class StartupAvatarView(context: Context,private val binding: AvatarMediaBinding
|
|||||||
private val report: (VideoPresentation)->Unit,private val fullVisible: ()->Unit,private val failed: ()->Unit={}): FrameLayout(context) {
|
private val report: (VideoPresentation)->Unit,private val fullVisible: ()->Unit,private val failed: ()->Unit={}): FrameLayout(context) {
|
||||||
private val poster=ImageView(context).apply {
|
private val poster=ImageView(context).apply {
|
||||||
scaleType=ImageView.ScaleType.FIT_CENTER
|
scaleType=ImageView.ScaleType.FIT_CENTER
|
||||||
setImageResource(if(com.gorios.lanvoice.BuildConfig.AVATAR_USER_ASSET_CANDIDATE) R.drawable.startup_black_tulle_poster else R.drawable.startup_poster)
|
setImageResource(com.gorios.lanvoice.BuildConfig.STARTUP_POSTER_RES_ID)
|
||||||
}
|
}
|
||||||
private val surface=TextureView(context).apply { isOpaque=false;alpha=0f }
|
private val surface=TextureView(context).apply { isOpaque=false;alpha=0f }
|
||||||
private var basic: ContinuousAvatarPack?=null
|
private var basic: ContinuousAvatarPack?=null
|
||||||
|
|||||||
@@ -14,7 +14,9 @@ data class StartupAssetKey(val versionCode: Long,val installedAt: Long,val pin:
|
|||||||
init { require(versionCode>0 && installedAt>0 && pin.matches(Regex("[0-9a-f]{64}")) &&
|
init { require(versionCode>0 && installedAt>0 && pin.matches(Regex("[0-9a-f]{64}")) &&
|
||||||
(root=="avatar/a01-expression-action-v1/" ||
|
(root=="avatar/a01-expression-action-v1/" ||
|
||||||
root=="avatar/a01-black-tulle-roomy720-correct03/" &&
|
root=="avatar/a01-black-tulle-roomy720-correct03/" &&
|
||||||
pin=="208f703ed92bf795bfeb78a1cef89b67bed2e45da80038a56157fd1ecd4cfa93" && validator>=3) && validator>0) }
|
pin=="208f703ed92bf795bfeb78a1cef89b67bed2e45da80038a56157fd1ecd4cfa93" && validator>=3 ||
|
||||||
|
root=="avatar/char-expressions-r02/" &&
|
||||||
|
pin=="f8a69041da51e1a551c6991bfad6d7f034f0f320f726f58568afd43d81cb9604" && validator>=3) && validator>0) }
|
||||||
val fingerprint: String get() = digest("$versionCode/$installedAt/$pin/$root/$validator")
|
val fingerprint: String get() = digest("$versionCode/$installedAt/$pin/$root/$validator")
|
||||||
}
|
}
|
||||||
private fun digest(value: String): String = MessageDigest.getInstance("SHA-256").digest(value.toByteArray())
|
private fun digest(value: String): String = MessageDigest.getInstance("SHA-256").digest(value.toByteArray())
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
# char expressions-r02:生产接入检查与阻点
|
# char expressions-r02:生产接入检查与阻点
|
||||||
|
|
||||||
|
**当前交付见文末“更新交付与授权自纠(code36)”。前两节保留旧候选的历史核查;旧 inventory 缺项和 TALK 排队语义均已解除。**
|
||||||
|
|
||||||
2026-10-14。检查基线 `4c70ff665e99dd019b55d0dc1e9891eaabe84c51`,开始时本地/remote main 相同、工作树干净。用户授权评估并接入 Liam 独立包,但明确要求当前播放器若不支持 TALK 窗口调度,应报告而非擅自修改。本次完成只读机器验证;没有导入、修改 App 或 gateway、构建、安装、素材生成或模型调用。
|
2026-10-14。检查基线 `4c70ff665e99dd019b55d0dc1e9891eaabe84c51`,开始时本地/remote main 相同、工作树干净。用户授权评估并接入 Liam 独立包,但明确要求当前播放器若不支持 TALK 窗口调度,应报告而非擅自修改。本次完成只读机器验证;没有导入、修改 App 或 gateway、构建、安装、素材生成或模型调用。
|
||||||
|
|
||||||
## 输入及真实性
|
## 输入及真实性
|
||||||
@@ -144,3 +146,109 @@ L1–L4:uOpacity=1,mask=uOpacity*patch.a。
|
|||||||
资产侧请同步HANDOFF为新的“仅禁换嘴、TTS继续、透明patch保留原生帧”语义,去掉等待窗口/提前收口的旧要求;修正旧index SHA引用。若改HANDOFF,必须同时更新index.files里HANDOFF的hash/bytes。最终发布新的不可变index及外置SHA、tar SHA;不要在App侧修改原候选metadata、继续沿用旧b1b3 pin或翻runtimeReady。当前收件目录和tar保持原样。
|
资产侧请同步HANDOFF为新的“仅禁换嘴、TTS继续、透明patch保留原生帧”语义,去掉等待窗口/提前收口的旧要求;修正旧index SHA引用。若改HANDOFF,必须同时更新index.files里HANDOFF的hash/bytes。最终发布新的不可变index及外置SHA、tar SHA;不要在App侧修改原候选metadata、继续沿用旧b1b3 pin或翻runtimeReady。当前收件目录和tar保持原样。
|
||||||
|
|
||||||
本机新增忽略证据位于 `logs/expressions-r02/transparent-rule/`:`evidence.json`、`production-clock.txt`、`native-vs-talk-contact.png`、两帧native/TALK全图及`missing-runtime-inventory.json`;只读复现脚本 `.runtime/expressions-r02-transparent-proof.py`。未发送外部消息,由协调者转交缺失清单;本次Git变更仅本节文档。
|
本机新增忽略证据位于 `logs/expressions-r02/transparent-rule/`:`evidence.json`、`production-clock.txt`、`native-vs-talk-contact.png`、两帧native/TALK全图及`missing-runtime-inventory.json`;只读复现脚本 `.runtime/expressions-r02-transparent-proof.py`。未发送外部消息,由协调者转交缺失清单;本次Git变更仅本节文档。
|
||||||
|
|
||||||
|
## 更新交付与授权自纠(code36)
|
||||||
|
|
||||||
|
2026-10-14,源码基线 `0c386ac8ecbeb75d82167e902da02882ecca82cb`,开始时本地与 origin/main 一致、工作树干净。用户授权对重传包做完整 checker 后交付 Liam code36;发现一个可确定修正的 metadata 错误后,用户明确要求“能自纠先自纠,希望快点看到新的 APK”。因此在独立目录制作单字段修正候选,没有改写资产方收件目录、原 tar、runtime manifest、视频或 PNG,没有伪造 Pi 准入。
|
||||||
|
|
||||||
|
### 原件、修正及实际采用 pin
|
||||||
|
|
||||||
|
| 项目 | 精确值 |
|
||||||
|
|---|---|
|
||||||
|
| 资产方原件 | `/home/ubuntu/asset-inbox/expressions-r02/`,2595 个文件,无 symlink |
|
||||||
|
| 原 tar SHA256 | `719d0616bc20653deb58fd128115c506c1a9a43c3706a841612016ad07f03422` |
|
||||||
|
| 原 index SHA256 | `0758672dd2ca8686f32c5e1062bca0d4bbf19063b036a42db71c1050ecb08d08` |
|
||||||
|
| 自纠候选 | `.runtime/avatar-imports/char-expressions-r02-audioend-fixed/` |
|
||||||
|
| **实际 APK index SHA256** | **`f8a69041da51e1a551c6991bfad6d7f034f0f320f726f58568afd43d81cb9604`** |
|
||||||
|
| 唯一语义修改 | `actions[id=asset_02].audioEndUs: 8000000 → 7940998` |
|
||||||
|
| 保留项 | 全部 2593 个 inventory 文件字节、10 份 runtime manifest、全部 runtimeReady:false/publishApproval:false;素材生成和推理调用均为0 |
|
||||||
|
|
||||||
|
原件在生产 `package-avatar-emotion.py` 的 audioEndUs 精确校验处被拒绝,不能称原 `075867…` 完整 checker 通过。ffprobe 的 asset_02 音频为 AAC/44100Hz、start=0、duration_ts=350198,呈现结束 `7,940,998µs`,与原声明差 `59,002µs`,超出既有2µs容差。解码末尾为 `7,941,225µs`,包含与 MP4 呈现时间不同的 AAC 尾样本;使用的是呈现结束值,未用 decoded padding 冒充音轨时长。视频仍为 `8,041,667µs`、193帧,未裁剪/重编码/补音轨。
|
||||||
|
|
||||||
|
`scripts/correct-expression-audio-end.py` 仅接受原精确 pin,并再次实测上述端点,要求差值符合本次证据。独立复制目录后只修正该字段,重写外置 SHA;结构比较确认其他 index 字段相同,逐项 SHA/bytes 确认媒体与 runtime 不变。新 index 的排版规范化也参与其新 SHA。任何新的不匹配必须重新审计,不复用此次修正猜测。
|
||||||
|
|
||||||
|
HANDOFF 仍含旧 `175534…` 引用及等待 talkAllowed 的旧语义;没有为了通过库存检查改写它。APK 不包含 HANDOFF,采用用户明确的“透明嘴层保留原生帧,TTS继续”语义。请资产方后续交付同步文档,重新冻结 pin,不覆盖本 APK pin。
|
||||||
|
|
||||||
|
### 生产验证及 App 最小接入
|
||||||
|
|
||||||
|
| 检查 | 实际结果 |
|
||||||
|
|---|---|
|
||||||
|
| 原件整包库存 | 2593 条 files 的 SHA/bytes 全过,补齐10份 runtime manifest;实际2595文件恰为 inventory + index + 外置SHA |
|
||||||
|
| 自纠完整 checker | 生产严格 schema/路径/绑定/上限校验与现有明确 userAuthorizedDebug 分支通过;未放宽校验或翻 runtimeReady,未当成 release/Pi 批准 |
|
||||||
|
| 媒体及绑定 | 4 body:145/73/73/73帧;6独立桥各25帧;全部 full decode、actual N/PTS、N×5 ownbody/ownframe、五档RGBA及独立 state curve 通过 |
|
||||||
|
| 内存 | 2570 PNG;合计27,632,640 RGBA bytes,最大单runtime7,795,200,分别低于32MB/8MB限制 |
|
||||||
|
| edges/actions | 10 edges(4 native loop+6桥),两条实际 H264+AAC dance;720×1280@24,无 cover,193帧/8,041,667µs;asset_01 audioEnd=8,000,000µs,asset_02=7,940,998µs |
|
||||||
|
| GLES | 10 runtime ×40=400项离屏 GLES pixel golden 通过,使用生产 shader、6采样帧×5档及Fit/crop等;修正候选媒体逐字节相同,无需重做相同像素检查 |
|
||||||
|
| JVM/UI/包装 | 11 JVM/UI入口通过;全量79包装测试通过;保留既有 clock/native/相机/presence/音频/生命周期回归 |
|
||||||
|
| APK生产回放 | 实际APK字节经 production loader/View/renderer;happy/sad请求、30s idle及variant上newturn合法回退通过;两dance各从neutral/happy进入,共4×193=772帧 ACTION 独占,媒体释放后回neutral且completed |
|
||||||
|
| 后台启动与缓存 | 实际包 cold校验 main asset reads=0、patch reads=2570;可信receipt重载patch reads=0,同进程无重复读取。旧Liam code35仍3425/0,5body/8桥回放通过;均为host线程/回调证据,不是手机启动耗时 |
|
||||||
|
| 隔离握手 | 9组实际Android AUTH→HELLO,11次 canonical ASGI WS握手通过;Liam显式persona/en/server voice锁定/fresh CID,禁用action及陌生pin的ready/pending均不可获得dance,断连busy清理通过;0 ASR/LLM/TTS |
|
||||||
|
| 构建 | assembleDebug及compileDebugAndroidTestKotlin通过;instrumentation未运行,没有真机安装或GPU/相机/音色听测 |
|
||||||
|
|
||||||
|
`char-expressions-r02` 是独立媒体选择,只允许 Liam 显式选择;main、Lvbu及默认 Liam 仍选原黑裙 correct03。内部媒体 identity/packId 仍 `a01`/`a01-expression-action-v1`,不是 Liam 人格身份。新 root 为 `avatar/char-expressions-r02/`,原包 root及pin保留。新选包3190 assets =2593运行引用(含index)+594显式历史回退+1公共face模型+2bootstrap;不会全目录打包,HANDOFF/审核物不进包。
|
||||||
|
|
||||||
|
bootstrap/poster由本包neutral实际frame0 CPU缩小到180×320,没有生成新形象。bootstrap SHA `ea615313caa5d9d79f7e28458d8f15f52a666a21fbd007c5f581cbe59dbab4a5`;poster SHA `c9dea401f80273a6ddf6d8b33673ee2c5968a5d4e2123080aee37a18c164f0a6`,50,170 bytes。poster作为该bundle专属res目录参与构建,旧两个poster保持字节不变。
|
||||||
|
|
||||||
|
实际启动回放发现 `StartupAvatarRepository` 原先把neutral body路径写死为 `runtime/neutral/body/idle.mp4`。现使用精确bootstrap SHA中绑定的路径,并仍严格要求selected root、安全相对路径、body SHA、shape及actualPTS。未跳过验证;新旧布局均回放通过。`StartupLoadCache`只新增新root/new exact pin组合,错误root/pin/validator负例仍拒绝。设置开合不重建renderer,后台先断WS再关相机的Liam/Lvbu修正保持。
|
||||||
|
|
||||||
|
本次未修改播放器/TALK嘴时钟、gateway源/配置/registry、persona/lorebook、时间、provider、TTS参数、presence或相机实现。transparent禁换嘴段仍按前节GLES证据保留原生笑容,出段恢复当前TALK档位;实际设备视觉是否自然仍须用户测试。
|
||||||
|
|
||||||
|
### APK及测试入口
|
||||||
|
|
||||||
|
- 文件:`lan-voice-v0714-liam-test-code36-arm64-debug.apk`,58,043,885 bytes。
|
||||||
|
- 下载:`http://192.168.31.124:8080/lan-voice-v0714-liam-test-code36-arm64-debug.apk`,校验文件为同 URL 加 `.sha256`。
|
||||||
|
- SHA256:`202a9d8b546c93e3dacbb5a4f432e53e71bce5af0f9dd13b6363921f830f874b`。
|
||||||
|
- applicationId:`com.gorios.lanvoice.liamtest`;versionName `0.7.14-liam-test`;versionCode36;min26/target34/arm64。
|
||||||
|
- 同debug证书SHA256:`b9608336bc1ed1de3269bb4594f9fe718daaa5439511c5187aa385d2b799dcf1`。
|
||||||
|
|
||||||
|
未安装设备。协调者可核SHA后USB升级现Liam包;主包/Lvbu可并存但gateway单连接,应依次通话。正常launcher进入可能在既有授权下自动启麦克风/相机;只看媒体请使用既有离线入口:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
adb shell am start -n com.gorios.lanvoice.liamtest/com.gorios.lanvoice.MainActivity --ez avatar_offline_preview true
|
||||||
|
```
|
||||||
|
|
||||||
|
离线设置内选择happy/sad、Idle/Talk、舞蹈01/02及停止;不联网、不启mic/cam。正常对话仍走Liam英语persona及服务端已登记音色,客户端不指定voice或CID;音色/真人标签/实际手机渲染未测。code36两dance仅离线可测试,联网能力编译为false。
|
||||||
|
|
||||||
|
35个既有APK及sidecar全部重新核hash;主code33、Lvbu34、Liam35/camera-probe未覆盖。回退须按Android版本限制处理Liam36→35(可能需要明确的debug降级安装),不自动卸载/清数据;主包/Lvbu原包继续保留。
|
||||||
|
|
||||||
|
### 待 gateway owner 审核登记清单(未执行)
|
||||||
|
|
||||||
|
必须采用**自纠后pin**,不是资产方原 `075867…`。当前格式所需的提案为:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"f8a69041da51e1a551c6991bfad6d7f034f0f320f726f58568afd43d81cb9604": {
|
||||||
|
"asset_01": 8042,
|
||||||
|
"asset_02": 8042
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
duration是视频 `8,041,667µs` 向上取整的8042ms,不以较短audioEnd替代。两条kind=dance、mouthAllowed:false/disallowTALK:true,fallback `neutral` frame144/PTS6,000,000进入,frame0/PTS0返回,entry/return anchor A。
|
||||||
|
|
||||||
|
| ID | clip SHA256 | 实际audioEndUs |
|
||||||
|
|---|---|---|
|
||||||
|
| asset_01 | `c13a4c037d89a9a8a43f4fcf22d0acb001e58f3557dcfe1e80a7cd7e9f8a4fb0` | 8000000 |
|
||||||
|
| asset_02 | `b0d752bc12a94be4d89a39fbeb2343dece90adfad220dc1e0a9e647eaf4aca98` | 7940998 |
|
||||||
|
|
||||||
|
此清单是待审核输入,不是registry准入或自然/音乐/权利批准。音乐人类听审、视频进出接缝动态审核、商用权利及真机未完成。code36不会宣称联网dance;将来即使只登记服务器,该包仍保留false门禁,需另行明确启用构建,不能把本轮离线通过等同网络动作可用。Liam persona/en/服务端锁音色均复用已有登记,不需要本次重注册。
|
||||||
|
|
||||||
|
### 忽略资产的恢复与证据
|
||||||
|
|
||||||
|
人物媒体、poster和APK不入Git;仅source/tests/catalog/bootstrap metadata/文档/导入脚本入Git。后续shell需要先取得原tar并核上述SHA,安全解包为原目录,再执行(输出必须是新路径):
|
||||||
|
|
||||||
|
```sh
|
||||||
|
python3 scripts/correct-expression-audio-end.py \
|
||||||
|
--source /home/ubuntu/asset-inbox/expressions-r02 \
|
||||||
|
--output .runtime/avatar-imports/char-expressions-r02-audioend-fixed
|
||||||
|
python3 scripts/import-character-media.py --media-bundle char-expressions-r02 \
|
||||||
|
--manifest .runtime/avatar-imports/char-expressions-r02-audioend-fixed/manifest.json \
|
||||||
|
--output logs/expressions-r02-restored/import --import-only
|
||||||
|
python3 scripts/package-character-test.py --profile liam-test \
|
||||||
|
--media-bundle char-expressions-r02 --version-code 36 \
|
||||||
|
--build --output logs/expressions-r02-restored/build.json
|
||||||
|
```
|
||||||
|
|
||||||
|
不要再次publish已冻结code36。恢复脚本复算精确derived pin、完整机器门禁、bootstrap及poster SHA;未知现有目标字节会拒绝覆盖。默认未指定media bundle的旧profile打包行为保持原黑裙。
|
||||||
|
|
||||||
|
本机忽略证据:`logs/expressions-r02-075867/independent-stages/evidence.json`记录原件阻点,`logs/expressions-r02-075867/gles/`含400项像素检查,`logs/expressions-r02-075867-derivative.json`记录来源和单字段差异;`logs/expressions-r02-corrected/import/`、`*-packaging-final.txt`、`*-runtime-final.txt`、`*-startup-final.txt`、`*-handshake.txt`及`delivery.json`记录实际导入、测试与发布。本节没有把运行日志或源报告提交Git。
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
"permissionConnectionRetention": false,
|
"permissionConnectionRetention": false,
|
||||||
"mediaSelection": "black-correct03",
|
"mediaSelection": "black-correct03",
|
||||||
"versionSuffix": "-lvbu-test",
|
"versionSuffix": "-lvbu-test",
|
||||||
|
"versionBase": "0.7.14",
|
||||||
"minimumVersionCode": 34,
|
"minimumVersionCode": 34,
|
||||||
"settingsNote": "吕布人设与服务端绑定音色测试;外观仍为黑裙角色,媒体身份为 a01。"
|
"settingsNote": "吕布人设与服务端绑定音色测试;外观仍为黑裙角色,媒体身份为 a01。"
|
||||||
},
|
},
|
||||||
@@ -30,7 +31,11 @@
|
|||||||
"permissionConnectionRetention": false,
|
"permissionConnectionRetention": false,
|
||||||
"mediaSelection": "black-correct03",
|
"mediaSelection": "black-correct03",
|
||||||
"versionSuffix": "-liam-test",
|
"versionSuffix": "-liam-test",
|
||||||
|
"versionBase": "0.7.14",
|
||||||
"minimumVersionCode": 35,
|
"minimumVersionCode": 35,
|
||||||
|
"additionalMediaSelections": [
|
||||||
|
"char-expressions-r02"
|
||||||
|
],
|
||||||
"settingsNote": "Liam 英语人设与服务端绑定音色测试;外观仍为黑裙角色,媒体身份为 a01。"
|
"settingsNote": "Liam 英语人设与服务端绑定音色测试;外观仍为黑裙角色,媒体身份为 a01。"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -45,6 +50,8 @@
|
|||||||
"posterResource": "startup_poster"
|
"posterResource": "startup_poster"
|
||||||
},
|
},
|
||||||
"black-correct03": {
|
"black-correct03": {
|
||||||
|
"userAuthorizedDebug": true,
|
||||||
|
"networkActionsAllowed": true,
|
||||||
"identityId": "a01",
|
"identityId": "a01",
|
||||||
"packId": "a01-expression-action-v1",
|
"packId": "a01-expression-action-v1",
|
||||||
"assetRoot": "avatar/a01-black-tulle-roomy720-correct03/",
|
"assetRoot": "avatar/a01-black-tulle-roomy720-correct03/",
|
||||||
@@ -52,6 +59,21 @@
|
|||||||
"bootstrapRoot": "avatar/startup-black-tulle-correct03/",
|
"bootstrapRoot": "avatar/startup-black-tulle-correct03/",
|
||||||
"bootstrapSha256": "29669529887db78e0d64d2e7afd89cb8866aefc84e2523195d4bb936ec2ae382",
|
"bootstrapSha256": "29669529887db78e0d64d2e7afd89cb8866aefc84e2523195d4bb936ec2ae382",
|
||||||
"posterResource": "startup_black_tulle_poster"
|
"posterResource": "startup_black_tulle_poster"
|
||||||
|
},
|
||||||
|
"char-expressions-r02": {
|
||||||
|
"identityId": "a01",
|
||||||
|
"packId": "a01-expression-action-v1",
|
||||||
|
"assetRoot": "avatar/char-expressions-r02/",
|
||||||
|
"indexSha256": "f8a69041da51e1a551c6991bfad6d7f034f0f320f726f58568afd43d81cb9604",
|
||||||
|
"userAuthorizedDebug": true,
|
||||||
|
"networkActionsAllowed": false,
|
||||||
|
"minimumVersionCode": 36,
|
||||||
|
"bootstrapRoot": "avatar/startup-char-expressions-r02/",
|
||||||
|
"bootstrapSha256": "ea615313caa5d9d79f7e28458d8f15f52a666a21fbd007c5f581cbe59dbab4a5",
|
||||||
|
"bootstrapMetadata": "manifests/startup-char-expressions-r02.json",
|
||||||
|
"resourceDirectory": "app/src/characterAssets/char-expressions-r02/res",
|
||||||
|
"posterResource": "startup_char_expressions_r02_poster",
|
||||||
|
"settingsNote": "Liam 英语人设与服务端绑定音色测试;char 多表情素材候选,联网舞蹈尚未登记。"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"commonAssets": {
|
"commonAssets": {
|
||||||
|
|||||||
@@ -0,0 +1,166 @@
|
|||||||
|
{
|
||||||
|
"schemaVersion": 1,
|
||||||
|
"sourceIndexSha256": "f8a69041da51e1a551c6991bfad6d7f034f0f320f726f58568afd43d81cb9604",
|
||||||
|
"posterSha256": "c9dea401f80273a6ddf6d8b33673ee2c5968a5d4e2123080aee37a18c164f0a6",
|
||||||
|
"posterWidth": 180,
|
||||||
|
"posterHeight": 320,
|
||||||
|
"provenance": "Exact decoded neutral source frame0; CPU downsample, no generated media; user-authorized debug integration, not Pi certification",
|
||||||
|
"body": {
|
||||||
|
"path": "avatar/char-expressions-r02/conversation/neutral/body/neutral-idle.mp4",
|
||||||
|
"sha256": "731b2444d00d307816b7edc9a11437f2780255b279506547a4caad13ef3fc23c",
|
||||||
|
"width": 720,
|
||||||
|
"height": 1280,
|
||||||
|
"frameCount": 145,
|
||||||
|
"ptsUs": [
|
||||||
|
0,
|
||||||
|
41667,
|
||||||
|
83333,
|
||||||
|
125000,
|
||||||
|
166667,
|
||||||
|
208333,
|
||||||
|
250000,
|
||||||
|
291667,
|
||||||
|
333333,
|
||||||
|
375000,
|
||||||
|
416667,
|
||||||
|
458333,
|
||||||
|
500000,
|
||||||
|
541667,
|
||||||
|
583333,
|
||||||
|
625000,
|
||||||
|
666667,
|
||||||
|
708333,
|
||||||
|
750000,
|
||||||
|
791667,
|
||||||
|
833333,
|
||||||
|
875000,
|
||||||
|
916667,
|
||||||
|
958333,
|
||||||
|
1000000,
|
||||||
|
1041667,
|
||||||
|
1083333,
|
||||||
|
1125000,
|
||||||
|
1166667,
|
||||||
|
1208333,
|
||||||
|
1250000,
|
||||||
|
1291667,
|
||||||
|
1333333,
|
||||||
|
1375000,
|
||||||
|
1416667,
|
||||||
|
1458333,
|
||||||
|
1500000,
|
||||||
|
1541667,
|
||||||
|
1583333,
|
||||||
|
1625000,
|
||||||
|
1666667,
|
||||||
|
1708333,
|
||||||
|
1750000,
|
||||||
|
1791667,
|
||||||
|
1833333,
|
||||||
|
1875000,
|
||||||
|
1916667,
|
||||||
|
1958333,
|
||||||
|
2000000,
|
||||||
|
2041667,
|
||||||
|
2083333,
|
||||||
|
2125000,
|
||||||
|
2166667,
|
||||||
|
2208333,
|
||||||
|
2250000,
|
||||||
|
2291667,
|
||||||
|
2333333,
|
||||||
|
2375000,
|
||||||
|
2416667,
|
||||||
|
2458333,
|
||||||
|
2500000,
|
||||||
|
2541667,
|
||||||
|
2583333,
|
||||||
|
2625000,
|
||||||
|
2666667,
|
||||||
|
2708333,
|
||||||
|
2750000,
|
||||||
|
2791667,
|
||||||
|
2833333,
|
||||||
|
2875000,
|
||||||
|
2916667,
|
||||||
|
2958333,
|
||||||
|
3000000,
|
||||||
|
3041667,
|
||||||
|
3083333,
|
||||||
|
3125000,
|
||||||
|
3166667,
|
||||||
|
3208333,
|
||||||
|
3250000,
|
||||||
|
3291667,
|
||||||
|
3333333,
|
||||||
|
3375000,
|
||||||
|
3416667,
|
||||||
|
3458333,
|
||||||
|
3500000,
|
||||||
|
3541667,
|
||||||
|
3583333,
|
||||||
|
3625000,
|
||||||
|
3666667,
|
||||||
|
3708333,
|
||||||
|
3750000,
|
||||||
|
3791667,
|
||||||
|
3833333,
|
||||||
|
3875000,
|
||||||
|
3916667,
|
||||||
|
3958333,
|
||||||
|
4000000,
|
||||||
|
4041667,
|
||||||
|
4083333,
|
||||||
|
4125000,
|
||||||
|
4166667,
|
||||||
|
4208333,
|
||||||
|
4250000,
|
||||||
|
4291667,
|
||||||
|
4333333,
|
||||||
|
4375000,
|
||||||
|
4416667,
|
||||||
|
4458333,
|
||||||
|
4500000,
|
||||||
|
4541667,
|
||||||
|
4583333,
|
||||||
|
4625000,
|
||||||
|
4666667,
|
||||||
|
4708333,
|
||||||
|
4750000,
|
||||||
|
4791667,
|
||||||
|
4833333,
|
||||||
|
4875000,
|
||||||
|
4916667,
|
||||||
|
4958333,
|
||||||
|
5000000,
|
||||||
|
5041667,
|
||||||
|
5083333,
|
||||||
|
5125000,
|
||||||
|
5166667,
|
||||||
|
5208333,
|
||||||
|
5250000,
|
||||||
|
5291667,
|
||||||
|
5333333,
|
||||||
|
5375000,
|
||||||
|
5416667,
|
||||||
|
5458333,
|
||||||
|
5500000,
|
||||||
|
5541667,
|
||||||
|
5583333,
|
||||||
|
5625000,
|
||||||
|
5666667,
|
||||||
|
5708333,
|
||||||
|
5750000,
|
||||||
|
5791667,
|
||||||
|
5833333,
|
||||||
|
5875000,
|
||||||
|
5916667,
|
||||||
|
5958333,
|
||||||
|
6000000
|
||||||
|
],
|
||||||
|
"durationUs": 6041667,
|
||||||
|
"fpsNumerator": 24,
|
||||||
|
"fpsDenominator": 1,
|
||||||
|
"hasAudio": false
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -10,6 +10,7 @@ parser.add_argument('--apk',type=Path,required=True)
|
|||||||
parser.add_argument('--sha256',required=True)
|
parser.add_argument('--sha256',required=True)
|
||||||
parser.add_argument('--startup-loader',action='store_true',help='Production background repository over actual APK bytes, isolated private receipt, no rendering/connection')
|
parser.add_argument('--startup-loader',action='store_true',help='Production background repository over actual APK bytes, isolated private receipt, no rendering/connection')
|
||||||
parser.add_argument('--user-asset-candidate',action='store_true',help='Exact user-authorized correct03 APK; this offline replay uses local media callback doubles and does not assert network admission')
|
parser.add_argument('--user-asset-candidate',action='store_true',help='Exact user-authorized correct03 APK; this offline replay uses local media callback doubles and does not assert network admission')
|
||||||
|
parser.add_argument('--media-bundle',default='black-correct03',help='Trusted user-debug bundle, when --user-asset-candidate is set')
|
||||||
args=parser.parse_args()
|
args=parser.parse_args()
|
||||||
assert hashlib.sha256(args.apk.read_bytes()).hexdigest()==args.sha256, 'APK hash drift'
|
assert hashlib.sha256(args.apk.read_bytes()).hexdigest()==args.sha256, 'APK hash drift'
|
||||||
ROOT=Path(__file__).resolve().parents[1];script=ROOT/'scripts/check-reply-regressions.py'
|
ROOT=Path(__file__).resolve().parents[1];script=ROOT/'scripts/check-reply-regressions.py'
|
||||||
@@ -90,20 +91,25 @@ graphics=(ROOT/'tests/avatar/Graphics.kt').read_text();graphics=graphics.replace
|
|||||||
}
|
}
|
||||||
''')
|
''')
|
||||||
build='''package com.gorios.lanvoice
|
build='''package com.gorios.lanvoice
|
||||||
object BuildConfig { const val AVATAR_STARTUP_FIX=false;const val DEBUG=true;const val AVATAR_NATURAL=true;const val AVATAR_ENGINEERING=true;const val AVATAR_MOUTH_CANDIDATE=true
|
object BuildConfig { const val STARTUP_POSTER_RES_ID=1;const val AVATAR_STARTUP_FIX=false;const val DEBUG=true;const val AVATAR_NATURAL=true;const val AVATAR_ENGINEERING=true;const val AVATAR_MOUTH_CANDIDATE=true
|
||||||
const val EMOTION_MANIFEST_SHA="987e125a7d7a2cde99121b5f5246c82f4dbe36c4899d3d49eaffd1a68bafb887"
|
const val EMOTION_MANIFEST_SHA="987e125a7d7a2cde99121b5f5246c82f4dbe36c4899d3d49eaffd1a68bafb887"
|
||||||
const val NATURAL_MANIFEST_SHA="0a3c4918ba746019cf1df885bec66e5858a8950997dac4f64e7d37094be64dad"
|
const val NATURAL_MANIFEST_SHA="0a3c4918ba746019cf1df885bec66e5858a8950997dac4f64e7d37094be64dad"
|
||||||
}'''
|
}'''
|
||||||
if args.user_asset_candidate:
|
if args.user_asset_candidate:
|
||||||
import importlib.util
|
import importlib.util
|
||||||
spec=importlib.util.spec_from_file_location('user_startup',ROOT/'scripts/prepare-user-avatar-startup.py');asset_config=importlib.util.module_from_spec(spec);spec.loader.exec_module(asset_config)
|
spec=importlib.util.spec_from_file_location('user_startup',ROOT/'scripts/prepare-user-avatar-startup.py');asset_config=importlib.util.module_from_spec(spec);spec.loader.exec_module(asset_config)
|
||||||
|
media=json.loads((ROOT/'manifests/character-build-profiles.json').read_bytes())['mediaBundles'][args.media_bundle]
|
||||||
|
assert media.get('userAuthorizedDebug') is True
|
||||||
|
asset_root=media['assetRoot'];basic_root=media['bootstrapRoot'];pin=media['indexSha256']
|
||||||
with zipfile.ZipFile(args.apk) as archive:
|
with zipfile.ZipFile(args.apk) as archive:
|
||||||
raw=archive.read('assets/'+asset_config.ASSET_ROOT+'manifest.json');assert hashlib.sha256(raw).hexdigest()==asset_config.PIN
|
raw=archive.read('assets/'+asset_root+'manifest.json');assert hashlib.sha256(raw).hexdigest()==pin
|
||||||
index=json.loads(raw);refs=[p['runtimeManifest'] for p in index['conversationPackages']]+[e['mouthRuntimeManifest'] for e in index['edges'] if 'mouthRuntimeManifest' in e]
|
index=json.loads(raw);refs=[p['runtimeManifest'] for p in index['conversationPackages']]+[e['mouthRuntimeManifest'] for e in index['edges'] if 'mouthRuntimeManifest' in e]
|
||||||
patch_count=sum(len(json.loads(archive.read('assets/'+asset_config.ASSET_ROOT+r['path']))['patches'])*5 for r in refs)
|
patch_count=sum(len(json.loads(archive.read('assets/'+asset_root+r['path']))['patches'])*5 for r in refs)
|
||||||
build=build.replace('const val EMOTION_MANIFEST_SHA="987e125a7d7a2cde99121b5f5246c82f4dbe36c4899d3d49eaffd1a68bafb887"','const val EMOTION_MANIFEST_SHA="'+asset_config.PIN+'"')
|
fallback_row=next(p for p in index['conversationPackages'] if p['id']==index['fallbackPackageId'])
|
||||||
|
fallback_frames=json.loads(archive.read('assets/'+asset_root+fallback_row['runtimeManifest']['path']))['body']['frameCount']
|
||||||
|
build=build.replace('const val EMOTION_MANIFEST_SHA="987e125a7d7a2cde99121b5f5246c82f4dbe36c4899d3d49eaffd1a68bafb887"','const val EMOTION_MANIFEST_SHA="'+pin+'"')
|
||||||
build=build.replace('const val AVATAR_STARTUP_FIX=false','const val AVATAR_STARTUP_FIX=true')
|
build=build.replace('const val AVATAR_STARTUP_FIX=false','const val AVATAR_STARTUP_FIX=true')
|
||||||
build=build.replace('object BuildConfig {','object BuildConfig { const val AVATAR_USER_ASSET_CANDIDATE=true;const val EMOTION_ASSET_ROOT="'+asset_config.ASSET_ROOT+'";const val STARTUP_ASSET_ROOT="'+asset_config.BASIC_ROOT+'";const val STARTUP_MANIFEST_SHA="'+hashlib.sha256((ROOT/'manifests/startup-black-tulle-correct03.json').read_bytes()).hexdigest()+'";')
|
build=build.replace('object BuildConfig {','object BuildConfig { const val AVATAR_USER_ASSET_CANDIDATE=true;const val EMOTION_ASSET_ROOT="'+asset_root+'";const val STARTUP_ASSET_ROOT="'+basic_root+'";const val STARTUP_MANIFEST_SHA="'+media['bootstrapSha256']+'";')
|
||||||
else:
|
else:
|
||||||
patch_count=3185
|
patch_count=3185
|
||||||
build=build.replace('object BuildConfig {','object BuildConfig { const val AVATAR_USER_ASSET_CANDIDATE=false;const val EMOTION_ASSET_ROOT="avatar/a01-expression-action-v1/";const val STARTUP_ASSET_ROOT="avatar/startup-white-01/";const val STARTUP_MANIFEST_SHA="461f5cfc10036de5f10ca3ce765fb8d9998697d3fd035aa9b1862d2ccfc3eaa2";')
|
build=build.replace('object BuildConfig {','object BuildConfig { const val AVATAR_USER_ASSET_CANDIDATE=false;const val EMOTION_ASSET_ROOT="avatar/a01-expression-action-v1/";const val STARTUP_ASSET_ROOT="avatar/startup-white-01/";const val STARTUP_MANIFEST_SHA="461f5cfc10036de5f10ca3ce765fb8d9998697d3fd035aa9b1862d2ccfc3eaa2";')
|
||||||
@@ -173,17 +179,17 @@ fun main(args: Array<String>) {
|
|||||||
println("EMOTION|requested=sad1|current=${binding.currentPackageId}|visual=${binding.visualStatus}")
|
println("EMOTION|requested=sad1|current=${binding.currentPackageId}|visual=${binding.visualStatus}")
|
||||||
printTrace("happy_sad",trace);check(trace.none { it.second.actual=="media_failed" });check(binding.currentPackageId=="sad-01");view.dispose();TestScheduler.advanceBy(100)
|
printTrace("happy_sad",trace);check(trace.none { it.second.actual=="media_failed" });check(binding.currentPackageId=="sad-01");view.dispose();TestScheduler.advanceBy(100)
|
||||||
}
|
}
|
||||||
for(initial in listOf(RoleEmotion.NEUTRAL,RoleEmotion.HAPPY)) {
|
for(initial in listOf(RoleEmotion.NEUTRAL,RoleEmotion.HAPPY)) for(assetChoice in 0..1) {
|
||||||
val(view,binding,trace)=rig();binding.intent(mediaReply(initial),false);TestScheduler.advanceBy(6000)
|
val(view,binding,trace)=rig();binding.intent(mediaReply(initial),false);TestScheduler.advanceBy(6000)
|
||||||
var stop: ((Boolean)->Unit)?=null;val statuses=mutableListOf<ActionStatus>()
|
var stop: ((Boolean)->Unit)?=null;val statuses=mutableListOf<ActionStatus>()
|
||||||
val controller=ActionController(index.actionPack,binding,{TestScheduler.now},{stop=it},statuses::add,choose={0})
|
val controller=ActionController(index.actionPack,binding,{TestScheduler.now},{stop=it},statuses::add,choose={assetChoice})
|
||||||
check(controller.offer(ActionPlan("public_fixture_action_id_001",7,index.actionPack!!.manifestSha,120000)))
|
check(controller.offer(ActionPlan("public_fixture_action_id_001",7,index.actionPack!!.manifestSha,120000)))
|
||||||
println("DANCE|initial=${initial.wire}|offered=true|before_stop_players=${MediaPlayer.created.size}")
|
println("DANCE|initial=${initial.wire}|offered=true|before_stop_players=${MediaPlayer.created.size}")
|
||||||
stop!!(true);MediaPlayer.created.single().let { it.prepared!!(it) };TestScheduler.until(15000) { MediaPlayer.created.any { it.started } || trace.any { it.second.actual=="media_failed" } }
|
stop!!(true);MediaPlayer.created.single().let { it.prepared!!(it) };TestScheduler.until(15000) { MediaPlayer.created.any { it.started } || trace.any { it.second.actual=="media_failed" } }
|
||||||
val movie=MediaPlayer.created.single();println("DANCE|started=${movie.started}|current=${binding.currentPackageId}|status=${statuses.last().status}")
|
val movie=MediaPlayer.created.single();println("DANCE|started=${movie.started}|current=${binding.currentPackageId}|status=${statuses.last().status}")
|
||||||
val field=view.javaClass.getDeclaredField("textures").apply { isAccessible=true };val textures=field.get(view) as List<TextureView>
|
val field=view.javaClass.getDeclaredField("textures").apply { isAccessible=true };val textures=field.get(view) as List<TextureView>
|
||||||
val listener=textures[3].surfaceTextureListener!!;val surface=textures[3].surfaceTexture!!
|
val listener=textures[3].surfaceTextureListener!!;val surface=textures[3].surfaceTexture!!
|
||||||
index.actionPack.assets.first().media!!.ptsUs.forEachIndexed { i,pts ->
|
index.actionPack.assets[assetChoice].media!!.ptsUs.forEachIndexed { i,pts ->
|
||||||
if(i>0) TestScheduler.advanceBy(42);surface.timestamp=pts*1000;listener.onSurfaceTextureUpdated(surface)
|
if(i>0) TestScheduler.advanceBy(42);surface.timestamp=pts*1000;listener.onSurfaceTextureUpdated(surface)
|
||||||
if(i==0) {
|
if(i==0) {
|
||||||
println("DANCE_LAYER|initial=${initial.wire}|first_frame_alpha=${textures[3].alpha}|body_alpha=${textures.take(3).map { it.alpha }}")
|
println("DANCE_LAYER|initial=${initial.wire}|first_frame_alpha=${textures[3].alpha}|body_alpha=${textures.take(3).map { it.alpha }}")
|
||||||
@@ -193,7 +199,7 @@ fun main(args: Array<String>) {
|
|||||||
}
|
}
|
||||||
check(textures[3].alpha==1f && textures.take(3).all { it.alpha==0f })
|
check(textures[3].alpha==1f && textures.take(3).all { it.alpha==0f })
|
||||||
}
|
}
|
||||||
println("DANCE_OWNER|initial=${initial.wire}|frames=${index.actionPack.assets.first().media!!.ptsUs.size}|music_visible=${index.actionPack.assets.first().media!!.ptsUs.size}|conversation_visible=0|state=${binding.diagnosticState}")
|
println("DANCE_OWNER|initial=${initial.wire}|asset=${index.actionPack.assets[assetChoice].id}|frames=${index.actionPack.assets[assetChoice].media!!.ptsUs.size}|music_visible=${index.actionPack.assets[assetChoice].media!!.ptsUs.size}|conversation_visible=0|state=${binding.diagnosticState}")
|
||||||
TestScheduler.advanceBy(50);movie.completion!!(movie);TestScheduler.until(15000) { statuses.last().status!="started" }
|
TestScheduler.advanceBy(50);movie.completion!!(movie);TestScheduler.until(15000) { statuses.last().status!="started" }
|
||||||
println("DANCE|ended=${statuses.last().status}|released=${movie.released}|return=${binding.currentPackageId}")
|
println("DANCE|ended=${statuses.last().status}|released=${movie.released}|return=${binding.currentPackageId}")
|
||||||
printTrace("dance_${initial.wire}",trace);check(statuses.last().status=="completed");check(binding.currentPackageId=="neutral-01");view.dispose();TestScheduler.advanceBy(100)
|
printTrace("dance_${initial.wire}",trace);check(statuses.last().status=="completed");check(binding.currentPackageId=="neutral-01");view.dispose();TestScheduler.advanceBy(100)
|
||||||
@@ -223,6 +229,26 @@ fun main(args: Array<String>) {
|
|||||||
println("STARTUP_REPOSITORY|mode=${args[2]}|main_asset_reads=0|patch_reads=$patchReads|same_process_reloads=0|packages=5|bridge_mouths=8|sensors=0|device=false")
|
println("STARTUP_REPOSITORY|mode=${args[2]}|main_asset_reads=0|patch_reads=$patchReads|same_process_reloads=0|packages=5|bridge_mouths=8|sensors=0|device=false")
|
||||||
}
|
}
|
||||||
'''
|
'''
|
||||||
|
if args.user_asset_candidate:
|
||||||
|
fallback=index['fallbackPackageId']
|
||||||
|
variants=[p['id'] for p in index['conversationPackages'] if p['emotion']=='neutral' and p['id']!=fallback]
|
||||||
|
assert variants, 'idle-variant replay requires an actual neutral variant'
|
||||||
|
variant_set='setOf('+','.join(json.dumps(x) for x in variants)+')'
|
||||||
|
main=main.replace('it.second.actual.startsWith("body_idle-")','it.second.actual in '+
|
||||||
|
'setOf('+','.join(json.dumps('body_'+x) for x in variants)+')')
|
||||||
|
main=main.replace('binding.currentPackageId?.startsWith("idle-")==true','binding.currentPackageId in '+variant_set)
|
||||||
|
main=main.replace('listOf("idle-breathe-01","idle-microshift-01")',
|
||||||
|
'listOf('+','.join(json.dumps(x) for x in variants)+')')
|
||||||
|
main=main.replace('neutral-01',fallback)
|
||||||
|
for emotion in ('happy','sad'):
|
||||||
|
actual=next(p['id'] for p in index['conversationPackages'] if p['emotion']==emotion)
|
||||||
|
main=main.replace(emotion+'-01',actual)
|
||||||
|
# A two-bridge reversal can wait a full fallback loop (145 frames in this pack).
|
||||||
|
main=main.replace('TestScheduler.advanceBy(7000)','TestScheduler.advanceBy(15000)')
|
||||||
|
startup_main=startup_main.replace('body.frameCount==97','body.frameCount=='+str(fallback_frames))
|
||||||
|
startup_main=startup_main.replace('packages.size==5','packages.size=='+str(len(index['conversationPackages'])))
|
||||||
|
startup_main=startup_main.replace('packages=5|bridge_mouths=8','packages='+str(len(index['conversationPackages']))+
|
||||||
|
'|bridge_mouths='+str(sum('mouthRuntimeManifest' in e for e in index['edges'])))
|
||||||
with tempfile.TemporaryDirectory(prefix='baji-runtime-audit-') as td:
|
with tempfile.TemporaryDirectory(prefix='baji-runtime-audit-') as td:
|
||||||
tmp=Path(td);files=[]
|
tmp=Path(td);files=[]
|
||||||
for path in (ROOT/'tests/avatar').glob('*.kt'):
|
for path in (ROOT/'tests/avatar').glob('*.kt'):
|
||||||
|
|||||||
@@ -19,7 +19,11 @@ ROOT=Path(__file__).resolve().parents[1]
|
|||||||
parser=argparse.ArgumentParser(description=__doc__)
|
parser=argparse.ArgumentParser(description=__doc__)
|
||||||
parser.add_argument('--gateway-source',type=Path,default=ROOT/'gateway',
|
parser.add_argument('--gateway-source',type=Path,default=ROOT/'gateway',
|
||||||
help='Existing canonical source or read-only snapshot; never changes/deploys the 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')
|
||||||
args=parser.parse_args()
|
args=parser.parse_args()
|
||||||
|
if args.unreviewed_index_sha:
|
||||||
|
import re
|
||||||
|
assert re.fullmatch('[0-9a-f]{64}',args.unreviewed_index_sha)
|
||||||
gateway_root=args.gateway_source.resolve(strict=True)
|
gateway_root=args.gateway_source.resolve(strict=True)
|
||||||
snapshot=gateway_root/'SNAPSHOT.json'
|
snapshot=gateway_root/'SNAPSHOT.json'
|
||||||
if snapshot.exists():
|
if snapshot.exists():
|
||||||
@@ -52,6 +56,7 @@ with tempfile.TemporaryDirectory(prefix='character-handshake-') as folder:
|
|||||||
'-d',str(stage/'classes'),*map(str,files)],check=True)
|
'-d',str(stage/'classes'),*map(str,files)],check=True)
|
||||||
hello_file=stage/'hello.jsonl'
|
hello_file=stage/'hello.jsonl'
|
||||||
subprocess.run([ns['JAVA'],'-Dcharacter.helloFile='+str(hello_file),
|
subprocess.run([ns['JAVA'],'-Dcharacter.helloFile='+str(hello_file),
|
||||||
|
'-Dcharacter.unreviewedPin='+args.unreviewed_index_sha,
|
||||||
'-Dcharacter.personas='+','.join(personas),'-cp',
|
'-Dcharacter.personas='+','.join(personas),'-cp',
|
||||||
str(stage/'classes')+':'+ns['cp'],'HandshakeCheckKt'],check=True,timeout=30)
|
str(stage/'classes')+':'+ns['cp'],'HandshakeCheckKt'],check=True,timeout=30)
|
||||||
hellos=[json.loads(row) for row in hello_file.read_text().splitlines()]
|
hellos=[json.loads(row) for row in hello_file.read_text().splitlines()]
|
||||||
@@ -69,6 +74,7 @@ from pathlib import Path
|
|||||||
from unittest.mock import patch
|
from unittest.mock import patch
|
||||||
from fastapi.testclient import TestClient
|
from fastapi.testclient import TestClient
|
||||||
import gateway
|
import gateway
|
||||||
|
from action_protocol import configured_packs,negotiate,pending_pin
|
||||||
from history import History
|
from history import History
|
||||||
from guest_sessions import GuestSessions
|
from guest_sessions import GuestSessions
|
||||||
|
|
||||||
@@ -100,8 +106,10 @@ for hello in hellos:
|
|||||||
expected_voice='synthetic-'+(persona if persona!='default' else 'yangmi_fiction')
|
expected_voice='synthetic-'+(persona if persona!='default' else 'yangmi_fiction')
|
||||||
assert ack['voice_id']==expected_voice
|
assert ack['voice_id']==expected_voice
|
||||||
assert profile.call_count==(1 if persona=='default' else 0)
|
assert profile.call_count==(1 if persona=='default' else 0)
|
||||||
assert ack['action_available']==('action_pack_sha256' in hello)
|
assert ack['action_available']==bool(negotiate(hello,configured_packs()))
|
||||||
assert ack['action_pending']==('action_pending_pack_sha256' in hello)
|
assert ack['action_pending']==bool(pending_pin(hello,configured_packs()))
|
||||||
|
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'])
|
assert ack['conversation_id'] not in ids;ids.append(ack['conversation_id'])
|
||||||
assert ws.receive_json()['type']=='history'
|
assert ws.receive_json()['type']=='history'
|
||||||
assert sessions[-1]==('yangmi_fiction' if persona=='default' else persona,
|
assert sessions[-1]==('yangmi_fiction' if persona=='default' else persona,
|
||||||
@@ -119,5 +127,5 @@ for persona in sorted({x['persona'] for x in hellos}-{'default'}):
|
|||||||
ws.receive_json();ids.append(ack['conversation_id'])
|
ws.receive_json();ids.append(ack['conversation_id'])
|
||||||
assert state.busy is False
|
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')
|
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))
|
||||||
subprocess.run([sys.executable,'-c',runner],cwd=stage,check=True,timeout=30)
|
subprocess.run([sys.executable,'-c',runner],cwd=stage,check=True,timeout=30)
|
||||||
|
|||||||
@@ -39,7 +39,10 @@ parser.add_argument('--user-authorized-debug-sha',help='Explicit exact user-auth
|
|||||||
parser.add_argument('--metadata-only',action='store_true',help='Only the actual manifest admission, without repeating fixtures')
|
parser.add_argument('--metadata-only',action='store_true',help='Only the actual manifest admission, without repeating fixtures')
|
||||||
parser.add_argument('--rejection-report',type=Path,help='New bounded structural field report; no raw values')
|
parser.add_argument('--rejection-report',type=Path,help='New bounded structural field report; no raw values')
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
if args.user_authorized_debug_sha and (not args.index_manifest or args.user_authorized_debug_sha!='208f703ed92bf795bfeb78a1cef89b67bed2e45da80038a56157fd1ecd4cfa93'): parser.error('Exact authorized correct03 index required')
|
if args.user_authorized_debug_sha and (not args.index_manifest or not any(
|
||||||
|
row.get('userAuthorizedDebug') is True and row['indexSha256']==args.user_authorized_debug_sha
|
||||||
|
for row in json.loads((ROOT/'manifests/character-build-profiles.json').read_bytes())['mediaBundles'].values())):
|
||||||
|
parser.error('Exact catalogued user-authorized index required')
|
||||||
if args.index_manifest and args.runtime_manifest: parser.error('Choose runtime or index manifest, not both')
|
if args.index_manifest and args.runtime_manifest: parser.error('Choose runtime or index manifest, not both')
|
||||||
if args.metadata_only and not (args.index_manifest or args.runtime_manifest): parser.error('Actual manifest required')
|
if args.metadata_only and not (args.index_manifest or args.runtime_manifest): parser.error('Actual manifest required')
|
||||||
if args.rejection_report and (not args.index_manifest or args.rejection_report.exists()): parser.error('Index and new rejection report required')
|
if args.rejection_report and (not args.index_manifest or args.rejection_report.exists()): parser.error('Index and new rejection report required')
|
||||||
|
|||||||
@@ -0,0 +1,53 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
"""User-authorized metadata-only derivative of the exact expressions-r02 delivery.
|
||||||
|
|
||||||
|
Preserves owner input and all media bytes. Does not import, build, approve or register.
|
||||||
|
"""
|
||||||
|
import argparse
|
||||||
|
import importlib.util
|
||||||
|
import json
|
||||||
|
from pathlib import Path
|
||||||
|
import shutil
|
||||||
|
|
||||||
|
ROOT = Path(__file__).resolve().parents[1]
|
||||||
|
SOURCE_PIN = '0758672dd2ca8686f32c5e1062bca0d4bbf19063b036a42db71c1050ecb08d08'
|
||||||
|
|
||||||
|
def derive(source, output):
|
||||||
|
spec = importlib.util.spec_from_file_location('expression_media_gate', ROOT/'scripts/package-avatar-emotion.py')
|
||||||
|
gate = importlib.util.module_from_spec(spec);spec.loader.exec_module(gate)
|
||||||
|
source = Path(source).resolve(strict=True);output = Path(output).absolute()
|
||||||
|
gate.require(gate.file_sha(source/'manifest.json') == SOURCE_PIN, 'exact source pin required')
|
||||||
|
gate.require(not output.exists() and not output.is_symlink() and not output.resolve().is_relative_to(source), 'new derivative outside owner input required')
|
||||||
|
gate.require(not any(p.is_symlink() for p in source.rglob('*')), 'source symlink')
|
||||||
|
original = gate.read_json(source/'manifest.json')
|
||||||
|
index = json.loads(json.dumps(original))
|
||||||
|
action = next(a for a in index['actions'] if a['id'] == 'asset_02')
|
||||||
|
clip = gate.locate(source,action['clip']['path'])
|
||||||
|
gate.require(gate.file_sha(clip)==action['clip']['sha256'], 'action clip drift')
|
||||||
|
measured = gate.probe_music_clip(clip)
|
||||||
|
gate.require(action['audioEndUs']==8_000_000 and measured['audioEndUs']==7_940_998, 'unexpected audio endpoint; re-audit required')
|
||||||
|
action['audioEndUs'] = measured['audioEndUs']
|
||||||
|
restored = json.loads(json.dumps(index))
|
||||||
|
next(a for a in restored['actions'] if a['id']=='asset_02')['audioEndUs'] = 8_000_000
|
||||||
|
gate.require(restored==original, 'derivative changes more than audioEndUs')
|
||||||
|
for row in original['files']:
|
||||||
|
p=gate.locate(source,row['path'])
|
||||||
|
gate.require(p.stat().st_size==row['bytes'] and gate.file_sha(p)==row['sha256'], 'source inventory drift')
|
||||||
|
shutil.copytree(source,output)
|
||||||
|
raw=(json.dumps(index,indent=2,ensure_ascii=False)+'\n').encode()
|
||||||
|
(output/'manifest.json').write_bytes(raw)
|
||||||
|
pin=gate.sha(raw)
|
||||||
|
(output/'manifest.sha256').write_text(pin+' manifest.json\n')
|
||||||
|
for row in index['files']:
|
||||||
|
p=gate.locate(output,row['path'])
|
||||||
|
gate.require(p.stat().st_size==row['bytes'] and gate.file_sha(p)==row['sha256'], 'derivative media/inventory drift')
|
||||||
|
gate.require(gate.file_sha(source/'manifest.json')==SOURCE_PIN, 'owner source changed')
|
||||||
|
return {'authorization':'user_requested_deterministic_self_correction', 'sourceIndexSha256':SOURCE_PIN,
|
||||||
|
'derivedIndexSha256':pin,'changedField':'actions[asset_02].audioEndUs','before':8_000_000,'after':7_940_998,
|
||||||
|
'mediaFilesChanged':0,'runtimeManifestsChanged':0,'runtimeReady':'unchanged_false',
|
||||||
|
'independentPiApproval':False,'gatewayChanged':False,'output':str(output)}
|
||||||
|
|
||||||
|
if __name__=='__main__':
|
||||||
|
parser=argparse.ArgumentParser(description=__doc__)
|
||||||
|
parser.add_argument('--source',type=Path,required=True);parser.add_argument('--output',type=Path,required=True)
|
||||||
|
args=parser.parse_args();print(json.dumps(derive(args.source,args.output),indent=2)+'\n')
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
"""Strict production gate and optional immutable debug import of a catalogued bundle.
|
||||||
|
|
||||||
|
No asset metadata rewriting, generation, gateway registry admission or APK publication.
|
||||||
|
"""
|
||||||
|
import argparse
|
||||||
|
import importlib.util
|
||||||
|
import json
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
ROOT=Path(__file__).resolve().parents[1]
|
||||||
|
|
||||||
|
def module(name,path):
|
||||||
|
spec=importlib.util.spec_from_file_location(name,path)
|
||||||
|
value=importlib.util.module_from_spec(spec);spec.loader.exec_module(value);return value
|
||||||
|
|
||||||
|
def main():
|
||||||
|
parser=argparse.ArgumentParser(description=__doc__)
|
||||||
|
parser.add_argument('--media-bundle',required=True)
|
||||||
|
parser.add_argument('--manifest',type=Path,required=True)
|
||||||
|
parser.add_argument('--output',type=Path,required=True)
|
||||||
|
parser.add_argument('--import-only',action='store_true')
|
||||||
|
args=parser.parse_args()
|
||||||
|
select=module('selected_media',ROOT/'scripts/select-character-assets.py')
|
||||||
|
pack=module('media_gate',ROOT/'scripts/package-avatar-emotion.py')
|
||||||
|
startup=module('media_startup',ROOT/'scripts/prepare-user-avatar-startup.py')
|
||||||
|
media=select.catalog()['mediaBundles'][args.media_bundle]
|
||||||
|
select.require(media.get('userAuthorizedDebug') is True,'explicit user debug authorization required')
|
||||||
|
source=args.manifest.resolve(strict=True)
|
||||||
|
output=args.output.resolve()
|
||||||
|
select.require(not output.exists() and not output.is_relative_to(source.parent),'new evidence outside owner storage required')
|
||||||
|
output.mkdir(parents=True)
|
||||||
|
report=pack.check_bundle(source,media['indexSha256'],output,user_authorized_debug=True)
|
||||||
|
raw,poster=startup.derive(source.parent,args.media_bundle)
|
||||||
|
select.require(select.digest(raw)==media['bootstrapSha256'],'catalog bootstrap pin mismatch')
|
||||||
|
if args.import_only:
|
||||||
|
pack.import_files(source.parent,report['files'],ROOT/'app/src/main/assets'/media['assetRoot'])
|
||||||
|
basic=startup.prepare(source.parent,media_bundle=args.media_bundle)
|
||||||
|
(output/'import.json').write_text(json.dumps({'authorization':'user_exact_revision_debug_integration',
|
||||||
|
'media_bundle':args.media_bundle,'manifest_sha256':media['indexSha256'],
|
||||||
|
'asset_root':media['assetRoot'],'files':len(report['files']),'bootstrap':basic,
|
||||||
|
'independent_pi_pin':False,'network_dance_available':False,'gateway_changed':False},indent=2)+'\n')
|
||||||
|
print(json.dumps({k:v for k,v in report.items() if k not in ('files','runtime_packages')},indent=2))
|
||||||
|
|
||||||
|
if __name__=='__main__':main()
|
||||||
@@ -175,7 +175,8 @@ def check_bundle(manifest,expected,output,user_authorized_debug=False):
|
|||||||
require(p.stat().st_size==row['bytes'] and p.stat().st_size<=128_000_000 and file_sha(p)==row['sha256'],'declared file mismatch: '+name)
|
require(p.stat().st_size==row['bytes'] and p.stat().st_size<=128_000_000 and file_sha(p)==row['sha256'],'declared file mismatch: '+name)
|
||||||
table[name]={'sha256':row['sha256'],'bytes':row['bytes']}
|
table[name]={'sha256':row['sha256'],'bytes':row['bytes']}
|
||||||
require(all(table.get(name)==row for name,row in files.items()),'inventory missing/mismatching referenced file')
|
require(all(table.get(name)==row for name,row in files.items()),'inventory missing/mismatching referenced file')
|
||||||
require(not user_authorized_debug or expected=='208f703ed92bf795bfeb78a1cef89b67bed2e45da80038a56157fd1ecd4cfa93','exact user-authorized debug index required')
|
require(not user_authorized_debug or any(row.get('userAuthorizedDebug') is True and row['indexSha256']==expected
|
||||||
|
for row in read_json(ROOT/'manifests/character-build-profiles.json')['mediaBundles'].values()),'exact user-authorized debug index required')
|
||||||
log=output/'production-index-tests.txt'
|
log=output/'production-index-tests.txt'
|
||||||
with log.open('x') as f:
|
with log.open('x') as f:
|
||||||
result=subprocess.run([sys.executable,str(ROOT/'scripts/check-reply-regressions.py'),'--suite','avatar','--index-manifest',str(manifest),*(['--user-authorized-debug-sha',expected] if user_authorized_debug else [])],stdout=f,stderr=subprocess.STDOUT,timeout=180)
|
result=subprocess.run([sys.executable,str(ROOT/'scripts/check-reply-regressions.py'),'--suite','avatar','--index-manifest',str(manifest),*(['--user-authorized-debug-sha',expected] if user_authorized_debug else [])],stdout=f,stderr=subprocess.STDOUT,timeout=180)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
"""Build/verify one trusted persona debug profile over unchanged code33 media.
|
"""Build/verify one trusted persona debug profile with an explicit immutable media bundle.
|
||||||
|
|
||||||
No gateway mutations, voice selection, model calls or device installation.
|
No gateway mutations, voice selection, model calls or device installation.
|
||||||
Default profile can be built and verified separately without publishing a main APK.
|
Default profile can be built and verified separately without publishing a main APK.
|
||||||
@@ -32,12 +32,15 @@ def file_sha(p):
|
|||||||
return hashlib.file_digest(f, 'sha256').hexdigest()
|
return hashlib.file_digest(f, 'sha256').hexdigest()
|
||||||
|
|
||||||
|
|
||||||
def flags(profile, version):
|
def flags(profile, version, media_bundle='black-correct03'):
|
||||||
pin = select.catalog()['mediaBundles']['black-correct03']['indexSha256']
|
media = select.catalog()['mediaBundles'][media_bundle]
|
||||||
return ['-PcharacterProfile='+profile, '-PactionVersionCode='+str(version),
|
pin = media['indexSha256']
|
||||||
|
return ['-PcharacterProfile='+profile, '-PcharacterMediaBundle='+media_bundle,
|
||||||
|
'-PavatarUserNetworkActions='+str(media.get('networkActionsAllowed',False)).lower(),
|
||||||
|
'-PactionVersionCode='+str(version),
|
||||||
'-PnaturalManifestSha=0a3c4918ba746019cf1df885bec66e5858a8950997dac4f64e7d37094be64dad',
|
'-PnaturalManifestSha=0a3c4918ba746019cf1df885bec66e5858a8950997dac4f64e7d37094be64dad',
|
||||||
'-PemotionManifestSha='+pin] + ['-P'+name+'=true' for name in (
|
'-PemotionManifestSha='+pin] + ['-P'+name+'=true' for name in (
|
||||||
'avatarUserNetworkActions', 'avatarUserAssetCandidate', 'avatarActionCandidate',
|
'avatarUserAssetCandidate', 'avatarActionCandidate',
|
||||||
'avatarNatural', 'avatarMouthCandidate', 'avatarFullActionCandidate', 'avatarPlaybackClockFix',
|
'avatarNatural', 'avatarMouthCandidate', 'avatarFullActionCandidate', 'avatarPlaybackClockFix',
|
||||||
'avatarStartupFix', 'presenceCandidate', 'faceDiagnosticsFix', 'cameraCompatibilityFix',
|
'avatarStartupFix', 'presenceCandidate', 'faceDiagnosticsFix', 'cameraCompatibilityFix',
|
||||||
'cameraDirectYuv', 'cameraPreviewStream', 'cameraProbeDiagnostic')]
|
'cameraDirectYuv', 'cameraPreviewStream', 'cameraProbeDiagnostic')]
|
||||||
@@ -47,26 +50,32 @@ def build_dir(profile):
|
|||||||
return ROOT/('app/build' if profile == 'main' else 'app/build/characters/'+profile)
|
return ROOT/('app/build' if profile == 'main' else 'app/build/characters/'+profile)
|
||||||
|
|
||||||
|
|
||||||
def verify(apk, profile, version):
|
def verify(apk, profile, version, media_bundle='black-correct03'):
|
||||||
catalog = select.catalog()
|
catalog = select.catalog()
|
||||||
role = catalog['profiles'][profile]
|
role = catalog['profiles'][profile]
|
||||||
media = catalog['mediaBundles']['black-correct03']
|
media = catalog['mediaBundles'][media_bundle]
|
||||||
selected = select.selection(ROOT/'app/src/main/assets', profile, emotion_sha=media['indexSha256'],
|
selected = select.selection(ROOT/'app/src/main/assets', profile, emotion_sha=media['indexSha256'],
|
||||||
user_assets=True, mouth=True, startup=True)
|
user_assets=True, mouth=True, startup=True, media_bundle=media_bundle)
|
||||||
require(file_sha(BASELINE) == BASELINE_SHA, 'code33 rollback drift')
|
require(file_sha(BASELINE) == BASELINE_SHA, 'code33 rollback drift')
|
||||||
with zipfile.ZipFile(BASELINE) as old, zipfile.ZipFile(apk) as new:
|
with zipfile.ZipFile(BASELINE) as old, zipfile.ZipFile(apk) as new:
|
||||||
names = lambda z: {n for n in z.namelist() if n.startswith('assets/') and not n.endswith('/')}
|
names = lambda z: {n for n in z.namelist() if n.startswith('assets/') and not n.endswith('/')}
|
||||||
require(names(new) == names(old) == {'assets/'+n for n in selected['files']}, 'APK selection inventory mismatch')
|
require(names(new) == {'assets/'+n for n in selected['files']}, 'APK selection inventory mismatch')
|
||||||
|
if media_bundle == 'black-correct03':
|
||||||
|
require(names(new) == names(old), 'code33 inventory drift')
|
||||||
for name in names(new):
|
for name in names(new):
|
||||||
raw = new.read(name)
|
raw = new.read(name)
|
||||||
row = selected['files'][name[7:]]
|
row = selected['files'][name[7:]]
|
||||||
require(raw == old.read(name) and len(raw) == row['bytes'] and select.digest(raw) == row['sha256'],
|
require(len(raw) == row['bytes'] and select.digest(raw) == row['sha256'],
|
||||||
'APK media drift: '+name)
|
'APK media drift: '+name)
|
||||||
|
if media_bundle == 'black-correct03' or name in names(old):
|
||||||
|
require(raw == old.read(name), 'shared/retained code33 bytes drift: '+name)
|
||||||
if name.endswith('.mp4'):
|
if name.endswith('.mp4'):
|
||||||
require(new.getinfo(name).compress_type == zipfile.ZIP_STORED, 'video compression drift')
|
require(new.getinfo(name).compress_type == zipfile.ZIP_STORED, 'video compression drift')
|
||||||
for name in ('startup_poster', 'startup_black_tulle_poster'):
|
for name in ('startup_poster', 'startup_black_tulle_poster'):
|
||||||
n = 'res/drawable-nodpi-v4/'+name+'.png'
|
n = 'res/drawable-nodpi-v4/'+name+'.png'
|
||||||
require(new.read(n) == old.read(n), 'poster resource drift')
|
require(new.read(n) == old.read(n), 'poster resource drift')
|
||||||
|
poster_path='res/drawable-nodpi-v4/'+media['posterResource']+'.png'
|
||||||
|
require(new.read(poster_path)==new.read('assets/'+media['bootstrapRoot']+'poster.png'), 'selected poster mismatch')
|
||||||
# Read real DEX static values rather than trusting a generated Java file.
|
# Read real DEX static values rather than trusting a generated Java file.
|
||||||
with tempfile.TemporaryDirectory() as folder:
|
with tempfile.TemporaryDirectory() as folder:
|
||||||
dex_text = ''
|
dex_text = ''
|
||||||
@@ -87,7 +96,7 @@ def verify(apk, profile, version):
|
|||||||
'STARTUP_MANIFEST_SHA': media['bootstrapSha256']}
|
'STARTUP_MANIFEST_SHA': media['bootstrapSha256']}
|
||||||
for field, value in expected.items():
|
for field, value in expected.items():
|
||||||
require(dex_values.get(field) == '"'+value+'"', 'APK DEX mismatch: '+field)
|
require(dex_values.get(field) == '"'+value+'"', 'APK DEX mismatch: '+field)
|
||||||
for field, value in {'AVATAR_NETWORK_ACTIONS_ALLOWED': True, 'AVATAR_USER_ASSET_CANDIDATE': True,
|
for field, value in {'AVATAR_NETWORK_ACTIONS_ALLOWED': media.get('networkActionsAllowed',False), 'AVATAR_USER_ASSET_CANDIDATE': True,
|
||||||
'PERMISSION_CONNECTION_RETENTION': role['permissionConnectionRetention']}.items():
|
'PERMISSION_CONNECTION_RETENTION': role['permissionConnectionRetention']}.items():
|
||||||
require(dex_values.get(field) == str(value).lower(), 'APK DEX boolean mismatch: '+field)
|
require(dex_values.get(field) == str(value).lower(), 'APK DEX boolean mismatch: '+field)
|
||||||
require(dex_values.get('VERSION_CODE') == str(version) and
|
require(dex_values.get('VERSION_CODE') == str(version) and
|
||||||
@@ -111,7 +120,9 @@ def verify(apk, profile, version):
|
|||||||
re.search(r'android:allowBackup[^\n]*', xml)[0], 'backup mismatch')
|
re.search(r'android:allowBackup[^\n]*', xml)[0], 'backup mismatch')
|
||||||
return {'profile': profile, 'application_id': role['applicationId'], 'persona': role['persona'],
|
return {'profile': profile, 'application_id': role['applicationId'], 'persona': role['persona'],
|
||||||
'version_name': version_name, 'version_code': version, 'certificate_sha256': CERT,
|
'version_name': version_name, 'version_code': version, 'certificate_sha256': CERT,
|
||||||
'index_sha256': media['indexSha256'], 'assets_unchanged': len(selected['files']),
|
'index_sha256': media['indexSha256'], 'media_bundle':media_bundle, 'asset_files_verified':len(selected['files']),
|
||||||
|
'assets_unchanged': len(selected['files']) if media_bundle=='black-correct03' else None,
|
||||||
|
'network_actions_allowed':media.get('networkActionsAllowed',False),
|
||||||
'poster_resources_unchanged': 2, 'provider_authorities': authorities,
|
'poster_resources_unchanged': 2, 'provider_authorities': authorities,
|
||||||
'actual_dex_verified': True, 'device': 'not_run', 'gateway_changed': False}
|
'actual_dex_verified': True, 'device': 'not_run', 'gateway_changed': False}
|
||||||
|
|
||||||
@@ -143,11 +154,13 @@ def main():
|
|||||||
parser = argparse.ArgumentParser(description=__doc__)
|
parser = argparse.ArgumentParser(description=__doc__)
|
||||||
parser.add_argument('--profile', choices=sorted(select.catalog()['profiles']), default='lvbu-test')
|
parser.add_argument('--profile', choices=sorted(select.catalog()['profiles']), default='lvbu-test')
|
||||||
parser.add_argument('--version-code', type=int)
|
parser.add_argument('--version-code', type=int)
|
||||||
|
parser.add_argument('--media-bundle',choices=sorted(select.catalog()['mediaBundles']),default='black-correct03')
|
||||||
parser.add_argument('--build', action='store_true')
|
parser.add_argument('--build', action='store_true')
|
||||||
parser.add_argument('--publish', action='store_true')
|
parser.add_argument('--publish', action='store_true')
|
||||||
parser.add_argument('--output', type=Path, required=True)
|
parser.add_argument('--output', type=Path, required=True)
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
minimum = select.catalog()['profiles'][args.profile].get('minimumVersionCode', 34)
|
minimum = max(select.catalog()['profiles'][args.profile].get('minimumVersionCode', 34),
|
||||||
|
select.catalog()['mediaBundles'][args.media_bundle].get('minimumVersionCode',0))
|
||||||
args.version_code = args.version_code if args.version_code is not None else minimum
|
args.version_code = args.version_code if args.version_code is not None else minimum
|
||||||
require(args.version_code >= minimum, 'fresh character version required')
|
require(args.version_code >= minimum, 'fresh character version required')
|
||||||
require(not args.publish or args.profile != 'main', 'main publication outside this task')
|
require(not args.publish or args.profile != 'main', 'main publication outside this task')
|
||||||
@@ -156,9 +169,9 @@ def main():
|
|||||||
'published character version is immutable; choose a new code')
|
'published character version is immutable; choose a new code')
|
||||||
if args.build:
|
if args.build:
|
||||||
subprocess.run([str(ROOT/'scripts/build.sh'), ':app:assembleDebug', ':app:compileDebugAndroidTestKotlin',
|
subprocess.run([str(ROOT/'scripts/build.sh'), ':app:assembleDebug', ':app:compileDebugAndroidTestKotlin',
|
||||||
*flags(args.profile, args.version_code)], check=True, cwd=ROOT)
|
*flags(args.profile, args.version_code, args.media_bundle)], check=True, cwd=ROOT)
|
||||||
apk = build_dir(args.profile)/'outputs/apk/debug/app-debug.apk'
|
apk = build_dir(args.profile)/'outputs/apk/debug/app-debug.apk'
|
||||||
report = verify(apk, args.profile, args.version_code)
|
report = verify(apk, args.profile, args.version_code, args.media_bundle)
|
||||||
if args.publish:
|
if args.publish:
|
||||||
report = publish(apk, report)
|
report = publish(apk, report)
|
||||||
args.output.parent.mkdir(parents=True, exist_ok=True)
|
args.output.parent.mkdir(parents=True, exist_ok=True)
|
||||||
|
|||||||
@@ -12,8 +12,11 @@ ASSET_ROOT=MEDIA['assetRoot']
|
|||||||
BASIC_ROOT=MEDIA['bootstrapRoot']
|
BASIC_ROOT=MEDIA['bootstrapRoot']
|
||||||
sha=lambda data:hashlib.sha256(data).hexdigest()
|
sha=lambda data:hashlib.sha256(data).hexdigest()
|
||||||
|
|
||||||
def derive(source):
|
def derive(source,media_bundle='black-correct03'):
|
||||||
index=source/'manifest.json';assert sha(index.read_bytes())==PIN,'exact index drift'
|
media=json.loads((ROOT/'manifests/character-build-profiles.json').read_bytes())['mediaBundles'][media_bundle]
|
||||||
|
pin=media['indexSha256'];asset_root=media['assetRoot']
|
||||||
|
assert media.get('userAuthorizedDebug') is True,'authorized debug bundle required'
|
||||||
|
index=source/'manifest.json';assert sha(index.read_bytes())==pin,'exact index drift'
|
||||||
m=json.loads(index.read_bytes());row=next(r for r in m['conversationPackages'] if r['id']==m['fallbackPackageId'])
|
m=json.loads(index.read_bytes());row=next(r for r in m['conversationPackages'] if r['id']==m['fallbackPackageId'])
|
||||||
runtime=source/row['runtimeManifest']['path'];assert sha(runtime.read_bytes())==row['runtimeManifest']['sha256']
|
runtime=source/row['runtimeManifest']['path'];assert sha(runtime.read_bytes())==row['runtimeManifest']['sha256']
|
||||||
body=json.loads(runtime.read_bytes())['body'];name=str(Path(row['runtimeManifest']['path']).parent/body['path'])
|
body=json.loads(runtime.read_bytes())['body'];name=str(Path(row['runtimeManifest']['path']).parent/body['path'])
|
||||||
@@ -22,23 +25,25 @@ def derive(source):
|
|||||||
native=subprocess.check_output(['/home/ubuntu/gori-bin/ffmpeg','-v','error','-i',str(path),'-frames:v','1','-f','image2pipe','-vcodec','png','-'],timeout=30)
|
native=subprocess.check_output(['/home/ubuntu/gori-bin/ffmpeg','-v','error','-i',str(path),'-frames:v','1','-f','image2pipe','-vcodec','png','-'],timeout=30)
|
||||||
image=Image.open(io.BytesIO(native)).convert('RGB').resize((180,320),Image.Resampling.LANCZOS)
|
image=Image.open(io.BytesIO(native)).convert('RGB').resize((180,320),Image.Resampling.LANCZOS)
|
||||||
out=io.BytesIO();image.save(out,format='PNG',optimize=True);poster=out.getvalue();assert len(poster)<=100_000
|
out=io.BytesIO();image.save(out,format='PNG',optimize=True);poster=out.getvalue();assert len(poster)<=100_000
|
||||||
meta={'schemaVersion':1,'sourceIndexSha256':PIN,'posterSha256':sha(poster),'posterWidth':180,'posterHeight':320,
|
meta={'schemaVersion':1,'sourceIndexSha256':pin,'posterSha256':sha(poster),'posterWidth':180,'posterHeight':320,
|
||||||
'provenance':'Exact decoded neutral source frame0; CPU downsample, no generated media; user-authorized debug integration, not Pi certification',
|
'provenance':'Exact decoded neutral source frame0; CPU downsample, no generated media; user-authorized debug integration, not Pi certification',
|
||||||
'body':{**body,'path':ASSET_ROOT+name}}
|
'body':{**body,'path':asset_root+name}}
|
||||||
return (json.dumps(meta,indent=2)+'\n').encode(),poster
|
return (json.dumps(meta,indent=2)+'\n').encode(),poster
|
||||||
|
|
||||||
def prepare(source,verify_only=False):
|
def prepare(source,verify_only=False,media_bundle='black-correct03'):
|
||||||
raw,poster=derive(source)
|
media=json.loads((ROOT/'manifests/character-build-profiles.json').read_bytes())['mediaBundles'][media_bundle]
|
||||||
outputs={ROOT/'manifests/startup-black-tulle-correct03.json':raw,
|
raw,poster=derive(source,media_bundle)
|
||||||
ROOT/'app/src/main/assets'/BASIC_ROOT/'manifest.json':raw,
|
outputs={ROOT/media.get('bootstrapMetadata','manifests/startup-black-tulle-correct03.json'):raw,
|
||||||
ROOT/'app/src/main/assets'/BASIC_ROOT/'poster.png':poster,
|
ROOT/'app/src/main/assets'/media['bootstrapRoot']/'manifest.json':raw,
|
||||||
ROOT/'app/src/main/res/drawable-nodpi/startup_black_tulle_poster.png':poster}
|
ROOT/'app/src/main/assets'/media['bootstrapRoot']/'poster.png':poster,
|
||||||
|
ROOT/media.get('resourceDirectory','app/src/main/res')/'drawable-nodpi'/(media['posterResource']+'.png'):poster}
|
||||||
for path,data in outputs.items():
|
for path,data in outputs.items():
|
||||||
if path.exists():assert path.read_bytes()==data,'Unknown bootstrap bytes preserved: '+str(path)
|
if path.exists():assert path.read_bytes()==data,'Unknown bootstrap bytes preserved: '+str(path)
|
||||||
else:
|
else:
|
||||||
assert not verify_only,'missing bootstrap: '+str(path)
|
assert not verify_only,'missing bootstrap: '+str(path)
|
||||||
path.parent.mkdir(parents=True,exist_ok=True);path.write_bytes(data)
|
path.parent.mkdir(parents=True,exist_ok=True);path.write_bytes(data)
|
||||||
return {'status':'passed','index_sha256':PIN,'bootstrap_sha256':sha(raw),'poster_sha256':sha(poster),'poster_bytes':len(poster),'paid_calls':0}
|
return {'status':'passed','index_sha256':media['indexSha256'],'bootstrap_sha256':sha(raw),'poster_sha256':sha(poster),'poster_bytes':len(poster),'paid_calls':0}
|
||||||
if __name__=='__main__':
|
if __name__=='__main__':
|
||||||
parser=argparse.ArgumentParser(description=__doc__);parser.add_argument('--source',type=Path,required=True);parser.add_argument('--verify-only',action='store_true')
|
parser=argparse.ArgumentParser(description=__doc__);parser.add_argument('--source',type=Path,required=True);parser.add_argument('--verify-only',action='store_true')
|
||||||
args=parser.parse_args();print(json.dumps(prepare(args.source,args.verify_only),indent=2))
|
parser.add_argument('--media-bundle',default='black-correct03')
|
||||||
|
args=parser.parse_args();print(json.dumps(prepare(args.source,args.verify_only,args.media_bundle),indent=2))
|
||||||
|
|||||||
@@ -38,16 +38,25 @@ def catalog():
|
|||||||
return data
|
return data
|
||||||
|
|
||||||
|
|
||||||
def selection(assets, profile='main', *, emotion_sha='', user_assets=False, mouth=False, startup=False):
|
def authorized_debug_sha(pin):
|
||||||
|
return any(row.get('userAuthorizedDebug') is True and row['indexSha256']==pin
|
||||||
|
for row in catalog()['mediaBundles'].values())
|
||||||
|
|
||||||
|
|
||||||
|
def selection(assets, profile='main', *, emotion_sha='', user_assets=False, mouth=False, startup=False, media_bundle=None):
|
||||||
data = catalog()
|
data = catalog()
|
||||||
require(profile in data['profiles'], 'unknown character profile')
|
require(profile in data['profiles'], 'unknown character profile')
|
||||||
role = data['profiles'][profile]
|
role = data['profiles'][profile]
|
||||||
bundle_id = ('black-correct03' if user_assets else 'white-full04') if emotion_sha else None
|
require(not media_bundle or emotion_sha, 'explicit media needs an exact pin')
|
||||||
require(role['mediaSelection'] == 'existing-build-flags' or
|
bundle_id = (media_bundle or ('black-correct03' if user_assets else 'white-full04')) if emotion_sha else None
|
||||||
role['mediaSelection'] == bundle_id and mouth and startup, 'profile/media flags mismatch')
|
require(bundle_id is None or bundle_id in data['mediaBundles'], 'unknown media bundle')
|
||||||
|
allowed = [role['mediaSelection'], *role.get('additionalMediaSelections', [])]
|
||||||
|
require((role['mediaSelection'] == 'existing-build-flags' and bundle_id in (None,'black-correct03','white-full04')) or
|
||||||
|
bundle_id in allowed and mouth and startup, 'profile/media flags mismatch')
|
||||||
bundle = data['mediaBundles'][bundle_id] if bundle_id else None
|
bundle = data['mediaBundles'][bundle_id] if bundle_id else None
|
||||||
if bundle:
|
if bundle:
|
||||||
require(emotion_sha == bundle['indexSha256'], 'selected exact index mismatch')
|
require(emotion_sha == bundle['indexSha256'], 'selected exact index mismatch')
|
||||||
|
require(user_assets == bundle.get('userAuthorizedDebug',False), 'media authorization mode mismatch')
|
||||||
assets = Path(assets).resolve(strict=True)
|
assets = Path(assets).resolve(strict=True)
|
||||||
files = {}
|
files = {}
|
||||||
|
|
||||||
@@ -111,7 +120,7 @@ def selection(assets, profile='main', *, emotion_sha='', user_assets=False, mout
|
|||||||
require(boot['sourceIndexSha256'] == emotion_sha and boot['body']['path'] in files and
|
require(boot['sourceIndexSha256'] == emotion_sha and boot['body']['path'] in files and
|
||||||
files[boot['body']['path']]['sha256'] == boot['body']['sha256'], 'bootstrap/index/body mismatch')
|
files[boot['body']['path']]['sha256'] == boot['body']['sha256'], 'bootstrap/index/body mismatch')
|
||||||
poster = add(boot_root + 'poster.png', boot['posterSha256'])
|
poster = add(boot_root + 'poster.png', boot['posterSha256'])
|
||||||
resource = ROOT / 'app/src/main/res/drawable-nodpi' / (bundle['posterResource'] + '.png')
|
resource = ROOT / bundle.get('resourceDirectory','app/src/main/res') / 'drawable-nodpi' / (bundle['posterResource'] + '.png')
|
||||||
require(resource.read_bytes() == poster, 'drawable/bootstrap poster mismatch')
|
require(resource.read_bytes() == poster, 'drawable/bootstrap poster mismatch')
|
||||||
return {'schemaVersion': 1, 'profile': profile, 'application_id': role['applicationId'],
|
return {'schemaVersion': 1, 'profile': profile, 'application_id': role['applicationId'],
|
||||||
'persona': role['persona'], 'media_bundle': bundle_id, 'media_identity': bundle['identityId'] if bundle else 'a01',
|
'persona': role['persona'], 'media_bundle': bundle_id, 'media_identity': bundle['identityId'] if bundle else 'a01',
|
||||||
@@ -143,13 +152,14 @@ def main():
|
|||||||
p.add_argument('--profile', choices=sorted(catalog()['profiles']), required=True)
|
p.add_argument('--profile', choices=sorted(catalog()['profiles']), required=True)
|
||||||
p.add_argument('--assets', type=Path, default=ROOT / 'app/src/main/assets')
|
p.add_argument('--assets', type=Path, default=ROOT / 'app/src/main/assets')
|
||||||
p.add_argument('--emotion-sha', default='')
|
p.add_argument('--emotion-sha', default='')
|
||||||
|
p.add_argument('--media-bundle', default='')
|
||||||
for flag in ('user-assets', 'mouth', 'startup'):
|
for flag in ('user-assets', 'mouth', 'startup'):
|
||||||
p.add_argument('--' + flag, choices=['true', 'false'], default='false')
|
p.add_argument('--' + flag, choices=['true', 'false'], default='false')
|
||||||
p.add_argument('--output', type=Path)
|
p.add_argument('--output', type=Path)
|
||||||
p.add_argument('--report', type=Path)
|
p.add_argument('--report', type=Path)
|
||||||
a = p.parse_args()
|
a = p.parse_args()
|
||||||
result = selection(a.assets, a.profile, emotion_sha=a.emotion_sha, user_assets=a.user_assets == 'true',
|
result = selection(a.assets, a.profile, emotion_sha=a.emotion_sha, user_assets=a.user_assets == 'true',
|
||||||
mouth=a.mouth == 'true', startup=a.startup == 'true')
|
mouth=a.mouth == 'true', startup=a.startup == 'true', media_bundle=a.media_bundle or None)
|
||||||
if a.output:
|
if a.output:
|
||||||
stage(a.assets, a.output, result)
|
stage(a.assets, a.output, result)
|
||||||
if a.report:
|
if a.report:
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
package com.gorios.lanvoice
|
package com.gorios.lanvoice
|
||||||
object BuildConfig { const val AVATAR_USER_ASSET_CANDIDATE=false }
|
object BuildConfig { const val AVATAR_USER_ASSET_CANDIDATE=false;const val STARTUP_POSTER_RES_ID=1 }
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
package com.gorios.lanvoice
|
package com.gorios.lanvoice
|
||||||
object R { object drawable { const val startup_poster=1;const val startup_black_tulle_poster=2 } }
|
object R { object drawable { const val startup_poster=1;const val startup_black_tulle_poster=2;const val startup_char_expressions_r02_poster=3 } }
|
||||||
|
|||||||
@@ -28,6 +28,12 @@ fun startupCacheCheck() {
|
|||||||
} finally { worker.shutdownNow() }
|
} finally { worker.shutdownNow() }
|
||||||
val userPin="208f703ed92bf795bfeb78a1cef89b67bed2e45da80038a56157fd1ecd4cfa93"
|
val userPin="208f703ed92bf795bfeb78a1cef89b67bed2e45da80038a56157fd1ecd4cfa93"
|
||||||
val userKey=StartupAssetKey(31,1,userPin,"avatar/a01-black-tulle-roomy720-correct03/",3)
|
val userKey=StartupAssetKey(31,1,userPin,"avatar/a01-black-tulle-roomy720-correct03/",3)
|
||||||
|
val charPin="f8a69041da51e1a551c6991bfad6d7f034f0f320f726f58568afd43d81cb9604"
|
||||||
|
val charKey=StartupAssetKey(36,1,charPin,"avatar/char-expressions-r02/",3)
|
||||||
|
check(charKey.fingerprint!=userKey.fingerprint)
|
||||||
|
check(runCatching { StartupAssetKey(36,1,userPin,charKey.root,3) }.isFailure)
|
||||||
|
check(runCatching { StartupAssetKey(36,1,charPin,userKey.root,3) }.isFailure)
|
||||||
|
check(runCatching { StartupAssetKey(36,1,charPin,charKey.root,2) }.isFailure)
|
||||||
check(userKey.fingerprint!=key(pin=userPin,validator=3).fingerprint)
|
check(userKey.fingerprint!=key(pin=userPin,validator=3).fingerprint)
|
||||||
for((root,pin,version) in listOf(Triple("avatar/unknown/",userPin,3),
|
for((root,pin,version) in listOf(Triple("avatar/unknown/",userPin,3),
|
||||||
Triple(userKey.root,"b".repeat(64),3),Triple(userKey.root,userPin,2))) {
|
Triple(userKey.root,"b".repeat(64),3),Triple(userKey.root,userPin,2))) {
|
||||||
|
|||||||
@@ -52,6 +52,24 @@ fun main() {
|
|||||||
check(socket.sent.size==count)
|
check(socket.sent.size==count)
|
||||||
client.release();Handler.drain()
|
client.release();Handler.drain()
|
||||||
}
|
}
|
||||||
|
val unreviewed=System.getProperty("character.unreviewedPin","")
|
||||||
|
if(unreviewed.isNotEmpty()) {
|
||||||
|
check(unreviewed.matches(Regex("[0-9a-f]{64}")))
|
||||||
|
for(mode in listOf("disabled","unknown_ready","unknown_pending")) {
|
||||||
|
val client=DialogueClient("localhost",5011,{},persona="liam",
|
||||||
|
actionPackSha={if(mode=="unknown_ready") unreviewed else null},
|
||||||
|
pendingActionPackSha={if(mode=="unknown_pending") unreviewed else null})
|
||||||
|
val socket=Socket();client.field("socket",socket);val listener=client.listener(0)
|
||||||
|
listener.onMessage(socket,"""{"type":"auth","state":"ok"}""");Handler.drain()
|
||||||
|
check(socket.sent.size==1);val hello=socket.sent.single()
|
||||||
|
check("\"persona\":\"liam\"" in hello && "voice_id" !in hello && "conversation_id" !in hello)
|
||||||
|
if(mode=="disabled")check("action_pack_sha256" !in hello && "action_pending_pack_sha256" !in hello)
|
||||||
|
wires.add(hello)
|
||||||
|
listener.onMessage(socket,"""{"type":"hello","action_available":false,"action_pending":false}""");Handler.drain()
|
||||||
|
check(client.actionNegotiation=="unavailable" && !client.capabilitiesReady())
|
||||||
|
client.disconnect();client.release();Handler.drain();check(socket.cancelled)
|
||||||
|
}
|
||||||
|
}
|
||||||
java.io.File(checkNotNull(System.getProperty("character.helloFile"))).writeText(wires.joinToString("\n")+"\n")
|
java.io.File(checkNotNull(System.getProperty("character.helloFile"))).writeText(wires.joinToString("\n")+"\n")
|
||||||
println("PASS: "+wires.size+" actual DialogueClient AUTH→production HELLO persona/media offers, pending readiness, duplicate AUTH and retired socket fences; transport/main/JSON adapters, device not_run")
|
println("PASS: "+wires.size+" actual DialogueClient AUTH→production HELLO persona/media offers, pending readiness, duplicate AUTH and retired socket fences; transport/main/JSON adapters, device not_run")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -120,3 +120,51 @@ class CharacterProfilesTests(unittest.TestCase):
|
|||||||
self.assertIn('-PcharacterProfile=liam-test',pack.flags('liam-test',35))
|
self.assertIn('-PcharacterProfile=liam-test',pack.flags('liam-test',35))
|
||||||
self.assertEqual(select.catalog()['profiles']['liam-test']['minimumVersionCode'],35)
|
self.assertEqual(select.catalog()['profiles']['liam-test']['minimumVersionCode'],35)
|
||||||
with self.assertRaises(ValueError):pack.artifact_name('main',35)
|
with self.assertRaises(ValueError):pack.artifact_name('main',35)
|
||||||
|
|
||||||
|
def char(self,profile='liam-test',**changes):
|
||||||
|
media=select.catalog()['mediaBundles']['char-expressions-r02']
|
||||||
|
flags=dict(emotion_sha=media['indexSha256'],user_assets=True,mouth=True,startup=True,
|
||||||
|
media_bundle='char-expressions-r02')
|
||||||
|
flags.update(changes)
|
||||||
|
return select.selection(ASSETS,profile,**flags)
|
||||||
|
|
||||||
|
def test_char_is_explicit_liam_only_and_does_not_mix_black_pack(self):
|
||||||
|
selected=self.char()
|
||||||
|
self.assertEqual(selected['file_count'],3190)
|
||||||
|
self.assertEqual((selected['persona'],selected['media_identity']),('liam','a01'))
|
||||||
|
self.assertEqual(sum(n.startswith('avatar/char-expressions-r02/') for n in selected['files']),2593)
|
||||||
|
self.assertFalse(any('black-tulle' in n or 'startup-white' in n for n in selected['files']))
|
||||||
|
for profile in ('main','lvbu-test'):
|
||||||
|
with self.subTest(profile=profile),self.assertRaises(ValueError):self.char(profile)
|
||||||
|
for profile in ('main','lvbu-test','liam-test'):
|
||||||
|
self.assertFalse(any('char-expressions' in n for n in self.full(profile)['files']))
|
||||||
|
|
||||||
|
def test_char_pin_bootstrap_and_poster_cannot_be_mixed(self):
|
||||||
|
media=select.catalog()['mediaBundles']['char-expressions-r02']
|
||||||
|
with self.assertRaises(ValueError):self.char(emotion_sha=select.catalog()['mediaBundles']['black-correct03']['indexSha256'])
|
||||||
|
original=Path.read_bytes
|
||||||
|
for target in (ASSETS/media['assetRoot']/'manifest.json',
|
||||||
|
ASSETS/media['bootstrapRoot']/'manifest.json',
|
||||||
|
ROOT/media['resourceDirectory']/'drawable-nodpi'/(media['posterResource']+'.png')):
|
||||||
|
with self.subTest(target=target),patch.object(Path,'read_bytes',lambda p:b'corrupt' if p==target else original(p)),self.assertRaises(ValueError):self.char()
|
||||||
|
|
||||||
|
def test_char_retains_transparent_sections_and_runtime_not_ready(self):
|
||||||
|
from PIL import Image
|
||||||
|
media=select.catalog()['mediaBundles']['char-expressions-r02']
|
||||||
|
for name,restricted in [('happy',range(7,70)),('sad',range(24,55))]:
|
||||||
|
root=ASSETS/media['assetRoot']/'conversation'/name
|
||||||
|
runtime=json.loads((root/'manifest.json').read_bytes())
|
||||||
|
self.assertIs(runtime['runtimeReady'],False)
|
||||||
|
for frame in restricted:
|
||||||
|
for level in runtime['patches'][frame]['levels'][1:]:
|
||||||
|
with Image.open(root/level['path']) as image:
|
||||||
|
self.assertEqual(image.getchannel('A').getextrema(),(0,0))
|
||||||
|
|
||||||
|
def test_char_has_no_network_dance_authorization(self):
|
||||||
|
spec=importlib.util.spec_from_file_location('char_pack',ROOT/'scripts/package-character-test.py')
|
||||||
|
pack=importlib.util.module_from_spec(spec);spec.loader.exec_module(pack)
|
||||||
|
flags=pack.flags('liam-test',36,'char-expressions-r02')
|
||||||
|
self.assertIn('-PavatarUserNetworkActions=false',flags)
|
||||||
|
self.assertIn('-PcharacterMediaBundle=char-expressions-r02',flags)
|
||||||
|
self.assertFalse(select.catalog()['mediaBundles']['char-expressions-r02']['networkActionsAllowed'])
|
||||||
|
self.assertIn('Network dance requires separate reviewed media registration',(ROOT/'app/build.gradle').read_text())
|
||||||
|
|||||||
@@ -12,7 +12,8 @@ class UserAssetPackageTests(unittest.TestCase):
|
|||||||
with self.subTest(pin=pin),self.assertRaises(ValueError):pack.authorization(pin,pi,registry)
|
with self.subTest(pin=pin),self.assertRaises(ValueError):pack.authorization(pin,pi,registry)
|
||||||
def test_buildconfig_exact_pin_isolated_roots_and_network_guards(self):
|
def test_buildconfig_exact_pin_isolated_roots_and_network_guards(self):
|
||||||
s=(ROOT/'app/build.gradle').read_text()
|
s=(ROOT/'app/build.gradle').read_text()
|
||||||
self.assertIn("emotionManifestSha != '"+pack.PIN+"'",s)
|
self.assertIn("emotionManifestSha != characterMedia.indexSha256",s)
|
||||||
|
self.assertIn("characterMedia.userAuthorizedDebug != true",s)
|
||||||
self.assertIn("if (!avatarUserAssetCandidate && avatarPlaybackClockFix",s)
|
self.assertIn("if (!avatarUserAssetCandidate && avatarPlaybackClockFix",s)
|
||||||
self.assertIn("sourceSets.main.assets.setSrcDirs([packagedAssets])",s)
|
self.assertIn("sourceSets.main.assets.setSrcDirs([packagedAssets])",s)
|
||||||
self.assertIn("scripts/select-character-assets.py",s)
|
self.assertIn("scripts/select-character-assets.py",s)
|
||||||
|
|||||||
Reference in New Issue
Block a user