Skip to content

Allow a one-keyframe BurnsPath on the wire (minItems 1) - #28

Merged
thorwhalen merged 3 commits into
mainfrom
fix/19-single-keyframe-wire
Oct 13, 2026
Merged

thorwhalen merged 3 commits into
mainfrom
fix/19-single-keyframe-wire

Conversation

@thorwhalen

@thorwhalen thorwhalen commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #19.

Decision: relax the schema to minItems: 1; Python is right. Python's BurnsPath, the TS BurnsPath class and evaluate() on both sides already accept one keyframe (both clamp branches return kfs[0]), and BurnsPath's docs call N keyframes the strict generalisation. Only the zod valueSchema (and so the generated JSON Schema) said 2. Making Python require 2 would break any caller constructing a one-keyframe path directly; relaxing the schema breaks nobody.

  • ts/src/component/schema.ts: .min(2) becomes .min(1); ts/schemas/burns-path.schema.json regenerated with pnpm schema (one-line diff).
  • Golden vectors: new single_keyframe path (generator misc/gen_golden_vectors.py; fixture diff is additive only). Both suites already evaluate every vector.
  • Cross-language checks (the repo had none for the schema): tests/test_wire_schema.py validates every golden path and a one-keyframe path against the committed JSON Schema (skipped without jsonschema); ts/test/wire-schema.test.ts validates every golden path through zod, pins 1-ok / 0-rejected, and fails if ts/schemas/*.json drifts from the zod source.
  • Stale docs fixed (moves.py hold docstring, test_moves.py, path.py). Built-in moves still emit the canonical two keyframes.

Version bump: none needed. The change only widens what the wire format accepts, so every existing document stays valid, and the schema's version const stays 1. The package version is bumped by CI on merge.

Found on the way, filed separately: zod also rejects out-of-image keyframe rects that Python accepts on purpose (clamp_ride_the_wall), same shape as this issue: #27. The new TS test skips that one vector with a pointer.

Tests: full Python suite 256 passed; TS 137 passed; tsc --noEmit clean.

Adversarial review (fresh Opus subagent): PASS. Confirmed relaxing is right (every old document stays valid), ran a one-keyframe path through Python evaluate/reversed/round-trip, both render backends and the TS class, and checked the new tests fail against main. One confirmed gap, fixed here: jsonschema was not installed in CI, so test_wire_schema.py was silently skipped. It is now in the dev extra and [tool.wads.ci.install] extras = "dev" installs it; the CI run shows the test collected and passing (297 collected, none skipped).

🤖 Generated with Claude Code

thorwhalen and others added 3 commits October 13, 2026 06:14
…s languages (#19)

Python, the TS BurnsPath class and evaluate() all accept one keyframe; only the
generated JSON Schema said 2. Relax the zod source and regenerate the schema,
add a single_keyframe golden vector, and add schema-conformance tests on both
sides (every golden path validates; committed schema matches the zod source).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…f skipping (#19)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@thorwhalen
thorwhalen merged commit 2d078b4 into main Oct 13, 2026
17 checks passed
@thorwhalen
thorwhalen deleted the fix/19-single-keyframe-wire branch October 13, 2026 06:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The TS BurnsPath schema requires 2 keyframes; Python accepts 1

1 participant