Recover from malformed agent edits
Some checks failed
CI / test (push) Has been cancelled

This commit is contained in:
2026-08-28 12:58:09 +02:00
parent e97cbd7698
commit 441c598890
6 changed files with 172 additions and 4 deletions

View File

@@ -25,6 +25,9 @@ Repository ownership map:
- config/cockpit_semantics.php owns device and customer-database semantics.
- app/Services/AIService.php owns provider calls, pseudonymization boundaries, and response parsing.
- app/Services/TenantDatabaseService.php owns ERP/config/customer source selection and tenant metadata.
- Cross-database workflows are orchestrated in ChatController/TenantDatabaseService; one SQL query
cannot join tables exposed through different Laravel connections unless the tracked architecture
explicitly supports qualified access.
- app/Services/SQLValidatorService.php owns read-only SQL safety; do not weaken it to accept a fix.
- app/Http/Controllers/ChatController.php orchestrates routing, execution, answers, and diagnostics.
- app/Services/FailureTrackingService.php and FailureAutomationService.php own failure handoff.
@@ -44,6 +47,8 @@ Repair workflow:
8. Inspect the final diff for malformed edits, unrelated files, hardcoded report values, and tests
that pass without exercising the changed behavior. Before retrying an edit, reread the current
file and never leave conflict markers or partial methods behind.
9. PHP config files are executable code. Preserve brackets, commas, quotes, and array nesting; run
`php -l` on every changed PHP file before broader tests.
"""
@@ -91,6 +96,11 @@ 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.
When expected behavior names tables from multiple databases or connections, first inspect source
routing and existing staged-query workflows. Do not put an impossible cross-connection join only
in ERP semantics. Implement deterministic orchestration that resolves identifiers in one source
and passes only the required identifier into the next source, preserving tenant isolation.
"""
placeholder_guidance = ''
if '__LAI_' in response: