refactor: migrate story draft, import, and probe onto the skill runner - #75
Merged
Conversation
#69) Move the remaining single-shot AI flows onto rig and delete the legacy JSON-scraping pipeline. openai-go no longer appears in internal/server; rig is the only path to an LLM. - story draft: story-draft skill on the runner (read-only scope, one propose_card, per-flow token budget); flat response contract unchanged - import preview: import-transform skill; propose_card gains an optional source field so drafts map back to numbered forge issues; provenance, authorization, and link-stripping invariants unchanged; a transform cut short by the iteration cap is reported in the response note; duplicate source numbers can no longer share one external key - drift summary: tool-less single-iteration rig run, still exactly one bounded upstream request, still degrades to empty on failure - probe: rig ProbeToolCalling with the same status mapping (400 no tool calling, 422 truncated, opaque 502) - runSkill takes a per-flow max token budget, clamped to the ceiling - deleted: chat, chatCompletion, sdkMessages, aiSDKOptions, response-body middleware, decodeJSONObject, coerceDraft(s), per-feature system prompts, aiBudget, probe plumbing
|
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.



Completes the rig migration started in #74: story draft, import preview, drift, and the probe now run on the skill runner, and the legacy single-shot JSON pipeline is deleted.
internal/serverhas zero openai-go imports — rig is the only path to an LLM.What changed
POST /api/ai/story): runs the newstory-draftskill (read-only tool scope, onepropose_card, 4096-token budget). The flatStoryDraftresponse and all error codes are unchanged — the frozen UI needs no changes.POST /api/import/preview): runs the newimport-transformskill.propose_cardgained an optionalsourceinteger so drafts map back to numbered forge issues; theSource Npacking, provenance attachment,issues[:sourceCount]authorization invariant, and model-inventedlink::stripping are all preserved. New: a transform cut short by the iteration cap is surfaced in the existingnotefield instead of silently truncating, and duplicate source numbers can no longer claim the same external key (pre-existing defect, fixed in passing).""on any failure.POST /api/ai/test):rig.ProbeToolCallingwith the same user-visible mapping (400 "model must support tool calling", 422 truncated, opaque 502). A reasoning model that burns the probe budget now correctly gets the truncation error.runSkilltakes a per-flow token budget, clamped to the 8192 ceiling.chat,chatCompletion,sdkMessages,aiSDKOptions, the response-body middleware,decodeJSONObject/thinkBlockRe,coerceDraft/coerceDrafts, the per-feature system prompts (now skill files),aiBudget, and the probe plumbing. Net −843 lines against +857 (most additions are skill files and runner-path tests).Testing
ErrNoToolCallingon the probe path — a distinct sentinel belongs in rig v0.2.0.Closes #69.