# Action/emotion runtime v2 contract Development baseline: `e3ee004d29ac472997a813fbdb641ba4983fa5ce` (clean, remote main matched). This contract reserves the interface; it grants no naturalness/publication approval. Asset owner: Localv-i-asset w8:p1. Code/importer owner: baji-action-emotion. No paid calls by code owner. Existing owner directories/previews are read only. Deliver a new directory, `manifest.json` exact bytes SHA256 and preview/evidence paths. Manifest `schemaVersion:2`, `identityId:a01`, `packId`, `fallbackPackageId`, `conversationPackages`, `edges`, `actions`, `files`. Paths are relative without `..`/URLs; every file has SHA256/bytes. Pi approval pins exact manifest SHA outside the manifest. Self-authored approved/status fields never enable runtime capabilities. Each conversation package: unique `id`, `emotion:neutral|happy|sad`, `visualIntensity:0|1`, `mouthBodySha256`, `runtimeManifest:{path,sha256}` referencing runtime04 format (continuous body + own actual N PTS registered frames × five RGBA aperture levels, own curves/anchors/coordinates). Body SHA, frame count and decoded PTS bind every mouth track to that exact body; no cross-body patches/masks/coordinates reuse. Happy/sad are slightly only, including model intensity2. Body is silent. No layer means whole-package fallback, never a neutral mouth over another body. Pi selected **1.1 source pixels for the candidate**, based on fixed comparisons; dynamic naturalness review is still pending. Do not treat a numeric gap as approval. Edges: `id`, `from`, `to`, `fromAnchor`, `toAnchor`, `fromFrame`, `toFrame`, `clip:{path,sha256,width,height,frameCount,ptsUs,durationUs,fpsNumerator,fpsDenominator,hasAudio:false}`. Edges also bind `fromPtsUs` and `toPtsUs` to the exact source/target body frame; `fromFrame` must be in that source package's `legalExitFrames`. Each package declares `entryAnchor`, `exitAnchor`, `legalExitFrames`, `loopEdge`. Frame indices/PTS are actual decoded values. Every changed body phase requires a reviewed edge, no arbitrary alpha cut. Supply dense seam frames, real-speed loops and full-scale/close previews, not just matching endpoints. Actions may be `[]` for a partial conversation-only index. Dance requires exactly `asset_01`, `asset_02`, `kind:dance`, `mouthAllowed:false`, `disallowTALK:true`, `entryAnchor:A`, `returnAnchor:A`, `clip` with file SHA/dimensions/frameCount/PTS/ duration/audio track metadata, `audioEndUs`, `reviewEvidence`. Current player accepts a **single complete video including entry, music dance and return A**. Separately hashed sequential segments are not yet supported. Music must actually exist, end naturally, and actor must not talk/sing. Source/music provenance and job/fee ledger stay in owner storage; Git stores metadata only. Client advertises only Pi-pinned, machine-validated packs: `action_protocol:1`, `action_pack_sha256`, `action_kinds:[dance]`. Server has independent exact SHA allowlist/duration; unknown clients/packs get no actions. Server creates opaque action_id, connection generation/turn binding and TTL; never accepts URLs from LLM. `action.plan` is emitted only after pre-reply playback.drained. Client stops and confirms AudioRecord before playing; `action.status` started/completed/cancelled/ failed echoes action_id/turn_id. Completed requires video_ended, audio_stopped, idle_restored, mic_stopped, and minimum reviewed duration elapsed. Settings cancel, background, disconnect, new turn and expiry discard the after reply. Asset handoff required first: slight happy/sad TALK samples and own runtime04 mouths/entry-exit evidence. Pi reviews exact manifest + timed previews; only then expand idle variants and two music dances. Gate1 and deterministic mock traces cannot certify naturalness or device AudioRecord/GPU/≤1s perception. Runtime selection keeps `selectedEmotion/selectedIntensity` (model) distinct from `visualEmotion/visualIntensity/packageId/degraded/reason` (admitted visual). User camera cues are independent and never select these role packages. Production runtime04 parser: `app/src/main/java/com/gorios/lanvoice/avatar/ContinuousAvatarManifest.kt`; v2 index parser: `app/src/main/java/com/gorios/lanvoice/avatar/EmotionActionManifest.kt`. Each package should use `packId:a01-expression-action-v1--runtime-04`; New per-package runtime manifests use **schemaVersion:2**; only the old neutral runtime03/04 schemaVersion1 retains its fixed97@24 constraints. Each new body's `frameCount:N`, `durationUs`, `fpsNumerator/fpsDenominator`, **`ptsUs:[actual decoded presentation timestamps]`** are mandatory. No truncation/padding to97, no neutral track reuse. Counts121/49 and rational frame rates are supported independently. Current GLES shape remains480×848 (new shapes require renderer extension). N is bounded2..720, fps1..60, duration0.1..30s; body PTS starts0, strictly increases, remains below duration and agrees with measured duration/nominal fps within one nominal frame. Nonuniform actual PTS is accepted within two nominal frame intervals. Machine gate must compare decoded PTS/duration to declarations, not infer PTS. `patchFormat.bodySha256` must equal `body.sha256`; `patches` has exactlyN entries, each `frameIndex:i`, `ptsUs:body.ptsUs[i]`, own coordinates/mask and five independent level paths/hashes. Patch format remains straight RGBA8, [0,.25,.5,.75,1]; nearest level, nonzero opacity1, zero bypass. Each patch≤128×128, totalRGBA≤8MB/runtime; all packages combined≤32MB, ≤12packages. These are admission bounds, not GPU proof. Each of the five mouth states supplies own actual `ptsUs`, `frameCount`, fps ratio, `durationMs` (100..1000), alpha values and A/B anchors; curve timing no longer assumes24fps. Runtime04 mouthStates/stateRouting names and anchor rules stay intact. Entry/return bridges carry actual decoded frame PTS; `audioEndUs` records measured last audio timestamp, completion also waits actual media stop and restored A. Current asset snapshot: happy/sad001 sources each actually97 frames; sad002 must be measured independently. 121/49 are compatibility test counts, not a claim about those files. The happy-01 draft hash `518865589fcff36259b864226cdc9651f742d6f56f3b58eeb98f241ef03d48e3` still used schema1/`a01-slight-happy-01`/`body.framePTSUs` at the read-only check; it is rejected, not silently relabeled or modified. Export schema2, packId `a01-expression-action-v1-happy-01-runtime-04`, `body.ptsUs`, `patchFormat.bodySha256`, and each mouth state's `ptsUs`. Use the same format for sad/neutral, independently measured. A frame0 enter bridge is legal only when its source declares frame0 in `legalExitFrames`; do not inherit old last-frame exits. Read-only handoff check (new evidence file, does not import/activate): `python3 scripts/check-avatar-runtime.py --manifest /manifest.json --sha256 --output logs/action-emotion/.json`. It checks file hashes, complete video decode, actual PTS/duration/fps, PNG RGBA shape/cache and production Kotlin admission. It rejects concurrent file drift. Deliver corrected runtime paths/hashes plus complete index hash, reviewed loop/ enter/return clip paths/hashes, timed seam previews and Pi's external exact pin. Conversation planning retains clip metadata and assigns each bridge execution a unique serial; stale completion cannot authorize a later bridge with the same id. MainActivity now uses the real multi-pack/bridge/music driver; capability activation still requires the external exact index pin and file admission. Next pin / asset handoff (media-wiring stage, no activation): - A partial neutral+happy index is sufficient; sad can follow in a later pinned index. Each included package needs its own schema2 runtime04 and actual N×5 data; an independently hash-validated legacy neutral runtime04 is also supported. - happy v2 exact SHA `8d4e56e356d0da3ab9260c448c986fcdb2ef42b66a0dfba11f7bd5dbfeb81b2e` passed read-only decode/hash/production-parser checks:97 actual PTS,485 PNGs, 1,617,000 RGBA bytes, body SHA `232943dc11698c47d4d38c281b08ea87cfcbbd11263b107da59f154a84f4230f`. Its empty legalExitFrames is not changed or treated as a reviewed exit. - Index rows declare reviewed legalExitFrames (actual frame indices), loopEdge, A entry/exit anchors and exact runtimeManifest path/hash. Index paths resolve under `avatar/a01-expression-action-v1/`; runtime file paths under each runtime. - Every package requires a loop edge. `nativeLoop:true` is only for a reviewed same-body last→0 loop: clip has that body's exact SHA/PTS/duration. Otherwise deliver an actual silent loop bridge; runtime plays that bridge rather than wraps. - neutral→happy and happy→neutral require actual silent bridge clip metadata, fromFrame/fromPtsUs and toFrame/toPtsUs bound to each own body. Frame0 exits are allowed only with reviewed index legalExitFrames; target entry is preroll- decoded and composed before the bridge reveals, regardless of different N/fps. - For each later dance, supply sourcePackageId/returnPackageId equal to fallback, sourceFrame/sourcePtsUs and returnFrame/returnPtsUs exact bindings. SourceFrame must be a declared legal exit. The complete clip includes the reviewed departure from that source and return to that target A frame, with actual PTS/duration, hasAudio:true, measured audioEndUs, no TALK/singing and seam/music evidence. - Supply full index bytes SHA, all referenced files plus SHA/bytes, preview paths and Pi's independent exact index approval. A runtime-only SHA is not the index pin. Do not fabricate bridges, exits, audio, naturalness or dance capability to fill gaps.