Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
aba60dc
Финмодель: юнит-экономика подписки 1999 ₽, сценарии и потолок вычислений
claude Nov 2, 2026
6c45e86
Финмодель: цены единиц по факту прода
claude Nov 2, 2026
24505e3
Финмодель: профиль на Telegram, до и после урезания контекста
claude Nov 2, 2026
cb49641
Сжатие длинных чатов включено по умолчанию, порог 100 тыс.
claude Nov 2, 2026
4d6f0b1
Тест порога сжатия: 100 тыс.
claude Nov 2, 2026
267554f
Заметки: долгая Telegram-сессия и сжатие
claude Nov 2, 2026
33c5d19
ops: cost-per-user.sh — расход на человека в день по usage_costs
claude Nov 2, 2026
6a5613a
Заметки и финмодель: расход на человека по факту прода
claude Nov 2, 2026
5d9c337
ops: phone-minutes.sh — минуты и стоимость звонков по phone_calls
claude Nov 2, 2026
421c8e7
Быстрый браузер выключен по умолчанию: поручения дешевле, чуть медленнее
claude Nov 2, 2026
cdf30b1
Тесты быстрого браузера: режим pilot включается явно
claude Nov 2, 2026
e73a915
Финмодель: звонки по факту прода
claude Nov 2, 2026
7ca9343
Заметки: быстрый браузер выключен, проверка на проде
claude Nov 2, 2026
f7dea61
Финмодель: кредиты OpenAI как фиксированный вычет
claude Nov 2, 2026
a6ba766
Обрезка старых результатов выключена: при дешёвом кэше она рвёт его д…
claude Nov 2, 2026
c17325d
Заметки: обрезка истории выключена, кэш Orca
claude Nov 2, 2026
ded027d
Карточки выключены по умолчанию (CARDS_MODE)
claude Nov 2, 2026
65facd4
Заметки: кэш Orca живёт не меньше 36 минут
claude Nov 3, 2026
79c9262
Финмодель: данные прода после сжатия контекста
claude Nov 3, 2026
2f94a70
Форматирование: README финмодели и тест браузерных запусков
claude Nov 3, 2026
64e27ec
Линт: число в шаблоне теста сжатия приведено к строке
claude Nov 3, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion agent/lib/browser-vm/pilot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import { env } from "@shared/environment";
* it stuck past `fastLlmTimeoutSeconds` (`runs.ts`), and run in flash mode
* when they only search. The list names a workspace by its id or its
* owner's email, as BROWSER_VM_WORKSPACES does, or everyone with `*`; unset,
* nobody is, and nothing is looked up. A verdict by the email is remembered for ten
* nobody is, and nothing is looked up. It runs only with BROWSER_FAST_MODE=pilot
* (off by default since 02.11: cheaper errands, slower). A verdict by the email is remembered for ten
* minutes: it is asked at every start, follow-up and retry of a queued
* errand. A failed lookup runs the errand as before rather than failing its
* start.
Expand All @@ -17,6 +18,7 @@ export async function fastBrowserPilot(scope: {
readonly userId?: string;
readonly workspaceId: string;
}) {
if (env.BROWSER_FAST_MODE !== "pilot") return false;
return inPilot("browser-fast", env.BROWSER_FAST_WORKSPACES, scope);
}

