kboss/docs/superpowers/plans/2026-08-07-bilingual-inquiry-dictionary.md
2026-08-07 16:39:44 +08:00

1.5 KiB

Bilingual Inquiry Dictionary Implementation Plan

For agentic workers: REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (- [ ]) syntax for tracking.

Goal: Adapt inquiry search APIs to the bilingual dictionary value columns.

Architecture: Build independent Chinese and English dictionary maps from one query. Return separate language display fields in normal search results while reusing the Chinese map for the existing Excel export.

Tech Stack: DSPY Python endpoints, async DBPools/sor access, MySQL.


Task 1: Update inquiry result mapping

Files:

  • Modify: b/product/search_user_inquiry.dspy

  • Query dict_value_zh and dict_value_en.

  • Build separate Chinese and English maps.

  • Return *_name_zh and *_name_en for single-choice fields.

  • Return consult_direction_name_zh and consult_direction_name_en.

  • Keep Excel export mapped through Chinese values.

Task 2: Update dictionary search output

Files:

  • Modify: b/product/search_user_inquiry_dict.dspy

  • Replace select * with the explicit bilingual dictionary columns.

Task 3: Verify

Files:

  • Verify: b/product/search_user_inquiry.dspy

  • Verify: b/product/search_user_inquiry_dict.dspy

  • Confirm neither SQL query references the removed dict_value column.

  • Compile both DSPY function bodies.

  • Run IDE diagnostics and git diff --check.