Repository navigation
feat: install ledger — every plugin/theme install with its door and source (P6.3 phase 2, SiteAgent 2.22.0) - #139
Conversation
…nce computed on read (P6.3 phase 2) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ed out, not corruption; append validates what it stores Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ames, transport, auth, source (P6.3 phase 2) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ndary; failed runs drop their frame Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
….3 phase 2) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…(P6.3 phase 2) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…multisite reports ledger_partial_network; stale read-only claims, dead counter, wire test Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fd0238930a
ℹ️ 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".
| // ledger. | ||
| if ( class_exists( 'Aura_Worker_Install_Ledger' ) ) { | ||
| try { | ||
| Aura_Worker_Install_Ledger::restart_coverage(); |
There was a problem hiding this comment.
Restart the shared network ledger only once
On a network-wide activation, aura_worker_for_each_site() invokes this function once per site, but the ledger state is stored with update_site_option() and is therefore shared by the entire network. The first site creates a clean ledger, while the second and every later site call restart_coverage() on that same ledger, setting evicted: true and moving since again even on a fresh installation where no coverage was lost. Restart the network-scoped ledger once outside the per-site loop, while retaining the per-site behavior for non-network activation.
Useful? React with 👍 / 👎.
| return Aura_Worker_Install_Ledger::as_siteagent( function () use ( $upgrader, $install_source ) { | ||
| return $upgrader->install( $install_source, array( 'overwrite_package' => true ) ); | ||
| }, $upgrader ); |
There was a problem hiding this comment.
Preserve the original URL for verified self-updates
When expected_sha256 is supplied, this path first downloads $zip_url and changes $install_source to the temporary file before entering the ledger wrapper. Consequently, upgrader_pre_download sees only that temp path and records source.kind: local_path, losing the actual remote host for every verified self-update. Pass the original source into the ledger correlation so secure self-updates report the CDN or WordPress host they really came from.
Useful? React with 👍 / 👎.
…ctivation; a verified self-update records its real source Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 143de752cf
ℹ️ 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".
| // ledger. | ||
| if ( class_exists( 'Aura_Worker_Install_Ledger' ) ) { | ||
| try { | ||
| Aura_Worker_Install_Ledger::restart_coverage(); |
There was a problem hiding this comment.
Restart coverage before per-site activation initializes it
Although the restart was moved outside the per-site loop, it still runs after that loop. On a fresh activation, aura_worker_activate_site() calls aura_worker_maybe_upgrade(), which calls ensure_started() and creates the state and empty ring; this subsequent restart_coverage() therefore treats the fresh ledger as existing and immediately sets evicted: true. This affects both single-site and network-wide fresh activations, falsely reporting that coverage was lost before anything could have been observed.
Useful? React with 👍 / 👎.
| return Aura_Worker_Install_Ledger::as_siteagent( function () use ( $upgrader, $install_source ) { | ||
| return $upgrader->install( $install_source, array( 'overwrite_package' => true ) ); | ||
| }, $upgrader, $zip_url ); |
There was a problem hiding this comment.
Mark SiteAgent self-updates as updates
When self_update() reaches this wrapper, it is replacing the already-installed SiteAgent plugin, but Plugin_Upgrader::install() supplies hook metadata with action: install and no plugin target. Consequently action_of() records every SiteAgent self-update as an install, making the new audit ledger inaccurate for this update path; the wrapper needs to carry an update-action override in addition to the original source URL.
Useful? React with 👍 / 👎.
…itialises the ledger; a self-update records action update Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
@codex review |
|
Codex Review: Didn't find any major issues. Nice work! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
@codex review |
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Implements Plan A of Digitizers/Aura docs/superpowers/plans/2026-09-26-install-ledger-plan-a-siteagent-2-22.md (spec docs/superpowers/specs/2026-09-21-agent-installed-packages-design.md §4).
Aura_Worker_Install_Ledgerobserves the upgrader for plugin/theme runs only (per-run token in hook_extra;upgrader_pre_downloadat PHP_INT_MAX; entry atupgrader_install_package_result), records and never decides.doing_action('wp_maybe_auto_update')— never the skin, cron, rest, wp_admin), user_id, auth, app-password NAME (never the uuid), route, source.wp_scheduled_delete); every row validated on read; any unreadable storage reportsledger_unreadableand is recovered behind a coverage boundary; write order only ever under-claims coverage. Reactivation restarts coverage; per-site activation on multisite reportsledger_partial_network.audit_agent_codereports it asinstalls(consumed by Aura #597). Uninstall removes the network rows.Tests: 5643 OK (baseline 5544 + 99), phpcs clean on touched files. Built subagent-driven with per-task reviews and a final whole-branch review. Version bump and changelog in the separate release PR.
🤖 Generated with Claude Code