Skip to content

refactor(dependency): strip gated dead code, bump to v4.0.0#3

Closed
MahtraDR wants to merge 1 commit into
mainfrom
refactor/dependency-strip-dead-code
Closed

refactor(dependency): strip gated dead code, bump to v4.0.0#3
MahtraDR wants to merge 1 commit into
mainfrom
refactor/dependency-strip-dead-code

Conversation

@MahtraDR
Copy link
Copy Markdown
Owner

Summary

  • Remove all 7 gated blocks that are dead code on core lich 5.17.2+ (ArgParser, SetupFiles, ScriptManager, custom_require, make_map_edits, DR startup, get_settings/get_data globals)
  • Remove deprecated autostart/stop_autostart/dependency_status stubs (verified zero callers across dr-scripts, gs-scripts, and lich-5)
  • Remove one-shot Settings['autostart'] migration (completed long ago)
  • Remove redundant parse_args/display_args wrappers (core provides identical ones via global_defs.rb)
  • Remove fully dead boot sequence (every branch is a no-op on core)
  • Bump version to 4.0.0, require lich >= 5.17.2
  • Update spec file: keep tests for remaining runtime helpers, remove tests for deleted code

Net: -1,952 lines (+84 / -2,036). dependency.lic is now ~110 lines.

What remains are runtime helpers (bankbot, slackbot, reportbot, hometown, verify_script, format_name) that dr-scripts still actively call. These are candidates for a future upstream into core lich.

Verification

All claims independently verified across all three repos (dr-scripts, gs-scripts, lich-5):

  • All 7 sentinel constants confirmed defined and set to true in core (arg_parser.rb, setup_files.rb, global_defs.rb, map_base.rb, startup.rb)
  • Every ungated helper confirmed to have active callers (or confirmed dead via git history)
  • custom_require callers (gate.lic, performance-monitor.lic) confirmed safe -- both have respond_to?(:start_scripts_if_available) guards
  • Deprecated stubs confirmed to have zero callers
  • Boot sequence confirmed fully dead (all respond_to? checks return false)

Companion PR

autostart.lic cleanup (gs-scripts): removes legacy DR dependency path and respond_to? guards that are now always true on 5.17.2+.

Test plan

  • bundle exec rspec spec/dependency_spec.rb -- 43 examples, 0 failures
  • Verify dependency loads cleanly in-game on lich 5.17.2+
  • Verify bankbot, slackbot, trade.lic hometown functions work
  • Verify autostart.lic still runs dependency and starts DR scripts

🤖 Generated with Claude Code

Core lich 5.17.2+ provides ArgParser, SetupFiles, ScriptManager,
map overrides, and DR startup natively via sentinel constants.
All 7 gated blocks were dead code and have been removed (-1086 lines).

Also removed: deprecated autostart stubs (no callers), one-shot
Settings['autostart'] migration, redundant parse_args/display_args
wrappers, and the fully dead boot sequence.

What remains: preamble (version check, game guard) and runtime
helpers (bankbot, slackbot, reportbot, hometown, verify_script)
that dr-scripts still call and have not yet been upstreamed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@MahtraDR
Copy link
Copy Markdown
Owner Author

Retargeting to upstream elanthia-online/dr-scripts

@MahtraDR MahtraDR closed this May 29, 2026
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.

1 participant