fix #18: [9] generate_media_for_turn is dead code with three undefined attributes - #40
Merged
CuriosityQuantified merged 4 commits intoAug 9, 2026
Merged
Conversation
…ibutes The method `generate_media_for_turn` in MediaService was never called anywhere, yet referenced `self.tts_service`, `self.state_service`, and `self.notify_progress` — none of which are defined in `__init__`. Any call would immediately raise AttributeError. It also used `print()` for debugging instead of the logger. Delete the method (82 lines). Add a regression test that locks in its absence and verifies the neighboring method survives the deletion. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
CuriosityQuantified
deleted the
feat/remove-dead-generate-media-for-turn
branch
August 9, 2026 01:11
CuriosityQuantified
added a commit
that referenced
this pull request
Aug 10, 2026
Issue #25 reported seven print() calls in services/media_service.py inside generate_media_for_turn, which bypass the configured logging system. That entire method (and all seven print() calls) was already deleted by fix #18 (commit 1b7a376 / PR #40), so the module already satisfies #25. The #18 regression only asserts the dead method is absent; nothing guards #25's own acceptance criterion (no print() bypassing structured logging). Add that missing recurrence guard: - tests/unit/test_no_print_media_service_regression.py: AST-based test asserting zero print() calls in services/media_service.py (walks ast.Call nodes whose func is the builtin name "print", so string / comment / pprint occurrences never false-positive), plus a positive control confirming the module configures a logging.getLogger(__name__) logger. Fails the moment any print() is reintroduced. - .github/workflows/ci.yml: named "Run print/logging regression" step in the unit-tests job, matching the sibling per-issue regression steps. media_service.py is unchanged (already correct). No app behavior changes. 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.
Closes #18
Summary
generate_media_for_turn(82 lines) fromservices/media_service.py— the method was never called from anywhere in the codebase, yet referencedself.tts_service,self.state_service, andself.notify_progress, none of which are defined inMediaService.__init__. Any invocation would have immediately raisedAttributeError. It also usedprint()for debugging instead of the logger.tests/unit/test_dead_code_removal_regression.pywith a regression test that asserts the dead method is absent and that the neighboringtest_r2_upload_downloadmethod survived the deletion intact.Test results
Subagent pipeline
import pytest, moved import to module level per project conventions.Graph refresh
Not applicable — this repo has no
graphify-out/or code-graph CI job.