Files
portal/docs/observer
Дмитрий 1e33da15c2 @
fix(судья): судит только ЕЁ голос + второе ухо отделяет крепкие находки от слабых

Полное заключение 19.07 вскрыло две беды судьи. Владелец: сначала судья, потом голос.

1. СУДИЛ ЧУЖОЙ ГОЛОС. Доложил «велено „шарвутся", услышано „шорвутся"» — а
   «шарвутся» сказал КЛИЕНТ. Судья сверял весь журнал целиком, обе стороны, и
   писал в брак Александры чужое произношение. Лечение не выкидыванием слова:
   каждое ожидаемое слово теперь помнит, КТО его должен был сказать, и находка
   докладывается только по её речи. Выравнивание по-прежнему по ВСЕЙ записи —
   иначе её слова начнут цепляться к клиентским; отсекаем на докладе, не на сверке.
   Прибор частиц слушает звук и тем более не знает, чей голос — судит только те
   слова, которые велели сказать ей.
   Было 8 звуковых находок → стало 6, ушли обе клиентские.

2. НЕ ОТЛИЧАЛ «голос сказал плохо» от «ухо не расслышало» — выглядит одинаково.
   Второе ухо другого устройства (модель разметки букв, уже стоит, качать нечего)
   слушает ту же запись. Оба уха не расслышали — находка крепкая; второе
   расслышало верно — слабая.

   🔴 Первая версия СНИМАЛА слабые — и убила «затишье», которое владелец
   подтвердил СВОИМ УХОМ: второе ухо расслышало это слово верно. Правило «оба
   уха обязаны ошибиться» режет правду. Второе ухо — СВИДЕТЕЛЬ, а не судья:
   говорит, насколько находка крепкая, а не есть ли она. Теперь понижение до
   СИГНАЛА: видно в статистике, приговор не двигает, накопитель на пачке
   разговоров сам отделит системное от случайного.

Итог по записи: 6 находок, 3 крепкие («первые»→«первое», «как-то» 81% и 114%),
3 слабые (в том числе подтверждённое владельцем «затишье»).

🪤 Испытания начали тянуть тяжёлые модели и вставать намертво. В conftest
общая заглушка: гигабайтным моделям в испытаниях не место, кому нужна
настоящая — подменяет явно у себя.

Тестов 173 → 183.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@
2026-07-19 10:57:27 +03:00
..
@
2026-07-18 14:40:02 +03:00
@
2026-07-19 10:57:27 +03:00

Observer infrastructure

Passive evidence-loop for the Лидерра «brain» per ADR-011.

Files

  • episodes-YYYY-MM.jsonl — append-only JSONL, one line per Stop-event. Schema v2 (schema_version: 2): the 5 mandatory fields + decision_provenance (who chose the node), environment (economy_level / model / post_compaction / session_turn / parallel_session), task_size, task_ref, prompt_signal, and an outcome that is unknown at write time (refined by /brain-retro). On an internal hook failure a minimal observer_error marker line is written instead of a silent skip. Written by tools/observer-stop-hook.mjs via tools/observer-transcript-parser.mjs.
  • notes/YYYY-MM-DD-<slug>.md — optional MD notes for sessions with qualitative history.
  • STATUS.md — auto-generated dashboard. Regenerated per-commit by tools/status-md-generator.mjs.
  • .read-counter.json — C3 observer-of-observer counter. Updated on Read of observer files.
  • dashboard.html + dashboard.js + dashboard-core.js — Brain Dashboard: visualises the episode log over the automation-graph topology (4 views — Карта / Разбор / Лента / Агрегат). Run npm run brain:dashboard, open the printed localhost URL. dashboard-core.js is pure logic, unit-tested in tools/brain-dashboard-core.test.mjs.

Lifecycle

  1. Write: every Stop-event appends one JSONL line, parsed from the session transcript (Stop-hook).
  2. Aggregate: /brain-retro skill reads JSONL each sprint, proposes regulatory candidates.
  3. Surface: STATUS.md shows controllers + monthly stats.
  4. Self-prune: C3 warns if 54 weeks pass without any read of observer files.

Routing-tag discipline

When the user dictates a specific method/node (e.g. «запусти discovery-interview»), Claude must emit one line in its response:

<!-- routing: provenance=user_directed_method node=<chosen> counterfactual=<node Claude would have chosen autonomously> -->

The Stop-hook routing-gate (tools/observer-routing-detector.mjs + routingGateDecision) detects a dictated method; if the tag is missing it returns decision: block, so the turn cannot end without the tag. The gate fires at most once per turn (stop_hook_active guard). This makes decision_provenance reliable — factor analysis can separate a router error from a user-dictated one.

Privacy

PII filter (phone numbers, emails, tokens) is applied before every write — see tools/observer-pii-filter.mjs. gitleaks pre-push also scans observer files as part of full-history sweep.

Don't

  • Don't edit episodes-*.jsonl manually — it's append-only.
  • Don't write outside docs/observer/notes/ for hand-curated notes.
  • Don't change .read-counter.json manually — it's maintained by hooks.

HK1 pre-check (Pravila ADR-010) — verified 2026-05-19

Before registering tools/observer-stop-hook.mjs on Stop event (Task B5), verified collision against 6-component economy/skill-discipline architecture:

  • User-level ~/.claude/settings.json already has Stop hook: agent-type Sonnet-4.6 economy compliance verifier (analyzes transcript for claim-without-evidence violations).
  • Project-level .claude/settings.json — Stop slot empty.

Result: no overwrite. observer-stop-hook will be added as command-type entry in project-level Stop array. Project + user scopes are independent slots in Claude Code 2.x — both run on the same Stop event without conflict. The agent verifier (user scope) and the JSONL appender (project scope) have non-overlapping responsibilities.