Fix: Bot intake field mapping
The Signal bot's !bcw command emits flat camelCase fields, but the rt BehaviorAnalysis form expects nested snake_case structure. As a result, opening the analysis in /dashboard/analysis-frameworks/behavior/:id/view showed a nearly-empty form.
Changes
- Added
mapBotL1ToRt()converter infunctions/api/frameworks/behavior/intake.ts - Flat fields → nested objects:
location_context,behavior_settings,temporal_pattern eligibility: [{type, requirement}]→ typed buckets (age_requirements,legal_requirements,skill_requirements,resource_requirements,other_requirements)- Timeline event keys:
decisionType→decision_type, etc. - Audience candidate keys: camelCase → snake_case
- Free-text frequency mapped to closest enum, original preserved in
timing_notes - All enums filtered against rt accepted sets
- Sets
is_public=trueandtags=['signal-bot']for shareability
Verify
Trigger !bcw <behavior> in Signal, open the returned URL, confirm form fields populate.