feat(replication): add first-audit scheduler observability#173
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds an observability layer to the ADR-0004 deterministic “first-audit” scheduler for monetized pins, emitting per-event debug logs and a low-frequency cumulative summary to support fleet-level funnel analysis without changing scheduling/protocol behavior.
Changes:
- Introduces atomic counters and stable terminal outcome classification for first-audit runs.
- Emits per-event
DEBUGlogs for queueing/coalescing/launching/terminal outcomes and a 5-minuteINFOsummary. - Adds a unit test to ensure terminal outcome classification and string labels remain stable.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/replication/mod.rs | Adds first-audit scheduler observability (counters, logs, terminal outcome classification) and a stability unit test. |
| src/replication/config.rs | Adds the 5-minute summary interval constant for the new observability summary. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
jacderida
approved these changes
Jul 12, 2026
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.
Summary
Adds observability to ADR-0004's deterministic monetised-pin first-audit scheduler without changing scheduling or protocol semantics.
audit_trigger=first_monetized;queued,coalesced,cooldown_deferred,outside_answerability_window,launched,passed,timeout,failed);This is the common observability layer for the bounded first-audit scheduler work. It deliberately does not change queue capacity, retry policy, cooldowns, launch rates, payment verification, trust handling, audit mechanics or commitment semantics.
Why
A matched DEV-01/DEV-02 ablation found that detaching the monetised-pin sender reduced:
while preserving 100% upload/download success and improving transfer-tail duration and node resource load. The current logs cannot provide a complete eligible → queued/coalesced → launched → terminal first-audit funnel. This PR supplies that denominator before the scheduler is redesigned.
Verification
cargo fmt --all -- --checkcargo check --all-targets --all-featurescargo test first_audit_terminal_outcomes_are_stable --all-featurescargo test monetized --all-featurescargo test --lib --all-features— 684 passedcargo clippy --all-targets --all-features -- -D warnings -D clippy::panic -D clippy::unwrap_used -D clippy::expect_usedReview notes
The per-event records are
DEBUG; only the five-minute cumulative summary isINFO, to avoid making normal fleet logging materially noisier.