Skip to content

Simplify: dedupe small helpers across the codebase#257

Merged
alexkroman merged 1 commit into
mainfrom
claude/codebase-review-simplify-b0crj8
Jun 19, 2026
Merged

Simplify: dedupe small helpers across the codebase#257
alexkroman merged 1 commit into
mainfrom
claude/codebase-review-simplify-b0crj8

Conversation

@alexkroman

Copy link
Copy Markdown
Collaborator

A codebase-wide simplification pass, factoring genuine duplication into
shared helpers without behavior change:

  • core/config: a single _profile() accessor backs get_profile_env/
    get_profile_email/get_account_id (was three identical load-and-read bodies).
  • app/mediafile: add transcript_id() and existing_output() and route the
    caption/dub/clip copies of str(getattr(transcript, "id", "")) and the
    caption/dub _existing_output URL-guard through them.
  • code_agent: a shared claude_config_root() replaces the duplicated
    CLAUDE_CONFIG_DIR constant + ~/.claude resolution in skills and memory.
  • code_agent/render: drop make_approver, a pure identity wrapper — the
    command passes its _confirm (already an Approver) straight through.
  • agent_cascade/tui: _TuiRenderer._dispatch and LiveAgentApp._safely were
    byte-identical UI-thread hops; both now delegate to one module-level
    _call_on_ui_thread().
  • commands/account: balance reuses _format_dollars instead of re-inlining
    the dollar format.

Existing tests are re-pointed at the shared helpers; the full gate
(patch-coverage, mutation, escape-hatch) passes.

Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_0168ddZzSJ7Ra4DvUd88orS5

A codebase-wide simplification pass, factoring genuine duplication into
shared helpers without behavior change:

- core/config: a single `_profile()` accessor backs get_profile_env/
  get_profile_email/get_account_id (was three identical load-and-read bodies).
- app/mediafile: add `transcript_id()` and `existing_output()` and route the
  caption/dub/clip copies of `str(getattr(transcript, "id", ""))` and the
  caption/dub `_existing_output` URL-guard through them.
- code_agent: a shared `claude_config_root()` replaces the duplicated
  CLAUDE_CONFIG_DIR constant + `~/.claude` resolution in skills and memory.
- code_agent/render: drop `make_approver`, a pure identity wrapper — the
  command passes its `_confirm` (already an Approver) straight through.
- agent_cascade/tui: `_TuiRenderer._dispatch` and `LiveAgentApp._safely` were
  byte-identical UI-thread hops; both now delegate to one module-level
  `_call_on_ui_thread()`.
- commands/account: `balance` reuses `_format_dollars` instead of re-inlining
  the dollar format.

Existing tests are re-pointed at the shared helpers; the full gate
(patch-coverage, mutation, escape-hatch) passes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0168ddZzSJ7Ra4DvUd88orS5
@alexkroman alexkroman enabled auto-merge June 19, 2026 06:53
@alexkroman alexkroman added this pull request to the merge queue Jun 19, 2026
Merged via the queue into main with commit 127eab9 Jun 19, 2026
20 checks passed
@alexkroman alexkroman deleted the claude/codebase-review-simplify-b0crj8 branch June 19, 2026 07:02
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.

2 participants