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:
amosblomqvist
2026-09-15 08:09:56 +03:00
parent f6b0c3fb86
commit 4022e3f0d0
4 changed files with 57 additions and 26 deletions
+6 -4
View File
@@ -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)", () => {