Skip to content

Fail closed when timing.json stems are not JSON objects - #126

Merged
cursor[bot] merged 2 commits into
mainfrom
cursor/timing-stem-objects-2ccd
Sep 7, 2026
Merged

Fail closed when timing.json stems are not JSON objects#126
cursor[bot] merged 2 commits into
mainfrom
cursor/timing-stem-objects-2ccd

Conversation

@jmjava

@jmjava jmjava commented Sep 7, 2026

Copy link
Copy Markdown
Owner

Problem

load_bundle_timing already rejects corrupt JSON and a non-object root. Per-stem values were untyped.

A list, string, number, or null under a stem then:

  1. Compile / scene-spec-generate treated the stem as missing words (pace: none compiled as if timestamps had never been run).
  2. sync_audio_tail_waits_in_scenes called .get on a list and raised AttributeError.
  3. Wizard freshness treated a list stem as a present timestamps entry.

Change

Every present timing.json stem value must be a JSON object. Missing file is still {}. A present non-object stem raises TimestampError (timing.json['stem'] must be a JSON object, not …).

sync_audio_tail_waits_in_scenes skips a stem only when the payload is a dict without segments.

Tests

Local: ruff check src/ tests/ green; pytest tests/ 725 passed, 1 skipped; docgen benchmark meets src/docgen/benchmark_data/baseline.json (no --update-baseline).

  • load_bundle_timing / extract_all reject list and scalar stems without rewriting the file
  • linted_class_block_from_spec (pace: none) fails on a list stem
  • validate timing_sync, scene-asset checks, and wizard statuses surface the error
  • sync_audio_tail_waits_in_scenes raises SceneGenerationError instead of AttributeError

Out of scope

Open in Web Open in Cursor 

cursoragent and others added 2 commits September 7, 2026 22:47
load_bundle_timing only typed the JSON root, so a list or scalar under a
stem looked like missing words at compile and crashed sync_audio_tail_waits
with AttributeError. Reject non-object stem values with TimestampError.

Co-authored-by: jmjava <jmjava@gmail.com>
Co-authored-by: jmjava <jmjava@gmail.com>
@jmjava
jmjava marked this pull request as ready for review September 7, 2026 22:55
@cursor
cursor Bot merged commit a371114 into main Sep 7, 2026
6 checks passed
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.

2 participants