Skip to content

Automattic/wordpress-atmosphere / .agents/skills/review

Shared base for reviewing a diff, a branch or a PR in this plugin. How to read the diff, which repo guidelines to load for the changed paths, and the shape of a finding. Used by the code-review and security-audit agents.

FileKindSize
SKILL.mdskill md7.1 KB
guidelines/accessibility.mdmarkdown781 B
guidelines/authorization.mdmarkdown2.8 KB
guidelines/content-exposure.mdmarkdown6.8 KB
guidelines/cron.mdmarkdown1.9 KB
guidelines/hooks.mdmarkdown2.3 KB
guidelines/oauth.mdmarkdown3.6 KB
guidelines/output.mdmarkdown610 B
guidelines/records.mdmarkdown2.1 KB
guidelines/remote-fetch.mdmarkdown5.3 KB
guidelines/supply-chain.mdmarkdown582 B
guidelines/uninstall.mdmarkdown2.0 KB
guidelines/well-known.mdmarkdown1.4 KB
judge.mdmarkdown1.2 KB

guidelines/cron.md

View on GitHub
# Scheduled callbacks

Publish, update, delete and reaction-sync events: running twice, running stale, surviving a disconnect.

Applies to: `includes/class-atmosphere.php` (cron registration), `includes/class-publisher.php`, `includes/class-reaction-sync.php`, `includes/class-backfill.php`, `get_cron_hooks()` in `includes/functions.php`, and any new `wp_schedule_event` or `wp_schedule_single_event`

## Running twice

- `wp_schedule_single_event` can fire twice: concurrent workers, reactivation, `wp cron event run`, traffic spikes that trigger overlapping loopback requests. A handler with a visible side effect (a published Bluesky post, a stored comment) gates on a meta sentinel before the side effect.
- The claim is atomic: `add_option( $key, $value, '', false )` only succeeds when the row does not exist yet, which makes it race-safe.

## In-flight state

- A publish writes meta before (rkey reservation in `get_rkey()`) and after (the URI in `mirror_thread_records_meta()`). A comment deletion or status change in between leaves the two inconsistent; confirm the reconcile-after-publish pattern is applied (see `reconcile_comment_after_publish()`).

## Stale events

- A lifecycle transition cancels or supersedes queued work. A publish or restore after a queued delete does not leave the delete alive to remove the restored records. A new delete does not leave an older update able to write protected content first.
- Handlers re-check visibility when they fire (see "When a post stops being public" in `content-exposure.md`).

## Unscheduling

Every plugin-owned cron hook is listed in `Atmosphere\get_cron_hooks()`, and disconnect, deactivate and uninstall clear them with `wp_unschedule_hook()`, not `wp_clear_scheduled_hook()`. The latter only clears events whose args match, so arg-carrying single events (the retry ladder carries `array( $post_id )`) survive an args-less clear and fire against a *different repo* after a disconnect and reconnect to another account.
rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 194kUpdated Claude CodeCodexVerifiedInstall