feat(aitaskbuilder): support star_rating instruction type - #477
Open
Adam1451991B wants to merge 1 commit into
Open
feat(aitaskbuilder): support star_rating instruction type#477Adam1451991B wants to merge 1 commit into
Adam1451991B wants to merge 1 commit into
Conversation
Adds the star_rating AI Task Builder instruction type to the CLI so batches can include star-rating questions. Participants pick a rating from 1 to max_stars, where max_stars is an optional integer (1-10, defaults to 5 on the API). Covers the batch instructions command (help text, valid-types set, per-type validation of max_stars), the request/response payloads and models, response display in get task responses, the example instructions file, and the changelog. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
SeanAlexanderHarris
requested changes
Aug 3, 2026
| } | ||
|
|
||
| // Validate star rating fields for star_rating | ||
| if instruction.Type == client.InstructionTypeStarRating { |
Contributor
There was a problem hiding this comment.
comment: this kind of validation logic sits server side, we don't duplicate it in the client - the rule of thumb means we keep validation in one place and do risk it getting out of sync between server and different clients. Remove the validateStarRating related code.
| fmt.Fprintf(w, " Uploaded Files: \n") | ||
| } | ||
| case model.AITaskBuilderResponseTypeStarRating: | ||
| if len(resp.Response.Answer) > 0 && resp.Response.Answer[0].Value != "" { |
Contributor
There was a problem hiding this comment.
suggestion(non-blocking): make this a little more readable or add comments
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.
Context
AI Task Builder is gaining a star rating instruction type: a distinct question where participants pick a rating by clicking stars. It is being added end-to-end (backend schema + web client), and the CLI needs to accept and validate it so batches created via the CLI can include star-rating questions.
star_ratingtakes an optionalmax_starsinteger — the number of stars offered. It is1-10and defaults to5on the API when omitted (mirroring the backend schema), so CLI users can send{ "type": "star_rating", "created_by": "...", "description": "..." }with an optional"max_stars".What this changes
star_ratingas a valid instruction type inaitaskbuilder batch instructions(help text, valid-types set, error message).max_stars(must be 1-10 when provided; optional otherwise).max_starsto the request/response payloads and models, and a display case for star-rating answers inget task responses.Behaviour for all existing instruction types is unchanged.
Rollback
Pure additive change (a new enum member, an optional field, and a validation branch). If it misbehaves, revert the commit — no persisted state or migrations are involved. The API remains the source of truth for validation; the CLI check is a convenience that fails fast before the request is sent.