Files
browser/openspec/changes/fix-env-profile-settings/specs/platform-env-bootstrap/spec.md
T
2026-07-11 14:56:10 +08:00

1.3 KiB

ADDED Requirements

Requirement: Platform startup loads local environment files

The platform SHALL load local .env configuration before constructing runtime configuration for storage initialization.

Scenario: Platform env file selects MySQL storage

  • WHEN platform/.env contains PLATFORM_STORAGE_BACKEND=mysql and PLATFORM_MYSQL_DSN
  • THEN platform configuration MUST use the MySQL storage backend and DSN from the env file

Scenario: Process environment overrides env file

  • WHEN a process environment variable and a local .env file both define the same platform setting
  • THEN platform configuration MUST use the process environment value

Requirement: Metadata backend selection remains database-backed

The platform SHALL initialize the configured metadata repository through the existing store boundary rather than falling back to hardcoded local sample data.

Scenario: MySQL storage is configured

  • WHEN PLATFORM_STORAGE_BACKEND=mysql and a non-empty PLATFORM_MYSQL_DSN are loaded
  • THEN platform startup MUST initialize the MySQL metadata store

Scenario: MySQL storage is missing DSN

  • WHEN PLATFORM_STORAGE_BACKEND=mysql is loaded without PLATFORM_MYSQL_DSN
  • THEN platform startup MUST fail with a direct configuration error instead of silently using file or memory storage