Repository navigation
fix(autonudge): leave a default-brief loop with no readable target to its probe - #40001
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS No design-level concerns. Returning [DESIGN-REVIEWED] b5686da Description read[DESCRIPTION-READ] 28b49e98959ebde46cb627fffac4cb4512a09fd96a773da02604f0119eae1b72 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) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. This is a fix for a defect that #39974 reports and a new test reproduces on base. It changes one branch, and only for the default brief. A loop with an owner-written brief still fires. What this change shipsInventory (4 items) — 4 justifiedIntent: stop granting the
[FIRST-PRINCIPLES-REVIEWED] b5686da Description read[DESCRIPTION-READ] 995f040e701e69d3f8cbcf9223e46d946715a96d2b47d998477a0ccd499b53bd That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 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: |
Code change approver recommendation: A person should decideWhy: the decider estimates a 10% chance that this change introduces a defect, within the 12% limit for approving on its own, but it is held at tier pending: being reviewed. Narrow fix: when a loop runs under the default brief and its message names nothing the judge can read, _judge_tick_is_quiet now returns None instead of False. I traced both callers. Probe-backed loops (gate.py:1294) take the same judge-less path they get with the scope off, with the blocker override and quiet floor intact, so an idle conductor patrol drops back to the probe's floor turn. Loops with no probe (gate.py:778) still fall through to firing every tick. Owner-written briefs still fire, and that is tested. The new behaviour matches default_spec's own docstring and the scope-off behaviour. The new test reproduces the bug on main. No state is written on the new path, and no trust boundary moves. Tier: pending: being reviewed. An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
This review checked head b5686da. Under the default brief, _judge_tick_is_quiet now returns None for a loop with no readable target. Owner-written briefs still return False. In gate.py, the no-probe caller still fires as before. The after-probe caller keeps the probe's quiet answer, its counters and the quiet floor, which is what the tick does with the scope off. No evidence is collected and no state is staged before that early return. A run against the head tree passed the new tests. With main's judge_tick.py the default-brief test fails with assert False is None. If the brief-kind check is removed, the owner-brief tests fail.
Done well: the default-brief test first asserts that PATROL_MESSAGE names no target, and it swaps in an evidence collector that raises if called. "No judge applies" therefore means nothing was read, not only that the return value is None.
Optional:
- Add a
## Real-machine verificationsection. A before/after run of the new test on your own computer is enough for this decision function. - The
default_spec()docstring in src/kiro_crew/autonudge_judge.py still says a no-target loop "fires as it does today". Rewording it to match the new None return would help the next reader. - The "Gated loops only" bullet in the Wake judge section of docs/system-specs/modules/learn-cron-dashboard.md could list this case as one more bypass where no judge runs.
Fixes #39974
Problem / Motivation
Goal: Granting the
nudge_evidencescope no longer turns every quiet tick of a conductor's patrol into a turn.The gateway arms a conductor's patrol as a gated
work-ledgerloop with the stockPATROL_MESSAGE, which names no session and no pull request. Once the scope is granted, a gated loop with no criteria of its own is judged under the default brief._judge_tick_is_quiet(src/kiro_crew/autonudge_service/judge_tick.py) then finds no target in the message and returnsFalse, so the quiet answer the typed probe already reached is replaced by a fire. With the scope off the same tick returnsNoneand stays quiet.Why it matters
At the 300 s interval an idle conductor goes from about one turn an hour (the probe's floor) to twelve, each on the conductor's own model. A host that runs conductors has to leave the scope off, which also gives up default-brief screening for the loops that could use it.
Not a goal
test_no_targets_fires_rather_than_suppressingpins.What changed
src/kiro_crew/autonudge_service/judge_tick.py: when no target can be read and the loop is under the default brief, returnNone("no judge applies") instead ofFalse. Both callers inautonudge_service/gate.pyalready treatNoneas the scope-off path: after a probe, the judge-less quiet with its counters and floor; with no probe, the existing fire. The docstring lists the newNonecase.src/kiro_crew/autonudge_service/gate.py: the_judge_reads_only_the_watched_prdocstring now says what a no-target loop's judge does under each brief kind. No code change.src/kiro_crew/docs/monitor-loops.md: one sentence saying a loop that names no session or pull request runs under the scope as it does without it.Intent check: the no-target
return Falsecame in with #12787, before the default brief existed, and was kept when #12787 added "screen every gated loop, under a default brief". That commit's stated goal is to save turns on loops armed with no brief. A loop with no target cannot be screened, so leaving it as it is with the scope off follows that goal.Tests
test/test_autonudge_wake_judge_tick.py::TestTheDefaultBrief:test_a_default_brief_with_no_readable_target_leaves_the_probe_s_answer: a gated loop with no brief whose message isPATROL_MESSAGEreturnsNone, collects no evidence and asks no judge. It fails onorigin/mainwithassert False is Noneand passes with the fix.test_an_owner_brief_with_no_readable_target_still_fires: the same message under awake_whenbrief still returnsFalse.PYTHONPATH=src:test pytest -n 8over everytest/*autonudge*,*conductor*,*patrol*,*nudge_wake*and*wake_judge*file, plus the two doc tests below: 6350 passed.GITHUB_BASE_REF=main FLAKE_RATCHET_BASE=<origin/main> pytest -n 8 test/test_*ratchet*.py: 404 passed.monitor-loops.md:test_runtime_docs_monitor_skills_facts.pyandtest_runtime_budget_wording.py(in the run above), andtest_feature_videos*.pyandtest_recommendation_metrics.pyon the same diff: passed.black --check,flake8on the changed Python files, andmypyonjudge_tick.py: clean.Proof: PROVEN test_a_default_brief_with_no_readable_target_leaves_the_probe_s_answer (head b5686da)
Sibling sweep
Swept:
grep -rn "parse_targets(" src/kiro_crew, every reader of a judge spec's targetsSibling:
src/kiro_crew/autonudge_service/judge_tick.py-- changed hereSibling:
src/kiro_crew/autonudge_service/gate.py(_judge_reads_only_the_watched_pr) -- not affected -- it answersFalsefor a no-target loop, which sends the tick on to the judge; that judge now answersNoneunder the default brief, so the tick still goes quiet. Docstring updated.Sibling:
src/kiro_crew/slack/gateway_runtime/nudge_wiring.py(evidence collector) -- not affected -- it runs only after the judge found targetsSibling:
src/kiro_crew/autonudge_judge.py(pr_targets_of) -- not affected -- it reads the spec's own list for arming, not the tickPattern harvest
Not generalizable: this is the only place the wake judge decides what a loop it cannot read does; the other "no judge applies" exits (ungated,
judge: false, scope off, no lane) already returnNone