Skip to content

fix(sdk): parse structured AI assessments#10

Open
TimeToBuildBob wants to merge 1 commit into
steveyegge:mainfrom
TimeToBuildBob:bob/vc-sdk-structured-assessment-6d55
Open

fix(sdk): parse structured AI assessments#10
TimeToBuildBob wants to merge 1 commit into
steveyegge:mainfrom
TimeToBuildBob:bob/vc-sdk-structured-assessment-6d55

Conversation

@TimeToBuildBob

Copy link
Copy Markdown

Summary

The SDKs AssessCode() and BatchAssessCode() return CodeAssessment with always-empty Issues and Recommendations fields, despite the model producing structured output. The SDK docs and example worker branch on these empty fields, encouraging dead control flow.

Changes

  1. internal/discovery/sdk/ai.go: Both AssessCode() and BatchAssessCode() now request raw JSON output and parse it using the existing internal/ai JSON parsing utilities.
  2. internal/discovery/sdk/ai_internal_test.go: New package-local tests covering direct JSON parsing, fenced JSON, batch snippet ID preservation, and malformed/missing/duplicate batch results.
  3. Richer CodeAssessment fields: Issues, Recommendations, and Confidence now come from real model output instead of empty placeholders.
  4. Batch mode now preserves per-snippet results instead of cloning one response text into every result.

Verification

go test ./internal/discovery/sdk

Closes #... (no issue opened for this, it was a scout finding)

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.

1 participant