# Measurement contract - v7.0-rules2

## Geometry, not a clinical instrument

Input is MediaPipe's image-coordinate landmarks and visibility estimates. x distances
are corrected for video aspect ratio. v7 does not convert this into force, joint loading,
power, calories, fatigue, stability diagnosis or a neurological score.

- Elbow angle: the angle at the elbow formed by shoulder, elbow and wrist, in the image
  plane. Each of the three landmarks must be visible/in frame at confidence >=0.55.
- Knee angle: hip-knee-ankle image-plane angle, reported only in full-body mode.
- Shoulder tilt: absolute angle of the shoulder line to the image horizontal.
- Trunk tilt: shoulder midpoint to hip midpoint relative to image vertical; N/A in upper.
- Hand speed: change in wrist position relative to its shoulder, divided by calibrated
  shoulder width and elapsed time. Unit SW/s, not metres/second. N/A if the frame gap is
  outside 12-350ms or either required frame/joint is missing.
- Tracking quality: mean visible-landmark confidence percentage for mode-required joints.
  This is not movement quality, technique quality or a probability of correct diagnosis.
- Pose FPS and inference ms: processing indicators; not fitness outcomes.

A screenshot does not reveal anatomical 3D angles accurately. Camera perspective,
occlusion, lighting, motion blur, frame rate, clothing, device and body proportions affect
results. The observed P10-P90 spread is not anatomical range of motion, joint mobility,
clinical symmetry, balance or sporting ability. Upper/half modes never invent knee values.

## Motion rules

Punch: starts armed with a bent elbow (<138 degrees); a subsequent observed extension
(>149 degrees, increasing >5 degrees), wrist speed and outward displacement trigger it.
Retraction is needed for another punch. The threshold is a prototype rule to be tuned,
not a normative technique standard. A single front camera may miss depth-oriented punches.

High/low blocks: wrist enters a shoulder-relative zone with an elbow still bent and
position change. Static held hands do not continuously earn new block events.
High/low lock SHAPES: hands close together (<0.46 shoulder widths), upper/lower zone,
held for >=500ms. This does not prove gripping, a joint lock or safe technique.
Dodge: permitted mode, shoulder and head move laterally; return releases the latch.
Lower: only standing modes; shoulders and head lower from baseline.
Knee lift: full mode, visible legs, knee rises relative to baseline. Not kick force.

## Hands-free state machine

The camera permission prompt still requires browser-controlled user consent. Once the
body baseline is locked, `Thumb_Up` at confidence >=0.78, uninterrupted for 1100ms with
required pose framing, starts a 5s countdown. Wrong gestures, low confidence, missing
body or frame gaps >450ms interrupt that hold. A latch prevents repeated transitions.
Countdown pauses if the body leaves frame. Calibration is retained unless explicitly
reset or camera orientation/device changes. A manual countdown is always available.
Thumb recognition is active for readiness / resume, not a combat move.

## Task timing and accuracy

A trial is a game-specific event. Accuracy is correct evaluated trials / evaluated trials,
not a global sports-science index. Different games have different trial definitions.
Response time runs from a game's visible cue state to detected completed response. It
includes movement execution, sampling, inference, rendering and browser latency. It is
not isolated neural/simple reaction time and should not be compared with lab norms.
Valid timed responses >=100ms enter medians; this is only an anticipation guard, not a
physiological diagnosis. Continuous-control games have no invented reaction-time score.
Rhythm records absolute beat error, not response latency. No-Go correct rejections have
no latency. A missed response does not become a zero-millisecond response.

## Qualification and comparison

A session is eligible for local XP/progress only if it is camera input, completes its
requested active duration (120ms tolerance), has at least 3 evaluated trials and at least
65% usable tracking during observed, unpaused time. Active time freezes on tracking loss.
Short sessions and poor tracking are visible as PARTIAL, not discarded or falsely compared.
The thresholds are prototype product choices. They are not clinical or age norms.

Comparisons require identical participant key, game, body mode, difficulty, requested
duration, hands/body control, shape option, protocol version and recorded device class /
video dimensions and starting arena aspect ratio. This reduces mixing, but it does not fully equalise camera latency,
lighting, hardware identity or training conditions. Cross-device comparisons need a
more complete calibration study. There is no automatic claim of improvement.

## Stored data and reports

The application stores nickname/ID/demo-cohort, tutorial completion, session configuration,
evaluated events, aggregate 2D distributions and an optional self-reported effort choice.
Raw video, ImageBitmap frames and raw landmarks are not saved in localStorage. Trial
side fields mean detected anatomical hand side; display mirroring is a separate choice.

The companion's praise and XP are game feedback, not scientific endorsement. Next-target
text is generated by transparent rules, not an LLM. Demo sessions never create saved
performance or practice records and never earn XP. Artificial QA inputs are explicitly
labelled in test documentation/previews and are not research participants.

The independent storage key is `wiraplay_v7_sports_lab`. v6 keys are never overwritten.
Storage is browser-local, not encrypted per user, not cloud-backed and not secure cohort
access control. Export regularly. A production service requires authenticated roles,
guardian relationships, server validation, retention/deletion controls and audit logs.
