feat(core): structured validation errors — code + path per issue (0.6.43)#73
Merged
Conversation
….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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.problemswas a flatstring[]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
SceneValidationErrornow carries.issues: ValidationIssue[]— each{ code, path, message }with a stable machinecode(unknown-blend,duplicate-node-id,unknown-timeline-label,bad-duration, …) and apathlocator (nodes.box,timeline.beat(in)[0],camera.zoom,audio.cues[0]).SceneLoadError.issues(read as a plain property to cross the scene's own bundled-core boundary, whereinstanceoffails) andreframe compile --json→{ ok:false, error, kind, issues? }.ValidationIssueexported from@reframe/coreandreframe-video/compile(the hand-authoredcompile-api.d.tsalso gainscheckDeterminism, 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 existingtoThrow(/…/)/toThrow(SceneValidationError)tests pass untouched — that's the back-compat proof — plus a new test snapshots a verbatim message.Verification
code/pathper problem, nested composition paths,loadScenecross-bundle.issues, byte-identity); typecheck cleanreframe compile --jsonon a bad scene →issues: [{code:"unknown-blend", path:"nodes.box", …}](verified end-to-end)Version → 0.6.43. Next in the A backlog: A-3 (
renderFrameAtexport), A-4 (unify the timing walks).🤖 Generated with Claude Code