feat: FailSafe — structured failure memory and auto-clustering for SIA#29
Open
ayaelnakeb wants to merge 2 commits into
Open
feat: FailSafe — structured failure memory and auto-clustering for SIA#29ayaelnakeb wants to merge 2 commits into
ayaelnakeb wants to merge 2 commits into
Conversation
After each generation, automatically cluster failures from logs and results.json (format errors, zero-accuracy classes, regressions, strong classes) and inject the structured memory at the top of every feedback prompt. Prevents regressions and surfaces per-class failure signal that was invisible in the aggregate score. - orchestrator.py: _cluster_failures() + _update_structured_memory() - prompts.py: inject memory.md at top of feedback prompt - agent_impls/pydantic_ai.py: add list_dir tool + system_prompt for OpenAI
8RON8
approved these changes
Jun 12, 2026
8RON8
approved these changes
Jun 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
FailSafe adds generation-persistent structured failure memory to SIA's
feedback loop.
After each generation, automatically clusters failures from results.json
and stdout logs (format errors, zero-accuracy classes, regressions,
strong classes) and hard-injects them at the top of every feedback prompt
— replacing the passive context.md file pointer with actionable,
structured failure signal.
Results on LawBench (913 cases, 191 classes):
Files changed: orchestrator.py, prompts.py, agent_impls/pydantic_ai.py