Repository navigation
Add fleet_summary: a compact fleet-ready digest of a site's agent surface - #1
Merged
Merged
Conversation
…rface
ASA is single-site today, but agent exposure is a fleet risk. This adds a
stable, transport-agnostic projection that fleet tooling can read to answer
"how exposed is this one site?" without the full per-ability report — the
contract a MainWP Fleet Health Monitor signal (fhm_extra_signals) or a CI
gate consumes.
- Audit_Runner::fleet_summary() projects the existing summary into
{ sev, highest_severity, agent_reachable, agent_reachable_write,
findings_by_severity, analysis_errors }. Pure projection: no new
analysis, no I/O, no state.
- derive_sev() maps the highest present finding severity to FHM's ok|warn|crit
vocabulary, conservatively: critical/high -> crit, medium/low -> warn,
info or none -> ok. Info-only sites do not raise a grade. The grade is a
smell signal, not a safety proof (inherits the "no issues detected" != "safe"
invariant).
- Digest, not descriptors: carries counts + a grade only, minimizing what a
future transport would ship upstream.
- int_of() narrows the mixed summary counts for the analyzer.
Tests: pure-PHP unit coverage of the full severity->grade mapping (reflection,
since the methods are WP-free) + an integration assertion that the field is a
faithful projection of the real pipeline. README documents the field.
Verified live (WP 7.0.2, Yoast + WP AI plugin): 19 agent-reachable, 3
reachable-write, sev=crit from 3 criticals.
Gates: lint, check-cs (WPCS), phpstan (L10), test (103) all pass.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Filip Ilic <ilic.filip@gmail.com>
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.
Why
ASA is single-site today, but agent exposure is inherently a fleet risk — one misconfigured
mcp.publicability replicated across N managed sites is N problems. This adds the stable contract a fleet consumer needs to answer "how exposed is this one site?" without pulling the full per-ability report.The immediate consumer is a MainWP Fleet Health Monitor signal: FHM now exposes an
fhm_extra_signalsfilter (seeProgressPlanner/mainwp-fhm-dashboard#2) that takes a scored{sev, value, detail}— this field hands it exactly that. It's equally useful to a CI gate or any dashboard.What
Audit_Runner::fleet_summary()projects the existingsummaryinto a compact digest on the report:summary; no new analysis, no I/O, no state.sevis conservative (derive_sev()): critical/high →crit, medium/low →warn, info or no findings →ok. Info-only sites (e.g. a lone ASA011 awareness note) do not raise a grade.Scope (what this is not)
This is only the contract. The transport that carries
fleet_summaryfrom a managed site up to a dashboard (piggyback the existing PEM child, a dashboard pull, or a dedicated child plugin) is deliberately not in this PR — all three options read this same field, so the contract lands first. ASA stays single-site and its read-only / no-new-surface invariants remain literally true.Testing
tests/Unit/fleet-summary-test.php) — the full severity→grade mapping, plus edge cases (multiple severities, info-only, no findings, malformed summary). Pure PHP via reflection, since the methods touch no WordPress.crit.sev=crit.composer lint,composer check-cs(WPCS),composer phpstan(level 10),composer test(103 tests) all pass.🤖 Generated with Claude Code