[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6GKSW2VFKAK2K7H0VGHDHXJ":3,"skill-same:01M6GKSW2VFKAK2K7H0VGHDHXJ":89},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":39,"linkOnly":40,"markdownContent":41,"markdownBody":42,"frontMatter":43,"refName":44,"commitSha":45,"skillDirectory":46,"forksCount":47,"repositoryHtmlUrl":48,"repositoryHomepageUrl":49,"ownerHtmlUrl":50,"ownerBlogUrl":51,"ownerDescription":6,"updatedAt":52,"install":53,"resources":66},"01M6GKSW2VFKAK2K7H0VGHDHXJ","acorn-background",null,"Use when work must run outside the request, on a schedule, or be logged in an Acorn project - WP-Cron vs Action Scheduler vs Laravel queues (make:job, ShouldQueue, queue:work, failed_jobs), console commands (make:command, wp acorn \u003Ccommand>), Schedule::command and schedule:run from system cron, Laravel Redis and Cache vs transients, logging channels (Log::, LOG_CHANNEL, stderr, storage\u002Flogs). For tables use acorn-data; for object cache tuning use wp-performance.","hekivo\u002Fkivo-wise","hekivo","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F278159278?v=4","01M6GKH8S3Z4CAJ9RRR607G1WJ","Hekivo","01M6GKH8XNM7HTVF4DC86MA8RG",14,"MIT","https:\u002F\u002Fgithub.com\u002Fhekivo\u002Fkivo-wise\u002Fblob\u002Fmain\u002Fskills\u002Facorn-background\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"acorn background","laravel","channels","commands","project","log","use","command","work","schedule","performance","system","tuning","redis","logs","cache","scheduler","console","run","storage","2026-11-10 10:12:30",false,"---\nname: acorn-background\ndescription: Use when work must run outside the request, on a schedule, or be logged in an Acorn project - WP-Cron vs Action Scheduler vs Laravel queues (make:job, ShouldQueue, queue:work, failed_jobs), console commands (make:command, wp acorn \u003Ccommand>), Schedule::command and schedule:run from system cron, Laravel Redis and Cache vs transients, logging channels (Log::, LOG_CHANNEL, stderr, storage\u002Flogs). For tables use acorn-data; for object cache tuning use wp-performance.\n---\n\n# Background work, cache and logs under Acorn\n\nAcorn brings Laravel's queue, cache, Redis, console, scheduler and log components into WordPress. WordPress already has its own scheduler (WP-Cron), object cache and debug log. Pick the native piece first and add the Laravel piece only for a real gap.\n\nRunner placeholders (`{{runner.wp}}`, `{{runner.acorn}}`, `{{runner.composer}}`, `{{runner.test}}`, `{{runner.cache}}`) come from the session context; on Lando they default to `lando wp`, `lando wp acorn`, `lando composer`, the project's test tooling and its cache-clear tooling. Redis tooling and service names come from `.lando.yml` (read them, do not assume `cache` or `redis`).\n\n## When to use\n\n- Something slow or unreliable runs inside a request (external API call, email, image work, CRM sync).\n- A recurring task (nightly cleanup, hourly sync), or a CLI command for maintenance and imports.\n- Configuring Redis or the Laravel cache, or untangling it from the WordPress object cache.\n- Adding a log channel, finding where logs go, or shipping logs from containers.\n\n## Inputs required\n\n1. Active profile, Acorn base path and namespace (session context).\n2. Installed pieces: `illuminate\u002Fredis` and the PHP `redis` extension (or `predis\u002Fpredis`), Action Scheduler (a plugin or `woocommerce\u002Faction-scheduler`), the WordPress Redis drop-in (`wp-content\u002Fobject-cache.php`).\n3. Config actually in effect: `config\u002Fqueue.php`, `config\u002Fcache.php`, `config\u002Fdatabase.php` (`redis`), `config\u002Flogging.php` in the base path, merged over Acorn's defaults.\n4. Hosting: can the project run a long-lived worker (container, supervisor, systemd)? Is there a system cron? How many web instances?\n\n### Decide the mechanism\n\n| Need | Native first | Laravel piece when |\n|---|---|---|\n| Run a hook at an interval, low volume, retry not critical | WP-Cron: `wp_schedule_event()` (`wp-includes\u002Fcron.php`), triggered by traffic unless `DISABLE_WP_CRON` is set and a system cron calls `{{runner.wp}} cron event run --due-now` | — |\n| Many deferred actions with per-action logs and admin UI, no worker process | Action Scheduler (`as_enqueue_async_action`, `as_schedule_single_action`, `as_schedule_recurring_action`; runs on WP-Cron) when it is already installed | — |\n| Retries with backoff, timeouts, unique jobs, batches, chaining, high volume | — | Laravel queue + worker (`queue:work`) |\n| Recurring Laravel commands with overlap control | WP-Cron calling a service | Scheduler (`schedule:run` every minute from system cron) |\n| Cache a computed value | Transients \u002F `wp_cache_*` (persistent when an object-cache drop-in is installed) | Laravel `Cache` for tags, locks, `remember`, or a store separate from WordPress |\n| Operator command | `WP_CLI::add_command()` | Acorn command for DI, Laravel console IO, scheduling |\n| Debug output | `WP_DEBUG_LOG` → `debug.log` | Laravel `Log` channels, structured context, stderr in containers |\n\nDetails and trade-offs: [references\u002Fdecision-matrix.md](references\u002Fdecision-matrix.md).\n\n### Profile differences\n\n| Item | `sage-theme` | `acorn-mu-plugin` | `radicle-app` |\n|---|---|---|---|\n| Jobs, commands | `app\u002FJobs`, `app\u002FConsole\u002FCommands` in the theme | same folders in the plugin, plugin namespace | same folders at the root |\n| `routes\u002Fconsole.php` | theme base path | plugin base path | project root |\n| Config overrides | `config\u002F*.php` in the theme | `config\u002F*.php` in the plugin | `config\u002F*.php` at the root |\n| Storage (logs, file cache) | `storage\u002F` in the theme if present, else `wp-content\u002Fcache\u002Facorn` | `storage\u002F` in the plugin if present, else the same fallback | `storage\u002F` at the root |\n| Worker command runs from | the site root through WP-CLI, theme active | the site root through WP-CLI (mu-plugins always load) | the project root through WP-CLI |\n\n## Procedure\n\nCommands: write every command with the runner value from the session context filled in (for example `lando wp acorn optimize:clear`), never a bare `wp`\u002F`composer`\u002F`php`\u002F`npm`, never the placeholder, never \"prefix with lando if you use it\". Commands that run in CI or a deploy script go in a separate block labelled with where they run.\n\n1. **Name the need and pick the mechanism** with the table. Write the reason when you choose a Laravel piece over a native one.\n2. **Laravel queue** ([references\u002Fqueues.md](references\u002Fqueues.md)):\n   - `QUEUE_CONNECTION` defaults to `sync` (runs inline, nothing is deferred). Choose `database` or `redis` per environment.\n   - Database driver: `{{runner.acorn}} make:queue-table`, `make:queue-failed-table` (and `make:queue-batches-table` for batches), then `{{runner.acorn}} migrate`. Tables get the WordPress prefix.\n   - `{{runner.acorn}} make:job SyncLead`; pass IDs, not objects; set `$tries`, `$backoff`, `$timeout`; make `handle()` idempotent; call `wp_set_current_user()` when capability checks run inside the job.\n   - Dispatch from the WordPress hook or controller: `SyncLead::dispatch($leadId)`.\n   - Run a worker: `{{runner.acorn}} queue:work --tries=3 --max-time=3600`. In production keep it alive with the platform's process manager and run `{{runner.acorn}} queue:restart` after every deploy.\n3. **Commands and schedule** ([references\u002Fcommands-scheduling.md](references\u002Fcommands-scheduling.md)):\n   - `{{runner.acorn}} make:command ImportLeads` → `app\u002FConsole\u002FCommands`, loaded automatically; run as `{{runner.acorn}} leads:import`.\n   - Schedule in `routes\u002Fconsole.php` (`Schedule::command('leads:import')->hourly()->withoutOverlapping()`) or with `->withSchedule(fn (Schedule $s) => …)` on the builder.\n   - Trigger it every minute from a system cron: `{{runner.acorn}} schedule:run` (on a server without the local runner, the same command through that environment's WP-CLI, from the WordPress root), or keep `{{runner.acorn}} schedule:work` running.\n4. **Redis and cache** ([references\u002Fredis-cache.md](references\u002Fredis-cache.md)):\n   - `{{runner.composer}} require illuminate\u002Fredis` in the base path (Acorn does not require it; its provider is skipped while the class is missing) plus the `redis` PHP extension or `predis\u002Fpredis`.\n   - Give Laravel its own Redis databases or key prefix. The Redis Object Cache drop-in defaults to database 0 and `{{runner.wp}} cache flush` runs `FLUSHDB` on it; Acorn's Redis `default` connection is also database 0 (`REDIS_DB`), cache database 1 (`REDIS_CACHE_DB`). Put queues and sessions elsewhere, for example `REDIS_DB=2`, `REDIS_CACHE_DB=3`.\n   - `{{runner.acorn}} cache:clear` empties the Laravel cache store only; `{{runner.wp}} cache flush` empties the WordPress object cache only.\n5. **Logging** ([references\u002Flogging.md](references\u002Flogging.md)):\n   - Default: channel `stack` → `single` → `storage\u002Flogs\u002Flaravel.log` under the app's storage path.\n   - Containers: `LOG_CHANNEL=stderr` (or add `stderr` to `LOG_STACK`) so the platform collects logs.\n   - A project `config\u002Flogging.php` only needs the channels it adds; Laravel merges `channels` with Acorn's defaults.\n   - Always log with a context array, never secrets or full personal data.\n6. **Clear caches** after PHP changes: `{{runner.cache}}`.\n\n## Verification\n\n- Queue: dispatch one job, then `{{runner.acorn}} queue:work --once` processes it; `{{runner.acorn}} queue:failed` is empty; with the database driver, the `jobs` table drains.\n- Schedule: `{{runner.acorn}} schedule:list` shows each task with its next run; `{{runner.acorn}} schedule:test` runs one on demand.\n- Commands: `{{runner.acorn}} list` shows the command; `{{runner.acorn}} help \u003Cname>` matches the signature.\n- Redis: `{{runner.wp}} eval 'var_dump(app(\"redis\")->connection()->ping());'` succeeds; `{{runner.wp}} eval 'var_dump(config(\"database.redis.default.database\"), config(\"database.redis.cache.database\"));'` shows databases that differ from the object cache's.\n- Logs: `{{runner.wp}} eval 'logger(\"kivo-check\", [\"ok\" => true]);'` writes to the expected file or stream.\n- WP-Cron: `{{runner.wp}} cron event list` shows the hook and next run.\n\n## Failure modes\n\n| Symptom | Cause | Fix |\n|---|---|---|\n| Jobs \"dispatch\" but run during the request | `QUEUE_CONNECTION` is `sync` (default) | Set `database` or `redis` and run a worker |\n| Jobs pile up, never processed | No worker running, or the worker listens to another queue\u002Fconnection | Start `queue:work` with matching `--queue`; supervise it |\n| Worker runs old code after a deploy | Long-running process keeps the old classes | `{{runner.acorn}} queue:restart` (needs a cache store shared by worker and deploy) |\n| Jobs behave as logged out or use stale WordPress state | Workers run in one long WP-CLI process; no request user, globals persist between jobs | `wp_set_current_user()` in `handle()`; avoid globals; `--max-jobs` \u002F `--max-time` |\n| `Class \"Redis\" not found` \u002F `redis` binding missing | No `redis` extension, or `illuminate\u002Fredis` not installed so its provider was skipped | Install the extension or `predis\u002Fpredis` (`REDIS_CLIENT=predis`); require `illuminate\u002Fredis` |\n| Sessions, locks or queued jobs vanish after a deploy | `{{runner.wp}} cache flush` ran `FLUSHDB` on the database Laravel also uses | Separate databases (`REDIS_DB`, `REDIS_CACHE_DB`) or `WP_REDIS_SELECTIVE_FLUSH` with a prefix |\n| Scheduled tasks never run | No system cron calling `schedule:run`, or it runs outside the site root | Add the cron entry; run through WP-CLI from the WordPress root |\n| `onOneServer()` \u002F `withoutOverlapping()` still overlap across servers | Cache store is per server (file) | Use Redis or database as the cache and lock store |\n| WP-Cron events late or never | Low traffic, or `DISABLE_WP_CRON` without a system cron | System cron with `{{runner.wp}} cron event run --due-now` |\n| No log file appears | Storage folder missing or not writable, or `LOG_CHANNEL` points to a stream | Check the storage path per profile; `stderr` output is in the container log |\n| Command missing from `list` | Not under `app\u002FConsole\u002FCommands` of the base path, or namespace mismatch with `composer.json` PSR-4 | Move it, fix the namespace, or register with `->withCommands([...])` |\n\n## Escalation\n\n- Adding a worker process, a cron entry, or Redis to an environment is infrastructure work: describe what is needed and ask.\n- Purging queues (`queue:clear`, `queue:flush`), flushing shared caches, or changing Redis databases on a shared environment: ask first.\n- Tables behind jobs or schedules: `acorn-data`. HTTP entry points that dispatch jobs: `acorn-routes-api`.\n\n\u003C!-- verified:\nvendor\u002Froots\u002Facorn\u002Fconfig\u002Fqueue.php — default QUEUE_CONNECTION 'sync'; database\u002Fredis connections; failed driver database-uuids table failed_jobs on DB_CONNECTION 'wordpress'\nvendor\u002Froots\u002Facorn\u002Fsrc\u002FRoots\u002FAcorn\u002FConsole\u002FKernel.php:84-138 queue, schedule, make:job\u002Fcommand commands; :176-182 loads app\u002FConsole\u002FCommands and base_path('routes\u002Fconsole.php')\nvendor\u002Froots\u002Facorn\u002Fsrc\u002FIlluminate\u002FFoundation\u002FConfiguration\u002FApplicationBuilder.php:334-349 withCommands(); :375-383 withSchedule()\nvendor\u002Filluminate\u002Fqueue\u002FConsole\u002FTableCommand.php:10, FailedTableCommand.php:10, BatchesTableCommand.php:10 — make:queue-*-table names with queue:* aliases\nvendor\u002Froots\u002Facorn\u002Fcomposer.json:44-69 — no illuminate\u002Fredis; illuminate\u002Fsupport\u002FDefaultProviders.php:41 lists RedisServiceProvider; roots\u002Facorn Application.php:328 filters providers by class_exists\nvendor\u002Froots\u002Facorn\u002Fconfig\u002Fdatabase.php:165-194 — redis client phpredis, default DB REDIS_DB 0, cache DB REDIS_CACHE_DB 1\nwp-content\u002Fplugins\u002Fredis-cache\u002Fincludes\u002Fobject-cache.php:626 default database 0; :1633-1669 flush() runs FLUSHDB unless WP_REDIS_SELECTIVE_FLUSH with a prefix (Redis Object Cache 2.7.0)\nvendor\u002Froots\u002Facorn\u002Fconfig\u002Fcache.php — default store 'file' at storage\u002Fframework\u002Fcache\u002Fdata; redis store uses 'cache' connection\nvendor\u002Froots\u002Facorn\u002Fconfig\u002Flogging.php:21 default 'stack'; stack -> LOG_STACK 'single'; single path storage\u002Flogs\u002Flaravel.log; stderr channel present\nvendor\u002Froots\u002Facorn\u002Fsrc\u002FIlluminate\u002FFoundation\u002FBootstrap\u002FLoadConfiguration.php — logging.channels, queue.connections, cache.stores, database.connections merged over Acorn defaults\nvendor\u002Froots\u002Facorn\u002Fsrc\u002FRoots\u002FAcorn\u002FConfiguration\u002FConcerns\u002FPaths.php:115-128 — storage fallback WP_CONTENT_DIR\u002Fcache\u002Facorn with logs\u002F\nwp\u002Fwp-includes\u002Fcron.php:48 wp_schedule_single_event, :252 wp_schedule_event, :1020-1051 wp_cron and DISABLE_WP_CRON\nroots-docs acorn queues, redis, cache, logging, wp-cli and artisan-console pages\n-->\n","# Background work, cache and logs under Acorn\n\nAcorn brings Laravel's queue, cache, Redis, console, scheduler and log components into WordPress. WordPress already has its own scheduler (WP-Cron), object cache and debug log. Pick the native piece first and add the Laravel piece only for a real gap.\n\nRunner placeholders (`{{runner.wp}}`, `{{runner.acorn}}`, `{{runner.composer}}`, `{{runner.test}}`, `{{runner.cache}}`) come from the session context; on Lando they default to `lando wp`, `lando wp acorn`, `lando composer`, the project's test tooling and its cache-clear tooling. Redis tooling and service names come from `.lando.yml` (read them, do not assume `cache` or `redis`).\n\n## When to use\n\n- Something slow or unreliable runs inside a request (external API call, email, image work, CRM sync).\n- A recurring task (nightly cleanup, hourly sync), or a CLI command for maintenance and imports.\n- Configuring Redis or the Laravel cache, or untangling it from the WordPress object cache.\n- Adding a log channel, finding where logs go, or shipping logs from containers.\n\n## Inputs required\n\n1. Active profile, Acorn base path and namespace (session context).\n2. Installed pieces: `illuminate\u002Fredis` and the PHP `redis` extension (or `predis\u002Fpredis`), Action Scheduler (a plugin or `woocommerce\u002Faction-scheduler`), the WordPress Redis drop-in (`wp-content\u002Fobject-cache.php`).\n3. Config actually in effect: `config\u002Fqueue.php`, `config\u002Fcache.php`, `config\u002Fdatabase.php` (`redis`), `config\u002Flogging.php` in the base path, merged over Acorn's defaults.\n4. Hosting: can the project run a long-lived worker (container, supervisor, systemd)? Is there a system cron? How many web instances?\n\n### Decide the mechanism\n\n| Need | Native first | Laravel piece when |\n|---|---|---|\n| Run a hook at an interval, low volume, retry not critical | WP-Cron: `wp_schedule_event()` (`wp-includes\u002Fcron.php`), triggered by traffic unless `DISABLE_WP_CRON` is set and a system cron calls `{{runner.wp}} cron event run --due-now` | — |\n| Many deferred actions with per-action logs and admin UI, no worker process | Action Scheduler (`as_enqueue_async_action`, `as_schedule_single_action`, `as_schedule_recurring_action`; runs on WP-Cron) when it is already installed | — |\n| Retries with backoff, timeouts, unique jobs, batches, chaining, high volume | — | Laravel queue + worker (`queue:work`) |\n| Recurring Laravel commands with overlap control | WP-Cron calling a service | Scheduler (`schedule:run` every minute from system cron) |\n| Cache a computed value | Transients \u002F `wp_cache_*` (persistent when an object-cache drop-in is installed) | Laravel `Cache` for tags, locks, `remember`, or a store separate from WordPress |\n| Operator command | `WP_CLI::add_command()` | Acorn command for DI, Laravel console IO, scheduling |\n| Debug output | `WP_DEBUG_LOG` → `debug.log` | Laravel `Log` channels, structured context, stderr in containers |\n\nDetails and trade-offs: [references\u002Fdecision-matrix.md](references\u002Fdecision-matrix.md).\n\n### Profile differences\n\n| Item | `sage-theme` | `acorn-mu-plugin` | `radicle-app` |\n|---|---|---|---|\n| Jobs, commands | `app\u002FJobs`, `app\u002FConsole\u002FCommands` in the theme | same folders in the plugin, plugin namespace | same folders at the root |\n| `routes\u002Fconsole.php` | theme base path | plugin base path | project root |\n| Config overrides | `config\u002F*.php` in the theme | `config\u002F*.php` in the plugin | `config\u002F*.php` at the root |\n| Storage (logs, file cache) | `storage\u002F` in the theme if present, else `wp-content\u002Fcache\u002Facorn` | `storage\u002F` in the plugin if present, else the same fallback | `storage\u002F` at the root |\n| Worker command runs from | the site root through WP-CLI, theme active | the site root through WP-CLI (mu-plugins always load) | the project root through WP-CLI |\n\n## Procedure\n\nCommands: write every command with the runner value from the session context filled in (for example `lando wp acorn optimize:clear`), never a bare `wp`\u002F`composer`\u002F`php`\u002F`npm`, never the placeholder, never \"prefix with lando if you use it\". Commands that run in CI or a deploy script go in a separate block labelled with where they run.\n\n1. **Name the need and pick the mechanism** with the table. Write the reason when you choose a Laravel piece over a native one.\n2. **Laravel queue** ([references\u002Fqueues.md](references\u002Fqueues.md)):\n   - `QUEUE_CONNECTION` defaults to `sync` (runs inline, nothing is deferred). Choose `database` or `redis` per environment.\n   - Database driver: `{{runner.acorn}} make:queue-table`, `make:queue-failed-table` (and `make:queue-batches-table` for batches), then `{{runner.acorn}} migrate`. Tables get the WordPress prefix.\n   - `{{runner.acorn}} make:job SyncLead`; pass IDs, not objects; set `$tries`, `$backoff`, `$timeout`; make `handle()` idempotent; call `wp_set_current_user()` when capability checks run inside the job.\n   - Dispatch from the WordPress hook or controller: `SyncLead::dispatch($leadId)`.\n   - Run a worker: `{{runner.acorn}} queue:work --tries=3 --max-time=3600`. In production keep it alive with the platform's process manager and run `{{runner.acorn}} queue:restart` after every deploy.\n3. **Commands and schedule** ([references\u002Fcommands-scheduling.md](references\u002Fcommands-scheduling.md)):\n   - `{{runner.acorn}} make:command ImportLeads` → `app\u002FConsole\u002FCommands`, loaded automatically; run as `{{runner.acorn}} leads:import`.\n   - Schedule in `routes\u002Fconsole.php` (`Schedule::command('leads:import')->hourly()->withoutOverlapping()`) or with `->withSchedule(fn (Schedule $s) => …)` on the builder.\n   - Trigger it every minute from a system cron: `{{runner.acorn}} schedule:run` (on a server without the local runner, the same command through that environment's WP-CLI, from the WordPress root), or keep `{{runner.acorn}} schedule:work` running.\n4. **Redis and cache** ([references\u002Fredis-cache.md](references\u002Fredis-cache.md)):\n   - `{{runner.composer}} require illuminate\u002Fredis` in the base path (Acorn does not require it; its provider is skipped while the class is missing) plus the `redis` PHP extension or `predis\u002Fpredis`.\n   - Give Laravel its own Redis databases or key prefix. The Redis Object Cache drop-in defaults to database 0 and `{{runner.wp}} cache flush` runs `FLUSHDB` on it; Acorn's Redis `default` connection is also database 0 (`REDIS_DB`), cache database 1 (`REDIS_CACHE_DB`). Put queues and sessions elsewhere, for example `REDIS_DB=2`, `REDIS_CACHE_DB=3`.\n   - `{{runner.acorn}} cache:clear` empties the Laravel cache store only; `{{runner.wp}} cache flush` empties the WordPress object cache only.\n5. **Logging** ([references\u002Flogging.md](references\u002Flogging.md)):\n   - Default: channel `stack` → `single` → `storage\u002Flogs\u002Flaravel.log` under the app's storage path.\n   - Containers: `LOG_CHANNEL=stderr` (or add `stderr` to `LOG_STACK`) so the platform collects logs.\n   - A project `config\u002Flogging.php` only needs the channels it adds; Laravel merges `channels` with Acorn's defaults.\n   - Always log with a context array, never secrets or full personal data.\n6. **Clear caches** after PHP changes: `{{runner.cache}}`.\n\n## Verification\n\n- Queue: dispatch one job, then `{{runner.acorn}} queue:work --once` processes it; `{{runner.acorn}} queue:failed` is empty; with the database driver, the `jobs` table drains.\n- Schedule: `{{runner.acorn}} schedule:list` shows each task with its next run; `{{runner.acorn}} schedule:test` runs one on demand.\n- Commands: `{{runner.acorn}} list` shows the command; `{{runner.acorn}} help \u003Cname>` matches the signature.\n- Redis: `{{runner.wp}} eval 'var_dump(app(\"redis\")->connection()->ping());'` succeeds; `{{runner.wp}} eval 'var_dump(config(\"database.redis.default.database\"), config(\"database.redis.cache.database\"));'` shows databases that differ from the object cache's.\n- Logs: `{{runner.wp}} eval 'logger(\"kivo-check\", [\"ok\" => true]);'` writes to the expected file or stream.\n- WP-Cron: `{{runner.wp}} cron event list` shows the hook and next run.\n\n## Failure modes\n\n| Symptom | Cause | Fix |\n|---|---|---|\n| Jobs \"dispatch\" but run during the request | `QUEUE_CONNECTION` is `sync` (default) | Set `database` or `redis` and run a worker |\n| Jobs pile up, never processed | No worker running, or the worker listens to another queue\u002Fconnection | Start `queue:work` with matching `--queue`; supervise it |\n| Worker runs old code after a deploy | Long-running process keeps the old classes | `{{runner.acorn}} queue:restart` (needs a cache store shared by worker and deploy) |\n| Jobs behave as logged out or use stale WordPress state | Workers run in one long WP-CLI process; no request user, globals persist between jobs | `wp_set_current_user()` in `handle()`; avoid globals; `--max-jobs` \u002F `--max-time` |\n| `Class \"Redis\" not found` \u002F `redis` binding missing | No `redis` extension, or `illuminate\u002Fredis` not installed so its provider was skipped | Install the extension or `predis\u002Fpredis` (`REDIS_CLIENT=predis`); require `illuminate\u002Fredis` |\n| Sessions, locks or queued jobs vanish after a deploy | `{{runner.wp}} cache flush` ran `FLUSHDB` on the database Laravel also uses | Separate databases (`REDIS_DB`, `REDIS_CACHE_DB`) or `WP_REDIS_SELECTIVE_FLUSH` with a prefix |\n| Scheduled tasks never run | No system cron calling `schedule:run`, or it runs outside the site root | Add the cron entry; run through WP-CLI from the WordPress root |\n| `onOneServer()` \u002F `withoutOverlapping()` still overlap across servers | Cache store is per server (file) | Use Redis or database as the cache and lock store |\n| WP-Cron events late or never | Low traffic, or `DISABLE_WP_CRON` without a system cron | System cron with `{{runner.wp}} cron event run --due-now` |\n| No log file appears | Storage folder missing or not writable, or `LOG_CHANNEL` points to a stream | Check the storage path per profile; `stderr` output is in the container log |\n| Command missing from `list` | Not under `app\u002FConsole\u002FCommands` of the base path, or namespace mismatch with `composer.json` PSR-4 | Move it, fix the namespace, or register with `->withCommands([...])` |\n\n## Escalation\n\n- Adding a worker process, a cron entry, or Redis to an environment is infrastructure work: describe what is needed and ask.\n- Purging queues (`queue:clear`, `queue:flush`), flushing shared caches, or changing Redis databases on a shared environment: ask first.\n- Tables behind jobs or schedules: `acorn-data`. HTTP entry points that dispatch jobs: `acorn-routes-api`.\n\n\u003C!-- verified:\nvendor\u002Froots\u002Facorn\u002Fconfig\u002Fqueue.php — default QUEUE_CONNECTION 'sync'; database\u002Fredis connections; failed driver database-uuids table failed_jobs on DB_CONNECTION 'wordpress'\nvendor\u002Froots\u002Facorn\u002Fsrc\u002FRoots\u002FAcorn\u002FConsole\u002FKernel.php:84-138 queue, schedule, make:job\u002Fcommand commands; :176-182 loads app\u002FConsole\u002FCommands and base_path('routes\u002Fconsole.php')\nvendor\u002Froots\u002Facorn\u002Fsrc\u002FIlluminate\u002FFoundation\u002FConfiguration\u002FApplicationBuilder.php:334-349 withCommands(); :375-383 withSchedule()\nvendor\u002Filluminate\u002Fqueue\u002FConsole\u002FTableCommand.php:10, FailedTableCommand.php:10, BatchesTableCommand.php:10 — make:queue-*-table names with queue:* aliases\nvendor\u002Froots\u002Facorn\u002Fcomposer.json:44-69 — no illuminate\u002Fredis; illuminate\u002Fsupport\u002FDefaultProviders.php:41 lists RedisServiceProvider; roots\u002Facorn Application.php:328 filters providers by class_exists\nvendor\u002Froots\u002Facorn\u002Fconfig\u002Fdatabase.php:165-194 — redis client phpredis, default DB REDIS_DB 0, cache DB REDIS_CACHE_DB 1\nwp-content\u002Fplugins\u002Fredis-cache\u002Fincludes\u002Fobject-cache.php:626 default database 0; :1633-1669 flush() runs FLUSHDB unless WP_REDIS_SELECTIVE_FLUSH with a prefix (Redis Object Cache 2.7.0)\nvendor\u002Froots\u002Facorn\u002Fconfig\u002Fcache.php — default store 'file' at storage\u002Fframework\u002Fcache\u002Fdata; redis store uses 'cache' connection\nvendor\u002Froots\u002Facorn\u002Fconfig\u002Flogging.php:21 default 'stack'; stack -> LOG_STACK 'single'; single path storage\u002Flogs\u002Flaravel.log; stderr channel present\nvendor\u002Froots\u002Facorn\u002Fsrc\u002FIlluminate\u002FFoundation\u002FBootstrap\u002FLoadConfiguration.php — logging.channels, queue.connections, cache.stores, database.connections merged over Acorn defaults\nvendor\u002Froots\u002Facorn\u002Fsrc\u002FRoots\u002FAcorn\u002FConfiguration\u002FConcerns\u002FPaths.php:115-128 — storage fallback WP_CONTENT_DIR\u002Fcache\u002Facorn with logs\u002F\nwp\u002Fwp-includes\u002Fcron.php:48 wp_schedule_single_event, :252 wp_schedule_event, :1020-1051 wp_cron and DISABLE_WP_CRON\nroots-docs acorn queues, redis, cache, logging, wp-cli and artisan-console pages\n-->\n",{"name":5,"description":7},"main","4045a2f672c1d4c1b4a5a5712b468c5d73ca6724","skills\u002Facorn-background",0,"https:\u002F\u002Fgithub.com\u002Fhekivo\u002Fkivo-wise","https:\u002F\u002Fhekivo.github.io\u002Fkivo-wise\u002F","https:\u002F\u002Fgithub.com\u002Fhekivo","https:\u002F\u002Fhekivo.dev","2026-11-08 06:10:39",{"source":8,"skillName":5,"commands":54,"prompt":64,"zipAvailable":65},[55,58,61],{"tool":56,"command":57},"npx","npx skills add hekivo\u002Fkivo-wise --skill acorn-background",{"tool":59,"command":60},"bunx","bunx skills add hekivo\u002Fkivo-wise --skill acorn-background",{"tool":62,"command":63},"pnpm","pnpm dlx skills add hekivo\u002Fkivo-wise --skill acorn-background","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fhekivo\u002Fkivo-wise\u002Fblob\u002Fmain\u002Fskills\u002Facorn-background\u002FSKILL.md",true,[67,73,77,81,85],{"path":68,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":71,"sourceHtmlUrl":72},"references\u002Fcommands-scheduling.md","REFERENCE","参考文档",3811,"https:\u002F\u002Fgithub.com\u002Fhekivo\u002Fkivo-wise\u002Fblob\u002Fmain\u002Fskills\u002Facorn-background\u002Freferences\u002Fcommands-scheduling.md",{"path":74,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":75,"sourceHtmlUrl":76},"references\u002Fdecision-matrix.md",3766,"https:\u002F\u002Fgithub.com\u002Fhekivo\u002Fkivo-wise\u002Fblob\u002Fmain\u002Fskills\u002Facorn-background\u002Freferences\u002Fdecision-matrix.md",{"path":78,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":79,"sourceHtmlUrl":80},"references\u002Flogging.md",3209,"https:\u002F\u002Fgithub.com\u002Fhekivo\u002Fkivo-wise\u002Fblob\u002Fmain\u002Fskills\u002Facorn-background\u002Freferences\u002Flogging.md",{"path":82,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":83,"sourceHtmlUrl":84},"references\u002Fqueues.md",4214,"https:\u002F\u002Fgithub.com\u002Fhekivo\u002Fkivo-wise\u002Fblob\u002Fmain\u002Fskills\u002Facorn-background\u002Freferences\u002Fqueues.md",{"path":86,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":87,"sourceHtmlUrl":88},"references\u002Fredis-cache.md",4234,"https:\u002F\u002Fgithub.com\u002Fhekivo\u002Fkivo-wise\u002Fblob\u002Fmain\u002Fskills\u002Facorn-background\u002Freferences\u002Fredis-cache.md",[90,116,132,154,173,194],{"skillNo":91,"name":92,"nameZh":6,"description":93,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":39},"01M6GKWJDFKQM27HTFXX20QVTP","wp-rest-api","Use when building, extending, or debugging WordPress REST API endpoints\u002Froutes: register_rest_route, WP_REST_Controller\u002Fcontroller classes, schema\u002Fargument validation, permission_callback\u002Fauthentication, response shaping, register_rest_field\u002Fregister_meta, or exposing CPTs\u002Ftaxonomies via show_in_rest.","https:\u002F\u002Fgithub.com\u002Fhekivo\u002Fkivo-wise\u002Fblob\u002Fmain\u002Fthird-party\u002Fwp-rest-api\u002FSKILL.md",[],[97,98,99,100,101,102,103,104,105,106,107,108,109,25,110,111,112,113,114,115],"REST","api","wp rest api","rest api","wordpress","workflows","debugging","authentication","Meta","controller","Bash","shaping","filesystem","schema","show","route","register","with","wp-cli",{"skillNo":117,"name":118,"nameZh":6,"description":119,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":120,"categories":121,"keywords":122,"publishedAt":39},"01M6GKWEA5BMJZ2RPPEEJTCC3N","wp-abilities-api","Use when working with the WordPress Abilities API (wp_register_ability, wp_register_ability_category, \u002Fwp-json\u002Fwp-abilities\u002Fv1\u002F*, @wordpress\u002Fabilities) including defining abilities, categories, meta, REST exposure, and permissions checks for clients.","https:\u002F\u002Fgithub.com\u002Fhekivo\u002Fkivo-wise\u002Fblob\u002Fmain\u002Fthird-party\u002Fwp-abilities-api\u002FSKILL.md",[],[98,123,124,101,102,125,105,97,107,126,127,109,128,25,113,129,130,114,131,115],"wp abilities api","cli","permissions","php","json","node","targets","clients","categories",{"skillNo":133,"name":134,"nameZh":6,"description":135,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":136,"categories":137,"keywords":138,"publishedAt":39},"01M6GKWA4GG2BZRFXCR9E73VR7","wp-security-escaping","Use when writing or reviewing code that outputs data, handles input or checks permissions in a WordPress + Acorn project - Blade {{ }} vs {!! !!}, esc_html, esc_attr, esc_url, wp_kses_post, \"&#038; in the URL\", double escaping, sanitize_text_field, nonces, current_user_can, map_meta_cap, permission_callback, $wpdb->prepare, whereRaw, file uploads, escaping ACF values, secrets in .env. For route middleware use acorn-routes-api; for ACF validation use acf-native; for Livewire actions use acorn-livewire.","https:\u002F\u002Fgithub.com\u002Fhekivo\u002Fkivo-wise\u002Fblob\u002Fmain\u002Fskills\u002Fwp-security-escaping\u002FSKILL.md",[],[139,140,141,142,143,125,144,105,98,145,146,147,148,112,149,23,150,151,152,153],"security","wp security","wp security escaping","writing","code","actions","secrets","livewire","text","cap","map","middleware","native","URL","routes-api",{"skillNo":155,"name":156,"nameZh":6,"description":157,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":158,"categories":159,"keywords":160,"publishedAt":39},"01M6GKW6VVY73BMZ3JNDMR4CWZ","wp-phpstan","Use when configuring, running or fixing PHPStan in a WordPress project that uses Acorn - phpstan.neon, baseline, szepeviktor\u002Fphpstan-wordpress stubs, larastan, level raising, \"Cannot access property on mixed\", get_field() types, paths for app\u002F. For Pint or Mago formatting use testing-wp; for runtime errors use roots-debugging.","https:\u002F\u002Fgithub.com\u002Fhekivo\u002Fkivo-wise\u002Fblob\u002Fmain\u002Fskills\u002Fwp-phpstan\u002FSKILL.md",[],[161,162,101,103,163,164,25,23,165,166,167,168,169,170,171,172],"wp phpstan","testing","baseline","access","get","neon","runtime","formatting","app","paths","types","errors",{"skillNo":174,"name":175,"nameZh":6,"description":176,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":177,"categories":178,"keywords":179,"publishedAt":39},"01M6GKW3JRSRS9N112QFA3SEGT","wp-performance","Use when a WordPress page, query or request is slow or needs profiling - TTFB, slow or N+1 queries, Query Monitor, Server-Timing, wp profile and wp doctor, autoloaded options, Redis object cache hit rate, transients, WP_CACHE_KEY_SALT. Adds the runner and Redis notes on top of the official procedure. For Eloquent query design use acorn-data; for PHP type errors use wp-phpstan.","https:\u002F\u002Fgithub.com\u002Fhekivo\u002Fkivo-wise\u002Fblob\u002Fmain\u002Fskills\u002Fwp-performance\u002FSKILL.md",[],[29,180,181,101,182,183,184,185,186,34,187,32,188,25,189,190,191,192,193,172],"wp performance","design","query design","official","notes","monitor","doctor","server","page","queries","runner","query","type","timing",{"skillNo":195,"name":196,"nameZh":6,"description":197,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":198,"categories":199,"keywords":200,"publishedAt":39},"01M6GKVZN243XQB5QWZ5ZKMG7P","wp-hooks-lifecycle","Use when adding, moving or debugging WordPress actions and filters in an Acorn project - add_action\u002Fadd_filter priority and accepted_args, where a hook belongs (setup or filters files vs a provider boot()), load order (mu-plugins, plugins_loaded, after_setup_theme, init), when Acorn boots per profile, hooks that never fire on Acorn routes, REST or Livewire requests (template_redirect, wp_head), save_post firing twice in the block editor, the_content priorities. For ACF hooks use acf-native; for provider structure use acorn-stack.","https:\u002F\u002Fgithub.com\u002Fhekivo\u002Fkivo-wise\u002Fblob\u002Fmain\u002Fskills\u002Fwp-hooks-lifecycle\u002FSKILL.md",[],[201,202,203,101,204,205,103,144,97,206,146,25,207,208,209,210,211,23,212,213],"lifecycle","hooks","wp hooks lifecycle","init","boot","stack","never","filters","files","provider","structure","filter","theme"]