Skip to content

refactor(PR2): safe deletions — remove 14 dead / out-of-scope symbols - #31

Merged
nceglia merged 2 commits into
refactor/pr0-contract-freezefrom
refactor/pr2-safe-deletions
Jul 12, 2026
Merged

refactor(PR2): safe deletions — remove 14 dead / out-of-scope symbols#31
nceglia merged 2 commits into
refactor/pr0-contract-freezefrom
refactor/pr2-safe-deletions

Conversation

@nceglia

@nceglia nceglia commented Jul 12, 2026

Copy link
Copy Markdown
Owner

Stacked on #30 (PR0–PR1). Base = refactor/pr0-contract-freeze — GitHub retargets to main when #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 tcri green; full suite 35 passed / 1 skipped.

Deleted — 14 symbols, 384 lines

  • preprocessing: get_latent_embedding, group_small_clones, register_probability_columns, remove_meaningless_genes, gene_entropy, classify_phenotypes
  • plotting: polar_plot (undefined-name ref), probability_distribution (self-recursion bug), bayesian_mutual_information (bad kwarg), SankeyNode.hex_to_rgb
  • metrics: _ent (never wired in), clone_fraction, module-level dkl (replaced by _distance.kl_divergence in PR1)
  • utils: 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-level dkl, probabilities — all 0). The surviving "dkl" references are the string distance-metric name + the flux inner dkl_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:

  • dropped the cosine_similarity import this PR orphaned (sole user was the deleted classify_phenotypes);
  • corrected a diary line-count (−129 → −127);
  • struck a stale plan line that still marked classify_phenotypes as a Phase-4 fold (it's a Phase-2 DROP per the authoritative REDO_LIST.md).

The audit independently confirmed: all 14 on-plan Phase-2/DROP, none present in the frozen _contract.pyi kept surface, no under-deletion, import + suite green.

Ledger: docs/contract/REFACTOR_AGENDA.md Phase-2 block fully ticked; PR-table row 2 → ✅.

🤖 Generated with Claude Code

nceglia and others added 2 commits July 12, 2026 09:15
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>
@nceglia
nceglia merged commit 00af198 into refactor/pr0-contract-freeze Jul 12, 2026
nceglia added a commit that referenced this pull request Jul 30, 2026
refactor: land the completed refactor in main (PRs #31#37)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant