From 5393f4f3d09bf2293f52517e022dc2ba7ce16798 Mon Sep 17 00:00:00 2001 From: saagpatel Date: Sun, 31 May 2026 07:58:21 -0700 Subject: [PATCH] refactor: remove orphaned read_context_text function (Arc C) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `read_context_text` in portfolio_truth_sources.py had zero callers anywhere in src/ or tests/ — the comment claiming "Called indirectly via context analysis pipeline" was stale. The 5 other 0.4.0 flagged functions (resolve_declared_operating_path, choose_primary_context_file, render_context_recovery_plan_markdown, latest_portfolio_truth_path, detect_boilerplate_context) all have real production callers and are NOT orphaned. Verified with `grep -rn` across all .py files. 2150 tests pass, ruff clean. --- src/portfolio_truth_sources.py | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/portfolio_truth_sources.py b/src/portfolio_truth_sources.py index 78ec708..a1e58b9 100644 --- a/src/portfolio_truth_sources.py +++ b/src/portfolio_truth_sources.py @@ -293,17 +293,6 @@ def _classify_context_quality(project_path: Path, context_files: list[str]) -> s return analyze_project_context(project_path, context_files).context_quality -# Utility: reads context file text, respecting size and allowlist limits. -# Called indirectly via context analysis pipeline. -def read_context_text(project_path: Path, relative_file: str) -> str: - path = project_path / relative_file - if not path.is_file() or path.stat().st_size > MAX_CONTEXT_BYTES: - return "" - if path.name not in TEXT_ALLOWLIST: - return "" - return path.read_text(errors="replace") - - # Utility: returns True if context quality is "boilerplate". # Called indirectly via context analysis pipeline. def detect_boilerplate_context(project_path: Path, context_files: list[str]) -> bool: