Skip to content

feat: extend firm voice-sample calibration to research answers - #53

Merged
crewcricle merged 1 commit into
mainfrom
fix/tone-calibration-coverage
Aug 8, 2026
Merged

feat: extend firm voice-sample calibration to research answers#53
crewcricle merged 1 commit into
mainfrom
fix/tone-calibration-coverage

Conversation

@rprabhat

@rprabhat rprabhat commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator

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 by DraftAgent/document_graph to calibrate drafted advice memos and letters) was never consulted by the research/conversational answer path. Tone there came only from the bare business_type word in build_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_sample for every persona - none of it was reaching the research prompt.

build_voice_steering wires voice_sample into the research path with the exact literal instruction wording draft.py already 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_summary now reflect voice_sample, not just the (currently always-empty, for every real seeded persona) firm_style jsonb.
  • Settings page placeholder copy broadened from "calibrates drafted advice memos and letters" to include research answers.

Verification

  • Backend: 844 tests pass (6 new - steering string construction, wording parity with draft.py, trace fragment reflecting voice_sample alone, and an end-to-end test confirming the sample reaches the actual generation call).
  • tsc --noEmit and eslint clean.
  • Live-verified: ran a real generation call through ResearchAgent._build_steering + _generate with the hospitality persona's actual seeded voice_sample - confirmed the steering string is built correctly, the live answer reads in the direct/dollar-figure-up-front register the sample asks for, and build_firm_profile_fragment correctly reports voice_applied: True.

🤖 Generated with Claude Code

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>
@vercel

vercel Bot commented Aug 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
taxflow-dashboard Ready Ready Preview Aug 8, 2026 8:12am

@crewcricle
crewcricle merged commit fc19ef0 into main Aug 8, 2026
7 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