feat(libsy): de-latch escalation sessions after judged recovery - #323
Draft
linj-glitch wants to merge 3 commits into
Draft
feat(libsy): de-latch escalation sessions after judged recovery#323linj-glitch wants to merge 3 commits into
linj-glitch wants to merge 3 commits into
Conversation
|
Signed-off-by: Lin Jia <linj@nvidia.com>
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
force-pushed
the
linj/escalation-recovery-delatch
branch
from
August 7, 2026 00:07
c12dc11 to
df5462f
Compare
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.
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.