Commit Graph

43 Commits

Author SHA1 Message Date
Дмитрий e8cc1f1105 docs(plan-6): regions subject-level — design spec + implementation plan
PDD regions feature (commits 4f60add..f982046) shipped с 32-bit маской на
31 субъект, incompatible со schema's 8-битным region_mask CHECK 0..255 →
500 on POST. Interim A (commit b1c3efa) откатил UI; этот эпик возвращает
поле в правильной модели.

Approach 2 — dual-write transition:
- Add projects.regions INT[] (89 codes, GIN-indexed)
- region_mask/region_mode legacy preserved для PhonePrefixService/LeadRouter
  compatibility (Plan 6.5 cleanup)
- Direct copy в supplier_projects.current_regions без bitmask conversion
- UI: <v-autocomplete> с 89 subjects + federal district subtitle

Spec — 14 sections (scope, approach, schema, REGIONS, validation, UI,
outbound, data flow, migration, testing, error, assumptions, OOS, refs).

Plan — 6 tasks (12 new tests, 3 PDD tests refactored):
- Task 0: orientation + baseline
- Task 1: schema delta v8.20 (1 commit)
- Task 2: REGIONS const 31→89 (1 commit) — 89 entries inline по
  конституционному порядку
- Task 3: backend (Store/Update/Service/Model + 5 Pest)
- Task 4: outbound adapter (SyncSupplierProjectsJob + 2 Pest)
- Task 5: frontend (Project type + NewProjectDialog + PDD + 5 Vitest)
- Task 6: regression sweep + close

Key insight (from brainstorming): SupplierProjectDto::regions уже
типизировано array<int, int|string> — supplier API contract supports
89 codes натively, не нужно изменений downstream.

5 ASSUMPTIONS marked в spec §12 (regions order, Москва/МО separate,
existing projects→[], dual-write window, UI subtitle vs subheader) —
confirmed via brainstorming session.

Drive-by: cspell-words.txt +1 entry «федокруг» (term проекта,
используется в spec и других docs).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 19:31:23 +03:00
Дмитрий 4f60add187 docs(spec): PDD regions field — autocomplete + bitmask binding
In-place port региона multi-select autocomplete в ProjectDetailsDrawer.
Закрывает Out-of-plan «Region multi-select autocomplete» из parent spec
(2026-05-14-project-details-drawer-design.md §7).

Подход A (утверждён 2026-05-14):
- v-autocomplete :items="REGIONS.filter(r => r.code !== 0)" (без sentinel)
- reverse-decompose existing region_mask в codes[] при reseedFromProject
- watch selectedRegions → encode mask + mode (include когда пусто, exclude иначе)
- 3 новых vitest case: render chips / select-encodes / clear-resets

Backend без изменений (region_mask + region_mode payload уже в Task 5 onSave).
Backport reverse-decompose в NewProjectDialog (TODO line 172) — out of scope.

