Repository navigation
feat(autonudge): screen nudge ticks with a typed wake judge - #12787
Conversation
First Principles Review (Fable 5) — 🟡 CONCERNSPremise-level review of First-Principles-Verdict: CONCERNS Default-brief screening ships one answer to a question its own RFC still records as unresolved (Q4: which switch authorizes a briefless loop on each lane). Not justified as shipped
What this change shipsInventory (10 items) — 9 justifiedIntent: stop each gated auto-nudge tick from spending a full main-session turn when a cheap typed judge can read the new evidence and say nothing needs the owner — an ADDITION, covered by
[FIRST-PRINCIPLES-REVIEWED] 34483d0 |
GPT 5.6 Review — ✅ no blocking findings (all downgraded on adjudication)GPT 5.6 flagged blocking issues on This comment is updated in place on each push. Review detailsBLOCKING -- src/kiro_crew/autonudge.py:5396 -- Judge state is published before persistence succeeds (origin: validation)
Adjudication (Opus 5) — is blocking on each finding proportionate?LOW — divergence is bounded and resolves toward spending a turn, never suppressing one; the failure is logged at [ADJUDICATION] 34483d0 total=1 uphold=0 downgrade=1 False positive or not applicable? A repository writer can comment: |
Design Review (Fable 5) — 🟡 CONCERNSDesign-level review of Design-Verdict: CONCERNS A judge brief naming pull-request criteria is armed, stored, and shown active while no gated tick can ever produce the facts it would evaluate. WatchThe description's final section states the canonical PR observation "has exactly ONE writer" that "a gated loop never reaches," so Suggestions
[DESIGN-REVIEWED] 34483d0 |
Opus 5 Review — ✅ no blocking findingsReviewed Review detailsNo findings. FINDING — src/kiro_crew/autonudge_judge.py:485 — a session target whose page comes back full at [OPUS-REVIEWED] 34483d0 Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
e2a68c6 to
220ce5d
Compare
220ce5d to
4645823
Compare
4645823 to
8fe26e7
Compare
UX Review (Fable 5) — 🟡 CONCERNSUX-level review of UX-Verdict: CONCERNS One feature answers to three names — "Jev" on the consent switch, "Judge:" in the popover, "Wake judge" in the transcript — and the blind reader could not connect them. Watch
Suggestions
[UX-REVIEWED] 34483d0 |
8fe26e7 to
691096d
Compare
5313399 to
c16cfdc
Compare
GPT 5.6 Review —
|
1 similar comment
GPT 5.6 Review —
|
GPT 5.6 Review —
|
GPT 5.6 Review — 🔴 changes requested (blocking)GPT 5.6 found at least one blocking issue that must be resolved before merging This comment is updated in place on each push. BLOCKING -- src/kiro_crew/dashboard/channel_slots.py:1543 -- Folder backfill can recreate a deleted conversation BLOCKING -- src/kiro_crew/messaging/auto_title.py:296 -- A stale title can overwrite a replacement conversation BLOCKING -- src/kiro_crew/telegram/transport_dispatch.py:3734 -- A fast SKIP permanently freezes the fallback title [BLOCK-MERGE] ee1df06 |
GPT 5.6 Review — 🔴 changes requested (blocking)GPT 5.6 found at least one blocking issue that must be resolved before merging This comment is updated in place on each push. BLOCKING -- src/kiro_crew/slack/gateway.py:8042 -- Judge cursors advance before the tick state commits |
GPT 5.6 Review — 🔴 changes requested (blocking)GPT 5.6 found at least one blocking issue that must be resolved before merging This comment is updated in place on each push. BLOCKING -- src/kiro_crew/autonudge_judge.py:118 -- Target and cursor stores use divergent bounds BLOCKING -- src/kiro_crew/slack/gateway.py:8042 -- Judge state is published before durable commit (origin: validation) FINDING -- src/kiro_crew/decisions/consent.py:29 -- [BLOCK-MERGE] cf0dc90 |
GPT 5.6 Review —
|
1 similar comment
GPT 5.6 Review —
|
Rendered-state disposition for the Design and UX lanesEvery new user-visible state in this revision, written out, with the ones that have no Covered by the attached image: Settings -> Developer -> Decisions, showing the No capture, popover judge row (
Segments are separated by a middle dot. No capture, transcript notice row: one line per verdict, reading No capture, and correctly so, the two bypasses: a Why no capture exists: a capture needs a pod serving both this revision's backend A reviewer should treat every row above as unillustrated rather than approved. |
Disposition of the advisory CONCERNS on
|
Dispositions for the findings on
|
An auto-nudge loop fires a full model turn every interval. For a pull request named by URL the typed probe already turns an unchanged tick into a free re-arm; for everything else -- a conductor patrolling workers, a babysitter reading review prose, a loop watching a log -- it cannot, because the evidence that justifies staying quiet is prose. The `nudge.wake` decision point reads what the loop's targets produced since the last tick and answers QUIET or fire. A watched session contributes its new assistant rows through `session_control.read_messages`, authorized with `authorize_target` first, so a target the owner could not read by hand is dropped and counted rather than fetched. A watched pull request contributes `render_pr_summary` over the twelve canonical keys the probe already published, plus the comment-body fingerprint when one exists -- never body text. Ordering: a gated monitor probe observes FIRST and a typed verdict wins outright, so a merged or closed pull request still deactivates a judged loop. The judge is consulted at exactly one point, the probe-quiet return. The judge never ends a loop. `finished` and `broken` wake with the verdict attached, because a prose-minted terminal would let one hostile comment buy permanent silence. Consecutive QUIET verdicts are floored by `decisions.nudge_wake.quiet_streak_floor`, clamped on read since config.json is agent-writable, so a judge wrong about a subject costs a late turn, not silence. A brief is credential-scrubbed at every entrance -- arm, update and decode. Bounding shape is not scrubbing a value: an allowlist with a length limit keeps a criterion naming a bearer token whole and merely shorter. Scrub precedes clip, because a redaction marker can be longer than the secret it replaces. The Jev lane needs the Decisions consent switch plus the `nudge_evidence` scope; with the scope off a stored brief is ignored and the loop runs as a plain timer. The tick resolves lane and authorization through one `is_enabled` call rather than a second rule of its own. Feature preview, default off. Design: docs/request-for-change/rfc-wake-judge.md
…none is given
A brief is no longer the thing that arms the judge. Once `nudge_evidence` is
granted, every GATED loop is screened on every tick; a loop naming no criteria of
its own runs under `autonudge_judge.default_spec`, whose wake sentence asks
whether the subject needs its owner and whose quiet sentence is "nothing new for
the owner since the last tick". The loop instruction is already the tick context,
so that default reads the loop own exit condition without restating it.
Requiring a brief per loop made the saving opt-in, and the loops that need it
most are armed by agents mid-task with no reason to spend the argument.
An explicit brief overrides the default. A brief naming only `targets` keeps them
and takes the default sentences, which is why the branch keys on the CRITERIA
being absent rather than on the brief being empty. The default is never written
back, so the stored field stays a record of what the owner asked for, and the
mid-tick replacement guard now compares a re-read against what was STORED: the
merged form differs on every default-brief tick, so comparing it would report a
replacement nobody made and discard the verdict.
Two bypasses, and they mean different things. `gate=False` is never screened,
because such a loop acts WHILE its subject is quiet and suppressing that removes
the work rather than the waste. `judge: false` is an owner who wants observation
gating and no judge; it normalises to a reserved marker the arming validator
refuses from a caller, so the boolean is its only spelling. An empty object is
neither -- it drops the owner criteria and the default applies.
The transcript notice names which brief a verdict was reached under, because a
quiet under the shipped default is not evidence that the owner sentence works.
Also in this commit, from review: two dead judge constants removed
(`_bounded_judge_spec` and `_bounded_judge_verdict` each spell their allowlist
inline, which is why neither had a reader), the RFC collector section corrected
to state that comment body text stays out of the evidence, and two pieces of
unrelated churn dropped from the diff.
Two review findings on this work are folded in here rather than left to a third
commit, because PR Hygiene allows two.
`pr_observation_is_about` decides whether a loop's single observation is about the
target the collector asks for. When the two strings differed it inferred BOTH
sides and compared identities. `infer_monitor` stores the canonical subject
(`owner/name#123`) with the inferred kind, and that shorthand carries no host by
design, so inference declines it: the watched side inferred to nothing, the
comparison could not succeed, the target was dropped and the tick answered
FALLBACK. Every gated loop whose subject is a pull request named in its own
instruction therefore paid a full turn on every interval -- the waste this point
exists to remove -- and it failed silently, because firing is the safe direction.
Both stored shapes now work: `monitor_watch` keeps the caller's canonical URL,
covered by the existing string and identity comparisons, and the shorthand is
covered by a third comparison of the inferred kind and subject against the pair
the monitor is bound to. That one needs no host of its own, because the inference
pins one host and refuses any other. The tests hand-wrote the watched side as a
URL and the kind as the wire name, so they ran on two values neither producer
emits and passed on the exact-string shortcut; the new class reads both fields
from a real `MonitorState` and fails by name when the third comparison is removed.
The feature map's Developer row still described `nudge.wake` as registered and
fired by nothing, contradicting the Monitor loops row in the same file. It now
states that the point fires and what arms it, and carries the `nudge_evidence`
scope it had omitted -- its own paragraph on the terms the row uses for its
sibling scopes, a place in the consent endpoint's scope list, and the point's
module beside the others in the backend column.
Rendered evidence for the transcript notice row is added at
`temp-screenshots/judge-notice-row.png`, closing the UX lane's remaining evidence
gap. A judged verdict is written as an ordinary `notice` row and drawn by the
existing `NoticeCard`, so the frame mirrors that component's DOM and its four lines
are the verbatim return of `notice_line` -- quiet under the shipped default brief,
quiet under the owner's own brief, a wake, and a fallback with no answers. The
harness reads the computed style back before shooting and reports the `--muted` and
`--card` tokens with a 13px/20px inner row, so the frame is evidence of this
revision's built stylesheet rather than of the harness.
An unwritten canonical pull-request observation reads as an unread target rather
than as a calm subject. The field has one writer, apply_monitor_probe on the
structured controller's path, and a judged loop is gated, observing through
irq.poll whose verdict carries no canonical facts -- so the collector saw {} for
every loop the judge screens. Handed on as a dict that was indistinguishable
from a complete reading with nothing to report, and the resulting no-evidence
no-drop shape is the one a QUIET verdict is built on, so an owner's pull-request
criterion bought silence up to the streak floor. pr_observation_has_facts is the
one named rule and both the gateway reader and collect_evidence's drop
accounting call it; the reader must answer before it stamps observed_at onto its
copy, which a plain emptiness test in the collector alone would pass through.
The feature map states what the collector can do instead of claiming a producer
it has none for, and the review captures move to PR attachments, which is the
route .gitignore records for review evidence.
A factless pull-request reading is an unread target only when no typed probe
covered the subject on this tick. On the gated path the judge is asked only after
the probe's own verdict came back quiet, so that subject WAS read and counting it
unread would fire a turn the probe had already settled, every interval, for the
life of the watch. pr_target_is_unread carries the rule and the reader passes it
whether a probe covers the subject; the collector's drop accounting trusts the
reader's None, because the monitor and the probe's schedule are in the reader's
reach and not the collector's.
judge_quiet_streak leaves the frontend, where it was parsed, typed and carried
with no surface rendering it. The backend field is what the quiet-streak floor
counts and stays.
The feature map's pull-request sentence leads with the absence: a watched pull
request contributes nothing on any loop this judge screens, and the reader's
renderer is described as what it produces once a gated tick publishes a canonical
observation. The companion sentence about the owner's criterion is conditional on
the same producer, so no clause in the row asserts a pull-request evaluation that
cannot happen.
The update path's comment on an empty judge object says what the code does: {}
clears the owner's own criteria and a gated loop then runs under the shipped
default, while judge: false is the bypass and normalises to a reserved marker
rather than to this shape. validation.py and autonudge.py already state it that
way, and the PR body already claims this comment does, so the three now agree.
Dispositions for the advisory verdicts on
|
bolichen97
left a comment
There was a problem hiding this comment.
Holding this one, and I have taken auto-merge back off so an approval cannot land it while the defect stands. This is not about the GPT BLOCKING — that one is genuinely over-stated, and the Opus downgrade of it is correct: a failed _persist_judge_state never suppresses an owed turn, it can at worst re-judge already-delivered evidence once after a restart.
It is about the advisory FINDING in the Opus 5 body that has no disposition on this head, which is real and does change behaviour:
collect_evidence reads one page of 12 durable rows per target. Every role counts as durable — tool, notice, system, error, user, assistant — so a single busy worker turn can produce more than a page of tool rows alone. When that page contains no assistant row, evidence comes back empty with dropped=0, so judge_tick calls no model and returns QUIET ("no new evidence"), the cursor advances 12, and the backlog is left for the next tick. On a busy worker the actionable reply can sit several pages behind and be judged QUIET every tick until quiet_streak_floor forces a wake — hours at a 45-minute interval.
That contradicts this PR's own stated invariant, the one collect_evidence's MAX_TARGETS handling exists for: an incomplete read must never look like a complete one.
Minimal fix, either one
src/kiro_crew/autonudge_judge.py:485-487— afterevidence.extend(session_evidence(...)), addif len(rows) >= MAX_ROWS_PER_TARGET: dropped += 1so a full page routes to FALLBACK and fires (this is the remedy Opus named); orsrc/kiro_crew/slack/gateway.py:7980-8001— have_read_sessionreadpayload.get('total')and signal not-read-to-end whentotal > next_since;collect_evidencealready counts a raise asdropped.
Plus a case in test/test_autonudge_wake_judge.py with a full page (12 tool rows, total=24) asserting the tick returns FALLBACK rather than QUIET.
Re-arm auto-merge once that is in or dispositioned with evidence.
buluoray
left a comment
There was a problem hiding this comment.
Approving at 34483d0.
Verified the fail-safe properties:
- Session reads go through
read_messages(caller_session_key=loop.slot_key), which runsauthorize_target. - A tick with an unreadable target returns FALLBACK (nudge_wake.py:484). Removing that check reddens 4 tests.
- The quiet floor is clamped with
min(floor, _JUDGE_QUIET_STREAK_FLOOR_DEFAULT)(autonudge.py:5195). Removing the clamp reddens the clamp test. - Any judge exception fires the turn (autonudge.py:6220).
- PR-monitor terminal branches run before the judge.
- Jev egress requires the new
nudge_evidencescope. judge_cursorsare never serialized.
875 tests passed.
Non-blocking:
- No test pins the gateway collector's
caller_session_key. - The description's "with the scope off a stored brief is ignored" overstates the LLM lane, which still runs a custom brief.
- I didn't confirm the decisions-log write in
judge_tickstays off the event loop.
What is the problem?
An auto-nudge loop fires a full model turn on its owning session every interval.
For a pull request named by URL,
PrWatchProbealready turns an unchanged tickinto a free re-arm. For everything else it cannot: a conductor patrolling worker
transcripts, a babysitter reading bot comment bodies, a loop watching a log. The
probe reads typed facts, a check conclusion or a merge state, and the evidence
that would justify staying quiet in those loops is prose.
So every tick costs a turn on the main session whether or not the new evidence
needs one. Measured on this repository: a conductor watching three workers at 45
minutes spends about 48 turns over two days to act on roughly five events.
Why this matters to the user
Those turns are the expensive kind. Each one carries the owning session's whole
context, so the cost is the context rather than the model, and a cheaper tier
does not help. The waste is also invisible: a loop that woke, found nothing and
went back to sleep leaves nothing on screen to say so, which is why ten patrol
loops once died together on a gateway restart and nobody noticed for hours.
How our fix solves it
On each tick, wake a judge instead of the session: a fast typed decision that
reads the new evidence and answers whether the owner needs to act now. Only a yes
spends a turn.
src/kiro_crew/decisions/points/nudge_wake.pyis the point. It builds abounded state from the evidence, asks three questions -- does the owner need to
act, what is the outcome, how urgent -- and maps the answers to one verdict.
It is a pure adapter, so a test drives it with literals.
src/kiro_crew/autonudge_judge.pyis where the evidence comes from. A watchedsession contributes its new assistant rows. A watched pull request contributes
NOTHING on any loop this judge screens, because the canonical observation its
reader wants has one writer and that writer is on the structured path; the reader
and its renderer are wired and tested against that shape and produce one line by
render_pr_summaryonce a gated tick publishes one, from the twelve canonicalkeys such a record carries -- state,
draft, mergeability, review decision, blocking review, unresolved thread count,
per-bucket check tallies with the failed and pending lanes named, the two
completeness flags, the head revision -- plus the PR-level comment-body
fingerprint when one is present. Never comment body TEXT: the reader that sees
those bodies reduces each to a fixed width and retains none, so no producer for
body text exists and none is claimed. The rendering lives in this module because
this module is its only consumer, and the monitor's canonical object is pinned by
full-dict equality tests and hashed into the wake fingerprint, so a field added
there for one reader would change what every provider must emit. Every read
arrives as a callable, so this module imports no dashboard module and every
function is testable without a gateway.
AutoNudgeService._judge_tick_is_quietis consulted only where the typed probereports quiet, and returns
Nonewhen no judge applies, which is what leaves anUNGATED loop, an explicitly opted-out one, and every loop on a machine that has
not granted the scope behaving exactly as they do today. A gated loop is screened
whether or not its owner wrote a brief.
Four properties are worth naming, because each one closes a way this feature
could have gone wrong.
It cannot read what its owner could not. A session target is read through
session_control.read_messages, which authorizes withauthorize_targetbeforereturning a row: deny-by-default and SEL-audited. A target that refuses is
dropped and counted by the same code path that refuses it, so nothing here
re-implements an authorization rule.
It cannot end a loop.
finishedandbrokenwake at every confidence with theverdict attached to the fired turn; only a typed probe may terminate one. A
judge-minted terminal would let a single hostile comment buy permanent silence, so
the judge does not have one. A parametrised sweep over every outcome, both owner
options and eight probabilities asserts no answer can produce it.
An unread pull request is a DROPPED target, not a calm one. The PR reader answers
Nonefor a loop carrying no monitor -- which is every loop armed throughPOST /api/autonudge-- for a brief naming a pull request the loop does not watch,and before a monitor's first observation. That
Noneused to reachpr_evidence,which returns an empty list, so the tick held no evidence and no drop: the exact
shape the rule below reads as "every target was read and was calm". The collector
counts it as a drop before the call.
A verdict whose brief was replaced mid-tick is discarded. The reads and the decision
both happen outside the service lock, and an update that replaces the brief clears the
streak, the cursors and the verdict record because all three describe the brief that
is gone. A tick already in flight re-read the brief after its awaits and commits
nothing when it changed: it restores the empty cursor map that update installed and
fires, so the rows it consumed are judged by the next tick under the brief that now
applies.
The monitor path asks the judge BEFORE charging its quiet counters. A judge that
answers wake or fallback makes the tick a delivered one, so charging first booked it
as free -- overstating the saving the feature exists to report -- and walked a
delivering loop toward a forced floor tick it never earned.
An empty delta is calm only when the read succeeded. Three different things make a
tick's delta empty and only one of them is "nothing happened": a target the
collector could not read leaves the tick blind, and evidence the scrub or the budget
shed entirely leaves it holding something it may not send. Those two fire, because
"we could not look" must never read as "we looked and it was calm". Every target
read with nothing new on any of them answers QUIET, which is the common steady state
of a patrol and the case the feature exists for; it lands in the same streak the
floor bounds, so a subject that simply stays silent still buys a delivered turn at
the floor rather than silence. The point decides this on the collector's own count
of unread targets, which the tick forwards.
It cannot go quiet indefinitely. Consecutive QUIET verdicts are floored, and the
floor's default is the probe path's own
_MAX_QUIET_STREAKrather than a secondnumber.
decisions.nudge_wake.quiet_streak_flooroverrides it, clamped to a hardceiling on every read because
config.jsonis writable by an auto-approved agentshell; without that clamp an injected floor could keep a watch silent for good.
It cannot feed itself. A verdict writes one
noticerow on the loop's OWN session-- the session the loop is armed on and would have woken, not the sessions it
watches -- through
append_and_surface, the same durable no-turn surface a refusedarm uses, carrying probabilities and counts but never evidence text. Notice rows are
excluded from evidence structurally, because the session collector admits
assistant rows only.
The lane rule lives in ONE place, and it is the seam's: the tick screens with a
single
decisions.is_enabled(nudge.wake), which routes this point throughgate._judge_authorityand answers both which lane would serve and whether thatlane is armed. Nothing here re-derives it. That matters because a second resolver
can only differ from the first: one arming Jev on endpoint consent alone picks the
Jev lane on a machine that consented without granting the scope, the gate refuses
that lane, and the tick is skipped where the gate itself picks the lane that needs
neither. The rule it enforces:
llmtakes the model-providerlane and needs no keystone -- its destination is the provider the session already
uses and its data class is the owner's own sessions, it decides only quiet versus
fire, and it is fail-open, so it adds neither a destination nor a category to the
keystone's scopes, which are categories of Jev egress.
jevneeds the Decisionsswitch and the
nudge_evidencescope.autoresolves to Jev when Jev is ARMED --consent AND that scope -- and to the LLM lane otherwise. With the scope off a
stored brief is ignored and the loop runs as a plain timer, so granting the scope
later arms every loop already carrying one. A test asserts the service exposes no
lane resolver of its own, because the fault is a second rule existing at all and a
call-level test passes either way.
decisions.nudge_wakeis registered onDecisionsConfig, so both knobs aresettable and appear in Settings. The floor is stored as a sentinel
0meaninginherit rather than as a copy of the engine's number:
autonudgeimportsconfig.loaderat module scope, so the config module cannot import the constantback, and a copied literal would be a second thing to keep in step. The engine
resolves the sentinel and owns the ceiling.
Both arming surfaces carry a brief, and both validate it.
monitor_startandmonitor_updateare the tool path;POST /api/autonudgeis the dashboard'splain-HTTP path, and it accepts
judge, runs the samevalidate_judge_spec, andrefuses a bad one with a 400 naming the field. That validation belongs at the
surface rather than at
authorize_and_add_nudge, which takes the brief throughunchanged and documents why: a refusal has to name a field the owner can fix, and
only the surface they typed it at can do that. Silently dropping a brief would be
the one outcome that leaves a caller believing a judge is armed when none is.
judgeis also advertised in both monitor tools' model-facinginputSchema, as anobject with
wake_when,quiet_whenand an optionaltargetslist. Without thatthe field was unreachable: the handler read it and the applier stored it, so every
Python-level test passed, while no agent could send one -- QA found a real turn
arming a loop with
judge == {}and the criteria pasted intomessageas prose.The regression guard is asserted against the schema rather than against a call,
because a call-level test goes green while the field is invisible.
On the Decisions card,
nudge.wakeis registered in the point-name and disclosuremaps, so the row reads in plain words instead of rendering its internal identifier
to every visitor, and its
nudge_evidenceswitch draws from the row's ownneeds_scopewith a label, a description and a granted position all present. Thecard's egress note now counts four categories rather than three and names the new
one, because that note is what tells a reader what can leave the machine and a
stale count understates it.
What the loop projection may publish is settled per field.
judge_cursorsisdropped on EVERY projection, not just the structured-monitor filter: a read
position is bookkeeping no reader can act on, and it names each watched target.
That drop had to go in
_serialize, because_serializeisasdictand a plainloop never reaches the structured filter -- which is exactly how the cursors
reached those reads, by the field existing rather than by any decision.
judge_quiet_streakandjudge_last_verdictare published: they are theautomation's own accounting, the same class as
cycle_count, and the verdict istext-free by construction -- an outcome, an item COUNT and a timestamp -- so it
cannot carry a transcript line the judge read.
The monitor popover renders that, under the schedule line it modifies:
Judge: wake when <criterion> - last: quiet - 3 items - 12:30Z. The row is the OWNER'S ownsentence or nothing: a loop screened under the default brief gains no row, because
the default is never written onto the record and the row would otherwise report
shipped text back as though the owner had written it. Where a default-brief verdict
IS reported is the per-tick transcript notice, which names the brief it used. A judge that has not answered yet reads "no verdict yet" rather than quiet,
because those are different statements and reading one as the other would report a
tick skipped that never happened. The line carries no probability: the record holds
none, and the per-answer numbers live in the decisions log, which is where the RFC
puts threshold tuning. The reading is a pure function in
autoNudgeLoop.tsbesidenextCycle, for the same reason that one is -- each surface words it for its ownlayout -- and that is where its 12 tests live.
That line renders through the session's automation record rather than straight from
the REST row, so the judge is carried at both hops in between. A session slot holds an
AutomationRecord, and the popover rebuilds its own loop shape from it field byfield. Both of those name every field they carry, so a judge published by the
projection and declared on the popover's loop type still reaches the owner only by
being named in the record and in the adapter as well; a value missing at either hop
reads on screen as a loop armed with no judge, which is the honest reading for most
loops and correctly draws nothing. The normalizer coerces the brief and the verdict
through the same fail-inert helpers as every sibling field, so a malformed judge also
reads as no judge instead of throwing inside the render of a loop that is otherwise
fine.
What tests we did
test/test_autonudge_wake_judge.py, 112 tests, run with-n0and a stubbedoracle at
decisions.decide, so no provider key is spent and the real statebuilder, mapping and tick all execute.
out-of-domain outcome all reach FALLBACK; low confidence wakes; both action
outcomes wake even when the judge said quiet; a sweep asserts no outcome outside
the quiet allowlist can produce silence at any probability; and a second sweep
asserts no answer at all can produce TERMINAL.
finishedandbrokenwake at every confidence with theoutcome named in the body, a repeated
finishedkeeps waking rather than beingsuppressed, and the loop stays armed.
per-item and instruction clips hold, the previous verdict is carried, and an
item carrying a credential is dropped by the seam's own scrub.
target dropped with its read cursor held rather than advanced, a cursor advanced
only on a read that returned, target shapes screened, and ISO-8601 row
timestamps parsed into ages -- verified against a live history row, because a
numbers-only parser read every session row as age zero and made the
drop-at-cap order arbitrary.
judge: false, no provider lane and amissing scope each leave the tick untouched with the brief still stored, and in
each case the evidence reader is a function that raises if called, so nothing is
read. A gated loop with no criteria of its own is judged under the default, which
is asserted by the criteria the judge was ASKED under rather than by the outcome. QUIET spends no turn; WAKE
and a refused provider each spend one; the streak floor delivers and resets; a
collector failure spends a turn.
Noneobservation is a drop and contributes noevidence, with a read observation as the control so the drop is not unconditional.
uncredited and the cursors empty and fires, with an unchanged brief as the control.
neither the free-tick counter nor the streak.
reports zero items with no answers; one unread target answers FALLBACK; evidence
the scrub shed answers FALLBACK; each is told apart by its verdict body, not only
its outcome. Through the service: a calm read spends no turn and counts toward the
floor, an unread target fires and resets the streak, and a subject that stays calm
still fires at the floor. The provider returns
Nonein those three, which is theshape that would FALL BACK if the tick reached it, so a QUIET there can only have
come from the delta. One source-level test pins that the tick forwards the
collector's count, since a caller that kept it would make a blind tick read as calm.
back as evidence.
cursors, since those describe the old brief), clearing, an unrelated update, and
a store reload; a corrupted store row normalises to the inert shape. A stored
brief is also bounded on load -- 50 targets reduce to 8, an oversized target and
criterion are clipped, unknown keys and bad cursor values are dropped.
validate_judge_specaccepts and de-duplicates, treats absent and emptyas legal, and refuses nine malformed shapes including an unknown key.
an invalid brief is a 400 naming the field with nothing armed, a non-object brief
is a 400 rather than a traceback, and a body with no brief arms a loop with none
-- the last one a negative control, so the route cannot invent an empty judge for
every loop the goal popover arms.
judgewith all three fieldsdescribed, a sent brief reaches the directive payload, a malformed one is refused
naming the field with no directive emitted,
falsenormalises to the reservedopt-out marker while
trueis refused and a hand-spelled marker is an unknownkey, an empty object survives as "no criteria of my own", and a call without one
emits no
judgekey.outcome and an item count and no evidence text, the two readings the popover needs
do survive, and no judge field carries a nested sequence -- a shape check, because
a verdict that later carried its evidence for context would pass a substring test
against this test's own literal while publishing every line it read.
GET /api/autonudgerow in the wire'sown spelling goes through the real normalizer into the session popover, and the
judge line is asserted on screen carrying its criterion and its verdict -- then in
the no-verdict state, then absent for a cleared brief, then absent rather than
throwing for a malformed one. Mounted from the wire because the chain holds three
shapes that each name their own fields, so a test handing the popover a loop object
agrees with the reader about every name and passes while a middle hop carries none
of them. Verified discriminating by dropping the judge at each hop in turn, which
fails exactly the two lines-on-screen tests.
nudge_evidenceswitch draws on thenudge.wakepanel and reads its granted position, the row is named in plain wordsrather than as
nudge.wake, and the switch is withheld entirely while Decisionsconsent is off.
_MAX_QUIET_STREAK, an over-large floorclamped by the engine, lane normalisation in seven shapes, floor coercion in six
(negative and malformed both read as inherit, never as unbounded), a non-object
section in five shapes, and the sibling
decisionskeys still parsing.Also green locally: 114 frontend tests over the Decisions card and its preview
projection with
tscclean, 89 config-ratchet tests including the regeneratedconfig-baseline.json,mypyover 1687 files, and the fast static gates relevantto this diff --
check_feature_map,docs_lint,check_brand_name,check_comment_history,check_changelog_history,check_black_formattingandcheck_sync_io_in_async. The backend surface suite is left to CI.Writing these found three real defects in earlier revisions of this branch. The
tick called
gate.is_enableddirectly and that function does a synchronouskeystone file read, on what is the gateway's event loop; both keystone reads now
go through
asyncio.to_thread. A judge brief with criteria but no explicittargetswatched nothing while looking armed, because target inference readpull-request URLs out of the loop message but not
chat-*keys. And arepeated-terminal branch zeroed the quiet streak and then incremented it, so the
floor sat at 1 forever and could never fire -- a judge wrong about
finishedwould have silenced the loop permanently, which is the one thing the floor exists
to prevent. That branch is gone entirely now, because the no-terminal rule
removed the state it guarded.
Every new UI string is translated in all 12 catalogs rather than left as English
passthrough. The repo's own gate settles that: a value NEW or EDITED on a branch and
still reading as English is "not inherited debt and there is no ceiling to raise".
The per-language style gates then had their own say -- French wants U+202F before
double punctuation, Bengali addresses the reader as informal, Hindi forbids the
formal pronoun, and Chinese allows at most two stacked possessives -- so those are
honoured per language rather than worked around.
decisions_egressis edited, not replaced. Its category count moved from three tofour, so each locale keeps its existing translation with only the count word changed
and the fourth category appended in that language. Replacing the paragraph with
English would have told ten languages' readers less about what leaves their machine
than the English reader is told, which is the fault this note exists to prevent.
The translations chunk's budget rises from 905 to 951 KB, the measured 905.6 KB plus
the 5% the entry's own note documents as its convention. The growth is 7 keys across
13 catalogs, one of them a consent disclosure that must exist in every language and
cannot lose a fact to fit. No dependency is added, and no lazy boundary can move a
catalog string out of that chunk.
Rendered surfaces
Captured from a pod at 1280x800 with the feature preview on and the scope granted.
This frame is the CONSENT surface: the point's row and description, the
nudge_evidenceswitch an owner has to turn on for the Jev lane, and the egress notewhose category count this change raises to four. Those are the strings a reader has to
weigh before granting anything, so they are the ones worth a frame first.
The popover's own judge line is a second surface and is not in this frame. It renders
Judge: wake when <criterion>, and beneath it eitherno verdict yetor a verdict rowcarrying the outcome word, the screened item count and the time, separated the way the
line above it separates its own parts. It needs a loop armed with a brief and then
actually judged before a verdict exists to show, which is why it needs its own capture.
Its strings and their pluralization are covered by tests, and a reviewer reading this
revision should treat the popover line as unillustrated rather than approved.
Any other suggestions on the work
Four things a reviewer may want to weigh.
urgencyis asked and recorded but changes no verdict. The design specifies allthree questions and says the thresholds are to be tuned from the logged answers,
so it is calibration input; a rule consuming it before there is a curve to read
would be a guess wearing a constant's name. Worth revisiting once the log has a
fortnight of data.
A
needs_owneranswer ofwakebelow the 0.5 bar maps to QUIET, because thethreshold is applied literally. It is unreachable from a conforming two-option
provider, where the chosen option is the argmax and so carries at least half the
mass; it exists only to bound a provider that returns a non-argmax choice. Left
as specified rather than quietly widened.
Filling the provider's per-option
criteriamap properly is a genuine improvementover carrying both sentences in the prompt, and it is a separate change to the
shared request builder rather than part of this one.
A
judgebrief on a loop that ALSO watches a pull request currently takesprecedence over the typed probe for that tick, so
monitor.last_observationis notrefreshed on a tick the judge answered. Reviewers flagged this and it is real. The
consequence was the one that mattered: a merged or closed pull request never
deactivated such a loop, because the judge emits no terminal of its own and the typed
probe that would have was skipped. FIXED HERE, not deferred to a follow-up. The typed
probe now observes first on any monitor-backed loop and a typed verdict wins outright;
the judge screens exactly one tick, the one the probe looked at and found nothing in.
No typed signal can be suppressed there, because every outcome that means something --
terminal, wake, fallback, an interrupted poll, a drifted target -- has already returned
by that line. What the judge still adds on such a loop is the evidence the probe cannot
read, a review left in prose. Four tests pin it: a merged pull request deactivates a
JUDGED loop, an actionable observation fires without asking the judge, a quiet
observation is the one tick the judge screens, and a quiet tick with no judge keeps the
probe's own verdict.
One further finding was raised against the quiet path and adjudicated DOWNGRADE
(disproportionate-remedy), so it is deliberately not changed here. The reasoning is
worth restating because it is the reason for inaction: the quiet branch schedules its
write through
_persist_soon, the detached pattern used at roughly fifteen call sites,whose own docstring pins the accepted degradation -- a lost write costs a fresh
countdown after restart, never a premature or dropped fire. The streak floor is a hard
backstop, so a reloaded streak postpones the floor by one quiet tick and then
re-accrues. Installing a blocking persist with rollback on this one path would
contradict the surrounding pattern to buy a one-tick, self-correcting delay.
Still in flight, and named here rather than left for a reader to discover. The
work-ledgerandselfcollectors are not in. Both need a design answer rather thanmore code. A
work-ledgercollector needs an evidence kind the point does notdeclare, and the declared set is deliberately closed. A
selfcollector -- a loopreading its own session -- introduces a feedback path the other collectors do not
have, because a loop's own fired turn is an assistant row in its own slot, so every
wake would plant evidence the next tick reads. That is the same
silence-amplification hazard the no-terminal rule exists to close.
The pull-request half of the collector now has a producer, which is the one thing
it lacked.
pr_evidencepreviously readsummaryandcommentsoffMonitorState.last_observation, andcanonical_pull_request_factsemits neither:it carries twelve typed keys plus an optional
pr_comment_body_digest, and the onereader that sees PR-level comment bodies reduces each to a fixed-width fingerprint
by design. So a pull-request target yielded an empty list,
judge_tickansweredFALLBACK, and FALLBACK fires -- which made arming a judge on a pull-request watch
strictly worse than not arming one, because the probe had already answered quiet.
render_pr_summarycloses it by rendering those twelve keys into the one line ajudge reads. The rendering sits in the judge's own collector because that is its
only consumer: the canonical object's exact shape is pinned by full-dict equality
tests and hashed into the wake fingerprint, so a field added there to serve one
reader changes what every provider must emit, while a reading assembled from keys
the probe already published costs nothing and adds no egress class -- the
fingerprint is carried as a fingerprint, and no comment body text is read anywhere.
Comment-body screening is no longer claimed in the tool schema, the docs, this
description, or the point's own module header, and
KIND_PR_COMMENTis gone ratherthan left declared with no producer. What the judge adds over the probe on a pull
request is the owner's up-to-500-character criterion evaluated against typed state,
which is the thing a typed probe has no way to do. Two tests drive the renderer
from a real
canonical_pull_request_factsprojection rather than a hand-writtendict, which is the assertion this code lacked: a hand-written observation can agree
with its reader while the actual producer emits different keys, and that is exactly
how a collector reading absent fields passed every test it had. The design RFC
(
rfc-wake-judge.md) is already merged and still describes comment-body evidencein its collector section; that divergence is deliberate and belongs to a follow-up
rather than an edit to a merged design record from this PR.
Three findings on the previous revision were real and are fixed here, and one of
them reverses a call recorded above. A quiet verdict now AWAITS its durable write
and fires when the write does not land. The earlier revision scheduled that write
fire-and-forget on the reasoning that a lost write costs only a recounted quiet
streak; the adjudicator's later reading is the correct one, because suppressing a
turn is the irreversible direction and nothing afterwards says the turn was owed,
so the state a suppression rests on has to be on disk first. The read cursors, the
streak and the verdict record are all published in memory before that write, which
is exactly the shape the rule names. Every path on the judge tick now writes
durably; only the suppressing one changes its answer when the write fails.
The session read is bounded to what the collector retains.
read_messagesdefaults to twenty rows and reports
next_sincefrom the window it returned, whilesession_evidencekeeps only the last twelve -- so an unbounded page advanced thecursor across eight rows that were then discarded and never read again, which is
where an actionable line sits when a worker posted several since the last tick.
Passing
limit=MAX_ROWS_PER_TARGETmakes the page and the retention the samenumber, so a burst larger than twelve costs a later tick instead of losing its
oldest rows.
A pull-request reader now verifies its subject before answering. A loop holds ONE
monitor, so the reader returns that monitor's single observation whatever target it
is asked for, and the brief's
targetsare the owner's own strings: a brief naminga second pull request was answered with the watched subject's state, labelled with
the name it asked for. A judge could then rule quiet on facts about a different
pull request.
pr_observation_is_aboutaccepts an identical string, or both sidesput through the same inference
parse_targetsalready admits a target by, with thehost part of the identity since one slug on two servers is two pull requests. The
observation's own
targetandkindlabels are checked too when it carries them.Every doubtful case refuses, which drops the target, and a tick with no evidence
answers FALLBACK, which fires. Ten tests cover the matcher, including the
same-number-different-repository and same-slug-different-host cases.
A judge brief is credential-scrubbed at every entrance. The criterion is free text
somebody writes at arm time, and it lands in two places a secret must not reach: the
loop store on disk, and the loop serialization the dashboard reads. The brief already
passed a bound -- an allowlist of keys with a length limit per value -- and a bound is
not a scrub: it reads every value as opaque, so a criterion naming a bearer token was
kept whole and merely shorter.
scrubbed_judge_specputs the criterion strings and thetargetsthrough the same credential scrubber the loop'smessageuses, and it iscalled at all three entrances rather than once at the store, because a brief that
arrives on a tool call is published to the dashboard without ever passing the decode
path. The scrub runs BEFORE the clip: a redaction marker can be longer than the secret
it replaces, so clipping first would let a scrubbed value land over its own bound. A
clean forge URL and ordinary prose pass the scrubber unchanged, so no legitimate watch
can be broken by this; a target it does alter is one carrying the credential. Six tests
cover it, and the three that pin the criterion entrances fail when the scrub is replaced
by a passthrough.
Declined on this revision: a finding asked that the staged read cursors be persisted
with the verdict before being published in memory. Its adjudicator downgraded it as a
disproportionate remedy and that reasoning holds. The cursors serve only the judge's
own per-tick evidence; the transcript keeps the rows, each verdict is point-in-time and
a later tick re-judges on fresh rows, the quiet-streak floor forces a delivery so no
loop can be pinned quiet by it, and the event that cancels the tick is user input, which
fires a turn anyway. The remedy threads staged cursors through the closure and the tick
method as a new cross-module ordering contract, which reintroduces the re-read and
double-judge hazard the current ordering deliberately avoids. The residual is one
re-read of at most the retained window under a cancelled tick.
Findings addressed on the previous revision, with one declined. The evidence cap
lands AFTER the recency sort and counts what it sheds, because the collector's
input is target-grouped and chronological within each group, so a cap on the front
dropped the newest rows of the last target on exactly the busy ticks the point
exists for. The verdict count published to the notice and the verdict record is the
SCREENED count on every return path, including the FALLBACK ones, so neither
reports the pre-scrub input length. A read cursor refused as unaddressable is
cleared rather than held, so a rewound or trimmed transcript costs one tick instead
of blinding the judge to that target for as long as the loop is armed. A
pull-request row is aged from the monitor's
last_observed_at, which is a siblingfield rather than a key inside the observation, so the reader hands it over
explicitly -- without it every such row ages 0.0 and silently defeats the
drop-oldest-first bound. The popover maps each verdict outcome to a localized word
and pluralizes its item count through i18next's own categories per language, so no
owner reads an English identifier or
1 itemsinside an otherwise localized line,and it renders its time with the same formatter as the line above it, so two adjacent
times no longer read on different clocks. The two
droppedcounts -- unreadabletargets, and items the scrub shed -- have distinct names instead of one clobbering the
other in the calibration log. Declined: a review finding asked that the notice row be
written after the durable state rather than before. Its adjudicator downgraded it and
that reasoning holds -- the notice is emitted before the branch so it cannot be skipped
by an early return, the in-memory mutations never reach disk when the write fails, and
the residual is one visible contradictory transcript line under a rare I/O failure.
Rebased onto the merged #12776, which changes what this PR contains. That change
shipped the wake judge's LLM lane, so
decisions/impl_llm.pynow exists on the baseand owns
decisions.nudge_wake.provider,llm_model, the Decisions card'snudge.wakelabel and its judge provider/model selector,DECISIONS_NUDGE_WAKE_POINT,and the translations-chunk budget. Every duplicate of those is dropped here and the
base's kept; this PR keeps what the base does not have -- the point module
(
decisions/points/nudge_wake.py), the evidence collectors (autonudge_judge.py), thetick hook,
quiet_streak_floor, thenudge_evidenceconsent scope, the popover judgeline and its strings, and
validation.py's brief bounds. The premise-level review'sblocker was this key's absent lane, and its own "clears when" names
impl_llmexisting, so the rebase is what answers it rather than a deletion.
One of the base's own tests needed a narrow amendment, and it is not a weakening.
test_status_is_the_effective_answer_and_a_missing_scope_says_socompares the set ofpoints reporting
needs_scopeagainst the gate's scope table, and the judge's defaultautolane resolves to the small model when Jev is unarmed, so it is active rather thanheld back: including it would assert a status the handler does not report. That
subtraction describes the projection rather than exempting the point from it.
test_every_scoped_point_is_inert_on_a_keystone_recording_no_scopeasserts over EVERYscoped point with no exception. The judge reaches it by pinning the lane whose authority
is the scope: that point carries two, and the small-model one needs no scope, so under
the default
autoan unexempted assertion would be asserting the wrong question. Withjevpinned the point answers the question the sweep exists to ask -- a keystone thatrecorded no scope leaves it inert -- and the sweep stays universal, which is the only
form in which it is a ratchet. A review finding named the earlier exemption and it was
right to: an exemption in a table-driven sweep is invisible to the next point added.
The card's own fixture merges the two behaviours rather than picking one: the row
declares the
nudge_evidencescope this change registers, and the lane is derived theway the gate's resolver derives it, from Jev being ARMED -- consent plus that grant.
The egress note counts FOUR categories again. Merging the base's catalog reverted it to
three, which is the understatement the card's own count ratchet exists to catch: the
note tells a reader what leaves their machine, and this change adds a category to it.
Restored in the English source with each of the eleven translations keeping its own
wording.
The restyle-ratchet record this branch carried is gone from it. #13008 landed the
identical record on main, so the gate passes on main's own baseline: 347 restyle sites in
50 files against a baseline recording 347 in 50, every file matching. Rebasing onto that
main reported the commit as already applied and skipped it, which is the same fact from
git's side. Dropping it also means the fix reaches every frontend branch instead of this
one alone.
Two module constants leave
autonudge.py. A review finding named_JUDGE_SPEC_KEYSasunread; its sibling
_JUDGE_VERDICT_KEYShas the same single self-reference, so both go._bounded_judge_specand_bounded_judge_verdicteach spell their allowlist inline, whichis why neither constant had a reader. The numeric bounds beside them stay: each has a live
call site.
The design record specifies comment-body evidence that this point does not carry, and the
difference is deliberate.
docs/request-for-change/rfc-wake-judge.mdkeepspr_commentinthe closed
kindset and aprcollector promising "new review/issue comment bodies sincethe last tick", because it describes the full design. The shipped point registers
transcript_tailandpr_checksonly, andpr_evidencecarries the probe observationalone: each PR-level comment body is reduced to a fixed-width
pr_comment_body_digestandnone of the prose is retained, which is what the
nudge_evidencedisclosure promises theowner. Adding comment text would widen egress past the category this scope was reviewed
under, so it needs its own scope and disclosure first. That subset is recorded in the RFC's
own preamble as of #13082, so this PR edits no design record to state it.
decisions.nudge_wake.quiet_streak_floorstays, against a review finding that reads it asa knob with no named consumer and proposes deleting it. The RFC specifies it in section 5
-- the quiet streak "is compared against
decisions.nudge_wake.quiet_streak_floor(clamped, never off)", and "Owners watching public repositories should set a lower floor."
-- and its rollout section assigns the
decisions.nudge_wake.*keys to this PR. Theconsumer the finding calls missing is named there, so deleting the key would take the
change out of conformance with the design it implements. Cited by section rather than by
line, because #13082 reflowed the document.
pluralKeys.jsoncarries its two new entries and nothing else. A regeneration hadre-sorted the whole file, pulling about twenty entries that belong to other branches into
this diff; the registry is read as a
Set, so the ordering buys nothing. Thefr.jsonnesting_depthvalue is likewise back to the base's escaped spelling -- that line is notthis change's to re-encode.
The popover's judge line has a render test at the widest criterion the arming surface
admits (500 chars), which is the shape half of a review finding. No clamp is added: the
popover clamps nothing anywhere, so the row carries its siblings' type contract, and a
clamp on this row alone would be a visual change no reviewer has seen. A capture of the
line in its verdict and no-verdict states is the other half, and it is not in this PR.
A brief is not what arms the judge. Once
nudge_evidenceis granted every GATEDloop is screened on every tick, and one naming no criteria of its own runs under a
default brief: wake when "the subject needs its owner: a blocker, a question or
ruling addressed to it, a terminal state, or the loop message's own exit
condition", quiet when "nothing new for the owner since the last tick". The loop's
instruction was already the tick's context, so that default reads the loop's own
exit condition without restating it. Requiring a brief per loop made the saving
opt-in, and the loops that need it most are armed by agents mid-task with no reason
to spend the argument.
An explicit brief overrides the default, and one naming only
targetskeeps themwhile taking the default's sentences -- which is why the branch keys on the
CRITERIA being absent rather than on the brief being empty:
targetssays whichsubjects to watch and nothing about when to wake. The default is never written back
onto the loop, so the stored field stays a record of what the owner asked for, and
granting them a criterion later is still an empty-to-set change rather than an edit
of shipped text.
That last property is load-bearing rather than tidy. The mid-tick guard that
discards a verdict when the brief was REPLACED under it compares a re-read against
what was STORED, never against the spec the tick ran under: those differ on every
default-brief tick, so comparing the merged form would report a replacement nobody
made and throw away a good verdict every time.
Two bypasses, and they mean different things. A
gate=falseloop is neverscreened, because its duty is to act WHILE its subject is quiet -- a heartbeat, a
reviewer chase -- so suppressing a quiet tick would remove the work rather than the
waste.
judge: falseis an owner who wants observation gating and no judge; itnormalises to a reserved marker that is deliberately absent from the accepted key
set, so the boolean is the only spelling a caller has and
{"off": true}by hand isrefused as unknown. An empty object is neither of those: it drops the owner's own
criteria and the default applies, so both monitor tool descriptions were corrected
where they said an empty object removes the judge.
The transcript notice names which brief a verdict was reached under,
defaultorcustom, because a quiet reached under shipped text is not evidence that theowner's own sentence works and a wake under it is not their sentence misfiring.
Default screening asks a NARROWER authorization question than an armed brief does,
and the difference is the point of it.
is_enabledanswers "could any lane servethis tick", which the LLM lane satisfies on the provider key alone --
gate._judge_authoritydocumentsprovider = llmplus ajudgespec on the loopas that lane's whole authorization, so the owner's brief is HALF of it. A loop whose
owner armed nothing supplies no such half. So the default path calls
gate.judge_evidence_scope_grantedinstead: the endpoint consent read AND thispoint's own
nudge_evidencescope, composed from the same two primitives_judge_authorityuses rather than a second rule. With that scope off, a loopcarrying no brief is left exactly as an ungated timer, which is what makes "scope
off changes nothing" true rather than aspirational. An explicitly armed brief is
unaffected and still runs on either lane.
This revision edits NO design record, which is worth stating plainly because an
earlier revision did.
docs/request-for-change/rfc-wake-judge.mdis untouched bythis branch. Default screening is ratified there by #13082, merged
2026-09-23T22:54Z, which takes the document past draft and states the shape this PR
ships, including the untrusted-evidence clause, why
nudge_evidencestands in for abrief a loop never wrote, and where the judge sits relative to the typed probe. This
branch's own RFC prose was withdrawn in favour of that text, so the design record is
single-sourced and the open maintainer question earlier flagged here is closed.
A structured monitor now REFUSES a judge brief instead of dropping one. The schema
offers
judgeon everymonitor_update, so arming a structured monitor withmonitor_watchand then sending a brief is two ordinary steps -- and_structured_monitor_updateneither stored the field nor refused it, so the ownergot a success acknowledgement for a criterion that was never armed while every tick
kept firing on the typed probe alone. Nothing in the acknowledgement would have told
them.
judgejoinsbannerin that path's refusal set, which exists for this exactshape: a message-loop-only field that a structured monitor has nowhere to put. Two
source-level tests pin it, and removing
judgefrom the set fails the first of themby name.
One review finding is recorded as declined rather than fixed, on the adjudicator's
reasoning rather than mine. The judge notice and the in-memory cursors are published
before the durable write, so a QUIET verdict whose write fails emits a notice that
contradicts what was stored, and a cancellation mid-judging can leave an advanced
cursor live for one tick. The adjudicator confirmed every condition and then measured
the remedy:
_persist_lockedserializes the live loop, so staging and persistingatomically needs either a rollback snapshot of three fields plus a new cross-module
return contract for the injected collector, or shielding a multi-second model call
from the cancellation that exists precisely so a nudge never races a human turn. The
degradation it buys against is bounded and self-correcting -- no transcript rows are
lost, only the judge's read window skips them, a failed QUIET write fires anyway with
a warning, the quiet-streak floor forces delivery so nothing can be silenced
indefinitely, and a restart reloads the un-advanced persisted cursors.
One unread target now fires the tick whatever the readable ones produced, and the
earlier shape of that rule was wrong. The blind-tick check sat INSIDE the empty-delta
branch, so it was only consulted when no target had produced anything. A tick with
one refused target and one talkative one has a nonempty delta, never reached that
branch, and could answer a confident QUIET about the target that WAS read --
suppressing the turn the unread one might have needed, under exactly the condition
the feature map says fires. The check is hoisted above the delta, which is what the
rule always meant: FALLBACK is for a collector or provider failure, and a target the
collector could not read is one however much the others said. A test pins the
mixed case, and removing the hoisted guard fails it by name alongside the
empty-delta one.
A stale comment on the update path went with it: it said an empty object takes the
judge off a live loop, which is the pre-default meaning. It now says what the code
does --
{}clears the owner's own criteria and a gated loop then runs under thedefault, while
judge: falseis the opt-out.The target cap now counts what it omits.
collect_evidenceslices the target list atMAX_JUDGE_TARGETS, anddroppedstarted at zero, so a message naming one targetmore than the cap allows read as a COMPLETE reading: a confident quiet about the
targets that fit could suppress a turn the omitted one might have needed. That is the
same fault as an unreadable target, reached through a bound instead of a failure, so
it now seeds the drop count and the hoisted guard fires on it. A test pins it and
fails when the initialiser goes back to zero.
The judge notice is now published AFTER the write it describes, and the tick takes one
exit instead of four. The notice went out first so that no early return could skip it,
which is a real requirement and the reason the reorder needed the exits collapsed: the
verdict is rendered where it was, the four branches carry their answer in a variable,
and one publish at the bottom serves every path -- including the one that fires
BECAUSE the write failed, where the reader most needs to know why.
Two faults close with it. A notice emitted before the persist is a claim about state
that may never land. And the emit is an await, so a brief replaced during it was
committed against afterwards: the streak and the verdict record would belong to
criteria nobody armed. There is now a final look at the stored brief immediately
before anything is committed, so a brief revised at any point up to that line
discards the verdict and fires. Four tests pin the ordering on the quiet, wake and
failed-write paths and the discard on the replacement path; putting the publish back
above the commit fails three of them with the trail reversed.
Rendered states, and which ones have no capture
Written out rather than left to a reviewer's inference, because two review lanes ask
for frames this revision cannot produce. The attached image above is current and
covers the consent surface; every popover and transcript state below is described
from the shipped strings, and the ones with no frame say so.
COVERED by the attachment: Settings -> Developer -> Decisions, showing the
nudge.wakerow, thenudge_evidenceswitch, and the egress note counting fourcategories. That frame still matches this revision's card copy, with one difference
worth naming: the switch description no longer ends in a state sentence, so the frame
shows one trailing sentence the current build omits.
NOT COVERED, popover judge row (
data-testid="judge-line",AutoNudgePopover.tsx),six states:
Judge: wake when {criterion}Judge: stay quiet while {criterion}no verdict yetlast: {outcome} / {count} items / {time}last: {outcome} / {count} itemsjudge: falseThe separator between those segments is a middle dot, and
{outcome}is one ofquiet,waking,finished,could not judge,unknown. The row carries itssiblings'
text-muted text-[11px]contract with no clamp, so a criterion at thearming bound of 500 characters wraps rather than truncating; a test pins that it is
carried whole, which is the shape half of the question and not the rendered half.
NOT COVERED, transcript notice row: one line per verdict, reading
Wake judge / {outcome} ({default|custom} brief) / {question} {answer} {p} ... / {n} evidence item(s), again middle-dot separated. The(default brief)and(custom brief)variants are new in this revision and have never been captured.NOT COVERED, the two bypasses, neither of which draws anything: a
gate=falseloopand a
judge: falseloop are never screened, so they show no judge row and emit nonotice. Their absence of UI is the correct rendering and is asserted by tests rather
than shown.
WHY there is no capture: a capture needs a pod whose backend and bundle both carry
this revision. The pod that produced the attached frame booted hours earlier and its
served bundle does not contain this revision's popover code at all. A fresh pod was
provisioned and booted correctly at this head, but no token could be minted for it
from the agent sandbox -- the gateway requires unix-socket admission on
/api/token/localand no socket is exposed in its run directory, so the pod answers/api/healthand refuses every authenticated call. That is tracked as #12958. Thepod has since been released rather than left holding a port.
A reviewer should read every row above as UNILLUSTRATED rather than approved.
An owed judge wake now survives the fire not happening. The judge advances DURABLE
read cursors before it decides, so a verdict that says fire and a process that stops
before the fire leave the next tick reading nothing new: it answers quiet and
suppresses the very turn that was owed, until the streak floor several intervals
later.
judge_wake_pendingis set with the verdict's own write, so the flag and theadvanced cursors land together, and the next tick delivers the turn WITHOUT asking the
judge again -- asking would re-read the same emptiness and reach the same wrong
answer. It is cleared at the single point delivery is confirmed.
The flag lives on the loop rather than on
MonitorState, and that is the substancerather than a detail. The probe path already carries this doubt across a fire as
poll_in_flight, and a refused fire already re-owes its claim and grants afollowup_ticksbypass -- but every one of those sits behindmonitor is not None,and a judge-only loop (a conductor watching sibling sessions) has no monitor record at
all. So the loops the judge exists for were the exact loops none of it covered, and a
REFUSED fire lost the turn the same way a crash did. Keeping the flag on the loop
covers both, and leaving it set until delivery settles is what makes a refusal re-owe
rather than drop.
The new field is WITHHELD from a structured monitor's legacy REST row. That route's
key set is pinned in both directions -- withheld plus published must cover every loop
field -- precisely so a new field has to answer the entitlement question rather than
joining the route by existing.
judge_wake_pendingis a bare boolean naming nothing,so it could have been published; it is withheld for the reason
judge_quiet_streakis, that this route holds a structured monitor to the stricter line. A plain loop,
which is the one with a popover to render, still gets it from
_serialize.A lost clear costs one extra fire, which is the direction to be wrong in, and the
loader resolves a non-boolean value to "delivered" for the same reason: a corrupt row
in an agent-writable store must not make a loop fire forever without consulting its
judge. Five tests cover the set on wake and fallback, the absence on quiet, the owed
turn delivering with no evidence re-read, and the load default; removing the set fails
two of them.
Two faults share one cause: the judge's TARGETS come from
loop.message, while itscriteria come from the spec, so a message-only retarget changes what is being judged
without touching the spec at all.
Cursor retention is now bounded where it is written. The collector only ever adds a
key, so a retarget left the departed target's cursor in the map and
asdictpersistedit on every write. The load cap was not a bound on that: it keeps an arbitrary 16, so
it could discard the cursor of a target still being read, and a lost cursor replays
rows the judge already screened. Pruning to the targets each tick actually reads makes
the population exactly the current targets, so the two bounds that disagreed -- 16
cursors against 8 targets -- collapse into the smaller one and the cap never binds.
Both mid-tick fences now compare the message as well as the spec. They existed to
discard a verdict whose brief was replaced mid-tick, but comparing the spec alone let a
retarget through with the spec byte-identical, committing a QUIET verdict reached
against the previous target and suppressing the new target's due turn on a streak it
never earned. The test drives the real tick and retargets during the await; removing
the message half of either fence fails it.
Also corrected the
quiet_streak_floorhelp text, which promised that many skippedturns. The Nth consecutive QUIET tick fires regardless of its own verdict, so the
number yields one fewer skip than it read as. Baseline regenerated.
quiet_streak_flooris now downward-only, which is what the RFC always meant. Itssection 5 pins the knob as "clamped, never off" and tells owners watching public
repositories to "set a lower floor", but the engine clamped
at 50 against a shipped floor of 10, so it could be configured five times UPWARD --
37.5h of silence at a 45-minute interval against the RFC's 7.5h worst case. The threat
that makes this matter is the one the code's own docstring names:
config.jsonisagent-writable, so a raised floor silences a watch with no new code, only a number. No
user of the 11-to-50 range was named in the RFC, the help text or this description.
The shipped floor is now itself the ceiling, so a larger value is clamped back down to
it and the knob can only ever shorten the silence window.
_JUDGE_QUIET_STREAK_FLOOR_MAXis deleted rather than lowered, because a second constant invited the two to drift. The
help text said "a value above the engine's ceiling"; it now states the downward-only
rule, and the baseline is regenerated. Restoring the 50 fails the clamp test at
assert 50 == 10.Naming
targetsnow narrows the watch even when nothing in the list survives filtering.Previously an owner who named one target and mistyped it fell through to the
message-inference default and got the message's subjects instead -- a WIDER watch than
the one they asked for, reading transcript evidence from a session they never named. The
fallback's own comment said "nothing explicit", but something was: the list simply
emptied during filtering.
Answering no targets is the safe direction and is why this is a small change rather than
a risky one: a spec naming no usable target fires the tick rather than suppressing it, so
a dropped list costs a turn every interval and never silence. An absent
targetskey isstill distinct from an empty one and still infers from the message, which is the default
the design asks for. Reverting the condition fails two of the five new tests.
Rendered evidence: the popover judge row, all seven states
Attached rather than committed:
.gitignorerecords the repository's rule that review evidence is uploaded withgh pr edit --attachand never committed, and the design and UX lanes read attachments through.github/scripts/pr-attachment-evidence.shas well as the committed diff.The popover judge row in all seven states, rendered in Chromium against THIS revision's
built stylesheet. Pod-based capture stayed blocked (#12958 -- the gateway wants
unix-socket admission on
/api/token/localand the sandbox has no socket), so this is acomponent-level capture instead, which needs no pod and no token. The row's markup is the
judge-lineJSX fromAutoNudgePopover.tsx; the styles aredist/assets/src-NpXWYNsL.cssbuilt from this head; the column is the popover's 340px. The harness reads the computed
style back before shooting and it reports
font-size: 11pxandcolor: rgb(127,127,136),which are the bundle's
.text-[11px]and--muted: #7f7f88resolving -- so the frame isevidence of the real utilities, not of the harness's own CSS. That check earned its keep:
the first attempt linked the stylesheet by
file://, which silently did not load, and theprobe caught a 16px unstyled frame that would have looked like a render.
The capture found a real defect, now fixed. A criterion at the arming bound with no
space in it -- a URL, a sha, a pasted blob -- did not wrap. It ran off the popover
horizontally, because the row carried no break rule.
break-wordsis added, and theseventh frame shows a 500-character unbroken token wrapping inside the column. The
frontend test that covers this row already used
'w'.repeat(500), the exact input thatoverflows, but asserted only text and font size; it now pins the break rule too, and
removing the class fails it with
expected 'text-muted text-[11px]' to contain 'break-words'.Wrapping rather than clamping, deliberately: the row shows the whole criterion so an owner
can confirm what they armed, and a clamp would hide the tail of a brief they are trying to
read. The sixth frame shows 487 characters of ordinary prose wrapping to nine lines, which
is what an owner actually meets.
The quiet-streak floor now owes its turn too. That branch FIRES, so it needed the same
owed-wake marker the wake branch carries, and it was the one firing path the marker
missed. The loss there is the silent kind: the branch persists a streak reset, so a
refused delivery or a process that stops leaves the next tick re-judging against durable
cursors, finding nothing new, answering quiet, and pushing the forced turn out another
whole floor with nothing recording that one was due. The monitor path's re-owe and its
gate-free retry both require a monitor record, and a judge-only loop has none, so this
flag is the only thing covering that case. Removing the line fails the new test at "and
the turn it owes survives a refusal".
Read positions now move only with a verdict. The collector used to assign
loop.judge_cursorsas soon as it had read, which is before anything is judged, and thejudge await that follows is cancellable -- a user typing cancels exactly that task. So a
tick could consume rows for a verdict that never committed: the next tick read nothing
new, answered quiet, and the wake those rows had earned was gone until the streak floor,
with nothing recording it. No disk failure needed, which is why this one is reachable in
ordinary use.
The collector returns the advanced map as a third value instead of publishing it, and the
tick holds it until the single commit point, beside
judge_last_verdict. Every path thatleaves earlier -- a cancelled await, a brief replaced mid-tick, a retargeted message --
now leaves the stored cursors exactly as they were, which is right: a tick that reached no
verdict consumed nothing. Two tests, and publishing right after collection again fails the
cancelled-await one.
This was a callback contract change, so the nine collector stubs in the judge suite moved
to three values. The four session-reader stubs did NOT: their contract is still
(rows, next_cursor), and an earlier sweep that widened them by mistake made one test passfor the wrong reason -- the bad unpack counted the target as dropped, which was what that
test asserted -- so the readers are pinned back to two values deliberately.
Design:
docs/request-for-change/rfc-wake-judge.md(#12735). The LLM lane andimpl_llm.pyshipped in #12776, which is merged, so this PR now sits on top of it.Feature preview, default off.
Two findings on the rebased head, both real and both fixed
The feature map's Developer row contradicted its own Monitor loops row. The Monitor
loops row states the judge is active; the Developer row still read "A seventh point,
nudge.wake, is REGISTERED here but fired by nothing yet ... this build ships the lanes andthe two settings while no tick is gated". That sentence described the build before this one.
It now says the point FIRES on the tick and names what arms it, which differs by loop: a
loop whose owner wrote a brief is screened on the lane's own authority, while a gated loop
that wrote none is screened only once
nudge_evidenceis granted, so an install withneither still gates no tick.
Three more gaps in the same row, found by sweeping it rather than by fixing only the
sentence quoted:
nudge_evidenceappeared nowhere in it, so the row enumerated theconsent endpoint's scopes as
tool_args,compactionandmemory_textwhile this PR addsa fourth to the same keystone. It now carries that scope's own paragraph on the terms the
row already uses for its siblings -- what category it sends, its keystone key, its reader,
absent-reads-as-no, the map and the refusal -- plus its switch, and says why
compactiondoes not imply it: that yes was reviewed as a transcript of the session its owner was
present for, while this one carries a different session's tail and a comment body written
by a bot on a forge. The endpoint column names it, and the backend column names
decisions/points/nudge_wake.pywithautonudge_judge.pybeside the sibling points italready listed.
A judged pull-request watch armed from a loop message never received its evidence.
pr_observation_is_aboutdecided whether the loop's single observation is about the targetbeing asked for, and when the two strings differed it inferred BOTH sides and compared the
identities. But
infer_monitorstores the CANONICAL subject (owner/name#123) with theinferred kind (
gh-pr), and that shorthand carries no host by design, so inference declinesit. The watched side therefore inferred to nothing, the comparison could not succeed, the
target was dropped, the drop was counted, and the tick answered FALLBACK -- which fires. So
every gated loop whose subject is a pull request named in its own instruction paid a full
turn on every interval, which is exactly the waste the point exists to remove, and it failed
silently because firing is the safe direction.
Two stored shapes exist and both now work.
monitor_watchstores the caller's own canonicalURL, which the existing string and inferred-identity comparisons already cover;
infer_monitorstores the shorthand, which a third comparison covers by testing theinferred
kindandsubjectagainst the pair the monitor is bound to. That thirdcomparison needs no host of its own: the inference pins exactly one host and refuses any
other, so for a subject it admits at all, kind and subject are the whole identity.
The reason the tests did not catch it is worth recording, because it is the same failure
this description already notes for the observation dict. The existing class hand-wrote the
watched side as the full URL and the kind as
github_pull_request, so every case ran on twovalues neither producer emits and passed on the exact-string shortcut. The new class takes
both fields from a real
MonitorStatebuilt byinfer_monitor, asserts the premise thatthe stored subject is the shorthand and that inference declines it, and then drives the
check with the targets
parse_targetsactually yields for that message. Removing the thirdcomparison fails
test_the_target_the_message_yields_is_acceptedby name.Rendered evidence: the transcript notice row, both brief variants
Attached rather than committed:
.gitignorerecords the repository's rule that review evidence is uploaded withgh pr edit --attachand never committed, and the design and UX lanes read attachments through.github/scripts/pr-attachment-evidence.shas well as the committed diff.The UX lane's remaining evidence gap was the transcript notice row, in both the default-brief
and custom-brief variants. This frame closes it, by the same pod-free route as the popover
capture, so #12958 does not block it either.
The row is not a component this PR adds: a judged verdict is written with
append_and_surface(state, slot, "notice", text, "msg msg-info"), the same surface a refusedarm uses, and the dashboard draws it with the existing
NoticeCard. The frame thereforemirrors
NoticeCard.tsxexactly -- the outerdiv[data-testid=notice-card][data-tone=info]with its
ring-1 ring-inset ring-border bg-card text-mutedclasses, the inner flex row attext-[13px] leading-5, lucide's owninfoglyph at size 13 read fromnode_modules/lucide-react/dist/esm/icons/info.js, and thespan.min-w-0.break-wordsthatholds the line. A judge notice carries no emoji prefix, so
parseNoticeyields toneinfoand
srSeverity('info')is empty, which is why no screen-reader severity span appears.The four lines are not hand-written. Each is the verbatim return of
decisions/points/nudge_wake.py::notice_linefor its case: quiet under the shipped defaultbrief, quiet under the owner's own brief, a wake, and a fallback with no answers at all. The
two quiet lines differ only in
(default brief)versus(custom brief), which is the wholepoint of that segment -- a quiet reached under the shipped default is not evidence that the
owner's own sentence works.
The harness reads the computed style back before it shoots, for the same reason it earned its
keep on the popover frame: it reports
color: rgb(127, 127, 136),background-color: rgb(24, 27, 34),border-radius: 8pxand an inner13px / 20px, which are--muted,--card,rounded-mdandtext-[13px] leading-5resolving out of this revision's builtstylesheet rather than anything the harness supplies. The column is set to a 720px transcript,
so the wrap in the frame is the wrap a reader sees.
The UX lane's four Watch items
None is a defect in this diff and none is taken here, so each is recorded rather than left for
a reader to rediscover. Three are copy decisions across 13 locales -- the "Jev" versus "Judge"
naming, the
judge_outcome_terminal: "finished"wording, and localizing the notice line, whichis deliberately hardcoded English today because it carries identifiers and probabilities rather
than prose. Inventing twelve translations is worse than one consistent English source handed to
a translation pass. The fourth is visual: the scope switch wants indenting or grouping under the
row it belongs to, which is a Decisions-card layout change affecting every point's panel rather
than this point's.
The pull-request collector has no producer yet, and the screen stays out of its way
A judged loop is a GATED loop --
_judge_tick_is_quietreturnsNonefor anything else onits first two attribute reads. The canonical observation the pull-request collector reads has
exactly ONE writer,
apply_monitor_probeon the structured controller's path, and a gatedloop never reaches it: it observes through
irq.poll, whoseVerdictcarries an outcome,prose and terminal keys, and no canonical facts. So
MonitorState.last_observationis{}for every loop the judge screens.
What that empty reading MEANS depends on whether anything read the subject, and a drop says
"nobody looked". On the gated path the judge is asked only after the typed probe's own verdict
came back quiet, so the subject was read, by the very reader the judge was called to
supplement.
autonudge_judge.pr_target_is_unreadis that rule: with a probe behind it afactless reading is not a drop, it contributes nothing, and the probe's free re-arm stands
exactly as it does on a build with no judge at all. With no probe behind it -- a loop carrying
no monitor, a spent watch, a brief naming some other pull request -- it is an unread target
and fires, which is the direction every unreadable input here resolves toward.
Getting that wrong in either direction is a real cost, and both reviewers named one. Counted
as a complete reading it is the no-evidence/no-drop shape a QUIET verdict is built on, so an
owner's criterion could never evaluate and they were told nothing about why. Counted as unread
it is a FALLBACK: a turn, a durable persist and a notice row every interval for the life of
the watch, against one turn per streak floor without any judge -- the screen inverting its own
purpose for the commonest gated loop there is. Deferring to the probe's quiet is the only
answer that is true about what happened.
Two tests pin it.
pr_target_is_unreadis asserted in both directions, and making itunconditional fails
test_a_reading_is_unread_only_when_no_probe_covers_the_subjectby name.At the tick level, a screened pull-request loop whose collector returns no evidence and no
drop answers QUIET, with its unread-target control beside it, so the free re-arm is pinned
where the turn is actually spent.
Threading real facts out of the kernel is deliberately NOT in this PR. The canonical shape is
built by the
monitoringproviders from their own fetch (review threads and a REST checkpass the
gh pr viewprobe does not make), so a gated producer means either a secondsubprocess per tick or a port of that provider, against a field whose exact shape is pinned
by full-dict equality and hashed into the wake fingerprint. The collector stays wired,
rendered and tested against that shape and gains a producer when a gated tick publishes one;
docs/feature-map/README.mdstates this rather than claiming the capability.judge_quiet_streakis also gone from the frontend. It was parsed inautomation.ts, typedon
AutoNudgeLoopand carried back by the popover, and no surface rendered it --judgeReadingnever read it. The backend field stays, because it is what the quiet-streak floor counts.