Repository navigation
fix(windows): route an empty complete JIT watchlist to the ambient lane - #13277
Merged
Merged
Conversation
Parity register item 5: since #12549 macOS hands a complete *empty* watchlist to the bounded ambient lane (owner decision 2026-09-01: an account with no standing trigger must not go silent). Windows still evaluated it to `none` and suppressed `empty_watchlist`, so on the Windows client every JIT-admitted account without a trigger produced no ambient candidate at all. `evaluateJitWatchlist` now returns `ambient_fallback` for an empty complete watchlist exactly like a non-empty watchlist with no match, `JitRuntime.admit` surfaces it as `no_eligible_planned_trigger` (the one planned outcome `WindowsJitAssistant` hands to `admitAmbient`), and the `empty_watchlist` reason is retired. Inactive/unauthorized authority still evaluates to `none`. The register entry is marked converged; the Windows local-budget-day gap (macOS #12798) stays listed under the JIT client floor. Failure-Class: none Co-Authored-By: Claude Fable 5.1 <[email protected]>
…e ambient pacing gap Adversarial review of this PR found that the routing change is correct but the parity claim was not. Two changes, no behaviour change: - `contracts/parity/README.md`: item 5 is no longer marked converged. macOS bounds its ambient lane with `JITAmbientPacingPolicy` (burst 2, then one per two hours, 2 triages reserved for derived intent), an `ambient_server_denied` backoff, and a local per-day nano usage read before spend; Windows `admitAmbient` has none of these (`claimJitWakeup` is called with `budget: null`). The entry now reads "routing converged; ambient pacing missing on Windows" and lists the four remaining gaps — pacing, denial backoff, local usage read, and the OCR-keyed ambient context cooldown that makes `reserveProactivity` unbounded per settled context — next to the existing budget-day gap under the JIT client floor (decision 19). - `jitAssistantDelivery.test.ts`: the four existing ambient cases all fake the runtime, so a regression inside `WindowsJitRuntime.admit` would pass them. Adds two cases that drive the REAL runtime (only the authority client and an in-memory sqlite db are supplied) through `WindowsJitAssistant.analyze` over a complete empty snapshot: one asserts the ambient lane is reached and buys exactly the single `nano_triage` reservation, one asserts an INCOMPLETE snapshot still buys nothing. Reverting the `jitTriggerRuntime.ts` routing line fails the first and leaves the second passing. Co-Authored-By: Claude Fable 5.1 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed and why
Parity register item 5. Since #12549 (owner decision 2026-09-01) macOS hands a complete empty watchlist to the bounded ambient lane — an account with no standing trigger must not go silent, and no Beta user has ever created a standing trigger. Windows still evaluated an empty complete watchlist to
noneand suppressedempty_watchlist, so on the Windows client every JIT-admitted account without a trigger produced no ambient candidate at all (the Aug 13–14 "went silent fleet-wide" class, one layer up).evaluateJitWatchlist(desktop/windows/src/shared/jitTriggerRuntime.ts): an empty complete watchlist now returnsambient_fallback, exactly like a non-empty watchlist with no match. Inactive / unauthorized authority still returnsnone.JitRuntime.admit(desktop/windows/src/main/jit/jitRuntime.ts): theempty_watchlistreason is retired; the empty case surfaces asno_eligible_planned_trigger, the one planned outcomeWindowsJitAssistantalready hands toadmitAmbient— so ambient spend stays behind the same local gate, context cooldown, server nano reservation, and daily caps as today.contracts/parity/README.md: item 5 is recorded as routing converged; ambient pacing missing on Windows — see "What this PR does not claim" below.No backend, wire, flag, or macOS change. The Windows client floor for a Windows cohort remains unmet (#12381/#12391/#12397, the budget-day gap, and the ambient pacing gap below); this PR converges one behaviour, it does not activate anything.
What this PR does not claim
Adversarial review of the first revision caught the parity register claiming full convergence for item 5 when only the routing converged. What the two platforms then spend in the ambient lane still differs, and the register now says so:
JITAmbientPacingPolicy(burst 2, then one peractiveDaySeconds / budget— two hours at the default eight — with 2 triages reserved for derived-intent matches), reached fromJITProactivityRuntime.swift:640-670. WindowsadmitAmbientcallsclaimJitWakeupwithbudget: nulland has no pacing at all, so the whole daily allowance can burn in the first minutes after local midnight — the exact failure measured on the owner account 2026-08-30/31 that produced the macOS policy.ambient_server_deniedbackoff, and no local per-day nano usage read before spend (macOSreadAmbientNanoUsage).WindowsJitAssistant.analyzehashes app + window title + OCR text), so a context whose text keeps changing mints a new fingerprint each frame andreserveProactivityRPCs are unbounded per settled context — they continue after the server answersreserved: false. Pre-existing, not introduced here; it is what makes the missing pacing cost real money.All four are listed in
contracts/parity/README.mditem 5 under the JIT client floor (decision 19), next to the existing budget-day gap, and are in the cut list below. They gate a Windows cohort, not this routing change: with no Windows cohort admitted, the unpaced lane is not reachable in production today.empty_watchlistis also no longer produced on either platform. The macOS PostHog reason allowlist (ProactiveLaneClient.swift:782) still lists it; that entry is now dead and stays until the next macOS PR — a Swift-only edit costs hours of macOS CI for a dead string and is deliberately not bundled here.Product invariants affected
none
How it was verified
desktop/windows:pnpm@10 exec vitest run src/shared/jitTriggerRuntime.test.ts src/main/jit/jitRuntime.test.ts src/main/jit/jitAssistantDelivery.test.ts src/main/jit/jitAssistant.test.ts→ 38 passed (node 22.23.2, pnpm 10.34.5, frozen lockfile).prettier --check,eslint(0 errors),tsc --noEmit -p tsconfig.node.json --composite falseclean.triggers.length === 0 → 'none'line injitTriggerRuntime.tsfailsreaches the ambient lane and buys exactly the nano reservationand leaves the other 11 delivery cases passing.Tests
jitTriggerRuntime.test.ts › hands a complete empty watchlist to the ambient fallback instead of going silent— drives the real evaluator for empty-complete, non-empty-miss, and inactive authority.jitRuntime.test.ts › routes a complete empty watchlist to the ambient fallback like any planned miss— the runtime admission surface (no_eligible_planned_trigger, legacy Insight still suppressed).jitAssistantDelivery.test.ts › empty complete watchlist, real runtime through analyze— the seam the other cases fake. Builds the REALWindowsJitRuntime(only the authority client and an in-memory sqlite db supplied) and callsWindowsJitAssistant.analyze: an empty complete snapshot reaches the ambient lane and buys exactly onenano_triagereservation; an incomplete snapshot buys nothing.jitAssistantDelivery.test.ts › does not admit ambient on a suppression reason it does not own— keeps the guard that onlyno_eligible_planned_triggerreachesadmitAmbient.Automatic-or-dead check
The evaluator, runtime, and end-to-end tests each fail if the platform-specific suppression returns; the end-to-end one fails even if the regression is inside
WindowsJitRuntime.admitrather than the evaluator.grep -rn "reason: 'empty_watchlist'" desktop/windows/srcis empty (the string survives only in one explanatory test comment), and the parity register entry names both the converged routing and the still-divergent pacing.Cut list
JITAmbientPacingPolicyanalogue), theambient_server_deniedbackoff, and the local per-day nano usage read: separate PR, they changeadmitAmbient's spend decision.reserveProactivityper settled context): separate PR, it changes the fingerprint contract inWindowsJitAssistant.analyze.budget_timezone(the fix(jit): align desktop pacing with the server budget timezone #12798 analogue): separate PR, it touches the reservation client andJitAssistant.localBudgetDay.empty_watchlistentry in the macOS PostHog reason allowlist: next macOS PR.Failure-Class: none
🤖 Generated with Claude Code