Skip to content

chore(sdk): prune 10 confirmed-dead modules (-3143 LOC)#90

Merged
Gradata merged 1 commit intomainfrom
chore/dead-code-prune
Apr 15, 2026
Merged

chore(sdk): prune 10 confirmed-dead modules (-3143 LOC)#90
Gradata merged 1 commit intomainfrom
chore/dead-code-prune

Conversation

@Gradata
Copy link
Copy Markdown
Owner

@Gradata Gradata commented Apr 15, 2026

Summary

Deletes 10 dead modules flagged in the autoresearch leanness audit after grep-verifying that no runtime import path exists. All 2453 tests pass.

-2101 LOC source, -1042 LOC tests, -3143 LOC total.

Deletions (grep-verification evidence)

File LOC Evidence (only refs found)
src/gradata/contrib/enhancements/outcome_feedback.py 1 docstring stub; only test_spec_compliance list + enhancements/init.py comment
src/gradata/enhancements/super_meta_rules.py 197 zero from ... super_meta_rules / import super_meta_rules across src/ and tests/; SuperMetaRule dataclass + SQL table live in meta_rules.py / meta_rules_storage.py and stay wired
src/gradata/enhancements/pubsub_pipeline.py 49 only tests/test_pubsub_pipeline.py
src/gradata/rules/budget.py 43 only tests/test_budget_injection.py
src/gradata/rules/rw_lock.py 54 only tests/test_rw_lock.py
src/gradata/cloud/wiki_store.py 451 only cloud/__init__.py lazy re-export + tests/test_wiki_store.py
src/gradata/enhancements/rule_verifier.py 243 only contrib/enhancements/install_manifest.py:274 string + tests + docs
src/gradata/enhancements/rule_evolution.py 434 only _manifest_helpers.py:125 string + tests/test_adaptations.py + tests/test_steals.py; live contradiction path is contradiction_detector.py via self_improvement.py:545
src/gradata/security/privacy_model.py 113 only tests/test_privacy_model.py + security/THREAT_MODEL.md; _core.py, brain.py, _export_brain.py all grep-clean
src/gradata/benchmarks/swe_bench.py 516 only its own docstring example + tests/test_swe_bench.py; no CLI/docs runtime reference

Test files removed

tests/test_{pubsub_pipeline,budget_injection,rw_lock,wiki_store,rule_verifier,privacy_model,swe_bench}.py + targeted pruning of:

  • tests/test_steals.py: TestRuleConflicts, TestRuleRelationEnum, rule_evolution imports in TestIntegration
  • tests/test_adaptations.py: TestRuleABTesting block, rule_evolution entry in manifest-capabilities test

Registry + docstring updates

  • contrib/enhancements/install_manifest.py: drop enhancements.rule_verifier from rule-integrity components
  • _manifest_helpers.py: drop rule_evolution from _core_modules
  • enhancements/__init__.py: drop rule_verifier docstring line
  • cloud/__init__.py: drop WikiStore lazy re-export
  • enhancements/meta_rules_storage.py: docstring no longer points at deleted super_meta_rules.py

NOT deleted (verified live via recent PRs)

Test plan

  • python -m pytest tests/ -x -q --ignore=tests/test_integration_full.py -> 2453 passed, 24 skipped
  • Pre-commit SDK import check passes

Generated with Gradata

…test LOC)

Deletes dead code flagged in the autoresearch leanness audit after
grep-verifying that no runtime import path exists. All 2453 tests pass.

Source files removed (2101 LOC):
- src/gradata/contrib/enhancements/outcome_feedback.py (1 LOC, docstring stub)
- src/gradata/enhancements/super_meta_rules.py (197 LOC, no importers;
  SuperMetaRule dataclass + SQL table live in meta_rules.py /
  meta_rules_storage.py and remain wired)
- src/gradata/enhancements/pubsub_pipeline.py (49 LOC, test-only)
- src/gradata/rules/budget.py (43 LOC, test-only)
- src/gradata/rules/rw_lock.py (54 LOC, test-only)
- src/gradata/cloud/wiki_store.py (451 LOC, only cloud/__init__.py
  re-export + test)
- src/gradata/enhancements/rule_verifier.py (243 LOC, only manifest
  string + test reference)
- src/gradata/enhancements/rule_evolution.py (434 LOC, only manifest
  string + test references; contradiction_detector.py covers the live
  path via self_improvement.py:545)
- src/gradata/security/privacy_model.py (113 LOC, test + docs only;
  _core.py / brain.py / _export_brain.py grep-clean)
- src/gradata/benchmarks/swe_bench.py (516 LOC, docstring example +
  test only, no CLI/docs runtime reference)

Test files removed (1042 LOC): matching tests for each module plus
targeted pruning of rule_evolution test classes (TestRuleConflicts,
TestRuleRelationEnum, rule_evolution imports in TestIntegration) from
tests/test_steals.py and the TestRuleABTesting block in
tests/test_adaptations.py.

