Repository navigation
Add optional named clips to the character pack contract - #5
Open
rubenmarcus wants to merge 7 commits into
Open
rubenmarcus wants to merge 7 commits into
rubenmarcus wants to merge 7 commits into
Conversation
Characters may now declare an animations.extra map of named clips beyond
the states: fixed vocabulary names (locomotion, weapon handling, damage
reactions, melee, round outcomes) or an emote_ prefix with a suffix. Keys
match ^[a-z][a-z0-9_]{1,40}$; each entry carries file, duration, loop,
rootMotion and source. Extra files are declared in files under the
animations.extra.<name> role, so duplicates, missing paths and the byte
budget (extras included) are enforced before any payload is hashed, and
each extra GLB must contain an animation named exactly as its key.
Agent: Claude Code
Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
The valid fixture now ships two extra clips (a vocabulary name and an emote_ name) and a no-extras pack stays valid. Twelve new mutants cover the contract: unknown, state-colliding, bare-prefix and pattern-violating names; missing, duplicated, shared, non-GLB and misnamed clip files; entries with missing or mistyped fields; and extras pushing the pack over its byte budget. Agent: Claude Code Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
Adopt the 45 names the animation conversion library proposes (branch feat/animation-conversion-20261109, PROPOSED_EXTRA_NAMES; every name is used by at least one key of library/index.json): 8-way walk/run/sprint diagonals, sprint gaits, crouched locomotion and aim, standing turns, jump phases, pistol variants and death variants. extraClipNames is now coreExtraClipNames (23) plus converterExtraClipNames (45, sorted to diff against the converter's own sorted export). assertExtraClipVocabulary enforces the single source: the vocabulary must equal the core set plus the converter set, with no duplicates, state collisions or pattern breaks. The converter must import extraClipNames from this module instead of keeping its own copy (noted in docs/character-pack.md). Agent: Claude Code Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
The synthetic fixture now carries a converter-named extra (sprint_fwd_left) alongside strafe_left and emote_danca, proving the new names validate end to end through the pack contract. New check cases: - PASS: assertExtraClipVocabulary on the real exports (68 names = 23 core + 45 converter) - Mutant: a converter key outside the vocabulary (vault_low) fails for the missing-name reason - Mutant: a vocabulary name outside the core and converter sets - Mutant: a dropped core name - Mutant: a duplicate vocabulary entry Agent: Claude Code Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
rubenmarcus
added a commit
that referenced
this pull request
Nov 9, 2026
…abulary The converter imports extraClipNames from tools/lib/character-pack.mjs instead of keeping its own copy. Agent: Claude Code Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
…ract The animation converter now emits per character one GLB per family (states, loco, combat, ceremony) plus one GLB per emote. The contract accepts that layout without dropping the per-state/per-clip one: - several animations.<state> roles may share one states pack whose clip names are the state names, and several animations.extra.<name> roles may share one family-pack file whose clip names are the keys; a file can never mix state and extra roles, and emote keys always keep one file per key; - extra entries gain an optional family field (loco|combat|ceremony| emote) that must match clipFamily, a mirror of the converter's packFamily (that branch is stacked on this one, so the mirror is proven against a snapshot of its answers instead of an import); - every key must exist as an animation name inside its shared GLB, and shared animation GLBs are read once per file during validation. Agent: Claude Code Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
The fixture now carries a loco family pack shared by two extras next to a per-file extra and proves both layouts valid, plus a states.glb pass case. New rejections, each for its stated reason: a key missing inside the family pack, an emote sharing any file (family or another emote), a declared family mismatching the clip name, a family outside the enum, one file mixing clip families, and a states pack missing a state clip. A snapshot parity table locks clipFamily to the converter's packFamily answers (83 names, emotes mapped to the contract family emote), with a poisoned-mirror mutant. Agent: Claude Code Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
The real family GLBs (legacy-out capitao-caveira, character-clips@2) store buffer 0 as the EXT_meshopt_compression stream in the BIN chunk plus a virtual fallback buffer for the uncompressed view sizes, which the strict one-self-contained-buffer rule rejected. readGlb gains allowMeshoptFallback: animation reads accept that layout with the compressed stream ranges bounds-checked against the BIN chunk, while the model read stays strict because its skin bytes are read raw. Proved on the real pack (14 files, 4596362 bytes, 11 states, 74 extras across loco/combat/ceremony/emotes) and with synthetic cases: a meshopt-shaped family pack validates, the strict default still rejects it, a second buffer without the fallback marker is refused, and a stream past the BIN chunk is out of bounds. Agent: Claude Code Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
This was referenced Nov 9, 2026
Member
Author
|
Local verification on head 0930753 (Linux, Node 26.12.1): npm ci PASS; npm run check PASS (98 PASS lines); npm run check:asset-gen PASS (4 PASS lines); npm run smoke:pack PASS (68 PASS lines). Blender 5.2.0 LTS is installed; these synthetic gates do not establish a real-asset or visual approval. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Characters may declare an optional
animations.extramap of named clips beyond the states, for the upcoming movement/weapon/reaction/emote set:^[a-z][a-z0-9_]{1,40}$and must be a fixed vocabulary name (strafe_left,run_back,reload_rifle,hit_front,knife_stab,victory, …) or anemote_prefix with at least one suffix character. State names and the bareemote_prefix are rejected, keeping the state and extra key spaces disjoint.file,duration(positive seconds),loop,rootMotionandsource;duration/loop/rootMotionare declared metadata for the runtime, the GLB stays authoritative for keyframes.filesunder theanimations.extra.<name>role, so missing/duplicate paths and the byte budget (extras included) are enforced structurally, before any payload is hashed.Stacked on #3 (
feat/character-pack-contract-20261108); vocabulary mirrored client-side in corosolto/client#1260.Vocabulary extended to the converter library names
extraClipNamesis now 68 names:coreExtraClipNames(23, unchanged) plusconverterExtraClipNames— the 45 names proposed by the animation conversion library (feat/animation-conversion-20261109,tools/lib/animation-library.mjsPROPOSED_EXTRA_NAMES; each name is used by at least one key of itslibrary/index.json):<gait>_<fwd|back>_<left|right>:walk_fwd_left/right,walk_back_left/right,run_fwd_left/right,run_left/right,run_back_left/right,sprint_fwd_left/right,sprint_left/right,sprint_back_left/rightsprint,sprint_backcrouchwalk_left/right/back(+diagonals),crouch_aim,crouch_pistol,crouch_turn_left/rightturn_left,turn_rightjump_start,jump_loop,jump_land,jump_pistolidle_aim,shoot_pistol,shoot_crouch,run_pistol,run_back_pistoldeath_front,death_right,death_headshot_front/back,death_crouchSingle source — note for the converter branch owner (
feat/animation-conversion-20261109):tools/lib/animation-library.mjscurrently defines its ownCONTRACT_EXTRA_NAMES/PROPOSED_EXTRA_NAMES. When rebasing on this PR, replace both with an import ofextraClipNames(and optionallyconverterExtraClipNames) fromtools/lib/character-pack.mjs, and keep its check assertingassertExtraClipVocabulary({ converter: <its proposed names> })so a proposal that outgrows the contract fails on its side too. Do not extend the name list in the converter branch; extend it here.assertExtraClipVocabulary(incharacter-pack.mjs) enforces the equality: vocabulary == core ∪ converter, no duplicates, no state collisions, no pattern breaks.Evidence
npm run checkgreen:tools/checks/character-pack-check.mjssuite — valid fixture with 3 extras (incl. the converter namesprint_fwd_left), valid pack with 0 extras, and 16 extra-clip mutants rejected for the stated reason: unknown/state-colliding/bare-prefix/pattern-violating names, missing/duplicate/non-GLB/misnamed files, missing or mistyped entry fields, extras overflowing the byte budget, plus 4 vocabulary-parity mutants: a converter key missing from the vocabulary (vault_low), a name outside core+converter, a dropped core name, a duplicate entry.PASS Extra clip vocabulary covers the conversion library (68 names = 23 core + 45 converter).docs/character-pack.md— vocabulary by group (68 names), entry fields, validation rules, and the single-source import requirement for the converter.Agent: Claude Code
Contract v3 — animation families (2026-11-09, third cycle)
Stacked commits
a2ec8ff,36557c0,0930753. The converter (PR #7,character-clips@2) now emits per characterstates.glb(11 states),loco.glb(45),combat.glb(14),ceremony.glb(7) andemotes/<key>.glb(one per emote); the contract now accepts that layout next to the old one-file-per-clip one:animations.<state>roles may share onestates.glb(clip names = state names) and severalanimations.extra.<name>roles may share one family-pack file (clip names = keys). One role kind per file: state and extra roles never mix, and neither takes a non-animation role on the side.family(loco|combat|ceremony|emote, schema enum) that must matchclipFamily— a mirror of the converter'spackFamily. Importingclip-pack.mjsis impossible here (that branch is stacked on this one), so the mirror is locked by a snapshot parity check: 83 names classified by the realpackFamily(2026-11-09), withemotes→emoteas the one vocabulary difference, plus a poisoned-mirror mutant. On rebase the converter should importclipFamily(andextraClipNames) fromtools/lib/character-pack.mjs— single source.EXT_meshopt_compressionlayout (buffer 0 = compressed stream in BIN + a virtual fallback buffer).readGlbgainsallowMeshoptFallbackfor animation reads, with compressed stream ranges bounds-checked; the model read stays strict (its skin bytes are read raw).Evidence:
npm run checkgreen;tools/checks/character-pack-check.mjsat 82 PASS — both layouts validate (incl. all 11 states in onestates.glband a meshopt-shaped family pack), strictreadGlbstill rejects the meshopt layout, and the new mutants are rejected for their stated reason: key missing inside the family pack, emote sharing a file (family or another emote), declared family mismatching the name, family outside the enum, one file mixing families, states pack missing a state clip, second buffer without the fallback marker, meshopt stream past the BIN chunk.Real-pack fixture (local, not committed — no GLB in this repo)
Built from the actual converter output (
local/anim-conv-20261109/legacy-out/capitao-caveira, modelrig-blender-20261109/v4, sha-verified against the converter manifest) with the v3 family layout: 14 files, 11 states + 74 extras (45 loco + 14 combat + 7 ceremony + 8 emotes,familydeclared on every key):Byte budget of a full pack — no raise needed
Measured full pack (capitao-caveira, all families + 1 preview): 4,596,362 bytes = model 3,051,460 + states 136,764 + loco/combat/ceremony 943,128 + emotes 208,600 + preview 256,410. Worst case across the rig pipeline outputs (largest model 4,495,584 + same 1,288,492 animation bytes + ~0.3 MB previews) ≈ 6.1 MB. Both current ceilings hold: the schema maximum
budgets.bytes ≤ 16,777,216(3.7× headroom over the fixture) and the 8,388,608 guidance indocs/character-pack.md(≥27% headroom at worst case). Proposal: keep the limits unchanged — 8,388,608 declared / 16,777,216 ceiling. Noraise character pack byte budgetcommit was added because nothing needs raising; if the owner prefers a raised explicit budget anyway, that is a one-line change on top.