cspell-words.txt +1 (иммутабельны).
2026-05-14 17:40:43 +03:00
Дмитрий 0d7f505185 docs(spec): PDD §7 Out-of-scope expanded with reviewer-flagged polish-debt
After SDD execution (9d88955..c5814ec) reviewers flagged 11 non-blocking
issues across Tasks 2/5/6/7/8/9. User decision 2026-05-14: ship as-is, defer
all polish to Plan 6+. Spec §7 расширен 3 кластерами:
- Token drift (4 hardcoded hex × #0f6e56/#f59e0b/#dc2626/480px → CSS vars)
- UX gaps (network-error snackbar / drawer a11y role+aria / Lucide icons)
- Test hardening (testid symmetry / clearAllMocks / .length / comment fix)
+ Cross-cutting silent-error pattern + Sentry breadcrumbs (Б-1 pending).

Полный feature функционально работает (Vitest 92f/755+3sk/0, vue-tsc 0,
ESLint 0, Vite build 2.50s). Polish-debt не блокирует ship.
2026-05-14 17:22:58 +03:00
Дмитрий 9d889558d3 docs(spec): ProjectDetailsDrawer push-mode design + mockup
Design spec + интерактивный HTML mockup для side-panel редактирования
проекта при выборе одного проекта на /projects.

Поведение:
- selectedIds.size === 1 → drawer справа (480px, push-mode, grid сдвигается)
- selectedIds.size >= 2 → BulkActionsBar внизу (условие в ProjectsView.vue:78
  меняется > 0 → >= 2)
- 0 selected → ни drawer, ни bulk-bar

Footer drawer:
- Слева (destructive): Приостановить (toggle-active) + Удалить (soft-archive)
- Справа (form actions): Отмена (close+clearSelection) + Сохранить
  (PATCH /api/projects/{id})

Backend без изменений — используются существующие endpoints PATCH/DELETE/
toggle-active. Pinia store useProjectsStore уже имеет update/toggleActive/
archive методы.

Прецеденты: DealDetailDrawer.vue (overlay-вариант); push-mode здесь — custom
aside + CSS transform/padding-right, без Vuetify teleport.

Mockup: 3 состояния через JS-toggle (0/1/2+ selected), Forest palette
(Teal #0F6E56, ivory #F6F3EC, noir #012019). Phone masked под 152-FZ ПДн.

cspell-words.txt +1 (юнит) — для упоминания юнит-тестов в spec §6.

Open questions: 0 (все 5 UX-решений утверждены заказчиком 2026-05-14).
2026-05-14 13:33:27 +03:00
Дмитрий f936944237 docs(spec): automation-graph iter2 — resize + simple-language + 3-color conflicts + edge legend
4 improvements after iter1 ride-out: drag-handle resize 300-900px + localStorage; rewrite 73 nodes to plain language with Style Guide; reclassify 8 conflicts as 🔴 not-closed /  practice-observed / 🟢 closed-by-rule; new 7-field edge legend (source/target/relation-type/trigger/transfers/mandatory/regulation).

Parallel execution strategy: Phase 2 dispatches 6 subagents (P1 resize, P2-P5 text rewrite by category, P6 conflict types + EDGE_DETAILS) returning raw JS blocks; Phase 3 main agent applies 12 atomic Edits in sequence → 11 atomic commits total.

Through superpowers:brainstorming 4-clarifying-question cycle (text scope / conflict classification / resize UX / edge legend fields), all options chosen by Дмитрий explicitly. Self-review pass; no placeholders, no contradictions, 0 open questions.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 10:29:40 +03:00
Дмитрий b747880ddc docs(spec): automation-graph refactor — 4 fixes (фон / подписи / радиальная иерархия / when+limits)
Дизайн рефакторинга docs/automation-graph.html после визуальной проверки
коммита 7ee78a9:
- canvas background на самом canvas + удаление hideEdgesOnDrag (artifacts)
- удаление labels с edges, переход на title-tooltip + legend section
- radial-sector layout: 6 колец × 4 функциональных сектора, physics off
- 2 новые секции легенды: «Когда используется» + «Ограничения»

cspell: +mgmt (валидный идентификатор узла claude_md_mgmt)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-14 08:55:32 +03:00
Дмитрий 9b21bbc1fd docs(spec): automation graph design spec — vis.js Solarized dark, 72 nodes, 6 conflicts 2026-05-13 16:43:13 +03:00
Дмитрий d0460f6d20 docs(plan): spec + plan для claude-code automation recommendations
Spec: docs/superpowers/specs/2026-05-13-claude-automation-recommendations-design.md
Plan: docs/superpowers/plans/2026-05-13-claude-automation-recommendations-plan.md

8 automations scope:
- 2 MCP: sentry, redis
- 2 skills: /q-item-add, /rls-check
- 2 hooks: PreToolUse block CLAUDE.md, PostToolUse db/schema.sql reminder
- 2 subagents: rls-reviewer, pest-parallel-debugger

Execution: Subagent-Driven (user choice A), feature branch feat/claude-automation.

Out of scope per customer:
- Sync нормативки (PSR_v1/Tooling/CLAUDE.md/Pravila формализация)
- Plugin commit-commands install

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 07:35:30 +03:00
Дмитрий fc07529c4c docs(audit): spec for portal full audit #2 (2026-05-13)
Design для нового 14-phase audit pass на main 21262ef post-merge plan5→main.

Scope: full 13-phase audit (replica 12.05 структуры — pre-flight, static analysis ×4 subagents, test suites, schema integrity, security, UI smoke 24 views, cross-doc, categorize, fix loop, regression verify, Pa11y live + axe-core, TODO sweep, bundle analyzer, Vitest coverage) + новая Phase 14 pre-production readiness (Sentry, DB roles, mock-data prod-gate revisit, CI workflows audit, env validation, queue/cron, backup/log rotation, deployment runbook).

Fix-strategy: hybrid — P0+P1 → atomic commits на main по ходу; P2/P3 → только запись в findings.md (без commits).

Guardrails applied (lessons из 12.05 audit + Pravila v1.12):
- Phase 4 SAST: ls .github/workflows/ FIRST (audit methodology gap closure)
- Phase 5/10 UI-refactor visual smoke + axe-core с setTimeout 500ms + hard reload (Q.DEFER.004 lesson)
- Pest --parallel --recreate-databases для long sessions (квирки 62/73)
- Plans/specs relative paths ../../../ для app/ refs (Pravila v1.12 §4.7 п.4)
- npm install с --legacy-peer-deps (квирк 74)

Baseline для regression gate Phase 9: Pest 742/739/0/3, Vitest 88f/683/3sk, Vite ~3.5s/0err, Histoire 35/63.

Next step: invoke superpowers:writing-plans для implementation plan в docs/superpowers/plans/2026-05-13-portal-full-audit-2.md.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 07:24:00 +03:00
Дмитрий cffed5e979 docs(spec): CTO-19 Lucide icon migration design (brainstorming approved)
Design spec for CTO-19 closure (реестр v1.79 ⏸ — иконочная система
`@mdi/font` не подключена, все mdi-* рендерятся пустыми).

Path α (aliases-only, views untouched) approved заказчиком через
brainstorming AskUserQuestion 13.05.2026 day:
— `npm i lucide-vue-next` selective tree-shakable imports ~25-30 KB gzip
— `app/resources/js/plugins/vuetify.ts` +icons config c custom IconSet
— 78-entry lucideMap (mdi-* semantic-ID → Lucide component)
— Fallback HelpCircle для unmapped
— 51 Vue/TS файл с `icon="mdi-*"` НЕ touched

CLAUDE.md §2 «Иконки: Lucide» — бренд-spec compliance.

Path (i) npm i @mdi/font — REJECTED (250 KB CSS, против бренда).
Path β rename all strings — REJECTED (большой diff 51 файл, не нужен).

Closure plan: CTO-19 ⏸ →  (Pravila §2.2 требует явного «закрываем»),
registry v1.82 → v1.83, CLAUDE.md §0 sync, memory updates. Single atomic
implementation commit.

cspell-words.txt +2: tabler (icon package ref), roh (grep flag).

Next: invoke superpowers:writing-plans для detailed implementation plan.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 04:36:51 +03:00
Дмитрий 323957ad34 chore(merge): R15 motion cleanup origin/main → plan5-frontend-projects
Merge `origin/main` (commits 0fd93fd planning + 615db99 normative) into
plan5-frontend-projects. Merge-base 48f27b4. plan5 был 113 ahead / 2 behind.

CONFLICTS RESOLVED (2 files, manual):
— CLAUDE.md: шапка → v1.90; §0 cross-refs → take origin/main (Pravila
  v1.11 / PSR_v1 v2.0 / Tooling v1.16); §2 Animation default stack → take
  origin/main (motion-runtime guidance); §5 п.12 → take origin/main
  (marker «Резерв (снят 12.05.2026)»); §6 фаза + §8 self-review → keep
  plan5 (Plan 4 MERGED + Plan 5 frontend + Quiet Luxury context); §9 →
  keep both v1.88 entries explicitly labelled (plan5 schema-sync +
  origin/main R15 removal — version-number collision result of parallel-
  branch bump'ов) + v1.89 plan5 factual fix + new v1.90 merge entry.
— docs/CHANGELOG_claude_md.md: keep all three entries (v1.90/v1.89/v1.88).

FAST-FORWARDED (3 files, no conflict — plan5 не редактировал):
— docs/Plugin_stack_rules_v1.md v1.7 → v2.0 (R15 удалён, 162 lines diff)
— docs/Pravila_raboty_Claude_v1_1.md v1.10 → v1.11 (§11.5/§13.2 счётчик
  16→15 правил + cross-refs)
— docs/Tooling_v8_3.md v1.15 → v1.16 (§9.2 reformulated в technical
  guidance: motion-v , framer-motion technical block)

ADDED FROM origin/main (2 files):
— docs/superpowers/plans/2026-05-12-remove-r15-motion-restrictions.md
— docs/superpowers/specs/2026-05-12-remove-r15-motion-restrictions-design.md

cspell-words.txt +1: «форкнулась» (валидный дев-жаргон, в merge-entries).

0 code changes (resources/js/, app/, db/ нетронуты).
0 npm install (motion-v / gsap / anime.js теперь разрешены, не делается).
0 schema changes.

POST-MERGE TODO (отдельные шаги):
— /claude-md-management:revise-claude-md polish (per §5 п.10)
— memory updates: feedback_plugin_paired_stack + project_state +
  reference_archive (бывшая «branch-divergent state» note → resolved)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 03:51:27 +03:00
Дмитрий b6f44d9c80 docs(redesign): add quiet-luxury 1440x896 elements design reference
HTML visual reference for Direction A Quiet Luxury portal redesign
(12.05.2026 sessions). Companion to spec/plan markdown files уже в репо
(docs/superpowers/specs/2026-05-12-portal-redesign-*.md и
docs/superpowers/plans/2026-05-12-portal-redesign-*.md).

Memory ref: project_portal_redesign.md (20 commits на plan5-frontend-projects)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 02:20:09 +03:00
Дмитрий 52e9a46f2b docs(planning): add claude-brain v1.0 extraction plan + design spec
Planning artefacts from 10.05.2026 brain-extraction work (tag brain-v1.0
at 52584df in claude-brain repo at c:/моя/проекты/claude-brain/).
GitHub push 8.2 remains BLOCKED — artefacts captured for traceability.

Memory ref: project_claude_brain.md

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 02:19:38 +03:00
Дмитрий 4ee718e668 docs(quiet-luxury): disclose ProjectCard template change bundled in 3fc90f1
Final code reviewer correctly identified that impl-commit 3fc90f1 included
not only the CSS work but also a template change <v-checkbox> →
<label><input><span> on ProjectCard.vue.

Root cause (Task 0 forensics): session-start git status showed
`M app/resources/js/components/projects/ProjectCard.vue` — pre-existing
uncommitted modifications from prior session/work. When the session Read
the file at start, it saw the working-dir version (already with native
<label><input>), not the branch-HEAD 88a13e2 version (with <v-checkbox>).
Stage+commit in 3fc90f1 thus bundled both changes.

The template change is architecturally required for the new CSS to work —
<v-checkbox> renders Vuetify-internal <input> without a sibling <span>,
which is what the scoped :checked + .card-check__box::after selector
needs. The baseline-fix commit 84530d5 was also prepared for the native
input selector, consistent with this template structure.

Updating spec §2 architecture to reflect this honestly rather than leave
a stale «Template / script нетронуты» statement that conflicts with the
diff in main.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 18:14:58 +03:00
Дмитрий ab47ad250b docs(quiet-luxury): apply reviewer findings on opacity cascade + error state
Task 2 code-quality review (subagent verdict: Ready to merge? No) found
two critical correctness bugs in the original CSS template from spec §3.2:

1. Vuetify's outlined variant collapses sub-element opacity through
   --v-field-border-opacity (= 0.38 at idle). Without explicit opacity:1
   on each override block, --liderra-line (alpha 0.08) effective alpha
   becomes 0.03 → border essentially invisible on ivory backgrounds.

2. Overriding border-color with an explicit value breaks the
   currentColor inheritance Vuetify uses for the error state
   (color: rgb(var(--v-theme-error)) on .v-field--error.v-field__outline).
   Without an explicit error rule that restores currentColor, the red
   error border never appears on any of the 5 validated fields.

Also tightened hover from .ld-input-quiet:hover (which is on the .v-input
root, including hint/error message area) to .v-field:hover inside
:deep() — matches Vuetify's own hover scope and avoids triggering on
helper text hover.

Spec §3.2 and plan Task 2.2 updated to the corrected CSS block with
explicit «almost-trap-avoidance» notes documenting why each adjustment
is needed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 17:52:29 +03:00
Дмитрий b2a5a6e18a docs(quiet-luxury): rescope #896 to 5 v-text-fields after vuetify-defaults finding
Task 0 (pre-flight) обнаружил global Vuetify default в plugins/vuetify.ts:50-54
который уже устанавливает variant=outlined density=comfortable color=primary
для всех VTextField. Изначальная гипотеза spec §1.2 «variant=filled по
умолчанию» была неверна — все 5 v-text-field в NewProjectDialog.vue выглядят
одинаково тёмными (Vuetify default border ≈ 60% on-surface), а не «один
filled среди других».

Заказчик принял расширение области: применить .ld-input-quiet ко всем 5
v-text-field (lines 21, 30, 48, 59, 61), убрать неработоспособные явные
props (variant/density/color/rounded — они уже из global default), и
вынести border-radius в :deep(.v-field) override через --radius-8.

Также Task 0 нашёл pre-existing failing test в ProjectCard.spec.ts:43
(change-trigger на <label> вместо <input> внутри); это будет починено
отдельным atomic-коммитом перед Task 1.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 17:35:50 +03:00
Дмитрий 7d86971e9d docs(quiet-luxury): design spec for elements #1440 + #896 redesign
Spec по узкому Quiet Luxury редизайну двух конкретных элементов из
Dev Element Indices: card-check__box в ProjectCard и v-text-field
«Название проекта» в NewProjectDialog. Подход — CSS / prop правки
под существующие tokens.css, без новых primitives.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 16:21:23 +03:00
Дмитрий 1d6d1f2671 docs(spec): projects bulk actions — design 2026-05-12 14:23:37 +03:00
Дмитрий f90ddb09c1 docs(specs): design — dev element indices (per-element data-dx + manifest)
Утверждённый дизайн: Vite plugin инжектирует data-dx на каждый element
+ persistent dev-indices.json (commit'ится) + DevIndexOverlay
(hover/Alt-keys/Alt+Shift+I toggle/click-to-copy).

Cтабильность через structural signature (file + ancestor chain + tag +
static attrs + text snippet), tombstones для удалённых ID, escape-hatch
через data-dev-name на важных местах. Production: tree-shake'ится через
import.meta.env.DEV.

+3 слова в cspell-words.txt (реордере/реорден/hmr).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 11:22:30 +03:00
Дмитрий 43250b6773 docs(specs): I2 backlog +5 final-review findings (token leaks + naming + stagger) 2026-05-12 10:33:53 +03:00
Дмитрий 3ce52fc52f docs(specs): Task 18 — portal redesign Iteration 1 acceptance + I2 backlog
Iteration 1 verification sweep (commits 38b985a..e266927):
- Vitest 579 passed / 3 skipped / 0 failed (full suite green)
- ESLint debt 15 errors — all in pre-existing Plan 5 files
  (NewProjectDialog/ProjectsView/projectsStore .spec.ts), 0 touched by redesign
- Type-check errors — all in pre-existing Plan 5 files
  (EditProjectDialog.vue, ProjectsView.vue, NewProjectDialog.spec.ts), 0 touched by redesign
- Histoire build — 4 new stories (StatusPill, Kbd, FilterChip, DensityToggle)
  discovered; build fails on pre-existing BulkActionsBar.story.vue Pinia issue

Acceptance §13 checklist (10 items): 8  / 1  / 1 N/A
- 12 CSS tokens , Inter+JetBrains Mono tnum , AppLayout shell 
- StatusPill in Deals  but  NOT integrated in KanbanCard/DashboardView
- 7 motion patterns + prefers-reduced-motion , Density localStorage 
- Vitest unit tests , Histoire stories 
- Pa11y SPA + Lighthouse N/A (skipped per I1 scope)

§15 new section captures 9 Iteration-2 backlog items: slug reconciliation,
sidebar drawer regression, filter chip stubs, status-legend strip,
KanbanCard hover overlap, sidebar marker regex tightening,
prefers-reduced-motion test for ld-marker-grow, Pa11y SPA config, Lighthouse run.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 10:31:14 +03:00
Дмитрий 17e07fbe69 docs(specs): portal redesign — Quiet Luxury (Forest extended) design
Approved through superpowers:brainstorming. Direction A (Quiet Luxury) + двухтоновый Pro Console sidebar + 7 motion patterns (count-up, stagger, pill-morph, hover-lift, skeleton, page-transition, sidebar-marker). Forest palette extended до 12 токенов. Inter + JetBrains Mono с tnum. 44px row default + 36px compact toggle. 14 status-pills (точные slugs из db/schema.sql). prefers-reduced-motion обязательный wrapper. Iteration 1 scope: tokens + typography + shell + components defaults + 4 ключевых view (Dashboard, Deals, Kanban, Projects).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 08:57:42 +03:00
Дмитрий 0fd93fd686 docs(spec+plan): R15 motion-runtime removal — design + impl plan
Brainstormed via superpowers:brainstorming. User decision 12.05.2026:
remove R15 PSR_v1 section entirely (variant B). Conscious rollback of
audited construction from v1.83 (10.05.2026).

Spec: docs/superpowers/specs/2026-05-12-remove-r15-motion-restrictions-design.md
Plan: docs/superpowers/plans/2026-05-12-remove-r15-motion-restrictions.md

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 07:17:19 +03:00
Дмитрий 32135e62d2 docs(spec): roadmap post-Plan 5 birdseye до production launch
Линейная лента Sprint 5 → 6 → 7 → 8 → 9 → soft-launch → public launch.
Учитывает закрытые Sprint 0/Sprint 4 и supplier-линию Plans 1-5.
Birdseye-обзор поверх roadmap-to-production-design.md v1.0.
2026-05-11 19:05:31 +03:00
Дмитрий 51019c5aee docs(plan5): rectify region_mode values 'all'/'whitelist'/'blacklist' → 'include'/'exclude'
Schema CHECK constraint on projects.region_mode accepts только 'include'/'exclude'.
Spec/plan изначально использовали 'all'/'whitelist'/'blacklist' (semantic naming),
что не соответствует БД-схеме. При имплементации Task 3 implementer выбрал
'include'/'exclude' (match schema = source of truth). Propagate-fix:

- plan (2 PHP Rule::in + ~10 payload mentions + 4 TS form defaults)
- spec (§4.2 описание, 3 JSON API examples, §6.4 текст, §7.1 StoreProjectRequest)

Чтобы Task 5+ (UpdateProjectRequest, frontend tasks 7-11) не повторили
плановую ошибку.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 18:40:41 +03:00
Дмитрий 1ca4378d14 docs(specs): Plan 5 (Frontend Projects UI + Backend CRUD) implementation design
Spec для full-stack плана: backend CRUD на projects (POST/PATCH/DELETE/sync/bulk),
frontend ProjectsView с карточками+прогресс-баром, NewProjectDialog с 3 табами
(Site/Call/SMS), polling sync-статуса через setTimeout-recursion + backoff,
schema delta v8.19→v8.20 (projects.archived_at).

Через superpowers:brainstorming skill. 11-13 task'ов по vertical-slice TDD
(паттерн Plan 4). Self-review прошёл — 4 inline-фиксы внесены.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 17:04:07 +03:00
Дмитрий 901cf98281 docs(specs): Plan 4 (Billing + CSV Reconcile + Admin) implementation design
Brainstorming output для Plan 4: активация ступенчатого биллинга
(pricing_tiers/lead_charges никем не читались/писались), резервный CSV-канал
приёма лидов из портала поставщика, Admin UI (pricing-tiers editor +
supplier-prices editor + tenant ChargesTab).

9 разделов: контекст + 8 бизнес-инвариантов + 9 out-of-scope; schema delta
v8.18 → v8.19 (+1 таблица supplier_csv_reconcile_log, +3 колонки
tenants.delivered_in_month/lead_charges.charge_source/supplier_leads.recovered_from_csv_at,
+3 индекса, +2 CHECK); billing flow в RouteSupplierLeadJob (3 новых сервиса
PricingTierResolver/LedgerService/InsufficientBalanceException + dual-balance
prepaid-first логика + bcmath денежная арифметика); monthly reset
(ResetMonthlyCountersCommand + Schedule monthlyOn(1,'00:00') Europe/Moscow);
auto-pause flow (project.is_active=false + email с rate-limit 1/час/tenant);
CSV reconcile (расширение SupplierPortalClient + SupplierCsvParser +
CsvReconcileJob hourly + drift > 5% → email); Admin UI (2 SaaS-admin
view + 1 tab в существующем BillingView); тестовая стратегия (+71 теста)
и 10 AC; ограничения (6 неверифицированных).

Закрывает TODO «Биллинг per Plan 4» в RouteSupplierLeadJob.php:48.
Inherits from Plans 1+2+2.5+2.6+3 (HEAD origin/main = 926fee9).

Self-review applied 5 fixes inline: AC ссылки §3.5 → §7.1; auto-pause UPDATE
через pgsql_supplier BYPASSRLS connection; supplier_id source для
supplier_lead_costs INSERT; bccomp(bcmul()) вместо PHP float compare;
GRANT-policy в db/02_grants.sql, не schema.sql.

7 открытых вопросов с дефолтами в §7.6 для последующего ввода в реестр.

+5 терминов в cspell-words.txt (декрементится / Инкрементится / Подписочный
/ bcdiv / TRUNC) для прохождения lefthook cspell stage.

Парный план (writing-plans output) будет в docs/superpowers/plans/ отдельным
коммитом после согласования spec'а.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 07:56:22 +03:00
Дмитрий b53ee28cf2 docs: brain bootstrap discovery results (Phase 0 of brain extraction)
Captures pre-bootstrap verification: Claude CLI commands availability,
prerequisites (jq/python/git/gitleaks), jq deep-merge behavior, secret
rotation status (DEFERRED), ~/.claude/backups/ leak scope.

Required reading before Phase 1 (brain repo skeleton creation).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 00:39:36 +03:00
Дмитрий 1a265b5a38 docs(specs): Plan 3 (Supplier Sync) implementation design
Brainstorming output: 9-Tasks decomposition в 2 фазы (Discovery + Implementation),
0 schema changes, parent spec 2026-05-10-supplier-integration-design.md.

Архитектурные решения (delegated decision-making у заказчика):
- BLOCKER #6: вариант C (переключение supplier-flow на crm_supplier_worker
  BYPASSRLS-роль из Plan 2.6 #iv 7899071) — закрывает BLOCKER #6 + WARN #2 + WARN #3
  одной правкой, 0 schema bump
- Headless browser: real Playwright через Node.js subprocess (страховка от
  Cloudflare/reCAPTCHA/JS-login/2FA на стороне поставщика в будущем)
- Discovery method: вариант А (Playwright MCP + credentials в .env, явное
  локальное снятие Pravila §6 на одну сессию)

Tasks:
1. Discovery через Playwright MCP (5 HTTP-фиксаций)
2. Spec update v1.0 → v1.1 (§4.4 observed AJAX formats)
3. Switch supplier-flow на pgsql_supplier connection (закрывает BLOCKER #6 + WARN #2/#3)
4. SupplierPortalClient (HTTP-обёртка над rt-*, Redis cache cookie/CSRF)
5. RefreshSupplierSessionJob + PlaywrightBridge (Node subprocess, 6h Redis TTL)
6. SyncSupplierProjectsJob + SupplierQuotaAllocator (20:30 МСК cron, B1/B2/B3 distribution)
7. CleanupInactiveSupplierProjectsJob (Phase A re-activate → B mark → C delete 180d)
8. RetryFailedSupplierJobsCommand (hourly cron + лимит 10 attempts/24h)
9. E2E integration test (Linux CI only, skip на Windows)

Exception hierarchy (3 классa): Auth/Transient/Client + abstract base.
Алерт-каналы: Sentry + email через Unisender Go SMTP relay (без Telegram).
Метрики приёма: Pest >=608/610, Larastan 0 errors, gitleaks 0 leaks.

+JSESSIONID в cspell-words.txt (рядом с PHPSESSID) для будущих spec'ов
session-cookie семантики.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 00:29:12 +03:00
Дмитрий 33fdce8664 docs(viz): §VII regroup + §X Russian/hierarchy spec + plan
Артефакты параллельной Claude-сессии (mode «экономия 0%», 10.05.2026 ночь финал).

Spec (366 строк): две связанные правки в hooks-skills-plugins-map.html:
1. §VII Skills — перегруппировка с 6 функциональных категорий на 5 plugin-based
   групп (4 плагина: superpowers/claude-md/frontend-design/upm + 1 standalone),
   28 skills без потерь.
2. §X interactive map — локализация UI-strings на русский (filter chips, legend,
   sidebar badges, tooltips); sidebar при клике на узел показывает иерархию:
   «За что отвечает» / «Кто руководит» / «Кем руководит» / «Связи»; edge-click
   handler с переходами к источнику/цели.

Plan (1012 строк): пошаговая реализация для executing-plans с TDD-структурой.
Точечные правки одного файла (HTML text + JS refactor + CSS additions).

cspell-words.txt: +6 терминов (lede/tgt/Скил/Sel/overhead/overhead'ный).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-10 23:33:22 +03:00
Дмитрий 5e38ff6d7e docs(viz): connections-graph spec + plan (D3 force-directed карта связей)
Артефакты параллельной Claude-сессии (mode «экономия 0%», 10.05.2026 ночь).

Spec (385 строк): расширение hooks-skills-plugins-map.html новой §X
«Связи — interactive map». Force-directed network через D3.js v7 (CDN),
~50 узлов (плагины + скилы + хук-скрипты + hook events + state-файл +
permissions + Pravila §12 + CLAUDE.md), 52 ребра. Vintage-blueprint
aesthetic. Drag/click/hover/category filters/reset.

Plan (1246 строк): пошаговая реализация для executing-plans с TDD-структурой.

cspell-words.txt: +3 термина (диспатчу/скилы/ребёр).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-10 23:31:44 +03:00
Дмитрий 67cb2cc946 docs(superpowers): economy-mode hook bypass closure spec + plan
6-component architecture (permissions block + 5 hooks) closing 8 critical/high
bypass paths: settings disable (H1), hook script edit (H2), prompt injection
(H4), state file delete (H6), subagent inheritance (H7), PostCompact loss
(H8), retry exhaustion (H9), verifier endpoint failure (H10), tool output
spoofing (H12), no-claim bypass (H13).

End-of-prompt parsing for "экономия N%". Shared state file in $TEMP.
Sonnet 4.6 verifier on Stop with decision:"block" + max 3 retry → escalate.

Spec: 964 lines, 12 sections.
Plan: 7 stages with TDD per task.
Runtime cost: ~\$7-14/month.

Stage 0 ratchet verified: auto-mode classifier blocks subagent Write on hook
scripts AND Bash heredoc bypass on settings.json.

Also adds 4 cspell vocabulary terms (парсингом/промпт/Mojibake/sed) used
in the new spec.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-10 21:39:23 +03:00
Дмитрий 3f463f48ea docs(specs): close all 7 open questions in supplier integration design
Q1 SMS validation: B2 = (sender, keyword), B3 = sender only; B1 not available
Q2 Supplier pricing: фиксированная цена за лид
Q3 Liderra billing: 7-tier volume pricing, monthly reset (config in admin)
Q4 Geo filter: MVP, union at supplier + filter on our side
Q5 Webhook auth: defense-in-depth (IP allowlist + secret token in URL)
Q6 Cookie/CSRF refresh: hourly headless Playwright cron + reactive on 401/403
Q7 supplier_project TTL: immediate disable, delete after 180 days no activity

cspell-words.txt: +геофильтр, логинится, encrypter, PHPSESSID

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-10 11:39:29 +03:00
Дмитрий ac09603181 docs(specs): supplier integration design (Лидерра ↔ crm.bp-gr.ru)
Captures brainstorming output for two-way integration:
- Sharing model: один supplier-лид → много deal-копий клиентам Лидерры
- 3 supplier-проекта на источник (B1/B2/B3), shared между клиентами
- Dynamic limit adjustment через 20:30 МСК cron + AJAX rt-project-update
- Quota distribution Total/3 с приоритетом B1→B2 на остатке
- Instant FIFO routing по дате создания проекта клиента
- Резервирование обоих направлений: pending-changes queue + CSV reconciliation

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-10 11:02:19 +03:00
Дмитрий 2a6f0289db docs(spec): Sprint 6 Post-MVP backend design (Reports + Notifications + AdminTenantDetail) 2026-05-10 09:13:45 +03:00
Дмитрий 8c6374d278 docs(spec-roadmap): fix broken link to memory/project_state.md (outside repo)
lychee pre-push hook поймал invalid markdown link на memory/project_state.md —
файл живёт в C:\Users\Administrator\.claude\projects\... (Claude auto-memory),
не в репозитории. Заменено на plain-text упоминание.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-10 04:12:58 +03:00
Дмитрий 823daf4f9f docs(plan-sprint4): implementation plan «Audit tail» + revised spec scope
Sprint 4 — закрытие 3 оставшихся audit O-* пунктов:
- Phase A: O-perf-04 keyset pagination в DealController::index
- Phase B (1+2+3): O-refactor-04 хвост, split 8 Vue-компонентов >300 строк
- Phase C: O-refactor-06 dead-code detection через rollup-plugin-visualizer + knip

Spec ревизия: Sprint 4 уменьшен с 8 до 3 пунктов после факт-чека —
O-perf-07/O-refactor-05/O-refactor-07/O-stack-02/O-stack-03 уже закрыты
в Sprint 1–2 (Sprint 1 ESLint vuetify rule, Sprint 2 Phase A: Pest browser
scaffold, infection mutation, lazy-loading, Larastan cache; CLAUDE.md
header фактически 30 строк после 5b13c95 changelog extraction).

Финальная регрессия: Pest 419+ / Vitest 430+ / Larastan + ESLint + vue-tsc 0.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-10 03:57:46 +03:00
Дмитрий 77b018dff8 docs(spec-roadmap): дизайн roadmap'а до production — 3-track структура (A/B/C)
Покрывает категории A (audit-хвосты), B (Phase 3 tooling), C (Post-MVP backend),
D (Б-1-зависимые фичи), E (production deploy в YC). Категория F (юр. тексты) —
external; G (push 18 коммитов) — Sprint 0 precondition.

Двухдорожечная структура:
- Track A (Sprint 4–6): не зависит от Б-1, стартует сразу после push
- Track B (Sprint 7–9): после получения реквизитов ООО — YC infra + CI/CD + SSO + лендинг + hardening + soft-launch

Definition of done «production launch» в §1, per-sprint acceptance в §5,
9 рисков с mitigations в §6, 5 open questions для будущей детализации в §7.

Базовый HEAD: 6c2f0ce (после Sprint 3 Phase C).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-10 03:51:05 +03:00
Дмитрий 42b3f3f9e4 docs(spec-sprint2): дизайн Спринта 2 «Modernization» — 12 O-* находок
Scope: 8 O-stack + 2 O-perf + 2 O-refactor (low/medium risk, без архитектурных
рефакторингов). Default-выборы для design-решений зафиксированы в spec'е.

4 фазы: A.Backend (Pest 4 browser + mutation + Laravel 13 lazy + Larastan cache)
→ B.Frontend (Vue 3.5 + Vuetify 3.12 + lazy-imports + ESLint check)
→ C.Docs (Google Fonts + CLAUDE.md §0 reorg + FD plugin checklist)
→ D.Hygiene (dead-code report).

Не входит — 6 Sprint 3 пунктов (high risk, R0.6 hard-стопы).

Бюджет: 5-6 часов агентов.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-09 18:51:55 +03:00
Дмитрий e2de8bf8a2 docs(narrative): sync versions + Histoire 21/43 + cross-refs (audit P1-01/03/06/08 + P2-03 + post-A)
Phase D Спринта 1 «Hygiene». Закрытие аудита 2026-05-09 (b6ae8dd):
- P1-01: README.md обновлён (CLAUDE.md ссылка с 28→29 инструментов и 5→6 уровней;
  Tooling v1.0→v1.10; Pravila v1.2→v1.6; PSR_v1 v1.3 добавлен; schema v8.5→v8.11
  (56 базовых + 12 партиций / 97 индексов / 38 RLS / 5 функций / 13 триггеров)).
- P1-03: CLAUDE.md Histoire 21/28 → 21/43 (заменено все вхождения, включая §0 и §3.3).
- P1-06: Pravila §13.9 cross-ref на Plugin_stack_rules_v1 теперь с (v1.3).
- P1-08: Tooling §2.1 п.7 Stylelint раздел дополнен версией stylelint-config-standard ^40.0.0.
- P2-03: CLAUDE.md F-K cross-link на Plugin_stack_rules_v1.md#история-версий.
- post-A: метрики schema в CLAUDE.md синхронизированы до v8.11 (97 / 38).

Также фикс битой ссылки в spec'е Sprint 1 (lychee 1 error → 0): относительный путь
до Plugin_stack_rules_v1.md из docs/superpowers/specs/ исправлен на ../../

Bump версий:
- CLAUDE.md v1.81 → v1.82
- Pravila v1.6 → v1.7
- Tooling Прил. Н v1.10 → v1.11

Все правки CLAUDE.md/Pravila/Tooling — через claude-md-management:claude-md-improver
(CLAUDE.md §5 п.10). README.md и spec — обычные правки.

lychee: 0 errors. markdownlint: 0 errors. cspell на web/v8/* — out-of-scope.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-09 18:36:36 +03:00
Дмитрий 08bbe4d9c8 docs(spec-sprint1): дизайн Спринта 1 «Hygiene» исправления аудита 2026-05-09
Spec через superpowers:brainstorming. Scope: 22 правки + 3 записи в реестр:
- 3 P0 (RLS impersonation_tokens, SetTenantContext middleware, format:sql:check Windows)
- 10 P1 (P1-10/P1-11 → реестр)
- 3 P2 (test password, орфо, F-K расшифровка)
- 6 low-risk O-* (2 FK indices, password rules trait, ESLint anti-vuetify, npm CI, font-display docs)

6 фаз / 6 коммитов: A.DB → B.Backend → C.Configs → D.Docs(narrative) → E.Docs(handoff) → F.Registry.
Зависимости: B/D зависят от A (CHANGELOG schema метрики).
Бюджет: 2.5-3.5 часа агентов в субагентном режиме.

CLAUDE.md/Pravila/Tooling правки в Фазе D — обязательно через
claude-md-management:claude-md-improver (CLAUDE.md §5 п.10).

Не входит: Спринт 2 (modernization) и Спринт 3 (big refactors) — отдельные spec'и.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-09 17:51:16 +03:00
Дмитрий b0343014db docs(spec-audit): пересмотр под Plugin_stack_rules_v1 v1.3 — spec v1.0 → v1.1
§12 «Плагины и MCP» переписана с полным inventory и R-обоснованиями:
- 12.1 Superpowers-skills (6 применяемых + 8 из карты §12.2 не релевантны)
- 12.2 Встроенные плагины: FD plugin НЕ призывается (R10+R13: аудит ≠ дизайн); claude-md-management вне DoD аудита
- 12.3 Внешние плагины (R10): simplify/security-review/review/init/ui-ux-pro-max — только по явному /команде, не призываются
- 12.4 MCP: laravel-boost (D2/D4), playwright опционально (D3), github не используется
- 12.5 CLI-тулы — не плагины, регулируются Tooling Прил. Н

В §3 расширен P0 stack-нарушениями (Pravila §13.9 hard-link на R10).
В §6 D1 включает Pravila/Plugin_stack_rules_v1/Tooling в зону аудита;
D3 проверяет R11 иерархию источников истины UI/UX;
D5 проверяет R6 стек-фильтр Vue+Vuetify и R6.1 Forest.
В §7 добавлен общий R-CHECKS блок поверх P/O чеклиста.
В §10 DoD self-review проверяет «0 R-нарушений в самом отчёте»;
code review мета-проверяет соблюдение Plugin_stack_rules_v1 v1.3.
В §13 добавлены риски misuse FD plugin / priority chain / правок Pravila.
Новая §15 — карта соответствия Plugin_stack_rules_v1 v1.3 → spec
(13 R-правил + Pravila §12/§13.9 + CLAUDE.md §1/§5 п.10/п.11 + Tooling Прил. Н).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-09 17:01:36 +03:00
Дмитрий 3d936d0da8 docs(spec-audit): добавлен дизайн подробного аудита проекта на 2026-05-09
Spec через superpowers:brainstorming. Гибридный подход (тулы + субагенты):
4 этапа (sweep тулами → 6 семантических субагентов → консолидация → self-review),
P0/P1/P2 для дефектов и O-perf/O-refactor/O-stack для возможностей улучшения.
Реализация — отдельным implementation plan через superpowers:writing-plans.

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