scene-capability-engine 3.6.32 → 3.6.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +86 -1
- package/README.md +119 -122
- package/README.zh.md +123 -121
- package/bin/scene-capability-engine.js +11 -0
- package/docs/README.md +21 -32
- package/docs/auto-refactor-index.md +384 -0
- package/docs/command-reference.md +94 -2
- package/docs/magicball-adaptation-task-checklist-v1.md +385 -0
- package/docs/magicball-app-bundle-sqlite-and-command-draft.md +539 -0
- package/docs/magicball-capability-iteration-api.md +2 -0
- package/docs/magicball-capability-iteration-ui.md +2 -0
- package/docs/magicball-capability-library.md +2 -0
- package/docs/magicball-cli-invocation-examples.md +336 -0
- package/docs/magicball-frontend-state-and-command-mapping.md +244 -0
- package/docs/magicball-integration-doc-index.md +137 -0
- package/docs/magicball-integration-issue-tracker.md +218 -0
- package/docs/magicball-mode-home-and-ontology-empty-state-playbook.md +249 -0
- package/docs/magicball-sce-adaptation-guide.md +203 -0
- package/docs/magicball-three-mode-alignment-plan.md +551 -0
- package/docs/magicball-ui-surface-checklist.md +126 -0
- package/docs/magicball-write-auth-adaptation-guide.md +328 -0
- package/docs/refactor-completion-roadmap.md +116 -0
- package/docs/zh/README.md +27 -30
- package/docs/zh/refactor-completion-roadmap.md +116 -0
- package/lib/app/registry-config.js +73 -0
- package/lib/app/registry-sync-service.js +228 -0
- package/lib/auto/archive-schema-service.js +276 -0
- package/lib/auto/archive-summary.js +60 -0
- package/lib/auto/batch-goal-input-service.js +543 -0
- package/lib/auto/batch-output.js +201 -0
- package/lib/auto/batch-summary-storage-service.js +110 -0
- package/lib/auto/close-loop-batch-service.js +116 -0
- package/lib/auto/close-loop-controller-service.js +287 -0
- package/lib/auto/close-loop-program-service.js +283 -0
- package/lib/auto/close-loop-recovery-service.js +191 -0
- package/lib/auto/close-loop-session-storage-service.js +50 -0
- package/lib/auto/controller-lock-service.js +55 -0
- package/lib/auto/controller-output.js +32 -0
- package/lib/auto/controller-queue-service.js +127 -0
- package/lib/auto/controller-session-storage-service.js +105 -0
- package/lib/auto/governance-advisory-service.js +208 -0
- package/lib/auto/governance-close-loop-service.js +411 -0
- package/lib/auto/governance-maintenance-presenter.js +162 -0
- package/lib/auto/governance-maintenance-service.js +112 -0
- package/lib/auto/governance-session-presenter.js +70 -0
- package/lib/auto/governance-session-storage-service.js +198 -0
- package/lib/auto/governance-signals.js +139 -0
- package/lib/auto/governance-stats-presenter.js +337 -0
- package/lib/auto/governance-stats-service.js +115 -0
- package/lib/auto/governance-summary.js +703 -0
- package/lib/auto/handoff-capability-matrix-service.js +281 -0
- package/lib/auto/handoff-evidence-review-service.js +251 -0
- package/lib/auto/handoff-release-evidence-service.js +190 -0
- package/lib/auto/handoff-release-gate-history-loaders-service.js +502 -0
- package/lib/auto/handoff-release-gate-history-service.js +257 -0
- package/lib/auto/handoff-reporting-service.js +1407 -0
- package/lib/auto/handoff-run-service.js +486 -0
- package/lib/auto/handoff-snapshots-service.js +645 -0
- package/lib/auto/observability-service.js +132 -0
- package/lib/auto/output-writer.js +34 -0
- package/lib/auto/program-auto-remediation-service.js +130 -0
- package/lib/auto/program-diagnostics.js +138 -0
- package/lib/auto/program-governance-helpers.js +306 -0
- package/lib/auto/program-governance-loop-service.js +413 -0
- package/lib/auto/program-output.js +106 -0
- package/lib/auto/program-summary.js +183 -0
- package/lib/auto/recovery-memory-service.js +684 -0
- package/lib/auto/recovery-selection-service.js +52 -0
- package/lib/auto/retention-policy.js +98 -0
- package/lib/auto/session-persistence-service.js +106 -0
- package/lib/auto/session-presenter.js +105 -0
- package/lib/auto/session-prune-service.js +190 -0
- package/lib/auto/session-query-service.js +249 -0
- package/lib/auto/spec-protection.js +141 -0
- package/lib/commands/app.js +911 -0
- package/lib/commands/assurance.js +212 -0
- package/lib/commands/auto.js +1091 -11063
- package/lib/commands/mode.js +321 -0
- package/lib/commands/ontology.js +415 -0
- package/lib/commands/pm.js +422 -0
- package/lib/ontology/seed-profiles.js +160 -0
- package/lib/state/sce-state-store.js +3369 -1200
- package/package.json +1 -1
|
@@ -0,0 +1,539 @@
|
|
|
1
|
+
# MagicBall App Bundle SQLite And Command Draft
|
|
2
|
+
|
|
3
|
+
> Status: historical foundation draft.
|
|
4
|
+
> Use this as architecture background only.
|
|
5
|
+
> For current MagicBall implementation work, start from `docs/magicball-integration-doc-index.md` instead.
|
|
6
|
+
|
|
7
|
+
## Goal
|
|
8
|
+
|
|
9
|
+
Define the first executable SCE backbone for MagicBall three-mode alignment:
|
|
10
|
+
|
|
11
|
+
- `Application Mode`
|
|
12
|
+
- `Ontology Mode`
|
|
13
|
+
- `Engineering Mode`
|
|
14
|
+
|
|
15
|
+
The backbone object is `app_bundle`.
|
|
16
|
+
This document provides:
|
|
17
|
+
|
|
18
|
+
1. SQLite table draft
|
|
19
|
+
2. naming rules
|
|
20
|
+
3. command draft
|
|
21
|
+
4. mode projection draft
|
|
22
|
+
5. phased implementation guidance
|
|
23
|
+
|
|
24
|
+
This draft is aligned with current SCE sqlite style in `lib/state/sce-state-store.js`:
|
|
25
|
+
- one shared sqlite file: `.sce/state/sce-state.sqlite`
|
|
26
|
+
- registry-style table names
|
|
27
|
+
- ISO timestamp fields
|
|
28
|
+
- `*_json` for extensible structured payloads
|
|
29
|
+
- explicit indexes for list/show hot paths
|
|
30
|
+
|
|
31
|
+
## Design Principles
|
|
32
|
+
|
|
33
|
+
1. `app_bundle` is the single truth source for mode binding.
|
|
34
|
+
2. Runtime / ontology / engineering identities are separated, but linked by stable IDs.
|
|
35
|
+
3. MagicBall should query SCE projections, not reconstruct relationships in frontend state.
|
|
36
|
+
4. Release version, ontology version, and code version are all first-class.
|
|
37
|
+
5. New tables should follow existing SCE registry naming conventions.
|
|
38
|
+
|
|
39
|
+
## Canonical Object Graph
|
|
40
|
+
|
|
41
|
+
- `app_bundle_registry`
|
|
42
|
+
- `runtime_release_registry`
|
|
43
|
+
- `runtime_installation_registry`
|
|
44
|
+
- `ontology_bundle_registry`
|
|
45
|
+
- `engineering_project_registry`
|
|
46
|
+
- `app_bundle_scene_binding_registry`
|
|
47
|
+
- `app_bundle_projection_cache_registry`
|
|
48
|
+
|
|
49
|
+
Relationship:
|
|
50
|
+
- one `app_bundle_registry` row binds one runtime release line, one ontology bundle, one engineering project
|
|
51
|
+
- one bundle can optionally expose a default scene and additional scene bindings
|
|
52
|
+
- one engineering project can later link into scene/spec/task governance already present in sqlite
|
|
53
|
+
|
|
54
|
+
## Recommended Table Set
|
|
55
|
+
|
|
56
|
+
### 1. app_bundle_registry
|
|
57
|
+
|
|
58
|
+
Purpose:
|
|
59
|
+
- top-level app identity and three-mode binding source of truth
|
|
60
|
+
|
|
61
|
+
```sql
|
|
62
|
+
CREATE TABLE IF NOT EXISTS app_bundle_registry (
|
|
63
|
+
app_id TEXT PRIMARY KEY,
|
|
64
|
+
app_key TEXT NOT NULL UNIQUE,
|
|
65
|
+
app_name TEXT NOT NULL,
|
|
66
|
+
app_slug TEXT,
|
|
67
|
+
workspace_id TEXT,
|
|
68
|
+
runtime_release_id TEXT,
|
|
69
|
+
ontology_bundle_id TEXT,
|
|
70
|
+
engineering_project_id TEXT,
|
|
71
|
+
default_scene_id TEXT,
|
|
72
|
+
environment TEXT,
|
|
73
|
+
status TEXT NOT NULL,
|
|
74
|
+
source_origin TEXT,
|
|
75
|
+
tags_json TEXT,
|
|
76
|
+
metadata_json TEXT,
|
|
77
|
+
created_at TEXT NOT NULL,
|
|
78
|
+
updated_at TEXT NOT NULL
|
|
79
|
+
);
|
|
80
|
+
|
|
81
|
+
CREATE INDEX IF NOT EXISTS idx_app_bundle_registry_status_updated
|
|
82
|
+
ON app_bundle_registry(status, updated_at DESC);
|
|
83
|
+
|
|
84
|
+
CREATE INDEX IF NOT EXISTS idx_app_bundle_registry_workspace
|
|
85
|
+
ON app_bundle_registry(workspace_id, updated_at DESC);
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Suggested enums:
|
|
89
|
+
- `status`: `draft`, `active`, `archived`, `disabled`
|
|
90
|
+
- `environment`: `dev`, `test`, `staging`, `prod`
|
|
91
|
+
|
|
92
|
+
### 2. runtime_release_registry
|
|
93
|
+
|
|
94
|
+
Purpose:
|
|
95
|
+
- release-oriented identity shown in Application Mode
|
|
96
|
+
|
|
97
|
+
```sql
|
|
98
|
+
CREATE TABLE IF NOT EXISTS runtime_release_registry (
|
|
99
|
+
release_id TEXT PRIMARY KEY,
|
|
100
|
+
app_id TEXT NOT NULL,
|
|
101
|
+
runtime_version TEXT NOT NULL,
|
|
102
|
+
release_channel TEXT,
|
|
103
|
+
release_status TEXT NOT NULL,
|
|
104
|
+
entrypoint TEXT,
|
|
105
|
+
runtime_status TEXT,
|
|
106
|
+
release_notes_file TEXT,
|
|
107
|
+
release_evidence_file TEXT,
|
|
108
|
+
published_at TEXT,
|
|
109
|
+
source_updated_at TEXT,
|
|
110
|
+
metadata_json TEXT,
|
|
111
|
+
created_at TEXT NOT NULL,
|
|
112
|
+
updated_at TEXT NOT NULL,
|
|
113
|
+
FOREIGN KEY (app_id) REFERENCES app_bundle_registry(app_id) ON DELETE CASCADE
|
|
114
|
+
);
|
|
115
|
+
|
|
116
|
+
CREATE INDEX IF NOT EXISTS idx_runtime_release_registry_app_published
|
|
117
|
+
ON runtime_release_registry(app_id, published_at DESC);
|
|
118
|
+
|
|
119
|
+
CREATE INDEX IF NOT EXISTS idx_runtime_release_registry_status
|
|
120
|
+
ON runtime_release_registry(release_status, updated_at DESC);
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Suggested enums:
|
|
124
|
+
- `release_status`: `draft`, `published`, `rollback`, `deprecated`
|
|
125
|
+
- `release_channel`: `local`, `dev`, `beta`, `prod`
|
|
126
|
+
- `runtime_status`: `ready`, `running`, `degraded`, `stopped`
|
|
127
|
+
|
|
128
|
+
### 3. runtime_installation_registry
|
|
129
|
+
|
|
130
|
+
Purpose:
|
|
131
|
+
- local/target installation state for app packages shown in Application Mode
|
|
132
|
+
|
|
133
|
+
```sql
|
|
134
|
+
CREATE TABLE IF NOT EXISTS runtime_installation_registry (
|
|
135
|
+
installation_id TEXT PRIMARY KEY,
|
|
136
|
+
app_id TEXT NOT NULL,
|
|
137
|
+
release_id TEXT,
|
|
138
|
+
machine_id TEXT,
|
|
139
|
+
install_root TEXT,
|
|
140
|
+
install_status TEXT NOT NULL,
|
|
141
|
+
installed_at TEXT,
|
|
142
|
+
last_opened_at TEXT,
|
|
143
|
+
current_environment TEXT,
|
|
144
|
+
metadata_json TEXT,
|
|
145
|
+
created_at TEXT NOT NULL,
|
|
146
|
+
updated_at TEXT NOT NULL,
|
|
147
|
+
FOREIGN KEY (app_id) REFERENCES app_bundle_registry(app_id) ON DELETE CASCADE,
|
|
148
|
+
FOREIGN KEY (release_id) REFERENCES runtime_release_registry(release_id) ON DELETE SET NULL
|
|
149
|
+
);
|
|
150
|
+
|
|
151
|
+
CREATE INDEX IF NOT EXISTS idx_runtime_installation_registry_app_updated
|
|
152
|
+
ON runtime_installation_registry(app_id, updated_at DESC);
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
Suggested enums:
|
|
156
|
+
- `install_status`: `not-installed`, `installed`, `broken`, `updating`
|
|
157
|
+
|
|
158
|
+
### 4. ontology_bundle_registry
|
|
159
|
+
|
|
160
|
+
Purpose:
|
|
161
|
+
- ontology/capability package identity shown in Ontology Mode
|
|
162
|
+
|
|
163
|
+
```sql
|
|
164
|
+
CREATE TABLE IF NOT EXISTS ontology_bundle_registry (
|
|
165
|
+
ontology_bundle_id TEXT PRIMARY KEY,
|
|
166
|
+
app_id TEXT NOT NULL,
|
|
167
|
+
ontology_version TEXT,
|
|
168
|
+
template_version TEXT,
|
|
169
|
+
capability_catalog_version TEXT,
|
|
170
|
+
triad_revision TEXT,
|
|
171
|
+
triad_status TEXT,
|
|
172
|
+
publish_readiness TEXT,
|
|
173
|
+
template_source TEXT,
|
|
174
|
+
capability_set_json TEXT,
|
|
175
|
+
summary_json TEXT,
|
|
176
|
+
metadata_json TEXT,
|
|
177
|
+
created_at TEXT NOT NULL,
|
|
178
|
+
updated_at TEXT NOT NULL,
|
|
179
|
+
FOREIGN KEY (app_id) REFERENCES app_bundle_registry(app_id) ON DELETE CASCADE
|
|
180
|
+
);
|
|
181
|
+
|
|
182
|
+
CREATE INDEX IF NOT EXISTS idx_ontology_bundle_registry_app_updated
|
|
183
|
+
ON ontology_bundle_registry(app_id, updated_at DESC);
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
Suggested enums:
|
|
187
|
+
- `triad_status`: `missing`, `partial`, `complete`
|
|
188
|
+
- `publish_readiness`: `blocked`, `draft`, `ready`, `published`
|
|
189
|
+
|
|
190
|
+
### 5. engineering_project_registry
|
|
191
|
+
|
|
192
|
+
Purpose:
|
|
193
|
+
- source/project control plane identity shown in Engineering Mode
|
|
194
|
+
|
|
195
|
+
```sql
|
|
196
|
+
CREATE TABLE IF NOT EXISTS engineering_project_registry (
|
|
197
|
+
engineering_project_id TEXT PRIMARY KEY,
|
|
198
|
+
app_id TEXT NOT NULL,
|
|
199
|
+
project_key TEXT,
|
|
200
|
+
project_name TEXT,
|
|
201
|
+
repo_url TEXT,
|
|
202
|
+
repo_provider TEXT,
|
|
203
|
+
default_branch TEXT,
|
|
204
|
+
current_branch TEXT,
|
|
205
|
+
commit_sha TEXT,
|
|
206
|
+
workspace_path TEXT,
|
|
207
|
+
code_version TEXT,
|
|
208
|
+
synced_runtime_release_id TEXT,
|
|
209
|
+
dirty_state INTEGER NOT NULL DEFAULT 0,
|
|
210
|
+
auth_policy_json TEXT,
|
|
211
|
+
metadata_json TEXT,
|
|
212
|
+
created_at TEXT NOT NULL,
|
|
213
|
+
updated_at TEXT NOT NULL,
|
|
214
|
+
FOREIGN KEY (app_id) REFERENCES app_bundle_registry(app_id) ON DELETE CASCADE,
|
|
215
|
+
FOREIGN KEY (synced_runtime_release_id) REFERENCES runtime_release_registry(release_id) ON DELETE SET NULL
|
|
216
|
+
);
|
|
217
|
+
|
|
218
|
+
CREATE INDEX IF NOT EXISTS idx_engineering_project_registry_app_updated
|
|
219
|
+
ON engineering_project_registry(app_id, updated_at DESC);
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
Suggested enums:
|
|
223
|
+
- `repo_provider`: `gitlab`, `github`, `local`, `other`
|
|
224
|
+
- `dirty_state`: `0|1`
|
|
225
|
+
|
|
226
|
+
### 6. app_bundle_scene_binding_registry
|
|
227
|
+
|
|
228
|
+
Purpose:
|
|
229
|
+
- explicit scene binding between app bundle and engineering/runtime workflows
|
|
230
|
+
- bridge into the existing scene/spec/task governance model
|
|
231
|
+
|
|
232
|
+
```sql
|
|
233
|
+
CREATE TABLE IF NOT EXISTS app_bundle_scene_binding_registry (
|
|
234
|
+
app_id TEXT NOT NULL,
|
|
235
|
+
scene_id TEXT NOT NULL,
|
|
236
|
+
binding_role TEXT NOT NULL,
|
|
237
|
+
source TEXT,
|
|
238
|
+
metadata_json TEXT,
|
|
239
|
+
created_at TEXT NOT NULL,
|
|
240
|
+
updated_at TEXT NOT NULL,
|
|
241
|
+
PRIMARY KEY (app_id, scene_id, binding_role),
|
|
242
|
+
FOREIGN KEY (app_id) REFERENCES app_bundle_registry(app_id) ON DELETE CASCADE,
|
|
243
|
+
FOREIGN KEY (scene_id) REFERENCES scene_registry(scene_id) ON DELETE CASCADE
|
|
244
|
+
);
|
|
245
|
+
|
|
246
|
+
CREATE INDEX IF NOT EXISTS idx_app_bundle_scene_binding_registry_scene
|
|
247
|
+
ON app_bundle_scene_binding_registry(scene_id, updated_at DESC);
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
Suggested enums:
|
|
251
|
+
- `binding_role`: `default`, `runtime-home`, `ontology-home`, `engineering-home`, `delivery-root`
|
|
252
|
+
|
|
253
|
+
### 7. app_bundle_projection_cache_registry
|
|
254
|
+
|
|
255
|
+
Purpose:
|
|
256
|
+
- optional cached home projection snapshots for MagicBall shells
|
|
257
|
+
- cache only, not source of truth
|
|
258
|
+
|
|
259
|
+
```sql
|
|
260
|
+
CREATE TABLE IF NOT EXISTS app_bundle_projection_cache_registry (
|
|
261
|
+
app_id TEXT NOT NULL,
|
|
262
|
+
projection_mode TEXT NOT NULL,
|
|
263
|
+
payload_json TEXT NOT NULL,
|
|
264
|
+
generated_at TEXT NOT NULL,
|
|
265
|
+
source_updated_at TEXT,
|
|
266
|
+
PRIMARY KEY (app_id, projection_mode),
|
|
267
|
+
FOREIGN KEY (app_id) REFERENCES app_bundle_registry(app_id) ON DELETE CASCADE
|
|
268
|
+
);
|
|
269
|
+
|
|
270
|
+
CREATE INDEX IF NOT EXISTS idx_app_bundle_projection_cache_registry_generated
|
|
271
|
+
ON app_bundle_projection_cache_registry(generated_at DESC);
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
Suggested enums:
|
|
275
|
+
- `projection_mode`: `application`, `ontology`, `engineering`
|
|
276
|
+
|
|
277
|
+
## Optional Phase-2 Tables
|
|
278
|
+
|
|
279
|
+
These should not block phase-1 backbone delivery.
|
|
280
|
+
|
|
281
|
+
### app_service_catalog_registry
|
|
282
|
+
- remote app library entries
|
|
283
|
+
- downloadable app package metadata
|
|
284
|
+
|
|
285
|
+
### app_template_binding_registry
|
|
286
|
+
- template lineage for ontology mode
|
|
287
|
+
- can later connect template registry and capability build pipeline
|
|
288
|
+
|
|
289
|
+
### engineering_project_attach_registry
|
|
290
|
+
- attach/hydrate/activate operation history
|
|
291
|
+
- useful for audit and retry workflows
|
|
292
|
+
|
|
293
|
+
## Recommended ID Rules
|
|
294
|
+
|
|
295
|
+
### app bundle IDs
|
|
296
|
+
- `app.<slug>`
|
|
297
|
+
- example: `app.customer-order-demo`
|
|
298
|
+
|
|
299
|
+
### runtime release IDs
|
|
300
|
+
- `rel.<app-slug>.<yyyymmddhhmmss>`
|
|
301
|
+
- example: `rel.customer-order-demo.20260308123015`
|
|
302
|
+
|
|
303
|
+
### ontology bundle IDs
|
|
304
|
+
- `onto.<app-slug>.<rev>`
|
|
305
|
+
- example: `onto.customer-order-demo.r12`
|
|
306
|
+
|
|
307
|
+
### engineering project IDs
|
|
308
|
+
- `eng.<app-slug>`
|
|
309
|
+
- example: `eng.customer-order-demo`
|
|
310
|
+
|
|
311
|
+
Rules:
|
|
312
|
+
- stable IDs, never reused
|
|
313
|
+
- display names can change, IDs should not
|
|
314
|
+
- `app_key` is the frontend-stable lookup key
|
|
315
|
+
|
|
316
|
+
## Recommended Command Draft
|
|
317
|
+
|
|
318
|
+
### Bundle Registry
|
|
319
|
+
|
|
320
|
+
```bash
|
|
321
|
+
sce app bundle list --json
|
|
322
|
+
sce app bundle show --app <app-id|app-key> --json
|
|
323
|
+
sce app bundle register --input bundle.json --json
|
|
324
|
+
sce app bundle sync --app <app-id|app-key> --json
|
|
325
|
+
sce app bundle archive --app <app-id|app-key> --auth-lease <lease-id> --json
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
### Runtime Projection
|
|
329
|
+
|
|
330
|
+
```bash
|
|
331
|
+
sce app runtime show --app <app-id|app-key> --json
|
|
332
|
+
sce app runtime releases --app <app-id|app-key> --json
|
|
333
|
+
sce app runtime install --app <app-id|app-key> --source <catalog-or-bundle> --auth-lease <lease-id> --json
|
|
334
|
+
sce app runtime activate --app <app-id|app-key> --release <release-id> --auth-lease <lease-id> --json
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
### Ontology Projection
|
|
338
|
+
|
|
339
|
+
```bash
|
|
340
|
+
sce app ontology show --app <app-id|app-key> --json
|
|
341
|
+
sce app ontology triad --app <app-id|app-key> --json
|
|
342
|
+
sce app ontology bind-template --app <app-id|app-key> --template <template-id> --auth-lease <lease-id> --json
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
### Engineering Projection
|
|
346
|
+
|
|
347
|
+
```bash
|
|
348
|
+
sce app engineering show --app <app-id|app-key> --json
|
|
349
|
+
sce app engineering attach --app <app-id|app-key> --repo <repo-url> --branch <branch> --auth-lease <lease-id> --json
|
|
350
|
+
sce app engineering hydrate --app <app-id|app-key> --auth-lease <lease-id> --json
|
|
351
|
+
sce app engineering activate --app <app-id|app-key> --auth-lease <lease-id> --json
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
### Mode Home Projection
|
|
355
|
+
|
|
356
|
+
```bash
|
|
357
|
+
sce mode application home --app <app-id|app-key> --json
|
|
358
|
+
sce mode ontology home --app <app-id|app-key> --json
|
|
359
|
+
sce mode engineering home --app <app-id|app-key> --json
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
These are the most important frontend-facing commands.
|
|
363
|
+
MagicBall should use them as mode entrypoints instead of stitching data from multiple raw endpoints.
|
|
364
|
+
|
|
365
|
+
## Recommended Response Shape
|
|
366
|
+
|
|
367
|
+
All `show/home` commands should return:
|
|
368
|
+
|
|
369
|
+
- `query`
|
|
370
|
+
- `summary`
|
|
371
|
+
- `items`
|
|
372
|
+
- `relations`
|
|
373
|
+
- `view_model`
|
|
374
|
+
- `mb_status`
|
|
375
|
+
|
|
376
|
+
### Example: `sce mode engineering home --app app.customer-order-demo --json`
|
|
377
|
+
|
|
378
|
+
```json
|
|
379
|
+
{
|
|
380
|
+
"mode": "engineering-home",
|
|
381
|
+
"query": {
|
|
382
|
+
"app_id": "app.customer-order-demo"
|
|
383
|
+
},
|
|
384
|
+
"summary": {
|
|
385
|
+
"app_name": "Customer Order Demo",
|
|
386
|
+
"runtime_version": "v0.4.2",
|
|
387
|
+
"code_version": "main@7e12a8f",
|
|
388
|
+
"scene_count": 4,
|
|
389
|
+
"open_issues": 3
|
|
390
|
+
},
|
|
391
|
+
"relations": {
|
|
392
|
+
"engineering_project_id": "eng.customer-order-demo",
|
|
393
|
+
"ontology_bundle_id": "onto.customer-order-demo.r12",
|
|
394
|
+
"runtime_release_id": "rel.customer-order-demo.20260308123015"
|
|
395
|
+
},
|
|
396
|
+
"view_model": {
|
|
397
|
+
"primary_sections": [
|
|
398
|
+
"source",
|
|
399
|
+
"timeline",
|
|
400
|
+
"diff",
|
|
401
|
+
"delivery",
|
|
402
|
+
"capability",
|
|
403
|
+
"assurance"
|
|
404
|
+
],
|
|
405
|
+
"default_scene_id": "scene.customer-order"
|
|
406
|
+
},
|
|
407
|
+
"mb_status": "active"
|
|
408
|
+
}
|
|
409
|
+
```
|
|
410
|
+
|
|
411
|
+
## Recommended Minimal Write Payload
|
|
412
|
+
|
|
413
|
+
### `bundle.json`
|
|
414
|
+
|
|
415
|
+
```json
|
|
416
|
+
{
|
|
417
|
+
"app_id": "app.customer-order-demo",
|
|
418
|
+
"app_key": "customer-order-demo",
|
|
419
|
+
"app_name": "Customer Order Demo",
|
|
420
|
+
"environment": "dev",
|
|
421
|
+
"status": "active",
|
|
422
|
+
"runtime": {
|
|
423
|
+
"release_id": "rel.customer-order-demo.20260308123015",
|
|
424
|
+
"runtime_version": "v0.4.2",
|
|
425
|
+
"release_channel": "dev",
|
|
426
|
+
"release_status": "published"
|
|
427
|
+
},
|
|
428
|
+
"ontology": {
|
|
429
|
+
"ontology_bundle_id": "onto.customer-order-demo.r12",
|
|
430
|
+
"ontology_version": "0.4.2",
|
|
431
|
+
"template_version": "tpl.20260308.1",
|
|
432
|
+
"triad_status": "complete",
|
|
433
|
+
"publish_readiness": "ready"
|
|
434
|
+
},
|
|
435
|
+
"engineering": {
|
|
436
|
+
"engineering_project_id": "eng.customer-order-demo",
|
|
437
|
+
"repo_url": "https://git.example.com/customer-order-demo.git",
|
|
438
|
+
"repo_provider": "gitlab",
|
|
439
|
+
"default_branch": "main",
|
|
440
|
+
"current_branch": "main",
|
|
441
|
+
"commit_sha": "7e12a8f",
|
|
442
|
+
"workspace_path": "E:/workspace/customer-order-demo",
|
|
443
|
+
"dirty_state": false
|
|
444
|
+
},
|
|
445
|
+
"default_scene_id": "scene.customer-order",
|
|
446
|
+
"scene_bindings": [
|
|
447
|
+
{
|
|
448
|
+
"scene_id": "scene.customer-order",
|
|
449
|
+
"binding_role": "default"
|
|
450
|
+
}
|
|
451
|
+
]
|
|
452
|
+
}
|
|
453
|
+
```
|
|
454
|
+
|
|
455
|
+
## Recommended Projection Rules
|
|
456
|
+
|
|
457
|
+
### Application Mode Projection
|
|
458
|
+
|
|
459
|
+
Should include:
|
|
460
|
+
- app identity
|
|
461
|
+
- installed release
|
|
462
|
+
- runtime status
|
|
463
|
+
- environment/channel
|
|
464
|
+
- entrypoint
|
|
465
|
+
- install/open actions
|
|
466
|
+
|
|
467
|
+
### Ontology Mode Projection
|
|
468
|
+
|
|
469
|
+
Should include:
|
|
470
|
+
- ontology bundle id/version
|
|
471
|
+
- triad completeness
|
|
472
|
+
- template source/version
|
|
473
|
+
- capability publish readiness
|
|
474
|
+
- ER/BR/DL summary cards
|
|
475
|
+
|
|
476
|
+
### Engineering Mode Projection
|
|
477
|
+
|
|
478
|
+
Should include:
|
|
479
|
+
- engineering project identity
|
|
480
|
+
- repo/branch/commit
|
|
481
|
+
- dirty state
|
|
482
|
+
- active scene/default scene
|
|
483
|
+
- links to PM objects and assurance sections
|
|
484
|
+
|
|
485
|
+
## Recommended Implementation Order
|
|
486
|
+
|
|
487
|
+
### Phase 1
|
|
488
|
+
- add sqlite tables:
|
|
489
|
+
- `app_bundle_registry`
|
|
490
|
+
- `runtime_release_registry`
|
|
491
|
+
- `ontology_bundle_registry`
|
|
492
|
+
- `engineering_project_registry`
|
|
493
|
+
- `app_bundle_scene_binding_registry`
|
|
494
|
+
- add commands:
|
|
495
|
+
- `sce app bundle list/show/register`
|
|
496
|
+
- `sce mode application home`
|
|
497
|
+
- `sce mode ontology home`
|
|
498
|
+
- `sce mode engineering home`
|
|
499
|
+
|
|
500
|
+
### Phase 2
|
|
501
|
+
- add:
|
|
502
|
+
- `runtime_installation_registry`
|
|
503
|
+
- `app_bundle_projection_cache_registry`
|
|
504
|
+
- add commands:
|
|
505
|
+
- `sce app runtime install/activate`
|
|
506
|
+
- `sce app engineering attach/hydrate/activate`
|
|
507
|
+
- `sce app bundle sync`
|
|
508
|
+
|
|
509
|
+
### Phase 3
|
|
510
|
+
- connect PM / ontology / assurance objects into mode projections
|
|
511
|
+
- add service library and app download path
|
|
512
|
+
- add capability feedback loop from scene/spec/task into ontology mode
|
|
513
|
+
|
|
514
|
+
## Minimum Acceptance Criteria
|
|
515
|
+
|
|
516
|
+
### Schema acceptance
|
|
517
|
+
- sqlite opens cleanly and creates all phase-1 tables in `.sce/state/sce-state.sqlite`
|
|
518
|
+
- foreign keys work under existing `PRAGMA foreign_keys = ON`
|
|
519
|
+
- `app_id` can resolve runtime/ontology/engineering rows without frontend joins
|
|
520
|
+
|
|
521
|
+
### Command acceptance
|
|
522
|
+
- `sce app bundle list/show/register --json` works
|
|
523
|
+
- all three `sce mode * home --json` commands return `view_model`
|
|
524
|
+
- MagicBall can open a managed app and resolve the same `app_id` into all three modes
|
|
525
|
+
|
|
526
|
+
### Governance acceptance
|
|
527
|
+
- all write commands support `--auth-lease`
|
|
528
|
+
- IDs are stable and non-reusable
|
|
529
|
+
- code version and runtime version can diverge and still be shown clearly
|
|
530
|
+
|
|
531
|
+
## Practical Conclusion
|
|
532
|
+
|
|
533
|
+
The next SCE implementation step should be:
|
|
534
|
+
|
|
535
|
+
1. extend `lib/state/sce-state-store.js` with the phase-1 app bundle tables
|
|
536
|
+
2. add `app bundle` list/show/register command handlers
|
|
537
|
+
3. add `mode application|ontology|engineering home` projections
|
|
538
|
+
|
|
539
|
+
That is the shortest path to make MagicBall's three-mode architecture real rather than frontend-assembled.
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# Magicball 能力迭代管理(SCE 对接说明)
|
|
2
2
|
|
|
3
|
+
> Status: secondary reference for the capability-iteration surface only.
|
|
4
|
+
> Do not use this as the general MagicBall integration entry.
|
|
3
5
|
> 适用于:Magicball AI 助手页面新增顶部图标入口,内部用页签切换。
|
|
4
6
|
> 目标:从历史 `scene/spec/task` 中提炼可复用能力模板,并完成本体映射,形成可发布的能力资产。
|
|
5
7
|
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# Magicball 能力库复用对接说明(SCE)
|
|
2
2
|
|
|
3
|
+
> Status: secondary reference for capability-library integration only.
|
|
4
|
+
> Keep this for the capability-library flow, not as the main MagicBall entry guide.
|
|
3
5
|
> 目标:在 Magicball UI 中提供“能力库检索/匹配/使用”闭环,加速场景能力落地。
|
|
4
6
|
|
|
5
7
|
Schema reference: `docs/agent-runtime/magicball-status.schema.json`
|