Skip to content

Extract platform-neutral reward orchestration - #326

Open
BenCodez wants to merge 14 commits into
masterfrom
codex/shared-reward-orchestration
Open

BenCodez wants to merge 14 commits into
masterfrom
codex/shared-reward-orchestration

Conversation

@BenCodez

@BenCodez BenCodez commented Sep 13, 2026

Copy link
Copy Markdown
Owner

Scope

Third Fabric/Forge/NeoForge preparation step. This branch is based on the current head of #317 (d23509d) so it inherits that PR's durable completion, ordering, replay, and shutdown fixes instead of reimplementing or weakening them.

  • Adds a Bukkit-free SharedRewardOrchestrator for sequential reward execution.
  • Adds explicit platform, durability, requirement, execution-context, plan, and step boundaries.
  • Native items/sounds/effects/permission-provider work remains outside the orchestrator in platform adapters.
  • The durability boundary owns resume cursors, checkpoint persistence, and offline deferral; the orchestrator intentionally creates no second queue, replay store, or checkpoint format.
  • A step is checkpointed only after its returned completion stage has completed successfully. DEFERRED work is never checkpointed as delivered.
  • Player availability is rechecked before every player-required step, so a disconnect can defer only the remaining suffix.
  • Nested orchestration returns the real child completion stage, preserving parent/child ordering.
  • Requirements, chance, delay, partial failures, shutdown, durable resume, and nested completion are covered by headless tests.

Dependency order

This PR has two prerequisites before it can become the integration base:

  1. Extract platform-neutral SQL backend initialization #324 platform-neutral SQL backend initialization
  2. Add shared user/cache lifecycle and SQL enumeration #325 shared user/cache lifecycle
  3. Add ordered async reward injection support #317 ordered/durable reward completion (this branch is based on its current head)
  4. This PR shared orchestration
  5. VotingPlugin shared core follow-up

#317 reconciliation

All currently reported #317 review threads are resolved at the base used here, including the latest effective-payload fix for EXP: 0 / EXPLevels: 0. This PR does not edit #317's replay queue/checkpoint implementation and does not redefine “completed” as “task submitted.” The new platform/durability contracts explicitly require completion to represent the underlying operation and durable write.

Validation status

Ready for review at the maintainer's request; not a claim of merge readiness. The normal local repository checkout/build environment was unavailable to the implementation session, so the branch has not been represented as locally Maven-validated. At the ready-for-review check, no PR-triggered GitHub Actions run was returned for head da23f3c0dd893fd48e28fd832702f185f0363d46; no passing repository build is claimed for this head. Codex code and security reviews started automatically when the draft was marked ready. No duplicate review request was sent.

The added tests use a non-Bukkit fake platform and durability adapter. They are headless regressions, not live-server tests.

Remaining integration blocker

The existing large Reward/RewardExecutor implementation from #317 has not yet been switched to construct/execute SharedRewardPlan instances. The connected GitHub write interface only supports whole-file replacement, and those files are actively changing in #317, so rewriting them here would risk overwriting concurrent durability work. Until that adapter/wiring is completed safely, this PR demonstrates the shared orchestration contract and behavior but does not yet satisfy the full “existing Bukkit path delegates through it” acceptance criterion. Marking ready for review does not remove this blocker.

No merge/release/deploy is requested.

Base automatically changed from codex/async-reward-injections to master September 13, 2026 02:44
@BenCodez
BenCodez marked this pull request as ready for review September 13, 2026 04:45
@coderabbitai

coderabbitai Bot commented Sep 13, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 12 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 6407d375-3440-4fee-acc5-df1f35c526d9

📥 Commits

Reviewing files that changed from the base of the PR and between 3de4b66 and 026ece9.

