Files
sase.tr/.fusion/memory/team-charter.md
Semih c72f063a25
Some checks failed
CI / Lint, Typecheck, Test & Build (push) Has been cancelled
fusion: dev-branch autonomy charter
Wire the autonomous engineering pipeline to operate on dev branch with
no human deploy gate. Pushes to git.semih.ai/root/sase.tr.git dev
trigger the Coolify webhook that redeploys https://dev.sase.tr — the
operator pulls signal from the live URL instead of approving every
merge.

Production (main → sase.tr) stays human-driven: agents never push to
main directly; promotion is an explicit operator decision.

Critical-path policy on dev relaxes for auth/payments/billing/
subscription so the loop can ship fixes there with a regression test;
migrations + dep/config changes still need human ack on dev because
they desync persisted/shared state.

Adds team-charter.md (dev/main topology, severity matrix, routing
rules, council protocol, loop detection) and MEMORY.md updates that
agents consult on every triage. Also gitignore'd fusion's runtime
SQLite/task state so .fusion/agents and .fusion/memory remain the
only authored docs in the tree.
2026-05-09 16:41:04 +00:00

9.2 KiB
Raw Blame History

Team Charter — sase.tr Autonomous Engineering Pipeline

This file defines who does what, how decisions move, and what triggers human escalation. Every agent reads this before acting on an incident.

Branch & Deploy Topology

sase has two deploy environments, both wired through Coolify (cool.semih.ai):

Environment Branch URL Coolify resource Deploy trigger
Staging dev https://dev.sase.tr jwgwkg4ssks80os0wswckgcs Auto on push to dev (Gitea webhook)
Production main https://sase.tr ro48g8ooo0gk4kskog0oo8s8 Auto on push to main (Gitea webhook)

Canonical git remote: https://git.semih.ai/root/sase.tr.git (Gitea, root owner). github.com/semihyesilyurt/sase.tr is a personal mirror — agents do NOT push there.

Autonomy Levels by Branch

dev branch (staging) — full autonomy, no human gate:

  • Agents auto-merge to dev when pre-merge workflow steps pass (lint + typecheck + tests + QA Lead approval).
  • Push to origin/dev triggers Coolify auto-deploy → user observes the live result on https://dev.sase.tr.
  • No deploy notification spam. The user pulls signal from dev.sase.tr directly.
  • Critical-path policy is RELAXED on dev: agents may modify auth/payments/subscription/billing files when QA Lead has a working regression test. Migrations still require human ack (irreversible schema changes, even on dev, can break shared staging data).

main branch (production) — protected:

  • Agents NEVER push directly to main. Promotion is human-driven (git merge dev + git push origin main).
  • Critical-path bans (auth/payments/subscription/billing/migrations) apply STRICTLY on main: human approval required regardless of test coverage.

Roster

Agent ID Reports to Role Primary surface
CEO agent-f1516562 strategic P0 council, cross-dept conflicts, prod-promotion approvals
CTO agent-403a540b CEO technical authority P1 technical incidents, owns BE/FE/QA
CPO 🎯 agent-851fc17d CEO product authority PostHog funnel, UX issues, owns Designer
Designer 🎨 agent-08d09be5 CPO UX spec author UI/UX bugs, copy revisions
QA Lead 🧪 agent-9e7809e2 CTO reviewer Pre-merge gate, post-deploy verification on dev.sase.tr
Backend Eng ⚙️ agent-b5f64135 CTO executor NestJS API, Drizzle/Postgres, Redis, BullMQ workers
Frontend Eng 💻 agent-c5dd19c0 CTO executor React/Vite/TanStack, Faro RUM

Stack Reality (sase.tr)

  • Backend: NestJS 10.4 + Drizzle ORM 0.41 + PostgreSQL 17 + Redis 7.4 + BullMQ + Better Auth 1.2
  • Frontend: Vite 6.3 + React 19 + TanStack Router 1.120 + TanStack Query 5 + Zustand 5 + Tailwind 4 + shadcn/ui
  • Tests: Vitest 3 + Playwright 1.50
  • Lint: Biome (2-space, double quotes, semicolons, trailing commas)
  • Deploy: Coolify on cool.semih.ai. Compose-based builds. Push to dev/main on git.semih.ai → webhook → redeploy.
  • Observability: OTEL → Tempo/Loki/Prometheus, Grafana Faro for RUM, PostHog for product analytics
  • Code search tool: ast-grep (already installed globally) — agents prefer structural search over plain text grep

Severity Matrix

Severity Definition Default routing Council? Auto-merge to dev?
P0 Production down on sase.tr, payment broken, auth broken, data loss, security breach CEO + CTO + CPO council Yes (30min SLA) Yes (after council vote)
P1 Major feature broken, >1% user impact, P95 regression >50%, funnel drop >10pp CTO or CPO direct No Yes
P2 Single-feature regression, edge-case bug, copy/UX issue Direct to BE/FE/Designer per domain No Yes
P3 Cosmetic, info-only Memory log, no task No N/A

Critical Paths

On dev — relaxed

