Skip to content

fix(annotator): reject invalid zero-dimension assets - #905

Merged
JArmandoAnaya merged 2 commits into
mainfrom
fix/877-zero-dimension-assets
Oct 9, 2026
Merged

JArmandoAnaya merged 2 commits into
mainfrom
fix/877-zero-dimension-assets

Conversation

@JArmandoAnaya

Copy link
Copy Markdown
Contributor

Fixes #877

Problem

AnnotationPage coerced a null asset width/height to 0 (?? 0), building a 0×0 editor frame that then reached browser suggestion preparation.

Change

  • parseAssetDescriptor requires positive whole-pixel dimensions.
  • AnnotationPage shows an ASSET_FRAME_INVALID error state (with retry) for an unmeasured or zero-sized asset instead of coercing.
  • BrowserSuggestionExecutor refuses a source smaller than 1×1 before the model runs (BROWSER_ASSET_FRAME_INVALID, with curated prose in REFUSAL_PROSE).
  • Server: a kernel test pins that Asset rejects zero/negative dimensions. The server's accept-unmeasured behavior in prompt bounds checking is documented and left unchanged.

Tests

New coverage for the parser, the page (unmeasured and 0×0), the executor, refusal prose, and the kernel Asset invariant. Touched suites, typecheck and lint pass locally.

Notes

  • UI-affecting: an invalid asset now replaces the workspace with an error state, so the annotator cannot navigate past it (only retry). Worth a look.

JArmandoAnaya and others added 2 commits October 9, 2026 01:24
parseAssetDescriptor now requires positive whole-pixel dimensions, the
annotation page shows an error instead of building a 0x0 frame from a
null width/height, and the browser suggestion executor refuses a source
whose frame is not at least 1x1.
@JArmandoAnaya
JArmandoAnaya merged commit e9da350 into main Oct 9, 2026
31 checks passed
@JArmandoAnaya
JArmandoAnaya deleted the fix/877-zero-dimension-assets branch October 9, 2026 08:42
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.

bug(annotator): reject invalid zero-dimension assets

1 participant