scene-capability-engine 3.6.32 → 3.6.37

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.
Files changed (111) hide show
  1. package/CHANGELOG.md +109 -11
  2. package/README.md +119 -122
  3. package/README.zh.md +123 -121
  4. package/bin/scene-capability-engine.js +12 -1
  5. package/docs/331-poc-adaptation-roadmap.md +3 -3
  6. package/docs/README.md +21 -32
  7. package/docs/auto-refactor-index.md +384 -0
  8. package/docs/command-reference.md +99 -7
  9. package/docs/faq.md +1 -1
  10. package/docs/interactive-customization/331-poc-sce-integration-checklist.md +3 -3
  11. package/docs/interactive-customization/moqui-interactive-template-playbook.md +4 -4
  12. package/docs/interactive-customization/phase-acceptance-evidence.md +2 -2
  13. package/docs/magicball-adaptation-task-checklist-v1.md +385 -0
  14. package/docs/magicball-app-bundle-sqlite-and-command-draft.md +539 -0
  15. package/docs/magicball-capability-iteration-api.md +2 -0
  16. package/docs/magicball-capability-iteration-ui.md +2 -0
  17. package/docs/magicball-capability-library.md +2 -0
  18. package/docs/magicball-cli-invocation-examples.md +336 -0
  19. package/docs/magicball-frontend-state-and-command-mapping.md +244 -0
  20. package/docs/magicball-integration-doc-index.md +137 -0
  21. package/docs/magicball-integration-issue-tracker.md +218 -0
  22. package/docs/magicball-mode-home-and-ontology-empty-state-playbook.md +249 -0
  23. package/docs/magicball-sce-adaptation-guide.md +203 -0
  24. package/docs/magicball-three-mode-alignment-plan.md +551 -0
  25. package/docs/magicball-ui-surface-checklist.md +126 -0
  26. package/docs/magicball-write-auth-adaptation-guide.md +328 -0
  27. package/docs/moqui-standard-rebuild-guide.md +6 -6
  28. package/docs/moqui-template-core-library-playbook.md +1 -1
  29. package/docs/refactor-completion-roadmap.md +116 -0
  30. package/docs/release-checklist.md +50 -27
  31. package/docs/releases/README.md +1 -0
  32. package/docs/releases/v3.6.37.md +22 -0
  33. package/docs/steering-strategy-guide.md +7 -7
  34. package/docs/troubleshooting.md +1 -1
  35. package/docs/zh/README.md +27 -30
  36. package/docs/zh/refactor-completion-roadmap.md +116 -0
  37. package/docs/zh/release-checklist.md +40 -17
  38. package/docs/zh/releases/README.md +1 -0
  39. package/docs/zh/releases/v3.6.37.md +22 -0
  40. package/lib/app/registry-config.js +73 -0
  41. package/lib/app/registry-sync-service.js +228 -0
  42. package/lib/auto/archive-schema-service.js +276 -0
  43. package/lib/auto/archive-summary.js +60 -0
  44. package/lib/auto/batch-goal-input-service.js +543 -0
  45. package/lib/auto/batch-output.js +201 -0
  46. package/lib/auto/batch-summary-storage-service.js +110 -0
  47. package/lib/auto/close-loop-batch-service.js +116 -0
  48. package/lib/auto/close-loop-controller-service.js +287 -0
  49. package/lib/auto/close-loop-program-service.js +283 -0
  50. package/lib/auto/close-loop-recovery-service.js +191 -0
  51. package/lib/auto/close-loop-session-storage-service.js +50 -0
  52. package/lib/auto/controller-lock-service.js +55 -0
  53. package/lib/auto/controller-output.js +32 -0
  54. package/lib/auto/controller-queue-service.js +127 -0
  55. package/lib/auto/controller-session-storage-service.js +105 -0
  56. package/lib/auto/governance-advisory-service.js +208 -0
  57. package/lib/auto/governance-close-loop-service.js +411 -0
  58. package/lib/auto/governance-maintenance-presenter.js +162 -0
  59. package/lib/auto/governance-maintenance-service.js +112 -0
  60. package/lib/auto/governance-session-presenter.js +70 -0
  61. package/lib/auto/governance-session-storage-service.js +198 -0
  62. package/lib/auto/governance-signals.js +139 -0
  63. package/lib/auto/governance-stats-presenter.js +337 -0
  64. package/lib/auto/governance-stats-service.js +115 -0
  65. package/lib/auto/governance-summary.js +703 -0
  66. package/lib/auto/handoff-capability-matrix-service.js +281 -0
  67. package/lib/auto/handoff-evidence-review-service.js +251 -0
  68. package/lib/auto/handoff-release-evidence-service.js +190 -0
  69. package/lib/auto/handoff-release-gate-history-loaders-service.js +502 -0
  70. package/lib/auto/handoff-release-gate-history-service.js +257 -0
  71. package/lib/auto/handoff-reporting-service.js +1407 -0
  72. package/lib/auto/handoff-run-service.js +486 -0
  73. package/lib/auto/handoff-snapshots-service.js +645 -0
  74. package/lib/auto/observability-service.js +132 -0
  75. package/lib/auto/output-writer.js +34 -0
  76. package/lib/auto/program-auto-remediation-service.js +130 -0
  77. package/lib/auto/program-diagnostics.js +138 -0
  78. package/lib/auto/program-governance-helpers.js +306 -0
  79. package/lib/auto/program-governance-loop-service.js +413 -0
  80. package/lib/auto/program-output.js +106 -0
  81. package/lib/auto/program-summary.js +183 -0
  82. package/lib/auto/recovery-memory-service.js +684 -0
  83. package/lib/auto/recovery-selection-service.js +52 -0
  84. package/lib/auto/retention-policy.js +98 -0
  85. package/lib/auto/session-persistence-service.js +106 -0
  86. package/lib/auto/session-presenter.js +105 -0
  87. package/lib/auto/session-prune-service.js +190 -0
  88. package/lib/auto/session-query-service.js +249 -0
  89. package/lib/auto/spec-protection.js +141 -0
  90. package/lib/commands/adopt.js +4 -4
  91. package/lib/commands/app.js +911 -0
  92. package/lib/commands/assurance.js +212 -0
  93. package/lib/commands/auto.js +1093 -11065
  94. package/lib/commands/mode.js +321 -0
  95. package/lib/commands/ontology.js +415 -0
  96. package/lib/commands/pm.js +422 -0
  97. package/lib/ontology/seed-profiles.js +160 -0
  98. package/lib/spec/bootstrap/context-collector.js +1 -1
  99. package/lib/state/sce-state-store.js +3369 -1200
  100. package/lib/steering/adoption-config.js +2 -2
  101. package/lib/steering/compliance-cache.js +2 -2
  102. package/lib/steering/steering-manager.js +4 -4
  103. package/lib/task/task-claimer.js +1 -2
  104. package/lib/workspace/multi/workspace-context-resolver.js +3 -3
  105. package/lib/workspace/multi/workspace-state-manager.js +0 -164
  106. package/lib/workspace/sce-tracking-audit.js +1 -1
  107. package/lib/workspace/takeover-baseline.js +1 -1
  108. package/package.json +1 -1
  109. package/template/.sce/README.md +1 -1
  110. package/template/.sce/steering/CORE_PRINCIPLES.md +1 -1
  111. package/bin/kse.js +0 -3
