@mnemom/mnemom 0.17.14 → 0.17.15

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.
@@ -6,14 +6,15 @@
6
6
  * Read-only; no network. Only token counts, model ids and timestamps are read from a
7
7
  * transcript line — never message content.
8
8
  *
9
- * The rate is ONE flat number (operator policy 2026-10-02): the median paired total-bill
10
- * saving of the S46 chain45 C2n arm (context runtime, aggressive profile, no goal) against
11
- * stock, 23.8% over n = 13 counted rounds (mnemom-adw scratchpad/trustcode-mvp/runs/
12
- * s46-status.json; early exits and void arms excluded). It applies to every request whose
13
- * original context is at or above the aggressive profile's fold point (its 60k tail
14
- * budget); smaller requests never fold, so they save 0. A flat rate over-counts mid-size
15
- * contexts and under-counts large ones; in aggregate that evens out. Per-size rates come
16
- * back once there are enough measured pairs. The token saving uses the same rule on the
9
+ * The rate is a median paired total-bill saving of a no-goal context-runtime arm against
10
+ * stock, taken from the dataset whose context sizes cover the request (operator
11
+ * 2026-10-05: the datasets test different context windows, so they are never pooled):
12
+ * - chain45 (S46 C2n, stock peaks 212-448k): 24.3% over n = 14 counted rounds
13
+ * (mnemom-adw scratchpad/trustcode-mvp/runs/s46-status.json; early exits excluded),
14
+ * for requests from the aggressive fold point (60k) up to 450k;
15
+ * - chain240 (d240p4 gwoff, stock peaks ~965k, Claude Code's 1M compaction): 31.6% over
16
+ * n = 3 matched runs, for requests at or above 450k.
17
+ * Smaller requests never fold, so they save 0. The token saving uses the same rule on the
17
18
  * prompt (operator 2026-10-02: one rule for dollars and tokens).
18
19
  */
19
20
  /** One billed request, deduped by message id. `t` is epoch seconds. */
@@ -69,14 +70,18 @@ export declare function parseCompactLine(line: Buffer): Compaction | null;
69
70
  * pass (no second read of the file).
70
71
  */
71
72
  export declare function loadTranscript(path: string, seen?: Set<string>, compactions?: Compaction[]): Row[];
72
- /** S46 C2n vs stock, median paired total-bill saving (n = 13). */
73
- export declare const S46_MEDIAN_SAVING = 0.238;
73
+ /** chain45: S46 C2n vs stock, median paired total-bill saving (n = 14). */
74
+ export declare const S46_MEDIAN_SAVING = 0.243;
75
+ /** chain240: d240p4 gwoff vs stock, median paired total-bill saving (n = 3). */
76
+ export declare const D240_MEDIAN_SAVING = 0.316;
74
77
  /** The aggressive profile's tail budget (cli/src/lib/agent.ts): below it nothing folds. */
75
78
  export declare const AGGRESSIVE_FOLD_FROM = 60000;
79
+ /** Above chain45's largest measured context, chain240 is the measurement that applies. */
80
+ export declare const CHAIN45_MAX_CONTEXT = 450000;
76
81
  export declare const ESTIMATOR_METHOD: string;
77
82
  export type Strategy = "none" | "aggressive";
78
83
  export type RateNote = "below_aggressive" | null;
79
- /** The per-request rate the screen uses. `raw` equals `screen`: no floor, no curve. */
84
+ /** The per-request rate the screen uses. `raw` equals `screen`: no floor. */
80
85
  export declare function ruleRate(x: number): {
81
86
  strategy: Strategy;
82
87
  raw: number;
@@ -6,14 +6,15 @@
6
6
  * Read-only; no network. Only token counts, model ids and timestamps are read from a
7
7
  * transcript line — never message content.
8
8
  *
9
- * The rate is ONE flat number (operator policy 2026-10-02): the median paired total-bill
10
- * saving of the S46 chain45 C2n arm (context runtime, aggressive profile, no goal) against
11
- * stock, 23.8% over n = 13 counted rounds (mnemom-adw scratchpad/trustcode-mvp/runs/
12
- * s46-status.json; early exits and void arms excluded). It applies to every request whose
13
- * original context is at or above the aggressive profile's fold point (its 60k tail
14
- * budget); smaller requests never fold, so they save 0. A flat rate over-counts mid-size
15
- * contexts and under-counts large ones; in aggregate that evens out. Per-size rates come
16
- * back once there are enough measured pairs. The token saving uses the same rule on the
9
+ * The rate is a median paired total-bill saving of a no-goal context-runtime arm against
10
+ * stock, taken from the dataset whose context sizes cover the request (operator
11
+ * 2026-10-05: the datasets test different context windows, so they are never pooled):
12
+ * - chain45 (S46 C2n, stock peaks 212-448k): 24.3% over n = 14 counted rounds
13
+ * (mnemom-adw scratchpad/trustcode-mvp/runs/s46-status.json; early exits excluded),
14
+ * for requests from the aggressive fold point (60k) up to 450k;
15
+ * - chain240 (d240p4 gwoff, stock peaks ~965k, Claude Code's 1M compaction): 31.6% over
16
+ * n = 3 matched runs, for requests at or above 450k.
17
+ * Smaller requests never fold, so they save 0. The token saving uses the same rule on the
17
18
  * prompt (operator 2026-10-02: one rule for dollars and tokens).
18
19
  */
19
20
  import { forEachLine, isoSeconds, parseJson } from "./lines.js";
@@ -159,18 +160,24 @@ export function loadTranscript(path, seen, compactions) {
159
160
  return out;
160
161
  }
161
162
  // ── the saving rate ──────────────────────────────────────────────────────────
162
- /** S46 C2n vs stock, median paired total-bill saving (n = 13). */
163
- export const S46_MEDIAN_SAVING = 0.238;
163
+ /** chain45: S46 C2n vs stock, median paired total-bill saving (n = 14). */
164
+ export const S46_MEDIAN_SAVING = 0.243;
165
+ /** chain240: d240p4 gwoff vs stock, median paired total-bill saving (n = 3). */
166
+ export const D240_MEDIAN_SAVING = 0.316;
164
167
  /** The aggressive profile's tail budget (cli/src/lib/agent.ts): below it nothing folds. */
165
168
  export const AGGRESSIVE_FOLD_FROM = 60_000;
166
- export const ESTIMATOR_METHOD = "flat S46 median (23.8%, C2n vs stock, n = 13) on every request whose original context is " +
167
- ">= 60k (the aggressive profile's fold point), 0 below; request count and output held at stock";
168
- /** The per-request rate the screen uses. `raw` equals `screen`: no floor, no curve. */
169
+ /** Above chain45's largest measured context, chain240 is the measurement that applies. */
170
+ export const CHAIN45_MAX_CONTEXT = 450_000;
171
+ export const ESTIMATOR_METHOD = "per request by original context: 0 below 60k (the aggressive profile's fold point); the " +
172
+ "chain45 median (24.3%, S46 C2n vs stock, n = 14) from 60k to 450k; the chain240 median " +
173
+ "(31.6%, d240p4 gwoff vs stock, n = 3) at or above 450k; request count and output held at stock";
174
+ /** The per-request rate the screen uses. `raw` equals `screen`: no floor. */
169
175
  export function ruleRate(x) {
170
176
  if (x < AGGRESSIVE_FOLD_FROM) {
171
177
  return { strategy: "none", raw: 0, screen: 0, note: "below_aggressive" };
172
178
  }
173
- return { strategy: "aggressive", raw: S46_MEDIAN_SAVING, screen: S46_MEDIAN_SAVING, note: null };
179
+ const r = x >= CHAIN45_MAX_CONTEXT ? D240_MEDIAN_SAVING : S46_MEDIAN_SAVING;
180
+ return { strategy: "aggressive", raw: r, screen: r, note: null };
174
181
  }
175
182
  /**
176
183
  * The one swap point for a session that did NOT run through Mnemom: rows → list-price
@@ -8,8 +8,8 @@
8
8
  * Sessions come in two buckets (index.ts): THROUGH Mnemom (launch ledger, a window / env
9
9
  * signal, or fold evidence), whose saving is REALIZED (replay.ts: stock Claude Code
10
10
  * replayed at its default window, can be negative), and NOT through Mnemom, whose saving
11
- * is the POTENTIAL one (backtest.ts: the flat S46 rule, 23.8% of every request at or
12
- * above 60k, for dollars and for tokens alike). Tokens and dollars are both shown
11
+ * is the POTENTIAL one (backtest.ts: 24.3% of every request from 60k to 450k, 31.6% at or
12
+ * above 450k, for dollars and for tokens alike). Tokens and dollars are both shown
13
13
  * (operator 2026-10-02). Percentages drop their decimals (rounded DOWN).
14
14
  *
15
15
  * Variations; every number has one source and no two lines make the same claim:
@@ -51,12 +51,12 @@ export declare const STRONG_MIN_USD = 5;
51
51
  export declare const STRONG_MIN_PCT = 5;
52
52
  export declare const DAYS = 30;
53
53
  /**
54
- * The forward line: chain45 S46 C2n (context runtime, aggressive profile) total bill vs
55
- * stock, -20.9% [-25.6, -15.9], Opus 5.5, n=13 (r15 readout; operator 2026-10-02: quote
56
- * S46, not S43), 95% CI rounded to fives, 15-25. The d240p1 ~45% figure is NOT used
57
- * (its re-bill undercounts output).
54
+ * The forward line (operator 2026-10-05: the wide range): the low end is the lowest
55
+ * median across the governed arms, chain45 S46 sealed (C2g) 20.5% (n=16); the high end is
56
+ * the highest, chain240 d240p4 sealed 35.7% (n=3). The no-goal medians, chain45 24.3% and
57
+ * chain240 31.6%, sit inside it. All Opus 5.5, total bill vs stock.
58
58
  */
59
- export declare const FORWARD_LINE = "Long sessions are where Mnemom saves the most: about 15 to 25% in our datasets.";
59
+ export declare const FORWARD_LINE = "Long sessions are where Mnemom saves the most: from about 20% to over 35% in our datasets.";
60
60
  /** Prices, promotions and plan allocations move; the saving is in usage (operator 2026-10-01). */
61
61
  export declare const PRICE_LINE = "Prices and plan limits change. Mnemom cuts what you use, so you stay ahead.";
62
62
  /** What `mnemom agent` does today: routes through the gateway, records, keeps context lean. */
@@ -8,8 +8,8 @@
8
8
  * Sessions come in two buckets (index.ts): THROUGH Mnemom (launch ledger, a window / env
9
9
  * signal, or fold evidence), whose saving is REALIZED (replay.ts: stock Claude Code
10
10
  * replayed at its default window, can be negative), and NOT through Mnemom, whose saving
11
- * is the POTENTIAL one (backtest.ts: the flat S46 rule, 23.8% of every request at or
12
- * above 60k, for dollars and for tokens alike). Tokens and dollars are both shown
11
+ * is the POTENTIAL one (backtest.ts: 24.3% of every request from 60k to 450k, 31.6% at or
12
+ * above 450k, for dollars and for tokens alike). Tokens and dollars are both shown
13
13
  * (operator 2026-10-02). Percentages drop their decimals (rounded DOWN).
14
14
  *
15
15
  * Variations; every number has one source and no two lines make the same claim:
@@ -52,14 +52,15 @@ export const STRONG_MIN_USD = 5;
52
52
  export const STRONG_MIN_PCT = 5;
53
53
  export const DAYS = 30;
54
54
  /**
55
- * The forward line: chain45 S46 C2n (context runtime, aggressive profile) total bill vs
56
- * stock, -20.9% [-25.6, -15.9], Opus 5.5, n=13 (r15 readout; operator 2026-10-02: quote
57
- * S46, not S43), 95% CI rounded to fives, 15-25. The d240p1 ~45% figure is NOT used
58
- * (its re-bill undercounts output).
55
+ * The forward line (operator 2026-10-05: the wide range): the low end is the lowest
56
+ * median across the governed arms, chain45 S46 sealed (C2g) 20.5% (n=16); the high end is
57
+ * the highest, chain240 d240p4 sealed 35.7% (n=3). The no-goal medians, chain45 24.3% and
58
+ * chain240 31.6%, sit inside it. All Opus 5.5, total bill vs stock.
59
59
  */
60
- export const FORWARD_LINE = "Long sessions are where Mnemom saves the most: about 15 to 25% in our datasets.";
61
- const FORWARD_SOURCE = "operator 2026-10-02: S46 C2n total bill -20.9% [-25.6, -15.9] (Opus 5.5, n=13), 95% CI " +
62
- "rounded to fives, 15 to 25; measured vs stock";
60
+ export const FORWARD_LINE = "Long sessions are where Mnemom saves the most: from about 20% to over 35% in our datasets.";
61
+ const FORWARD_SOURCE = "operator 2026-10-05: lowest to highest governed-arm median, total bill vs stock: chain45 " +
62
+ "S46 C2g 20.5% (n=16) to chain240 d240p4 sealed 35.7% (n=3); no-goal medians 24.3% and " +
63
+ "31.6% inside";
63
64
  /** Prices, promotions and plan allocations move; the saving is in usage (operator 2026-10-01). */
64
65
  export const PRICE_LINE = "Prices and plan limits change. Mnemom cuts what you use, so you stay ahead.";
65
66
  /** What `mnemom agent` does today: routes through the gateway, records, keeps context lean. */
@@ -387,8 +388,8 @@ export function buildScreen(inp) {
387
388
  gap();
388
389
  L.push(...wrap(FORWARD_LINE));
389
390
  A("forward_range_pct", {
390
- shown: "15 to 25",
391
- raw: [-25.6, -20.9, -15.9],
391
+ shown: "20 to over 35",
392
+ raw: { chain45: { c2n: -24.3, c2g: -20.5 }, chain240: { gwoff: -31.6, sealed: -35.7 } },
392
393
  method: FORWARD_SOURCE,
393
394
  });
394
395
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mnemom/mnemom",
3
- "version": "0.17.14",
3
+ "version": "0.17.15",
4
4
  "description": "Transparent AI agent tracing",
5
5
  "type": "module",
6
6
  "bin": {