feat(scum): rebuild plugin-owned management data

This commit is contained in:
npc0-hue
2026-08-15 12:43:09 +08:00
parent 92b1159cc8
commit 65353cf269
113 changed files with 3116 additions and 8058 deletions
@@ -8,14 +8,15 @@ The SCUM plugin owns collection names such as `scum_users`, schemas, upsert keys
## Generic Platform Data Contract
The generic record is scoped by `pluginId`, `serverInstanceId`, `collection`, and `key`, with an opaque JSON `value` and timestamps. The platform validates scope and authorization only. A page bridge exposes list/get/put/delete generic collection methods to plugin bundles.
The generic record is scoped by `pluginId`, `serverInstanceId`, `collection`, and `key`, with an opaque JSON `value` and timestamps. The platform validates scope and authorization only. A page bridge exposes list/put/delete and atomic put/delete transaction methods to plugin bundles.
## SCUM Data Flow
1. The plugin declares v57 SQLite queries plus config/log parsers in its own versioned assets.
1. The plugin declares v57 SQLite `sqlRef` assets, opaque collection row targets, config maps, and log parsers in its own versioned data pack.
2. Platform dispatches the selected declared operation to Run; no browser or plugin supplies a machine path or SQL string at request time.
3. Plugin-shaped results are stored in scoped `scum_*` collections through the generic store.
3. Run returns structured rows; Platform applies only the declared collection, upsert keys, and column mapping before storing them in the scoped generic store.
4. The SCUM page reads those collections through the generic bridge and applies all SCUM-specific presentation and gift logic locally.
5. Gift delivery and activity commands use the existing generic Game Client Bridge queue exposed by the plugin-page host.
## Compatibility
@@ -8,6 +8,11 @@ Platform SHALL persist opaque plugin records scoped by plugin identifier, server
- **THEN** Platform stores the opaque record without interpreting SCUM fields
- **AND** another plugin or server instance cannot read the record through the scoped API
#### Scenario: Plugin updates a collection atomically
- **WHEN** an authorized plugin page submits a transaction containing collection puts and deletes
- **THEN** Platform validates the complete transaction before applying it
- **AND** the repository exposes the resulting records as one collection change
### Requirement: Plugin-Owned SCUM Domain
The SCUM plugin SHALL own its collection names, record schemas, gift behavior, map behavior, and version-specific data extraction assets.
@@ -23,3 +28,8 @@ SCUM machine SQLite, configuration, and log operations SHALL remain plugin-decla
- **WHEN** a SCUM page requests a declared data refresh
- **THEN** Platform routes the declared operation through Run
- **AND** neither the page nor Platform's generic collection API accepts a raw host path or arbitrary SQLite statement
#### Scenario: Run reports declared query rows
- **WHEN** Run completes a declared SQLite query with a structured `rows` result
- **THEN** Platform uses only the plugin-declared collection, upsert keys, and column mappings to persist the rows
- **AND** Platform does not branch on the game, query key, collection name, or row fields
@@ -3,7 +3,7 @@
- [x] Revert the direct-data and reference-alignment commits while retaining unrelated local-debug fixes.
- [x] Add a generic scoped plugin data record model, repository, service, DTO, and HTTP API in Platform.
- [x] Add generic collection actions to the plugin-page host and browser API client.
- [ ] Restore SCUM v57 SQL, config, log, and gift assets in the plugin package.
- [ ] Rebuild the SCUM plugin page to use only generic collection bridge actions for users, squads, activity, gifts, and map points.
- [ ] Remove obsolete SCUM-specific Platform/frontend data and gift surfaces that conflict with plugin ownership.
- [ ] Add focused backend, plugin, and frontend tests; run structure and OpenSpec validation.
- [x] Restore SCUM v57 SQL, config, log, and gift assets in the plugin package.
- [x] Rebuild the SCUM plugin page to use only generic collection bridge actions for users, squads, activity, gifts, and map points.
- [x] Remove obsolete SCUM-specific Platform/frontend data and gift surfaces that conflict with plugin ownership.
- [x] Add focused backend, plugin, and frontend tests; run structure and OpenSpec validation.