Fix problemas detectados en evaluación: historial, prompting, artifacts

1. Task history preserva key_data estructurado (recordNums, sectionIds,
   moduleIds, pages) extraído de las tool executions reales — el modelo
   retiene contexto entre tasks sin re-consultar.

2. Coder system prompt mejorado: instrucciones explícitas sobre qué tool
   usar para cada operación (create_module vs create_or_update_record),
   consultar knowledge base antes de actuar, y reutilizar key_data del
   historial.

3. Eliminado artifact_memory y working_context del coder context_sections
   — ya no son necesarios con conversación real. Reduce acumulación de
   artifacts en el context.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jordan Diaz
2026-04-03 13:29:09 +00:00
parent 3aa7a463d0
commit 7bdb943e7f
3 changed files with 97 additions and 6 deletions

View File

@@ -398,6 +398,20 @@ class ContextEngine:
lines.append(f" Result: {summary}")
if facts:
lines.append(f" Facts: {'; '.join(facts[:5])}")
# Key structured data (recordNums, sectionIds, etc.)
key_data = entry.get("key_data", {})
if key_data:
kd_parts = []
for table, nums in key_data.get("tables", {}).items():
kd_parts.append(f"{table}: records {nums}")
for page, num in key_data.get("pages", {}).items():
kd_parts.append(f"page '{page}' = record {num}")
if key_data.get("sections"):
kd_parts.append(f"sections: {key_data['sections']}")
if key_data.get("modules"):
kd_parts.append(f"modules: {key_data['modules']}")
if kd_parts:
lines.append(f" Key data: {'; '.join(kd_parts)}")
review = entry.get("review", "")
if review:
lines.append(f" Review: {review[:100]}")