Skip to content

feat(process_health): add application health aggregation - #1009

Open
martinhavelka (wukchung) wants to merge 63 commits into
microsoft:mainfrom
wukchung:u/wukchung/application-health
Open

martinhavelka (wukchung) wants to merge 63 commits into
microsoft:mainfrom
wukchung:u/wukchung/application-health

Conversation

@wukchung

@wukchung martinhavelka (wukchung) commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Agent assessment

Self-reported assessment, not an independent review.

Assessed revision: c6698f22e9558228c4caaf5376a36229c0bbb6fe

Dimension Assessment Rationale
Change confidence 8/10 ↑ Package checks, tests, doctests, Clippy, rustdoc, formatting, generated README, spellcheck, and manifest ordering pass.
↓ The full just anvil-container just anvil-pr rerun is still in progress.

🤖 The new process_health package provides framework-neutral application health reporting through the health library target. HTTP readiness adapters remain in the dependent oxidizer_health_probe pull request.

Summary

Publishers write health contributions to named components. Component and Monitor expose aggregate state, change notification, and immutable reports.

Aggregator
  component(name) -> Component
  monitor() -> Monitor

Component
  publisher()
  publisher_with(state, attributes)
  report()

Publisher
  publish(state, attributes)
  degraded(reason)

Monitor
  state()
  changed()
  reports()

Public contract

Surface Current behavior This PR
Cargo package Not available process_health, in crates/process_health
Library import Not available health; install with cargo add process_health --rename health
Aggregator::new(observed::Sink) Not available A diagnostics sink is required. Aggregator has no no-argument Default path.
Process observation Not available Monitor owns state, changed, and reports. It keeps the process root and worker alive after all Aggregator handles are dropped. reports returns an opaque Iterator.
Publisher role Not available Publishers are write-only. Observe component or process state through Component and Monitor. Dropping normally queues removal without waiting for aggregation; releasing the final process owner waits for worker shutdown.
Attributes Not available Attribute names and values are strings. Attribute iteration is opaque.
Signals Not available Signal is an immutable publisher contribution in a report. state() returns Health; attributes() returns an opaque iterator.
Worker failures Not available Startup and termination failures emit typed observed events. Readiness fails closed if the worker stops.
HTTP adapters Not available in process_health The framework package does not select an HTTP stack. The dependent probe package supplies readiness adapters.

Evidence

Passed on revision 7c31c2548a720400ad083356e93ba32deb4ba5bf:

  • cargo clippy -p process_health --all-targets --all-features --locked -- -D warnings
  • cargo test -p process_health: 66 unit and integration tests passed; 11 doctests passed
  • just anvil-miri --package process_health
  • just anvil-mutants-diff: 337 mutants killed, 0 survived, 0 timed out, 100.0% score
  • just anvil-readme --fix
  • just anvil-spellcheck
  • git diff --check

The full native just anvil-pr gate remains blocked by the local Visual Studio installation, which lacks Microsoft.VisualStudio.Component.VC.14.51.x86.x64.Spectre. The failure occurs in the unchanged msvc_spectre_libs package. GitHub CI is validating the complete matrix for the final revision.

Risk Assessment

Door: One-way

This defines a new public API before its first release.

Blast Radius: Consumers

Callers install process_health, import it as health, supply an observed::Sink, and use the separate probe package for HTTP adapters.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@codecov

codecov Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.0%. Comparing base (9e73397) to head (7c31c25).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##            main    #1009      +/-   ##
=========================================
  Coverage   99.9%   100.0%              
=========================================
  Files        854       10     -844     
  Lines      75041      631   -74410     
