Skip to content

feat: AI failure explanation (explainFailure)#8

Merged
tugkanboz merged 1 commit into
mainfrom
feature/ai-explain
Jun 2, 2026
Merged

feat: AI failure explanation (explainFailure)#8
tugkanboz merged 1 commit into
mainfrom
feature/ai-explain

Conversation

@tugkanboz

Copy link
Copy Markdown
Member

Closes #7.

When a test fails, optionally get a short, specific explanation and a suggested fix from an LLM. Advisory only, it runs after the failure and never changes pass or fail.

  • explainFailure(error, { response, request, provider, model }) returns a string.
  • Reuses the existing two-go/ai provider (fetch based, bring your own key).
  • Exported from two-go/ai and the main entry, with types, README, and CHANGELOG.

611 unit tests green (3 new, provider stubbed so no network), tsc clean, no em dashes.

Add explainFailure(error, { response, request }) to the two-go/ai layer. It
sends the failed assertion plus request/response context to an LLM and returns a
likely cause and a suggested fix. Advisory only, never changes pass or fail.
Reuses the existing provider, with types and stubbed unit tests.
@tugkanboz tugkanboz merged commit 60ab7c0 into main Jun 2, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AI failure explanation / triage

1 participant