refactor: account for completed monitor turns - #5182
Conversation
GPT 5.6 Review — ✅ no blocking findingsGPT 5.6 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
Design Review (Fable 5) — 🟡 CONCERNSDesign-level review of Design-Verdict: CONCERNS The completion contract fail-closes on Watch
Suggestions
[DESIGN-REVIEWED] 529e202 |
First Principles Review (Fable 5) — 🟡 CONCERNSPremise-level review of All evidence gathered and counts verified. Here is the review. First-Principles-Verdict: CONCERNS Every runtime capability here is dormant — nothing sets What this change shipsIntent: charge a structured monitor's budget only when a provider actually completed a turn — an ADDITION (labeled
Watch
Subtractions
[FIRST-PRINCIPLES-REVIEWED] 529e202 |
1c2704b to
25a7269
Compare
25a7269 to
d39654b
Compare
d39654b to
f099658
Compare
f099658 to
b859404
Compare
b859404 to
5216adc
Compare
a296c6f to
8a5b174
Compare
8a5b174 to
cd41882
Compare
|
Addressed the current blocking review: completed-turn accounting is now staged, persisted, and only then published to live state. Failed writes leave counters, terminal fields, and timers unchanged; repeated cancellation drains the executor write before releasing the service lock. Also fixed the slice-owned import-order failure in chat_runner.py. Focused verification: 600 monitor/provider tests passed; isort, flake8, Linux mypy, black gate, and docs lint passed. CI was not manually rerun; the restack push triggered the normal checks. |
|
Please rebase/split this PR to residual-only scope. Merged predecessor #5181 ( This is also the base of the intentional #5182 -> #5183 -> #5184 -> #5185 -> #5186 stack. Rebase the stack in that order after shrinking this base so children do not continue carrying the already-merged #5181 layer. |
bolichen97
left a comment
There was a problem hiding this comment.
Approved after a full-diff review (scope match, no out-of-scope files, security surface checked, tests verified non-vacuous). Review notes available on request.
bolichen97
left a comment
There was a problem hiding this comment.
Re-approving after conflict-resolution rebase: three same-anchor conflicts (main's name-grant audit identity injection + this PR's monitor_completion hook) resolved by keeping both sides; chat_runner keeps main's newer name_grant import set plus this PR's monitoring.completion import; AST-verified, driver body wires monitor_completion at 5 sites; single commit, 21 files.
|
Addressed the blocking GPT finding in this PR, where the legacy Slack collector owns the completion accounting. Synthetic |
|
Fixed in |
|
Addressed the review blocker by excluding ACP Focused local verification: 807 passed ( |
Problem / Motivation
Legacy delivery counts dispatch attempts, while structured monitors need to charge only work that actually reaches a provider completion boundary.
Why it matters
Charging probes, busy handoffs, or failed delivery overstates cost; inferring completion from helper returns can undercount failures or double-count retries.
What changed (motivation → approach → change)
Tests
Manual verification
N/A — transport and completion behavior is covered with deterministic provider-event fixtures.
Related Issues
N/A — implements the accounting layer specified in #5180 and depends on #5181.
Checklist
Contribution License Agreement
N/A — the repository template does not yet supply final CLA wording.