feat: Clarify HITL inbox in Studio#6
Merged
Conversation
- core: ClarifyTicket.appendCandidate; HITLService.answerClarifyTicket refactored to options object with `customCandidate` and `note` paths. - server: AnswerBodySchema accepts customCandidate XOR candidateId with optional note; GET /clarify/:id projects answerNote / skipReason from the latest Decision so the detail pane needs one fetch. - studio: new Clarify page (list+detail, status filter via PageActions, sidebar pending badge), inline rationale anchored under the selected candidate (editable on pending, read-only on terminal states), "+ Add my own answer" inline form, "+ New question" modal, cross-tab focusProposal sweep across statuses. - tests: domain coverage for appendCandidate; service coverage for note + customCandidate; route coverage for XOR body schema and answerNote projection; helper unit tests for summarizeOps / formatOpsSummary / questionExcerpt / candidateLetter. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- server: CreateBodySchema accepts candidates with optional `id`; the route mints via newClarifyCandidateId when missing. Removes the client-side `crypto.randomUUID() as ClarifyCandidateId` cast that broke the "no inline brand cast" rule. - studio: summarizeOps / collectNodeIds switches gain the `never` sentinel so adding a 13th GraphOperation discriminant compile-errors here. - core: trim HITLService.answerClarifyTicket JSDoc to one paragraph per the project's comment convention. - tests: add route coverage for the server-mint candidate id path. Co-Authored-By: Claude Opus 4.7 (1M context) <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.
Summary
Closes the second HITL gate for Braid. Skills already emitted ClarifyTickets and the backend persisted them, but nothing in Studio consumed the SSE stream — pending tickets were a dead-letter queue. This PR ships the user-facing surface plus the missing answer-side flexibility.
PageActions, pending badge in sidebar + tab, cross-tabfocusProposalchip on applied tickets.+ Add my own answer):HITLService.answerClarifyTicketnow takes options includingselection: { kind: 'custom', description }; server appends the new candidate viaClarifyTicket.appendCandidateand marks it answered in one transaction. Follows the documented zero-ops resolution path (braid-clarifySKILL.md:151) so it interoperates with the existing skill.GET /clarify/:idsurfacesanswerNote/skipReasonderived from the latest matching Decision — keeps the detail pane single-fetch.