📒 Files selected for processing (15)
  • AdvancedCore/src/main/java/com/bencodez/advancedcore/core/reward/SharedRewardContext.java
  • AdvancedCore/src/main/java/com/bencodez/advancedcore/core/reward/SharedRewardDurability.java
  • AdvancedCore/src/main/java/com/bencodez/advancedcore/core/reward/SharedRewardOrchestrator.java
  • AdvancedCore/src/main/java/com/bencodez/advancedcore/core/reward/SharedRewardPlan.java
  • AdvancedCore/src/main/java/com/bencodez/advancedcore/core/reward/SharedRewardPlatform.java
  • AdvancedCore/src/main/java/com/bencodez/advancedcore/core/reward/SharedRewardProgress.java
  • AdvancedCore/src/main/java/com/bencodez/advancedcore/core/reward/SharedRewardRequirement.java
  • AdvancedCore/src/main/java/com/bencodez/advancedcore/core/reward/SharedRewardResult.java
  • AdvancedCore/src/main/java/com/bencodez/advancedcore/core/reward/SharedRewardStep.java
  • AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/rewards/SharedRewardChainRegressionTest.java
  • AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/rewards/SharedRewardDurableDecisionTest.java
  • AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/rewards/SharedRewardNullRequirementTest.java
  • AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/rewards/SharedRewardOrchestratorTest.java
  • AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/rewards/SharedRewardReviewFollowupTest.java
  • AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/rewards/SharedRewardStackSafetyTest.java

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 13, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-13T16:33:55.288269Z 026ece9 New commits
🔒 Security Review Completed 2026-09-13T04:48:58.092630Z da23f3c Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: da23f3c0dd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Address Codex 3998759040 and 3998759042. Persist the initial decision,
placeholder snapshot and stable definition/ordered-plan fingerprint before
step zero, delay or offline deferral. Resume without rerolling requirements
or chance, reject incompatible/unversioned progress without changing it,
and continue awaiting actual action and checkpoint completion.

Keep legacy signatures/non-durable integrations. Durable adapters must
implement versioned snapshot and atomic begin through their existing replay
owner; unsupported adapters fail closed. No second queue or replay store,
no changes to #317 native execution, no Bukkit wiring or loader claims.

Add 12 regressions and retain/update all 7 existing orchestration tests.
All 19 methods passed locally against JDK21-compiled production classes
using a small assertion/annotation harness (not Maven or the JUnit engine).
Includes a test-only disk restart and lost-acknowledgement scenarios.
Local syntax/whitespace checks passed. Full repository Maven/JUnit and
packaged validation must run in Actions; live server/SQL not available.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3b1782d2ae

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Address Codex 3998844331. Persist an absolute notBefore deadline with the
initial eligibility decision and retain it on every progress advance.
Recovered work waits only the remaining duration, including after first-step
failure, offline deferral or a lost initial persistence acknowledgement.
Reject delayed legacy cursor-zero snapshots without timing proof instead
of restarting or bypassing the configured delay. Keep old constructors and
provide an overridable platform clock without breaking existing adapters.

Add four deterministic clock/restart regressions and retain the existing
nineteen orchestration/decision tests. All twenty-three methods passed with
JDK21-compiled production classes and the local assertion/annotation harness;
this is not Maven or the JUnit engine. Incremental whitespace checks passed.
Full repository tests and packaged validation remain through GitHub Actions;
no live SQL/server test or native loader support is claimed.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ac51398a5e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dd46939370

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Retain concurrent commit dd46939's iterative sequencing and existing stack
regression rather than overwriting it. Restore the final post-checkpoint
shutdown check and normalize a null final requirement to NOT_ELIGIBLE.

Add eleven headless regressions for long durable chains/requirements,
real stage ordering, callback threads, partial failure, disconnects,
checkpoint failure, shutdown and null requirements. No executor, blocking
wait or durability contract changes. Local JDK21 syntax and reconstructed
incremental whitespace checks passed; full Maven/JUnit and packaged checks
require GitHub Actions. No live-server/database validation is claimed.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e5ce6370db

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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