# Yearning v4 Beta
> Yearning v4 公测版官方文档 · 基于 AI Agentic 的新一代企业级 SQL 审核平台
## Others
- [License & Security Policy](/en/about/license.md): Yearning has been actively maintained as open-source software since 2017, helping engineering and DBA teams govern production database changes safely.
- [Datasources & Target Database Grant SQL](/en/admin/datasources-and-grants.md): Yearning v4 separates Read-Only (review & query) credentials from Execution (execution) credentials. Provision dedicated accounts on target databases before registering them in /admin/datasources.
- [15-Minute First-Boot Setup Guide](/en/admin/first-time-setup.md): After signing in as admin, follow this exact 6-step dependency order so your engineering team can submit their first governed change order and read-only query without hitting 1001 VALIDATION_FAILED: Add an AI Provider (/admin/review-engine/providers): Configure an HTTPS OpenAI-compatible cloud endpoint (default anonymized profile) or an internal RFC1918 vLLM/Ollama endpoint (san profile for SAN-2B/SAN-4B/SQL-Audit-Nano), run Test Connection, and enable it.Enable Built-in Skills & Create a Rule Set (/admin/review-engine/skills -> /admin/rule-sets): Enable baseline skills (builtin.dml-require-where, builtin.forbid-truncate, builtin.ddl-require-primary-key, builtin.max-affect-rows) and combine them into a published Rule Set. Every change_review flow requires a non-empty rule_set_id.Register Target Datasources (/admin/datasources): Create dedicated read-only (yearning_ro) and execution (yearning_exec) DB accounts (see Datasources & DB Grant SQL), fill mandatory version_constraint (e.g. >=8.0,<9.0), and verify connection + identity fingerprint.Create Users & Approval/Query Flows (/admin/users -> /admin/flows): Configure change_review (1..N serial datasource stages, 1..10 approval steps, executors) and query_access (datasources, optional can_export, sensitive column masking).Grant Flows via Permission Groups (/admin/permission-groups): Add developers/DBAs to groups and attach the authorized flows. Note that built-in admin does not implicitly override frozen business flows.Configure public_base_url & Notifications (/admin/settings/general & /notifications): Set your public HTTPS URL (used for OIDC callbacks and order links) and configure Email / DingTalk / Feishu / Slack rules.
- [Datasources, SSO, AI Budget & Notifications](/en/admin/governance.md): Platform administrators (builtin_admin and role = 'admin') govern all /admin/* configuration modules while remaining strictly barred from overriding frozen business orders (admin_is_not_business_override = true).
- [AI Providers, 48 Built-In Audit Rules & Knowledge Base](/en/admin/review-engine.md)
- [Scoped Database AI Assistant (4.0 Core Feature)](/en/features/ai-assistant.md): The Database AI Assistant is a flagship Yearning v4.0 capability built directly into the authenticated workspace (bottom-right dots-02 floating trigger and /assistant view). It focuses strictly on three database workflows: platform usage guidance, metadata-grounded natural-language SQL generation, and SQL analysis & optimization. Unlike general-purpose chat shells, the assistant enforces four architectural guardrails: per-turn in-memory zero-leak anonymization, dialect AST structured restoration, zero direct SQL execution, and a mandatory two-stage bridge into formal AI Precheck and multi-stage Approval.
- [Zero-Leak AI SQL Precheck & Submission Gate](/en/features/ai-precheck.md): Every DDL or DML change order in Yearning v4 must pass a two-stage Deterministic AST/Rule Check + AI Review Inspection before submission. Only runs that reach ready status with zero blocking findings pass the Submission Gate.
- [Frozen Approvals & In-Process gh-ost Execution](/en/features/change-orders.md): Yearning v4 enforces Freeze at Submission across every multi-stage change order so SQL payloads, review evidence, approvers, and executors cannot be tampered with or bypassed.
- [Governed Read-Only Query Workspace](/en/features/query-workspace.md): The Yearning v4 Query Workspace (/query) delivers audited, read-only database access without distributing plaintext database credentials.
- [Top SQL Performance Diagnostics (Admin /admin/diagnostics)](/en/features/sql-diagnostics.md): SQL Performance Diagnostics is Yearning v4.0's non-intrusive slow-SQL governance loop for platform administrators. It strictly reuses existing read-only query/review connection pools (never falling back to execution credentials, never installing extensions, never modifying database configuration, and never resetting statistics counters).
- [Binlog-Free Cross-Engine Automatic Rollback](/en/features/sql-rollback.md): Yearning v4 eliminates legacy MySQL ROW Binlog scraping and unapproved instant rollbacks, introducing Binlog/WAL-free AST inverse generation + in-transaction before-image capture across both MySQL-compatible and PostgreSQL-compatible engines.
- [Architecture & Privacy Pipeline](/en/guide/architecture.md): Yearning v4 runs as a stateless Go modular monolith backed by PostgreSQL for shared state, execution leases, scheduled jobs, transactional outbox notifications, and multi-replica realtime SSE fan-out, with zero RPC dependencies.
- [Docker Compose Quick Start](/en/guide/quick-start.md): Yearning v4 ships an all-in-one docker-compose.yml that bootstraps PostgreSQL 18, internal PostgreSQL TLS certificates, a 6-purpose AES-256-GCM AEAD keyring, automated versioned schema migrations, and the Yearning v4 control plane with embedded React UI in a single command.
- [Enterprise Security & AI Trust Architecture](/en/guide/security-and-ai-trust.md): Enterprise teams adopting AI for production database governance ask three decisive questions: 1) How do you guarantee schema and production data never leak to LLMs? 2) How do you guarantee AI is strictly non-intrusive? 3) How do you prevent AI hallucinations from blocking valid releases or generating broken SQL? Yearning v4 enforces every guarantee in Go runtime code rather than prompt wishes.
- [Overview & What Changed in Yearning v4](/en/guide/what-is-yearning.md): Yearning v4 is a ground-up rebuild of the open-source Yearning platform as an AI Agentic SQL Review & Database Governance Platform. Built as a single-binary Go modular monolith paired with a React 19 + TypeScript + shadcn/ui web workspace and a PostgreSQL metadata plane, Yearning v4 retires legacy RPC services and MySQL metadata storage while putting an autonomous metadata-probing AI Agentic SQL Review Engine and a Database AI Assistant at the heart of frozen multi-stage governance, in-process gh-ost online DDL, binlog-free cross-engine rollback, governed read-only queries, and Top-SQL performance diagnostics.
- [AI Agent Skill & OpenAPI v4](/en/integration/agent-skill-openapi.md): Yearning v4 ships a complete OpenAPI 3 specification (api/openapi/yearning-v4.yaml), a realtime SSE event bus (GET /api/v4/events/stream), and a zero-dependency yearning Agent Skill (skills/yearning/). AI coding assistants (Claude Code, Codex CLI, Cursor, Antigravity) integrate directly with /api/v4/* under full RBAC, double-submit CSRF, Idempotency-Key, If-Match, and Submission Gate enforcement without deploying a standalone MCP server.
- [Binary & Standalone PostgreSQL Deployment](/en/operations/binary-deploy.md): Deploy the single yearning binary directly with systemd against an existing HA PostgreSQL 14–18 cluster (RDS / Patroni / self-managed).
- [CLI Commands & Environment Reference](/en/operations/cli-and-config.md): Yearning v4 ships as a single yearning binary with strict configuration precedence: built-in defaults < YAML config (--config) < YEARNING_* environment variables
- [Kubernetes Multi-Replica Production Deployment](/en/operations/kubernetes.md): Yearning v4 is a completely stateless Go monolith backed by PostgreSQL for shared leases, sessions, scheduled jobs, and SSE fan-out, ready for multi-replica Kubernetes deployments with zero Pod-local state. Standard manifests live under backend/deploy/k8s/: backend/deploy/k8s/control-plane.yaml: Stateless multi-replica Deployment, Service, probes, and hardened securityContextbackend/deploy/k8s/migration-workloads.yaml: Isolated schema migration Job and temporary migration review Deploymentbackend/deploy/k8s/network-policy.yaml: Least-privilege NetworkPolicy
- [Migrating from Yearning v3 to v4](/en/operations/migration-v3-to-v4.md): Yearning v4 moves metadata persistence from legacy MySQL to a versioned PostgreSQL domain schema using an explicit downtime cutover pipeline (Preflight -> Dry-Run -> Admin Mapping Confirmation -> Apply -> Verify).
- [4-Digit Business Error Codes](/en/reference/error-codes.md): All Yearning v4 API endpoints return {"err_code": , "message": "...", "data": ...}. Non-zero codes map to 8 stable domains (10xx–70xx).