fix: the knowledge-context slider is a discrete 6-stop scale — off, then powers of four from 64
The continuous 0-4096 dial was precision theater (a 128-token budget is ~2 propositions; nobody wants that granularity). Decided stops (owner, 2026-09-15): 0 / 64 / 256 / 1024 / 4096 / 16384 — the native range walks positions 0-5 and maps through GRAPH_CONTEXT_TOKENS_STOPS in contracts. Max rises to 16384 (route range follows); the server still accepts any integer in range so a stale client cannot brick settings; non-stop legacy values snap to the nearest stop for the thumb, readout stays honest.
This commit is contained in:
@@ -13,7 +13,7 @@ import {
|
||||
steerDelivered,
|
||||
GRAPH_CONTEXT_TOKENS_DEFAULT,
|
||||
GRAPH_CONTEXT_TOKENS_MAX,
|
||||
GRAPH_CONTEXT_TOKENS_STEP,
|
||||
GRAPH_CONTEXT_TOKENS_STOPS,
|
||||
graphContextText,
|
||||
type GraphContextData,
|
||||
} from "../src/core/contracts.ts";
|
||||
@@ -279,10 +279,12 @@ describe("the runner's pure gates", () => {
|
||||
assert.equal(effectiveContextBudget({ graphContextTokens: 2048 }), 2048);
|
||||
});
|
||||
|
||||
it("the decided knobs: default 1024, max 4096, step 128", () => {
|
||||
it("the decided knobs: default 1024, max 16384, discrete powers-of-four stops from 64", () => {
|
||||
assert.equal(GRAPH_CONTEXT_TOKENS_DEFAULT, 1024);
|
||||
assert.equal(GRAPH_CONTEXT_TOKENS_MAX, 4096);
|
||||
assert.equal(GRAPH_CONTEXT_TOKENS_STEP, 128);
|
||||
assert.equal(GRAPH_CONTEXT_TOKENS_MAX, 16384);
|
||||
// The scale revision (owner, 2026-09-15): off then powers of four —
|
||||
// every stop a real decision, no fine-grained dial theater.
|
||||
assert.deepEqual([...GRAPH_CONTEXT_TOKENS_STOPS], [0, 64, 256, 1024, 4096, 16384]);
|
||||
});
|
||||
|
||||
it("contextToolCallId is deterministic per chat (the one-shot dedup key)", () => {
|
||||
|
||||
@@ -102,8 +102,10 @@ describe("DraftShell — the sessionless surface", () => {
|
||||
html.indexOf('data-testid="stats-bar"') < html.indexOf('data-testid="graph-context-control"'),
|
||||
"the slider is the stats bar's left slot",
|
||||
);
|
||||
// The slider's default position: 1024 of 4096, step 128 (decided).
|
||||
assert.ok(html.includes('min="0"') && html.includes('max="4096"') && html.includes('step="128"'));
|
||||
// The DISCRETE slider (owner, 2026-09-15): 6 positions (off + powers of
|
||||
// four from 64), not a continuous 0-4096 dial.
|
||||
assert.ok(html.includes('min="0"') && html.includes('max="5"') && html.includes('step="1"'));
|
||||
assert.ok(html.includes('value="3"'), "default 1024 = stop index 3");
|
||||
// The readout: "tok" abbreviated, but the FULL number (owner, 2026-09-15:
|
||||
// no k-rounding — 1024 reads as 1024).
|
||||
assert.ok(html.includes("1024 tok"), "the readout shows the default budget, not 0 — default is ON");
|
||||
|
||||
Reference in New Issue
Block a user