Auto-fix permitted with QA Lead regression test:

  • apps/api/src/modules/auth/**
  • apps/api/src/modules/payments/**
  • apps/api/src/modules/billing/**
  • apps/api/src/modules/subscription/**
  • apps/web/src/routes/_auth/**, /dashboard/subscription/**, /dashboard/billing/**

On dev — still gated (human ack required)

  • Any file under apps/api/src/database/schema/**
  • Any file under apps/api/src/database/migrations/**
  • pnpm-lock.yaml (dep changes need explicit owner approval)
  • package.json (deps + scripts)
  • ecosystem.config.js (PM2 — though Coolify owns deploy now, leave gated)

On main — strictly gated

Everything in the dev "still gated" list, PLUS the auth/payments/billing/subscription paths. Agent must never push to main without human ack.

Routing Rules

When Triage Agent classifies a signal, the domain → owner map:

Signal source Default classification Default owner
Tempo P95 latency on /api/vehicles/decode technical/perf Backend Eng (CTO ack)
Tempo error rate on any apps/api/src/** endpoint technical/error Backend Eng (CTO ack)
Loki error log spike with stack trace technical/error Backend Eng
Sentry issue tagged frontend technical/frontend Frontend Eng
Sentry issue tagged backend technical/backend Backend Eng
PostHog funnel ratio drop product/funnel CPO
PostHog vin_decode_error rate spike technical/integration Backend Eng (CTO ack)
Faro RUM web-vitals regression technical/perf-frontend Frontend Eng
Faro user.action error events product/UX CPO → Designer
Slack /sase-feedback user complaint user-feedback CPO triage
Worker job failure spike (BullMQ) technical/worker Backend Eng
OTEL/Faro instrumentation gap observability Backend Eng or Frontend Eng

Workflow on dev (default)

1. Telemetry signal → Triage task (column=triage, base branch=dev)
2. Triage Agent classifies + delegates per matrix above
3. Engineer agent opens worktree from origin/dev
4. Engineer writes failing regression test → fix → passes
5. Pre-merge workflow steps run:
   - pnpm lint
   - pnpm typecheck
   - pnpm test (Vitest)
   - QA Lead reviews test scenario + edge cases
6. All green → auto-merge to origin/dev (squash)
7. Push triggers Coolify webhook → dev.sase.tr redeploy
8. Triage Agent runs post-deploy verification: 30 min later, query the
   incident's metric. If recovered → memory append fix-pattern. If not →
   reopen task with "regression survived deploy" note.

Workflow on main (promotion)

1. Operator decides dev → main promotion is desired (human-driven)
2. Operator runs: git checkout main && git merge dev && git push origin main
3. Coolify webhook → sase.tr redeploy
4. Optional: agents do not act on main except for documentation backfills

Council Protocol (P0 Only)

  1. Triage Agent opens task with column=triage, status=awaiting-approval, metadata.kind=council, base branch=dev
  2. Adds CEO, CTO, CPO as inbox-pinged via fn_send_message
  3. Each member writes their decision to fn_task_document_write({key: "council_{role}", ...}) within 30 minutes (NB: keys cannot contain slashes — use underscores)
  4. CEO aggregates and writes council_ceo_final
  5. If proceed → Triage moves task to column=todo and delegates per the routing matrix; full dev-autonomy applies from there
  6. If escalate-to-human → CEO sends fn_send_message to user with summary

Dedup & Rate Limits

  • Fingerprint: hash(signal_type + primary_dimension + severity_bucket)
  • 4-hour rolling window — same fingerprint adds to existing task's log instead of opening new one
  • Rate limit: max 5 incident-tasks/hour, max 20/day. Exceeded → all overflow incidents merged into single "telemetry storm" task assigned to CTO for batch review

Loop Detection

  • Same task fingerprint reopened 3+ times within 7 days → freeze auto-flow, escalate to CEO with "root-cause investigation needed" memo (auto-merge disabled on the incident's surface until human reviews)
  • Same file modified 3+ times in 24h by different executors → freeze, escalate to CTO

Quiet Hours

  • Configurable per project. Default: P2/P3 incidents queue between 23:0007:00 Europe/Istanbul; P0/P1 always processed
  • Setting key: triage.quiet_hours = { start: "23:00", end: "07:00", tz: "Europe/Istanbul" }

Human Inbox Triggers

Send fn_send_message({to: "user", ...}) ONLY for:

  • P0 council escalate-to-human verdict (CEO)
  • Critical-path on dev: migration / dep change / config change requested (CTO)
  • Loop detection / token-budget alarm (System)
  • Production promotion request — when CTO believes a dev-validated fix should ship to main (sense check before main push)

Do NOT spam the inbox for routine status. Routine updates go into the task's own log via fn_task_log. Deploy-gate notifications are NOT sent — the user observes dev.sase.tr directly.

Memory Namespaces

  • fix-patterns — completed fix recipes; consulted on triage to find prior solutions
  • weekly-review — CEO Monday summary
  • ux-patterns — CPO/Designer decisions on UX trade-offs
  • regression-history — fixes that themselves regressed; loop-detection input
  • vendor-incidents — external dependency outages (iyzico, EMEX, PL24, PartsCatalogs)
  • dev-deploys — log of agent-driven dev pushes; CEO weekly-review reads this to spot patterns