Skip to content

Audit cleanup: drop mustache, remove dead code, shrink helpers#34

Merged
kplawver merged 1 commit into
mainfrom
kplawver-ponytail-audit
Jun 30, 2026
Merged

Audit cleanup: drop mustache, remove dead code, shrink helpers#34
kplawver merged 1 commit into
mainfrom
kplawver-ponytail-audit

Conversation

@kplawver

Copy link
Copy Markdown
Collaborator

Summary

  • Drops the mustache gem in favor of stdlib ERB for prompt templates — one less runtime dependency, same <%= %> substitution and conditional blocks.
  • Removes dead code surfaced by a repo-wide over-engineering audit: the never-called IssueIdGenerator, the unused summary generation path (PromptBuilder#summary, the summary template, summary_requirements config var, and Report#summary + its renderer branches), the unread mention_triggers / collapse_previous_code_review_comments config flags, the one-line LlmClient#complete delegator, redundant require 'set' (autoloaded since Ruby 3.2), and a redundant AffectedRange#initialize override.
  • Shrinks a few spots: inlines apply_string_overrides, collapses Reviewer#parse_response helpers, simplifies the CLI repo_owner/repo_name helpers, and updates the architecture docs (AGENTS.md / CLAUDE.md) to reference ERB.

Test plan

  • bundle exec rake — RuboCop clean (46 files), RSpec 115 examples, 0 failures.
  • Gemfile.lock no longer references mustache.

Notes

  • The IO::Buffer is experimental warning during reviewer_spec is pre-existing (emitted by the async gem during the parallel review); it is not introduced by the ERB migration.


def render_template(path, vars)
Mustache.render(template_cache(path), template_vars.merge(vars))
ERB.new(template_cache(path), trim_mode: '-').result_with_hash(template_vars.merge(vars))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Critical] ERB#result_with_hash is not a standard Ruby method — will raise NoMethodError at runtime

The code calls ERB.new(...).result_with_hash(...), but result_with_hash does not exist in Ruby's standard ERB library. The ERB API provides result(binding) and result_with_binding(binding), neither of which accept a plain Hash. This appears to be a direct copy-paste adaptation from the previous Mustache API (Mustache.render(template, hash)) without accounting for ERB's different rendering model. This will cause a NoMethodError at runtime whenever review or verify is called.

Tags: bug, compatibility

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it wasn't, you wouldn't have run, friend.

@kplawver kplawver merged commit 4d5ba8d into main Jun 30, 2026
2 checks passed
@kplawver kplawver deleted the kplawver-ponytail-audit branch June 30, 2026 13:37
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