@@ -0,0 +1,328 @@
1
+ # MagicBall Write Auth Adaptation Guide
2
+
3
+ ## Goal
4
+
5
+ Define how MagicBall should adapt to SCE write-authorization requirements.
6
+
7
+ This guide focuses on:
8
+ 1. which actions require authorization
9
+ 2. how MagicBall should request or reuse a lease
10
+ 3. how to pass lease information to SCE
11
+ 4. how to handle denied / expired / invalid lease errors
12
+
13
+ This guide is intentionally frontend-oriented.
14
+
15
+ ## Current SCE Authorization Model
16
+
17
+ SCE uses a write-authorization layer centered on:
18
+ - policy file: `.sce/config/authorization-policy.json`
19
+ - lease storage: `.sce/state/sce-state.sqlite`
20
+ - commands:
21
+ - `sce auth grant`
22
+ - `sce auth status`
23
+ - `sce auth revoke`
24
+
25
+ The runtime enforcement entry is:
26
+ - `ensureWriteAuthorization(...)`
27
+
28
+ ## What MagicBall Should Assume By Default
29
+
30
+ MagicBall should assume:
31
+ 1. read operations do not require lease
32
+ 2. write operations may require lease
33
+ 3. the exact enforcement depends on SCE policy
34
+ 4. frontend must not guess policy internals from static assumptions
35
+
36
+ Therefore, MagicBall should design write flows as:
37
+ - optimistic if lease exists
38
+ - blocked-with-guidance if lease is missing or invalid
39
+
40
+ ## SCE Commands Relevant To Auth
41
+
42
+ ### Grant lease
43
+ ```bash
44
+ sce auth grant --scope <scope> --reason "<reason>" --json
45
+ ```
46
+
47
+ ### Inspect lease status
48
+ ```bash
49
+ sce auth status --json
50
+ sce auth status --lease <lease-id> --json
51
+ ```
52
+
53
+ ### Revoke lease
54
+ ```bash
55
+ sce auth revoke --lease <lease-id> --json
56
+ ```
57
+
58
+ ## Scopes MagicBall Should Care About
59
+
60
+ Current implemented write flows in SCE imply these practical action families:
61
+
62
+ ### App / mode related
63
+ - `app:bundle:register`
64
+ - `app:registry:configure`
65
+ - `app:engineering:attach`
66
+ - `app:engineering:hydrate`
67
+ - `app:engineering:activate`
68
+ - `app:runtime:install`
69
+ - `app:runtime:activate`
70
+
71
+ ### Engineering mode PM data plane
72
+ - `pm:requirement:upsert`
73
+ - `pm:tracking:upsert`
74
+ - `pm:planning:upsert`
75
+ - `pm:change:upsert`
76
+ - `pm:issue:upsert`
77
+
78
+ ### Ontology mode data plane
79
+ - `ontology:er:upsert`
80
+ - `ontology:br:upsert`
81
+ - `ontology:dl:upsert`
82
+
83
+ ### Existing studio/task actions
84
+ - `studio:apply`
85
+ - `studio:release`
86
+ - `studio:rollback`
87
+ - `task:rerun`
88
+
89
+ ## Recommended MagicBall UI Rule
90
+
91
+ ### Rule 1
92
+ Treat all mutating actions as lease-aware actions.
93
+
94
+ ### Rule 2
95
+ Do not hide all write buttons permanently.
96
+ Instead:
97
+ - show action button
98
+ - if no valid lease is present, show locked state or auth prompt before execution
99
+
100
+ ### Rule 3
101
+ For dangerous write actions, require an explicit authorization step even if the button is visible.
102
+
103
+ ## Recommended Frontend State Model
104
+
105
+ MagicBall should keep a lightweight authorization state model:
106
+
107
+ ```ts
108
+ interface WriteLeaseState {
109
+ leaseId: string | null
110
+ subject: string | null
111
+ role: string | null
112
+ scope: string[]
113
+ expiresAt: string | null
114
+ revokedAt: string | null
115
+ active: boolean
116
+ stale: boolean
117
+ }
118
+ ```
119
+
120
+ Recommended derived flags:
121
+ - `hasLease`
122
+ - `leaseActive`
123
+ - `leaseExpired`
124
+ - `scopeSatisfied(action)`
125
+
126
+ ## Recommended Frontend Flow
127
+
128
+ ### 1. Startup / app switch
129
+ When MagicBall starts or switches app/project context:
130
+ 1. call `sce auth status --json`
131
+ 2. cache active leases
132
+ 3. derive whether current user/session can write
133
+
134
+ ### 2. Before a write action
135
+ When user clicks a write action:
136
+ 1. map UI action to SCE action scope
137
+ 2. check local cached lease state
138
+ 3. if lease exists and scope matches, execute command with `--auth-lease <lease-id>`
139
+ 4. if lease missing or insufficient, open auth prompt flow
140
+
141
+ ### 3. Auth prompt flow
142
+ Recommended UI steps:
143
+ 1. show why authorization is required
144
+ 2. show requested action scope
145
+ 3. ask user to authorize
146
+ 4. execute `sce auth grant ... --json`
147
+ 5. cache returned `lease_id`
148
+ 6. retry original write action with `--auth-lease`
149
+
150
+ ## Suggested UI Copy Pattern
151
+
152
+ ### Locked action hint
153
+ - `This action requires SCE write authorization.`
154
+ - `Requested scope: pm:requirement:upsert`
155
+
156
+ ### Grant dialog content
157
+ - `Action`: human-readable action name
158
+ - `Requested scope`: exact SCE scope string
159
+ - `Reason`: user-editable reason text
160
+ - `Password`: if needed by policy
161
+
162
+ ### Success hint
163
+ - `Write authorization granted for 15 minutes.`
164
+
165
+ ### Failure hint
166
+ - `Authorization failed. Check password, lease policy, or requested scope.`
167
+
168
+ ## Recommended Scope Mapping Table
169
+
170
+ | MagicBall UI action | SCE command | Required scope |
171
+ | --- | --- | --- |
172
+ | Save app bundle | `sce app bundle register` | `app:bundle:register` |
173
+ | Update registry config | `sce app registry configure` | `app:registry:configure` |
174
+ | Attach engineering project | `sce app engineering attach` | `app:engineering:attach` |
175
+ | Hydrate engineering workspace | `sce app engineering hydrate` | `app:engineering:hydrate` |
176
+ | Activate engineering workspace | `sce app engineering activate` | `app:engineering:activate` |
177
+ | Install runtime release | `sce app runtime install` | `app:runtime:install` |
178
+ | Activate runtime release | `sce app runtime activate` | `app:runtime:activate` |
179
+ | Save requirement | `sce pm requirement upsert` | `pm:requirement:upsert` |
180
+ | Save tracking item | `sce pm tracking upsert` | `pm:tracking:upsert` |
181
+ | Save plan | `sce pm planning upsert` | `pm:planning:upsert` |
182
+ | Save change request | `sce pm change upsert` | `pm:change:upsert` |
183
+ | Save issue item | `sce pm issue upsert` | `pm:issue:upsert` |
184
+ | Save ER asset | `sce ontology er upsert` | `ontology:er:upsert` |
185
+ | Save BR rule | `sce ontology br upsert` | `ontology:br:upsert` |
186
+ | Save DL chain | `sce ontology dl upsert` | `ontology:dl:upsert` |
187
+ | Apply studio change | `sce studio apply` | `studio:apply` |
188
+ | Release studio result | `sce studio release` | `studio:release` |
189
+ | Rollback studio result | `sce studio rollback` | `studio:rollback` |
190
+ | Rerun task | `sce task rerun` | `task:rerun` |
191
+
192
+ ## Recommended Grant Command Patterns
193
+
194
+ ### Generic lease
195
+ ```bash
196
+ sce auth grant --scope app:runtime:activate --reason "activate selected runtime release" --json
197
+ ```
198
+
199
+ ### Multiple scopes if one workflow batches mutations
200
+ ```bash
201
+ sce auth grant --scope app:engineering:attach,app:engineering:hydrate,app:engineering:activate --reason "initialize engineering workspace" --json
202
+ ```
203
+
204
+ ## How MagicBall Should Pass Lease To SCE
205
+
206
+ For every write command, pass:
207
+ - `--auth-lease <lease-id>`
208
+
209
+ Example:
210
+ ```bash
211
+ sce pm requirement upsert --input requirement.json --auth-lease <lease-id> --json
212
+ ```
213
+
214
+ ## Error Handling Rules
215
+
216
+ MagicBall should not treat all write failures the same.
217
+
218
+ ### Case A: lease required
219
+ Typical symptom:
220
+ - error mentions `Write authorization required`
221
+ - or says lease is required for action
222
+
223
+ Frontend action:
224
+ 1. keep form state intact
225
+ 2. open authorization prompt
226
+ 3. let user retry after grant
227
+
228
+ ### Case B: lease not found
229
+ Typical symptom:
230
+ - error mentions `lease not found`
231
+
232
+ Frontend action:
233
+ 1. clear cached lease id
234
+ 2. force refresh auth status
235
+ 3. reopen grant flow
236
+
237
+ ### Case C: lease expired / revoked
238
+ Typical symptom:
239
+ - error mentions expired / revoked / inactive lease
240
+
241
+ Frontend action:
242
+ 1. mark local lease stale
243
+ 2. force refresh auth status
244
+ 3. ask user to grant again
245
+
246
+ ### Case D: scope mismatch
247
+ Typical symptom:
248
+ - authorization denied for action despite active lease
249
+
250
+ Frontend action:
251
+ 1. show requested scope
252
+ 2. request a new lease with broader or correct scope
253
+
254
+ ### Case E: business validation error
255
+ Typical symptom:
256
+ - payload/field/schema validation failure
257
+ - no auth wording in error message
258
+
259
+ Frontend action:
260
+ 1. do not reopen auth flow
261
+ 2. keep current form state
262
+ 3. show validation feedback only
263
+
264
+ ## Recommended Frontend State Machine
265
+
266
+ ```text
267
+ idle
268
+ -> checking_lease
269
+ -> lease_ready
270
+ -> lease_missing
271
+ -> requesting_lease
272
+ -> lease_granted
273
+ -> executing_write
274
+ -> write_succeeded
275
+ -> write_failed_auth
276
+ -> write_failed_validation
277
+ ```
278
+
279
+ ## Minimal Frontend Implementation Checklist
280
+
281
+ ### Required now
282
+ 1. local lease cache
283
+ 2. `auth status` fetch on startup / app switch
284
+ 3. action-to-scope mapping table
285
+ 4. shared auth prompt dialog
286
+ 5. automatic retry of blocked action after successful grant
287
+
288
+ ### Can wait
289
+ 1. lease auto-refresh before expiry
290
+ 2. batch lease orchestration for multi-step workflows
291
+ 3. lease history panel
292
+ 4. revoke button in UI
293
+
294
+ ## Recommended MagicBall Button Policy
295
+
296
+ ### Safe read-only buttons
297
+ - always enabled
298
+
299
+ ### Write buttons with no lease
300
+ - visible
301
+ - disabled or soft-blocked
302
+ - click opens auth dialog
303
+
304
+ ### Write buttons with valid lease
305
+ - enabled
306
+ - execute command with `--auth-lease`
307
+
308
+ ### High-risk buttons
309
+ Examples:
310
+ - runtime activate
311
+ - engineering activate
312
+ - studio release
313
+ - backup restore
314
+
315
+ Recommended behavior:
316
+ - keep visible
317
+ - require explicit confirmation even with valid lease
318
+
319
+ ## Practical Conclusion
320
+
321
+ MagicBall should now implement write authorization as a shared UI capability, not as page-by-page special handling.
322
+
323
+ The most important thing is:
324
+ - centralize scope mapping
325
+ - centralize lease state
326
+ - centralize retry-after-grant flow
327
+
328
+ That will keep all app/runtime/pm/ontology/studio write flows consistent.
@@ -84,12 +84,12 @@ Defaults: `ready>=6`, `partial<=0`, `gap<=0`.
84
84
 
85
85
  ## Default Moqui Template Matrix
86
86
 
87
- - `kse.scene--moqui-entity-model-core--0.1.0`
88
- - `kse.scene--moqui-service-contract-core--0.1.0`
89
- - `kse.scene--moqui-screen-flow-core--0.1.0`
90
- - `kse.scene--moqui-form-interaction-core--0.1.0`
91
- - `kse.scene--moqui-rule-decision-core--0.1.0`
92
- - `kse.scene--moqui-page-copilot-dialog--0.1.0`
87
+ - `sce.scene--moqui-entity-model-core--0.1.0`
88
+ - `sce.scene--moqui-service-contract-core--0.1.0`
89
+ - `sce.scene--moqui-screen-flow-core--0.1.0`
90
+ - `sce.scene--moqui-form-interaction-core--0.1.0`
91
+ - `sce.scene--moqui-rule-decision-core--0.1.0`
92
+ - `sce.scene--moqui-page-copilot-dialog--0.1.0`
93
93
 
94
94
  ## Next Step for Business Project
95
95
 
@@ -201,7 +201,7 @@ sce auto close-loop-batch .sce/auto/ontology-remediation.lines --format lines --
201
201
 
202
202
  Stage-D baseline package for the interactive business customization loop:
203
203
 
204
- - `kse.scene--moqui-interactive-customization-loop--0.1.0`
204
+ - `sce.scene--moqui-interactive-customization-loop--0.1.0`
205
205
 
206
206
  This package captures:
207
207
 
@@ -0,0 +1,116 @@
1
+ # Refactor Completion And Next Roadmap
2
+
3
+ ## Scope
4
+
5
+ This document records the completion state of the `3.6.33` refactor round and defines the next engineering direction.
6
+
7
+ Current stable commits:
8
+
9
+ - `0c9594d` `refactor(auto): finalize close-loop governance split and docs refresh`
10
+ - `0fb49b7` `refactor(handoff): extract capability matrix service`
11
+ - `8ebc5bc` `release: 3.6.33`
12
+
13
+ ## What Is Considered Done
14
+
15
+ This refactor round is considered complete because the main autonomous delivery chain is no longer centered in `lib/commands/auto.js`.
16
+
17
+ Completed extractions:
18
+
19
+ - `lib/auto/close-loop-controller-service.js`
20
+ - `lib/auto/close-loop-batch-service.js`
21
+ - `lib/auto/close-loop-program-service.js`
22
+ - `lib/auto/observability-service.js`
23
+ - `lib/auto/program-summary.js`
24
+ - `lib/auto/program-output.js`
25
+ - `lib/auto/batch-output.js`
26
+ - `lib/auto/program-governance-helpers.js`
27
+ - `lib/auto/program-governance-loop-service.js`
28
+ - `lib/auto/program-auto-remediation-service.js`
29
+ - `lib/auto/output-writer.js`
30
+ - `lib/auto/handoff-capability-matrix-service.js`
31
+
32
+ Supporting cleanup completed in the same round:
33
+
34
+ - README and docs hub restructuring
35
+ - governance summary regression fix
36
+ - governance weekly-ops session telemetry fix
37
+ - session stats `criteria.days` fix
38
+
39
+ ## Resulting Architecture Shift
40
+
41
+ Before this round:
42
+
43
+ - `lib/commands/auto.js` contained both command registration and most major orchestration logic.
44
+ - changes to program or governance behavior were high-risk because too many concerns were coupled.
45
+
46
+ After this round:
47
+
48
+ - `lib/commands/auto.js` is primarily a command-layer shell plus wrappers.
49
+ - major delivery orchestration now lives under `lib/auto/`.
50
+ - the first `auto-handoff` subdomain now has a dedicated service boundary.
51
+
52
+ This is the practical reason the round is treated as complete even though `auto.js` is still large.
53
+
54
+ ## Why Some Work Was Explicitly Deferred
55
+
56
+ Not every remaining function in `lib/commands/auto.js` should be extracted immediately.
57
+
58
+ Deferred on purpose:
59
+
60
+ - low-value helper moves with poor payoff
61
+ - unstable `auto-handoff` micro-extractions that increased regression risk
62
+ - cosmetic-only reductions that do not improve long-term maintainability
63
+
64
+ The rule used during this round was:
65
+
66
+ - keep extractions that create durable service boundaries
67
+ - stop when the next move becomes lower value than the regression risk it introduces
68
+
69
+ ## Remaining High-Value Areas
70
+
71
+ The next meaningful work is no longer the close-loop main path. It is concentrated in `auto-handoff` and a few release/governance support areas.
72
+
73
+ Highest-value remaining themes:
74
+
75
+ 1. `auto-handoff` release evidence and history services
76
+ 2. `auto-handoff` release note / evidence review renderers
77
+ 3. `auto-handoff` baseline and coverage snapshot services
78
+ 4. final documentation and release process hardening
79
+
80
+ ## Recommended Next Round
81
+
82
+ The next round should be treated as a focused `auto-handoff` refactor, not a continuation of generic `auto.js` cleanup.
83
+
84
+ Recommended order:
85
+
86
+ 1. `release evidence` subdomain
87
+ 2. `release gate history` subdomain
88
+ 3. `release note / evidence review` rendering subdomain
89
+ 4. `baseline / coverage snapshot` subdomain
90
+
91
+ Each subdomain should follow the same rule used in `3.6.33`:
92
+
93
+ - extract one coherent service boundary
94
+ - keep command behavior unchanged
95
+ - require unit coverage for the new module
96
+ - require guarded integration coverage before keeping the change
97
+
98
+ ## Validation Baseline
99
+
100
+ The following checks were used to accept the current refactor round:
101
+
102
+ - `npx jest tests/unit/auto --runInBand`
103
+ - `npx jest tests/unit/commands/auto.test.js --runInBand`
104
+ - `npx jest tests/integration/auto-close-loop-cli.integration.test.js tests/integration/version-cli.integration.test.js --runInBand`
105
+ - `npm run test:release`
106
+
107
+ Any next round should continue to use these as the minimum baseline.
108
+
109
+ ## Release Status
110
+
111
+ Current stable release:
112
+
113
+ - version: `3.6.33`
114
+ - tag: `v3.6.33`
115
+
116
+ This version is the baseline for future `auto-handoff` evolution.
@@ -115,41 +115,48 @@ Verify:
115
115
 
