feat(scum): add file config workbench

This commit is contained in:
npc0-hue
2026-07-28 14:43:24 +08:00
parent e739dd9c79
commit e4ef4024a8
22 changed files with 397 additions and 109 deletions
@@ -0,0 +1,8 @@
## ADDED Requirements
### Requirement: Declared field ownership constrains config editing
Platform-projected plugin declarations SHALL associate each modeled configuration field with a declared logical file key so the frontend can invoke existing diff and approval APIs without accepting arbitrary file targets.
#### Scenario: Preview uses an owning declared config file
- **WHEN** a modeled field change is previewed
- **THEN** the frontend MUST use the field's declared logical file key and MUST NOT accept a host path or user-supplied target key
@@ -0,0 +1,37 @@
## ADDED Requirements
### Requirement: SCUM declares safe file workspace catalog
The SCUM plugin SHALL declare logical configuration and log directories/files and a bounded modeled configuration-field catalog without raw host paths, secrets, credentials, sockets, or arbitrary schemas.
#### Scenario: Default configuration scope is declared
- **WHEN** an authorized operator opens the SCUM file-and-configuration page
- **THEN** the page MUST select the plugin-declared configuration directory and list only its declared logical files
#### Scenario: Unsafe declaration is rejected
- **WHEN** a plugin manifest includes an absolute path, traversal key, secret-like value, or unsupported field control
- **THEN** Platform MUST reject the manifest before it is registered
### Requirement: Modeled SCUM fields are configuration-first
The SCUM workbench SHALL render modeled fields with Chinese label, explanation, input type, constraint, default, restart impact, and owning file, and SHALL keep unmodeled fields read-only.
#### Scenario: Operator changes a modeled field
- **WHEN** an operator changes a declared editable field
- **THEN** the workbench MUST compose only that field into the owning configuration file and require a diff preview before approval
#### Scenario: Unknown configuration is encountered
- **WHEN** the loaded configuration includes a key outside the declared field catalog
- **THEN** the workbench MUST show it as read-only and MUST NOT present it as a safe editable control
### Requirement: Logs are file scope in the same workbench
The SCUM workbench SHALL present plugin-declared log files as a log-file scope and display their Platform-mediated stream content.
#### Scenario: Operator opens a declared log file
- **WHEN** an operator selects a declared SCUM log file
- **THEN** the page MUST query only its declared Platform log stream and show readable file content without host-path disclosure
### Requirement: Legacy SCUM pages migrate safely
The frontend SHALL migrate legacy SCUM overview, config, logs, and operations page keys to the `files-config` page while leaving non-SCUM routing unchanged.
#### Scenario: Legacy SCUM operations link is opened
- **WHEN** a user opens a SCUM plugin URL with the legacy `operations` key
- **THEN** the frontend MUST resolve it to the declared `files-config` workbench for the same server context
@@ -0,0 +1,8 @@
## ADDED Requirements
### Requirement: SCUM primary surface is file and configuration workbench
The SCUM plugin SHALL expose `files-config` as its primary operator page rather than an overview-first or semantic-log-dashboard page.
#### Scenario: SCUM plugin page opens
- **WHEN** a user opens the declared primary SCUM page for a server instance
- **THEN** the page MUST prioritize declared configuration files and modeled configuration controls before log-file browsing