=========================================
- Hits       75032      631   -74401     
+ Misses         9        0       -9     
Flag Coverage Δ
linux 100.0% <100.0%> (ø)
linux-arm 100.0% <100.0%> (ø)
scheduled ?
windows 100.0% <100.0%> (+<0.1%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-advanced-security github-advanced-security AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cargo-gamma found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…progress

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…ransitions

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Clarify startup readiness and HTTP example requirements, register the crate for workspace consumers, and synchronize the worker-failure test with its intended publication.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…_http

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@martintmk

martintmk commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

Posted by an AI agent

Warning: Incomplete review

No current source-supported findings remain. The mutation-test watchdog exemptions are restored in both integration helpers. I reviewed all 19 cumulative changed paths using matching baseline-first evidence. Two output-only API areas remain unreviewed because a source-free inherited-input boundary could not be established. No overall verdict is given.

Full-review attempt, assessed head and revalidated head: 7c31c2548a720400ad083356e93ba32deb4ba5bf in wukchung/oxidizer. Target: microsoft/oxidizer, refs/heads/main. Source-assessed merge base and target tip: d6562ac6e42aef48b9586d8241675bcaeb7499f9. Current supplied and actual used target tip: 0a3cff4fbcd0c58072cbb63186f408649bf2fd0d. Merge base remains d6562ac6e42aef48b9586d8241675bcaeb7499f9. Coverage time: 2026-11-27T19:48:36.055548+00:00. Earlier review submissions remain tied to their own commits.

Area Status
Public contract done
Correctness done
Tests done
Performance done, source only
Naming done
Telemetry done
Resilience done
Consistency done
Public API surface could not review
Public API changes could not review
Integration tests done

Production behavior, documentation, package discovery and dependency configuration are unchanged from the preceding source assessment. New private tests cover registration ID agreement and publisher replacement scheduling. Existing tests strengthen registration and receiver-teardown checks. Hint changes select package-owned tests without changing other packages or generalized scheduling. No build, test, API capture, measurement or target-runtime validation was run by this reviewer.

Context-only refresh: 2026-11-27T22:12:08.952476+00:00. The head and merge base are unchanged. Current head CI: 45 successful checks, 1 neutral, 0 still running and 0 failed or cancelled. This refresh does not extend source coverage, validate the advanced target at runtime, retry blocked API work or start a completed-review cooldown.

Public API changes

Could not assess

No matching API captures, output-only classification, saved design draft or matching scoped rustdoc check was produced. The required source-free input boundary remains unproved.

Source-based API observations, not a complete API classification: the Cargo package is process_health and library target is health. Construction requires a Sink, attributes are string name/value pairs, publishers are write-only, and reports expose opaque iterators. Documentation distinguishes queued contribution removal from final-owner worker shutdown.

API human-review signal: undetermined.

Integration tests

Integration Test Additions Only

Compared with the merge base, where the package is absent, this head adds 26 integration tests across two targets. Existing state and lifecycle assertions remain. Both receive helpers restore unbounded waits during mutation runs and retain their native or Miri safety deadlines otherwise. No target, test or execution selector was removed.

Integration-test human-review signal: not required. Combined human-review-required decision: undetermined because API evidence is missing. No label was changed.

Benchmarks

Not applicable: complete base/head package inventory contains no benchmark targets or metabench registrations in the only changed package. Selected crates: none. Measured cases: zero. No benchmark owner or work remains pending. Source performance review is complete without measured regression claims.

Current unresolved findings

No unresolved findings.

The mutation-watchdog finding is source-fixed and provider-resolved. The duplicate-notification test finding and final-publisher shutdown finding also remain source-fixed and provider-resolved. Historical declined or deferred proposals retain their separate dispositions.

At the source-review cutoff, 112 roots and 235 comments were assessed. This context refresh read all 112 current roots and 235 comments without new source adjudication. Later discussion remains separate unassessed context. Both existing COMMENT review submissions remain pinned to their original commits. No new review, vote, inline comment, reply or thread-state change was submitted.

@martintmk martintmk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Posted by an AI agent

One non-blocking test-harness finding. See the rolling review report for coverage and the two missing output-only API areas. No overall verdict is given.

Comment thread crates/oxidizer_health/src/component.rs Resolved
@wukchung
martinhavelka (wukchung) marked this pull request as ready for review November 24, 2026 20:41
Copilot AI balanced review requested due to automatic review settings November 24, 2026 20:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved worker-failure paths can leave change observers pending indefinitely and cause unbounded queued-slot retention, while quadratic snapshot rebuilding can delay updates across components.

3 open issues
What changed in this PR

Adds oxidizer_health to the Oxidizer workspace so services can combine subsystem health signals, inspect diagnostics, and expose readiness without choosing a specific HTTP server.

Changes:

  • Adds publishers, named components, aggregate health, and independent change observers.
  • Provides filtered diagnostic reports and optional Tower and http_extensions readiness adapters.
  • Adds contract tests, API examples, and workspace integration.
File Description
README.md Lists the new health aggregation crate.
crates/​oxidizer_health/​tests/​worker.rs Tests worker ordering and snapshot updates.
crates/​oxidizer_health/​tests/​http.rs Tests readiness status, bodies, and headers.
crates/​oxidizer_health/​tests/​aggregation.rs Tests aggregation, notifications, lifetimes, and concurrency.
crates/​oxidizer_health/​src/​worker.rs Runs background aggregation and manages worker shutdown.
crates/​oxidizer_health/​src/​signal.rs Defines health signals and attribute equality.
crates/​oxidizer_health/​src/​report.rs Adds snapshots, diagnostic filters, and report iterators.
crates/​oxidizer_health/​src/​lib.rs Exports the public API and documents usage.
crates/​oxidizer_health/​src/​kubernetes_http.rs Implements optional HTTP readiness adapters.
crates/​oxidizer_health/​src/​health.rs Defines health states and worst-state selection.
crates/​oxidizer_health/​src/​component.rs Implements components, publishers, and queued updates.
crates/​oxidizer_health/​src/​attribute.rs Defines typed diagnostic attributes.
crates/​oxidizer_health/​src/​aggregator.rs Adds component registration and process-level monitoring.
crates/​oxidizer_health/​README.md Provides generated crate documentation.
crates/​oxidizer_health/​Cargo.toml Declares crate metadata, dependencies, and optional features.
Cargo.toml Adds workspace dependency entries.
Cargo.lock Records the new crate’s dependencies.

Review effort: Balanced

Comment thread crates/process_health/src/component.rs Resolved
Comment thread crates/oxidizer_health/src/report.rs Resolved
Comment thread crates/oxidizer_health/src/worker.rs Resolved
…dogs

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…ovals

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The first-release readiness API’s reservation, waker, and shutdown contracts warrant human concurrency and ownership review before publication, with full validation reported as incomplete.

No open issues 🎉

Review effort: Balanced

Cover degraded reason metadata and nested diagnostic panic cleanup, suppress one equivalent multiset mutation, and adopt the canonical process-health Gamma hints.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 27, 2026 17:48

@martin-kolinek martin-kolinek left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖: Approved.

Merge the current target branch and preserve the validated process-health mutation hints alongside main.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The new readiness API’s multi-atomic reservations, coalesced queues, and worker-exit notifications warrant human concurrency review because runtime validation of key interleavings was unavailable.

No open issues 🎉

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 27, 2026 17:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The test checks for a pending cursor before asynchronous publication processing is confirmed, allowing an incorrect extra notification to escape detection.

1 open issue

Review effort: Balanced

Use a later component turn to prove the repeated equal publication was processed before asserting that no notification was emitted.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 27, 2026 18:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The new public readiness API combines multi-atomic reservations, coalesced queues, and panic/shutdown handling whose ordering guarantees require human concurrency review beyond the supplied fixed-order tests.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 27, 2026 18:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The public readiness API’s atomic reservation transfers, coalesced scheduling, and reentrant waker shutdown warrant independent concurrency review, with full runtime-analysis validation still pending.

No open issues 🎉

Review effort: Balanced

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 27, 2026 18:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The aggregation and worker tests retain watchdog timeouts during mutation testing, risking local test failures instead of Gamma’s timeout verdict.

1 open issue

Review effort: Balanced

@martin-kolinek martin-kolinek left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖: Approved.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 27, 2026 19:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The first-release API relies on a multi-counter concurrency protocol and callback-driven shutdown, but the supplied tests do not systematically cover reservation interleavings, warranting human concurrency and API review before publication.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@martin-kolinek martin-kolinek left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖: Approved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants