Repository navigation
feat(monitor): the gh-pr reader fetches, the wake judge decides - #13759
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: |
First Principles Review (Fable 5) — 🟡 CONCERNSPremise-level review of First-Principles-Verdict: CONCERNS A third-order loss ledger ( Not justified as shipped
What this change shipsInventory (10 items) — 8 justifiedIntent: let a watch owner's own criterion — including reviewer prose — decide when a PR watch wakes its session, by splitting fetching from judging. ADDITION, licensed by
Capped at 10: also riding along are the ack/tool-description relabels (the old wake-set promise no longer holds, so derived), [FIRST-PRINCIPLES-REVIEWED] 3277d95 |
Design Review (Fable 5) — 🟡 CONCERNSDesign-level review of Design-Verdict: CONCERNS A permanently-partial reading disables gating forever — every tick fires, no alarm distinguishes it from real activity, and the backstop never counts it. Watch
Suggestions
[DESIGN-REVIEWED] 3277d95 |
Opus 5 Review — ✅ no blocking findingsReviewed Review detailsAdvisory only — nothing blocks: one in-memory/on-disk baseline divergence on the failed-persist path. FINDING — src/kiro_crew/autonudge.py:6709 — [OPUS-REVIEWED] 3277d95 Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
bf6767b to
a732c5f
Compare
a732c5f to
3b93af2
Compare
3b93af2 to
b72bb05
Compare
|
|
|
|
The duplication is real and I verified both halves rather than taking them. The item offers a second clearing path — a named boundary reason why Worth naming what this makes the third reader of, because that is the part that matters more than the line count. The same secondary-limit vocabulary appears in Ticketed onto #14074, which already carries the shared classifier's half of exactly this problem, rather than opening a second issue: the remedy is one decision about who owns GitHub's rate-limit signals, and splitting it across two tickets invites two different answers. Not fixed on this head. Reading a |
The fact holds. The item is right that this rides along rather than being declared, and right that it matters most for watches armed by an earlier build: their stored message carries knobs that configured the wake, and nothing re-aims them at the judge criteria that replaced them. That consequence is already tracked. #14072 carries it as one of its clearing conditions — the behaviour change for already-armed loops stated where an owner sees it, or the docs saying existing watches must be re-armed — alongside the settled-green default the same retirement removed. Both are the same question about what an existing watch inherits, so they belong in one place. What I cannot do here is the other clearing path, and it is worth being precise about why rather than calling it impossible. Declaring it means editing the pull-request description, and a body edit re-rolls every review lane exactly as a push does. This head has Design at PASS and First Principles at CONCERNS with one remaining fenced blocker; trading those verdicts to add a sentence would cost more than the sentence is worth, and the next authorized round carries it for free. This comment is the declaration on the record until then. |
Two things dispose of this, and the first is the adjudicator's own: On the substance, the anchor is The specific mechanism this finding describes is a different claim from the rule, and worth answering on its own terms. It says two hidden lanes can exchange states inside an over-full bucket while the retained facts and the digest stay identical, suppressing the tick. That is true of a bucket cut at a cap, and it is why the cut is said out loud: an over-full board carries The remedy it proposes — per-bucket overflow counts in the digest and the rendered summary — would change the digest for a board whose live lanes were all measured, which is the outcome So: no code change. The rule is closed on this diff by the whole-dict pin, the adjudicator declined to uphold the finding, and the mechanism it names is already covered by the truncation being visible rather than silent. |
The adjudicator reached this line and declined to uphold it, in its own words:
The stamp is Why I am not taking the proposed fix, which is the part that matters most here. It asks that each forgotten stash's identity be preserved until its owning loop consumes the loss notice. That is exactly the design this line replaced, and it has a failure the current one does not. A loop can be removed while it still owns a notice. Neither removal site clears the judge's stash, and the judge exposes no cleanup entry point, so nothing ever takes that notice and the store never empties. When the forgotten state was spent only on the store emptying, one such notice pinned it permanently — and while it was pinned every other loop's take reported a loss, so every gated pull-request watch fired every interval for the life of the process. That is not a delayed notification; it is the cost promise of the whole feature inverted, permanently, for every watch on the gateway. I found that by asking what bounded the state rather than from any review, proved it with a test that failed on the old line, and fixed it by bounding the state to a rotation of takes. So the two behaviours trade against each other. The finding's remedy prevents a case needing ~129 abandoned loops plus a specific ordering, self-healing on the next tick and floor-delivered within ten. The current line prevents a permanent, gateway-wide one. Where they conflict the bounded and recoverable loss is the correct side. The residue the finding is right about is real and now tracked in #14113: a removed loop leaves its stash entry and its notice behind, which costs a bounded slot, up to one rotation of forced fires, and a slightly overstated loss counter. Clearing at the source — a cleanup entry point both removal sites call — is deferred there deliberately, because the backstop already removes the unbounded consequence and the coupling that fix introduces is a decision worth making outside a review round. |
I checked the mechanism rather than taking it, and it holds exactly as described. At The branch above it cannot cover for that. The consequence is the one Opus states: one third-party comment whose body the per-item scrub refuses makes the tick fire every cadence interval for as long as that comment stays inside Worth saying plainly: this is a more likely failure than the fenced finding on this same diff. That one needs roughly 129 loops abandoned between publish and take plus a specific ordering. This one needs one commenter to paste a long URL, which is ordinary behaviour on a pull request. It is also a defect I introduced — the scrub-refusal exit was added to stop a partial shed reaching the judge, and it over-fires. The remedy is available rather than hypothetical, which is worth recording for whoever takes it. Not on this head, and the reason is procedural rather than technical. This lane concluded with no blocking findings, the head's only remaining blocker is a security-fenced item awaiting a human override, and the push rule in force on this pull request does not authorize a push for an advisory finding. Changing the exit condition of the quiet decision also needs its own pins in both directions — a repeated refusal stays calm, a fresh one still fires — which is a round of work rather than a line. So this is recorded as accepted and owed, not as answered away. Flagging it to the human who holds the override, because taking the override ships this with it, and that ought to be a decision made knowingly rather than by omission. |
…question's baseline
The item offers two ways to clear: delete the machinery, or name a counted path that reaches more than 64 concurrently-abandoned stashes. The second one is available, so deleting would be wrong. The path is loop removal. The number is not mine either. The GPT lane's own adjudication on the previous head put the condition at roughly 129 loops abandoned between publish and take in one process, which is the same population this cap counts, arrived at independently. Reachability is also pinned rather than argued. What the item is right about is the description, and that is a fair hit. The body declares the stash cap and its counted drop notice but stops there, so a reader learns the first store is bounded and not that a second one is, nor what spends its state. That is under-declared for machinery this size. I am not editing the description on this head. A body edit re-rolls every review lane exactly as a push does, and this head has GPT clear for the first time in the round with one lane still in flight. Trading that to add a paragraph costs more than the paragraph is worth; this comment carries the declaration until a round that needs a push for another reason. |
I checked both symbols rather than taking the grep. One fact the item does not mention makes the case tighter. They are referenced from Ticketed onto #14073, which already carries the dead-surface question for this module from the earlier round's finding on Not deleted on this head. Deleting a public name plus the tests that pin it is a behaviour-neutral change that still has to prove it is behaviour-neutral, and the push rule in force here does not authorize a round for an advisory finding while the board is otherwise settling. The names are inert — nothing calls them, so nothing is at risk from their staying one more round. |
The item's own clearing condition offers two routes: coalesce a sustained run of The tension the item names is real and I am not arguing it away. #14071 carries the coalescer for that, and it now has a second cause behind it rather than one: a body-stash drop also produces a not-whole reading, by a different route and with a different clearing condition, which is recorded on the issue as a comment. A coalescer that handled only the check-name case would leave the other open, so the ticket covers both. Not built on this head. A coalescer is a state machine with its own persistence question — how many consecutive partials, counted where, reset by what — and the design decision it needs is exactly what a follow-up issue is for rather than a round appended to a pull request that is otherwise settling. |
The mechanism holds. Calling that compatible is too strong. The config still parses, which is all "keeps working" is really saying, and the item is correct that parsing is not the same as behaving as armed. #14072 carries it, with both clearing routes the item offers recorded there: the upgrade note stating that a green wake now needs an explicit Not on this head. Folding the legacy keys into the brief means deciding what |
The suggestion is to render the It is right, and the reason is the one the suggestion implies rather than states. The not-whole path fires precisely when the reading could not be trusted, and the wake it produces is indistinguishable from a wake caused by something a reviewer actually did. An owner who cannot tell those apart learns the wrong thing from the interruption: they go looking for the comment or the check that changed, find nothing, and the next such wake is the one they start ignoring. The reading already carries the reason — Folded into #14071 rather than filed separately, because that issue already owns the partial reading's cost and this is the same reading's presentation. A coalescer that reports one partial per run and still does not say why it fired would leave the owner with the same puzzle, so the two belong to one change. Not on this head. Threading the note into the wake body touches the notice-rendering seam and needs a pin that the cause survives into the delivered text, which is a round of work. The suggestion is advisory, this lane is a WATCH rather than a block, and no push is authorized for it. |
Verified in full rather than taken. At The comment on that branch says it "leaves the baseline exactly as the stored record has it", and the warning says "leaving the stored baseline in force". Neither is what The consequence is exactly as the finding states, and the chain is short. The next tick builds its seen set from One consequence the finding does not name makes it worse, and it is worth recording. An emptied baseline also defeats the scrub-refusal freshness gate added on this head: that gate asks whether a refused item is new, and after this branch every item claims to be. So a persist failure re-opens the fire-every-interval path that gate exists to close, for every remark at once. The proposed fix is right and is the minimal one: capture I am not pushing it. The board is fully green on this head -- 81 success, 11 skipped, zero failure or cancelled, every review lane concluded and fresh, Tracked as #14137 instead, which carries the branch, the full consequence chain including the effect on the freshness gate, and the prior-restore remedy verbatim. The trade was weighed explicitly and went this way because the defect sits only on the persist-refused error path and self-heals on the next successful write, so a three-line change did not justify re-rolling six clean review lanes. Recorded as real and owed rather than answered away. |
iamwhatever
left a comment
There was a problem hiding this comment.
Is this still required? Seems the new wake judge has already been merged? I guess we will need to use Jev like mechanism later when it is available.
|
Yes, still needed. #12787 merged the judge itself; this PR is the follow-up that makes the judge actually see the evidence. Today the gh-pr probe still makes its own wake/quiet call: any board change wakes the owner directly, and comment bodies never reach the judge at all. This PR turns the probe into a pure fetcher -- retry, backoff, rate-limit handling and pagination live there -- and hands everything it fetches (checks, reviews, comment bodies, mergeability) to the judge, which makes the only decision. The core keeps one hard rule: PR merged/closed ends the loop. Jev is already available and in use (nudge_evidence scope + TYPESAFE_API_KEY); the haiku lane from #12776 covers installs without a key. RFC #13790 (merged) documents this split. |
|
@iamwhatever Still required, and the merged RFC names this PR as the piece that is still open.
12776 and 12787 merged; 13759 is the remaining one. Its PR ladder item 4 describes this PR item for item: "PR G -- the reader fetches and the judge decides: What merged was the judge's screening machinery and the design doc, not this reading:
The merged code says in its own words that this PR's reading does not exist yet. Concretely, against
Nothing else implements it: On the Jev point: that lane already exists and is already selectable, CI on this head is clean: 92 checks, 92 names, 0 pending, 0 non-pass, |
What is the problem?
The gh-pr probe both read a pull request and decided whether the tick deserved a
model turn. It classified the board against its own notion of actionable -- a
failing check absent from
known_reds, every lane green whenwake_on_greenallowed it, a conflict -- and emitted a wake from that. One module holding the
reading and the judgment has three consequences.
things: one waits for a reviewer, one waits for a rebase to settle. The probe
answers the same question for both.
probe reports that a comment arrived and deliberately never reads it, so a
reviewer's ask -- which routinely sits in a comment body while the lane carrying
it reports
success-- cannot be a wake criterion at all.MonitorState.last_observation, written only by the structured controller'sprovider. A gated loop observes through the raise-based kernel, whose verdict
carries prose and no facts, so the judge screens every such loop against an
empty observation.
The transport is also thin: one
gh pr view, one retry-free attempt, norate-limit handling, and a check rollup read as a bare array -- which carries no
count, so a truncated read cannot be detected.
Why this issue matters to the user
A wake criterion the owner writes in their own words is the feature
monitor_startadvertises. With the probe deciding,wake_when: "a reviewer asks for a change"cannot be honoured: the judge is handed check tallies and a commentfingerprint, so it answers about lanes while the reviewer waits.
The reverse failure is quieter. A rollup read short looks exactly like a small
clean board, and a rate-limited tick looks like a failed fetch. Both resolve
toward a reading the owner cannot tell apart from calm.
How our fix solves it
The reader fetches, the judge decides, and the core owns the irreversible steps.
Each component holds exactly one of those jobs.
probes/gh_pr.py) returns facts and nothing else. One_Transportper tick gives bounded retry with jittered backoff, honours arate-limit window the response names and caps that wait, paginates check runs
and commit statuses, and reconciles rows against
total_count. Every call isbounded by what the tick has left. A row's identity is its workflow rather than
an app slug, so two workflows sharing a job name stay two rows. A reading that
fell short is
partial, withincompletenaming what was missed.nudge.wakecarries theevidence kinds
pr_state,pr_checks,pr_commentandpr_review; thedefault brief names a failing check, a reading that is not whole, and a new
remark. The shed rule pins the two typed summaries and drops the oldest prose
first, so a tight char budget gives up a comment body rather than the board.
autonudge.py) owns what cannot be undone.observation.is_terminalmaps to the existing deactivation with merged andclosed kept distinct; the reading is persisted before it is published, so a
refused write publishes nothing and fires; the judge baseline is staged and
committed under the lock, and only while the brief it was earned under still
stands. The remark delta is computed here because the fetcher holds no memory
between ticks.
babysit/scripts/pr_watch.pyis deleted, and acron registered against a deployed copy of it is refused with its job KEPT
rather than silently removed.
What tests we did
Local, scoped,
-n0: 837 passed across the eight test files this diff owns --test_autonudge_wake_judge.py259,test_autonudge.py216,test_wake_judge_feedback.py175,test_gh_pr_fetch.py80 (new),test_autonudge_stop_auth.py59,test_review_repair_routing_skill.py20,test_irq_port_baseline.py15,test_monitor_start_ack.py13.test_babysit_pr_watch.pyis deleted with the driver it tested; its survivinginvariants live in the files above. New coverage is one case per behaviour across
the transport, the terminal mapping, the shed rule, the persist-before-publish
order and the baseline lifecycle and the retained board's bounds, each pinned in both
directions.
Measured rather than assumed: a 90-check board carrying five comment bodies
renders to 4,371 of
MAX_STATE_CHARS8,000 as 7 evidence items, with nothingdropped and all five bodies intact. Summarising the board into one
pr_checksitem is what makes that fit, so no ceiling is raised.
Prose reaches the judge through an in-memory per-loop stash, capped at 64. A
stash dropped to hold that cap is counted and logged, and makes that tick read
as not whole rather than as a remark with nothing in it, so the tick fires.
Gates run locally on this tree:
flake8,isort, the baselinedblackgate,comment-history, and
mypyover 1,726 files -- whose only four complaints areboto3-stub argument types in two files this diff does not touch. The full backend suite is
left to CI.
Any other suggestions on the work
raises no observations, so those layers idle. Collapsing them is 1,160 lines of
kernel and 1,449 of tests with its own review surface, so it is out of scope.
first_seen_this_tickisrendered for the judge and read by nothing in the core. That is the line this
design draws, and the first consumer that branches on it has rebuilt the
comparator this change removes.
absorbed inside the tick, but the consecutive-failure backstop counts readings
that never reached the subject, not ones that came back short, so a sustained
run of
partialraises no alarm. Coalescing that is a follow-up.monitoring/github_pull_request.pyis untouched.monitor_watchstaysprovider-decided and its reader still produces a comment fingerprint rather than
bodies, so the collector keeps rendering that digest -- the only discussion
signal that path has.
no linked issue: this is feature work, and the repository convention reserves
issues for reported problems -- the context lives in this description.