Expand Down
9 changes: 7 additions & 2 deletions agent/lib/compaction/pilot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,13 @@ export async function compactionPilot(
},
turn?: Parameters<typeof pilotVerdictOfTurn>[1]
) {
const list = env.COMPACTION_WORKSPACES ?? [];
if (!directModelActive() || list.length === 0) return false;
// Unset means everyone: a long chat otherwise grows to hundreds of
// thousands of tokens a step (a Telegram session reached 388k, 05.11
// costs); `off` is the way back.
const list = env.COMPACTION_WORKSPACES ?? ["*"];

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Unset COMPACTION_WORKSPACES now compacts for everyone, but the env.ts comment on this variable still says unset means "as before" near the model window. Update that comment and this function's JSDoc to state that unset means all and off means none.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At agent/lib/compaction/pilot.ts, line 29:

<comment>Unset `COMPACTION_WORKSPACES` now compacts for everyone, but the `env.ts` comment on this variable still says unset means "as before" near the model window. Update that comment and this function's JSDoc to state that unset means all and `off` means none.</comment>

<file context>
@@ -23,8 +23,13 @@ export async function compactionPilot(
+  // Unset means everyone: a long chat otherwise grows to hundreds of
+  // thousands of tokens a step (a Telegram session reached 388k, 05.11
+  // costs); `off` is the way back.
+  const list = env.COMPACTION_WORKSPACES ?? ["*"];
+  if (!directModelActive() || list.length === 0 || list.includes("off")) {
+    return false;
</file context>

if (!directModelActive() || list.length === 0 || list.includes("off")) {
return false;
}
if (list.includes("*")) return true;
return pilotVerdictOfTurn("compaction", turn, async () => {
try {
Expand Down
9 changes: 5 additions & 4 deletions agent/lib/compaction/tests/pilot.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ const openRouter = { OPENROUTER_API_KEY: "openrouter-test-key" };
const gateway = { OPENROUTER_API_KEY: "" };

describe("the pilot list of compaction", () => {
it("names nobody while unset, and nobody on the Gateway", async () => {
expect(await pilot("", openRouter)).toBe(false);
it("names everybody while unset, nobody when off, and nobody on the Gateway", async () => {
expect(await pilot("", openRouter)).toBe(true);
expect(await pilot("off", openRouter)).toBe(false);
expect(await pilot("*", gateway)).toBe(false);
expect(await pilot(workspaceId, gateway)).toBe(false);
});
Expand All @@ -38,10 +39,10 @@ describe("the pilot list of compaction", () => {
});

describe("the input a pilot step compacts at", () => {
it("is 150k unless set, and never below 100k", async () => {
it("is 100k unless set, and never below 100k", async () => {
vi.resetModules();
const { env } = await import("@shared/environment");
expect(env.COMPACTION_INPUT_TOKENS).toBe(150_000);
expect(env.COMPACTION_INPUT_TOKENS).toBe(100_000);

vi.resetModules();
vi.stubEnv("COMPACTION_INPUT_TOKENS", "99999");
Expand Down
23 changes: 20 additions & 3 deletions agent/lib/compaction/tests/turn-start.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,11 @@ describe("whether a step may compact the conversation", () => {
).toBe(false);
});

it("never compacts the task agent's report, a retry or a context message last", () => {
it("never compacts the task agent's report, a retry or the checkpoint last", () => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Removing context.state and context.instruction from this list drops the only assertion that these kinds never compact when last. The doc comment in turn-start.ts still says a context.* message after the opener is unsafe, so the code, tests, and docs now disagree. Either restate the rule in the doc comment and keep a test for the new behavior, or keep these assertions.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At agent/lib/compaction/tests/turn-start.test.ts, line 85:

<comment>Removing `context.state` and `context.instruction` from this list drops the only assertion that these kinds never compact when last. The doc comment in `turn-start.ts` still says a `context.*` message after the opener is unsafe, so the code, tests, and docs now disagree. Either restate the rule in the doc comment and keep a test for the new behavior, or keep these assertions.</comment>

<file context>
@@ -82,13 +82,11 @@ describe("whether a step may compact the conversation", () => {
   });
 
-  it("never compacts the task agent's report, a retry or a context message last", () => {
+  it("never compacts the task agent's report, a retry or the checkpoint last", () => {
     for (const kind of [
       "execution.background_task",
</file context>

for (const kind of [
"execution.background_task",
"execution.retry",
"execution.continuation",
"context.state",
"context.instruction",
"context.compaction",
]) {
expect(compactsAtTurnStart([...earlier, opener, tagged("x", kind)])).toBe(
Expand All @@ -97,6 +95,25 @@ describe("whether a step may compact the conversation", () => {
}
});

it("looks past a few short context lines after the opener, not past many", () => {
const line = (n: number) =>
tagged(`Геопозиция ${String(n)}`, "context.location");
expect(compactsAtTurnStart([...earlier, opener, line(1), line(2)])).toBe(
true
);
expect(
compactsAtTurnStart([
...earlier,
opener,
line(1),
line(2),
line(3),
line(4),
line(5),
])
).toBe(false);
});

it("never compacts after a step or an approval's answer", () => {
const step: ModelMessage = {
content: [
Expand Down
22 changes: 18 additions & 4 deletions agent/lib/compaction/turn-start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,24 @@ function userMessageKind(message: ModelMessage) {
* the opener do not count.
*/
export function compactsAtTurnStart(messages: readonly ModelMessage[]) {
const last = messages.findLast(
(message) =>
message.role !== "user" || !userMessageKind(message).startsWith("memory.")
);
// Up to a few short `context.*` lines (location, tips, a recap) may follow

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: The doc block above compactsAtTurnStart still says the opener must be the last message and that a context.* message after it could be all the recent part keeps. This function now accepts up to four such lines, so that comment is wrong. Update it to describe the four-line allowance and why the opener stays in the kept window.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At agent/lib/compaction/turn-start.ts, line 46:

<comment>The doc block above `compactsAtTurnStart` still says the opener must be the last message and that a `context.*` message after it could be all the recent part keeps. This function now accepts up to four such lines, so that comment is wrong. Update it to describe the four-line allowance and why the opener stays in the kept window.</comment>

<file context>
@@ -43,10 +43,24 @@ function userMessageKind(message: ModelMessage) {
-    (message) =>
-      message.role !== "user" || !userMessageKind(message).startsWith("memory.")
-  );
+  // Up to a few short `context.*` lines (location, tips, a recap) may follow
+  // the opener on a channel such as Telegram: eve keeps its last ten messages
+  // whole, so the opener stays beside them after the summary.
</file context>

// the opener on a channel such as Telegram: eve keeps its last ten messages
// whole, so the opener stays beside them after the summary.
let contextLines = 0;
const last = messages.findLast((message) => {
if (message.role !== "user") return true;
const kind = userMessageKind(message);
if (kind.startsWith("memory.")) return false;
if (
kind.startsWith("context.") &&
kind !== "context.compaction" &&
contextLines < 4
) {
contextLines += 1;
return false;
}
return true;
});
return (
last?.role === "user" &&
userMessageKind(last) === "user" &&
Expand Down
1 change: 1 addition & 0 deletions agent/lib/history/pilot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export async function historyTrimPilot(
turn?: Parameters<typeof pilotVerdictOfTurn>[1]
) {
const list = env.HISTORY_TRIM_WORKSPACES ?? [];
if (env.HISTORY_TRIM_MODE !== "pilot") return false;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: The JSDoc above historyTrimPilot still describes only HISTORY_TRIM_WORKSPACES as the switch. Add a sentence that the pilot also needs HISTORY_TRIM_MODE=pilot, otherwise the list is ignored.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At agent/lib/history/pilot.ts, line 29:

<comment>The JSDoc above `historyTrimPilot` still describes only `HISTORY_TRIM_WORKSPACES` as the switch. Add a sentence that the pilot also needs `HISTORY_TRIM_MODE=pilot`, otherwise the list is ignored.</comment>

<file context>
@@ -26,6 +26,7 @@ export async function historyTrimPilot(
   turn?: Parameters<typeof pilotVerdictOfTurn>[1]
 ) {
   const list = env.HISTORY_TRIM_WORKSPACES ?? [];
+  if (env.HISTORY_TRIM_MODE !== "pilot") return false;
   if (!directModelActive() || list.length === 0) return false;
   if (list.includes("*")) return true;
</file context>

if (!directModelActive() || list.length === 0) return false;
if (list.includes("*")) return true;
return pilotVerdictOfTurn("history-trim", turn, async () => {
Expand Down
11 changes: 11 additions & 0 deletions agent/lib/history/tests/pilot.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,14 @@ beforeEach(() => {
afterEach(() => {
vi.restoreAllMocks();
vi.stubEnv("HISTORY_TRIM_WORKSPACES", "");
vi.stubEnv("HISTORY_TRIM_MODE", "");
vi.stubEnv("OPENROUTER_API_KEY", "");
});

async function loadPilot(list: string, settings: Record<string, string>) {
vi.resetModules();
vi.stubEnv("HISTORY_TRIM_WORKSPACES", list);
vi.stubEnv("HISTORY_TRIM_MODE", "pilot");
for (const [name, value] of Object.entries(settings)) {
vi.stubEnv(name, value);
}
Expand All @@ -50,6 +52,15 @@ const openRouter = { OPENROUTER_API_KEY: "openrouter-test-key" };
const gateway = { OPENROUTER_API_KEY: "" };

describe("the pilot list of trimming old history", () => {
it("does nothing unless the mode is `pilot`: the list alone is off", async () => {
vi.resetModules();
vi.stubEnv("HISTORY_TRIM_WORKSPACES", "*");
vi.stubEnv("HISTORY_TRIM_MODE", "off");
vi.stubEnv("OPENROUTER_API_KEY", "openrouter-test-key");
const { historyTrimPilot } = await import("@agent/lib/history/pilot");
expect(await historyTrimPilot({ workspaceId })).toBe(false);
});

it("names nobody while unset, and nobody on the Gateway", async () => {
expect(await pilot("", openRouter)).toBe(false);
expect(await pilot("*", gateway)).toBe(false);
Expand Down
17 changes: 17 additions & 0 deletions docs/dev-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,20 @@ postgres:17-alpine`, Docker в облачной сессии есть; Google
через ostrovok.ru/affiliate; тестовый ключ ищет по всем отелям, а бронирует лишь тестовый (hid 8526976), боевой —
после сертификации (14–30 дней, видео «поиск → бронь → отмена»). Ключ `KEY_ID:API_KEY` ждём в `OSTROVOK_API_KEY`.

- Цена долгой Telegram-сессии (02.11, финмодель — `docs/finmodel/`): сессия владельца сидела на 360–390 тыс. токенов на шаг
(Orca, кэш 98%: тёплый шаг ≈ 0,1 ₽, холодный ≈ 4,6 ₽; среднее по каналу 0,67 ₽ против 0,14 ₽ в вебе) — сжатие не срабатывало:
`compactsAtTurnStart` отвергал ход, если после сообщения шла строка `context.*`. С 02.11 (выкат 20261102-185821) строки
`context.*` (до 4, кроме чекпоинта) не мешают, `COMPACTION_WORKSPACES` без значения — все (`off` — никому), порог 100 тыс.
Проверка эффекта: `usage-stats.sh` — `input_p50` по «Interactive steps by their place» у `channel:telegram`. Консоль VM

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: This adds an internal VM hostname and a root-console access incident to the notes. AGENTS.md asks that notes skip internal hostnames and task history. Drop the hostname here, or refer to the host by role.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At docs/dev-notes.md, line 531:

<comment>This adds an internal VM hostname and a root-console access incident to the notes. AGENTS.md asks that notes skip internal hostnames and task history. Drop the hostname here, or refer to the host by role.</comment>

<file context>
@@ -524,6 +524,20 @@ postgres:17-alpine`, Docker в облачной сессии есть; Google 
+  (Orca, кэш 98%: тёплый шаг ≈ 0,1 ₽, холодный ≈ 4,6 ₽; среднее по каналу 0,67 ₽ против 0,14 ₽ в вебе) — сжатие не срабатывало:
+  `compactsAtTurnStart` отвергал ход, если после сообщения шла строка `context.*`. С 02.11 (выкат 20261102-185821) строки
+  `context.*` (до 4, кроме чекпоинта) не мешают, `COMPACTION_WORKSPACES` без значения — все (`off` — никому), порог 100 тыс.
+  Проверка эффекта: `usage-stats.sh` — `input_p50` по «Interactive steps by their place» у `channel:telegram`. Консоль VM
+  `bro-app-sel-2` 02.11 root-пароль из состояния не принимала (`vnc.py run`): env правился только кодом и выкатом.
+  `host.py deploy` из облачной сессии: `NODE_OPTIONS=--max-old-space-size=8192` (иначе куча на `next build`), Node 24, `zstd`.
</file context>

`bro-app-sel-2` 02.11 root-пароль из состояния не принимала (`vnc.py run`): env правился только кодом и выкатом.
`host.py deploy` из облачной сессии: `NODE_OPTIONS=--max-old-space-size=8192` (иначе куча на `next build`), Node 24, `zstd`.
Проверено вживую 02.11 (веб-чат владельца, 5 сообщений по ~33k токенов): сжатие срабатывает с 2-го хода, шаг держится ~111k;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: These notes expose the owner's session details and a specific search query (also line 2470); remove individual activity data and keep only non-user-specific operational results.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At docs/dev-notes.md, line 534:

<comment>These notes expose the owner's session details and a specific search query (also line 2470); remove individual activity data and keep only non-user-specific operational results.</comment>

<file context>
@@ -524,6 +524,20 @@ postgres:17-alpine`, Docker в облачной сессии есть; Google 
+  Проверка эффекта: `usage-stats.sh` — `input_p50` по «Interactive steps by their place» у `channel:telegram`. Консоль VM
+  `bro-app-sel-2` 02.11 root-пароль из состояния не принимала (`vnc.py run`): env правился только кодом и выкатом.
+  `host.py deploy` из облачной сессии: `NODE_OPTIONS=--max-old-space-size=8192` (иначе куча на `next build`), Node 24, `zstd`.
+  Проверено вживую 02.11 (веб-чат владельца, 5 сообщений по ~33k токенов): сжатие срабатывает с 2-го хода, шаг держится ~111k;
+  вызов сжатия ≈ 0,5 ₽ и +3 с. Расход на человека — `host.py ops NAME cost-per-user.sh [SINCE]`.
+  Обрезка старых результатов (`HISTORY_TRIM_WORKSPACES`) с 02.11 выключена `HISTORY_TRIM_MODE=off` (по умолчанию): её сдвиг границы
</file context>

вызов сжатия ≈ 0,5 ₽ и +3 с. Расход на человека — `host.py ops NAME cost-per-user.sh [SINCE]`.
Обрезка старых результатов (`HISTORY_TRIM_WORKSPACES`) с 02.11 выключена `HISTORY_TRIM_MODE=off` (по умолчанию): её сдвиг границы
раз в 8 ходов рвёт кэш с места правки (живой шаг Telegram: 72k из 82k токенов без кэша ≈ 0,9 ₽), а выигрыш в токенах при кэше
$0,003/M ничтожен; рост истории держит сжатие. Кэш Orca живёт ≥ 36 мин (живой ход Telegram 02.11: 50% префикса попало, остальное — следствие выключенной обрезки; замеры 30/60/120 мин не получены: фоновый python умирает вместе с контейнером сессии, ставьте замер через `send_later`-цепочку); прогрев `warm.ts` пингует только RunInfra,
а чат идёт через Orca. Карточки с 02.11 выключены `CARDS_MODE=off` (по умолчанию; владелец): `send_card`/`update_card` падали с «non-serializable capture»; список `CARDS_WORKSPACES=*` на проде остаётся, вернуть — `CARDS_MODE=pilot` после починки.

## Процесс

- Дизайн (15.10): все страницы, кроме лендинга, — на одной системе: тёплая
Expand Down Expand Up @@ -2451,6 +2465,9 @@ subscriptions WHERE template = 'flight')`, строки уйдут каскад
быстрее deepinfra (вызов browser-use — медиана 2,2 с против 5,6 с), но
дороже вдвое; без `require_parameters` его вызовы шли без ошибок
(`docs/browser-speed.md`).
- С 02.11 пилот ниже **выключен** `BROWSER_FAST_MODE=off` (по умолчанию; владелец: поручения могут быть медленнее, если дешевле): список
`BROWSER_FAST_WORKSPACES` на проде остаётся `*`, но ничего не включает; вернуть — `BROWSER_FAST_MODE=pilot` в `/etc/bro/env`.
Проверено вживую 02.11: поиск чайников на dns-shop — DeepInfra, 18 шагов, 118 с, 0,77 ₽ модели.
- Пилот `BROWSER_FAST_WORKSPACES` (05.10; с 19.10 в проде `*`, владелец — сразу всем):
DeepSeek worker на Together без `requireParameters`, `llmTimeoutSeconds` 25 (worker
≥ 2026-10-05.6), flash для поиска — `FLASH_SEARCH` с ним не нужен
Expand Down
39 changes: 39 additions & 0 deletions docs/finmodel/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Финмодель Bro

`bro-finmodel.xlsx` — живые формулы; жёлтые ячейки — вводные (курс, цена, N, ₽/день токенов, цены единиц).

Выводы при цене 1 999 ₽, постоянных 69,7 тыс. ₽/мес (курс 84,41), номере на каждого:

- Токены 75–100 ₽/день (2 250–3 000 ₽/мес) больше самой выручки: при них 1 999 ₽ не окупается ни при каком N. Цена для нуля при N=200 — 3,1–3,9 тыс. ₽.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: The headline conclusion here (75–100 ₽/день makes 1 999 ₽ unprofitable at any N) is superseded by the 03.11 update below (tokens 25 ₽/день, ≈500 ₽ profit at N=200). Rewrite the 'Выводы' block for the current inputs, or mark it explicitly as the 26.10–02.11 snapshot so the two results don't read as contradictory.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At docs/finmodel/README.md, line 7:

<comment>The headline conclusion here (75–100 ₽/день makes 1 999 ₽ unprofitable at any N) is superseded by the 03.11 update below (tokens 25 ₽/день, ≈500 ₽ profit at N=200). Rewrite the 'Выводы' block for the current inputs, or mark it explicitly as the 26.10–02.11 snapshot so the two results don't read as contradictory.</comment>

<file context>
@@ -0,0 +1,38 @@
+
+Выводы при цене 1 999 ₽, постоянных 69,7 тыс. ₽/мес (курс 84,41), номере на каждого:
+
+- Токены 75–100 ₽/день (2 250–3 000 ₽/мес) больше самой выручки: при них 1 999 ₽ не окупается ни при каком N. Цена для нуля при N=200 — 3,1–3,9 тыс. ₽.
+- Нуль при 1 999 ₽: ≈42 ₽/день токенов при N=200, ≈30 при N=100, ≈50 при N=500. Маржа 30% при N=200 — ≈22 ₽/день.
+- Цена единиц в листе «Профили и лимиты» (голос, звонки, браузер) — допущения; сверять по `usage_costs` (`host.py ops <VM> usage-stats.sh`).
</file context>

- Нуль при 1 999 ₽: ≈42 ₽/день токенов при N=200, ≈30 при N=100, ≈50 при N=500. Маржа 30% при N=200 — ≈22 ₽/день.
- Цена единиц в листе «Профили и лимиты» (голос, звонки, браузер) — допущения; сверять по `usage_costs` (`host.py ops <VM> usage-stats.sh`).

## Факт прода (`usage-stats.sh`, 26.10–02.11)

- Самое дорогое — длинная Telegram-сессия: контекст шага 100–390 тыс. токенов, 0,67 ₽/шаг против 0,14 ₽ в вебе. Это и есть «75–100 ₽/день» (один аккаунт ≈ 70 ₽/день).
- Поручение браузеру — в среднем 2,4 ₽ (p90 4,6), а не 15.
- Голос и звонки в `usage_costs` не пишутся: их цена остаётся допущением.

## Расход на человека (прод, `host.py ops <VM> cost-per-user.sh 2026-10-19`, 02.11)

14 воркспейсов с расходом, большинство — тестовые и бенчмарки, поэтому цифры завышены и шумят:

- ₽ за активный день без самого дорогого: p50 24 ₽, среднее 31 ₽, p90 62 ₽; у «постоянных» (3+ дня) p50 51 ₽.
- Структура (₽ на человеко-день): chat 18, browser-run 15, background 6,4, browser-report 5, proxy 0,9, task 0,6.
- Голос и звонки в `usage_costs` не пишутся: в эти цифры не входят.
- Выводы: чат (длинный контекст Telegram) и модель браузера — две главные статьи; браузер идёт на `BROWSER_FAST_WORKSPACES` (Together, +3,7 ₽ за поручение ради скорости) — решение о скорости/цене за владельцем.

## Звонки (`phone-minutes.sh`, 05.10–02.11)

74 дозвона (>5 с), 113 минут, 5 человек со звонками: медиана 0,7 мин на звонок, в среднем ≈ 25 мин на человека за 4 недели (≈ 0,8 мин в день; один человек — 95 мин). ElevenLabs — $6,6 за 71 звонок ≈ 5 ₽/мин плюс оператор ≈ 1,76 ₽/мин; GPT-Live (с 18.10 основной путь) в этой цене не виден, `carrier_rub` в таблице не заполняется.

## Кредиты OpenAI (владелец 02.11: $200 в месяц, позже возможно $500)

Фиксированная сумма: покрывает всё, что платится OpenAI (голос `/talk`, звонки GPT-Live), но не растёт с числом людей. Лист «Профили и лимиты» считает долю OpenAI в каждой статье (колонка G, допущение) и покрытие: при N=200 и среднем профиле $200 ≈ 16,9 тыс. ₽ дают +84 ₽ на человека в месяц (≈ 1 700 минут голоса и звонков на всех), $500 — около +210 ₽. Чем меньше людей, тем сильнее эффект: при N=50 кредиты закрывают весь OpenAI-расход.

## Обновление 03.11 (данные прода после сжатия контекста)

- Токены в «Вводных» — 25 ₽/день (было 75): среднее 17,7, медиана 12,7, «постоянный» тяжёлый пользователь 44,7 (один человек).
- Лист «Факты прода 03.11» — что измерено; лист «Профили и лимиты» пересчитан на ход чата 0,50 ₽ (шаг 0,17 ₽ × 3).
- Базовый результат: прибыль ≈ 500 ₽/пользователь/мес при N=200, безубыточное N ≈ 83, токены для нуля — до 41 ₽/день.
- Выборка 10 человек, ~2,5 активных дня на каждого: цифры предварительные. Лимиты на пользователя — после роста выборки (решение владельца).
Binary file added docs/finmodel/bro-finmodel.xlsx
Binary file not shown.
Loading
Loading