.vbw-planning/milestones/03-coverage-analysis-quick-wins-critical-path-test-co/phases/01-coverage-analysis-quick-wins/PLAN-01.md
Add the # frozen_string_literal: true magic comment to every git-tracked Ruby file that is currently missing it. This is a mechanical, low-risk change that brings the codebase into full compliance with REQ-13 and prepares for the RuboCop audit in Plan 02.
Decomposition rationale: This plan is separated from the RuboCop audit because (a) frozen_string_literal changes touch nearly 100 files and are purely mechanical, making them ideal for a single focused commit, and (b) completing this first removes a large category of RuboCop violations, simplifying Plan 02's scope.
Current state:
# frozen_string_literal: trueConstraints:
test/tmp/ (generated artifacts, not tracked in git)test/lib/tmp/install_generator/config/initializers/source_monitor.rb already has the pragma (verified)#!/usr/bin/env ruby) as line 1 -- the pragma must go AFTER the shebangtest/dummy/db/schema.rb is excluded from RuboCop in .rubocop.yml but should still get the pragma for consistency
</context>
app/controllers/source_monitor/application_controller.rbapp/controllers/source_monitor/health_controller.rbapp/helpers/source_monitor/application_helper.rbapp/jobs/source_monitor/application_job.rbapp/models/source_monitor/application_record.rblib/source_monitor.rblib/source_monitor/assets.rblib/source_monitor/assets/bundler.rblib/source_monitor/engine.rblib/source_monitor/version.rblib/source_monitor/setup/initializer_patcher.rblib/source_monitor/setup/bundle_installer.rblib/source_monitor/setup/workflow.rblib/source_monitor/setup/gemfile_editor.rblib/source_monitor/setup/requirements.rblib/source_monitor/setup/detectors.rblib/source_monitor/setup/shell_runner.rblib/source_monitor/setup/cli.rblib/source_monitor/setup/verification/printer.rblib/source_monitor/setup/verification/telemetry_logger.rblib/source_monitor/setup/verification/solid_queue_verifier.rblib/source_monitor/setup/verification/result.rblib/source_monitor/setup/verification/action_cable_verifier.rblib/source_monitor/setup/verification/runner.rblib/source_monitor/setup/install_generator.rblib/source_monitor/setup/dependency_checker.rblib/source_monitor/setup/prompter.rblib/source_monitor/setup/migration_installer.rblib/source_monitor/setup/node_installer.rb# frozen_string_literal: true\n\n to each file listed above. If the file already begins with a shebang (#!), insert the pragma on line 2 (after the shebang) with a blank line separating them. For lib/source_monitor.rb specifically, note it starts with require statements -- the pragma goes before all requires.grep -cL 'frozen_string_literal: true' app/**/*.rb lib/**/*.rb returns no results (all files have the pragma). Additionally run ruby -c lib/source_monitor.rb to confirm syntax validity.# frozen_string_literal: true as their first non-shebang line.config/routes.rbdb/migrate/20251009103000_add_feed_content_readability_to_sources.rbdb/migrate/20251014171659_add_performance_indexes.rbdb/migrate/20251014172525_add_fetch_status_check_constraint.rbdb/migrate/20251108120116_refresh_fetch_status_constraint.rb# frozen_string_literal: true\n\n to each file. These are small files (migration class definitions and route definitions).head -1 on each file to confirm the pragma is present. Run ruby -c config/routes.rb to confirm syntax validity (it will fail since it references SourceMonitor::Engine, so instead just visually confirm the pragma is on line 1).test/test_helper.rbtest/source_monitor_test.rbtest/gemspec_test.rbtest/application_system_test_case.rbtest/system/dropdown_fallback_test.rbtest/integration/engine_mounting_test.rbtest/integration/navigation_test.rbtest/controllers/source_monitor/health_controller_test.rbtest/jobs/source_monitor/fetch_feed_job_test.rbtest/jobs/source_monitor/item_cleanup_job_test.rbtest/jobs/source_monitor/log_cleanup_job_test.rbtest/lib/source_monitor/setup/ (12 files)test/lib/source_monitor/setup/verification/ (5 files)test/lib/source_monitor/instrumentation_test.rbtest/lib/source_monitor/feedjira_configuration_test.rbtest/lib/source_monitor/metrics_test.rbtest/lib/source_monitor/scheduler_test.rbtest/lib/source_monitor/release/runner_test.rbtest/lib/source_monitor/release/changelog_test.rbtest/lib/source_monitor/items/item_creator_test.rbtest/lib/source_monitor/items/retention_pruner_test.rbtest/lib/source_monitor/events/event_system_test.rbtest/lib/source_monitor/assets/bundler_test.rbtest/lib/source_monitor/engine_assets_configuration_test.rbtest/lib/source_monitor/http_test.rbtest/lib/source_monitor/fetching/feed_fetcher_test.rbtest/lib/source_monitor/fetching/fetch_runner_test.rb# frozen_string_literal: true\n\n to each file. The test/test_helper.rb file may have a shebang or special first lines -- check and handle accordingly.find test -name '*.rb' -not -path 'test/tmp/*' -not -path 'test/dummy/*' -exec head -1 {} \; | grep -cv 'frozen_string_literal' returns 0.test/dummy/app/controllers/application_controller.rbtest/dummy/app/controllers/test_support_controller.rbtest/dummy/app/helpers/application_helper.rbtest/dummy/app/jobs/application_job.rbtest/dummy/app/mailers/application_mailer.rbtest/dummy/app/models/application_record.rbtest/dummy/app/models/user.rbtest/dummy/config/application.rbtest/dummy/config/boot.rbtest/dummy/config/environment.rbtest/dummy/config/environments/development.rbtest/dummy/config/environments/production.rbtest/dummy/config/environments/test.rbtest/dummy/config/importmap.rbtest/dummy/config/puma.rbtest/dummy/config/routes.rbtest/dummy/config/initializers/assets.rbtest/dummy/config/initializers/content_security_policy.rbtest/dummy/config/initializers/filter_parameter_logging.rbtest/dummy/config/initializers/inflections.rbtest/dummy/db/migrate/20251124080000_create_users.rbtest/dummy/db/schema.rb# frozen_string_literal: true\n\n to each file. The test/dummy/db/schema.rb may be auto-generated by Rails -- still add the pragma since it is git-tracked and part of the project.find test/dummy -name '*.rb' -exec head -1 {} \; | grep -cv 'frozen_string_literal' returns 0.bin/rubocop --only Style/FrozenStringLiteralComment to confirm zero RuboCop offenses for this cop. (3) Run the test suite to confirm no regressions from adding the pragma.git ls-files -- '*.rb' | xargs head -1 | grep -cv 'frozen_string_literal: true' outputs 0bin/rubocop --only Style/FrozenStringLiteralComment exits 0bin/rails test exits 0 (or at minimum no new failures)git ls-files -- '*.rb' | xargs head -1 | grep -cv 'frozen_string_literal: true' returns 0bin/rubocop --only Style/FrozenStringLiteralComment exits 0 with zero offenses# frozen_string_literal: true (REQ-13)Style/FrozenStringLiteralComment cop passes with zero offenses