Archon icon indicating copy to clipboard operation
Archon copied to clipboard

Backend Field Naming: Rename example_name to code_example_name for clarity

Open Wirasm opened this issue 3 months ago • 2 comments

Problem

The current backend uses as the field name for AI-generated code example titles, which causes confusion:

  1. Generic naming: is vague and doesn't clearly indicate it's for code examples
  2. Frontend confusion: The frontend has to map between , ]2;]1;, and fallback logic
  3. API clarity: API consumers need to understand that contains the AI-generated descriptive title

Current Implementation

Backend generates:

  • example_name: "Create and Use a Tool" (AI-generated descriptive title)
  • title: "Create and Use a Tool" (copies from example_name)

Logs show:

Generated code example summary - Name: 'Create and Use a Tool', Summary length: 251
Generated code example summary - Name: 'Create Custom Tool with Preparation', Summary length: 343

Proposed Solution

Rename example_namecode_example_name for clarity:

Files to update:

  • code_extraction_service.py (lines 1479, 1483, 1498)
  • code_storage_service.py (line 601)
  • Database schema/migration
  • TypeScript interfaces
  • API documentation

Benefits

  • ✅ Clear field naming that indicates purpose
  • ✅ Better API documentation
  • ✅ Reduced frontend confusion
  • ✅ More maintainable code

Impact

  • Database: Requires migration if data exists
  • Frontend: Simple TypeScript interface update
  • API: Update response mapping

Low risk change that significantly improves code clarity.

Wirasm avatar Sep 08 '25 11:09 Wirasm

even better might be code_example_title

Wirasm avatar Sep 08 '25 11:09 Wirasm

@claude analyze this issue and provide implementation guidance

thsconsult avatar Sep 08 '25 15:09 thsconsult