feat: extend firm voice-sample calibration to research answers - #53
Merged
Conversation
A firm's voice_sample (set once in Settings) already calibrated DraftAgent's advice memos and document_graph's letters, but the research/conversational answer path never consulted it - tone there came only from the bare business_type word in build_client_profile (e.g. "hospitality" vs "dental"), an emergent side effect rather than deliberate per-firm calibration. Confirmed via the accountant audit round three (#13): Elena's hospitality-persona answers read noticeably more plain-English than the dental/property equivalents. The demo seed data already has a well-differentiated voice_sample for every persona (dental, property, accounting, hospitality, construction) - none of it was reaching the research prompt. build_voice_steering wires it in with the exact literal instruction wording draft.py already uses, so a firm gets one consistent voice across research answers AND drafted documents, not two independently-tuned mechanisms. trace.firm.voice_applied and profile_summary now also reflect voice_sample, not just the (currently always-empty) firm_style jsonb. Settings page placeholder text updated to describe the broadened scope. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
Item #13 from the consolidated fix plan. Confirmed deliberate, existing infrastructure - fixed a coverage gap, not a design question.
A firm's
voice_sample(set once in Settings, already used byDraftAgent/document_graphto calibrate drafted advice memos and letters) was never consulted by the research/conversational answer path. Tone there came only from the barebusiness_typeword inbuild_client_profile- an emergent side effect, not deliberate per-firm calibration.This is what the accountant audit round three flagged as #13: Elena's hospitality-persona answers read noticeably more plain-English than the dental/property equivalents. The demo seed data already has a well-differentiated
voice_samplefor every persona - none of it was reaching the research prompt.build_voice_steeringwiresvoice_sampleinto the research path with the exact literal instruction wordingdraft.pyalready uses ("The firm describes its own voice like this - match this tone: ..."), so a firm gets one consistent voice across research answers AND drafted documents, not two independently-tuned mechanisms.Also updated:
trace.firm.voice_applied/profile_summarynow reflectvoice_sample, not just the (currently always-empty, for every real seeded persona)firm_stylejsonb.Verification
draft.py, trace fragment reflectingvoice_samplealone, and an end-to-end test confirming the sample reaches the actual generation call).tsc --noEmitandeslintclean.ResearchAgent._build_steering+_generatewith the hospitality persona's actual seededvoice_sample- confirmed the steering string is built correctly, the live answer reads in the direct/dollar-figure-up-front register the sample asks for, andbuild_firm_profile_fragmentcorrectly reportsvoice_applied: True.🤖 Generated with Claude Code