Reject test-only agent repairs
Some checks failed
CI / test (push) Has been cancelled

This commit is contained in:
2026-08-28 00:18:21 +02:00
parent 6463394e7a
commit e97cbd7698
6 changed files with 102 additions and 7 deletions

View File

@@ -91,6 +91,16 @@ For an unknown-column failure, compare every alias.column in the observed SQL wi
schema and identify the owning table before editing. Teach the exact ownership, join, grouping,
and real column names in semantics config, then add a reference SQL example for the reported
question shape. Never replace one missing column with an unverified synonym.
"""
placeholder_guidance = ''
if '__LAI_' in response:
placeholder_guidance = """
Privacy placeholder repair guidance:
Trace the actual answer path through AIService::generateDatabaseResponse, issued token
restoration, and ChatController's local fallback. A token can only be restored when it exists
in the exact token map returned by protect(); never test a made-up token against an unrelated
map. Cover model-invented or malformed __LAI_...__ output with an HTTP-backed AIService test
and verify the user receives a real local database-result fallback, not a raw placeholder.
"""
return f"""You are fixing failure report #{report.id} in the Laravel AI Chat repository.
@@ -131,6 +141,7 @@ Generated SQL, if relevant:
{sql or '[not available]'}
{tenant_scope}
{sql_semantics}
{placeholder_guidance}
Run focused tests while working. Leave the repository with the fix and regression test applied.
"""