Skip to content

Refactor QualitativeInput to use raw JSON string#79

Merged
sanggggg merged 2 commits intomainfrom
claude/refactor-qualitative-input-01UVXEJ34mC5gVezmKcG6QKa
Nov 21, 2025
Merged

Refactor QualitativeInput to use raw JSON string#79
sanggggg merged 2 commits intomainfrom
claude/refactor-qualitative-input-01UVXEJ34mC5gVezmKcG6QKa

Conversation

@sanggggg
Copy link
Collaborator

Replace complex heuristic-based context extraction with a single raw JSON string containing the full chat session transcript with embedded tool uses.

Changes:

  • QualitativeInput now has a single raw_session field containing JSON
  • Added SessionTranscript, SessionTurn, and EmbeddedToolUse structs
  • Implement center-truncation for long tool content (2000 char threshold)
  • Updated collect_qualitative_data to build JSON transcript from messages
  • Updated build_qualitative_analysis_prompt to use raw session format
  • Updated fallback analysis to parse session stats from JSON
  • Updated TypeScript types for frontend compatibility

This provides the LLM with full conversation context including all tool operations, enabling more accurate qualitative analysis.

Replace complex heuristic-based context extraction with a single raw JSON
string containing the full chat session transcript with embedded tool uses.

Changes:
- QualitativeInput now has a single raw_session field containing JSON
- Added SessionTranscript, SessionTurn, and EmbeddedToolUse structs
- Implement center-truncation for long tool content (2000 char threshold)
- Updated collect_qualitative_data to build JSON transcript from messages
- Updated build_qualitative_analysis_prompt to use raw session format
- Updated fallback analysis to parse session stats from JSON
- Updated TypeScript types for frontend compatibility

This provides the LLM with full conversation context including all tool
operations, enabling more accurate qualitative analysis.
- Remove generate_quantitative_analysis_fallback and related scoring functions
- Remove generate_qualitative_analysis_fallback and SessionStats-based functions
- Remove generate_rubric_evaluation_fallback
- Update analytics_service to require AI client (error if unavailable)
- Update parse_qualitative_response to return Err instead of fallback data
- Clean up unused imports

Analysis now requires a valid AI client and propagates errors instead of
falling back to rule-based analysis.
@sanggggg sanggggg merged commit 7a86214 into main Nov 21, 2025
4 of 5 checks passed
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.

2 participants