Skip to content

Commit 9f7e861

Browse files
committed
Merge origin/main into feat/fidelity-and-launch-prep
Reconcile this branch's fidelity/eval/MCP work with the Posecode rename and feature expansion that landed on main (65+ new examples, fingers rig, props, pins, reach-IK, travel/turn choreography). Resolution: - Ported posecode-eval (headless probe + invariant scorecard) onto main's rig: probe now mirrors the viewer's full root pipeline (yaw/travel → ground-lock → floor clamp); checks retargeted to main's pelvis:hinge semantics and real phase names; dropped bone-origin contact checks that don't hold under main's mesh-grounding. 361/361 checks across all 73 examples. - Re-extracted main's mesh-aware ground-lock into posecode-render/groundlock.ts (shared by viewer + eval); added Viewer.captureFrame(); playground exposes window.__posecodeViewer. - Made posecode-mcp publishable (esbuild bin bundle, server.json registry manifest, posecode.org permalinks). - README: playground link, render GIFs, eval/safety section. - Took main's version of all overlapping parser/renderer/spec files — main already implements the hinge + torso/abduction sign fixes under its own design, so this branch's earlier parser edits were dropped as superseded.
2 parents 299bed3 + 83dbd92 commit 9f7e861

172 files changed

Lines changed: 5083 additions & 1970 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ coverage/
55
.DS_Store
66
.vite/
77
.vercel
8+
.claude/worktrees/

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2026 Movit
3+
Copyright (c) 2026 Posecode
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 39 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
<h1 align="center">◆ Movit</h1>
1+
<h1 align="center">◆ Posecode</h1>
22

33
<p align="center"><b>Kinematic motion as text.</b> Mermaid gave LLMs a way to draw diagrams.<br/>
4-
Movit gives them a way to <i>show movement</i> — exercises, physiotherapy, posture —<br/>
4+
Posecode gives them a way to <i>show movement</i> — exercises, physiotherapy, posture —<br/>
55
as a tiny human-readable language that renders to an animated 3D figure in the browser.</p>
66

77
<p align="center">
8-
<a href="https://www.posecode.org/play"><b>▶ Live playground</b></a> ·
8+
<a href="https://posecode.org/play"><b>▶ Live playground</b></a> ·
99
<a href="spec/SPEC.md">Language spec</a> ·
1010
<a href="spec/examples">Examples</a> ·
11-
<a href="packages/movit-mcp">MCP server</a>
11+
<a href="packages/posecode-mcp">MCP server</a>
1212
</p>
1313

1414
<table align="center">
1515
<tr>
16-
<td align="center"><img src="docs/media/deadlift.gif" width="230" alt="Deadlift rendered from .movit text"/><br/><sub><code>hips: hinge 70</code> — deadlift</sub></td>
17-
<td align="center"><img src="docs/media/squat.gif" width="230" alt="Body-weight squat rendered from .movit text"/><br/><sub><code>knees: flex 95</code> — squat</sub></td>
18-
<td align="center"><img src="docs/media/lateral-raise.gif" width="230" alt="Lateral raise rendered from .movit text"/><br/><sub><code>shoulders: abduct 90</code> — lateral raise</sub></td>
16+
<td align="center"><img src="docs/media/deadlift.gif" width="230" alt="Deadlift rendered from .posecode text"/><br/><sub><code>pelvis: hinge</code> — deadlift</sub></td>
17+
<td align="center"><img src="docs/media/squat.gif" width="230" alt="Body-weight squat rendered from .posecode text"/><br/><sub><code>knees: flex 95</code> — squat</sub></td>
18+
<td align="center"><img src="docs/media/lateral-raise.gif" width="230" alt="Lateral raise rendered from .posecode text"/><br/><sub><code>shoulders: abduct 90</code> — lateral raise</sub></td>
1919
</tr>
2020
</table>
2121

@@ -29,16 +29,16 @@ descent") — it just has no syntax to express it that a renderer can read.
2929
Diffusion-based text-to-motion models exist, but they're heavy, expensive, and
3030
give you no fine control over the anatomical phases.
3131

