Skip to content

Add opt-in automation effects, usage charges and durable perk management - #76

Draft
BenCodez wants to merge 23 commits into
masterfrom
codex/selected-effects-and-lifecycle
Draft

BenCodez wants to merge 23 commits into
masterfrom
codex/selected-effects-and-lifecycle

Conversation

@BenCodez

@BenCodez BenCodez commented Oct 10, 2026 •

Copy link
Copy Markdown
Owner

Registered banked-time commands now have 28 new regression cases covering permissions, self/staff/console identity, pure reads, supported limits, invalid input, durable writes before scheduled replies, uncertain publication failures and restart recovery. Tests exercise the real registered handlers, bank controller pause path and storage; the native online-refresh handoff is isolated.

Validation: 115 focused tests and all 455 clean-package tests pass, retaining every previous case. Exact compatible AdvancedCore candidate and published SimpleAPI dependency bytes were verified. Production code, existing tests and tracked dependency selectors are unchanged; shaded runtime contents match the previous candidate. Fresh independent focused review and current-source publication checks are recorded with this update. Live eligibility/player scheduling, normal dependency delivery and final feature acceptance remain outstanding. Keep this PR in draft.

Registered Diagnose command coverage now exercises self/other permissions, online target selection, console handling, deferred target reads, requester reply scheduling, disconnects and read-only durable state. Ten new cases use the production handlers and renderer with real feature/charge stores; existing tests and production behavior are unchanged.

Validation: 28 focused tests and 427 clean-package tests pass with the compatible AdvancedCore candidate and published SimpleAPI snapshot. All 417 prior cases remain, and the shaded artifact's entry bodies equal the previous candidate. These tests use controlled platform dispatch; final normal-dependency and live-platform acceptance remain outstanding. Keep this PR in draft.

Adds four independently configurable interaction effects, durable personal usage charges, queue management, banked personal time, diagnostics and local statistics. Existing timed perks retain their defaults when the optional settings are absent.

Behavior

  • AutoBlockRefill: refills a depleted placement hand from matching inventory items, preserving metadata and revalidating the hand/slot. Cancelled placements and no-op refills cost nothing.
  • VeinMining: bounded connected ore traversal without loading chunks, native break/protection/tool/drop handling and recursion prevention. Additional successful blocks are the usage unit; the available budget bounds the batch before breaking.
  • RightClickHarvest: main-hand mature crop harvesting, native cancellation/protection checks, one reserved inventory seed and replanting. Reuses AutoPlant requirements and avoids duplicate harvesting.
  • PrecisionMode: owner-selected MCPerks effects are suppressed while sneaking; suppression spends no charges.
  • Personal UUID/effect charge balances are distinct from activation allowances and elapsed duration. Confirm durable reservations before gameplay, release proved-unused units, and retain uncertain units as spent. Shared charged audiences are rejected; unlimited shared perks remain supported.
  • Queue entries retain stable IDs, ordered upcoming entries, requester and meaningful ETA/unknown state. Waiting entries reserve entitlement; starts consume it once behind durable fences. Cancel own waiting entries; staff may pause, remove or reorder. Uncertain starts never automatically replay or refund.
  • Opt-in personal banked time consumes only online eligible elapsed time and supports pause/resume without replaying activation hooks. Legacy absolute expiration remains separate. Persistent/one-shot/periodic effects that cannot safely pause are rejected for banked mode.
  • Diagnose uses actual execution decisions, current definition for new activation advice and retained grant options for running effects. After reload, changed world and activation-limit policy is reflected correctly. Inspection never debits balances.
  • Optional bounded local aggregate activations, queue wait and known skip reasons; successful-operation totals share the charge outcome ledger. Advisory counters reset on restart and use no external analytics service.

Commands and opt-in configuration

# In a perk definition; existing perks do not gain these effects automatically.
Effects: [VeinMining, PrecisionMode]
VeinMining:
  MaxBlocks: 16
  MaxDistance: 8
  Materials: [COAL_ORE, IRON_ORE, DIAMOND_ORE]
