From 4f51adcb94ceaab8e00af8f772114ce62ce55d65 Mon Sep 17 00:00:00 2001 From: ProtocolWarden <32967198+ProtocolWarden@users.noreply.github.com> Date: Thu, 18 Jun 2026 06:05:19 -0400 Subject: [PATCH] cleanup: delete dead git-ops primitives + PatchRegistry.all_patches Remove over-ported dead code from the initial fork-manager port (PR #2): - git/git_ops.py: remote_url, list_files_changed_between - patches.py: PatchRegistry.all_patches All three have zero src callers, zero tests, are not in any __all__, and have no cross-repo consumers (verified across all repos). The wired git primitives and the used patch accessors (for_source / by_source / get) are kept. 66 tests green; ruff clean; audit B2-env-only. Part of the cross-repo incomplete-integration remediation. Co-Authored-By: Claude Opus 4.8 --- .console/log.md | 11 +++++++++++ src/source_registry/git/git_ops.py | 14 -------------- src/source_registry/patches.py | 6 ------ 3 files changed, 11 insertions(+), 20 deletions(-) diff --git a/.console/log.md b/.console/log.md index 69f77c5..5133566 100644 --- a/.console/log.md +++ b/.console/log.md @@ -88,3 +88,14 @@ truth; pre-push catches regressions before they hit GitHub. ## 2026-05-23 — Standardize pre-push hook - Updated `.hooks/pre-push` to the auto-discovering boundary-artifact variant (auto-locates PrivateManifest/dist artifact; extra custodian-multi fallback path). + +## 2026-06-18 — cleanup: delete dead git-ops primitives + all_patches + +Ecosystem incomplete-integration remediation (Phase 3 DELETE). Removed +over-ported dead code from the initial fork-manager port (PR #2): git/git_ops.py +`remote_url` + `list_files_changed_between`, and patches.py +`PatchRegistry.all_patches`. All three: zero src callers, zero tests, not in any +__all__, no cross-repo consumers (verified). Sibling accessors (`for_source`, +`by_source`, `get`) and the wired git primitives stay. 66 tests green; ruff + +audit (B2 env only). (Pre-existing stale T7 doctor warnings for +validation/vocabulary dirs are unrelated and not a CI gate here.) diff --git a/src/source_registry/git/git_ops.py b/src/source_registry/git/git_ops.py index 4b1bdff..161cd44 100644 --- a/src/source_registry/git/git_ops.py +++ b/src/source_registry/git/git_ops.py @@ -79,17 +79,3 @@ def force_push_with_lease(repo: str | Path, remote: str, branch: str) -> GitResu def is_clean(repo: str | Path) -> bool: res = _git(repo, "status", "--porcelain") return res.ok and res.stdout.strip() == "" - - -def remote_url(repo: str | Path, remote: str) -> str | None: - res = _git(repo, "remote", "get-url", remote) - return res.stdout.strip() if res.ok else None - - -def list_files_changed_between( - repo: str | Path, base_ref: str, head_ref: str, -) -> list[str]: - res = _git(repo, "diff", "--name-only", f"{base_ref}..{head_ref}") - if not res.ok: - return [] - return [line for line in res.stdout.splitlines() if line.strip()] diff --git a/src/source_registry/patches.py b/src/source_registry/patches.py index 3b41fd1..47a82c0 100644 --- a/src/source_registry/patches.py +++ b/src/source_registry/patches.py @@ -49,12 +49,6 @@ def by_source(self) -> dict[str, list[PatchRecord]]: def for_source(self, source_name: str) -> list[PatchRecord]: return list(self._by_source.get(source_name, [])) - def all_patches(self) -> list[PatchRecord]: - out: list[PatchRecord] = [] - for patches in self._by_source.values(): - out.extend(patches) - return out - def get(self, full_id: str) -> PatchRecord | None: """Lookup by ``:`` identifier.""" if ":" not in full_id: