feat(scak): port production Self-Correcting Agent Kernel from internal#65
Merged
imran-siddique merged 1 commit intomainfrom Mar 7, 2026
Merged
feat(scak): port production Self-Correcting Agent Kernel from internal#65imran-siddique merged 1 commit intomainfrom
imran-siddique merged 1 commit intomainfrom
Conversation
…l repo New files (6 modules): - completeness_auditor.py (227L): Teacher model integration for soft failure detection - patcher.py (574L): Patch composition engine with classified patch application - semantic_analyzer.py (307L): NLP-based refusal detection beyond regex - semantic_purge.py (337L): Patch lifecycle management with decay classification - nudge_mechanism.py (253L): Post-give-up nudge injection to encourage retry - teacher.py (76L): Cognitive glitch diagnosis using o1-preview Upgraded files (7): - kernel.py (+441L): Dual-loop architecture (Runtime Loop 1 + Offline Loop 2) - analyzer.py (+350L): CognitiveGlitch diagnosis with evidence-based patterns - outcome_analyzer.py (+218L): Semantic analysis + tool telemetry correlation - triage.py (+108L): Smart routing to sync (JIT) or async (batch) paths - detector.py (+75L): Enhanced FailureQueue with custom handler registration - memory_manager.py (+38L): Model version tracking and upgrade purge - __init__.py (+18L): Re-exports for all new modules Tests: - Added test_dual_loop.py (463L) for dual-loop architecture coverage - All 119 tests pass Closes #57 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
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.
Summary
Ports the production-grade SCAK (Self-Correcting Agent Kernel) from the internal agent-governance repository to the public OSS toolkit. This is the largest module upgrade so far, adding the Dual-Loop Architecture (Runtime + Offline loops) with 6 entirely new modules.
New Modules (6)
Upgraded Modules (7)
Tests
Architecture: Dual-Loop Self-Correction
Loop 1 (Runtime): Immediate failure handling — detect, classify, patch, retry
Loop 2 (Offline): Quality improvement — semantic purge, completeness audits, model upgrades
This replaces the simple retry + exponential backoff with smart triage that routes failures to sync (JIT) or async (batch) processing based on criticality, tool context, and cognitive failure patterns.
Closes #57