@luckydraw/cumulus 1.0.31 → 1.0.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/dist/gateway/static/blex.min.js +13 -7
- package/dist/lib/adaptive-context-budget.d.ts +35 -1
- package/dist/lib/adaptive-context-budget.d.ts.map +1 -1
- package/dist/lib/adaptive-context-budget.js +22 -6
- package/dist/lib/adaptive-context-budget.js.map +1 -1
- package/dist/lib/gateway.d.ts.map +1 -1
- package/dist/lib/gateway.js +28 -3
- package/dist/lib/gateway.js.map +1 -1
- package/dist/lib/retriever.d.ts.map +1 -1
- package/dist/lib/retriever.js +22 -6
- package/dist/lib/retriever.js.map +1 -1
- package/dist/tui/components/App.d.ts.map +1 -1
- package/dist/tui/components/App.js +30 -20
- package/dist/tui/components/App.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## v1.0.33
|
|
4
|
+
|
|
5
|
+
Patch release. A third of the past-conversation context in every prompt was the same messages printed twice. Fixing it cuts retrieved-context size by a quarter on a real thread with no loss of recall.
|
|
6
|
+
|
|
7
|
+
- **32.6% of all rendered history lines were duplicates.** Measured over 3,084 prompt captures on the gateway (1,078 with a `[Relevant Past Messages]` block): 8,327 of 25,554 lines were re-renderings of a message index already present in that same prompt — exact identity, not a similarity heuristic, since every line carries its own `#index`. That cost 6.51M of 18.51M history tokens (35.2%), affected 59% of captures, and ran as high as 42.8% on individual threads. Multiplicity was always `2x` and never `3x` anywhere on disk — the bounded distribution that pins a single emit-once-more code path.
|
|
8
|
+
- **Cause: `expandWithSegments` emitted each hit twice.** Expanding a conversation segment emits every scored result inside it; the outer loop then reached those same results and emitted each again. The guard that looked like it prevented this tested a _message_ index against `processedSegments`, which holds _segment start_ indices — two number spaces in one Set, so it only fired when a hit happened to sit exactly on a processed boundary. `searchHistory` is clean (Set-merged); `formatRetrievedContext` does not dedupe, so every duplicate was billed twice against the RAG budget and displaced a different message that would otherwise have fit.
|
|
9
|
+
- **Fix: one `emit()` gate owns uniqueness** (Rule #8 — no second, defensive dedupe downstream, which would be a bridge between two notions of "unique"). The surviving copy keeps the real search score, never the segment decay.
|
|
10
|
+
- On the `fable-config-amnesia` bench case (a real 3,809-message thread): history messages 81 → **49**, retrieved context 8,011 → **5,991** tokens (−25%), full prompt −15.7%, **identical recall** (3/3 gold facts), stored-content items unchanged. Where the budget is not binding the prompt simply gets smaller; on the budget-capped turns — whose history blocks were 41.6% duplicates — the freed space is instead spent on additional distinct messages.
|
|
11
|
+
- Recorded but deliberately **not** changed: a purely-expanded neighbour scores `segmentBest × 0.6` while task 089's relevance floor drops anything under `max(0.15, topScore × 0.7)`, so since 089 segment context has been unreachable and the duplicate was the whole of segment expansion's observable output. Reviving it (raise the decay) or removing it (Rule #8) is a benchable dilution decision, not a bug fix.
|
|
12
|
+
- RLM-touching: bench pass — 2/2 real cases, 12/12 ladder, static prompt 1791/1800 untouched, speed line held against a same-session control run on unmodified HEAD. 1657/1658 tests green (+4; the one failure is a pre-existing `migrate.test.ts` network flake that fails identically on unmodified HEAD under full-suite load), tsc clean, build clean, lint delta 0, negative control proven.
|
|
13
|
+
|
|
14
|
+
## v1.0.32
|
|
15
|
+
|
|
16
|
+
Patch release. The adaptive context budget's feedback loop can run in both directions for the first time — its "how full was this prompt?" sensor was pointed at the model's response instead of the prompt. Also picks up `@luckydraw/blex@0.1.19`, so mermaid diagrams render without text spilling outside their boxes.
|
|
17
|
+
|
|
18
|
+
- **The adaptive budget has never once grown, on any thread.** Measured across all 91 `*.adaptive.json` sidecars on the gateway: 0 GROW, 107 SHRINK, 813 FLAT — 49 threads sitting on the 100,000 floor, including every high-traffic one. `recordTurn`'s `tokensUsed` is documented as "tokens actually packed into the prompt", but the gateway fed it `estimateTokens(fullResponse) + userQueryTokens` — the assistant's **output** plus one prompt component, excluding the system prompt, the recent-conversation window and **all retrieved context**, the largest part and the one the budget exists to size. Growth needs `tokensUsed ≥ 55,250` at the floor; the largest value that shape ever produced anywhere is 7,615. Shrink needs TTFT alone, so it worked — hence a one-way ratchet.
|
|
19
|
+
- **One helper, every caller.** New exported `packedPromptTokens()` sums the five real components (instructions, always-include, recent window, RAG, user message). The gateway feeds it from the figures it already computes for `debug.systemPromptBreakdown`; the agentic path overwrites the instructions figure with its own text, since that branch sends a different instruction block. The TUI, which fed a _third_ definition (the RAG slice alone), now uses the same helper — a source-level test fails if either call site diverges again (Rule #8).
|
|
20
|
+
- **Capacity is measured against the budget the retriever actually gets.** `atCapacity` compared against a private `effectiveBudget()` (`0.75×CL − 10,000`) while packing used `getTotalContextBudget()` (`CL × 2/3`) — two notions of "the budget" in one class, ~55k apart at a 775k pin. The private one is deleted, not kept alongside.
|
|
21
|
+
- Policy constants are untouched, but this is **not** a no-op: the grow branch is now reachable, so a thread that packs ≥85% of its budget and answers in under 4s can grow by 1.2×. Whether larger budgets help is a separate, benchable question (task 088 P3 measured dilution as the real failure class) — this restores a mechanism that only ever ran one way, and makes the sidecars record real packed totals.
|
|
22
|
+
- RLM-touching: bench pass — 2/2 real cases, 12/12 ladder, static prompt 1791/1800, speed line held against a same-session control run on unmodified HEAD (the differ's flag against the older `after-162.json` baseline was machine drift, not the change). 1654/1654 tests green (+9), tsc clean, build clean, lint delta 0, three negative controls proven.
|
|
23
|
+
|
|
3
24
|
## v1.0.31
|
|
4
25
|
|
|
5
26
|
Patch release. The stall classifier now gets an output budget a reasoning model can actually finish in — closing the last case where it failed closed and never nudged.
|