PrecisionMode:
  TargetEffects: [VeinMining, RightClickHarvest, AutoBlockRefill]
UsageCharges:
  Enabled: false
BankedTime:
  Enabled: false

Existing PerkQue remains authoritative. Optional LocalStatistics.Enabled is in Config.yml. README documents limits, units, permissions, seed policy and complete examples.

/mcperks SetUsageCharges <player> <effect> <amount>
/mcperks AddUsageCharges <player> <effect> <amount>
/mcperks GetUsageCharges <effect>
/mcperks Queue
/mcperks CancelQueue <entry-id>
/mcperks QueuePause <true|false>
/mcperks QueueRemove <entry-id>
/mcperks QueueMove <entry-id> <position>
/mcperks GetBankedTime <perk>
/mcperks PauseBankedTime <perk>
/mcperks ResumeBankedTime <perk>
/mcperks SetBankedTime <player> <perk> <seconds>
/mcperks Diagnose [player]
/mcperks LocalStatistics

Dependency and compatibility

Requires AdvancedCore PR #360, including the additive shutdown hooks, final-file completion contract and ServerData.mutateFinalData ownership API. The dependency version is 3.8.2-SNAPSHOT; its version string alone is not an immutable artifact identity. AdvancedCore is shaded into MCPerks, so server owners do not install a separate AdvancedCore plugin.

Java 21 minimum is unchanged. MCPerks does not declare Folia support; conditional scheduler paths do not establish full platform support. Existing data and configuration remain readable, with no implicit conversion of legacy duration into banked time or automatic charge refill. Gameplay, storage and arbitrary external commands are not one universal atomic transaction; uncertain side effects remain conservative as documented.

Current validation and remaining gates

Current head: 5ad509178e8818e85656d9685dfbc4f931958e4c, using the additive contract in AdvancedCore PR #360 at 0e3ba8239093dc94a5d2c7409d041a61cf7de427.

The runtime integration exposes the ordered ServerData owner's backing publication monitor and confirms native overflow publication before acknowledging replay receipts. Banked-time setters checkpoint before their flags become visible and retain uncertain eligibility until a current observation permits resume; storage work stays outside the bank controller monitor.

The upgraded scheduler no longer checks entity validity by default on Spigot/Paper. Immediate owner callbacks now recheck plugin enablement and player validity before gameplay, retaining the existing one-shot action/retirement claim. A queued callback after disable or entity invalidation retires once, including duplicate callbacks. Delayed owner checks retain their established behavior.

Scheduler fixtures use the actual upgraded return type and real default FoliaLib options. The additional simulated live queue player is explicitly valid. Existing assertions, queue estimates, balance checks and production dependency selectors remain intact.

  • 169 focused scheduler, reload, bank, overflow and queue tests passed.
  • 384 tests passed in a clean package, zero failures, errors or skips. All 382 prior cases remain plus two real Spigot/Paper disable-before-callback cases.
  • All 25 suite classpaths selected exact rebuilt AdvancedCore SDK 7c4a495cad823bafcfba271b9ea68aa6bd84bdb33191c91e52bb1570a4911827 and published SimpleAPI snapshot 43 9b6d924658a236ae0ac0f1aadc8c5f9fb6a7306253c306c7496723836cb6adeb.
  • The 5,001-class shaded JAR retains the candidate native-publication and reward-scheduler instructions and all four publication/shutdown APIs. ZIP integrity, test-library exclusion and retained discovery were verified. JAR SHA-256: 01a07ef8550397a991fe2cb1b916ad8141e89b2f69babb8bcd1b15b0aaac6368 (9,302,079 bytes).
  • A fresh independent GPT-6.1 Sol Extra High review of the six-file scheduler/fixture delta, its callers and real dependency bytecode returned No findings. Earlier feature and runtime reviews retain their unchanged scopes; this is a focused verdict.

PR #76 remains draft. Isolated local selectors are validation-only and are not published production pins or normal Maven releases. The normal AdvancedCore snapshot 133 still lacks the four required APIs. The upgraded dependency also removed the old JVM getImpl():ServerImplementation descriptor; fixture adaptation and these source builds do not restore old-binary compatibility. Normal-artifact delivery, compatibility coordination and final consumer acceptance remain separate.

