refactor(PR2): safe deletions — remove 14 dead / out-of-scope symbols - #31
Merged
nceglia merged 2 commits intoJul 12, 2026
Merged
Conversation
Safe deletions — every target verified to have zero in-package call-sites before removal (incl. precise call-site check for _ent / module-level dkl / probabilities). AST-span removal of top-level defs + SankeyNode.hex_to_rgb + the dead `probabilities` import. 384 lines removed; import tcri green; suite 35 passed / 1 skipped (nothing referenced them). Removed: pp.get_latent_embedding, pp.group_small_clones, pp.register_probability_columns, pp.remove_meaningless_genes, pp.gene_entropy, pp.classify_phenotypes, pl.polar_plot, pl.probability_distribution, pl.bayesian_mutual_information, metrics._ent, tl.clone_fraction, metrics.dkl, ut.probabilities, SankeyNode.hex_to_rgb. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Multi-agent audit (3 lenses) verdict PASS with 3 LOW items, all fixed: - remove cosine_similarity import (orphaned by classify_phenotypes deletion) - diary preprocessing shrink -129 -> -127 (was double-counting blank residue) - plan: classify_phenotypes is Phase-2 DROP, not Phase-4 fold (per REDO_LIST) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Stacked on #30 (PR0–PR1). Base =
refactor/pr0-contract-freeze— GitHub retargets tomainwhen #30 merges.Pure removal PR: deletes the Phase-2 dead / out-of-scope symbols outright (dropped, not moved to examples). No behavior change to the kept surface;
import tcrigreen; full suite 35 passed / 1 skipped.Deleted — 14 symbols, 384 lines
get_latent_embedding,group_small_clones,register_probability_columns,remove_meaningless_genes,gene_entropy,classify_phenotypespolar_plot(undefined-name ref),probability_distribution(self-recursion bug),bayesian_mutual_information(bad kwarg),SankeyNode.hex_to_rgb_ent(never wired in),clone_fraction, module-leveldkl(replaced by_distance.kl_divergencein PR1)probabilities(+ its dead plotting import)Safety
Every target verified to have zero in-package call-sites before removal — including a precise
NAME(call-site check for the three ambiguous ones (_ent, module-leveldkl,probabilities— all 0). The surviving"dkl"references are the string distance-metric name + thefluxinnerdkl_func(kept → Phase 6), not the deleted function. Removal done by AST-span (exact def line ranges), not text munging.Audit
A 3-lens multi-agent audit (doc↔code · deletion safety · plan/contract conformance) ran on this branch → PASS, with 3 LOW items, all fixed here:
cosine_similarityimport this PR orphaned (sole user was the deletedclassify_phenotypes);classify_phenotypesas a Phase-4 fold (it's a Phase-2 DROP per the authoritativeREDO_LIST.md).The audit independently confirmed: all 14 on-plan Phase-2/DROP, none present in the frozen
_contract.pyikept surface, no under-deletion, import + suite green.Ledger:
docs/contract/REFACTOR_AGENDA.mdPhase-2 block fully ticked; PR-table row 2 → ✅.🤖 Generated with Claude Code