cabloy 5.1.60 → 5.1.62

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 (232) hide show
  1. package/.claude/hooks/contract-loop-gate.ts +296 -0
  2. package/.claude/settings.json +16 -0
  3. package/.claude/skills/cabloy-backend-scaffold/SKILL.md +2 -0
  4. package/.claude/skills/cabloy-backend-scaffold/references/follow-up-checklist.md +1 -0
  5. package/.claude/skills/cabloy-contract-loop/SKILL.md +89 -16
  6. package/.claude/skills/cabloy-contract-loop/references/contract-loop-map.md +102 -14
  7. package/.claude/skills/cabloy-contract-loop/references/resource-custom-state-pattern.md +4 -0
  8. package/.claude/skills/cabloy-contract-loop/references/verification-checklist.md +32 -14
  9. package/.claude/skills/cabloy-domain-planning/SKILL.md +212 -0
  10. package/.claude/skills/cabloy-frontend-scaffold/SKILL.md +13 -0
  11. package/.claude/skills/cabloy-frontend-scaffold/references/follow-up-checklist.md +2 -0
  12. package/.claude/skills/cabloy-module-removal/SKILL.md +144 -0
  13. package/.claude/skills/cabloy-resource-field-update/SKILL.md +7 -0
  14. package/.claude/skills/cabloy-zova-source-reading/SKILL.md +221 -0
  15. package/.claude/skills/cabloy-zova-source-reading/references/analysis-modes.md +91 -0
  16. package/.claude/skills/cabloy-zova-source-reading/references/core-reading-paths.md +117 -0
  17. package/CHANGELOG.md +64 -0
  18. package/CLAUDE.md +11 -0
  19. package/cabloy-docs/.vitepress/config.mjs +197 -5
  20. package/cabloy-docs/ai/cli-to-skill-map.md +7 -0
  21. package/cabloy-docs/ai/docs-skills-rules-mapping.md +22 -0
  22. package/cabloy-docs/ai/future-skill-roadmap.md +12 -7
  23. package/cabloy-docs/ai/introduction.md +1 -0
  24. package/cabloy-docs/ai/playbook-backend-module.md +6 -0
  25. package/cabloy-docs/ai/playbook-module-removal.md +164 -0
  26. package/cabloy-docs/ai/skills.md +12 -0
  27. package/cabloy-docs/backend/backend-contract-emission-output-inspection.md +189 -0
  28. package/cabloy-docs/backend/backend-contract-emission-source-reading-map.md +160 -0
  29. package/cabloy-docs/backend/backend-contract-emission-specimen.md +170 -0
  30. package/cabloy-docs/backend/backend-resource-module-contract-chain.md +323 -0
  31. package/cabloy-docs/backend/backend-source-reading-debug-checklist.md +173 -0
  32. package/cabloy-docs/backend/backend-source-reading-roadmap.md +129 -0
  33. package/cabloy-docs/backend/backend-source-reading-verify-playbook.md +166 -0
  34. package/cabloy-docs/backend/bean-scene-authoring.md +4 -4
  35. package/cabloy-docs/backend/broadcast-guide.md +3 -3
  36. package/cabloy-docs/backend/cli.md +20 -11
  37. package/cabloy-docs/backend/config-guide.md +4 -4
  38. package/cabloy-docs/backend/controller-aop-guide.md +10 -10
  39. package/cabloy-docs/backend/controller-guide.md +12 -2
  40. package/cabloy-docs/backend/crud-workflow.md +7 -3
  41. package/cabloy-docs/backend/dto-guide.md +18 -2
  42. package/cabloy-docs/backend/dto-infer-generation.md +201 -25
  43. package/cabloy-docs/backend/election-guide.md +2 -2
  44. package/cabloy-docs/backend/entity-guide.md +30 -3
  45. package/cabloy-docs/backend/error-guide.md +3 -3
  46. package/cabloy-docs/backend/event-guide.md +4 -4
  47. package/cabloy-docs/backend/external-aop-guide.md +2 -2
  48. package/cabloy-docs/backend/field-indexes.md +9 -3
  49. package/cabloy-docs/backend/foundation.md +8 -8
  50. package/cabloy-docs/backend/i18n-guide.md +6 -6
  51. package/cabloy-docs/backend/internal-aop-guide.md +2 -2
  52. package/cabloy-docs/backend/introduction.md +15 -0
  53. package/cabloy-docs/backend/migration-and-changes.md +3 -3
  54. package/cabloy-docs/backend/model-guide.md +16 -6
  55. package/cabloy-docs/backend/openapi-guide.md +3 -0
  56. package/cabloy-docs/backend/queue-guide.md +3 -3
  57. package/cabloy-docs/backend/redlock-guide.md +2 -2
  58. package/cabloy-docs/backend/schedule-guide.md +2 -2
  59. package/cabloy-docs/backend/scripts.md +8 -0
  60. package/cabloy-docs/backend/serialization-guide.md +12 -2
  61. package/cabloy-docs/backend/service-guide.md +18 -9
  62. package/cabloy-docs/backend/startup-guide.md +5 -5
  63. package/cabloy-docs/backend/status-guide.md +271 -0
  64. package/cabloy-docs/backend/unit-testing.md +3 -3
  65. package/cabloy-docs/backend/vona-source-reading-map.md +157 -0
  66. package/cabloy-docs/backend/websocket-protocol-guide.md +5 -5
  67. package/cabloy-docs/backend/websocket-usage-guide.md +15 -8
  68. package/cabloy-docs/frontend/a-model-under-the-hood.md +281 -0
  69. package/cabloy-docs/frontend/a-openapi-under-the-hood.md +248 -0
  70. package/cabloy-docs/frontend/a-router-guide.md +307 -0
  71. package/cabloy-docs/frontend/api-guide.md +6 -4
  72. package/cabloy-docs/frontend/api-schema-guide.md +1 -0
  73. package/cabloy-docs/frontend/app-startup-guide.md +7 -4
  74. package/cabloy-docs/frontend/bean-scene-authoring.md +3 -1
  75. package/cabloy-docs/frontend/behavior-guide.md +16 -16
  76. package/cabloy-docs/frontend/cli.md +14 -2
  77. package/cabloy-docs/frontend/command-scene-authoring.md +504 -0
  78. package/cabloy-docs/frontend/component-guide.md +5 -5
  79. package/cabloy-docs/frontend/component-props-guide.md +1 -1
  80. package/cabloy-docs/frontend/component-v-model-guide.md +2 -2
  81. package/cabloy-docs/frontend/design-principles.md +6 -0
  82. package/cabloy-docs/frontend/fetch-interceptor-guide.md +440 -0
  83. package/cabloy-docs/frontend/filter-query-select-data-flow-guide.md +260 -0
  84. package/cabloy-docs/frontend/form-guide.md +786 -0
  85. package/cabloy-docs/frontend/form-scene-to-page-meta-guide.md +303 -0
  86. package/cabloy-docs/frontend/foundation.md +33 -0
  87. package/cabloy-docs/frontend/frontend-source-reading-roadmap.md +249 -0
  88. package/cabloy-docs/frontend/generated-contract-consumption-debug-checklist.md +190 -0
  89. package/cabloy-docs/frontend/generated-contract-consumption-entry-branch.md +205 -0
  90. package/cabloy-docs/frontend/generated-contract-consumption-list-branch.md +157 -0
  91. package/cabloy-docs/frontend/generated-contract-consumption-specimen.md +203 -0
  92. package/cabloy-docs/frontend/generated-contract-consumption-verify-playbook.md +189 -0
  93. package/cabloy-docs/frontend/generic-component-guide.md +1 -1
  94. package/cabloy-docs/frontend/introduction.md +38 -5
  95. package/cabloy-docs/frontend/ioc-and-beans.md +6 -0
  96. package/cabloy-docs/frontend/mock-guide.md +1 -0
  97. package/cabloy-docs/frontend/model-architecture.md +288 -39
  98. package/cabloy-docs/frontend/model-resource-best-practices.md +379 -0
  99. package/cabloy-docs/frontend/model-resource-cookbook.md +508 -0
  100. package/cabloy-docs/frontend/model-resource-internals-deep-dive.md +238 -0
  101. package/cabloy-docs/frontend/model-resource-owner-pattern.md +402 -0
  102. package/cabloy-docs/frontend/model-resource-usage-guide.md +334 -0
  103. package/cabloy-docs/frontend/model-state-guide.md +371 -15
  104. package/cabloy-docs/frontend/module-scope.md +8 -8
  105. package/cabloy-docs/frontend/modules-and-suites.md +2 -1
  106. package/cabloy-docs/frontend/navigation-guards-guide.md +7 -0
  107. package/cabloy-docs/frontend/openapi-sdk-guide.md +17 -6
  108. package/cabloy-docs/frontend/page-guide.md +15 -9
  109. package/cabloy-docs/frontend/page-meta-guide.md +466 -0
  110. package/cabloy-docs/frontend/page-params-guide.md +3 -3
  111. package/cabloy-docs/frontend/page-query-guide.md +2 -2
  112. package/cabloy-docs/frontend/page-route-guide.md +6 -0
  113. package/cabloy-docs/frontend/permission-formscene-action-visibility-guide.md +263 -0
  114. package/cabloy-docs/frontend/quickstart.md +18 -2
  115. package/cabloy-docs/frontend/reading-zova-for-vue-developers.md +266 -0
  116. package/cabloy-docs/frontend/resource-entry-page-deep-dive.md +271 -0
  117. package/cabloy-docs/frontend/resource-list-page-deep-dive.md +279 -0
  118. package/cabloy-docs/frontend/rest-resource-source-reading-map.md +522 -0
  119. package/cabloy-docs/frontend/rest-resource-under-the-hood.md +622 -0
  120. package/cabloy-docs/frontend/root-behaviors-guide.md +282 -0
  121. package/cabloy-docs/frontend/route-alias-guide.md +6 -0
  122. package/cabloy-docs/frontend/router-stack-guide.md +229 -0
  123. package/cabloy-docs/frontend/router-tabs-introduction.md +26 -3
  124. package/cabloy-docs/frontend/router-tabs-layout-integration.md +367 -0
  125. package/cabloy-docs/frontend/router-tabs-mechanism.md +6 -0
  126. package/cabloy-docs/frontend/router-tabs-route-meta-cookbook.md +7 -0
  127. package/cabloy-docs/frontend/router-tabs-vs-stack.md +167 -0
  128. package/cabloy-docs/frontend/router-view-hosts-guide.md +450 -0
  129. package/cabloy-docs/frontend/server-data.md +4 -1
  130. package/cabloy-docs/frontend/system-startup-guide.md +2 -2
  131. package/cabloy-docs/frontend/table-action-visibility-permission-flow-guide.md +263 -0
  132. package/cabloy-docs/frontend/table-cell-cookbook.md +568 -0
  133. package/cabloy-docs/frontend/table-guide.md +373 -0
  134. package/cabloy-docs/frontend/table-resource-crud-cookbook.md +496 -0
  135. package/cabloy-docs/frontend/zova-app-guide.md +251 -0
  136. package/cabloy-docs/frontend/zova-form-source-reading-map.md +293 -0
  137. package/cabloy-docs/frontend/zova-form-under-the-hood.md +561 -0
  138. package/cabloy-docs/frontend/zova-reactivity-under-the-hood.md +320 -0
  139. package/cabloy-docs/frontend/zova-router-under-the-hood.md +561 -0
  140. package/cabloy-docs/frontend/zova-source-reading-map.md +421 -0
  141. package/cabloy-docs/frontend/zova-table-controller-render-supplement.md +225 -0
  142. package/cabloy-docs/frontend/zova-table-source-reading-map.md +317 -0
  143. package/cabloy-docs/frontend/zova-table-under-the-hood.md +532 -0
  144. package/cabloy-docs/frontend/zova-vs-vue3-comparison.md +308 -0
  145. package/cabloy-docs/fullstack/backend-metadata-to-frontend-table-actions-debug-checklist.md +245 -0
  146. package/cabloy-docs/fullstack/backend-metadata-to-frontend-table-actions-source-reading-map.md +139 -0
  147. package/cabloy-docs/fullstack/backend-metadata-to-frontend-table-actions-verify-playbook.md +248 -0
  148. package/cabloy-docs/fullstack/backend-metadata-to-frontend-table-actions.md +511 -0
  149. package/cabloy-docs/fullstack/contract-loop-playbook.md +356 -0
  150. package/cabloy-docs/fullstack/edition-collaboration-differences.md +6 -0
  151. package/cabloy-docs/fullstack/frontend-metadata-to-backend.md +199 -23
  152. package/cabloy-docs/fullstack/introduction.md +15 -1
  153. package/cabloy-docs/fullstack/openapi-to-sdk.md +135 -11
  154. package/cabloy-docs/fullstack/suites-and-modules.md +333 -0
  155. package/cabloy-docs/fullstack/tutorial-1-first-module.md +3 -0
  156. package/cabloy-docs/fullstack/tutorial-2-first-crud.md +4 -0
  157. package/cabloy-docs/fullstack/tutorial-3-frontend-metadata-sharing.md +6 -2
  158. package/cabloy-docs/fullstack/tutorial-4-custom-level-renderers.md +60 -23
  159. package/cabloy-docs/fullstack/tutorial-5-backend-contract-sharing.md +14 -7
  160. package/cabloy-docs/fullstack/tutorial-6-one-contract-four-uses.md +6 -0
  161. package/cabloy-docs/fullstack/tutorials-overview.md +17 -4
  162. package/cabloy-docs/reference/bean-scene-boilerplates.md +15 -13
  163. package/cabloy-docs/reference/package-map.md +4 -3
  164. package/package.json +2 -1
  165. package/scripts/init.ts +2 -18
  166. package/scripts/initTestData.ts +25 -0
  167. package/scripts/upgrade.ts +17 -2
  168. package/vona/pnpm-lock.yaml +48 -194
  169. package/vona/src/suite/a-training/modules/training-student/package.json +53 -0
  170. package/vona/src/suite/a-training/modules/training-student/src/.metadata/index.ts +400 -0
  171. package/vona/src/suite/a-training/modules/training-student/src/.metadata/locales.ts +18 -0
  172. package/vona/src/suite/a-training/modules/training-student/src/.metadata/this.ts +2 -0
  173. package/vona/src/suite/a-training/modules/training-student/src/bean/meta.index.ts +12 -0
  174. package/vona/src/suite/a-training/modules/training-student/src/bean/meta.version.ts +21 -0
  175. package/vona/src/suite/a-training/modules/training-student/src/bean/ssrMenu.student.ts +29 -0
  176. package/vona/src/suite/a-training/modules/training-student/src/config/locale/en-us.ts +15 -0
  177. package/vona/src/suite/a-training/modules/training-student/src/config/locale/zh-cn.ts +15 -0
  178. package/vona/src/suite/a-training/modules/training-student/src/controller/student.ts +74 -0
  179. package/vona/src/suite/a-training/modules/training-student/src/dto/studentCreate.tsx +28 -0
  180. package/vona/src/suite/a-training/modules/training-student/src/dto/studentSelectReq.tsx +44 -0
  181. package/vona/src/suite/a-training/modules/training-student/src/dto/studentSelectRes.tsx +11 -0
  182. package/vona/src/suite/a-training/modules/training-student/src/dto/studentSelectResItem.tsx +45 -0
  183. package/vona/src/suite/a-training/modules/training-student/src/dto/studentSummary.tsx +42 -0
  184. package/vona/src/suite/a-training/modules/training-student/src/dto/studentUpdate.tsx +28 -0
  185. package/vona/src/suite/a-training/modules/training-student/src/dto/studentView.tsx +25 -0
  186. package/vona/src/suite/a-training/modules/training-student/src/entity/student.tsx +84 -0
  187. package/vona/src/suite/a-training/modules/training-student/src/index.ts +2 -0
  188. package/vona/src/suite/a-training/modules/training-student/src/model/student.ts +10 -0
  189. package/vona/src/suite/a-training/modules/training-student/src/service/student.ts +57 -0
  190. package/vona/src/suite/a-training/modules/training-student/test/student.test.ts +173 -0
  191. package/vona/src/suite/a-training/modules/training-student/tsconfig.build.json +11 -0
  192. package/vona/src/suite/a-training/modules/training-student/tsconfig.json +7 -0
  193. package/vona/src/suite/a-training/package.json +12 -0
  194. package/vona/src/suite/a-training/tsconfig.base.json +4 -0
  195. package/vona/src/suite/a-training/tsconfig.json +10 -0
  196. package/zova/packages-cli/cli/package.json +2 -2
  197. package/zova/packages-cli/cli-set-front/cli/templates/openapi/config/boilerplate/module/openapi.config.ts +6 -1
  198. package/zova/packages-cli/cli-set-front/package.json +1 -1
  199. package/zova/packages-cli/cli-set-front/src/lib/bean/cli.openapi.generate.ts +34 -4
  200. package/zova/packages-zova/zova/package.json +2 -2
  201. package/zova/pnpm-lock.yaml +416 -690
  202. package/zova/src/suite/a-training/modules/training-student/cli/openapi.config.ts +9 -0
  203. package/zova/src/suite/a-training/modules/training-student/package.json +52 -0
  204. package/zova/src/suite/a-training/modules/training-student/src/.metadata/component/formFieldLevel.ts +31 -0
  205. package/zova/src/suite/a-training/modules/training-student/src/.metadata/index.ts +258 -0
  206. package/zova/src/suite/a-training/modules/training-student/src/.metadata/locales.ts +7 -0
  207. package/zova/src/suite/a-training/modules/training-student/src/.metadata/this.ts +2 -0
  208. package/zova/src/suite/a-training/modules/training-student/src/api/openapi/baseURL.ts +5 -0
  209. package/zova/src/suite/a-training/modules/training-student/src/api/openapi/index.ts +3 -0
  210. package/zova/src/suite/a-training/modules/training-student/src/api/openapi/schemas.ts +196 -0
  211. package/zova/src/suite/a-training/modules/training-student/src/api/openapi/types.ts +4146 -0
  212. package/zova/src/suite/a-training/modules/training-student/src/api/trainingStudent.ts +151 -0
  213. package/zova/src/suite/a-training/modules/training-student/src/apiSchema/trainingStudent.ts +43 -0
  214. package/zova/src/suite/a-training/modules/training-student/src/bean/tableCell.actionDeleteForce.tsx +51 -0
  215. package/zova/src/suite/a-training/modules/training-student/src/bean/tableCell.actionSummary.tsx +56 -0
  216. package/zova/src/suite/a-training/modules/training-student/src/bean/tableCell.level.tsx +63 -0
  217. package/zova/src/suite/a-training/modules/training-student/src/component/formFieldLevel/controller.tsx +117 -0
  218. package/zova/src/suite/a-training/modules/training-student/src/config/locale/en-us.ts +9 -0
  219. package/zova/src/suite/a-training/modules/training-student/src/config/locale/zh-cn.ts +9 -0
  220. package/zova/src/suite/a-training/modules/training-student/src/index.ts +2 -0
  221. package/zova/src/suite/a-training/modules/training-student/src/model/student.ts +42 -0
  222. package/zova/src/suite/a-training/modules/training-student/tsconfig.build.json +13 -0
  223. package/zova/src/suite/a-training/modules/training-student/tsconfig.json +5 -0
  224. package/zova/src/suite/a-training/package.json +12 -0
  225. package/zova/src/suite/a-training/tsconfig.base.json +4 -0
  226. package/zova/src/suite/a-training/tsconfig.json +4 -0
  227. package/zova/src/suite/cabloy-basic/modules/basic-select/src/component/formFieldSelect/controller.tsx +29 -7
  228. package/zova/src/suite/cabloy-basic/modules/basic-select/src/component/select/controller.tsx +34 -11
  229. package/zova/src/suite-vendor/a-zova/modules/a-table/package.json +1 -1
  230. package/zova/src/suite-vendor/a-zova/modules/a-table/src/component/table/controller.tsx +3 -3
  231. package/zova/src/suite-vendor/a-zova/modules/a-table/src/lib/tableCell.ts +1 -1
  232. package/zova/src/suite-vendor/a-zova/package.json +2 -2
