Skip to content

feat(core): structured validation errors — code + path per issue (0.6.43)#73

Merged
kiyeonjeon21 merged 1 commit into
mainfrom
feat/structured-validation
Jun 20, 2026
Merged

feat(core): structured validation errors — code + path per issue (0.6.43)#73
kiyeonjeon21 merged 1 commit into
mainfrom
feat/structured-validation

Conversation

@kiyeonjeon21

Copy link
Copy Markdown
Owner

What

A-2 of the OSS floor-hardening backlog. Validation errors are the feedback loop for AI-generated scenes (and the surface a product UI uses to point at a broken node), but SceneValidationError.problems was a flat string[] with the location baked into prose — an agent can read it, a UI can't map it to a node, and neither can categorize failures.

How

  • SceneValidationError now carries .issues: ValidationIssue[] — each { code, path, message } with a stable machine code (unknown-blend, duplicate-node-id, unknown-timeline-label, bad-duration, …) and a path locator (nodes.box, timeline.beat(in)[0], camera.zoom, audio.cues[0]).
  • Propagated in-process: SceneLoadError.issues (read as a plain property to cross the scene's own bundled-core boundary, where instanceof fails) and reframe compile --json{ ok:false, error, kind, issues? }. ValidationIssue exported from @reframe/core and reframe-video/compile (the hand-authored compile-api.d.ts also gains checkDeterminism, which was missed in 0.6.42).

Back-compat (the key property)

Every message is byte-identical; .problems (string[]), .message, and the class identity are unchanged. The ~30 existing toThrow(/…/) / toThrow(SceneValidationError) tests pass untouched — that's the back-compat proof — plus a new test snapshots a verbatim message.

Verification

  • 400 tests pass (+5: structured code/path per problem, nested composition paths, loadScene cross-bundle .issues, byte-identity); typecheck clean
  • reframe compile --json on a bad scene → issues: [{code:"unknown-blend", path:"nodes.box", …}] (verified end-to-end)
  • Goldens unaffected (validation isn't on the render path)

Version → 0.6.43. Next in the A backlog: A-3 (renderFrameAt export), A-4 (unify the timing walks).

🤖 Generated with Claude Code

….43)

A-2 of the OSS floor-hardening backlog. Validation errors are the feedback loop
for AI-generated scenes and the surface a product UI points at a broken node, but
they were a flat string[] with the location baked into prose.

SceneValidationError now carries .issues: ValidationIssue[] — each problem is
{code, path, message} with a stable machine code (unknown-blend, duplicate-node-id,
unknown-timeline-label, bad-duration, …) and a path locator (nodes.box,
timeline.beat(in)[0], camera.zoom, audio.cues[0]). Propagated in-process via
SceneLoadError.issues (read as a plain property to cross the scene's bundled-core
boundary) and `reframe compile --json` ({ok:false,error,kind,issues?}).
ValidationIssue is exported from @reframe/core and reframe-video/compile (the
hand-authored compile-api.d.ts also picks up checkDeterminism, missed in 0.6.42).

Fully back-compat/additive: every message is byte-identical and .problems/.message
/the class are unchanged — the whole existing toThrow suite passes untouched.
Goldens unaffected (validation isn't on the render path).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@kiyeonjeon21 kiyeonjeon21 merged commit 4c36c5a into main Jun 20, 2026
1 check passed
@kiyeonjeon21 kiyeonjeon21 deleted the feat/structured-validation branch June 20, 2026 19:00
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.

1 participant