first commit

This commit is contained in:
npc0-hue
2026-07-11 14:56:10 +08:00
commit 7e05d0a4e7
660 changed files with 78119 additions and 0 deletions
@@ -0,0 +1,45 @@
# mysql-platform-metadata-storage Specification
## ADDED Requirements
### Requirement: MySQL metadata backend configuration
The platform SHALL support `PLATFORM_STORAGE_BACKEND=mysql` for metadata persistence.
#### Scenario: MySQL backend is configured with a DSN
- **GIVEN** `PLATFORM_STORAGE_BACKEND=mysql`
- **AND** `PLATFORM_MYSQL_DSN` points to a reachable database
- **WHEN** the platform starts
- **THEN** it SHALL initialize a MySQL metadata store
- **AND** it SHALL create required metadata storage structures when missing.
#### Scenario: MySQL backend is missing a DSN
- **GIVEN** `PLATFORM_STORAGE_BACKEND=mysql`
- **AND** `PLATFORM_MYSQL_DSN` is empty
- **WHEN** the platform starts
- **THEN** startup SHALL fail with a clear configuration error.
### Requirement: Log body backend remains separate
The platform SHALL configure log body storage separately from metadata storage.
#### Scenario: MySQL metadata uses file log bodies by default
- **GIVEN** `PLATFORM_STORAGE_BACKEND=mysql`
- **AND** `PLATFORM_LOG_BODY_BACKEND` is empty
- **WHEN** the platform starts
- **THEN** log bodies SHALL use the file segmented backend
- **AND** log entries SHALL NOT be stored as row-per-line MySQL metadata.
### Requirement: MySQL configuration is documented
The repository SHALL include commented MySQL examples in local env and Docker configuration docs.
#### Scenario: Operator wants to configure MySQL
- **GIVEN** an operator reads the env examples or README
- **WHEN** they search for MySQL configuration
- **THEN** they SHALL find `PLATFORM_STORAGE_BACKEND=mysql`, `PLATFORM_MYSQL_DSN`, and `PLATFORM_LOG_BODY_BACKEND=file` examples.