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,336 @@
|
|
|
1
|
+
# MagicBall CLI Invocation Examples
|
|
2
|
+
|
|
3
|
+
## Goal
|
|
4
|
+
|
|
5
|
+
Provide copy-ready invocation examples for the most common MagicBall -> SCE integration flows.
|
|
6
|
+
|
|
7
|
+
This document is optimized for frontend integration, local debugging, and CLI smoke verification.
|
|
8
|
+
It is not the main source of architecture or product policy.
|
|
9
|
+
|
|
10
|
+
Use this together with:
|
|
11
|
+
- `docs/magicball-ui-surface-checklist.md`
|
|
12
|
+
- `docs/magicball-frontend-state-and-command-mapping.md`
|
|
13
|
+
- `docs/magicball-write-auth-adaptation-guide.md`
|
|
14
|
+
|
|
15
|
+
## Conventions
|
|
16
|
+
|
|
17
|
+
Assume:
|
|
18
|
+
- `app_key = customer-order-demo`
|
|
19
|
+
- current workspace already uses the intended project root
|
|
20
|
+
- all commands request machine-readable JSON via `--json`
|
|
21
|
+
|
|
22
|
+
## 1. Workspace Bootstrap
|
|
23
|
+
|
|
24
|
+
### 1.1 App bundle identity
|
|
25
|
+
```bash
|
|
26
|
+
sce app bundle show --app customer-order-demo --json
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Expected use:
|
|
30
|
+
- cache `app_id`
|
|
31
|
+
- cache `app_key`
|
|
32
|
+
- cache app-level bundle bindings
|
|
33
|
+
|
|
34
|
+
### 1.2 Serialized mode-home bootstrap
|
|
35
|
+
Run in this order only:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
sce mode application home --app customer-order-demo --json
|
|
39
|
+
sce mode ontology home --app customer-order-demo --json
|
|
40
|
+
sce mode engineering home --app customer-order-demo --json
|
|
41
|
+
sce app engineering show --app customer-order-demo --json
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Recommended frontend rule:
|
|
45
|
+
- do not parallelize these four calls during current verification window
|
|
46
|
+
|
|
47
|
+
## 2. Application Mode Examples
|
|
48
|
+
|
|
49
|
+
### 2.1 Read application home
|
|
50
|
+
```bash
|
|
51
|
+
sce mode application home --app customer-order-demo --json
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Typical fields MagicBall cares about:
|
|
55
|
+
- `summary.app_name`
|
|
56
|
+
- `summary.runtime_version`
|
|
57
|
+
- `summary.install_status`
|
|
58
|
+
- `summary.release_count`
|
|
59
|
+
- `view_model.current_release`
|
|
60
|
+
|
|
61
|
+
### 2.2 Read runtime releases
|
|
62
|
+
```bash
|
|
63
|
+
sce app runtime releases --app customer-order-demo --json
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### 2.3 Install a release
|
|
67
|
+
```bash
|
|
68
|
+
sce app runtime install --app customer-order-demo --release rel-2026-03 --json
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### 2.4 Activate a release
|
|
72
|
+
```bash
|
|
73
|
+
sce app runtime activate --app customer-order-demo --release rel-2026-03 --json
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## 3. Ontology Mode Examples
|
|
77
|
+
|
|
78
|
+
### 3.1 Read ontology home
|
|
79
|
+
```bash
|
|
80
|
+
sce mode ontology home --app customer-order-demo --json
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### 3.2 Read triad summary
|
|
84
|
+
```bash
|
|
85
|
+
sce ontology triad summary --json
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### 3.3 Read ER / BR / DL tables
|
|
89
|
+
```bash
|
|
90
|
+
sce ontology er list --json
|
|
91
|
+
sce ontology br list --json
|
|
92
|
+
sce ontology dl list --json
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### 3.4 Read starter-seed preview
|
|
96
|
+
```bash
|
|
97
|
+
sce ontology seed show --profile customer-order-demo --json
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### 3.5 Apply starter seed
|
|
101
|
+
```bash
|
|
102
|
+
sce ontology seed apply --profile customer-order-demo --json
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### 3.6 Refresh chain after successful seed apply
|
|
106
|
+
Run in this order:
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
sce mode ontology home --app customer-order-demo --json
|
|
110
|
+
sce ontology triad summary --json
|
|
111
|
+
sce ontology er list --json
|
|
112
|
+
sce ontology br list --json
|
|
113
|
+
sce ontology dl list --json
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## 4. Engineering Mode Examples
|
|
117
|
+
|
|
118
|
+
### 4.1 Read engineering home
|
|
119
|
+
```bash
|
|
120
|
+
sce mode engineering home --app customer-order-demo --json
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### 4.2 Read PM tabs
|
|
124
|
+
```bash
|
|
125
|
+
sce pm requirement list --json
|
|
126
|
+
sce pm tracking board --json
|
|
127
|
+
sce pm planning board --json
|
|
128
|
+
sce pm change list --json
|
|
129
|
+
sce pm issue board --json
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### 4.3 Read assurance tabs
|
|
133
|
+
```bash
|
|
134
|
+
sce assurance resource status --json
|
|
135
|
+
sce assurance logs views --json
|
|
136
|
+
sce assurance backup list --json
|
|
137
|
+
sce assurance config switches --json
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### 4.4 Read engineering project detail
|
|
141
|
+
```bash
|
|
142
|
+
sce app engineering show --app customer-order-demo --json
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
## 5. Write Authorization Examples
|
|
146
|
+
|
|
147
|
+
### 5.1 Inspect current authorization status
|
|
148
|
+
```bash
|
|
149
|
+
sce auth status --json
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### 5.2 Grant lease for PM editing
|
|
153
|
+
```bash
|
|
154
|
+
sce auth grant --scope pm:requirement:upsert --reason "edit requirement from MagicBall" --json
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### 5.3 Grant lease for ontology editing
|
|
158
|
+
```bash
|
|
159
|
+
sce auth grant --scope ontology:er:upsert,ontology:br:upsert,ontology:dl:upsert --reason "edit ontology from MagicBall" --json
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### 5.4 Use returned lease on a write command
|
|
163
|
+
```bash
|
|
164
|
+
sce pm requirement upsert --input requirement.json --auth-lease <lease-id> --json
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
### 5.5 Re-check a lease
|
|
168
|
+
```bash
|
|
169
|
+
sce auth status --lease <lease-id> --json
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### 5.6 Revoke a lease
|
|
173
|
+
```bash
|
|
174
|
+
sce auth revoke --lease <lease-id> --json
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
## 6. PM Write Examples
|
|
178
|
+
|
|
179
|
+
### 6.1 Requirement upsert
|
|
180
|
+
```bash
|
|
181
|
+
sce pm requirement upsert --input requirement.json --json
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
Example `requirement.json`:
|
|
185
|
+
```json
|
|
186
|
+
{
|
|
187
|
+
"requirement_id": "REQ-UI-001",
|
|
188
|
+
"title": "Render requirement list in engineering mode",
|
|
189
|
+
"source_request": "MagicBall engineering tab integration",
|
|
190
|
+
"status": "draft",
|
|
191
|
+
"priority": "P1"
|
|
192
|
+
}
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
### 6.2 Tracking upsert
|
|
196
|
+
```bash
|
|
197
|
+
sce pm tracking upsert --input tracking.json --json
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
Example `tracking.json`:
|
|
201
|
+
```json
|
|
202
|
+
{
|
|
203
|
+
"tracking_id": "TRK-UI-001",
|
|
204
|
+
"requirement_id": "REQ-UI-001",
|
|
205
|
+
"current_stage": "clarifying",
|
|
206
|
+
"status": "normal",
|
|
207
|
+
"next_action": "Wire engineering tracking tab"
|
|
208
|
+
}
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
### 6.3 Issue upsert
|
|
212
|
+
```bash
|
|
213
|
+
sce pm issue upsert --input issue.json --json
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
Example `issue.json`:
|
|
217
|
+
```json
|
|
218
|
+
{
|
|
219
|
+
"issue_id": "BUG-UI-001",
|
|
220
|
+
"title": "Engineering issue tab does not refresh",
|
|
221
|
+
"source": "review",
|
|
222
|
+
"severity": "medium",
|
|
223
|
+
"status": "new"
|
|
224
|
+
}
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
## 7. Task Feedback And Timeline Examples
|
|
228
|
+
|
|
229
|
+
### 7.1 Read task feedback for a job
|
|
230
|
+
```bash
|
|
231
|
+
sce studio events --job <job-id> --json
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
MagicBall should prefer:
|
|
235
|
+
- `task.feedback_model`
|
|
236
|
+
- `task.mb_status`
|
|
237
|
+
- raw `event[]` only in advanced/audit mode
|
|
238
|
+
|
|
239
|
+
### 7.2 Read timeline list
|
|
240
|
+
```bash
|
|
241
|
+
sce timeline list --limit 20 --json
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
### 7.3 Read timeline detail
|
|
245
|
+
```bash
|
|
246
|
+
sce timeline show <snapshot-id> --json
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
## 8. Suggested Frontend Wrapper Pattern
|
|
250
|
+
|
|
251
|
+
### 8.1 Node/Electron shell wrapper
|
|
252
|
+
```ts
|
|
253
|
+
async function runSceJson(args: string[]) {
|
|
254
|
+
const result = await invokeShell(['sce', ...args]);
|
|
255
|
+
if (result.exitCode !== 0) {
|
|
256
|
+
throw {
|
|
257
|
+
command: ['sce', ...args].join(' '),
|
|
258
|
+
exitCode: result.exitCode,
|
|
259
|
+
stdout: result.stdout,
|
|
260
|
+
stderr: result.stderr,
|
|
261
|
+
retryable: true
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
return JSON.parse(result.stdout);
|
|
265
|
+
}
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
### 8.2 Serialized workspace bootstrap wrapper
|
|
269
|
+
```ts
|
|
270
|
+
async function loadWorkspace(appKey: string) {
|
|
271
|
+
const appBundle = await runSceJson(['app', 'bundle', 'show', '--app', appKey, '--json']);
|
|
272
|
+
const applicationHome = await runSceJson(['mode', 'application', 'home', '--app', appKey, '--json']);
|
|
273
|
+
const ontologyHome = await runSceJson(['mode', 'ontology', 'home', '--app', appKey, '--json']);
|
|
274
|
+
const engineeringHome = await runSceJson(['mode', 'engineering', 'home', '--app', appKey, '--json']);
|
|
275
|
+
const engineeringDetail = await runSceJson(['app', 'engineering', 'show', '--app', appKey, '--json']);
|
|
276
|
+
|
|
277
|
+
return {
|
|
278
|
+
appBundle,
|
|
279
|
+
applicationHome,
|
|
280
|
+
ontologyHome,
|
|
281
|
+
engineeringHome,
|
|
282
|
+
engineeringDetail
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
## 9. Failure Logging Pattern
|
|
288
|
+
|
|
289
|
+
When a command fails, MagicBall should preserve:
|
|
290
|
+
- command string
|
|
291
|
+
- exit code
|
|
292
|
+
- stderr
|
|
293
|
+
- stdout if any
|
|
294
|
+
- page/section where failure happened
|
|
295
|
+
- retry action name
|
|
296
|
+
|
|
297
|
+
Suggested error bundle:
|
|
298
|
+
|
|
299
|
+
```json
|
|
300
|
+
{
|
|
301
|
+
"command": "sce mode ontology home --app customer-order-demo --json",
|
|
302
|
+
"page": "ontology",
|
|
303
|
+
"section": "summary",
|
|
304
|
+
"exit_code": 1,
|
|
305
|
+
"stderr": "database is locked",
|
|
306
|
+
"retryable": true
|
|
307
|
+
}
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
## 10. Recommended Smoke Flow For Local Integration
|
|
311
|
+
|
|
312
|
+
Run this full sequence when verifying MagicBall local integration:
|
|
313
|
+
|
|
314
|
+
```bash
|
|
315
|
+
sce app bundle show --app customer-order-demo --json
|
|
316
|
+
sce mode application home --app customer-order-demo --json
|
|
317
|
+
sce mode ontology home --app customer-order-demo --json
|
|
318
|
+
sce mode engineering home --app customer-order-demo --json
|
|
319
|
+
sce app engineering show --app customer-order-demo --json
|
|
320
|
+
sce ontology triad summary --json
|
|
321
|
+
sce pm requirement list --json
|
|
322
|
+
sce assurance resource status --json
|
|
323
|
+
sce auth status --json
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
If ontology is empty and product wants starter data:
|
|
327
|
+
|
|
328
|
+
```bash
|
|
329
|
+
sce ontology seed show --profile customer-order-demo --json
|
|
330
|
+
sce ontology seed apply --profile customer-order-demo --json
|
|
331
|
+
sce mode ontology home --app customer-order-demo --json
|
|
332
|
+
sce ontology triad summary --json
|
|
333
|
+
sce ontology er list --json
|
|
334
|
+
sce ontology br list --json
|
|
335
|
+
sce ontology dl list --json
|
|
336
|
+
```
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
# MagicBall Frontend State And Command Mapping
|
|
2
|
+
|
|
3
|
+
## Goal
|
|
4
|
+
|
|
5
|
+
Turn the current SCE integration defaults into a concrete frontend mapping table for MagicBall.
|
|
6
|
+
|
|
7
|
+
This document focuses on:
|
|
8
|
+
- page-level state ownership
|
|
9
|
+
- command-to-action mapping
|
|
10
|
+
- success / empty / error rendering rules
|
|
11
|
+
- retry and refresh behavior
|
|
12
|
+
|
|
13
|
+
Use this together with:
|
|
14
|
+
- `docs/magicball-sce-adaptation-guide.md`
|
|
15
|
+
- `docs/magicball-mode-home-and-ontology-empty-state-playbook.md`
|
|
16
|
+
- `docs/magicball-write-auth-adaptation-guide.md`
|
|
17
|
+
|
|
18
|
+
## 1. Integration Surfaces
|
|
19
|
+
|
|
20
|
+
The current frontend-sensitive surfaces are:
|
|
21
|
+
1. app bootstrap and mode-home loading
|
|
22
|
+
2. ontology empty-state and starter-seed initialization
|
|
23
|
+
3. write-error presentation and retry boundaries
|
|
24
|
+
4. timeline / task feedback handoff points
|
|
25
|
+
|
|
26
|
+
## 2. Page State Ownership
|
|
27
|
+
|
|
28
|
+
### 2.1 App Workspace Shell
|
|
29
|
+
|
|
30
|
+
This state belongs to the top-level app workspace shell.
|
|
31
|
+
|
|
32
|
+
Recommended shape:
|
|
33
|
+
|
|
34
|
+
```ts
|
|
35
|
+
interface AppWorkspaceState {
|
|
36
|
+
appKey: string
|
|
37
|
+
appBundle: Record<string, unknown> | null
|
|
38
|
+
applicationHome: Record<string, unknown> | null
|
|
39
|
+
ontologyHome: Record<string, unknown> | null
|
|
40
|
+
engineeringHome: Record<string, unknown> | null
|
|
41
|
+
engineeringDetail: Record<string, unknown> | null
|
|
42
|
+
boot: ModeBootState
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Owned commands:
|
|
47
|
+
- `sce app bundle show --app <app-key> --json`
|
|
48
|
+
- `sce mode application home --app <app-key> --json`
|
|
49
|
+
- `sce mode ontology home --app <app-key> --json`
|
|
50
|
+
- `sce mode engineering home --app <app-key> --json`
|
|
51
|
+
- `sce app engineering show --app <app-key> --json`
|
|
52
|
+
|
|
53
|
+
Rule:
|
|
54
|
+
- this shell owns mode bootstrap and should not delegate command ordering to nested tabs
|
|
55
|
+
|
|
56
|
+
### 2.2 Ontology Page State
|
|
57
|
+
|
|
58
|
+
Recommended shape:
|
|
59
|
+
|
|
60
|
+
```ts
|
|
61
|
+
interface OntologyPageState {
|
|
62
|
+
ontologyHome: Record<string, unknown> | null
|
|
63
|
+
triadSummary: Record<string, unknown> | null
|
|
64
|
+
erList: Record<string, unknown> | null
|
|
65
|
+
brList: Record<string, unknown> | null
|
|
66
|
+
dlList: Record<string, unknown> | null
|
|
67
|
+
starterSeed: {
|
|
68
|
+
suggested: boolean
|
|
69
|
+
profile: string | null
|
|
70
|
+
guidance: string | null
|
|
71
|
+
}
|
|
72
|
+
emptyState: {
|
|
73
|
+
visible: boolean
|
|
74
|
+
reason: string | null
|
|
75
|
+
}
|
|
76
|
+
seedFlow: {
|
|
77
|
+
loading: boolean
|
|
78
|
+
confirming: boolean
|
|
79
|
+
lastError: string | null
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Owned commands:
|
|
85
|
+
- `sce mode ontology home --app <app-key> --json`
|
|
86
|
+
- `sce ontology triad summary --json`
|
|
87
|
+
- `sce ontology er list --json`
|
|
88
|
+
- `sce ontology br list --json`
|
|
89
|
+
- `sce ontology dl list --json`
|
|
90
|
+
- `sce ontology seed show --profile customer-order-demo --json`
|
|
91
|
+
- `sce ontology seed apply --profile customer-order-demo --json`
|
|
92
|
+
|
|
93
|
+
Rule:
|
|
94
|
+
- ontology page owns empty-state detection and post-seed refresh chain
|
|
95
|
+
|
|
96
|
+
### 2.3 Command Failure State
|
|
97
|
+
|
|
98
|
+
Recommended shared shape:
|
|
99
|
+
|
|
100
|
+
```ts
|
|
101
|
+
interface CommandFailureState {
|
|
102
|
+
command: string
|
|
103
|
+
scope: 'read' | 'write'
|
|
104
|
+
page: string
|
|
105
|
+
stderr: string
|
|
106
|
+
stdout: string | null
|
|
107
|
+
exitCode: number | null
|
|
108
|
+
occurredAt: string
|
|
109
|
+
retryable: boolean
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Rule:
|
|
114
|
+
- preserve exact command failure data for copy, retry, and AI-assisted diagnosis
|
|
115
|
+
- do not collapse all failures into a single generic message
|
|
116
|
+
|
|
117
|
+
## 3. Bootstrap Command Mapping
|
|
118
|
+
|
|
119
|
+
| UI event | SCE command | State target | Success behavior | Failure behavior |
|
|
120
|
+
| --- | --- | --- | --- | --- |
|
|
121
|
+
| Open app workspace | `sce app bundle show --app <app-key> --json` | `appBundle` | cache app identity and bundle bindings | stop boot and show workspace-level error |
|
|
122
|
+
| Bootstrap step 1 | `sce mode application home --app <app-key> --json` | `applicationHome` | render app hero / release status | stop boot, allow step retry |
|
|
123
|
+
| Bootstrap step 2 | `sce mode ontology home --app <app-key> --json` | `ontologyHome` | render ontology summary shell | keep app section visible, allow step retry |
|
|
124
|
+
| Bootstrap step 3 | `sce mode engineering home --app <app-key> --json` | `engineeringHome` | render engineering summary shell | keep prior sections visible, allow step retry |
|
|
125
|
+
| Bootstrap step 4 | `sce app engineering show --app <app-key> --json` | `engineeringDetail` | render repo/workspace detail | keep engineering summary visible, allow step retry |
|
|
126
|
+
|
|
127
|
+
Implementation rule:
|
|
128
|
+
- all four steps execute sequentially
|
|
129
|
+
- each step updates `boot.activeStep`
|
|
130
|
+
- each success appends to `boot.completedSteps`
|
|
131
|
+
- each failure writes a `CommandFailureState`
|
|
132
|
+
|
|
133
|
+
## 4. Ontology Empty-State Mapping
|
|
134
|
+
|
|
135
|
+
| Detection input | Frontend interpretation | UI action |
|
|
136
|
+
| --- | --- | --- |
|
|
137
|
+
| `mode ontology home` returns `starter_seed` guidance | project is seed-capable | show helper text + initialize button |
|
|
138
|
+
| `ontology triad summary` shows zero/missing triads | ontology coverage is not initialized | keep summary visible, do not treat as backend failure |
|
|
139
|
+
| `er/br/dl list` all empty | ontology asset space is empty | show empty-state card |
|
|
140
|
+
| one or more lists contain items | ontology is initialized | hide empty-state card |
|
|
141
|
+
|
|
142
|
+
Empty-state visibility rule:
|
|
143
|
+
- show empty-state only when the table/list surfaces are empty and summary also indicates zero/missing coverage
|
|
144
|
+
- do not show empty-state if one of ER/BR/DL already has real items
|
|
145
|
+
|
|
146
|
+
## 5. Starter Seed Command Mapping
|
|
147
|
+
|
|
148
|
+
| UI event | SCE command | State target | Success behavior | Failure behavior |
|
|
149
|
+
| --- | --- | --- | --- | --- |
|
|
150
|
+
| Open seed confirmation | `sce ontology seed show --profile customer-order-demo --json` | `seedFlow.confirming` | show preview of starter content | allow direct apply fallback if preview fails but command is optional |
|
|
151
|
+
| Confirm initialize | `sce ontology seed apply --profile customer-order-demo --json` | `seedFlow.loading` | run post-seed refresh chain | keep empty-state card visible and preserve exact error |
|
|
152
|
+
| Refresh after seed | `sce mode ontology home --app <app-key> --json` | `ontologyHome` | update summary/seed hint | show section-level error |
|
|
153
|
+
| Refresh after seed | `sce ontology triad summary --json` | `triadSummary` | update triad readiness | show section-level error |
|
|
154
|
+
| Refresh after seed | `sce ontology er list --json` | `erList` | populate ER table | show table-level error |
|
|
155
|
+
| Refresh after seed | `sce ontology br list --json` | `brList` | populate BR table | show table-level error |
|
|
156
|
+
| Refresh after seed | `sce ontology dl list --json` | `dlList` | populate DL table | show table-level error |
|
|
157
|
+
|
|
158
|
+
Important rule:
|
|
159
|
+
- seed apply is user-triggered only
|
|
160
|
+
- refresh chain is automatic once seed apply succeeds
|
|
161
|
+
|
|
162
|
+
## 6. Error Rendering Contract
|
|
163
|
+
|
|
164
|
+
### 6.1 Read Errors
|
|
165
|
+
|
|
166
|
+
Read errors should be rendered inline at the section that failed.
|
|
167
|
+
|
|
168
|
+
Examples:
|
|
169
|
+
- ontology summary failed -> show summary card error, not full page crash
|
|
170
|
+
- ER list failed -> show ER table error, keep BR/DL areas usable
|
|
171
|
+
- engineering detail failed -> keep engineering summary visible
|
|
172
|
+
|
|
173
|
+
### 6.2 Write Errors
|
|
174
|
+
|
|
175
|
+
Write errors should expose:
|
|
176
|
+
- exact command
|
|
177
|
+
- exit code
|
|
178
|
+
- stderr
|
|
179
|
+
- retry action
|
|
180
|
+
- copy error action
|
|
181
|
+
|
|
182
|
+
Recommended write-error card fields:
|
|
183
|
+
- title
|
|
184
|
+
- short reason
|
|
185
|
+
- command snippet
|
|
186
|
+
- copy button
|
|
187
|
+
- retry button
|
|
188
|
+
- `Ask AI to help fix` action if MagicBall already supports it
|
|
189
|
+
|
|
190
|
+
### 6.3 Retry Boundary Rule
|
|
191
|
+
|
|
192
|
+
Retry only the failed operation.
|
|
193
|
+
Do not blindly rerun the entire page bootstrap or seed workflow unless the state model requires it.
|
|
194
|
+
|
|
195
|
+
## 7. Suggested UI Actions
|
|
196
|
+
|
|
197
|
+
### 7.1 Workspace Shell
|
|
198
|
+
|
|
199
|
+
Buttons:
|
|
200
|
+
- `Retry current step`
|
|
201
|
+
- `Reload app workspace`
|
|
202
|
+
- `Copy command error`
|
|
203
|
+
|
|
204
|
+
### 7.2 Ontology Empty-State Card
|
|
205
|
+
|
|
206
|
+
Buttons:
|
|
207
|
+
- `Initialize starter ontology`
|
|
208
|
+
- `Continue with empty ontology`
|
|
209
|
+
- `Retry summary`
|
|
210
|
+
|
|
211
|
+
### 7.3 Seed Failure Card
|
|
212
|
+
|
|
213
|
+
Buttons:
|
|
214
|
+
- `Retry initialization`
|
|
215
|
+
- `Copy command error`
|
|
216
|
+
- `Continue with empty ontology`
|
|
217
|
+
|
|
218
|
+
## 8. Timeline And Task Handoff
|
|
219
|
+
|
|
220
|
+
This document does not redefine task/timeline contracts.
|
|
221
|
+
Use existing SCE view contracts for those surfaces:
|
|
222
|
+
- `docs/magicball-task-feedback-timeline-guide.md`
|
|
223
|
+
- `docs/agent-runtime/magicball-contract-index.md`
|
|
224
|
+
|
|
225
|
+
Recommended connection point:
|
|
226
|
+
- when a write or seed command fails, store the exact command failure bundle so MagicBall can pass it into its AI assistant or timeline/task views later
|
|
227
|
+
|
|
228
|
+
## 9. Minimal Acceptance Checklist
|
|
229
|
+
|
|
230
|
+
MagicBall can consider this mapping implemented when:
|
|
231
|
+
- one app workspace shell owns mode bootstrap ordering
|
|
232
|
+
- one ontology page state owns empty-state detection and seed flow
|
|
233
|
+
- each failing command renders at the correct section boundary
|
|
234
|
+
- every retry button retries only one failed command
|
|
235
|
+
- every write error can be copied directly for AI-assisted diagnosis
|
|
236
|
+
|
|
237
|
+
## 10. Suggested Implementation Order
|
|
238
|
+
|
|
239
|
+
1. workspace shell boot state
|
|
240
|
+
2. serialized bootstrap commands
|
|
241
|
+
3. ontology empty-state card
|
|
242
|
+
4. seed confirmation + apply flow
|
|
243
|
+
5. section-level error cards
|
|
244
|
+
6. error copy / retry actions
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
# MagicBall Integration Doc Index
|
|
2
|
+
|
|
3
|
+
## Goal
|
|
4
|
+
|
|
5
|
+
Provide one short entry document for MagicBall engineers to know:
|
|
6
|
+
- which SCE-facing document to read first
|
|
7
|
+
- which document to use for a specific frontend concern
|
|
8
|
+
- which document is contract, checklist, tracker, or product policy
|
|
9
|
+
|
|
10
|
+
This file should stay short.
|
|
11
|
+
It is a navigation layer, not a new source of truth.
|
|
12
|
+
|
|
13
|
+
## Current Entry Set
|
|
14
|
+
|
|
15
|
+
These are the current first-line integration documents:
|
|
16
|
+
- `docs/magicball-sce-adaptation-guide.md`
|
|
17
|
+
- `docs/magicball-ui-surface-checklist.md`
|
|
18
|
+
- `docs/magicball-mode-home-and-ontology-empty-state-playbook.md`
|
|
19
|
+
- `docs/magicball-frontend-state-and-command-mapping.md`
|
|
20
|
+
- `docs/magicball-cli-invocation-examples.md`
|
|
21
|
+
- `docs/magicball-write-auth-adaptation-guide.md`
|
|
22
|
+
- `docs/magicball-task-feedback-timeline-guide.md`
|
|
23
|
+
- `docs/magicball-integration-issue-tracker.md`
|
|
24
|
+
|
|
25
|
+
## Recommended Reading Order
|
|
26
|
+
|
|
27
|
+
1. `docs/magicball-sce-adaptation-guide.md`
|
|
28
|
+
- primary integration overview
|
|
29
|
+
- command surfaces and three-mode entry model
|
|
30
|
+
|
|
31
|
+
2. `docs/magicball-adaptation-task-checklist-v1.md`
|
|
32
|
+
- implementation checklist
|
|
33
|
+
- milestone-oriented execution order
|
|
34
|
+
|
|
35
|
+
3. `docs/magicball-mode-home-and-ontology-empty-state-playbook.md`
|
|
36
|
+
- two active frontend-sensitive defaults
|
|
37
|
+
- serialized mode-home loading
|
|
38
|
+
- ontology empty-state and starter-seed behavior
|
|
39
|
+
|
|
40
|
+
4. `docs/magicball-frontend-state-and-command-mapping.md`
|
|
41
|
+
- page state ownership
|
|
42
|
+
- command-to-action mapping
|
|
43
|
+
- error and retry boundaries
|
|
44
|
+
|
|
45
|
+
5. `docs/magicball-write-auth-adaptation-guide.md`
|
|
46
|
+
- write authorization and lease handling
|
|
47
|
+
|
|
48
|
+
6. `docs/magicball-task-feedback-timeline-guide.md`
|
|
49
|
+
- task feedback cards
|
|
50
|
+
- timeline view integration
|
|
51
|
+
|
|
52
|
+
7. `docs/magicball-cli-invocation-examples.md`
|
|
53
|
+
- copy-ready CLI examples
|
|
54
|
+
- wrapper and smoke verification patterns
|
|
55
|
+
|
|
56
|
+
8. `docs/magicball-integration-issue-tracker.md`
|
|
57
|
+
- current cross-project truth
|
|
58
|
+
- only open issues, active decisions, and verified resolutions
|
|
59
|
+
|
|
60
|
+
## Use By Topic
|
|
61
|
+
|
|
62
|
+
### I need to bootstrap the three-mode app shell
|
|
63
|
+
Use:
|
|
64
|
+
- `docs/magicball-sce-adaptation-guide.md`
|
|
65
|
+
- `docs/magicball-mode-home-and-ontology-empty-state-playbook.md`
|
|
66
|
+
- `docs/magicball-frontend-state-and-command-mapping.md`
|
|
67
|
+
|
|
68
|
+
### I need to implement ontology empty-state and starter seed
|
|
69
|
+
Use:
|
|
70
|
+
- `docs/magicball-mode-home-and-ontology-empty-state-playbook.md`
|
|
71
|
+
- `docs/magicball-frontend-state-and-command-mapping.md`
|
|
72
|
+
- `docs/magicball-integration-issue-tracker.md`
|
|
73
|
+
|
|
74
|
+
### I need to implement write actions safely
|
|
75
|
+
Use:
|
|
76
|
+
- `docs/magicball-write-auth-adaptation-guide.md`
|
|
77
|
+
- `docs/magicball-frontend-state-and-command-mapping.md`
|
|
78
|
+
- `docs/magicball-cli-invocation-examples.md`
|
|
79
|
+
|
|
80
|
+
### I need copy-ready command examples for local integration
|
|
81
|
+
Use:
|
|
82
|
+
- `docs/magicball-cli-invocation-examples.md`
|
|
83
|
+
|
|
84
|
+
### I need to build task cards and timeline panels
|
|
85
|
+
Use:
|
|
86
|
+
- `docs/magicball-task-feedback-timeline-guide.md`
|
|
87
|
+
- `docs/agent-runtime/magicball-contract-index.md`
|
|
88
|
+
|
|
89
|
+
### I need to know what is still open between MagicBall and SCE
|
|
90
|
+
Use:
|
|
91
|
+
- `docs/magicball-integration-issue-tracker.md`
|
|
92
|
+
|
|
93
|
+
## Document Roles
|
|
94
|
+
|
|
95
|
+
| Document | Role | Should change often? |
|
|
96
|
+
| --- | --- | --- |
|
|
97
|
+
| `magicball-sce-adaptation-guide.md` | main overview | low |
|
|
98
|
+
| `magicball-adaptation-task-checklist-v1.md` | execution checklist | medium |
|
|
99
|
+
| `magicball-mode-home-and-ontology-empty-state-playbook.md` | frontend behavior policy | medium |
|
|
100
|
+
| `magicball-frontend-state-and-command-mapping.md` | frontend implementation mapping | medium |
|
|
101
|
+
| `magicball-write-auth-adaptation-guide.md` | auth/write behavior | low |
|
|
102
|
+
| `magicball-task-feedback-timeline-guide.md` | task/timeline integration | low |
|
|
103
|
+
| `magicball-cli-invocation-examples.md` | copy-ready command examples | medium |
|
|
104
|
+
| `magicball-integration-issue-tracker.md` | live cross-project tracker | high |
|
|
105
|
+
|
|
106
|
+
## Secondary References
|
|
107
|
+
|
|
108
|
+
These remain useful, but they are not first-read integration entry documents:
|
|
109
|
+
- `docs/magicball-capability-iteration-ui.md`
|
|
110
|
+
- `docs/magicball-capability-iteration-api.md`
|
|
111
|
+
- `docs/magicball-capability-library.md`
|
|
112
|
+
|
|
113
|
+
Use them when MagicBall is specifically implementing capability iteration / capability library flows.
|
|
114
|
+
|
|
115
|
+
## Historical Foundation Drafts
|
|
116
|
+
|
|
117
|
+
These documents are still worth keeping as architecture history, but should not drive current integration work directly:
|
|
118
|
+
- `docs/magicball-app-bundle-sqlite-and-command-draft.md`
|
|
119
|
+
- `docs/magicball-three-mode-alignment-plan.md`
|
|
120
|
+
|
|
121
|
+
If guidance in these drafts conflicts with the current entry set, prefer the current entry set.
|
|
122
|
+
|
|
123
|
+
## Current High-Priority Defaults
|
|
124
|
+
|
|
125
|
+
As of the current tracker state:
|
|
126
|
+
- `mode * home` stays serialized during `Issue 001` verification
|
|
127
|
+
- fresh ontology pages use `fallback + optional seed apply`
|
|
128
|
+
- seed apply stays explicit and user-triggered
|
|
129
|
+
- command failures should be preserved in copyable form for AI-assisted diagnosis
|
|
130
|
+
|
|
131
|
+
## Maintenance Rule
|
|
132
|
+
|
|
133
|
+
When a new MagicBall-facing SCE document is added:
|
|
134
|
+
- add it here only if it changes implementation behavior or cross-project coordination
|
|
135
|
+
- do not add deep design drafts unless they are still active implementation inputs
|
|
136
|
+
- after the current doc baseline, prefer feedback-driven updates over proactive document expansion
|
|
137
|
+
- if there is no new real integration blocker, keep the current entry set stable
|