Registry + docstring updates:
- contrib/enhancements/install_manifest.py: drop rule_verifier from
  rule-integrity module components
- _manifest_helpers.py: drop rule_evolution from _core_modules
- enhancements/__init__.py: drop rule_verifier docstring line
- cloud/__init__.py: drop WikiStore lazy re-export
- enhancements/meta_rules_storage.py: docstring no longer points at
  the deleted super_meta_rules.py

NOT DELETED (verified live via PRs #77/#81/#86):
- enhancements/rule_ranker.py, self_healing.py, rule_canary.py,
  rule_to_hook.py (all have runtime callers)
- middleware/ (flagged empty in the audit but actually contains
  _core.py + 4 adapters — kept)
- src/gradata/graphify-out/ (did not exist in this tree)

Tests: 2453 passed, 24 skipped (test_integration_full.py ignored per
task spec).

Co-Authored-By: Gradata <noreply@gradata.ai>
Copy link
Copy Markdown

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gradata has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 15, 2026

Caution

Review failed

Pull request was closed or merged during review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: e10788c3-3fc5-4c33-a194-010b83bb9e15

📥 Commits

Reviewing files that changed from the base of the PR and between 902d550 and 1390cd3.

📒 Files selected for processing (25)
  • src/gradata/_manifest_helpers.py
  • src/gradata/benchmarks/swe_bench.py
  • src/gradata/cloud/__init__.py
  • src/gradata/cloud/wiki_store.py
  • src/gradata/contrib/enhancements/install_manifest.py
  • src/gradata/contrib/enhancements/outcome_feedback.py
  • src/gradata/enhancements/__init__.py
  • src/gradata/enhancements/meta_rules_storage.py
  • src/gradata/enhancements/pubsub_pipeline.py
  • src/gradata/enhancements/rule_evolution.py
  • src/gradata/enhancements/rule_verifier.py
  • src/gradata/enhancements/super_meta_rules.py
  • src/gradata/rules/budget.py
  • src/gradata/rules/rw_lock.py
  • src/gradata/security/privacy_model.py
  • tests/test_adaptations.py
  • tests/test_budget_injection.py
  • tests/test_privacy_model.py
  • tests/test_pubsub_pipeline.py
  • tests/test_rule_verifier.py
  • tests/test_rw_lock.py
  • tests/test_spec_compliance.py
  • tests/test_steals.py
  • tests/test_swe_bench.py
  • tests/test_wiki_store.py
💤 Files with no reviewable changes (22)
  • src/gradata/contrib/enhancements/outcome_feedback.py
  • tests/test_spec_compliance.py
  • src/gradata/enhancements/init.py
  • tests/test_pubsub_pipeline.py
  • tests/test_adaptations.py
  • src/gradata/_manifest_helpers.py
  • tests/test_budget_injection.py
  • tests/test_wiki_store.py
  • tests/test_rw_lock.py
  • tests/test_steals.py
  • src/gradata/rules/budget.py
  • tests/test_privacy_model.py
  • src/gradata/enhancements/pubsub_pipeline.py
  • src/gradata/rules/rw_lock.py
  • tests/test_rule_verifier.py
  • tests/test_swe_bench.py
  • src/gradata/security/privacy_model.py
  • src/gradata/benchmarks/swe_bench.py
  • src/gradata/cloud/wiki_store.py
  • src/gradata/enhancements/rule_verifier.py
  • src/gradata/enhancements/super_meta_rules.py
  • src/gradata/enhancements/rule_evolution.py
📜 Recent review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Python 3.12
🧰 Additional context used
📓 Path-based instructions (1)
src/gradata/**/*.py

⚙️ CodeRabbit configuration file

src/gradata/**/*.py: This is the core SDK. Check for: type safety (from future import annotations required), no print()
statements (use logging), all functions accepting BrainContext where DB access occurs, no hardcoded paths. Severity
scoring must clamp to [0,1]. Confidence values must be in [0.0, 1.0].

Files:

  • src/gradata/enhancements/meta_rules_storage.py
  • src/gradata/cloud/__init__.py
  • src/gradata/contrib/enhancements/install_manifest.py
🔇 Additional comments (3)
src/gradata/cloud/__init__.py (1)

33-33: Public export cleanup looks correct.

Line 33 cleanly restricts package exports to CloudClient, which matches the intentional removal of WikiStore and avoids stale re-exports.

src/gradata/contrib/enhancements/install_manifest.py (1)

272-275: Rule-integrity component list cleanup is correct and consistent with this PR.

Removing the deleted enhancements.rule_verifier entry from this manifest list avoids stale module references while preserving the remaining active rule-integrity components.

src/gradata/enhancements/meta_rules_storage.py (1)

5-6: LGTM! Docstring reference correctly updated.

The docstring now accurately references meta_rules.py (where SuperMetaRule is actually defined, as confirmed by the import at line 31) instead of the deleted super_meta_rules.py module. The added clarification about the SuperMetaRule dataclass improves documentation completeness.


📝 Walkthrough

Breaking Changes

  • Deleted 10 dead modules (2,101 LOC source, 1,042 LOC tests):

    • benchmarks/swe_bench.py – SWE-bench harness, instance loaders, and patch comparison utilities
    • cloud/wiki_store.py – Supabase-backed wiki store with semantic search and pgvector integration
    • enhancements/rule_evolution.py – A/B testing primitives, rule conflict detection, and relationship classification
    • enhancements/rule_verifier.py – Rule verification subsystem with pattern matching and SQLite persistence
    • enhancements/super_meta_rules.py – Tier-2/3 meta-rule discovery, validation, and formatting
    • enhancements/pubsub_pipeline.py – Pub/sub-based correction processing pipeline
    • rules/budget.py – Context-aware rule filtering and formatting by budget level
    • rules/rw_lock.py – Reader-writer lock synchronization primitives
    • security/privacy_model.py – Differential privacy, lesson sanitization, and k-anonymity checks
    • contrib/enhancements/outcome_feedback.py – Outcome feedback module
  • Removed public APIs: WikiStore, PubSubPipeline, ExperimentManager, RuleExperiment, rule conflict detection (detect_rule_conflict, classify_all_relations), rule verification, SWE-bench harness, RWLock, budget filtering utilities, privacy models (sanitize_for_sharing, add_laplace_noise)

  • Manifest updates: Removed rule_verifier from rule-integrity components and manifest capabilities; updated docstrings in meta_rules_storage.py; removed WikiStore export from cloud/__init__.py

  • All tests passing: 2,453 passed, 24 skipped; removed all coverage for deleted modules

Walkthrough

This PR removes multiple modules including enhancement tools (rule_evolution, rule_verifier, pubsub_pipeline, super_meta_rules), cloud features (WikiStore), utility infrastructure (budget, rw_lock, privacy_model), and benchmarking functionality (swe_bench), along with associated tests and manifest declarations.

Changes

Cohort / File(s) Summary
Enhancement modules removal
src/gradata/enhancements/rule_evolution.py, src/gradata/enhancements/rule_verifier.py, src/gradata/enhancements/pubsub_pipeline.py, src/gradata/enhancements/super_meta_rules.py
Deleted A/B testing primitives, rule conflict detection, pub/sub pipeline, and super-meta-rule lifecycle logic (434, 243, 49, and 197 lines respectively removed).
Cloud features removal
src/gradata/cloud/wiki_store.py, src/gradata/cloud/__init__.py
Removed Supabase-backed wiki store with semantic search and removed WikiStore from module exports.
Utility/infrastructure removal
src/gradata/rules/budget.py, src/gradata/rules/rw_lock.py, src/gradata/security/privacy_model.py
Deleted budget-aware lesson filtering, reader-writer lock, and privacy/differential privacy utilities.
Benchmarking removal
src/gradata/benchmarks/swe_bench.py
Removed SWE-bench harness and patch comparison utilities (516 lines).
Manifest and configuration updates
src/gradata/_manifest_helpers.py, src/gradata/contrib/enhancements/install_manifest.py, src/gradata/enhancements/__init__.py, src/gradata/contrib/enhancements/outcome_feedback.py
Updated SDK capabilities manifest to remove rule_evolution, reordered module components to exclude rule_verifier, removed rule_verifier from available enhancements list, and removed empty docstring from outcome_feedback.
Documentation updates
src/gradata/enhancements/meta_rules_storage.py
Updated docstring references for SuperMetaRule persistence to point to meta_rules.py instead of super_meta_rules.py.
Test suite removal
tests/test_adaptations.py, tests/test_budget_injection.py, tests/test_privacy_model.py, tests/test_pubsub_pipeline.py, tests/test_rule_verifier.py, tests/test_rw_lock.py, tests/test_spec_compliance.py, tests/test_steals.py, tests/test_swe_bench.py, tests/test_wiki_store.py
Removed test coverage for deleted modules and updated manifest capability assertions.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

refactor, breaking-change

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main change: removing 10 confirmed-dead modules with a code reduction of 3143 lines.
Description check ✅ Passed The description is directly related to the changeset, providing detailed documentation of deleted modules, verification evidence, and test results.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/dead-code-prune

Comment @coderabbitai help to get the list of available commands and usage tips.

@Gradata Gradata merged commit 005b655 into main Apr 15, 2026
16 of 17 checks passed
@Gradata Gradata deleted the chore/dead-code-prune branch April 17, 2026 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant