Repository navigation
fix(autonudge): let the judge brief's own target list decide the watched PR - #14480
Conversation
Design Review (Fable 5) — ✅ PASSDesign-level review of Design-Verdict: PASS Verify the instruction-over-brief precedence: in the conflict shape the collector still drops every monitor reading, so the judge stays evidence-blind there (deliberate, documented, base-equal). [DESIGN-REVIEWED] 0b4d595 |
First Principles Review (Fable 5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Verify issue #14470 records the brief-armed no-monitor failure — the defect's provenance rests entirely on that link, which this lane cannot read. What this change shipsInventory (10 items) — 9 justifiedIntent: a gated loop whose judge brief names its pull request must actually watch it — a FIX (linked issue #14470).
[FIRST-PRINCIPLES-REVIEWED] 0b4d595 |
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: |
Opus 5 Review — ✅ no blocking findingsReviewed Review detailsNothing blocks — one advisory finding: a judge-only update burns a config generation on a gated loop that has no resolvable subject. FINDING — src/kiro_crew/autonudge.py:3533 — on a gated loop whose subject does not resolve ( [OPUS-REVIEWED] 0b4d595 Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
2ad5b07 to
3a6dcfc
Compare
3a6dcfc to
036db6d
Compare
036db6d to
31d41ea
Compare
…hed PR A gated loop resolved its subject from the message only, so a loop naming its pull request in judge.targets and not in its own text got no monitor at all -- nothing was fetched, every tick fell back, and no PR comment reached the judge. One resolver, infer_subject, now answers WHICH pull request a loop is about for all five sites that used to ask independently: the brief's target list first, the instruction second. parse_targets already reads the list first, so both halves are now about one pull request instead of two.
31d41ea to
0b4d595
Compare
Problem / Motivation
Goal: A gated loop's pull-request monitor must come from the subject its judge
brief names, not from its message alone.
A gated auto-nudge loop decided which pull request it watches from its message
only. The wake judge's own
judge.targetslist -- the field where an owner namesthe subject for the judge -- was never read when the monitor was built.
So a loop armed like this got no monitor at all:
targets.inferrefuses a barePR 13936(a shorthand carries no host, and#Nisequally an issue reference -- both deliberate), the brief was not consulted, and
infer_monitorreturnedNone.Five sites resolved the subject independently from
loop.message, andupdateneverre-resolved it when the brief changed, so replacing
judge.targetsleft the watchon the old pull request.
Why it matters to the user
The pull-request probe is what fetches review and comment bodies so the judge can
read them. No monitor means no probe, so such a loop recorded
outcome=fallbackwithzero evidence items and fired on the plain timer every interval -- a turn on a
schedule instead of a turn when a reviewer asked for something.
The two halves also disagreed.
parse_targetsreadsjudge.targetsFIRST and asksabout nothing else once it is present, so the collector asked about the brief's strings
while a monitor built from the message published a reading of a different pull request
-- dropped every tick. A
ghfetch that could never become evidence.What changed (how the fix solves it)
Symptom -> cause -> fix: the turn fires on the timer because the tick has no evidence;
no evidence because there is no monitor; no monitor because the subject came from the
message while the owner named it in the brief. So it comes from both, in one place.
autonudge.infer_subject(message, judge)is now the single answer to WHICH pullrequest a loop is about, and all five sites call it.
when the instruction names no pull request in ANY grammar. Otherwise the INSTRUCTION
decides, which is what base answered before the brief was read at all. Falling back
rather than refusing matters: for the ordinary "blocked on fix(sandbox): bypass toolbox shim to fix nested sandbox failure on macOS 26 #7" shape base bound a
monitor on the loop's OWN pull request, polled it and retired the loop when it
merged, so refusing would take merge-retirement away from loops that have it, stored
ones included.
targets.names_pull_request(text)answers "does this name a pull request at all",across URL,
owner/name#123and barePR #42. It has to matchinfer's own widernotion:
inferselects only from a URL but treats a shorthand as naming one, so aURL-only predicate read "Babysit PR fix(sync): MeshClaw beta sync 2026-07-18/19 batch-41 addendum (1 frontend ported; cumulative 61: 37 backend + 25 frontend) #42" as naming nothing and handed the watch to
the brief's blocker. Wider than
infer(text) is not Nonetoo, so a two-subjectinstruction stays unresolved instead of being resolved by the brief.
monitor_start's ack derives its gated disclosure after the brief is validated.monitor_updatere-resolves the subject when the brief changes, and a rebind thatchanges the subject now advances
config_generation, so a structural-terminalverdict for the old subject cannot deactivate the new watch.
docs/system-specs/modules/babysit-pr-watch.mdnow states this resolution order; itpreviously predicted message-only inference.
gate=falseloops have no judge and are unchanged;monitor_watchmonitors areuntouched. The grammar stays in one place: every candidate goes through
targets.infer, which shares one URL collector with the new predicate.Tests we did
20 tests in one class in
test/test_autonudge_wake_judge.py:judge.targets, asserts themonitor exists, and asserts a fresh comment arrives as a
pr_commentevidence item,dropped == 0(mockedghreader).blocker is never watched in any of the three grammars; a stored loop in that shape
keeps its monitor; a shorthand instruction refuses the brief's entry; an ambiguous
instruction stays unresolved.
PR 13936spelling still gates, and a citedsource location (
autonudge.py#1751) is not read as a second subject.judge.targetsmovesmonitor.targetand advancesconfig_generation; an unchanged subject spends none.Three mutations, one per fix, each caught: predicate back to URL-only (2 failed),
refusing instead of falling back (2 failed), no generation increment (1 failed).
test_autonudge_wake_judge.py+test_probe_targets.pytest_autonudge.py+test_monitor_start_ack.py+ 3 siblingsmypy src/kiro_crew/The full suite is CI's job on the merge ref.
Not a goal
Resolving a bare
PR <number>against a default repository is not implemented.#123is equally an issue reference, so a default-repo rule silently turns an issuemention into a watched pull request, and it would be a second grammar beside
targets.infer. The observed failure is covered without it. Tracked separately.Pattern harvest
Rule candidate: review-prompt
Pattern: a predicate extracted to guard a decision accepts LESS than the decision
itself. Here
names_pull_requestscanned only the URL grammar whileinferalsotreats
owner/name#123andPR #42as naming a pull request, so the guard passedtext
infercalls ambiguous. Ask of any extracted predicate: does it accept exactlywhat the decision accepts?
Other suggestions on the work
parse_targetsreturns nothing once a list is present; load-bearing here, not obviousat its call sites.
Fixes #14470