Commit Graph

7 Commits

Author SHA1 Message Date
Semih
230ef63433 docs: mark super_panel_reader role as done
Role created on the Sase.tr standalone Postgres with SELECT-only
privileges on schema public + ALTER DEFAULT PRIVILEGES so future
tables inherit the grant. Panel-web DATABASE_URL_SASE_RO switched to
this role; panel redeployed; UPDATE/INSERT/DELETE rejected with
'permission denied' as expected; SELECT count(*) FROM users still
works.

Process: temporarily exposed sase-postgres on port 54320, ran the
SQL via psql, then closed the public port. Password generated with
openssl rand -hex 24 (lives only in Coolify env).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-18 16:46:22 +03:00
Semih
d0f0cadf51 docs: refresh teknikborc + add RUNBOOK.md
Phase 7 (user mgmt, all of A–F) and Phase 8 (VIN observability Faz 1–4
+ regression alert) are shipped. Teknikborc previously listed many of
those as open — clean it up and section the remaining work into:

- Phase 7 still-open items (support actions, KVKK, sessions, bulk ops,
  automation) — explicitly listed at top
- Phase 8 still-open items (alert config UI, vin_anomaly_log table,
  pointing to RUNBOOK.md for documentation)
- PRD ↔ Sase.tr reality gaps (EFT killed, B2B doesn't exist, etc.)
- Defansif teknik borç (super_panel_reader rol, prisma db push
  multi-replica risk, pre-existing Sase.tr typecheck errors)
- Sase.tr-side work (Faz 0+1 PostHog events; notes that the backend
  VIN telemetry was tried and reverted because query_logs already has
  everything we need)
- BIP open work (P1 fix, eval golden set, pattern bundle, embedding
  similarity, multi-project routing)
- Minor / low priority polish items

RUNBOOK.md is new: founder operations guide. Sections:
- Telegram alert → response matrix (success drop, regression, p95
  spike, volume drop/spike, timeout dominance)
- Founder daily review walkthrough (the / "Bugün" page sequence)
- Pipeline/cron health (job cadences + how to check)
- Coolify quick reference (app UUIDs + deploy command)
- User report → fix call chain
- Security model summary
- Local dev + new endpoint scaffolding steps

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-18 14:27:18 +03:00
Semih
5b26d10485 feat(sase): founder notes — Phase A of user mutations
Panel-side only — first writable feature on the Sase user detail page.
Notes are stored in the panel database (sase_user_notes); the spoke is
never touched (KVKK minimize).

Model
- SaseUserNote { id, saseUserId, authorUserId, body, pinned, createdAt }
- Index on (saseUserId, pinned, createdAt) for the default render order

API
- GET  /api/sase/users/[id]/notes — list (pinned first, then newest)
- POST /api/sase/users/[id]/notes — { body, pinned } create (audit'li)
- PATCH/DELETE /api/sase/notes/[noteId] — toggle pin / hard delete

UI
- New "Notlar" tab on user detail. Textarea + pinned checkbox + submit;
  list shows TR-localized timestamps, per-row pin/unpin and delete.

Schema sync
- package.json `start` now runs `prisma db push --skip-generate` before
  `next start`. Panel uses db-push style (no migrations dir); this lets
  the new table land on next deploy without a separate manual step.
  Future destructive changes will require a smarter migration approach.

teknikborc.md updated: super_panel_reader role still needs to be created
on the new sase-postgres (current panel uses sase superuser).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-18 09:32:48 +03:00
Semih
0b31685e95 feat(sase): user management Phase 7a — listing + detail (RO)
Adım 1 — User listesi sayfası
- Extend Sase RO Prisma schema: Plan, Brand, UserBrand, BankAccount, Payment, QueryLog
- listUsers() + listPlans() repo with filter/sort/page in apps/web/src/lib/sase/users.ts
- /projects/sase/users — TanStack-free server-rendered table with URL-param filters
  (plan multi-select, status, activity preset, search) + pager
- Sase landing "Users →" link

Adım 2 — User detay 360°
- /projects/sase/users/[id] — header (masked email + audit-logged reveal button)
  + 5 tabs: Özet · Subscription & Billing · Kullanım · Aktivite · Audit
- Usage stats: 30d/90d/lifetime queries, success rate, avg response, daily sparkline,
  brand/source distribution, top VINs
- Timeline: merged signup + subscriptions + payments + recent queries
- User-scoped audit trail (AuditLog endpoint LIKE filter)
- POST /api/sase/users/[id]/reveal-email — audit-logged full email reveal

teknikborc.md — Phase 7 PRD vs Sase.tr şeması gap'leri kaydedildi
(EFT yok, B2B yok, API keys/webhooks yok, vb.)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-18 00:42:59 +03:00
Semih
7edbf1d7ad docs: teknikborc — insight pipeline next-steps backlog
8-item insight category covering pilot success closure, push-notification
gap, Sase.tr Faz 0+1 prerequisites that unblock 9 dormant tag rules, eval
golden set requirement, and deferred volume-dependent work (bundle mode,
embedding similarity, multi-project routing).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 09:53:36 +00:00
Semih
608ab0e6c7 chore: remove teknikborc.md 2026-05-13 20:36:34 +00:00
Semih
7c8330e315 docs: technical debt registry — deferred items, hacks, cleanup triggers 2026-05-13 20:33:24 +00:00