Repository navigation
fix(session): log steady-state runtime reconcile readings at debug - #19620
KiroCrewCaptain merged 1 commit into
Conversation
UX Review (Opus 5.5, fork) — ⏭️ skippedRevision |
Design Review (Opus 5.5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS Check that a stray population that grows but never meets the kill conditions has a visible signal now that its summary line logs at DEBUG. [DESIGN-REVIEWED] 8398659 Description read[DESCRIPTION-READ] 173a348b4dec71c3a2768bbf157a3577bea0e8db5095e0f7db50f93fab6eabe4 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5, fork) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS On an install with What this change shipsInventory (4 items) — 4 justifiedIntent: stop the gateway log repeating the runtime reconciler's unchanged reading at WARNING every tick, while passes that act still warn. FIX (closes #19618).
[FIRST-PRINCIPLES-REVIEWED] 8398659 Description read[DESCRIPTION-READ] d708bfe213fa75bda193ef8d41c8e874409758ae0cb52c380f494ea2d55e0644 That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review (fork) — ✅ no blocking findingsReviewed |
GPT 6.1 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
0d5beec to
d89cb55
Compare
|
Rebased onto main 9a77e12 (new head d89cb55). The only conflict came from #20537 splitting test/test_runtime_reconcile.py: the five new summary-level tests now live in test/test_runtime_reconcile_wiring.py, next to the existing not-mine level tests and the _cleanup_with_clock/_drive_reconcile helpers they use. The source and spec hunks are unchanged. test/test_runtime_reconcile*.py plus the session_cleanup test files: 575 passed, 5 xfailed. black, isort, flake8 and mypy are clean. |
|
|
d89cb55 to
8398659
Compare
|
Maintenance rebase onto main 9037cde (new head 8398659). Local, at 8398659: the 22 test files that import |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Tier 1 auto-approve: fix (4 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, security checklist all-NO, no reviewer-lane findings, readiness signal fresh for this head SHA, declared category matches the diff. Category: the two per-pass runtime reconcile summaries drop to DEBUG when the pass changed nothing, and stay WARNING when it acted. Spec files changed as a ride-along (a minority of the diff on both file count and changed lines), not reviewed as a design decision: docs/system-specs/modules/runtime-ownership.md.
Problem / Motivation
Goal: The gateway log stops carrying the runtime reconciler's unchanged reading at WARNING every five minutes, while passes that kill, would kill or retract something still warn.
Every cleanup tick writes one or two WARNING lines that say nothing happened, for the life of the gateway:
Why it matters
Every Linux install with long-lived tool work, an app backend or a record held only by the MCP pidfile gets 288 or more WARNING lines a day that need no action. They bury the few reconcile lines that do (a retraction, a kill, a withheld kill) and train anyone reading the log to skip
Runtime reconcile:warnings.Not a goal
not-minerecords soowned_deadreaches zero.session.runtime_reconcilecounter.not-mineDEBUG stay as they are).What changed (motivation → approach → change)
Symptom: two WARNING summaries every tick while the pass did nothing. Cause: each summary's level was chosen by whether a count was non-zero, but
owned_deadmade only ofnot-mineanswers andunowned_alivemade only of permanently withheld pids are steady states. The per-pidnot-mineline had already been moved to DEBUG for this reason; the summaries above it had not.Change: both summaries pick their level from whether the pass acted. The dead-direction summary in
runtime_reconcile.pyis WARNING when a record was retracted or a retraction it owed failed (it now counts failures), and DEBUG otherwise. The hook summary insession_cleanup.pyis WARNING when the reading has a kill, a would-be kill or a retraction, and DEBUG otherwise. DEBUG over INFO because the steady line would still repeat every tick, and the counter already publishes every field each pass. The runtime-ownership spec records the rule.Backwards compatibility
Compatible: only log levels change; no field, counter, config key or return value moves.
Removes nothing: the same lines are still written with the same text, at DEBUG instead of WARNING when the pass did nothing.
Tests
test/test_runtime_reconcile_wiring.py, beside the existingnot-minelevel tests, five new tests (seven cases):test_a_dead_count_that_is_all_not_mine_is_summarised_below_warning: allnot-minegives a DEBUG summary.test_a_dead_count_with_a_retraction_is_summarised_at_warningand..._with_a_failed_retraction_...: either keeps the summary at WARNING.test_a_steady_reading_is_summarised_below_warning: the hook summary forunowned_alive=20 owned_dead=10and nothing done is DEBUG.test_a_reading_that_acted_is_summarised_at_warning[killed|would_kill|retracted]: each keeps the hook summary at WARNING.The two steady-state tests fail with the source change reverted (2 failed, 5 passed) and pass with it. Determinism: the five tests passed 10 of 10 repeated runs and in reversed node-id order; they use explicit
caplog/monkeypatcharguments, no autouse fixtures. Alltest/test_runtime_reconcile*.pyfiles plus every test file importingsession_cleanuppass: 575 passed, 5 xfailed. black, isort, flake8 and mypy are clean on the touched files.test/test_flake_pattern_ratchet.pypasses. Semgrep is not installed on this host, so the SAST lane is CI's.Manual verification
N/A — unit coverage sufficient: the change is two log-level choices, and both branches of each are asserted on the real code paths (the reconciler's
run_onceand the cleanup hook).Related Issues
Closes #19618
Pattern harvest
Not generalizable: the class (a steady-state reading at WARNING) has no shape a rule can see, because whether a count is "steady" depends on what each count means here.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)