Platform Constitution

7 неизменных правил платформы

Конституция платформы

7 обязательных политик для любого изменения в системе. Никаких исключений. Эти правила обеспечивают чистоту архитектуры и предсказуемость развития платформы.

Нарушение конституции = баг в архитектуре. Требуется немедленное исправление.

Seven Policies (A-G)

A

Policy A: No Garbage

Никакого хардкода, если БД может это хранить

No new hardcode if DB can hold it
No second execution path
No test-only prod branches
No dumping-ground files
No zombie state
TEXT = 'Привет, я бот!'
runtime_policy.copilot_greeting
if user_id == 123:
if user.tier == 'owner':
B

Policy B: Centralized Truth

Вся правда в БД. Python = мост. n8n = исполнитель

Process/policy/agent/workflow truth in DB
Execution truth in process_runs/process_run_steps/llm_calls
Python = bridge only
n8n = execution plane only
agent_config = {...} in Python
agent_profile table
process_def in code
processes table
C

Policy C: One Production Path

Один production путь. Seed = только диагностика

One live path
Seed/smoke = diagnostic only
No test_mode
Synthetic proof is not release evidence
if TEST_MODE: return mock
Single path with observability
pytest passed = ready
Live evidence in production
D

Policy D: Observable by Default

Каждый процесс: run + steps + llm_calls + board

Every significant process: process_run + steps
llm_calls linkage
Error details
Board visibility
process executes silently
process_run with steps + llm_calls
error swallowed
error logged with context
E

Policy E: Draft Before Deploy

Новые агенты/процессы: draft → review → approval → deploy

New agents/processes/workflows: draft first
Review required
Approval before deploy
No auto-deploy for critical things
INSERT agent, deploy immediately
status='draft' → review → approval
CREATE PROCESS, activate
process.status='draft' → human approval
F

Policy F: Honest Readiness

Release truth = только live evidence

Schema-ready != product-ready
Release truth = live evidence only
No synthetic evidence
Table created = feature ready
Live process runs with real users
Demo passed = release
Production evidence over time
G

Policy G: Paper Before Money

Trading: сначала paper mode. LLM не двигает капитал

Trading/treasury: paper first
LLM has no right to move capital
Human approval required for financial actions
LLM calls execute_trade()
LLM proposes, human approves
Auto-deploy trading strategy
Paper mode for 30 days minimum

Применение политик

Добавить новый текст в ботPolicy A

Вынести в runtime_policy

Создать нового агентаPolicy E

draft → review → approve

Запустить новый процессPolicy D

Добавить observability

Интегрировать торговлюPolicy G

Paper mode first

Релиз новой фичиPolicy F

Live evidence required

Определить конфиг процессаPolicy B

Хранить в processes table

Написать тестыPolicy C

Tests ≠ release evidence

Типичные нарушения

НарушениеPoliciesFixSeverity
Hardcoded prompt in Python
AB
Move to runtime_policy_jsonhigh
Agent created without review
E
Set status='draft', require approvalhigh
Process without logging
D
Add process_run + steps trackingmedium
LLM directly executes trades
G
LLM proposes, human approvescritical
Feature released after schema change
F
Collect live evidence firstmedium
test_mode flag in production
C
Remove test_mode, single pathhigh

Audit Checklist

Policy A

  • No hardcoded texts
  • No hardcoded limits
  • No zombie code

Policy B

  • All agents in DB
  • All processes in DB
  • All policies in DB

Policy C

  • Single execution path
  • No test_mode
  • No synthetic tests as proof

Policy D

  • process_runs logged
  • steps tracked
  • llm_calls linked
  • errors visible

Policy E

  • New agents drafted
  • Review process exists
  • Approval workflow

Policy F

  • Live evidence collected
  • Schema != product ready

Policy G

  • Paper mode for trading
  • Human approval for money
  • LLM no direct capital access

Quick Reference

DO

  • • Хранить тексты в runtime_policy
  • • Логировать все процессы
  • • Делать review перед deploy
  • • Тестировать на live данных
  • • Paper mode для финансов
  • • Single execution path
  • • Live evidence для release

DON'T

  • • Хардкодить тексты в Python
  • • Создавать второй путь исполнения
  • • Auto-deploy критических изменений
  • • Считать schema-ready = product-ready
  • • Давать LLM право двигать капитал
  • • Использовать test_mode в проде
  • • Synthetic tests как release evidence

Decision Tree

Новое изменение в платформе?
    │
    ├─ Это текст/лимит/промпт? ───────────────────────→ Policy A (DB)
    │
    ├─ Это новый агент/процесс/workflow? ────────────→ Policy E (Draft)
    │
    ├─ Это финансовое действие? ─────────────────────→ Policy G (Paper)
    │
    ├─ Это релиз? ───────────────────────────────────→ Policy F (Evidence)
    │
    ├─ Это новый код? ───────────────────────────────→ Policy D (Observe)
    │
    └─ Это тест? ────────────────────────────────────→ Policy C (Single Path)
← Wiki Home
Runtime Policy
Process System