diff --git a/cspell-words.txt b/cspell-words.txt index eca914c2..099c46d6 100644 --- a/cspell-words.txt +++ b/cspell-words.txt @@ -1755,3 +1755,5 @@ creds гэп misowned деплоями +subdirs +unwired diff --git a/docs/archive/llm-bootstrap-2026-05/TASKLOG.md b/docs/archive/llm-bootstrap-2026-05/TASKLOG.md new file mode 100644 index 00000000..c03ff792 --- /dev/null +++ b/docs/archive/llm-bootstrap-2026-05/TASKLOG.md @@ -0,0 +1,75 @@ +# Task log — LLM-first router overhaul (phase 1) + +This file tracks the per-task progression of Phase 1, recording user-level +state changes (not in git) so the audit trail survives the overhaul. + +## Task 1 — Rollback infra ⭐ (commit `dc7fd579`, 2026-05-25) + +Established and proved a full rollback mechanism BEFORE any destructive step. + +- Git tag `brain-pre-llm-bootstrap` → `9d4a30c3` (origin/main pre-overhaul). +- Archive structure `docs/archive/llm-bootstrap-2026-05/` with 8 subdirs. +- Snapshots: `~/.claude/settings.json`, all 14 hooks in `~/.claude/hooks/`, + `~/.claude/runtime/router-gate-mode.json`, `docs/registry/nodes.yaml`, + project `.claude/settings.json`. +- `tools/test-rollback.mjs` + 3 TDD tests (GREEN). +- `ROLLBACK.md` runbook with from→to manifest. +- E2E smoke proof (Task 1 Step 9) verified user-level + git-tracked rollback, + Task 1 untracked files survived. Smoke caught a bug in the plan's procedure + (`git checkout tag -- .` + `--soft` does NOT delete files committed after + the tag — `git reset --hard tag` is correct). ROLLBACK.md uses `--hard`. + +## Task 2 — Remove §12 skill-discipline, keep economy (2026-05-25) + +Removed §12 enforcement hooks from the live user environment; the economy +system (0% / 5% / 75% / 100%, etc.) remains fully active. + +**Changes to `~/.claude/settings.json`** (live user file, not in git): + +- Removed PreToolUse block `matcher: "Skill"` → `skill-marker.py` (§12 trigger). +- Removed PreToolUse block `matcher: "Edit|Write|MultiEdit"` → + `skill-check.py` (§12 enforcement on Edit/Write). +- Remaining PreToolUse: 1 block — `matcher: "Edit|Write|MultiEdit|Bash|Agent"` + → `economy-state-guard.py` (pure economy concern, kept). +- All UserPromptSubmit / PostCompact / SessionStart / Stop hooks unchanged. + +**Changes to `~/.claude/hooks/economy-mode.py`** (live user file): + +- Line ~337: replaced trailing reminder + «§12 hard rule из Pravila НЕ override-ится этим режимом — на всех уровнях.» + → «§17 universal skill-coverage НЕ override-ится этим режимом — на всех уровнях.» +- All economy logic (LEVELS dict, parse_level, closest_level, state file + write) unchanged. +- The references to `§12.2` inside `LEVELS[5]["rules"]` and `LEVELS[100]["rules"]` + remain — those describe process gates and are migrated to `§17` cross-refs + in Task 6. + +**Changes to `~/.claude/hooks/economy-state-guard.py`** (live user file): + +- NO-OP. Inspected for §12 skill-discipline logic; the file is pure + economy (BASH_FILE_MOD_PATTERNS is the test-cadence reminder, not §12 + enforcement). Plan Step 3 allows no-op for pure-economy guards. + +**Files NOT removed** (only their PreToolUse triggers were unwired): + +- `~/.claude/hooks/skill-marker.py` — still on disk, no longer invoked. +- `~/.claude/hooks/skill-check.py` — still on disk, no longer invoked. + +These two files move into `docs/archive/.../user-hooks/` archive in Task 4 +(snapshot is already in archive from Task 1). + +**Permissions.ask still references** `skill-marker.py` / `skill-check.py` — +4 entries (Edit/Write on each). Left as-is; they only require permission +for direct file edits, no enforcement. Cleaned up alongside Task 4. + +**Verification:** + +- `~/.claude/settings.json` parses as valid JSON; `hooks.PreToolUse` length = 1. +- All 4 economy hooks still run with exit 0 on `< /dev/null`. +- Live `economy-mode.py` run with prompt «тест экономия 5%» returns valid + JSON with FIRST LINE `=== ECONOMY MODE: 5%` and trailer mentioning `§17`, + no `§12 hard rule` substring. + +**Rollback path**: `node tools/test-rollback.mjs --execute` restores +`~/.claude/settings.json` (with skill-marker/skill-check PreToolUse blocks) +and overwrites `economy-mode.py` from snapshot. Verified end-to-end in Task 1. diff --git a/docs/observer/STATUS.md b/docs/observer/STATUS.md index 799e8d9d..9a9c994f 100644 --- a/docs/observer/STATUS.md +++ b/docs/observer/STATUS.md @@ -1,6 +1,6 @@ # Brain Status (auto-generated) -Last updated: 2026-05-25T04:31:41.337Z +Last updated: 2026-05-25T06:31:41.211Z | Контролёр | Состояние | Детали | |---|---|---| @@ -8,15 +8,15 @@ Last updated: 2026-05-25T04:31:41.337Z | C2 Cross-ref consistency | 🔴 | Update cross-refs in offending files. | | C3 Observer-of-observer | ✅ | [observer-of-observer] OK — last read 0 week(s) ago | | C4 Сигнальный статус | ✅ | This file (self-reference) | -| C5 Observer-coverage | ⚠️ | 341 episode(s) this month · Stop-hook + post-commit OK · 21 missed activation(s) — see /brain-retro | +| C5 Observer-coverage | ⚠️ | 135 episode(s) this month · .git/hooks/post-commit not installed (run: npx lefthook install --force) · 17 missed activation(s) — see /brain-retro | | C6 Chain map sync | ✅ | [chain-map-checker] OK — 16 chains in sync | ## Метрики (информационные, не алерты) -- Observer evidence: 341 episodes this month, 0 observer_error markers, 31 PII matches before filter -- Legacy v1 episodes (not in factor analysis): 202 -- Last /brain-retro: 0 day(s) ago -- Использование узлов: см. `/brain-retro` (раз в спринт). missed_activations: 21. **Неиспользованные узлы — не алерт, если профильной задачи не было** (Pravila §16.4 v1.36; capability-readiness; см. memory `feedback_brain_unused_tools_not_problem` — outside-repo memory store). +- Observer evidence: 135 episodes this month, 0 observer_error markers, 6 PII matches before filter +- Legacy v1 episodes (not in factor analysis): 11 +- Last /brain-retro: 1 day(s) ago +- Использование узлов: см. `/brain-retro` (раз в спринт). missed_activations: 17. **Неиспользованные узлы — не алерт, если профильной задачи не было** (Pravila §16.4 v1.36; capability-readiness; см. memory `feedback_brain_unused_tools_not_problem` — outside-repo memory store). ## Метрики дисциплины @@ -24,17 +24,17 @@ Baseline дисциплины роутера (этап 2 router discipline overh | Тип задачи | Эпизодов | % с триггер-матчем | % через скил | |---|---|---|---| -| analysis | 15 | 46.7% | 26.7% | -| monitoring | 12 | 0.0% | 0.0% | -| bugfix | 10 | 40.0% | 40.0% | -| planning | 9 | 11.1% | 22.2% | -| feature | 9 | 22.2% | 0.0% | +| bugfix | 7 | 28.6% | 42.9% | +| feature | 5 | 0.0% | 0.0% | +| analysis | 4 | 0.0% | 25.0% | +| planning | 2 | 0.0% | 0.0% | | refactor | 1 | 0.0% | 0.0% | | cleanup | 1 | 0.0% | 0.0% | +| monitoring | 1 | 0.0% | 0.0% | -Router step distribution: 1: 139, 2: 118, 3: 37, 5: 42 +Router step distribution: 1: 55, 2: 45, 3: 12, 5: 18 -Boundaries applied (ADR / границы): 47 of 336 эпизодов (14.0%). +Boundaries applied (ADR / границы): 13 of 130 эпизодов (10.0%). ## Активные многоэтапные проекты