feat(sdk): add typed UI contracts - #600
Open
solvemproblr wants to merge 1 commit into
Open
Conversation
solvemproblr
marked this pull request as ready for review
August 19, 2026 22:22
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit f783e68. Configure here.
solvemproblr
force-pushed
the
asa/sdk-ui-contracts
branch
from
August 19, 2026 22:31
f783e68 to
0a5de2d
Compare
solvemproblr
force-pushed
the
asa/sdk-ui-contracts
branch
from
August 19, 2026 23:07
0a5de2d to
2c8dd0d
Compare
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.

Idea
Make the SDK the source of truth for platform-specific task argument editors and grader result renderers.
Issue
Environment authors currently hand-write
x-hud-hintJSON Schema metadata for supported argument editors. Grader rendering is inferred fromBashGrader/LLMJudgeGradernames or privateinfo._hudmetadata, so custom graders and name overrides lose the intended presentation.Solution
PromptArg,DataFileArg,DataFilesArg, andGradingArg.DataFileRefandGradingCriterionPydantic models and validate wire values into declared models.GraderKindtoSubScoreandEvaluationResult; stamp it fromGrader.grade()independently of display names.BashGraderasbashandLLMJudgeGraderasrubric.Impact
Environment code can import stable SDK types instead of duplicating UI metadata. Custom graders can opt into a supported renderer without adopting a built-in class name. A separate frontend change can consume the new
kindfield and remove the name/metadata fallback.Validation
ruff format --check hudruff check hudty checkon changed runtime modules1048 passed, 17 deselectedin the full available non-robot test suite84 passedThe three robot test modules could not be collected in this worktree because the optional
openpi_clientdependency is not installed.Note
Medium Risk
Changes task arg coercion on the server (behavior shift for some wire shapes) and extends the public grading wire format with
kind; both affect platform clients and environment authors but are backward-compatible defaults for existing graders.Overview
Introduces SDK types so task manifests and UIs can rely on stable contracts instead of hand-written
x-hud-hintmetadata and grader name heuristics.Task arguments: New
PromptArg,DataFileArg,DataFilesArg, andGradingArgannotations publish editor hints on the published JSON Schema;DataFileRefis the base model for file references. These types are re-exported fromhud.environment. The environment server now coerces wire args with Pydantic (validate_pythonfirst, thenvalidate_jsonfor legacy string payloads), so tasks receive validated models at runtime.Grading:
GraderKind(generic,bash,rubric) is added onSubScoreand stamped fromGrader.grade()independently of displayname. Built-in graders setbashandrubricrespectively. Grade frames on the wire includekindon each subscore node.Docs and tests cover manifest hints, end-to-end typed args, and kind serialization.
Reviewed by Cursor Bugbot for commit 2c8dd0d. Bugbot is set up for automated code reviews on this repo. Configure here.