Repository navigation
refactor: delete four uncalled helpers in core modules - #25869
Conversation
member_memory_identity (memory_stores), registry_slugs (connections/tool_aliases), stage_redacted_copy (snapshot_redact) and _open_no_internal_redirect (skill_providers/skillsh) have no caller in src, test, scripts, website or docs, and none is reached through __all__, an entry point or a getattr/string lookup. Neither security-adjacent one is the live guard. skills.sh fetches go through _sync_fetch_json, which hands _ALLOWED_HOSTS and _is_internal_url to _http.sync_fetch_json, which calls open_guarded itself. Snapshot egress redaction runs through snapshot.py calling redact_bundle_for_egress directly. The shutil import only stage_redacted_copy used goes with it. Closes #25865
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks. This PR deletes four functions that nothing calls. Searching the tree for each removed name finds no remaining reader, and no other code in [DESIGN-REVIEWED] f120fd7 Description read[DESCRIPTION-READ] 70aad6779383bcefe0c85e80bbbb6dd44344d71d0ce822dcfb6b86ccd5bda426 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing to check. What this change shipsInventory (5 items) — 5 justifiedIntent: make code easier to read by removing four functions that nobody calls, so readers stop taking them for the live paths. This is a FIX (the cleanup is tracked in #25865).
[FIRST-PRINCIPLES-REVIEWED] f120fd7 Description read[DESCRIPTION-READ] 4ece8a286dd50543d909f8830ed00f3e832acd8cdf8855edd56176340ea74ae8 That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
Sensitive change review
|
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Approved on behalf of the watch holder (bolichen). Design and First Principles pass on this head (or skipped / author override), UX skipped or pass, no conflict, no open change request.
Problem / Motivation
Goal: Four functions that nothing calls are gone from core modules, so readers stop mistaking them for live paths.
member_memory_identity(memory_stores.py),registry_slugs(connections/tool_aliases.py),stage_redacted_copy(snapshot_redact.py) and_open_no_internal_redirect(skill_providers/skillsh.py) have no caller insrc,test,scripts,websiteordocs.git grep -wfinds only eachdef. None is in an__all__, an entry point, or agetattr/string lookup.Why it matters
Two of them sit next to security code. A reader who sees
_open_no_internal_redirectorstage_redacted_copycan take it for the guard that really runs, and change the wrong one. Dead helpers also cost review time on every PR that touches these files.Not a goal
memory_stores.py(fix(members): let a new crewmate start from a deleted one's memory #22947, fix(agent): never rewrite a crew-bound spec Crew does not own #25325, fix(platform): route every by-name lock-sidecar open through open_create_or_existing #25591).What changed (motivation → approach → change)
Each function was checked for callers by exact name, by partial name, and through
getattr,__all__and entry points. All four had none, so all four go. Theshutilimport onlystage_redacted_copyused goes with it. For the two security-adjacent ones, the live path was confirmed not to route through them: skills.sh's_sync_fetch_jsonhands_ALLOWED_HOSTSand_is_internal_urlstraight to_http.sync_fetch_json, which callsopen_guardeditself.snapshot.pycallsredact_bundle_for_egressdirectly.Backwards compatibility
Compatible: no caller exists, so nothing that runs today changes.
None of the removed names has a reader on
origin/main:git grep -n -w <name>acrosssrc,test,scripts,websiteanddocsprints only eachdef. The lines below name the live path that does each job instead, and the test that holds it:Reader: src/kiro_crew/execution_context.py:validate_execution -- chat -- reads a member's database identity through read_member_database_identity, never member_memory_identity; test_execution_context.py::test_database_identity_path_and_cross_member_routing
Reader: src/kiro_crew/connections/tool_aliases.py:declared_tool_aliases -- chat -- walks get_all_registry_providers() itself, never registry_slugs; test_connections_tool_aliases.py::test_flag_on_writes_the_resolved_map
Reader: src/kiro_crew/snapshot.py:_redacted_upload_copy -- app -- the aws_control backup egress calls redact_bundle_for_egress directly, never stage_redacted_copy; test_snapshot_redaction.py::TestTheOutboundCopyIsRedacted::test_the_redacted_copy_lives_in_the_caller_workdir
Tests
No test added: deleting uncalled code has no behavior to pin. Evidence instead:
test_auto_improvement_members.py::test_assignments_build_real_context_from_only_their_private_store, fails the same way on cleanorigin/mainon this host. Frontend related set: 12501 passed.Manual verification
N/A — unit coverage sufficient: the change only deletes code no path calls, and the module test suites pass.
Related Issues
Closes #25865
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributions are accepted under the project's Apache-2.0 license.