Universal CSV Importer #70
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "develop"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
**Remaining Issues Found:** 1. Validierung prüfte noch prompt_id → Speichern blockiert 2. AnalysisNode zeigte noch prompt_id → "Kein Prompt" obwohl gesetzt 3. Deserializer hatte keinen Fallback für alte Workflows **Fixes:** - workflowValidation.js: Line 91 - if (!node.data.prompt_slug) statt prompt_id - AnalysisNode.jsx: Line 15 - Verwendet jetzt data.prompt_slug - Fallback: "Prompt: ${slug}" statt "Prompt #${id}" - Kommentar aktualisiert (data.prompt_slug statt prompt_id) - workflowSerializer.js: Line 81 - Fallback: node.prompt_slug || node.prompt_id || null - Backwards-compatible für alte Workflows **Testing:** 1. Neuen Workflow erstellen 2. Analysis Node hinzufügen 3. Prompt auswählen 4. Node sollte Prompt-Namen zeigen 5. Beim Öffnen: Dropdown sollte Wert anzeigen 6. Speichern sollte funktionieren (keine Validierungsfehler) 7. Execute sollte funktionieren (kein "Prompt not found") Part 2 Complete Bugfix - Workflow Execution Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>Backend: - Moved /placeholders endpoint BEFORE /{prompt_id} catch-all - Prevents "placeholders" being parsed as UUID parameter - Fixes 500 Internal Server Error preventing placeholder loading Frontend: - PlaceholderPicker can now load ~120+ system placeholders Root Cause: - FastAPI matches routes in order - Generic /{prompt_id} was catching /placeholders first - psycopg2 error: invalid input syntax for type uuid: "placeholders" Version: 0.9p (workflow module) Part 3: End Node Template Engine Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>Root Cause: - Frontend serialized as "questions" - Backend expected "question_augmentations" - Analysis Nodes WITH questions configured sent empty array to backend - Questions were never added to LLM prompt Frontend workflowSerializer.js: - Serialization: questions → question_augmentations (Backend field name) - Deserialization: question_augmentations → questions (Frontend data object) - Backward compatible: Falls back to "questions" for old workflows Backend workflow_executor.py: - Removed incorrect load_prompt_questions() function (was a misunderstanding) - Back to original logic: Only use node.question_augmentations - Simplified normalization logging Impact: - Analysis Node questions are now correctly sent to backend - Questions augment the base prompt as intended - LLM receives structured questions - Decision signals are generated and accessible as placeholders Example: - Node configures question with id="q21" - Signal becomes accessible as {{ node_2.signal_q21 }} - Can be used in Logic Nodes and End Node templates Issue: Workflow questions not sent to LLM (field name mismatch) Version: 0.9p (workflow module) Part 3: End Node Template Engine - Critical Fix Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>Three major improvements for workflow templates: 1. **Normalized Signal Placeholders:** - Signals now available as {{ node_4.signal_kalorienbilanz }} - Uses normalized_value (not raw decision_signals) - Enables structured decision-based outputs 2. **Question Text Placeholders:** - Question texts available as {{ node_4.question_kalorienbilanz }} - Extracted from workflow graph (question_augmentations) - Allows displaying questions alongside answers 3. **Clean End Node Output:** - End Node output no longer duplicated with "## node_4" headers - aggregate_results() detects End Nodes via graph.nodes - Only shows final template-rendered output - Backward compatible: Falls back to combined_analysis if no End Node Backend workflow_executor.py: - execute_end_node(): Added normalized signals to template context - execute_end_node(): Added question texts to template context - execute_workflow(): Added graph to context for End Node access - aggregate_results(): Signature change to accept graph - aggregate_results(): Detects End Nodes and uses only their output Frontend WorkflowResultViewer.jsx: - Now uses aggregated.analysis_core (primary output) - Removed fallback to combined_analysis (was showing duplicates) Example Template: ```jinja2 **Frage:** {{ node_4.question_kalorienbilanz }} **Antwort:** {{ node_4.signal_kalorienbilanz }} --- {{ node_4.analysis_core }} ``` Issue: Signal placeholders empty, question texts unavailable, duplicate output Version: 0.9p (workflow module) Part 3: End Node Template Engine - Complete Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>Root Cause: - PlaceholderPicker used q.id for signal placeholders - Backend template context used question_type - Placeholders never matched → empty values Frontend PlaceholderPicker.jsx: - Changed signal_${q.id} → signal_${q.type} (matches backend) - Added question_${q.type} placeholders (question texts) - New category: "Workflow - Questions" Backend workflow_executor.py: - Added extensive debug logging for template context - Logs all signal_* and question_* keys + values - Helps diagnose template rendering issues Example: - Question configured with type="kalorienbilanz" - Frontend now shows: {{ node_4.signal_kalorienbilanz }} - Frontend now shows: {{ node_4.question_kalorienbilanz }} - Backend creates: template_context['node_4']['signal_kalorienbilanz'] - Should match and render correctly Issue: Signal placeholders show empty values Version: 0.9p (workflow module) Part 3: End Node Template Engine - Field Name Fix Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>Frontend PlaceholderPicker.jsx: - Placeholder descriptions now include question ID (q.id) - Format: "NodeLabel (q21) - Signal type: Question text" - Makes it easier to identify which question a placeholder belongs to Example: Before: "Analysis 4 - Signal: Wie ist die Kalorienbilanz?" After: "Analysis 4 (q21) - Signal kalorienbilanz: Wie ist die Kalorienbilanz?" Shows: - Node label: "Analysis 4" - Question ID: "(q21)" ← User-assigned ID - Question type: "kalorienbilanz" ← Used in placeholder - Question text: "Wie ist..." Placeholder stays: {{ node_4.signal_kalorienbilanz }} But description shows q21 for better identification Version: 0.9p (workflow module) Part 3: End Node Template Engine - UX Improvement Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>Root Cause: - Multiple questions with same type (e.g. "unsicherheit") created duplicate placeholders - {{ node_4.signal_unsicherheit }} could refer to q21 OR q22 - Later signal overwrote earlier one in template context Solution: - Placeholders now use question ID: {{ node_4.signal_q21 }} - Unique even with multiple questions of same type Frontend PlaceholderPicker.jsx: - Changed placeholder: signal_${questionType} → signal_${questionId} - Changed placeholder: question_${questionType} → question_${questionId} - Description shows both: "q21 (unsicherheit): Question text" Backend workflow_executor.py: - Build question_type → question_id mapping from graph - Map normalized_signals (by type) to question IDs - Handles duplicate types with index tracking - Creates signal_${id} and question_${id} in template context Example: Questions configured: - q21: type="unsicherheit", question="Ist Protein unsicher?" - q22: type="unsicherheit", question="Ist Energie unsicher?" Placeholders generated: - {{ node_4.signal_q21 }} → "nein" - {{ node_4.signal_q22 }} → "ja" - {{ node_4.question_q21 }} → "Ist Protein unsicher?" - {{ node_4.question_q22 }} → "Ist Energie unsicher?" Issue: Duplicate question types cause placeholder conflicts Version: 0.9p (workflow module) Part 3: End Node Template Engine - CRITICAL FIX Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>ROOT ARCHITECTURAL CHANGE: Multiple questions with same type are now supported! Problem: - question_augmenter used q.type as LLM key - If two questions had type="unsicherheit": - LLM saw duplicate keys: "- unsicherheit: [ja/nein]" - Could only answer one - Signals were ambiguous Solution: - Use question.id as LLM key (unique by design) - Keep type for normalization logic - Map id → type internally Backend question_augmenter.py: - format_question_list() now uses q.id as key - Format: "- **q21**: [ja/nein] # Question text" - Question text as comment for LLM context Backend workflow_executor.py: - Removed type→id mapping (no longer needed) - decision_signals now keyed by id (from LLM) - Build id→type catalog for normalization - NormalizedSignal.question_type stores id (not type!) - End Node template: signal_{id} directly available Flow: 1. Questions sent to LLM: "- q21: [ja/nein] # Ist Protein unsicher?" 2. LLM answers: "- q21: nein" 3. Normalization: id→type lookup for spectrum/rules 4. Template: {{ node_4.signal_q21 }} = "nein" Example (TWO unsicherheit questions): Questions: - q21: type=unsicherheit, question="Ist Protein unsicher?" - q22: type=unsicherheit, question="Ist Energie unsicher?" LLM Prompt: ``` ## Entscheidungsfragen - **q21**: [ja/nein] # Ist Protein unsicher? - **q22**: [ja/nein] # Ist Energie unsicher? ``` LLM Response: ``` - q21: nein - q22: ja ``` Template: ``` {{ node_4.signal_q21 }} → "nein" {{ node_4.signal_q22 }} → "ja" ``` BREAKING CHANGE: - Old workflows with decision_signals keyed by type will break - Need to re-execute workflows after update Issue: Cannot have multiple questions with same type Version: 0.9p (workflow module) Part 3: End Node Template Engine - ARCHITECTURAL FIX Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>Root Cause: - Tried to import normalize_signal_value from normalization_engine - Function does not exist (only normalize_decision_signal) - Caused 500 Internal Server Error on workflow execution Backend workflow_executor.py: - Changed import: normalize_signal_value → normalize_decision_signal - normalize_decision_signal returns NormalizedSignal (not dict) - Use returned object directly (no .get() calls) - Simplified logic Fix: ```python # BEFORE (broken): normalized = normalize_signal_value(...) normalized_signals.append(NormalizedSignal(..., normalized.get('status'))) # AFTER (working): normalized_signal = normalize_decision_signal(...) normalized_signals.append(normalized_signal) ``` Issue: 500 Internal Server Error on workflow execution Version: 0.9p (workflow module) Part 3: End Node Template Engine - Import Fix Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>