Showcase rlm when context crosses 50% of compactAt - #633
Merged
Conversation
Fold rlm even under --lean, keep it off the Folded-native listing and the always-on prefix, and unfold on --rlm, a >=4 native batch, or an explicit load. MCP fan-out does not showcase (Linear each() footgun). sPTC stays wired for after unfold.
--rlm loads the schema onto the tail; catalogSkips stays true under GRAFF_STABLE_CATALOG. Assert on the rendered JSON, not the skip flag.
Late-showcase hid rlm on small turns. This adds the missing half: effectiveContextTokens crossing half of compactAt markLoads rlm onto the catalog tail. GRAFF_RLM_CONTEXT overrides (percent, 32k floor, or off). Tools-head bytes stay identical — rlm stays off the meta listing. Zhang/MGH: RLM is for OOD-length decomposition, not a first-turn tool and not a naive fat-payload trigger. 32k is their RL curriculum, opt-in.
The rlm listing skip comment pushed the file to 602. Collapse it so tier 1 lines stays green.
yermakoffivan
pushed a commit
to yermakoffivan/codegraff
that referenced
this pull request
Aug 31, 2026
Double --suite inhouse with distilled verifiers from merged CodeGraff PRs: hardlink pin (justrach#687), hosted x_search splice (justrach#632), first-turn MCP skip (ADR 0035/0029), rlm showcase gate (justrach#633), codedb five-shot menu (justrach#597), peer-channel resume (justrach#584). Same pattern as the first six — buggy starter + SPEC + visible tests + hidden/ check. Not the live repo.
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.
Stacked on late-showcase (PR #631, rebased onto current 277 so
x_searchstays). Small first turns still hiderlm. When the existing session meter is actually large, the next catalog can carry the schema on the tail.What the MGH post changed
Zhang / Li / Khattab treat RLM as a length-generalization decomposition space, not a default first-turn tool. Tool-call scaffolds cannot chunk near-infinite context; a
forloop can. Their 32k/1-needle figure is an RL curriculum, not a production token floor. A naive fat-payload / first-slim trigger is the MCP case ADR 0030 already rejected.So the size gate is the meter the Agent already has:
effectiveContextTokens() ≥ 50%ofprovider.compactAt(). Not a second counter. Not 32k by default.Showcase (
markLoaded, schema on the tail, sPTC live):--rlm/setFromCli(true)— immediateread_file/codedb/bash/webfetch)load_tool_schemas tools=["rlm"]MCP-only fan-out and first slim/fat payload do not showcase.
/newand/clearhide a session-discovered showcase;--rlmsticks;--oldresets.GRAFF_RLM_CONTEXToverrides: unset = 50% of compactAt;0/offdisables;1–100or50%is a percent;32k/32768is Zhang's curriculum as an opt-in floor.Cache-head invariant
rlmnever rides the Folded-native /load_tool_schemaslisting (that would rewrite the tools head).renderRootToolsbefore vs after showcase: head bytes identical, schema only on the tail. ADR 0011.Do not splice
system_note/ shapes onto the always-on prefix.ADR 0030 extended (same number as #631; no second 0030). Suite 1677 (277 was 1672; +1 late-showcase net, +4 context/knob/head).
Live SuperGrok (grok-4.6, OAuth,
-p,--max-model-calls 2):pongin 4.53s / 3570 in (512 cached) / 106 out / 1 call. Tools JSON has norlm/llm_query. No rlm call.GRAFF_RLM_CONTEXT=101(threshold sim):pongin 6.60s / 3777 in / 252 out / 1 call. Catalog head (bash…attempt_completion) byte-identical;rlm(+llm_query) appended; hostedx_searchstill last. No rlm call.Tier 1: unit suite green at 1677;
linesgreen; tuiguard hover flaked once (“sweep repainted 1 times”) and passed on retry.Not in this PR: rewrite of #623 / #630 / #631 bodies.