Skip to content

feat(libsy): de-latch escalation sessions after judged recovery - #323

Draft
linj-glitch wants to merge 3 commits into
mainfrom
linj/escalation-recovery-delatch
Draft

feat(libsy): de-latch escalation sessions after judged recovery#323
linj-glitch wants to merge 3 commits into
mainfrom
linj/escalation-recovery-delatch

Conversation

@linj-glitch

@linj-glitch linj-glitch commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

The escalation router's latch is currently one-way: once a session escalates, the strong tier serves every remaining turn, including long stretches of routine work after the original trouble is fixed. This PR adds an opt-in recovery path. When recovery_confirmations is above zero, a hand-back judge keeps reading the trajectory on latched turns, and once it rules clear for that many consecutive turns the session returns to the weak tier. The default of zero preserves today's permanent-latch behavior exactly, including skipping the judge on latched turns.

Three design points came out of benchmarking an earlier draft of this change. First, the hand-back judge uses its own packaged prompt rather than the trouble rubric: the latched transcript is the strong tier's own healthy-looking work, so asking "is there trouble" hands sessions back precisely when the strong tier is cruising through the hard part, and the recovery prompt instead asks whether the remaining work could be carried by the weak tier, defaulting to staying strong. The route-level prompt override continues to replace the trouble rubric only. Second, after a de-latch the session is on probation: a single escalate verdict re-latches it, so a wrong hand-back costs one weak turn rather than a full re-confirmation streak of thrash. Third, each session gets one recovery — the second latch is permanent — so tiers cannot oscillate for the remainder of a session.

A judge outage on a latched turn holds both the latch and the recovery streak, so recovery needs live verdicts and an outage can never cause a hand-back. Docs and the TOML schema reference are updated, and the new tests cover the de-latch, the held latch, probation re-latch with latch permanence, and the recovery judge's prompt selection.

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1

🚀 View preview at
https://NVIDIA-NeMo.github.io/Switchyard/pr-preview/pr-323/

Built to branch gh-pages at 2026-08-07 00:08 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

linj-glitch and others added 3 commits August 6, 2026 17:03
Benchmarking the recovery knob showed three failure modes working
together: the trouble rubric reads the latched transcript, which is the
capable tier's own healthy-looking work, so it hands sessions back
exactly when the strong tier is cruising through the hard part; a wrong
hand-back then costs a full re-confirmation streak of weak-tier thrash
before the session can re-latch; and nothing stops the cycle from
repeating for the rest of the session.

This change gives the latched-turn consultation its own packaged
hand-back prompt that asks whether the remaining work could be carried
by the efficient tier and defaults to staying strong (the route-level
prompt override keeps replacing the trouble rubric only), re-latches on
a single escalate verdict after a de-latch, and makes the second latch
permanent so each session gets at most one recovery.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Lin Jia <linj@nvidia.com>
A handed-back conversation that has outgrown the efficient tier's
context window overflows on every future turn, and the overflow arm
never reaches the judge, so probation could not re-latch it: the
session paid a doomed efficient call plus a capable fallback per turn
forever. Overflow after a hand-back now re-latches permanently.

Recovery transitions (hand-back, probation re-latch, overflow re-latch)
now emit info-level tracing events, the two judge builders share one
assembly path, and the module docs name both judges.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Lin Jia <linj@nvidia.com>
@linj-glitch
linj-glitch force-pushed the linj/escalation-recovery-delatch branch from c12dc11 to df5462f Compare August 7, 2026 00:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant