Структурированная сводка для этой задачи не записана. Показан сохранённый результат без изменений.
Итог
I made the code fixes, regression tests and docs/e2e/SAAS-050-REPORT.md. I did not prove which single cause produced the 11 failures. The production DB and logs are unreadable from this environment, because the data directory is owned by iovon-saas and I have no sudo. Nothing is deployed, no Builder ran, and I made no provider calls, so I did no live UI test.
What the evidence says about the cause
- Spend cap: the $2.00 cap isn't a good fit. The failures were content-dependent: the same text failed 4–5 times, then a shorter message worked. A full ledger would have failed everything after it.
- Provider flakiness: weak fit for the same reason, since random errors wouldn't track specific wording.
- Most likely cause: I suspect Pete answered in plain prose for those turns, for example declining real magazine quotes. Both the parse and the single repair call then failed. This is a hypothesis.
- Duplicates: resending after a failure stored the same customer message twice, as both page-text files show.
The report has the read-only SQL for an operator to confirm. The deployed code already records the response class, finish reason, token counts and raw text for these failures.
Fixes
- Failure categories: each failed job now stores a secret-free category (transport, spend cap, credential, truncated, malformed and so on). The UI shows a short reason.
- Retry: transient errors only (network, timeout, HTTP 408/429/5xx) retry automatically, at most twice, after 20 s then 60 s. They reuse the same job and message, so no duplicate is created. Spend cap, truncation and malformed output are never auto-retried.
- Resend: sending the same text again after a failed turn retries that message instead of storing it twice. Different text, or a repeat after Pete has answered, is stored normally.
- Prose answers: if Pete answers in prose and the repair fails, his answer is shown and the saved spec stays unchanged. The turn is marked out of date, and this takes at most 2 calls.
- Stale spec: approval is refused when the latest turn failed or only got a prose reply. The Approve button is disabled in that state and while Pete is working.
- Spending: the spend cap and ledger behaviour are unchanged.
Tests
- The new
tests/architect-reliability-regression.php (24 checks) passes. - The repair, multilingual, builder-handoff, chat-mobile, builder-resilience, saas-041, saas-042 and workflow-ui tests pass.
php -l and git diff --check are clean. - I edited one existing case in
tests/architect-repair-regression.php, because plain prose is now deliberately kept as a reply. tests/architect-diagnostics-regression.php fails at line 53 even on a clean checkout. Commit 3c3d736 turned raw-response retention on and that test still expects it off.
The report also has the deployment steps for an operator. Changes are uncommitted in the workspace.