@@ -17,10 +17,10 @@ That means model design affects not only SQL behavior, but also CRUD defaults, D
17
17
 
18
18
  ## Create a model
19
19
 
20
- Example: create a model named `student` in module `demo-student`.
20
+ Example: create a model named `student` in module `training-student`.
21
21
 
22
22
  ```bash
23
- npm run vona :create:bean model student -- --module=demo-student
23
+ npm run vona :create:bean model student -- --module=training-student
24
24
  ```
25
25
 
26
26
  ## Model definition
@@ -56,7 +56,7 @@ class ServiceStudent {
56
56
  ```typescript
57
57
  class ServiceStudent {
58
58
  async findAll(): Promise<EntityStudent[]> {
59
- return await this.$scope.demoStudent.model.student.select();
59
+ return await this.$scope.trainingStudent.model.student.select();
60
60
  }
61
61
  }
62
62
  ```
@@ -66,7 +66,7 @@ class ServiceStudent {
66
66
  ```typescript
67
67
  class ServiceStudent {
68
68
  async findAll(): Promise<EntityStudent[]> {
69
- return await this.bean._getBean('demo-student.model.student').select();
69
+ return await this.bean._getBean('training-student.model.student').select();
70
70
  }
71
71
  }
72
72
  ```
@@ -121,7 +121,7 @@ Representative patterns:
121
121
  ```typescript
122
122
  this.scope.model.student.builder().where('name', 'tom').orderBy('name');
123
123
  this.scope.model.student.builderSelect().where('name', 'tom').orderBy('name');
124
- this.scope.model.student.query('select * from demoStudent');
124
+ this.scope.model.student.query('select * from trainingStudent');
125
125
  ```
126
126
 
127
127
  A practical rule is:
@@ -155,7 +155,7 @@ Representative pattern:
155
155
  ```typescript
156
156
  config.onions = {
157
157
  model: {
158
- 'demo-student:student': {
158
+ 'training-student:student': {
159
159
  disableDeleted: true,
160
160
  disableInstance: true,
161
161
  client: 'mysql',
@@ -279,3 +279,13 @@ When creating backend persistence logic:
279
279
  4. choose deliberately among local scope, cross-module scope, and direct bean access
280
280
  5. remember that datasource, cache, and model options can change the behavior of the backend contract loop
281
281
  6. drop to raw SQL or lower-level query builder logic only when the higher-level model surface is insufficient
282
+
283
+ ## Where to read next
284
+
285
+ If your next question is how model persistence behavior fits into one complete backend contract thread, continue with:
286
+
287
+ - [Entity Guide](/backend/entity-guide)
288
+ - [DTO Guide](/backend/dto-guide)
289
+ - [CRUD Workflow](/backend/crud-workflow)
290
+ - [Vona Source Reading Map](/backend/vona-source-reading-map)
291
+ - [Backend Resource/Module Contract Chain](/backend/backend-resource-module-contract-chain)
@@ -100,6 +100,9 @@ For the downstream bridge and consumption path, also see:
100
100
  A practical split is:
101
101
 
102
102
  - this page explains backend contract authoring and emission
103
+ - [Backend Contract Emission Specimen](/backend/backend-contract-emission-specimen) explains one concrete emitted action thread
104
+ - [Backend Contract Emission Source Reading Map](/backend/backend-contract-emission-source-reading-map) explains the shortest file-order path through the emission inputs
105
+ - [Backend Contract Emission Output Inspection](/backend/backend-contract-emission-output-inspection) explains how to inspect the emitted output surfaces themselves
103
106
  - the fullstack page explains the bridge from emitted OpenAPI to generated frontend SDK
104
107
  - the frontend page explains how Zova consumes that contract in its own workflows
105
108
 
@@ -10,10 +10,10 @@ This is one of the main bridges between synchronous application code and distrib
10
10
 
11
11
  ## Create a queue
12
12
 
13
- Example: create a queue named `add` in module `demo-student`.
13
+ Example: create a queue named `add` in module `training-student`.
14
14
 
15
15
  ```bash
16
- npm run vona :create:bean queue add -- --module=demo-student
16
+ npm run vona :create:bean queue add -- --module=training-student
17
17
  ```
18
18
 
19
19
  ## Queue definition
@@ -197,7 +197,7 @@ Representative pattern:
197
197
  ```typescript
198
198
  config.onions = {
199
199
  queue: {
200
- 'demo-student:add': {
200
+ 'training-student:add': {
201
201
  concurrency: false,
202
202
  transaction: false,
203
203
  options: {
@@ -10,10 +10,10 @@ Vona provides a Redlock-based distributed lock abstraction so that mutual exclus
10
10
 
11
11
  ## Create a redlock definition
12
12
 
13
- Example: create redlock metadata in module `demo-student`.
13
+ Example: create redlock metadata in module `training-student`.
14
14
 
15
15
  ```bash
16
- npm run vona :create:bean meta redlock -- --module=demo-student
16
+ npm run vona :create:bean meta redlock -- --module=training-student
17
17
  ```
18
18
 
19
19
  ## Lock resource types
@@ -10,10 +10,10 @@ This matters because recurring work is modeled with the same broader distributed
10
10
 
11
11
  ## Create a schedule
12
12
 
13
- Example: create a schedule named `log` in module `demo-student`.
13
+ Example: create a schedule named `log` in module `training-student`.
14
14
 
15
15
  ```bash
16
- npm run vona :create:bean schedule log -- --module=demo-student
16
+ npm run vona :create:bean schedule log -- --module=training-student
17
17
  ```
18
18
 
19
19
  ## Schedule definition
@@ -114,3 +114,11 @@ When documenting or automating backend scripts:
114
114
  - prefer root scripts for normal contributor workflows
115
115
  - drop to `vona/package.json` only when you need backend-specific detail
116
116
  - verify commands against current scripts before publishing examples
117
+
118
+ ## Where to read next
119
+
120
+ If your next question is not only how the monorepo runs backend workflows, but which source surfaces those workflows eventually enter, continue with:
121
+
122
+ - [Backend CLI](/backend/cli)
123
+ - [Backend Source Reading Roadmap](/backend/backend-source-reading-roadmap)
124
+ - [Vona Source Reading Map](/backend/vona-source-reading-map)
@@ -41,6 +41,16 @@ async findOne(id) {
41
41
 
42
42
  This makes serialization an explicit request-path capability rather than an invisible response-side convention.
43
43
 
44
+ Important operational rule:
45
+
46
+ - for performance reasons, serialization is **not enabled by default**
47
+ - `v.serializerTransform(...)`, `v.serializerExclude()`, `v.serializerReplace(...)`, `v.serializerGetter(...)`, and `v.serializerCustom(...)` only declare field-level transform metadata
48
+ - those transforms do **not** run unless the target API explicitly enables serialization with `@Core.serializer()`
49
+
50
+ A practical debugging rule is:
51
+
52
+ - if a field-level serializer appears correct but the response still returns the raw value, first check whether the controller action uses `@Core.serializer()`
53
+
44
54
  ## Serializer transforms
45
55
 
46
56
  Vona supports custom serializer transforms through `@SerializerTransform(...)`.
@@ -48,7 +58,7 @@ Vona supports custom serializer transforms through `@SerializerTransform(...)`.
48
58
  Representative generation workflow:
49
59
 
50
60
  ```bash
51
- npm run vona :create:bean serializerTransform upper -- --module=demo-student
61
+ npm run vona :create:bean serializerTransform upper -- --module=training-student
52
62
  ```
53
63
 
54
64
  Representative pattern:
@@ -78,7 +88,7 @@ Field-level serialization is attached through `@Api.field(...)` metadata helpers
78
88
  Representative pattern:
79
89
 
80
90
  ```typescript
81
- @Api.field(v.serializerTransform('demo-student:upper'))
91
+ @Api.field(v.serializerTransform('training-student:upper'))
82
92
  name: string;
83
93
  ```
84
94
 
@@ -10,10 +10,10 @@ In practice, the service guide is also the most useful page for understanding ba
10
10
 
11
11
  ## Create a service
12
12
 
13
- Example: create a service named `student` in module `demo-student`.
13
+ Example: create a service named `student` in module `training-student`.
14
14
 
15
15
  ```bash
16
- npm run vona :create:bean service student -- --module=demo-student
16
+ npm run vona :create:bean service student -- --module=training-student
17
17
  ```
18
18
 
19
19
  ## Service definition
@@ -58,7 +58,7 @@ class ControllerStudent {
58
58
  import type { ServiceStudent } from '../service/student.ts';
59
59
 
60
60
  class ControllerStudent {
61
- @Use('demo-student.service.student')
61
+ @Use('training-student.service.student')
62
62
  serviceStudent: ServiceStudent;
63
63
  }
64
64
  ```
@@ -84,7 +84,7 @@ class ControllerStudent {
84
84
  ```typescript
85
85
  class ControllerStudent {
86
86
  findOne() {
87
- return this.$scope.demoStudent.service.student.findOne();
87
+ return this.$scope.trainingStudent.service.student.findOne();
88
88
  }
89
89
  }
90
90
  ```
@@ -103,19 +103,19 @@ Direct bean access patterns are also available.
103
103
  ### Global container access: `_getBean`
104
104
 
105
105
  ```typescript
106
- const serviceStudent = this.bean._getBean('demo-student.service.student');
106
+ const serviceStudent = this.bean._getBean('training-student.service.student');
107
107
  ```
108
108
 
109
109
  ### Request-scoped access
110
110
 
111
111
  ```typescript
112
- const serviceStudent = this.ctx.bean._getBean('demo-student.service.student');
112
+ const serviceStudent = this.ctx.bean._getBean('training-student.service.student');
113
113
  ```
114
114
 
115
115
  ### Fresh bean creation: `_newBean`
116
116
 
117
117
  ```typescript
118
- const serviceStudent = this.bean._newBean('demo-student.service.student');
118
+ const serviceStudent = this.bean._newBean('training-student.service.student');
119
119
  ```
120
120
 
121
121
  A practical split is:
@@ -127,7 +127,7 @@ A practical split is:
127
127
  A practical “when to use which” rule is:
128
128
 
129
129
  - use `this.scope.service.student` when the dependency belongs to the current module and ordinary business code is enough
130
- - use `this.$scope.demoStudent.service.student` when the dependency clearly belongs to another module
130
+ - use `this.$scope.trainingStudent.service.student` when the dependency clearly belongs to another module
131
131
  - use `this.bean._getBean(...)` when you need explicit app-container access by bean identifier
132
132
  - use `this.ctx.bean._getBean(...)` when the workflow should resolve through request-scoped access
133
133
  - use `this.bean._newBean(...)` when you need a fresh bean instance instead of the ordinary resolved one
@@ -138,7 +138,7 @@ Services are one bean scene inside the larger backend essentials model.
138
138
 
139
139
  That means service access should be understood together with:
140
140
 
141
- - bean identifiers such as `demo-student.service.student`
141
+ - bean identifiers such as `training-student.service.student`
142
142
  - local module scope vs cross-module scope
143
143
  - other scope resource categories such as model and entity
144
144
 
@@ -166,3 +166,12 @@ A better default is:
166
166
  4. choose deliberately among local scope, cross-module scope, injection, and direct bean access
167
167
 
168
168
  That keeps backend access patterns aligned with Vona’s actual architecture instead of using one access style everywhere by habit.
169
+
170
+ ## Where to read next
171
+
172
+ If your next question is how service orchestration hands off to the persistence and contract layers in one real module, continue with:
173
+
174
+ - [Model Guide](/backend/model-guide)
175
+ - [Entity Guide](/backend/entity-guide)
176
+ - [Vona Source Reading Map](/backend/vona-source-reading-map)
177
+ - [Backend Resource/Module Contract Chain](/backend/backend-resource-module-contract-chain)
@@ -42,10 +42,10 @@ This is one of the reasons backend startup belongs in the backend docs, not in t
42
42
 
43
43
  ## Create a startup bean
44
44
 
45
- Example: create a startup named `log` in module `demo-student`.
45
+ Example: create a startup named `log` in module `training-student`.
46
46
 
47
47
  ```bash
48
- npm run vona :create:bean startup log -- --module=demo-student
48
+ npm run vona :create:bean startup log -- --module=training-student
49
49
  ```
50
50
 
51
51
  Representative shape:
@@ -102,7 +102,7 @@ Representative pattern:
102
102
  ```typescript
103
103
  config.onions = {
104
104
  startup: {
105
- 'demo-student:log': {
105
+ 'training-student:log': {
106
106
  after: false,
107
107
  debounce: true,
108
108
  instance: false,
@@ -148,7 +148,7 @@ App config can disable a startup explicitly:
148
148
  ```typescript
149
149
  config.onions = {
150
150
  startup: {
151
- 'demo-student:log': {
151
+ 'training-student:log': {
152
152
  enable: false,
153
153
  },
154
154
  },
@@ -200,7 +200,7 @@ Module monkey files can also receive module-oriented hook callbacks, and the app
200
200
  Representative CLI workflow:
201
201
 
202
202
  ```bash
203
- npm run vona :init:monkey demo-student
203
+ npm run vona :init:monkey training-student
204
204
  ```
205
205
 
206
206
  ### Startup beans
@@ -0,0 +1,271 @@
1
+ # Status Guide
2
+
3
+ This guide explains how Status works in Vona within the Cabloy monorepo.
4
+
5
+ ## Why Status matters
6
+
7
+ Some backend modules need a very small amount of durable module-local state without introducing a full business resource.
8
+
9
+ Typical examples include:
10
+
11
+ - feature toggles owned by one module
12
+ - small structured status payloads
13
+ - module-local runtime flags that should survive process restart
14
+ - lightweight persisted settings that do not justify a dedicated CRUD surface
15
+
16
+ Vona provides Status for exactly that shape.
17
+
18
+ A practical mental model is:
19
+
20
+ - Status is a persisted key/value store
21
+ - keys are scoped by the owning module
22
+ - values are stored as JSON
23
+ - the main public API is a typed `get` / `set` surface
24
+
25
+ ## Create `meta.status`
26
+
27
+ Create a status bean in your module with the shared Vona CLI entrypoint:
28
+
29
+ ```bash
30
+ npm run vona :create:bean meta status -- --module=training-student
31
+ ```
32
+
33
+ This follows the same `:create:bean` workflow used by other backend bean scenes and metadata beans.
34
+
35
+ The generated shape is representative of:
36
+
37
+ ```typescript
38
+ import { Meta } from 'vona-module-a-meta';
39
+ import { BeanStatusBase } from 'vona-module-a-status';
40
+
41
+ export interface IStatusRecord {}
42
+
43
+ @Meta()
44
+ export class MetaStatus extends BeanStatusBase<IStatusRecord> {}
45
+ ```
46
+
47
+ The important point is that your module defines its own typed status record while reusing the shared persistence and locking behavior from `BeanStatusBase`.
48
+
49
+ ## Define a typed status record
50
+
51
+ Status is most useful when the record shape is explicit.
52
+
53
+ Representative pattern:
54
+
55
+ ```typescript
56
+ interface IStatusUser {
57
+ name: string;
58
+ age: number;
59
+ }
60
+
61
+ export interface IStatusRecord {
62
+ enable: boolean;
63
+ user: IStatusUser;
64
+ }
65
+
66
+ @Meta()
67
+ export class MetaStatus extends BeanStatusBase<IStatusRecord> {}
68
+ ```
69
+
70
+ This gives a practical typed contract:
71
+
72
+ - `get('enable')` returns `boolean | undefined`
73
+ - `set('enable', true)` requires a boolean
74
+ - `get('user')` returns the typed user object or `undefined`
75
+
76
+ So Status is flexible at storage time because the value is JSON, but strongly typed at authoring time because the bean is generic.
77
+
78
+ ## Use `scope.status`
79
+
80
+ After defining `meta.status` in a module, the generated scope exposes it as `scope.status` inside that module.
81
+
82
+ Representative usage:
83
+
84
+ ```typescript
85
+ let value = await this.scope.status.get('enable');
86
+ await this.scope.status.set('enable', true);
87
+ value = await this.scope.status.get('enable');
88
+
89
+ let user = await this.scope.status.get('user');
90
+ await this.scope.status.set('user', { name: 'zhennann', age: 18 });
91
+ user = await this.scope.status.get('user');
92
+ ```
93
+
94
+ A practical behavior summary is:
95
+
96
+ - `get(...)` returns `undefined` when the key has not been written yet
97
+ - `set(...)` creates the key on first write
98
+ - later `set(...)` updates the existing value
99
+
100
+ ## What is actually stored
101
+
102
+ The current source stores Status data in table `aStatus`.
103
+
104
+ The logical identity of a record is:
105
+
106
+ - `module`
107
+ - `name`
108
+
109
+ The stored payload is:
110
+
111
+ - `value` as JSON
112
+
113
+ So a practical storage reading is:
114
+
115
+ | Field | Meaning |
116
+ | -------- | ------------------------------------- |
117
+ | `module` | the owning backend module |
118
+ | `name` | the status key inside that module |
119
+ | `value` | the persisted JSON value for that key |
120
+
121
+ The current migration creates the table with the framework basic fields plus:
122
+
123
+ - `module`
124
+ - `name`
125
+ - `value`
126
+
127
+ This means Status is designed as a small module-scoped persistence surface rather than a general-purpose relational model.
128
+
129
+ ## Module-local scoping
130
+
131
+ One of the most important design points is that Status is scoped by the **consumer module**, not only by the key name.
132
+
133
+ That means two different modules can both use a key such as `enable` without colliding with each other.
134
+
135
+ A practical reading is:
136
+
137
+ - `training-student + enable` is one status record
138
+ - `demo-course + enable` is a different status record
139
+
140
+ This makes Status a natural fit for module-local state.
141
+
142
+ ## First-write concurrency behavior
143
+
144
+ The current implementation protects first-write creation with Redlock.
145
+
146
+ A practical flow is:
147
+
148
+ 1. attempt to read the current `(module, name)` record
149
+ 2. if the record exists, update it
150
+ 3. if the record does not exist, enter a `lockIsolate(...)` critical section
151
+ 4. re-check the record with a forced fresh read
152
+ 5. insert only if it is still missing
153
+
154
+ This is important in distributed or multi-worker deployments because two workers might otherwise try to create the same logical key at the same time.
155
+
156
+ The design intention is:
157
+
158
+ - ordinary reads stay simple
159
+ - first-write races are serialized
160
+ - the locked re-check avoids stale read behavior during creation
161
+
162
+ For the broader locking model, also see [Redlock Guide](/backend/redlock-guide).
163
+
164
+ ## Relationship to cache and ORM
165
+
166
+ Status is built on top of the Vona ORM model layer.
167
+
168
+ That matters because Status is not a separate storage engine. It participates in the same broader backend persistence model as other ORM-backed data.
169
+
170
+ A practical reading is:
171
+
172
+ - Status persistence is implemented through an ORM model
173
+ - reads can benefit from the framework data-access stack
174
+ - write behavior still follows the framework mutation path
175
+
176
+ For surrounding concepts, also see:
177
+
178
+ - [ORM Guide](/backend/orm-guide)
179
+ - [Cache Guide](/backend/cache-guide)
180
+ - [Migration and Changes](/backend/migration-and-changes)
181
+
182
+ ## Relationship to migration
183
+
184
+ The built-in `a-status` module currently creates its own storage table through `meta.version` with `fileVersion: 1`.
185
+
186
+ For ordinary consumers of Status, the usual workflow is simple:
187
+
188
+ - depend on the shared Status module
189
+ - create your own `meta.status`
190
+ - define your typed record
191
+ - use `scope.status` from your module
192
+
193
+ You do **not** create a separate status table per consuming module.
194
+
195
+ If your own module later outgrows Status and needs a richer schema, that usually means moving to dedicated entity/model resources and managing your own `meta.version` changes directly.
196
+
197
+ ## What Status is good for
198
+
199
+ Status is a strong fit when the data is:
200
+
201
+ - small in size
202
+ - keyed by a fixed or slowly changing set of names
203
+ - naturally owned by one module
204
+ - read or updated by key rather than queried as a collection
205
+
206
+ Typical good fits include:
207
+
208
+ - module enable flags
209
+ - one module-owned progress marker
210
+ - compact structured settings
211
+ - one-off durable state snapshots
212
+
213
+ ## What Status is not for
214
+
215
+ Status is usually the wrong abstraction when you need:
216
+
217
+ - a large collection of rows
218
+ - rich filtering or search
219
+ - relational structure
220
+ - a public CRUD API
221
+ - list, delete, or pagination behavior
222
+ - field-level validation and indexing as a first-class domain concern
223
+
224
+ A practical boundary is:
225
+
226
+ - use Status for a small number of durable module-local keys
227
+ - use entity/model/controller resources when the data becomes a real business resource
228
+
229
+ ## Current implementation notes
230
+
231
+ From the current source, some boundaries are worth knowing:
232
+
233
+ - the public base API is intentionally small: `get` and `set`
234
+ - there is no built-in delete or list convenience API
235
+ - values are stored as JSON
236
+ - first-write concurrency is protected by Redlock
237
+ - the current table creation is lightweight and does not define a separate Status-specific CRUD surface
238
+
239
+ These details make Status easy to use, but they also mean you should not stretch it into a substitute for a richer domain model.
240
+
241
+ ## Recommended workflow
242
+
243
+ A practical Status workflow is:
244
+
245
+ 1. create `meta.status` with the Vona CLI
246
+ 2. define a small typed `IStatusRecord`
247
+ 3. read and write through `this.scope.status`
248
+ 4. keep payloads compact and module-owned
249
+ 5. move to dedicated entity/model resources if the data stops looking like key/value state
250
+
251
+ ## Related guides
252
+
253
+ Read this guide together with:
254
+
255
+ - [Backend CLI](/backend/cli)
256
+ - [Migration and Changes](/backend/migration-and-changes)
257
+ - [ORM Guide](/backend/orm-guide)
258
+ - [Cache Guide](/backend/cache-guide)
259
+ - [Redlock Guide](/backend/redlock-guide)
260
+
261
+ ## Implementation checks for Status changes
262
+
263
+ When adding or revising module-local durable state, ask:
264
+
265
+ 1. is this really a small module-owned key/value need?
266
+ 2. should the state live in `meta.status` instead of a dedicated entity/model resource?
267
+ 3. is the status record shape explicit and typed?
268
+ 4. will the payload remain compact and stable over time?
269
+ 5. do later requirements such as list, delete, filtering, or indexing mean the design should graduate to a richer persistence model?
270
+
271
+ That keeps Status aligned with its intended role in Vona.
@@ -33,7 +33,7 @@ This is why Vona testing should not be reduced to isolated helper-unit testing o
33
33
  Example:
34
34
 
35
35
  ```bash
36
- npm run vona :create:test student -- --module=demo-student
36
+ npm run vona :create:test student -- --module=training-student
37
37
  ```
38
38
 
39
39
  ## Execute tests
@@ -91,7 +91,7 @@ Locale-sensitive variants and additional request-context helpers are also availa
91
91
  Representative pattern:
92
92
 
93
93
  ```typescript
94
- const scopeStudent = app.scope('demo-student');
94
+ const scopeStudent = app.scope('training-student');
95
95
  ```
96
96
 
97
97
  This lets tests exercise:
@@ -108,7 +108,7 @@ through the same scoped abstractions used in application code.
108
108
  Representative pattern:
109
109
 
110
110
  ```typescript
111
- await app.bean.executor.performAction('get', '/demo/student');
111
+ await app.bean.executor.performAction('get', '/training/student');
112
112
  ```
113
113
 
114
114
  This is especially useful because it exercises the controller path more realistically than only unit-testing isolated helper functions.