# U6 independent analytic verification

2026-10-01. Independently constructed equations and generated saved inputs;
existing XCTest fixtures were inspected but were not the numerical oracle.
No device recordings were available. Physical mounting/sign checks, independently
labeled real-session recomputation, matched raw/fused trials, and roughly 50 garage
transitions remain pending. This evidence makes no hardware-performance claim.

Reproduce: `python3 scripts/verify-analysis.py`. The script snapshots core sources,
compiles a separate executable with Xcode-beta into `/tmp`, saves/reloads generated
common-model JSON, and compares its outputs with Python equations. It neither runs
shared package builds nor changes production code/tests. Exit 1 means an oracle
failed; JSON report and source hashes appear in the printed artifact directory.

Frozen red run: `/tmp/rideform-u6-independent-mbxibs26/report.json`.
Its `source/` directory preserves the compiled source snapshot. The run passed
seven grouped checks and reproduced the following three failures.

## Findings

| Severity | Reproducer | Expected | Actual | Evidence |
|---|---|---|---|---|
| P1 | Create `alias` symlink to `master`, then call `analyzeAndSave(masterURL: master, sidecarURL: alias/inside.json)` when the final file is absent. | Throw `sidecarInsideMaster`; master contains only `input.json`. | Call succeeds and master gains `inside.json`. Resolving the absent final path does not resolve the existing symlink parent. | `safety.json` has `symlinkRejected: false`; `master/inside.json` exists. |
| P2 | Rectangular spectrum, grid 50 Hz, 100 actual samples at `i/50` seconds, lateral velocity `cos(πi)`, duration 1.98 s, cutoff 5 Hz. | Non-DC energy at 25 Hz lies within declared analyzed Nyquist 25 Hz; high-frequency ratio 1. | `zero_band_energy`: loop ends at `(n−1)/2`, omitting even-length Nyquist bin `n/2`. | `nyquist.json`; source snapshot `SmoothnessMetrics.swift`. |
| P2 | Segment begins at time 0 with lateral speed 0.4 rad/s and angle 0; continues to angle 0.4 at time 1 with no stable hold. | Preserve `truncated`, `no_stable_hold`, and `onset_at_segment_boundary`. | Flags contain only `truncated`, `no_stable_hold`; uncertainty that movement preceded the segment is lost. | `boundary-truncated.json`; source snapshot `TransitionDetector.swift`. |

All artifact paths in the table are relative to
`/tmp/rideform-u6-independent-mbxibs26/`. Its frozen source SHA256 values include:

- MotionAnalyzer.swift: `559b341c522dd45be4b8428903f91a585b28bf1a42efaa1393b78c3bb26f1f77`
- SmoothnessMetrics.swift: `ae6816490332df76859f4159ba66ed3d51ad6a86592b0447b0a59929c9e60c96`
- TransitionDetector.swift: `9114856e2fd492e3d63c5159ea4abb70cbe5b2368557bed6cfe0e213e12cde97`

## Passing independent expectations

- Saved irregular timestamps `[0,.04,.11,.19,.28,.36,.47,.58,.70]`, pure roll
  `−.2t³`, gyro `−.6t²`: displayed lateral angle `.2t³`, acceleration `−1.2t`,
  jerk `−1.2`; squared-jerk integral `1.44 × .7 = 1.008`, peak/RMS 1.2,
  normalized squared jerk 36. Absolute tolerance `1e−8`, including edge fits.
- Independent `Rz(.4) Ry(−.2) Rx(.3)` matrix agrees with displayed angles
  `[-.3,−.2,.4]` and transformation of gyro `[1,2,3]` and acceleration `[4,5,6]`.
- Piecewise motion at 0.025 s intervals yields outbound-left, linked return-left,
  outbound-right, onset `.8/2.5/4.2`, final dwell `1.8/3.5/5.2`, hold confirmation
  `.4` seconds later, and 1-second durations. An independently chosen `.48 → .35
  → .40` overshoot yields `.08` overshoot and two corrections `.13/.05` radians;
  later intentional return remains a distinct leg.
- Distribution `[1,2,4,8]`: mean 3.75, median 3, IQR 3.25, sample variance
  `115/12`. Left ranges `.2/.6` versus right `.2/.2`: left variance `.08`,
  normalized outbound asymmetry `2/3`; absent return groups retain zero counts
  and unavailable statistics. Filtering retains analytic velocity derivatives.
- Python `hashlib.sha256` of independently saved sorted-key input/config JSON
  equals sidecar identities. Reanalysis equals its first result, event changes
  alter input identity, direct master paths are rejected, and the ordinary
  external sidecar write preserves original master bytes. The symlink failure
  above prevents a general master-immutability conclusion.
- Independently recomputed mean-removed Hann DFT of 2 Hz plus 10 Hz motion agrees
  to `1e−10`; 0.1-second actual intervals yield explicit ineffective-bandwidth
  unavailability; segment-crossing jerk integration is explicitly unavailable.
  Direct crossings carry their flag, empty motion is explicit, and incomplete
  transitions retain unavailable duration, overshoot, and interval metrics.

These generated inputs verify formulas and state-machine behavior, not detector
accuracy on physical movements. The checker remains available for post-fix reruns;
this initial red receipt must remain attributable to the frozen snapshot.
