Phase 4 LLD: Chain System Backlog — Comprehensive Design Document#233
Phase 4 LLD: Chain System Backlog — Comprehensive Design Document#233DiamondDagger590 wants to merge 83 commits into
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…ager keys, add QuestChainPlayerData to McRPGPlayer
…eteEvent with tests
…tCancelEvent expiration flag
…ompletionSlot; merge chain runs into QuestHistoryGui display
- Pass Throwable as second arg to Logger.log() in all config parse catch blocks in QuestChainConfigLoader and QuestConfigLoader so stack traces are preserved in log aggregators instead of only the message string - Guard QuestCancelEvent.getQuestDefinitionKey() against null questDefinition field (populated only via the two-arg constructor); falls back to getQuestInstance().getQuestKey() so callers always receive a non-null key - Fix ChainStepCompletionSlot.onClick() false-return paths: return true to prevent item movement and send a localized warning message to the player when the quest key is malformed or the definition is no longer registered - Add QUEST_CHAIN_HISTORY_GUI_UNKNOWN_STEP_MESSAGE locale key and English string for the unknown-step feedback message
…18,19 | Medium 26,27 | Low 41,43,44,45)
… docs (Medium 25 | Low 36,47)
…tions - Add QuestChainManagerTest covering getChainStatus, forceAdvanceChain, handleQuestCancelled/Expired defensive paths, and loadChainStates delegation - Add QuestChainStateDAOTest verifying loadAllChainStates, saveChainState, deleteChainState, and deleteAllForPlayer via mocked JDBC - Add QuestChainCompletionLogDAOTest covering logCompletion, getCompletedQuestKeys, getAllCompletedQuestKeysByChain, getChainCompletionRuns, getStepsForRun, and getChainParticipantQuestKeys - Extract shared writeFile/deleteRecursively helpers from QuestChainConfigLoaderTest and QuestChainReloadTest into TestFileUtils in testFixtures - Add @DisplayName annotations to all QuestChainRegistryTest methods - Swap @DisplayName/@test order to @test then @DisplayName across all chain test classes to match project convention
…ions - Add Quest Chain System section to Domain Terminology covering QuestChainDefinition, QuestChainStep, QuestChainPlayerState, QuestChainPlayerData, QuestChainState, QuestChainRepeatMode, QuestChainManager, ChainPersistenceService, ChainQuestStarter, ChainAutoStartTrigger, QuestChainStartCondition, and all chain lifecycle events - Document test conventions in Testing section: @test before @DisplayName ordering, TestFileUtils for filesystem helpers, mocked JDBC pattern for DAO tests - Add quest chain system to the Keeping This File Current maintenance table
…UI polish, tests Dirty-version CAS, write-generation gate, DAO boolean returns, sync flush on logout, cancel listener NPE fix, progress listener logging, offline-player event support, fast-disconnect guard, loading/empty GUI states, date formatting extraction, repeat-mode config warning, locale and command path fixes, test coverage.
…tes, SQLException reads QuestChainStateDAO and QuestChainCompletionLogDAO write methods now return un-executed List<PreparedStatement> for use with FailSafeTransaction instead of internally catching and returning booleans. Read methods propagate SQLException to callers instead of swallowing. ChainPersistenceService uses FailSafeTransaction for saveChainStateAsync, persistAdvancementAsync, and flushChainStatesSync. Dirty flags are cleared only by the authoritative synchronous logout flush. Async dirty-clearing callbacks removed. QuestChainManager.resetChain uses an explicit manual transaction for atomic paired deletes since success detection is required to decide whether to remove in-memory state. DAO tests updated to match new return types.
…hainPlayerData resetChain now calls prepareForFlush instead of cancelPendingSave so the write generation is incremented before the delete, preventing any in-flight async saves from restoring stale data after the hard reset. restartChain calls cancelPendingSave before cancelling the active chain quest so no queued save can race with the imminent state reset. startStepForPlayer now calls chainData.updateQuestKeyIndex after resetToStep so the quest-to-chain reverse index stays consistent without a full rebuild. restartChain completion branch (no uncompleted step found) also calls updateQuestKeyIndex after state.complete to clear the stale index entry. questKeyToChainKey changed from HashMap to ConcurrentHashMap for thread safety.
Server Owner ReviewLooking at this diff, I need to focus on what matters to me as a server owner: the YAML resource files, Server Owner ReviewCONCERN: CONCERN: The CONCERN: The CONCERN: Seven new tutorial quest YAML files and a CONCERN: The CONCERN: Multiple new permission nodes are introduced ( CONCERN: The diff references renaming CONCERN: The new CONCERN: The CONCERN: The CONCERN: Two new database tables are created ( CONCERN: The HLD documents a Migration required: YES — two new database tables, new player setting with default behavior affecting existing players, new config keys in Reload-safe: PARTIAL — chain definitions and quest definitions support |
Extensibility ReviewBreaking change risk: MEDIUM — multiple public API signatures changed (Long→Instant, method renames, new mandatory parameters) without deprecation bridges, and new chain events have nullable-consistency gaps that will silently drop offline-player notifications from addon listeners. CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: |
Testing ReviewLooking at this diff, I need to identify what changed in production code vs. test code, then apply every checklist item. The diff is almost entirely documentation files ( Production files changed: No testing concerns found. |
Security ReviewNo security concerns found. The diff contains exclusively documentation files ( |
Addons can now distinguish soft-disable from permanent removal by checking event.getReason(). Both AbilityRegistry callsites pass explicit reasons: PERMANENT for unregisterAbility, SOFT_DISABLE for softDisableAbility. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ln8kpPanSWnnjZEsfMNKwg
GUI/UX ReviewThe diff is almost entirely documentation, cursor rules, and planning markdown files. The only GUI-relevant content surfaced is in Before I can apply the checklist, I need the source files themselves. Please paste or attach one or more of the following:
Which of these do you have available? |
Server Owner ReviewLooking at this diff, I need to focus on what a server owner actually cares about: the YAML files, Let me work through the checklist systematically. Server Owner ReviewCONCERN: CONCERN: The CONCERN: Eight new permission nodes are introduced ( CONCERN: The HLD references CONCERN: Seven tutorial quest YAML files are added ( CONCERN: CONCERN: Two new database tables are introduced ( CONCERN: The localization files ( CONCERN: The CONCERN: The admin commands are restructured — the path changes from CONCERN: The CONCERN: The HLD reward summary shows significantly higher values than earlier versions (e.g., Q1 went from 500 to 1,000 boosted XP, Q7 from 1,000 to 2,500), but no comment in any YAML shown in this diff explains the scaling equation or provides sample outputs at key thresholds. SummaryMigration required: YES — new DB tables, new config keys, new permission nodes, renamed command paths, renamed permissions. Reload-safe: PARTIAL — chain definitions reload (documented), but active quest reconciliation during reload has known gaps (audit finding E3: offline players missed; finding re: stale active instances). The DB migration bug (E1) means a failed migration is unrecoverable without manual DB intervention. Critical items for server owners before this ships:
|
Extensibility ReviewBreaking change risk: MEDIUM — multiple public API signatures changed (Long→Instant, method renames, new mandatory parameters) without deprecation bridges, and new chain events have nullable-player inconsistencies that will silently drop offline notifications from addon listeners. CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: |
Testing ReviewLooking at this diff, I need to examine what's actually changed in terms of testable production logic versus what test coverage exists. The diff is primarily documentation files ( However, the documentation itself — specifically CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: Multiple test files call CONCERN: Production files changed: Test files present: None added or modified in this diff Coverage gaps: |
Security ReviewNo security concerns found. The diff contains exclusively documentation files ( When the implementation files referenced in these planning documents (e.g., |
A6: Add eviction Javadoc to retryCounters field in QuestChainManager A4: Deduplicate stripContentPackSuffix to McRPGCommandBase A2: Replace raw Bukkit scheduler with DelayableCoreTask in AvailabilityWindowChecker A7: Extract ChainExpirationHandler from QuestChainManager (~155 lines) A5: Replace QuestTemplate telescoping constructors with Builder pattern Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ln8kpPanSWnnjZEsfMNKwg
GUI/UX ReviewThe diff is primarily documentation, rule files, and planning markdown. The only GUI-relevant material is the Applying the checklist against what is present: CONCERN: G1 from CONCERN: G2 from CONCERN: G3 from CONCERN: G4 from CONCERN: No other GUI source files, slot classes, or localization YAML files are present in this diff. The five concerns above cover all GUI/UX issues surfaced by the changed content. |
Server Owner ReviewLooking at this diff, I need to focus on what actually matters for a server owner: YAML files, Let me work through the checklist against the YAML resources and config-touching changes visible in the diff. FindingsCONCERN: CONCERN: CONCERN: New CONCERN: Seven new tutorial quest YAML files are referenced but their content is not shown — it is impossible to verify whether they have inline comments, correct key naming, or safe default values CONCERN: CONCERN: CONCERN: CONCERN: New permission nodes for chain admin commands are added but the diff does not show the CONCERN: CONCERN: CONCERN: Two new SQL tables ( CONCERN: CONCERN: CONCERN: SummaryMigration required: YES
Reload-safe: PARTIAL
|
Extensibility ReviewBreaking change risk: MEDIUM — multiple public API signatures changed (Long→Instant, method renames, constructor additions) without deprecation bridges, and two chain events inconsistently require CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: New |
Testing ReviewLooking at this diff, I need to identify what's actually testable code vs. documentation/planning files, then apply the checklist. Observation: The diff is almost entirely documentation files ( I'll report on what the diff itself reveals, including the self-documented gaps. CONCERN: Availability window subsystem (T1–T7) has zero test coverage despite being new non-trivial pure-Java logic. CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: Tests in CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: The seven chain admin commands ( Production files changed: |
Security ReviewNo security concerns found. The diff contains exclusively documentation files ( |
…3, T6, T10) AvailabilityWindowTest covers AvailabilityConfig, AvailabilityWindowDefinition, WindowBoundary.Fixed/Recurring, and WindowClosePolicy.fromString — all pure JUnit with no MockBukkit dependency. AbilityRegistryTest covers the soft-disable/re-enable lifecycle including state transitions and event firing assertions. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ln8kpPanSWnnjZEsfMNKwg
Move 8 chain test files from event/quest/ and listener/quest/ to their correct chain/ subdirectories, update package declarations, fix annotation ordering, remove unused imports, and fix constructor signature mismatch in QuestChainLoginListenerTest. Also fix AbilityRegistryTest to use getOrCreateMock() for test ordering compatibility. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ln8kpPanSWnnjZEsfMNKwg
GUI/UX ReviewLooking at this diff, the primary GUI-relevant changes are the new quest chain GUI files and slots referenced in CONCERN: CONCERN: CONCERN: CONCERN: The CONCERN: CONCERN: The CONCERN: The tutorial disables itself via CONCERN: CONCERN: The CONCERN: The |
Server Owner ReviewLooking at this diff, I need to focus on what a server owner actually cares about: YAML config files, Let me work through the checklist systematically. Server Owner ReviewCONCERN: CONCERN: The CONCERN: Seven new YAML quest definition files are introduced under CONCERN: CONCERN: The new permission hierarchy introduces CONCERN: The old permission documented in the HLD for tutorial admin was CONCERN: The chain YAML CONCERN: Similarly, CONCERN: The DB migration audit finding E1 documents that CONCERN: Two entirely new SQL tables are created ( CONCERN: The CONCERN: The CONCERN: The CONCERN: The audit document SummaryMigration required: YES
Reload-safe: PARTIAL
|
Extensibility ReviewBreaking change risk: MEDIUM — multiple public API signatures changed (Long→Instant, method renames, new mandatory parameters) without deprecation bridges, and several new chain events have nullable-player inconsistencies that will silently drop addon intercepts. CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: |
Testing ReviewLooking at this diff, I need to assess what production code changed versus what tests exist. The diff is primarily documentation, planning files, and cursor rules — but it references a large implementation (Phases 1–3) that is not shown in the diff itself. The AUDIT_RESULTS.md and PLAN_05_TESTING.md files within the diff explicitly document the testing gaps. I will apply the checklist to what is visible and what is described. CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: Five test classes call CONCERN: The entire availability window subsystem (7 new classes with non-trivial logic) contains zero tests, yet PLAN_05_TESTING.md is a planning document — no actual test files were added in this diff CONCERN: No regression test for the DB migration version-bump-on-failure bug (E1) CONCERN: CONCERN: Production files changed: |
Security ReviewNo security concerns found. The diff contains exclusively documentation files ( |
G1: Send rendered Component via getLocalizedMessageAsComponent instead of raw MiniMessage string in onClick, fixing unrendered markup in chat. G2: Wire CHAIN_PREVIEW_REWARDS_HIDDEN into buildDefinitionPreview as a lore line, making the previously dead localization key reachable. G4: Apply palette color resolution to preview item display name and lore via MiniMessage serialize/resolve/deserialize round-trip. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ln8kpPanSWnnjZEsfMNKwg
These files served as working documents during the chain backlog audit and are no longer needed now that all planned fixes are complete. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ln8kpPanSWnnjZEsfMNKwg
GUI/UX ReviewLooking at this diff, I need to apply the GUI/UX checklist to the actual GUI-relevant changes. The diff is primarily documentation (HLD, LLD, CLAUDE.md, cursor rules) with references to GUI files. Let me extract every GUI-relevant claim and flag problems. CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: The CONCERN: CONCERN: The CONCERN: The HLD describes |
Server Owner ReviewServer Owner ReviewOverviewThis is a large diff covering documentation, internal coding rules, and implementation of a quest chain system with tutorial content. From a server owner perspective, I'm focusing on the YAML configs, CONCERN: New CONCERN: No CONCERN: The CONCERN: Two new SQL tables ( CONCERN: New permission nodes use inconsistent naming — CONCERN: CONCERN: No CONCERN: New chain YAML files ( CONCERN: Repeat modes CONCERN: CONCERN: CONCERN: "Player must be online" restriction on all chain admin commands is not documented in the YAML or in-game help — server owners cannot run these from console for offline players CONCERN: Chain state re-resolution on reload logs SummaryMigration required: YES — Two new SQL tables must be created. No Reload-safe: PARTIAL — Chain definitions reload via |
Extensibility ReviewBreaking change risk: MEDIUM — The diff introduces several new public API surfaces (events, interfaces, registry keys, builder-only construction paths) with gaps in nullability contracts, missing cancellable pre-events for chain lifecycle transitions, and one confirmed interface addition without a CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: The CONCERN: |
Testing ReviewLooking at this diff, I need to identify what production code was actually changed versus documentation/config files. The diff is heavily truncated, but I can work with what's visible. The diff contains:
However, the documentation extensively describes production code that was implemented across Phases 1, 2, and 3. The diff references numerous new production classes but contains zero corresponding test file changes. Let me flag the concerns based on what's described as "implemented." CONCERN: The diff documents extensive production code across three implementation phases (Phase 1, 2, 3) as "Implemented" but contains zero test file additions or modifications. CONCERN: CONCERN: Seven new objective types ( CONCERN: Four new reward types ( CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: Chain admin commands ( CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: The LLD (Phase 1, section 7) explicitly promises "Tests (see Phase 1 LLD section 7)" but section 7 of the LLD is truncated in the diff and no corresponding test files appear anywhere in the diff. Production files changed: Test files present: None Coverage gaps: |
Security ReviewNo security concerns found. The diff is entirely documentation and developer-tooling content: Markdown files ( |
Summary
This PR adds the Phase 4 Low-Level Design (LLD) document that comprehensively specifies all 13 remaining backlog items for the quest chain system. The document provides detailed implementation guidance for timestamp modernization, quest reload safety, ability unregistration reversibility, chain repeatability, availability windows, quest expiration behaviors, chain start conditions, lifecycle events, and content introspection.
Key Sections
The 2100+ line LLD covers:
Timestamp Refactor (§1) — Migrate quest/chain timestamps from
Longepoch millis toInstantacrossQuestInstance,QuestChainPlayerState, and all DAOs with boundary conversionsQuest Reload Fixes (§2) — Implement finished quest cache invalidation and active instance reconciliation to cancel stale instances when definitions change, with player notifications
Ability Unregistration Reversibility (§3) — Track soft-disabled abilities in
AbilityRegistryinstead of permanent removal, enabling re-registration when quest definitions are restored on reloadTutorial Bypass Scope Fix (§4) — Harden bypass permission check to reference tutorial chain key directly instead of source key
AbilityType Refactor Deferred Items (§5) — Extract
isAlwaysAvailable()predicate, createAbilityNameResolvercollaborator, add comprehensive filter testsChain Repeatability (§6) — Implement
RepeatEvaluatorfor all repeat modes (UNLIMITED,COOLDOWN,LIMITED,COOLDOWN_LIMITED) with cooldown math and completion limitsAvailability Windows (§7) — Design sealed
WindowBoundaryinterface (fixed/recurring),AvailabilityWindowDefinitionwith year-wrapping logic,ChainAvailabilityCheckerscheduled task, and three window-close policies (EXPIRE_ACTIVE,ALLOW_FINISH,EXPIRE_WITH_GRACE)Quest Expiration Behaviors (§8) — Dispatch on-quest-expire actions (
retry,restart-chain,skip) with retry counters and grace periodsChain Start Conditions & TimeGateChainCondition (§9) — Define
QuestChainStartConditioninterface and implement first built-inTimeGateChainConditionfor time-gated chainsChain Lifecycle Events (§10) — Add
QuestChainExpireEvent,QuestChainRestartEvent,QuestChainStepRetryEventContent Introspection Commands (§11) — Chat-based commands for listing/inspecting quests, chains, abilities, and their properties
Implementation Order (§12) — Sequenced 5-phase rollout prioritizing foundational changes (timestamps, reload fixes) before feature-heavy items (availability windows, expiration behaviors)
File & Locale Keys — Complete summary of new files, modified files, and required localization keys
Notable Design Decisions
InstantexclusivelyEXPIRE_WITH_GRACEpolicy use in-memory task tracking with immediate player warningsTesting Strategy
Comprehensive test coverage specified for all major components:
https://claude.ai/code/session_01Ln8kpPanSWnnjZEsfMNKwg