116
116
  Ensure:
117
117
 
118
+ - Release automation is tag-driven, not commit-driven:
119
+ - `.github/workflows/release.yml` only triggers on `push.tags: v*`
120
+ - plain `git push` runs normal CI and does not publish npm/GitHub release
121
+ - GitHub Actions publish prerequisites are in place:
122
+ - repository secret `NPM_TOKEN` must exist and remain valid for `npm publish --access public`
123
+ - `GITHUB_TOKEN` is used by workflow for release asset/readback steps
118
124
  - `package.json` version is correct.
125
+ - `package.json` version must be greater than the currently published npm version.
119
126
  - `CHANGELOG.md` includes release-relevant entries.
120
127
  - Release notes draft exists (for example `docs/releases/vX.Y.Z.md`).
121
128
  - Optional: configure release evidence gate with repository variables (`Settings -> Secrets and variables -> Actions -> Variables`):
122
- - `KSE_RELEASE_GATE_ENFORCE`: `true|false` (default advisory, non-blocking)
123
- - `KSE_RELEASE_GATE_REQUIRE_EVIDENCE`: require `handoff-runs.json` summary
124
- - `KSE_RELEASE_GATE_REQUIRE_GATE_PASS`: require evidence gate `passed=true` (default true when evidence exists)
125
- - `KSE_RELEASE_GATE_MIN_SPEC_SUCCESS_RATE`: minimum allowed success rate percent
126
- - `KSE_RELEASE_GATE_MAX_RISK_LEVEL`: `low|medium|high|unknown` (default `unknown`)
127
- - `KSE_RELEASE_GATE_MAX_UNMAPPED_RULES`: maximum allowed unmapped ontology business rules
128
- - `KSE_RELEASE_GATE_MAX_UNDECIDED_DECISIONS`: maximum allowed undecided ontology decisions
129
- - `KSE_RELEASE_GATE_REQUIRE_SCENE_BATCH_PASS`: require scene package publish-batch gate passed (`true|false`, default `true`)
130
- - `KSE_RELEASE_GATE_MAX_SCENE_BATCH_FAILURES`: maximum allowed scene package batch failure count (default `0`)
129
+ - `SCE_RELEASE_GATE_ENFORCE`: `true|false` (default advisory, non-blocking)
130
+ - `SCE_RELEASE_GATE_REQUIRE_EVIDENCE`: require `handoff-runs.json` summary
131
+ - `SCE_RELEASE_GATE_REQUIRE_GATE_PASS`: require evidence gate `passed=true` (default true when evidence exists)
132
+ - `SCE_RELEASE_GATE_MIN_SPEC_SUCCESS_RATE`: minimum allowed success rate percent
133
+ - `SCE_RELEASE_GATE_MAX_RISK_LEVEL`: `low|medium|high|unknown` (default `unknown`)
134
+ - `SCE_RELEASE_GATE_MAX_UNMAPPED_RULES`: maximum allowed unmapped ontology business rules
135
+ - `SCE_RELEASE_GATE_MAX_UNDECIDED_DECISIONS`: maximum allowed undecided ontology decisions
136
+ - `SCE_RELEASE_GATE_REQUIRE_SCENE_BATCH_PASS`: require scene package publish-batch gate passed (`true|false`, default `true`)
137
+ - `SCE_RELEASE_GATE_MAX_SCENE_BATCH_FAILURES`: maximum allowed scene package batch failure count (default `0`)
131
138
  - Optional: tune release drift alerts in release notes:
132
139
  - Drift evaluation is executed by `scripts/release-drift-evaluate.js` in CI (history load, alert calc, gate report writeback, enforce exit code).
133
- - `KSE_RELEASE_DRIFT_ENFORCE`: `true|false` (default `false`), block publish when drift alerts are triggered
134
- - `KSE_RELEASE_DRIFT_FAIL_STREAK_MIN`: minimum consecutive failed gates to trigger alert (default `2`)
135
- - `KSE_RELEASE_DRIFT_HIGH_RISK_SHARE_MIN_PERCENT`: minimum high-risk share in latest 5 versions (default `60`)
136
- - `KSE_RELEASE_DRIFT_HIGH_RISK_SHARE_DELTA_MIN_PERCENT`: minimum short-vs-long high-risk share delta (default `25`)
137
- - `KSE_RELEASE_DRIFT_PREFLIGHT_BLOCK_RATE_MIN_PERCENT`: minimum release preflight blocked rate in latest 5 known runs (default `40`)
138
- - `KSE_RELEASE_DRIFT_HARD_GATE_BLOCK_STREAK_MIN`: minimum consecutive hard-gate preflight blocked streak (latest window, default `2`)
139
- - `KSE_RELEASE_DRIFT_PREFLIGHT_UNAVAILABLE_STREAK_MIN`: minimum consecutive release preflight unavailable streak (latest window, default `2`)
140
+ - `SCE_RELEASE_DRIFT_ENFORCE`: `true|false` (default `false`), block publish when drift alerts are triggered
141
+ - `SCE_RELEASE_DRIFT_FAIL_STREAK_MIN`: minimum consecutive failed gates to trigger alert (default `2`)
142
+ - `SCE_RELEASE_DRIFT_HIGH_RISK_SHARE_MIN_PERCENT`: minimum high-risk share in latest 5 versions (default `60`)
143
+ - `SCE_RELEASE_DRIFT_HIGH_RISK_SHARE_DELTA_MIN_PERCENT`: minimum short-vs-long high-risk share delta (default `25`)
144
+ - `SCE_RELEASE_DRIFT_PREFLIGHT_BLOCK_RATE_MIN_PERCENT`: minimum release preflight blocked rate in latest 5 known runs (default `40`)
145
+ - `SCE_RELEASE_DRIFT_HARD_GATE_BLOCK_STREAK_MIN`: minimum consecutive hard-gate preflight blocked streak (latest window, default `2`)
146
+ - `SCE_RELEASE_DRIFT_PREFLIGHT_UNAVAILABLE_STREAK_MIN`: minimum consecutive release preflight unavailable streak (latest window, default `2`)
140
147
  - Optional: tune weekly ops release gate:
141
- - `KSE_RELEASE_WEEKLY_OPS_ENFORCE`: `true|false` (default `true`)
142
- - `KSE_RELEASE_WEEKLY_OPS_REQUIRE_SUMMARY`: require weekly summary artifact (`true|false`, default `true`)
143
- - `KSE_RELEASE_WEEKLY_OPS_MAX_RISK_LEVEL`: `low|medium|high|unknown` (default `medium`)
144
- - `KSE_RELEASE_WEEKLY_OPS_MAX_GOVERNANCE_BREACHES`: optional max breach count
145
- - `KSE_RELEASE_WEEKLY_OPS_MAX_AUTHORIZATION_TIER_BLOCK_RATE_PERCENT`: max authorization-tier deny/review block rate percent (default `40`)
146
- - `KSE_RELEASE_WEEKLY_OPS_MAX_DIALOGUE_AUTHORIZATION_BLOCK_RATE_PERCENT`: max dialogue-authorization block rate percent (default `40`)
147
- - `KSE_RELEASE_WEEKLY_OPS_MAX_MATRIX_REGRESSION_RATE_PERCENT`: optional max regression-positive rate percent
148
+ - `SCE_RELEASE_WEEKLY_OPS_ENFORCE`: `true|false` (default `true`)
149
+ - `SCE_RELEASE_WEEKLY_OPS_REQUIRE_SUMMARY`: require weekly summary artifact (`true|false`, default `true`)
150
+ - `SCE_RELEASE_WEEKLY_OPS_MAX_RISK_LEVEL`: `low|medium|high|unknown` (default `medium`)
151
+ - `SCE_RELEASE_WEEKLY_OPS_MAX_GOVERNANCE_BREACHES`: optional max breach count
152
+ - `SCE_RELEASE_WEEKLY_OPS_MAX_AUTHORIZATION_TIER_BLOCK_RATE_PERCENT`: max authorization-tier deny/review block rate percent (default `40`)
153
+ - `SCE_RELEASE_WEEKLY_OPS_MAX_DIALOGUE_AUTHORIZATION_BLOCK_RATE_PERCENT`: max dialogue-authorization block rate percent (default `40`)
154
+ - `SCE_RELEASE_WEEKLY_OPS_MAX_MATRIX_REGRESSION_RATE_PERCENT`: optional max regression-positive rate percent
148
155
  - Invalid numeric values are reported as gate `config_warnings` and default threshold fallback is applied.
149
156
  - Optional: tune release asset integrity gate:
150
- - `KSE_RELEASE_ASSET_INTEGRITY_ENFORCE`: `true|false` (default `true`)
151
- - `KSE_RELEASE_ASSET_INTEGRITY_REQUIRE_NON_EMPTY`: `true|false` (default `true`)
152
- - `KSE_RELEASE_ASSET_INTEGRITY_REQUIRED_FILES`: override required asset list (comma-separated, supports `{tag}`)
157
+ - `SCE_RELEASE_ASSET_INTEGRITY_ENFORCE`: `true|false` (default `true`)
158
+ - `SCE_RELEASE_ASSET_INTEGRITY_REQUIRE_NON_EMPTY`: `true|false` (default `true`)
159
+ - `SCE_RELEASE_ASSET_INTEGRITY_REQUIRED_FILES`: override required asset list (comma-separated, supports `{tag}`)
153
160
  - Optional release-asset 0-byte guard (enabled in workflow by default):
154
161
  - `scripts/release-asset-nonempty-normalize.js` auto-fills placeholder content for optional assets such as `.lines` and `.jsonl` before GitHub Release upload.
155
162
  - Local dry-run example:
@@ -159,4 +166,20 @@ Ensure:
159
166
  - Optional local dry-run for gate history index artifact:
160
167
  - `sce auto handoff gate-index --dir .sce/reports/release-evidence --out .sce/reports/release-evidence/release-gate-history.json --json`
161
168
 
162
- Then proceed with your release workflow (tag, push, npm publish, GitHub release).
169
+ Then proceed with your release workflow:
170
+
171
+ ```bash
172
+ # 1. bump version + commit first
173
+ # 2. push branch changes
174
+ git push origin main
175
+
176
+ # 3. create and push release tag
177
+ git tag vX.Y.Z
178
+ git push origin vX.Y.Z
179
+ ```
180
+
181
+ Expected:
182
+
183
+ - `git push origin main` only runs normal CI.
184
+ - `git push origin vX.Y.Z` triggers GitHub Actions `Release` workflow.
185
+ - workflow publishes npm package and creates GitHub Release if all release gates pass.
@@ -9,6 +9,7 @@ This directory stores release-facing documents:
9
9
  ## Archived Versions
10
10
 
11
11
  - [Release checklist](../release-checklist.md)
12
+ - [v3.6.37 release notes](./v3.6.37.md)
12
13
  - [v1.46.2 release notes](./v1.46.2.md) (historical)
13
14
  - [v1.46.2 validation report](./v1.46.2-validation.md) (historical)
