Wave A: extract load monitor and add priority registry#25
Merged
Conversation
This was referenced May 7, 2026
Lock the tier list to the four canonical constants in fixed order so filters cannot add tiers or reorder them, and validate the hypercart_query_guard_action_priority filter return against that list instead of trusting any string that comes back. Document the extend-vs-clear semantics on the registry filter so a clear must be explicit (empty array) rather than implied by omission. Add a no-WP-runtime PHPUnit suite covering both extracted classes — pattern matching and tier semantics for the registry, and threshold clamping, dwell, hysteresis exits, mixed-metric severity, the no-detector failsafe, and round-trip persistence for the load monitor. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
noelsaw1
added a commit
that referenced
this pull request
May 7, 2026
Move the original P1-PRIORITY-CC-AS planning doc from 1-INBOX to 3-DONE with a completion header mapping its phases to shipped waves: Phase 1 to Wave A (PR #25), Phase 2 to Wave B (PR #26), Phase 3 carved out into the new Wave C design doc. Add PROJECT/2-WORKING/P1-MUTEX-GUARD.md, the Wave C design for a third subsystem that prevents thundering-herd patterns by deduplicating concurrent invocations of the same operation. The doc captures storage decisions (wp_options + autoload no, atomic INSERT...ON DUPLICATE KEY UPDATE with PHP-anchored time, expires_at|nonce delimited value, md5 key hashing), the four-method API with reentrancy and TTL semantics, explicit caller patterns, contention-only logging defaults, and a phased rollout with checklists. Phase 1 ships the smallest thing that solves the NoFraud admin_init herd; Phase 2 is gated on production evidence. Drop empty placeholder files and the unused AGENTS-NAV-CMS.md as part of folder cleanup. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 tasks
This was referenced May 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
class-hcqg-load-monitor.phpclass-hcqg-priority-registry.phpwith a filterable default hook-to-tier map for future Wave B workhypercart-query-guard.phpas the bootstrap and throttle-control entrypointScope
This is Wave A only. It is intended to preserve the Phase 1 throttle behavior already on
mainwhile making the codebase easier to extend for per-action throttling.Notes
class-hcqg-priority-registry.phpis intentionally inert in this PR; it is groundwork for Wave B.Validation
php -l hypercart-query-guard.phpphp -l class-hcqg-load-monitor.phpphp -l class-hcqg-priority-registry.phpgit diff --check