Skip to content

fix(godforge): audit patches — NameError crash, version strings, deprecated env docs, env-var routing#9

Merged
diese-tech merged 7 commits into
mainfrom
claude/audit-godforge-forgelens-5Y7gT
May 14, 2026
Merged

fix(godforge): audit patches — NameError crash, version strings, deprecated env docs, env-var routing#9
diese-tech merged 7 commits into
mainfrom
claude/audit-godforge-forgelens-5Y7gT

Conversation

@diese-tech
Copy link
Copy Markdown
Owner

Summary

This PR applies three audit patches to the GodForge repository.

Patch 1 + 7 — Fix format_draft_show NameError and stale version strings (utils/formatter.py)

  • Critical bug fix: Removed the second (broken) call to _add_forgelens_status_field inside format_draft_show that referenced the undefined variable export, which would raise a NameError at runtime whenever .draft show was invoked.
  • Version string sync: Replaced all hard-coded v1.6 footer literals in embed footers with f"GodForge v{GODFORGE_VERSION} ..." so they track the module-level GODFORGE_VERSION constant (2.1.0-rc) instead of a stale string. Affected footers: format_draft_board, format_draft_show, format_draft_end, format_claim_embed, format_board_from_snapshot, and format_draft_end_from_export.

Patch 6 — Mark deprecated channel ID vars in .env.example

  • Inserted a single comment line above the three betting/handshake channel ID variables to make clear they are ignored unless GODFORGE_ENABLE_LEGACY_ECONOMY=true, since ForgeLens now owns betting and ledgers.

Patch 9 — Move hard-coded single-tenant constants in bot.py to env vars

  • Replaced the hard-coded _GOD_USER_ID = 146116042182098944 with _GOD_USER_ID = int(os.getenv("GODFORGE_OWNER_USER_ID", "0")).
  • Replaced the hard-coded REPORTS_CHANNELS = {1129404279808073758: 1496553890181550110, ...} dict with an env-var-driven dict comprehension reading GODFORGE_REPORTS_CHANNELS (comma-separated guild_id:channel_id pairs).
  • Added documentation for both new env vars at the bottom of .env.example.

Test plan

  • Invoke .draft show on an active draft — confirm no NameError is raised and the ForgeLens Status field appears once (not twice).
  • Check any draft embed footer — confirm it shows GodForge v2.1.0-rc instead of GodForge v1.6.
  • Copy .env.example to .env, set GODFORGE_OWNER_USER_ID and GODFORGE_REPORTS_CHANNELS to your Discord IDs, restart the bot, and verify elevated commands and report channel routing work correctly.
  • Confirm the bot starts without error when GODFORGE_OWNER_USER_ID and GODFORGE_REPORTS_CHANNELS are unset (defaults to 0 / empty dict, disabling those features gracefully).

https://claude.ai/code/session_01Xodut6PZZtu2JRzx8wqbik


Generated by Claude Code

@diese-tech diese-tech merged commit ca0e2bb into main May 14, 2026
2 checks passed
@diese-tech diese-tech deleted the claude/audit-godforge-forgelens-5Y7gT branch May 14, 2026 00:53
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