MCPerks has no declared hosted Maven workflow; a hosted build pass is not inferred. Current-head automatic feedback must be checked separately. No live Paper, Folia, database, client, graphical or shutdown/restart acceptance is claimed. MCPerks does not declare Folia support. No merge, release or deployment is performed.

Harvest admission regressions

Test-only follow-up 5934bf383d31a28a852af6c24e2a29ad4e1989fa adds 15 cases across all five supported crops. Mature crops without a replant seed and immature crops leave inventory, blocks and the durable labeled ledger unchanged without scheduling gameplay. Eligible controls reserve before breaking and consume one seed and one successful harvest use, including duplicate callback handling. Production code, existing tests and the tracked dependency POM are unchanged.

Focused RightClickHarvestAdmissionTest: 15 passed. Full clean package: 399 passed, zero failures/errors/skips, including every prior 384 case, in 39 seconds. Validation used an isolated temporary selector for AdvancedCore PR360 source 5da4c2b74c06d2d3b5c0fb32bff9ca3e71d8f71f, SDK SHA256 4edcce11ba62e34294096ac93dc3d7fa7e261f84abe4952259c056aa0e44ef42, and published SimpleAPI43 9b6d924658a236ae0ac0f1aadc8c5f9fb6a7306253c306c7496723836cb6adeb; all 26 actual suite classpaths were checked. Packaged JAR SHA256 c28af61db0ef3e5b293e774d508822965774b4bbff3fc0282fcbd772533fb94d, 9,302,085 bytes. Every ZIP entry matches the prior exact-dependency candidate; archive metadata changes the outer SHA. Tests/JUnit/Mockito remain excluded. Fresh independent focused new-test and affected-caller review: No findings.

These are listener/real-ledger tests with mocked Bukkit world/player boundaries, not native protection-plugin or live-world acceptance. The PR stays draft; remaining complete feature, normal dependency and runtime acceptance gates are unchanged. MCPerks does not declare Folia support.

Registered queue command regression coverage

Test-only follow-up 24ff4a68ec2bb6ba8a0e1feed3d09512507a49e3 adds 18 cases through the actual registered command dispatcher and durable queue store. Coverage includes permission denial, self versus staff cancellation, starting/uncertain fences, pause/resume/reordering, malformed input, durable completion before scheduled replies, publication failure and read-only queue display/estimates. Ordered storage barriers prevent negative tests from passing before mistakenly admitted work finishes.

Final validation: 18 focused tests and a fresh clean package of 417 tests passed, retaining all 399 previous outcomes. All 27 actual suite classpaths selected the same candidate AdvancedCore SDK from 5da4c2b and published SimpleAPI snapshot 43. Every packaged ZIP entry matches the previous validated artifact; production, tracked POM and existing tests/helpers are unchanged. A fresh independent focused review of the final test and affected contracts returned No findings.

The PR remains draft for the previously recorded final feature, dependency and platform acceptance gates. This adds deterministic command-level regression evidence; it does not establish live protection-plugin/world behavior or release readiness. No artifact was published, server launched or PR merged.

@coderabbitai

coderabbitai Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: de369e53-c3f7-425b-ac14-3d38dd0e2911
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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 Oct 10, 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-10-10T18:35:38.582318Z 37c912b New commits
🔒 Security Review ✅ Completed 2026-10-10T00:20:22.298573Z c2d0d2b PR opened
ℹ️ 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: c2d0d2b3c8

ℹ️ 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: 07d44dc9df

ℹ️ 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: c58888c0d9

ℹ️ 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: b769075a14

ℹ️ 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: cf1ebc8702

ℹ️ 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: 13e4d21e8f

ℹ️ 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: 6d097a02dd

ℹ️ 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: 37c912baa6

ℹ️ 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".

@BenCodez
BenCodez marked this pull request as draft October 10, 2026 20:43
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