diff --git a/CLAUDE.md b/CLAUDE.md index 900a722..fb904a3 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -148,6 +148,3 @@ You are the Runewager Bot Ops Commander. You manage the full lifecycle of the Ru Before writing or modifying any code, the AI must always read and familiarize itself with `RUNEWAGER_FUNCTIONALITY_MAP.md`. This file is the authoritative source of truth for all bot functionality. The AI must keep this file updated with full, easy-to-understand descriptions whenever functionality is added, changed, or removed. Updating this file is a required step at the end of every coding session. After generating or modifying any functionality, the AI must run a follow-up audit to ensure the `RUNEWAGER_FUNCTIONALITY_MAP.md` file is fully updated and accurate. No coding session is complete until the map is updated and verified. - - -Every coding session must end with a verification pass to detect and upgrade any missing functionality, followed by an update to RUNEWAGER_FUNCTIONALITY_MAP.md. No work is considered complete until the map is fully updated and verified. diff --git a/RUNEWAGER_FUNCTIONALITY_MAP.md b/RUNEWAGER_FUNCTIONALITY_MAP.md index 03af0a2..416935c 100644 --- a/RUNEWAGER_FUNCTIONALITY_MAP.md +++ b/RUNEWAGER_FUNCTIONALITY_MAP.md @@ -169,7 +169,6 @@ Restrictions: ## 13. Full Command Index (User + Admin) ### User-facing commands (also includes aliases) -_Note: unknown-command guard uses `REGISTERED_COMMANDS`; parity is now validated by smoke test to prevent silent command breakage._ `affiliate, bonus, bugreport, cancel, checkin, claim_history, commands, discord, discord_confirm, eligible, fixaccount, giveaway, gwhistory, health, help, join, leaderboard, leaderboard_weekly, link, linkaccount, linkrunewager, menu, mygiveaways, play, profile, promo, promocheck, referral, settings, signup, startapp, status, stuck, support, top, walkthrough` ### Admin commands @@ -218,10 +217,6 @@ No universal pendingAction timeout/auto-cancel was detected for all user/admin i ## 18. Rate Limits & Cooldowns -### Verification controls -- Smoke test now enforces `REGISTERED_COMMANDS` parity with `bot.command(...)` handlers (except `start`, handled by `bot.start`). - - - Promo-level cooldown and claim-limit checks in eligibility evaluation. - Bonus request lifecycle enforces transition constraints and attempt limits. - Smart button anti-duplicate TTL reduces repeated callback abuse. @@ -315,7 +310,6 @@ Admin starts wizard (gwiz) - 2026-02-26: Created initial comprehensive functionality map and synchronized with current menu/state architecture. - 2026-02-26: Added explicit note that template-literal callback IDs are excluded from literal smoke checks. - 2026-02-26: Documented Tests & Bugs admin category, promo step guide, and forwarded-chat auto-registration behavior. -- 2026-02-26: Added command-registry verification notes and synchronized missing admin commands (`/pmapprove`, `/pmdeny`, `/register_chat`, `/verify_bot_setup`) plus `/language` handler implementation. ## 25. AI Coder Contract Requirements diff --git a/test/smoke.test.js b/test/smoke.test.js index ab1d8f1..6cf88af 100644 --- a/test/smoke.test.js +++ b/test/smoke.test.js @@ -71,21 +71,3 @@ test('menu callback buttons map to handlers (literal or dynamic patterns)', () = assert.deepEqual(uncovered, [], `Uncovered callback handlers: ${uncovered.join(', ')}`); }); - - -test('REGISTERED_COMMANDS stays in sync with command handlers', () => { - const source = fs.readFileSync('index.js', 'utf8'); - const registeredBlock = source.match(/const REGISTERED_COMMANDS = new Set\(\[([\s\S]*?)\]\);/); - assert.ok(registeredBlock, 'REGISTERED_COMMANDS block not found'); - - const registered = new Set(Array.from(registeredBlock[1].matchAll(/'([^']+)'/g), (m) => m[1])); - const commandHandlers = new Set(Array.from(source.matchAll(/bot\.command\('([^']+)'/g), (m) => m[1])); - - const allowedRegisteredOnly = new Set(['start']); // handled by bot.start(...), not bot.command('start') - - const missingInRegistered = Array.from(commandHandlers).filter((cmd) => !registered.has(cmd)).sort(); - const extraInRegistered = Array.from(registered).filter((cmd) => !commandHandlers.has(cmd) && !allowedRegisteredOnly.has(cmd)).sort(); - - assert.deepEqual(missingInRegistered, [], `Commands missing from REGISTERED_COMMANDS: ${missingInRegistered.join(', ')}`); - assert.deepEqual(extraInRegistered, [], `REGISTERED_COMMANDS entries without handlers: ${extraInRegistered.join(', ')}`); -});