Commit Graph

155 Commits

Author SHA1 Message Date
Дмитрий 81cbd8c1c2 feat(brain-retro #7): C1+C2+C3+C4 router-discipline fixes
retro #7 (docs/observer/notes/2026-05-27-brain-retro-7.md) surfaced 4
candidates against 23 turns since retro #6. All four implemented TDD.

C1 — translit slang vocabulary in router-classifier-regex-fallback.mjs.
TASK_TYPE_KEYWORDS += deploy bucket (push / запушь / выкат);
memory-sync += обнови мозг / эталон / пилот / memory dump.

C2 — short_ambiguous_block in router-tool-gate.mjs + router-prehook.mjs.
prehook persists prompt_length; gate blocks Edit/Write/MultiEdit/Bash
when task_type in {ambiguous, unknown} AND prompt_length <= 30 AND
skill not invoked AND no direct_justified tag.

C3 — self-assessment timeout 30s to 50s in observer-self-assessment-api.mjs.
Windows TLS handshake + Sonnet latency exceeded 30s. Stop-hook has 60s
budget; 50s leaves headroom. DEFAULT_TIMEOUT_MS exported for tests.

C4 — Reviewer findings block in status-md-generator.mjs. New helper
computeReviewerFindingsBlock surfaces 51 actionable findings without
running /brain-retro. Detects batch-reviewed via
outcome_reviewed_source=direct_api_batch. MD012 guard test added.

C5 (gitleaks-before-push) intentionally skipped — pre-push hook already
blocks at server side.

Tests: 956/956 root tools, 0 regressions. LEFTHOOK=0 used per quirk #111.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-27 06:46:55 +03:00
Дмитрий 0789367742 chore(observer): runtime drift — counters + episodes-2026-05
ремонт инфраструктуры: runtime-данные observer Stop-хуков, накопленные за параллельные сессии 26.05.2026. Auto-generated, не требуют регрессии.

- .pii-counters.json: WIN_USER_PATH 97 → 107
- episodes-2026-05.jsonl: append-only events from observer-stop-hook

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-26 20:26:10 +03:00
Дмитрий 9b7de8bf8c chore(observer): runtime + STATUS.md refresh after G/H/A1/A2 fixes + settings.json hook order
Hygiene commit after consolidated brain-retro #6 follow-up. Captures live
runtime state where the fixes are now visibly working:

  - STATUS.md regen reflects 917-test sentinel pass.
  - episodes-2026-05.jsonl: +50 lines from this session's turns, including
    state with source: llm + non-empty task_cost (A1 live evidence).
  - pii-counters.json: counter increments from PII filter scans during retro.
  - settings.json: linter-normalized hook order (no semantic change).
  - .gitleaksignore: prior staged hash entry from parallel session.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 20:04:38 +03:00
Дмитрий 8f9ffc387d chore(observer): brain-retro #6 — full reviewer pass (316/316), digital analysis
Period 2026-05-24T00:00Z..2026-05-26T13:18Z (~61h, 317 episodes).
Processed 132 unreviewed episodes via brain-retro-batch-reviewer.mjs
(Opus 4.7 / ProxyAPI, 293.6s, 0 errors). Coverage 100% (316/316), up from
91% in retro #5.

Findings:
  - rework 10.4% (33/316), stable vs retro #5 (11.4%)
  - 132 episodes (41.6%) with gap «recommended, picked direct» — but
    60-70% turned out to be silent regex-fallback false-positives (fixed
    in follow-up commit).
  - rework by group: skill_used 12.0% | direct_no_rec 2.5% |
    direct_ignored_rec 22.7% — delta 20.2 п.п.
  - user_chose_from_options: 0% rework / 0% blocked on 55 episodes —
    brainstorm-pattern is the strongest quality mechanism.
  - 85% episodes без self_assessment — owner подтвердил «бежал слишком
    быстро без остановки» (material signal).

Artefacts:
  - docs/observer/notes/2026-05-26-brain-retro-6.md (25KB)
  - docs/observer/sanity-checks/2026-05-26-brain-retro-6.json
  - STATUS.md regen (C5 488 episodes, missed_activations=21)
  - read-counter + self-retrospect-counter bumped (519 since last)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 17:28:26 +03:00
Дмитрий 5215842304 chore(observer): episodes + pii-counter refresh after webmaster brainstorm session 26.05 вечер — К1+К2 финализированы в memory; К3-К7 пауза до фикса baseline-бага LeadRouter snapshot (см. spec 2026-05-26-slepok-routing-protection). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> 2026-05-26 15:53:16 +03:00
Дмитрий 06dc4a2a91 chore(observer): refresh STATUS.md after merges (boevoi enforce ON)
Auto-regenerated after merging 3 feature branches into main:
  - fix/self-assessment-prompt-source (752d80af in 51966328)
  - feat/brain-retro-2026-05-26 (753c3901)
  - fix/enforce-9-holes (675b7f22)

Now reflects: 474 episodes / sessions / discipline metrics + new sections
'Длинные сессии' (brain-retro candidate B) and 'Использование override-фраз'
(enforce hole 8). router-gate-mode flipped warn-only → enforce in runtime.
2026-05-26 12:41:31 +03:00
Дмитрий 675b7f2237 Merge branch 'fix/enforce-9-holes' into main
Brain-retro #5 candidate C — closes 7 of 9 enforce bypasses, defers 2.
+ enforce mode flipped from warn-only to enforce in runtime.

Hole fixes:
  1. Remove self-override via assistant text (ce02d1ad)
  2. Task/Agent in MUTATING_TOOLS (7e5c2973)
  5. Tighten nodeMatches to exact/segment match (a846eed9)
  4. Triggers_matched fallback when classifier silent (56829266)
  8. Override-usage monitor in STATUS.md + new module (08e2a969)
  9. Rationalization-audit blocks on 3rd flag + expanded vocab (0ea3b5d7)
  7. ремонт инфраструктуры requires justification line (57a7f55b)

Deferred (architectural):
  3. Confidence threshold (separate spec)
  6. Stop-event post-mutation timing (separate spec)

152 enforce-* tests GREEN.

# Conflicts:
#	docs/observer/STATUS.md
#	tools/status-md-generator.mjs
2026-05-26 11:48:16 +03:00
Дмитрий 08e2a969e8 feat(enforce): hole 8 — override-usage monitor in STATUS.md
Brain-retro #5 candidate C, hole 8: ~/.claude/runtime/override-usage.jsonl
logged every override-vocab use but no surface analyzed frequency. 18x
recovery in lifetime was hidden until manual inspection.

New module tools/enforce-override-monitor.mjs computes per-phrase totals
plus today's count; warns (warning) at >=5/day per phrase (configurable).
Wired into tools/status-md-generator.mjs as a new '## Использование
override-фраз' block.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 11:16:16 +03:00
Дмитрий ea9430d8a7 feat(observer): session-length warning in STATUS.md (retro #5 candidate B)
Brain-retro #5 surfaced a correlation: long sessions (≥50 turns) correlate
with discipline drift. Reviewer pass showed regulated rate dropped 19% →
4.5% during a long session.

This commit adds:

  • computeSessionLengthBlock(episodes, opts?) — pure function that
    groups today's (UTC) episodes by task_id, finds the MAX session_turn
    per session, and surfaces sessions with ≥threshold turns (default 50)
    in a markdown block.

  • Wire-up in renderStatus + main CLI: new "## Длинные сессии" section
    inserted between disciplineBlock/activeProjects and costBlock.

  • 7 new unit tests (36/36 total green).

Behavior:
  • No sessions today →  "Ни одной сессии с >50 ходов".
  • One+ flagged → ⚠️ table { session_id, max turn, regulated %, last episode ts }.
  • Custom threshold via opts.threshold.

Per memory project_enforce_hard_rules.md: this is an indicator, not a hook;
no blocking, just observability. Owner can decide whether to restart when
regulated % drops in a long session.
2026-05-26 10:52:35 +03:00
Дмитрий 659f2b0757 feat(brain-retro): retro #5 — first reviewer pass (184/202) + batch-reviewer tool
Brain-retro #5 за период 2026-05-24T13:18Z .. 2026-05-26T05:09Z (202 эпизода).
Первый ненулевой reviewer-pass в истории brain-governance (раньше 0/414).

Key findings:
  • 184 episodes reviewed via Opus 4.7 ProxyAPI, 18 errors (~$9 cost)
  • outcome_reviewed: success 24.5% / soft_success 64.1% / rework 11.4%
  • node_quality: correct 30% / disputable 59% / wrong_node 9% / over+under 1.6%
  • 93.5% no_self_assessment — confirms self-assessment bug fixed in 752d80af
  • Top ignored nodes (wrong_node): #19 Superpowers (5), #18 Pest (3),
    #33 claude-md-management (2), #25 Semgrep (2)
  • Discipline regressed in long session: regulated 19% → 4.5%

Artifacts:
  • tools/brain-retro-batch-reviewer.mjs (new) — direct API batch driver
    for retros >50 episodes (canonical Task() spawn impractical at scale).
  • docs/observer/notes/2026-05-26-brain-retro.md (new) — full retro note
    with 4 candidates A/B/C/D for owner review.
  • docs/observer/sanity-checks/2026-05-26.json (new) — sanity Q&A.
  • docs/observer/episodes-2026-05.jsonl — 184 episodes mutated with
    review.* / outcome_reviewed / outcome_reviewed_source fields.
  • docs/observer/STATUS.md — refreshed.
  • docs/observer/.pii-counters.json / .read-counter.json / .self-retrospect-counter.json
    — bumped by procedure.

Spec: brain-retro skill .claude/skills/brain-retro/SKILL.md.
2026-05-26 10:49:28 +03:00
Дмитрий 48eaffece8 docs(schema): v8.37 — DIRECT platform changelog entry + header version bump
Spec: docs/superpowers/specs/2026-05-25-supplier-webhook-reliability-design.md

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-25 17:59:13 +03:00
Дмитрий 919971d085 fix(db): migration covers chk_supplier_leads_platform + seed PG-compatible
Found via TDD that supplier_leads has its own platform CHECK constraint
(chk_supplier_leads_platform) and that the seed migration was missing
NOT NULL columns (accepts_types, channel). Migration now:

  - widens supplier_projects/project_supplier_links/supplier_leads.platform
    VARCHAR(4) → VARCHAR(8) (DIRECT is 6 chars)
  - extends three CHECK constraints to include 'DIRECT'

Seed migration uses raw SQL INSERT to properly serialize PG ARRAY type
for accepts_types column. channel='sites' (valid per suppliers_channel_check).

db/schema.sql synced — 3 platform columns and 3 CHECK constraints updated.
CHANGELOG_schema.md entry pending Task 9.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-25 17:59:11 +03:00
Дмитрий 6bf0ebfd1d feat(supplier): LedgerService + CsvReconcileJob recognise DIRECT platform
LedgerService::resolveSupplierId returns suppliers.code='direct' row for
DIRECT-platform supplier_projects (and for parsed-from-payload non-B
projects). CsvReconcileJob::extractPlatform now classifies most non-empty,
non-junk project strings as DIRECT (instead of dumping them into
unparseable_count) — this allows CSV recovery to also create DIRECT
supplier_leads, mirroring the webhook path.

CsvReconcileJobTest junk-rows fixtures updated: previously used callback
phone-number-as-project (79135551234) and URL-like strings as 'junk', but
those are now valid DIRECT identifiers. Replaced with truly junk strings
matching only outside-whitelist symbols (e.g. '???', '!@#').

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-25 17:59:08 +03:00
Дмитрий 5cad78b73d feat(supplier): RouteSupplierLeadJob + LeadRouter handle DIRECT platform
parseProjectField() returns ('DIRECT', signal_type, identifier) when project
has no B-prefix; identifier-detection (call/site/sms regex) runs on full
project string. LeadRouter::matchEligibleProjects has a DIRECT fast-path
that matches Liderra projects by (signal_type, signal_identifier) directly
without requiring project_supplier_links pivot — because DIRECT
supplier_projects are auto-created on first webhook and don't have manual
psl links.

B1/B2/B3 path unchanged (psl-based via project_supplier_links).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-25 17:59:06 +03:00
Дмитрий 3bb2bf92e2 feat(supplier-webhook): accept non-B-prefix projects as platform=DIRECT
Drops regex /^B[123]_.+$/ from project field validation; parsePlatform()
returns 'DIRECT' for projects without B-prefix (instead of silent fallback
to 'B1'). SupplierProjectResolver ALLOWED_PLATFORMS extended to include
DIRECT.

Closes ~67 of 82 lost leads/day for tenant client1 (observed 2026-05-25):
mostly client.carmoney.ru (55), B2_Caranga (7), cabinet.caranga.ru (3),
cashmotor.ru (2), numeric callback IDs (~10).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-25 17:59:04 +03:00
Дмитрий 82b95f4bcb test(supplier): end-to-end DIRECT platform tests (4 failing, 2 passing)
Six tests:
  1. webhook with non-B-prefix project → 202 + platform=DIRECT (FAIL: 422 regex)
  2. Resolver creates DIRECT supplier_project (FAIL: Unknown platform DIRECT)
  3. RouteSupplierLeadJob delivers DIRECT lead via signal_identifier
     fallback (FAIL: VARCHAR(4) truncation — fixed in prior commit)
  4. numeric-only project → DIRECT (FAIL: 422 regex)
  5. B1 regression (PASS)
  6. Resolver rejects truly unknown platform (PASS)

Implementation in subsequent commits.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-25 17:59:02 +03:00
Дмитрий 9a56d92440 fix(db): widen supplier_*.platform VARCHAR(4)→VARCHAR(8) for DIRECT
TDD found that 'DIRECT' (6 chars) does not fit in VARCHAR(4). Three columns
need widening: supplier_projects.platform, project_supplier_links.platform,
supplier_leads.platform. supplier_manual_sync_queue.platform was already
VARCHAR(8). Done in the same migration as CHECK extension — single
atomic deploy.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-25 17:59:00 +03:00
Дмитрий 0e5f47c5e9 feat(db): seed suppliers.code='direct' for DIRECT platform billing
LedgerService::resolveSupplierId will look up suppliers WHERE code='direct'
for DIRECT-platform supplier_projects (Phase 3). cost_rub matches B1 (same
supplier company, different lead-routing channel).

Spec: docs/superpowers/specs/2026-05-25-supplier-webhook-reliability-design.md

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-25 17:58:58 +03:00
Дмитрий 8d037e1f04 fix(supplier): merge webhook into csv-recovered deal, no double-charge
Adds early merge check in RouteSupplierLeadJob::createDealCopyForProject:
when lead.vid IS NOT NULL and an existing deal with NULL source_crm_id
exists for (tenant, phone, project_id) within last 24h, UPDATE that
deal's source_crm_id instead of creating a second Deal. INSERT into
supplier_lead_deliveries links the new supplier_lead.id to the existing
deal.id. LedgerService::chargeForDelivery is NOT called — the original
charge happened when the csv-recovery created the deal.

Closes 37 duplicate deals observed on prod for tenant client1 25.05.2026.
Spec B Phase 1 (commit ccfecd5e) removed DuplicateDetector — this fix
restores idempotency for the specific webhook-after-csv-recovered case
WITHOUT re-blocking intentional supplier repeats with different vids.

Guard: only merges where source_crm_id IS NULL (the CSV-recovered marker).
Two webhooks with different vids on same phone+project still create two
deals — by-design per Spec B.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-25 17:54:22 +03:00
Дмитрий 3dfb96ba47 fix(supplier-webhook): always return JSON 422 on ValidationException
Adds withExceptions render callback for ValidationException that forces
JSON 422 response when request matches api/webhook/supplier/* — regardless
of Accept header. Default Laravel behavior is 302 redirect for non-JSON
clients, which strips POST body.

Observed on prod 2026-05-25: 76 of 234 supplier webhook hits got 302 (Location: /),
mostly for non-B-prefix projects (client.carmoney.ru, cabinet.caranga.ru,
cashmotor.ru). Supplier doesn't follow 302 redirects on POST, so the
lead body is lost. This fix ensures supplier always sees a meaningful
422 with errors[] instead of a redirect.

Other routes unaffected (render returns null for non-webhook URLs).
2026-05-25 17:37:46 +03:00
Дмитрий 633435e990 chore(observer): session episodes — Phase 4 follow-up testing
Append-only journal capture during the factor-analysis bug-surface session.
Episodes contain live tests of the LLM classifier retry logic (10/10 LLM
success rate post-retry) and the prefilter Layer 1 gate on short prompts.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-25 16:15:24 +03:00
Дмитрий 12f88f32c1 feat(brain): sanity-generator + brain-retro v2 + self-retrospect stub (phase 3 task 19)
Phase 3 Task 19 partial — coverage announcement §4.9 deferred to a
separate commit (touches Pravila §17, requires §15.2 pre-flight sync).

- tools/brain-retro-sanity-generator.mjs (NEW, pure):
  generateCandidateQuestions(episodes) returns ≤5 sanity questions
  derived from per-classification volume (>10 episodes per task type
  triggers a themed question: bugfix/feature/planning/refactor/security/
  marketing) plus 2 meta questions about missed activations / direct
  bypass. Reads task_type from classifier_output (v4) with fallback
  to primary_rationale.task_classification (v2/v3). Spec §4.7.
- tools/brain-retro-sanity-generator.test.mjs (NEW): 6 tests
  (bugfix >10 / feature >10 / max 5 / empty / legacy v2/v3 / strings).
- .claude/skills/brain-retro/SKILL.md:
  + description rewritten — "раз в 1-2 недели OR sanity-check threshold"
    (cadence change per spec §4.7).
  + procedure +steps 5a (sanity questions via AskUserQuestion +
    PII filter + sanity-checks/YYYY-MM-DD.json), 5b (reviewer-agent
    Task() spawn + fallback to brain-retro-opus-reviewer.mjs), 9
    (self-retrospect threshold check), 10 (cost report from
    ~/.claude/runtime/cost-daily.json), 11 (richer summary).
- .claude/skills/self-retrospect/SKILL.md (NEW) — stub skill;
  full procedure wired in Task 20 (analyzer + STATUS.md surface the
  threshold).
- docs/observer/.self-retrospect-counter.json (NEW): initial state
  {last_run_at: null, episodes_since_last: 0}.
- docs/observer/sanity-checks/.gitkeep (NEW): directory placeholder
  for sanity-answers JSON files.

Tests: 608 passed / 0 failed (+15 from Task 19 + prior). 4 pre-existing
file fails unchanged. Coverage announcement §4.9 (economy-mode.py +
Pravila §17 subsection + feedback memory + coverage-annotation-mode
flag) — deferred: touches Pravila which is in the §15.2 8-file SoT
list and needs pre-flight `git fetch origin && git log HEAD..origin/main`
before edit; flagging as Phase 3 follow-up commit.
2026-05-25 14:28:26 +03:00
Дмитрий 975570e555 chore(brain): phase-1 flags + rollback re-verify — Phase 1 closed (task 7)
Phase 1 Task 7 closes Phase 1 of LLM-first router overhaul.

Live user-level state (NOT git-tracked):
- ~/.claude/runtime/skill-discipline-mode.json = {mode: 'off'} (new).
- ~/.claude/runtime/router-gate-mode.json = {mode: 'warn-only'} (unchanged).

Rollback re-verified after 6 destructive Phase 1 commits:
- node tools/test-rollback.mjs --dry-run -> OK.
- Tag brain-pre-llm-bootstrap intact (origin/main 9d4a30c3).
- Snapshots in docs/archive/llm-bootstrap-2026-05/ all present.

Phase 1 commits (7 tasks, 7 commits):
- dc7fd579 Task 1: Rollback infra + e2e proof.
- 3073e0cb Task 2: §12 hooks unwired, economy preserved.
- 03600acc Task 3: discipline-metrics KEEP.
- bca63fc6 Task 4: §12 archived + 4 tools mv + 2 consumers refactored.
- 712b4c63 Task 5: Pravila §17 + ADR-016.
- 6d72f5b6 Task 6: cross-ref version drift fix (minimal scope).
- (this commit) Task 7: phase-1 flag + rollback re-verify.

Final verification:
- npx vitest run tools/ : 539 passed (baseline preserved).
- C1 l1-watcher: 0 drift.
- C2 cross-ref-checker: 0 drift in 4 files.
- All 7 Phase 1 exit criteria met (TASKLOG.md Task 7 section).

Plan: docs/superpowers/plans/2026-05-25-llm-first-router-overhaul.md Task 7.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 14:28:24 +03:00
Дмитрий 2b052ab1a7 chore(brain): cross-refs §12 active-rules → §17 minimal (phase 1 task 6)
Phase 1 Task 6 of LLM-first router overhaul. Minimal-scope execution after
reality check (C1/C2 controllers don't track section refs, only version
drift; plan steps about §3.3/R15 archiving are out of scope for cross-ref
update).

Changes:
- CLAUDE.md §0 'Источник истины' row for Pravila: **v1.40 от 24.05.2026**
  -> **v1.41 от 25.05.2026** + narrative bump (§12 archived in Task 4,
  §17 added in Task 5 via ADR-016).
- docs/Tooling_v8_3.md line 4 cross-ref:
  cross-ref Pravila v1.39+ -> v1.41+ (+ CLAUDE.md v2.27+ -> v2.28+).

Deferred (TASKLOG.md Task 6 section for full reasoning):
- §12 textual occurrences in PSR_v1 (39) and historical Tooling/CLAUDE.md
  changelog blocks remain as honest historical pointers to the archived
  §12 (docs/archive/llm-bootstrap-2026-05/pravila-12/...).
- CLAUDE.md §3.3 archive + nodes.yaml pin — out of scope, requires
  structural restructure beyond cross-ref work.
- Tooling §4.X 'когда брать' archive — out of scope.
- PSR_v1 R15 — already removed in v2.0 (motion-runtime removal,
  12.05.2026); current R15 is 'Off-phase routing', unrelated to §12.

Verification:
- tools/l1-watcher.mjs: OK — 0 drift.
- tools/cross-ref-checker.mjs: OK — 0 drift in 4 files (was FAILing on
  Pravila v1.40 / v1.39 references after Task 5 bump to v1.41).
- npx vitest run tools/: 539 passed (unchanged from Task 4 baseline).

Plan: docs/superpowers/plans/2026-05-25-llm-first-router-overhaul.md Task 6.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 14:28:24 +03:00
Дмитрий c6f9dc2d76 feat(brain): Pravila §17 (universal skill-coverage) + ADR-016 (phase 1 task 5)
Phase 1 Task 5 of LLM-first router overhaul. §17 added as the formal
replacement for the §12 «Superpowers hard rule» archived in Task 4.

Pravila changes:
- Header v1.40 -> v1.41 (25.05.2026) + changelog entry.
- §17 «Universal skill-coverage rule» added (6 subsections):
  - §17.1 default-deny on non-conversation tasks.
  - §17.2 5 exempt classes (conversation / micro / manual_override /
    acknowledgment-cancellation / escape-hatch).
  - §17.3 Continuation НЕ exempt (D1).
  - §17.4 Enforcement via router-tool-gate.mjs + runtime mode-flag
    (off / warn-only / enforce; default Phase 2 = warn-only).
  - §17.5 Status (not hard-rule under §9, mechanical hook).
  - §17.6 Link to §16.4 missed-activation.

ADR-016 created (Status: Accepted, Date: 2026-05-25):
- Context: §12 closed-list limitations, rationalization gap, D1 case.
- Decision: §12 archived, §17 introduced.
- Consequences: universal coverage, mechanical enforcement, full
  rollback. Cost ~$320-1370/mo bootstrap (accepted).
- Boundaries: 10 scenarios mapped.
- Enforcement: hook chain + adr-judge + brain-retro + STATUS.md C5.

No code changes — normative-text + new ADR file only. Test impact zero.

Plan: docs/superpowers/plans/2026-05-25-llm-first-router-overhaul.md Task 5.
Spec: docs/superpowers/specs/2026-05-24-llm-first-router-overhaul-design.md §6.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 14:28:24 +03:00
Дмитрий b917360e9b chore(brain): archive §12 + 4 routing/dormancy artefacts + 2 memory + switch 2 consumers to nodes.yaml (phase 1 task 4)
Phase 1 Task 4 of LLM-first router overhaul. Aggressive scope per user
choice (AskUserQuestion 2026-05-25).

Pravila changes:
- §12 (lines 678-748) extracted to docs/archive/.../pravila-12/, body
  replaced by 1-paragraph placeholder pointing to §17 (Task 5) + ADR-016.
- §0 priority chain dropped §12, added forward note about §17.
- §16.4 cross-refs migrated: tools/observer-classification-map.json
  -> docs/registry/nodes.yaml + buildClassificationMap;
  tools/.node-dormancy.json -> nodes.yaml status field + buildDormancyMap.
- §16.5 hard-rule list: §12 -> §17.

Code refactor (preserves test green):
- tools/observer-coverage-checker.mjs + observer-transcript-parser.mjs
  switched from readFileSync(.json) to loadRegistry + adapter.
- 9/9 + 154/154 GREEN.

git mv into archive/routing-docs/:
- tools/observer-classification-map.json, .node-dormancy.json,
  extract-node-dormancy.mjs, extract-node-dormancy.test.mjs.

lefthook.yml: job 12b removed.

Memory (user-level, cp+add-f):
- feedback_superpowers_hard_rule.md, feedback_feature_via_writing_plans.md
  copied to archive/memory/. MEMORY.md user-level updated.

Plan deviations (TASKLOG.md):
- registry-to-classification-map.mjs KEEP (4+ active consumers).
- routing-off-phase.md NOT ARCHIVED (auto-generated derivative).
- router-procedure.md deferred.

Verification: vitest tools/ 539 passed (baseline 543 -7 dormancy +3 rollback).

Rollback: node tools/test-rollback.mjs --execute + git reset --hard
brain-pre-llm-bootstrap.

Plan: docs/superpowers/plans/2026-05-25-llm-first-router-overhaul.md Task 4.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 14:28:24 +03:00
Дмитрий e5f20adcad chore(brain): discipline-metrics.mjs — keep (phase 1 task 3)
Phase 1 Task 3 of LLM-first router overhaul.

Decision: KEEP tools/discipline-metrics.mjs as-is (no code change).

Rationale (see TASKLOG.md Task 3 section):
- Module exports 3 pure functions, all general-purpose metrics not bound
  to §12 specifically.
- disciplinePercentByClassification: classificationMap source migrates
  from observer-classification-map.json -> nodes.yaml in Task 11; metric
  shape preserved under §17 universal skill-coverage.
- deriveRouterStep + boundariesAppliedRate: general router-procedure /
  path_type metrics, untouched by overhaul.
- Active consumers: brain-retro-analyzer.mjs, status-md-generator.mjs.
- 19 tests GREEN, no regressions.

Plan: docs/superpowers/plans/2026-05-25-llm-first-router-overhaul.md Task 3.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 14:28:24 +03:00
Дмитрий 32f9133e87 chore(brain): unwire §12 skill-discipline hooks from settings.json, keep economy (phase 1 task 2)
Phase 1 Task 2 of LLM-first router overhaul.

Live user-level changes (NOT in git, see TASKLOG.md for full diff manifest):
- ~/.claude/settings.json — removed 2 PreToolUse blocks:
  - matcher 'Skill' -> skill-marker.py (§12 trigger marker)
  - matcher 'Edit|Write|MultiEdit' -> skill-check.py (§12 enforcement on Edit)
  - Remaining PreToolUse: 1 block (economy-state-guard, pure economy)
- ~/.claude/hooks/economy-mode.py — trailer text:
  '§12 hard rule из Pravila НЕ override-ится' -> '§17 universal skill-coverage НЕ override-ится'
- ~/.claude/hooks/economy-state-guard.py — NO-OP (no §12 logic; pure economy)

Economy system (0%/5%/25%/50%/75%/100%) remains fully active. Stop-hook
subagent verifier (model: claude-sonnet-4-6) remains. PostCompact, SessionStart
hooks unchanged.

skill-marker.py and skill-check.py files remain on disk in ~/.claude/hooks/
(snapshot already in docs/archive/.../user-hooks/ from Task 1). They are
unwired from PreToolUse — no longer invoked. Task 4 moves them into the
archive proper.

permissions.ask still references skill-marker.py/skill-check.py (4 entries
Edit/Write each) — these gate direct file edits and are harmless. Cleaned
up alongside Task 4 archive.

Verification:
- ~/.claude/settings.json parses as valid JSON (1 PreToolUse block).
- All 4 economy hooks (economy-mode, economy-state-guard, economy-postcompact,
  economy-self-check) still run with exit 0.
- Live economy-mode.py with prompt 'тест экономия 5%' returns valid hook
  JSON with FIRST LINE '=== ECONOMY MODE: 5%' and trailer mentioning §17.

Rollback: 'node tools/test-rollback.mjs --execute' restores both files
from snapshot (verified e2e in Task 1).

Plan: docs/superpowers/plans/2026-05-25-llm-first-router-overhaul.md Task 2.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 14:28:23 +03:00
Дмитрий 26999ca597 chore: working tree cleanup pre-llm-first-router merge
Три группы накопившихся auto-правок (НЕ ручные):

1. markdownlint --fix auto-format (~25 .md в docs/superpowers/, docs/security/marketing-vet.md, docs/adr/015, docs/deploy/lkomega-runbook): MD031/MD032 (blank lines around fence/list) + MD004 (bullet markers `+`→`-`). Содержательных текстовых правок 3: ADR-015 bullet, sprint5d-cleanup bullet, router-discipline trailing space.

2. lefthook 2.1.6 → 2.1.8 (package.json + lock): patch-bump, авто-резолвил npm.

3. Observer runtime (docs/observer/): episodes-2026-05.jsonl +420 строк (текущая активность мозга), STATUS.md regen, .pii-counters / .read-counter тики, +2026-05-24-brain-retro.md note.

Цель — разблокировать merge feat/llm-first-router → main (этап 0 плана постановки в боевой). Содержание ветки не трогает.
2026-05-25 14:23:11 +03:00
Дмитрий 0817c81e67 fix(admin): снять 503-замок saas-admin зоны — защиту держит nginx basic-auth
EnsureSaasAdmin fail-closed 503 вне dev/testing → вся админка на боевом
liderra.ru недоступна (все /api/admin/* падали). Настоящий saas-admin SSO
(Yandex 360) ещё не готов (Б-1 + DO-4), но держать зону наглухо закрытой
нельзя — заказчику нужна админка.

Стопгэп (выбор заказчика): защита /admin + /api/admin/* переносится на
nginx (отдельный HTTP Basic Auth, /etc/nginx/.htpasswd-admin), middleware
зону больше не закрывает. Тест production-кейса переведён с 503 на 200.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 07:35:03 +03:00
Дмитрий b2cbc57533 docs(brain): spec v2.3 + plan v1.2 — coverage announcement (§4.9) + decision confirmed
Coverage announcement — новая фича прозрачности (brainstorm 2026-05-25):
заказчик всегда видит чем покрыта задача (skill/node/hook/direct) в прозе
+ TodoWrite. Источник — classifier_output. Enforcement через economy-mode
reminder (economy сохраняется). Flag coverage-annotation-mode (10-й).
Тайминг — в составе overhaul Phase 3.

spec v2.2 → v2.3:
- §4.9 (новое) Coverage announcement — 2 поверхности, формат пометки,
  источник, enforcement, flag, тайминг, откат.
- §10 flags table +coverage-annotation-mode (9→10 флагов).
- §11.3 Phase 3 +task coverage announcement.
- §23 (новое) changelog v2.2→v2.3.

plan v1.1 → v1.2:
- DECISION POINT  ПОДТВЕРЖДЁН: economy keep / §12 remove.
- Task 19 +step 8 coverage announcement (economy-mode reminder + Pravila §17
  подпункт + memory feedback_coverage_announcement + flag).

brainstorm Q&A: Q1 поверхности=проза+TodoWrite; Q2 состав=skill+node+hook+direct;
Q3 enforcement=convention+reminder; Q4 тайминг=в составе overhaul.

НЕ исполняется (per user — план).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 07:31:33 +03:00
Дмитрий 7d31d0be39 docs(brain): plan v1.1 — откат мозга первым + 9 пробелов 0%-аудита
v1.0 → v1.1 после полного 0%-аудита плана.

ГЛАВНОЕ: Task 1 = «Откат мозга» — полная инфра + snapshot user-level
(~/.claude/settings.json + hooks/*.py + runtime flags) + dry-run +
END-TO-END SMOKE (тривиальная правка → откат → verify) ДО любой
деструкции. Если откат не зелёный — дальше не идём.

9 закрытых пробелов:
- G3 (КРИТИЧЕСКОЕ): user-level hooks смешивают economy-mode (0%/5%/100%,
  СОХРАНИТЬ) и §12 skill-discipline (СНЯТЬ). Task 2 разделяет: snimaet
  skill-marker.py+skill-check.py, оставляет economy-*.py, чистит §12 из
  economy-state-guard.py + economy-mode.py. DECISION POINT для заказчика.
- G16: brain-retro-opus-reviewer.mjs НЕ существует → Task 18 CREATE
  (не «keep from v2.0» как было в v1.0/spec).
- G11: router-accuracy-runner.mjs:11 import classifyByRegex сломается →
  Task 10 чинит на regex-fallback модуль.
- G14: registry-to-classification-map.mjs нейтрализуется (Task 4).
- G8/G9: C1/C2 адаптируются рано (Task 6), чтобы lefthook не блокировал
  коммиты Task 7-15.
- G5: parser forward-compat к v4 эпизодам после отката (Task 15).
- user-level rollback + episodes preservation в test-rollback.mjs/ROLLBACK.md.

Прочее: test-rollback.mjs использует execFileSync (не execSync — без shell,
без инъекции). 21 задача (было 22 в v1.0, консолидация rollback в Task 1).

Self-review: spec coverage + 16 находок v2.2 + 9 находок аудита плана,
type consistency, 0 placeholders.

НЕ исполняется сейчас (per user «только план»).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 06:31:11 +03:00
Дмитрий 2b7a71c5b6 docs(brain): implementation plan фазы 1+2+3 LLM-first router overhaul
План из spec v2.2 — 22 задачи (Task 0 pre-flight + 8 phase-1 + 8 phase-2
+ 6 phase-3) в bite-sized TDD-формате.

Phase 1 (foundation+archive): tag + archive scaffold + inventory hooks +
discipline-metrics decision + test-rollback.mjs (TDD) + archive §12/routing-
docs/memory + §17+ADR-016 + cross-refs §12→§17 + flags+ROLLBACK.md.

Phase 2 (classifier): router-config + nodes.yaml capabilities + prefilter
3 группы/manual-override/anchor (TDD) + Sonnet 4.6 classifier+памятка (TDD)
+ missed-activations на nodes.yaml (TDD) + embedding (TDD) + §17 gate (TDD,
D1 continuation-not-exempt) + prehook inheritance+cost (TDD) + parser v4.0
+ C1/C2 adapters + warmup hook + flags flip.

Phase 3 (evidence loop): Stop-hook execution_trace+chain_gaps+inheritance-
copy (TDD) + self_assessment (TDD) + reviewer subagent verify + direct-API
fallback handler + sanity-generator + brain-retro v2 procedure + self-
retrospect skill + analyzer v4 + status-md cost sections + schema v4.3 +
final flags + rollback dry-run verification.

Self-review: spec coverage (8 слоёв + §17 + 16 находок v2.2), 0 placeholders
(кроме намеренного model-ID резолва Task 0/9), type consistency проверена.

Реализация — после Биллинга v2 Спек C. Фаза 4 (distillation) — отдельный
план через ~6 месяцев. НЕ исполняется сейчас (per user).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 06:08:08 +03:00
Дмитрий 81f52fd1c6 docs(brain): spec v2.2 — закрыты 16 находок 0%-аудита
v2.1 → v2.2. Полный critical audit (экономия 0%) нашёл 16 пробелов;
все закрыты. Новый §22 — changelog с таблицей всех находок.

Критическое (1):
- D1: §17 formal text (§6) включал Continuation в exempt-список direct,
  но Continuation наследует non-conversation classification → §17 enforce
  должен применяться. §6 п.4 переписан: exempt только Acknowledgment +
  Cancellation; Continuation — нет (NON_BLOCKING_TASK_TYPES не содержит её).

Внутренние несогласованности (6):
- A1: schema alternative_better типизирован только null → заметка string|null.
- A2/C3: task_cost reviewer tokens vs usd — взаимоисключающи по пути review.
- A3: §11.3 step 3.2 «создать reviewer-agent.md» → файл уже создан (49aa4ba7).
- A4: prompt-enrichment risk добавлен в §14.
- A5/B3: missed-activations.mjs читает archived map → adapter task §11.2 task 9
  (переключение на nodes.yaml) + §9.5 detail + §14 risk.
- A6: §18.7 «reviewer-agent будет добавлен» → уже добавлен.

Underspecified (5):
- B1/B5: inheritance state→episode chain описан (§4.1 проверка 2).
- B2: reviewer fallback path = brain-retro-opus-reviewer.mjs сохраняется из v2.0.
- B4: discipline-metrics.mjs keep/remove → task §11.1 task 17.

Typo / ellipsis (4):
- C1: «existed» → «создана» в DoD.
- C4: «ОНLY» (кириллица) → «ONLY» в reviewer-agent.md.
- C5: anchor list финализирован (28 существительных + 10 императивов, ellipsis убран).

Сравнение аудитов: v1.0 имел 35 находок, v2.1 — 16, обе волны закрыты.
Остаточные implementation-вопросы (model ID, clustering algo) — в §15,
решаются на старте фаз.

Реализация — после закрытия Биллинга v2 Спек C.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 06:02:33 +03:00
Дмитрий 49aa4ba725 docs(brain): spec v2.1 + reviewer-agent — 16 правок после code review
v2.0 → v2.1 — 3 группы изменений (16 пунктов суммарно):

Группа 1 — решения принятые после v2.0, не внесённые:
- 1.1 Памятка classifier (4 паттерна: brainstorming / discovery-interview /
  writing-plans / systematic-debugging). +flag prompt-enrichment-mode.
- 1.2 Reviewer как полноценный Claude Code subagent (tools=[Read,Grep,Glob,
  Skill], model=opus). Новый файл .claude/agents/reviewer-agent.md.
  +стоимость $240-1200/мес vs $40-80 direct API. Crash fallback на direct
  API. Context bloat cap 10 соседних эпизодов.
- 1.3 Inheritance + 3 группы коротких prompt'ов (continuation/acknowledgment/
  cancellation) + 30-минутный таймаут. +flag inheritance-mode. Новые поля
  в schema v4.1: inherited_from_task_id, inheritance_age_minutes,
  previous_direction_rejected, previous_task_id_rejected.

Группа 2 — edge cases:
- 2.1 Reviewer model явно opus в agent file.
- 2.2 Reviewer subagent crash → fallback direct API call.
- 2.3 Reviewer context bloat: max 10 episodes в agent system prompt.
- 2.4 Manual override приоритет №1 в prefilter (раньше inheritance).
- 2.5 Cancellation clears state + previous_task_id_rejected marker.

Группа 3 — мелкие упущения:
- 3.1 brain-retro SKILL.md description: раз в 1-2 недели (не sprint).
- 3.2 recommended_chain_id nullable для custom chains.
- 3.3 Embedding только для non-prefilter эпизодов.
- 3.4 PII filter wraps sanity-check comments.
- 3.5 requested_node fuzzy matching fallback.
- 3.6 Anchor word list inline initial.
- 3.7 Self-retrospect counter init в фазе 3 step 3.3.
- 3.8 Sanity-check answer file schema_version=1.

Cost rewrite: 720-1380 USD (v2.0) -> 1940-8200 USD (v2.1) на 6 месяцев
из-за reviewer subagent. Granular rollback через reviewer-mode=direct-api
возвращает к v2.0 ценам.

§21 новый — changelog v2.0 → v2.1 со всеми 16 пунктами и где правка.

Реализация — после закрытия Биллинга v2 Спек C.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 04:23:33 +03:00
Дмитрий 10eed4e7e4 docs(brain): spec v2.0 LLM-first router overhaul
Brainstorming сессия 2026-05-24..25:
- LLM-first классификатор (Sonnet 4.6) заменяет regex Layer 1.
- §17 «universal skill-coverage» заменяет §12 (default-deny кроме
  conversation/micro/manual_override/escape-hatch).
- Opus 4.7 ревьюер в /brain-retro заполняет review.* (auto, не пользователь).
- Self-retrospect skill (opt-in) для самоанализа агента.
- 7 гранулярных flag-переключателей + dry-run rollback.
- 3 implementation фазы (~3.5-4.5 недели) + 5-6 месяцев passive
  evidence collection + фаза 4 distillation regex из эмпирики.

v1.0 содержал 8 фактических ошибок (несуществующие skill-discipline
файлы, отсутствующие nodes.yaml поля, L1-L16 в неверных файлах) +
11 пропусков охвата + 10 underspecified + 6 противоречий. v2.0 —
полная перезапись с реальным state inventory (§18) и explicit
accepted trade-offs (§19).

Реализация — после закрытия Биллинга v2 Спек C (per user decision).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 03:27:02 +03:00
Дмитрий be8f582a50 docs(continuity): stage 3 follow-up закрыт — 3 fixes + STATUS regen
3 fixes done in worktree feat/router-stage3-three-fixes:
- d7d8c5e helper readStdinAsUtf8 (StringDecoder, 4 tests)
- c7e02ee 3 хука прокинуты через helper (3 placeholder тестов)
- 593f12a observer-state-enricher helper (9 tests, +empty-string guard)
- 92bbd64 parseTranscript enrichment (2 tests, 4 fields в primary_rationale)

Final regression: 538/538 tools GREEN. gitleaks 0/1490 commits.
warn-only mode сохранён. CHECKPOINT B на следующих сутках работы.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-24 16:01:41 +03:00
Дмитрий 593f12ae6a feat(observer): state enricher helper для эпизодов (stage 3 follow-up 2)
readRouterState(sessionId, {baseDir}) -- pure read state-файла сторожа.
extractRouterFields(state) -- pure извлечение 4 полей для primary_rationale.

Используется парсером эпизодов на следующем шаге (Task 3).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-24 15:45:43 +03:00
Дмитрий 554b1f4aa3 docs(continuity): stages 2+3 router overhaul merged + warn-only active
active-projects.md обновлён: этап 2  + влит в main, этап 3  Phase A+B + влит
в main (warn-only режим, никакой блокировки), bug-fix bec69aa5 (deriveRouterStep)
включён. CHECKPOINT B накапливает реальные наблюдения; Task 9 (переключение
в enforce + 2 метрики) — отдельно после ревью baseline.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-24 13:37:42 +03:00
Дмитрий dd0ac43052 chore(observer): commit live router-classification episodes (stage 3 warn-only)
Эпизоды реальных сессий после hotfix — сторож пишет state + классификацию
на каждый промпт (verified: UUID-session state files). Данные для brain-retro
warn-only ревью.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 11:40:05 +03:00
Дмитрий 57bd85edc6 fix(router): prehook reads 'prompt' field + remove matcher from UserPromptSubmit (stage 3 hotfix)
Two real bugs found via verification (hook didn't fire in live session):
1. UserPromptSubmit block had matcher:"*" — event doesn't support matcher,
   non-standard block dropped (claude-code-guide authoritative). Removed →
   block now {hooks:[...]} like working observer-stop-hook.
2. stdin field was event.user_prompt; Claude Code sends event.prompt.
   Now reads (event.prompt || event.user_prompt) for compat.

Field-fix verified manually with real stdin shape {prompt:...} → #71 pdn-152fz.
Firing fix (matcher) NOT verifiable in-session (hooks load at session start) —
needs restart + next-turn state-file check.

NB stop-gate turn_events field also wrong (Stop sends transcript_path) — separate
follow-up, not on observation critical path (affects chain tracking only).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 11:32:28 +03:00
Дмитрий ebca54f0fa feat(router): register 3 hooks in .claude/settings.json (warn-only) (stage 3 task 8)
UserPromptSubmit → router-prehook (classifier).
PreToolUse Edit|Write|MultiEdit|Bash → router-tool-gate (warn-only).
Stop → router-stop-gate (chain progress).

router-gate-mode.json = warn-only (outside repo, ~/.claude/runtime/).
Переключение в enforce — отдельным шагом после Checkpoint B (24ч наблюдения).

End-to-end smoke verified: «проверь пдн» → #71 pdn-152fz-audit,
warn-only пишет в stderr, не блокирует. Доменная разметка Task 1 работает.

NB активация в основной сессии: хуки в worktree-копии settings.json
версионируются; для реального наблюдения нужна либо merge ветки, либо
ручное применение к основному .claude/settings.json (warn-only безопасен).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 11:08:44 +03:00
Дмитрий 7c8223bf72 feat(router): Stop hook — chain progress tracking (stage 3 task 7)
После каждого хода обновляет state.chainProgress по реально вызванным
скилам. chainCompleted=true когда последний шаг достигнут.
skillInvokedThisTurn флажок для PreToolUse gate.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 11:07:20 +03:00
Дмитрий 89441d95c3 feat(router): tune Layer 1 — глаголы + keyword>classification приоритет (stage 3 task 5b)
Подкрутка classifier'а БЕЗ правки реестра (доменная разметка Task 1 сохранена):
- TASK_TYPE_KEYWORDS +командные глаголы (проверь/составь/поправь/распиши/...);
  порядок ключей: marketing/security ДО analysis для «проверь пдн»→security.
- detectRecommendedNode → two-pass: keyword-домен приоритетнее classification-типа
  (Pass 1 keyword, Pass 2 classification fallback).
- MICRO_KEYWORDS +увеличь/уменьши/одну строку/bump.

Accuracy regex-only: 68.3% → 80.0% (type 55%→85%, micro 95%→100%, node 55%).
Node остался 55%: конфликт «feature+домен» в одном промпте (баланс→#62 vs
feature→#19) Layer 1 одним узлом не разрешает — это работа Layer 2 (Sonnet).
Ground truth НЕ переписан ради цифры (отказ от overfit, в отличие от
реверченного 112591a где субагент удалял реестровые keyword'ы).

489/489 tools GREEN.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 10:54:48 +03:00
Дмитрий b8adeeb9fd docs(stage2): commit plan + observer evidence from this session
План этапа 2 (8 тасков subagent-driven) + эпизоды наблюдателя
текущей сессии разработки + PII-counters file.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 07:50:05 +03:00
Дмитрий 6bd0eb59eb fix(baseline): correct dangling SHA reference (final review minor)
Snapshot "Commit:" field referenced 30b795c (dangling orphan from
amend cycle). Replaced with actual e239160a + 436284c5 (F1 fix).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 07:32:20 +03:00
Дмитрий c1f03061c2 docs(continuity): stage 2 closed - active-projects updated
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 07:15:36 +03:00
Дмитрий 436284c558 fix(baseline): correct top-5 missed-activation nodes in snapshot
Spec review F1: positions 4-5 had stale numbers (#41:2 #42:2);
actual analyzer output shows #25:3, #39:3 (and #53:3 tied at pos 5).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 07:13:48 +03:00
Дмитрий e239160a2e docs(brain): baseline pre-enforcement snapshot (stage 2 task 6)
Зафиксированы цифры дисциплины роутера на 2026-05-24 перед запуском
enforcement-хука этапа 3. Sanity-check passed: missed_before=17 ==
missed_after=17 (delta=0) после переключения источника правды на реестр.

observer-classification-map.json помечен deprecated — для удаления в этапе 4.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 07:09:19 +03:00
Дмитрий f6a1b3d09f feat(brain): STATUS.md — блок «Метрики дисциплины» (stage 2 task 5)
Auto-generated блок с разбивкой % дисциплины по типам задач,
router-step distribution + suspicious-флаг, boundaries-applied rate.
Backward-compat: блок опускается, если discipline не передан.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 07:03:41 +03:00