feat: inject request-local server time and freeze action asset contract

This commit is contained in:
zenord
2026-10-13 00:16:32 +08:00
parent e3ee004d29
commit dfd1372ba2
5 changed files with 119 additions and 2 deletions
+52
View File
@@ -0,0 +1,52 @@
# 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`, `runtimeManifest:{path,sha256}` referencing runtime04 format
(continuous body + own 97 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.
Provide 0.9/1.1/1.2 aperture previews; Pi chooses before import.
Edges: `id`, `from`, `to`, `fromAnchor`, `toAnchor`, `fromFrame`, `toFrame`,
`clip:{path,sha256,width,height,frameCount,ptsUs,durationUs,hasAudio:false}`.
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: exactly `asset_01`, `asset_02`, `kind:dance`, `mouthAllowed:false`,
`entryAnchor:A`, `returnAnchor:A`, `clip` with file SHA/dimensions/frameCount/PTS/
duration/audio track metadata, `audioEndUs`, `reviewEvidence`.
Use a single complete video including entry, music dance and return A, or list
explicitly hashed sequential segments with reviewed edges. 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.