32-
Movit takes the opposite, lightweight approach (see [the research](#background)):
32+
Posecode takes the opposite, lightweight approach (see [the research](#background)):
3333

34-
- The LLM writes a small **`.movit`** document — semantic phases, not 3D matrices.
34+
- The LLM writes a small **`.posecode`** document — semantic phases, not 3D matrices.
3535
- A **client-side** parser + Three.js renderer animates it. Generation is a
3636
fraction of a cent of text; rendering runs at 60fps on a phone.
3737
- Every angle is **hard-clamped to a healthy range of motion**, so a model
3838
hallucinating "knee flex 200°" can't produce an anatomically impossible joint.
3939

40-
```movit
41-
movit exercise "Body-weight squat"
40+
```posecode
41+
posecode exercise "Body-weight squat"
4242
rig humanoid
4343
pose start = standing
4444
@@ -61,72 +61,59 @@ movit exercise "Body-weight squat"
6161

6262
## Try it
6363

64-
**No install:** open the [live playground](https://www.posecode.org/play),
65-
pick an example, edit the text, watch the figure move. Hit **Copy LLM prompt**
66-
to get a system prompt that teaches ChatGPT/Claude to write Movit for you —
67-
or wire up the [MCP server](packages/movit-mcp) so your agent authors,
68-
validates, and renders movements natively.
69-
70-
**Locally:**
71-
7264
```bash
7365
npm install
7466
npm run dev # opens the playground (Vite) at http://localhost:5173
7567
npm test # parser + renderer + eval test suites
7668
npm run eval # fidelity scorecard: geometric invariants over every example
7769
```
7870

79-
## Examples
80-
81-
Fourteen ready-to-paste movements live in [`spec/examples`](spec/examples)
82-
squat, deadlift, push-up, biceps curl, lateral raise, forward fold, roll-down,
83-
chair pose, side bend, spinal twist, neck rotation, shoulder stretch, and two
84-
posture resets. A hip hinge is one line:
85-
86-
```movit
87-
step "Hinge down" 2s ease-in-out:
88-
hips: hinge 70 # closed-chain: torso tips over planted feet
89-
knees: flex 20
90-
ground-lock: feet
91-
cue "Push the hips back, chest up, flat back"
92-
```
71+
In the playground: pick an example, watch it animate, edit the text live, and
72+
hit **Copy LLM prompt** to get a system prompt that teaches ChatGPT/Claude to
73+
write Posecode for you — or wire up the [MCP server](packages/posecode-mcp) so
74+
your agent authors, validates, and renders movements natively.
9375

94-
## How Movit stays honest
76+
## How Posecode stays honest
9577

9678
Two safety layers ship with the language:
9779

9880
- **ROM clamping** — every angle is hard-clamped to healthy range-of-motion
99-
tables before rendering; a hallucinated `knee: flex 200` renders at 144°
100-
with a warning, never an impossible joint.
101-
- **Fidelity evals**[`movit-eval`](packages/movit-eval) re-runs the real
102-
parser → FK → ground-lock pipeline headlessly and scores geometric
103-
invariants ("a deadlift pitches the torso ≥ 55° with a flat back and
104-
vertical shins"). Every example must pass every invariant in CI.
81+
tables before rendering; a hallucinated `knee: flex 200` renders at its
82+
ceiling with a warning, never an impossible joint.
83+
- **Fidelity evals**[`posecode-eval`](packages/posecode-eval) re-runs the
84+
real parser → FK → ground-lock pipeline headlessly and scores geometric
85+
invariants ("a deadlift pitches the torso ≥ 50° with vertical shins"). Every
86+
example must pass every invariant in CI.
10587

10688
## Packages
10789

10890
| Package | What it does |
10991
| --- | --- |
110-
| [`movit-parser`](packages/movit-parser) | `.movit` text → validated, ROM-clamped IR. Pure TypeScript, framework-agnostic. |
111-
| [`movit-render`](packages/movit-render) | IR → animated low-poly mannequin (Three.js), forward kinematics + ground-lock CCD IK. |
112-
| [`movit-share`](packages/movit-share) | Encode a `.movit` doc to a URL-safe token so a movement travels as a link. Pure, dependency-free. |
113-
| [`movit-mcp`](packages/movit-mcp) | MCP server: lets an LLM agent author, ROM-validate, and get a render link for a movement — natively. |
114-
| [`movit-eval`](packages/movit-eval) | Fidelity harness: headless kinematic probing + biomechanical invariant scoring. |
115-
| [`movit-language`](packages/movit-language) | Editor smarts (completion, hover docs, diagnostics) shared by CodeMirror and the LSP. |
116-
| [`movit-lsp`](packages/movit-lsp) | Language Server Protocol server + [VS Code extension](editors/vscode). |
92+
| [`posecode-parser`](packages/posecode-parser) | `.posecode` text → validated, ROM-clamped IR. Pure TypeScript, framework-agnostic. |
93+
| [`posecode-render`](packages/posecode-render) | IR → animated low-poly mannequin (Three.js), forward kinematics + ground-lock CCD IK. |
94+
| [`posecode-share`](packages/posecode-share) | Encode a `.posecode` doc to a URL-safe token so a movement travels as a link. Pure, dependency-free. |
95+
| [`posecode-mcp`](packages/posecode-mcp) | MCP server: lets an LLM agent author, ROM-validate, and get a render link for a movement — natively. |
96+
| [`posecode-eval`](packages/posecode-eval) | Fidelity harness: headless kinematic probing + biomechanical invariant scoring. |
11797
| [`playground`](playground) | Live editor + 3D viewport + warnings + the LLM prompt + shareable links. |
11898

11999
The protocol and both libraries are **MIT-licensed** — the open core. See
120100
[`spec/SPEC.md`](spec/SPEC.md) for the full language and
121101
[`spec/llm-authoring.md`](spec/llm-authoring.md) for the authoring prompt.
102+
For where Posecode spreads fastest and the per-domain go-to-market plan, see
103+
[`docs/market-research.md`](docs/market-research.md); for the engine roadmap,
104+
[`ROADMAP.md`](ROADMAP.md).
122105

123106
## Scope (v0.1)
124107

125-
✅ Single-person fitness, stretching & posture · Mermaid-style DSL · ROM safety
126-
clamping · forward kinematics · ground-lock IK · live playground.
108+
✅ Single-person movement across fitness, physio, desk, dance, education & rehab ·
109+
Mermaid-style DSL · ROM safety clamping (authored **and IK-solved** angles) ·
110+
forward kinematics · ground-lock **and ROM-constrained reach-to-target IK** ·
111+
hip-hinge · lying/seated poses · scene props (chair/wall/bar) · a single-DOF
112+
hand rig · live playground.
127113

128-
⏳ Deferred: reach-IK, two-person / partner movements + collision detection,
129-
FBX/GLB export, hosted SaaS editor and the expert-verified motion marketplace.
114+
⏳ Deferred: two-person / partner movements + collision detection, deeper props
115+
(load, bands, rings), multi-joint fingers, FBX/GLB export, hosted SaaS editor and
116+
the expert-verified motion marketplace.
130117

131118
## Background
132119

@@ -136,6 +123,6 @@ specifies ROM-based safety constraints from clinical normative data, and lays
136123
out the open-core commercialization path. The spec cross-references its
137124
sections (§4 DSL, §5 biomechanics, §6 client rendering, §7 strategy).
138125

139-
> ⚠️ Movit's range-of-motion values are general literature data, not medical
126+
> ⚠️ Posecode's range-of-motion values are general literature data, not medical
140127
> advice. Consult a qualified professional for physiotherapy or exercise
141128
> prescription.

ROADMAP.md

Lines changed: 50 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# Movit — domains & roadmap
1+
# Posecode — domains & roadmap
22

3-
Movit's vision is broad: **describe any single-person movement as text and render it
3+
Posecode's vision is broad: **describe any single-person movement as text and render it
44
safely in 3D.** The *protocol* is general; the *current renderer* is deliberately
55
scoped (one figure, forward kinematics, ground-locked hands/feet, no props). This
6-
doc maps the domains Movit can serve, what already works, and what each remaining
6+
doc maps the domains Posecode can serve, what already works, and what each remaining
77
domain needs — so contributions land where they unlock the most.
88

9-
## Where Movit fits
9+
## Where Posecode fits
1010

1111
| Domain | Example uses | Status |
1212
| --- | --- | --- |
@@ -17,27 +17,44 @@ domain needs — so contributions land where they unlock the most.
1717
| **Fitness / strength** | Body-weight and free-form movement coaching | ✅ Core today (squat, curl, raise). Barbell/dumbbell/machine work needs props + grip. |
1818
| **Functional / elderly care** | Sit-to-stand, balance, gentle ROM, fall-prevention drills | 🟡 Partial — sit-to-stand works; reaching/balance need reach-IK + props. |
1919
| **Sports technique** | Golf swing, tennis serve, throwing, kicking | 🟡 Partial — needs trunk rotation fidelity, weight shift, and implements (club/racket/ball). |
20-
| **Dance / choreography** | Notating sequences, port de bras, simple phrases | 🟡 Simple gestures work; precise reach + partner work are future. |
20+
| **Dance / choreography** | Notating sequences, port de bras, phrases that turn & travel | ✅ Phrases, port de bras, pirouettes, and traveling combos (box-step, grapevine, chassé) work via `turn`/`travel`; partner work is future. |
2121
| **Martial arts** | Stances, strikes, basic forms | 🟡 Stances/strikes partly work; contact and weapons are future. |
22-
| **Sign language / gesture** | Finger-spelling, signs, expressive gesture | ⛔ Needs a hand/finger rig (the rig currently ends at the wrist). |
22+
| **Sign language / gesture** | Finger-spelling, signs, expressive gesture | 🟡 Partial — single-DOF finger curls render visibly (fist, pinch, wave, rough finger-spelling); exact sign language needs multi-joint fingers + wrist orientation. |
2323

2424
## Engine capabilities that widen the scope
2525

2626
These are the unlocks, roughly in order of leverage:
2727

28-
1. **Hip / waist hinge primitive** — today deadlift / forward-fold are faked as a
29-
spinal roll-down. A true hip hinge unlocks deadlift, row, good-morning, hinge-based
30-
yoga, and bending to interact with props.
31-
2. **Reach-IK (reach a world target)** — touch your toes, hand-to-opposite-knee,
32-
grab a bar, place a hand on a wall. Unlocks a huge share of physio, yoga, and any
33-
prop interaction.
34-
3. **Scene props with contact anchors** — objects the figure can stand on, sit on,
35-
hang from, or push against, plus ground-lock-style anchors to them.
36-
4. **Lying & seated base poses** — supine / prone / quadruped / seated starting poses
37-
(for floor yoga, mat Pilates, bed-based rehab, sit-to-stand on a real seat).
38-
5. **Hand / finger articulation** — grip and gesture (sign language, grasping props).
39-
6. **Two-person + collision** — partner stretches, assisted rehab, contact sports
40-
(already noted as deferred in the spec).
28+
1. ~~**Hip / waist hinge primitive**~~ — ✅ **shipped (v0.1).** `pelvis: hinge <deg>`
29+
tips the torso forward over the hips while the legs stay planted (the renderer
30+
counter-rotates the hips). Powers `deadlift`, `bent-over-row`, `good-morning`,
31+
and `bow`. Next: hinge with a loaded-bar prop.
32+
2. ~~**Reach-IK (reach a world target)**~~ — ✅ **shipped, now ROM-constrained.**
33+
`reach: <effector> <target>` drives a hand/foot to a body landmark, the
34+
`floor`, or a prop anchor via CCD. Powers `touch-toes`, `cross-body-reach`,
35+
`seated-forward-fold`, and prop grips. The solve clamps every chain joint
36+
into its Range-of-Motion box each iteration — solved angles obey the same
37+
hard limits as authored ones — and `hands` / `feet` reach or pin both sides
38+
in one line. Next: two-bone analytic solve for straighter elbows/knees.
39+
3. ~~**Scene props with contact anchors**~~ — ✅ **shipped (starter set).** `prop
40+
chair|wall|bar` adds a scene object with named anchors (`seat`, `wall`, `bar`).
41+
Powers `sit-to-stand`, `box-squat`, `wall-sit`, `dead-hang`, `hanging-knee-raise`.
42+
Next: more props (bench, rings, bands), load cues, anchor-aware ground-lock.
43+
4. ~~**Lying & seated base poses**~~ — ✅ **shipped.** `supine | prone | seated`
44+
start poses (grounded by a bounding-box drop). Powers `glute-bridge`,
45+
`dead-bug`, `cobra`, `seated-forward-fold`. Next: quadruped + chair-seated.
46+
5. ~~**Hand / finger articulation**~~ — ✅ **shipped (single-DOF).** Per-finger
47+
curl bones + `fingers` group. Powers `make-a-fist`, `pinch-grip`, `hand-wave`,
48+
`finger-spell-demo`. Next: multi-joint fingers for accurate sign language.
49+
6. ~~**Spatial choreography (turn & travel)**~~ — ✅ **shipped.** `turn: <deg>`
50+
rotates the figure's facing and `travel: <x> <z>` moves it across the floor,
51+
both absolute + carried across phases and returning home on the loop wrap.
52+
Powers `pirouette`, `box-step`, `grapevine`, `waltz-box`, `chasse`,
53+
`walk-cycle`, `quarter-turns` — pirouettes, traveling combos, and gait.
54+
Standing poses only. Next: footstep-locked travel (true gait), motion
55+
aliveness (velocity-continuous flow + weight shift).
56+
7. **Two-person + collision** — partner stretches, assisted rehab, contact sports
57+
(still deferred in the spec).
4158

4259
## Prop / equipment library (future)
4360

@@ -55,15 +72,23 @@ Each prop is a small scene object + an anchor type; movements then reference it
5572
| **Resistance band** | Band pull-aparts, banded rehab, mobility with tension |
5673
| **Dumbbell / barbell / kettlebell** | Loaded strength patterns (needs grip + load cues) |
5774
| **Ball (stability / medicine)** | Core work, balance, throws |
58-
| **Parallettes / dip station** | Dips, L-sits, push-up variations at height |
75+
| **Parallettes / dip station** | ✅ Dip bars shipped (`prop dip-bars` — triceps dips). Still future: L-sits, push-up variations at height |
5976
| **Foam roller** | Self-myofascial release, mobility drills |
6077

6178
## Current limitations (honest)
6279

63-
- One figure only; no props or external objects yet.
64-
- Forward kinematics + ground-locked hands/feet; **no reach-to-target IK**.
65-
- Hip/waist hinge is approximated by spinal flexion (so deadlift-class moves look
66-
like a roll-down — curate around this until the hinge primitive lands).
67-
- Rig ends at the wrist (no fingers) and the head (no facial articulation).
80+
- One figure only; partner work and collision are still deferred.
81+
- A **starter** prop set (chair / wall / bar / box / dip bars) — no bench,
82+
rings, bands, or loaded implements yet, and props sit at fixed default
83+
placements.
84+
- Props are visual + reach anchors (no physical sit/lean solve).
85+
- Fingers are **single-DOF** curls — good for grip and rough gesture, not exact
86+
sign language. The head has no facial articulation.
6887

6988
> Range-of-motion values are general literature data, not medical advice.
89+
90+
---
91+
92+
See [`docs/market-research.md`](docs/market-research.md) for where Posecode spreads
93+
fastest, the per-domain go-to-market briefs, and which engine unlock opens which
94+
locked domain.

0 commit comments

Comments
 (0)