Repository navigation
feat(machine-health): add the top-processes and backup-status checks - #8935
Conversation
top-processes samples process CPU deltas and system counters over the orchestrator's new -SampleSeconds window (passed through Get-CheckArgument) and grades them against Microsoft Learn's Windows Server bands, labeled as such; disk latency is graded only on a sustained window. backup-status reads every backup signal through Get-BackupSignal (Backup channel by event id, wbadmin and restore points elevated only, File History, Windows Backup log, OneDrive Known Folder Move policy) and adds its elevation-matrix row. The report appendix gains a generic arm that lists any check's items[] by title, severity and muted state, withholding exclusion values. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Basis strings and docs say "version id" rather than the wbadmin label, and the deprecation sentence is held at script scope so the failure summary carries it too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Get-FindingKey gains a process kind whose identity is the lowercased image file name, never the PID, so top-processes items carry a key and can be muted; a muted process stays listed and never raises severity. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Counter paths, backup channel, class, path, log, policy keys and source ids are named once in their adapters and the checks build commands from them. The dispatch timeout covers the sampling window through Get-CheckTimeoutSec, and a test ties the -SampleSeconds maximum to the sustained window. Catalog records take the Pointer / As of / Recheck trigger form and hold the rationale the scripts now cite. The System Image Backup deprecation rides on the summary only when a system image is the present source. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…test headers Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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. |
|
claude-security-review reviewed Security review: PR #8935 (head 389adcf)Result: no security findings reported, no inline comments posted. Scope. The PR adds the I read these files in full: Not covered. I could not run Why nothing was reported:
Instruction-surface lens. The diff deletes or narrows no standing instruction, so the exception register was not consulted. Note below the reporting bar (not counted). |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dcc25e1536
ℹ️ 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".
|
claude-review reviewed Code review of PR #8935 at head 389adcf: no findings. I read the full diff (20 files) and the PR context. I did not run the Pester suite or any script. The author's "789 passed" claim is author-claimed and unverified by me. What I checked
Design note, not a finding: |
…sions onedrive-kfm reads present when a known folder resolves under a OneDrive root, or when a Known Folder Move policy names a tenant and moves a folder; zero folder values and notification or prompt policies are not evidence. A positive wbadmin version count keeps system-image present when the retained channel holds only failed runs. The top-processes summary says when system counters were unreadable instead of printing blank readings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…op-processes-backup # Conflicts: # plugins/machine-health/skills/audit/catalog/checks.jsonc # plugins/machine-health/skills/audit/reference/windows/check-catalog.md # plugins/machine-health/skills/audit/scripts/windows/lib/Get-ElevationMatrix.ps1 # plugins/machine-health/skills/audit/tests/windows/lib/Get-ElevationMatrix.Tests.ps1
Lane-Activity: pr-unblock/resolve-conflicts
…s-backup' into feat/machine-health-top-processes-backup # Conflicts: # plugins/machine-health/skills/audit/catalog/checks.jsonc # plugins/machine-health/skills/audit/reference/windows/check-catalog.md
…ary is capped The summary drops the process list first, then cuts the rest of the body, so the label naming which bands apply always survives the cap. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…op-processes-backup # Conflicts: # plugins/machine-health/skills/audit/catalog/checks.jsonc # plugins/machine-health/skills/audit/reference/windows/check-catalog.md
Lane-Activity: pr-unblock/resolve-conflicts
…s-backup' into feat/machine-health-top-processes-backup
No related issue: Phase 8 of the owner-approved machine-health PC-checkup plan (ADR 0081, #8906).
Summary
This adds two checks:
top-processesanswers "what's slowing this computer down". It samples processes over a window and grades CPU, memory, processor queue and disk latency against the Microsoft Learn bands for Windows Server, and the output says those bands are for Windows Server.backup-statusanswers "is this computer backed up". It reads every backup signal: system image, restore points, File History, Windows Backup, and OneDrive folder backup.It also adds a generic appendix arm, so every list-style check's items now appear in the markdown report.
Fix
Get-ProcessSampletakes two process snapshots-SampleSecondsapart, with the counters sampled in between. CPU % is delta / (interval × logical CPUs) × 100. The counter paths are held once and also build the reproduction command.Get-BackupSignalreads the Backup channel by numeric event id and never reads localized labels. wbadmin runs only when elevated, and only its exit code and version-id count are used. Its sources, ids, paths and keys are held once and build$commands.Test-TopProcessesitems are FindingItems of a newprocesskind (identity: the lowercased image name), so they can be muted. Disk latency is graded only on a window of at least the sustained window.sample_secondsis reported.Test-BackupStatusis WARN when no source is present and UNKNOWN when any source needs admin. The System Image Backup deprecation note is always in the detail.-SampleSecondsparameter, validated 5-60 with a default of 15, is passed to checks that declare it. The per-check timeout is nowGet-CheckTimeoutSec: max(90, window + 30).ConvertTo-AppendixMarkdown: it rendersitems[]for any check, and it never prints anexclusionitem's title or value.backup-statusrow in the elevation matrix. Catalog entries fortop-processesandbackup-status, bothreliabilitywith no cadence, and sections 26 and 27. Sections and entries 20-27 are positions assigned across the sibling PRs.minor).Verification
run-tests.ps1exits 0: 789 passed, 0 failed, 1 skipped.-SampleSeconds 60exits 0:top-processes62768 ms andstorage-top-n39683 ms, both under 75,000 ms. The default 15 s run also passes.system-imageasunknown.typos, machine-paths, the TODO lint and the changelog check all pass.Related
backup-statusreads UNKNOWN on standard runs until the elevated pass lands, because restore points need admin.🤖 Generated with Claude Code