14
15
  - [GitHub Releases](https://github.com/heguangyong/scene-capability-engine/releases) (latest)
@@ -0,0 +1,22 @@
1
+ # v3.6.37 Release Notes
2
+
3
+ Release date: 2026-03-12
4
+
5
+ ## Highlights
6
+
7
+ - Removed legacy `kse` command/content references from active runtime paths, templates, fixtures, and release-facing documentation without keeping a compatibility bridge.
8
+ - Standardized scene package/template metadata and fixture paths on `sce` naming so generated artifacts no longer leak old `kse` identifiers.
9
+ - Fixed Windows release preflight for `scripts/git-managed-gate.js` by adding `git.cmd` / `git.exe` fallback resolution.
10
+ - Documented the actual release trigger model: only `v*` tag pushes trigger GitHub Actions release publishing, and workflow publishing depends on repository secret `NPM_TOKEN`.
11
+
12
+ ## Verification
13
+
14
+ - `npx jest tests/unit/workspace/workspace-context-resolver.test.js tests/unit/workspace/workspace-state-manager.test.js tests/unit/steering/compliance-cache.test.js tests/unit/scripts/moqui-lexicon-audit.test.js tests/unit/scripts/moqui-standard-rebuild.test.js tests/unit/scripts/moqui-metadata-extract.test.js tests/unit/task/task-claimer.test.js tests/unit/commands/auto.test.js tests/integration/auto-close-loop-cli.integration.test.js --runInBand`
15
+ - `node scripts/check-branding-consistency.js`
16
+ - `npx jest tests/unit/scripts/git-managed-gate.test.js --runInBand`
17
+
18
+ ## Release Notes
19
+
20
+ - Plain `git push` does not publish this project.
21
+ - Release automation starts only when `git push origin vX.Y.Z` triggers `.github/workflows/release.yml`.
22
+ - GitHub Actions publish requires repository secret `NPM_TOKEN`.
@@ -64,14 +64,14 @@ Detect existing steering files
64
64
 
65
65
  └─ Steering files found → Prompt for strategy
66
66
 
67
- ├─ use-kse → Backup existing → Install sce steering
67
+ ├─ use-sce → Backup existing → Install sce steering
68
68
 
69
69
  └─ use-project → Keep existing → Skip sce steering
70
70
  ```
71
71
 
72
72
  ## Rollback
73
73
 
74
- If you chose "use-kse" and want to restore your original steering files:
74
+ If you chose "use-sce" and want to restore your original steering files:
75
75
 
76
76
  ```bash
77
77
  # List available backups
@@ -100,7 +100,7 @@ Your steering strategy choice is saved in `.sce/adoption-config.json`:
100
100
  {
101
101
  "version": "1.0.0",
102
102
  "adoptedAt": "2026-01-23T10:00:00.000Z",
103
- "steeringStrategy": "use-kse",
103
+ "steeringStrategy": "use-sce",
104
104
  "steeringBackupId": "steering-2026-01-23T10-00-00-000Z",
105
105
  "multiUserMode": false,
106
106
  "lastUpdated": "2026-01-23T10:00:00.000Z"
@@ -111,7 +111,7 @@ Your steering strategy choice is saved in `.sce/adoption-config.json`:
111
111
 
112
112
  ### For New sce Users
113
113
 
114
- 1. **Choose "use-kse"** to get the full experience
114
+ 1. **Choose "use-sce"** to get the full experience
115
115
  2. Review the installed steering files to understand sce workflow
116
116
  3. Customize `ENVIRONMENT.md` for your project specifics
117
117
  4. Update `CURRENT_CONTEXT.md` as you work on different Specs
@@ -123,7 +123,7 @@ Your steering strategy choice is saved in `.sce/adoption-config.json`:
123
123
  3. Consider creating a hybrid approach:
124
124
  - Keep your core steering rules
125
125
  - Add sce-specific rules in separate files
126
- - Use file naming to control load order (e.g., `00-core.md`, `10-kse.md`)
126
+ - Use file naming to control load order (e.g., `00-core.md`, `10-sce.md`)
127
127
 
128
128
  ### For Teams
129
129
 
@@ -138,13 +138,13 @@ Your steering strategy choice is saved in `.sce/adoption-config.json`:
138
138
 
139
139
  **Solution:**
140
140
  - Check which steering strategy you chose: `cat .sce/adoption-config.json`
141
- - If "use-kse", verify sce steering files are present
141
+ - If "use-sce", verify sce steering files are present
142
142
  - If "use-project", ensure your steering files are compatible with sce
143
143
 
144
144
  ### Problem: Want to switch strategies after adoption
145
145
 
146
146
  **Solution:**
147
- 1. If currently "use-kse":
147
+ 1. If currently "use-sce":
148
148
  ```bash
149
149
  sce rollback {steering-backup-id}
150
150
  ```
@@ -1045,7 +1045,7 @@ ls -la .sce/
1045
1045
 
1046
1046
  **4. Community:**
1047
1047
  - Discord: [Join our Discord](https://discord.gg/sce)
1048
- - Twitter: [@kse_dev](https://twitter.com/kse_dev)
1048
+ - Twitter: [@sce_dev](https://twitter.com/sce_dev)
1049
1049
 
1050
1050
  ### Creating a Good Issue Report
1051
1051