feat: lower graduation thresholds + cloud_correction_event_id lineage#183
Conversation
…ion_event_id Decision-D from forensic report (docs/internal/SDK_GRADUATION_FORENSICS.md): Fix 2 — Lower graduation thresholds for low-volume categories: - INSTINCT→PATTERN: fire_count >= 2 (was 3) - PATTERN→RULE: fire_count >= 3 (was 5), Beta-LB >= 0.75 (was 0.85) - New BrainConfig.graduation_thresholds for advanced tuning Fix 3 — Forward lineage: - LESSON_CHANGE events now include data.cloud_correction_event_id - Cloud materializer (separate PR on gradata-cloud) prefers this over the legacy integer source_correction_id Tests: 100 passed (existing + new test_graduation_thresholds_low_volume.py + test_lesson_lineage_cloud_id.py). Layering check: no Layer 0→2 imports introduced. Risk: graduation now fires earlier for small samples; Beta-LB guard still blocks pure noise.
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (13)
📝 WalkthroughSummary
WalkthroughThe pull request introduces configurable graduation thresholds for lesson promotion, allowing INSTINCT→PATTERN and PATTERN→RULE transitions to be parameterized via ChangesConfigurable Graduation Thresholds
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 OpenGrep (1.20.0)OpenGrep fatal error (exit code 2): �[32m✔�[39m �[1mOpengrep OSS�[0m �[1m Loading rules from local config...�[0m Comment |
Summary
BrainConfig.graduation_thresholdsso advanced users can tune those gates back up per brain.cloud_correction_event_idonLESSON_CHANGEevents, using the SDK event_id of the parentCORRECTIONevent for forward lineage.Tests
python3 -m py_compile src/gradata/_config.py src/gradata/_core.py src/gradata/enhancements/self_improvement/_confidence.py src/gradata/enhancements/self_improvement/_graduation.py src/gradata/enhancements/pipeline_rewriter.py tests/test_brain_config_recall.py tests/test_graduation_thresholds_low_volume.py tests/test_lesson_lineage_cloud_id.py tests/test_safety_assertion.py tests/test_spec_compliance.py tests/test_pipeline_rewriter.pypython3 -m pytest tests/test_graduation_thresholds_low_volume.py tests/test_lesson_lineage_cloud_id.py tests/test_brain_config_recall.py tests/test_safety_assertion.py tests/test_spec_compliance.py tests/test_pipeline_rewriter.py -qNotes
Cloud companion PR depends on this SDK release because it consumes
LESSON_CHANGE.data.cloud_correction_event_id.