@owlmeans/planning 0.1.18-rc.9 → 0.1.18

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 (295) hide show
  1. package/README.md +122 -29
  2. package/agent-meta/manifest.json +131 -4
  3. package/agent-meta/skills/planning/SKILL.md +78 -171
  4. package/agent-meta/skills/planning/parts/collaboration.md +67 -0
  5. package/agent-meta/skills/planning/parts/errors.md +51 -0
  6. package/agent-meta/skills/planning/parts/fold.md +69 -0
  7. package/agent-meta/skills/planning/parts/mounting.md +64 -0
  8. package/agent-meta/skills/planning/parts/types.md +141 -0
  9. package/build/aliases/types.d.ts +72 -0
  10. package/build/aliases/types.d.ts.map +1 -0
  11. package/build/aliases/types.js +2 -0
  12. package/build/aliases/types.js.map +1 -0
  13. package/build/aliases.d.ts +4 -0
  14. package/build/aliases.d.ts.map +1 -0
  15. package/build/aliases.js +28 -0
  16. package/build/aliases.js.map +1 -0
  17. package/build/consts.d.ts +43 -34
  18. package/build/consts.d.ts.map +1 -1
  19. package/build/consts.js +49 -25
  20. package/build/consts.js.map +1 -1
  21. package/build/entrypoints/types.d.ts +105 -0
  22. package/build/entrypoints/types.d.ts.map +1 -0
  23. package/build/entrypoints/types.js +2 -0
  24. package/build/entrypoints/types.js.map +1 -0
  25. package/build/entrypoints.d.ts +5 -1
  26. package/build/entrypoints.d.ts.map +1 -1
  27. package/build/entrypoints.js +24 -6
  28. package/build/entrypoints.js.map +1 -1
  29. package/build/errors.d.ts +41 -0
  30. package/build/errors.d.ts.map +1 -1
  31. package/build/errors.js +61 -0
  32. package/build/errors.js.map +1 -1
  33. package/build/helpers/app/consts.local.d.ts +5 -0
  34. package/build/helpers/app/consts.local.d.ts.map +1 -0
  35. package/build/helpers/app/consts.local.js +5 -0
  36. package/build/helpers/app/consts.local.js.map +1 -0
  37. package/build/helpers/app/types.d.ts +53 -0
  38. package/build/helpers/app/types.d.ts.map +1 -0
  39. package/build/helpers/app/types.js +2 -0
  40. package/build/helpers/app/types.js.map +1 -0
  41. package/build/helpers/app.d.ts +4 -0
  42. package/build/helpers/app.d.ts.map +1 -0
  43. package/build/helpers/app.js +139 -0
  44. package/build/helpers/app.js.map +1 -0
  45. package/build/helpers/apply/consts.local.d.ts +7 -0
  46. package/build/helpers/apply/consts.local.d.ts.map +1 -0
  47. package/build/helpers/apply/consts.local.js +9 -0
  48. package/build/helpers/apply/consts.local.js.map +1 -0
  49. package/build/helpers/apply/types.d.ts +32 -0
  50. package/build/helpers/apply/types.d.ts.map +1 -0
  51. package/build/helpers/apply/types.js +2 -0
  52. package/build/helpers/apply/types.js.map +1 -0
  53. package/build/helpers/apply.d.ts +5 -23
  54. package/build/helpers/apply.d.ts.map +1 -1
  55. package/build/helpers/apply.js +127 -144
  56. package/build/helpers/apply.js.map +1 -1
  57. package/build/helpers/card/types.d.ts +20 -0
  58. package/build/helpers/card/types.d.ts.map +1 -0
  59. package/build/helpers/card/types.js +2 -0
  60. package/build/helpers/card/types.js.map +1 -0
  61. package/build/helpers/card.d.ts +11 -7
  62. package/build/helpers/card.d.ts.map +1 -1
  63. package/build/helpers/card.js +41 -28
  64. package/build/helpers/card.js.map +1 -1
  65. package/build/helpers/changes/consts.local.d.ts +13 -0
  66. package/build/helpers/changes/consts.local.d.ts.map +1 -0
  67. package/build/helpers/changes/consts.local.js +13 -0
  68. package/build/helpers/changes/consts.local.js.map +1 -0
  69. package/build/helpers/changes/types.d.ts +58 -0
  70. package/build/helpers/changes/types.d.ts.map +1 -0
  71. package/build/helpers/changes/types.js +2 -0
  72. package/build/helpers/changes/types.js.map +1 -0
  73. package/build/helpers/changes.d.ts +11 -42
  74. package/build/helpers/changes.d.ts.map +1 -1
  75. package/build/helpers/changes.js +237 -251
  76. package/build/helpers/changes.js.map +1 -1
  77. package/build/helpers/code/types.d.ts +27 -0
  78. package/build/helpers/code/types.d.ts.map +1 -0
  79. package/build/helpers/code/types.js +2 -0
  80. package/build/helpers/code/types.js.map +1 -0
  81. package/build/helpers/code.d.ts +6 -17
  82. package/build/helpers/code.d.ts.map +1 -1
  83. package/build/helpers/code.js +39 -40
  84. package/build/helpers/code.js.map +1 -1
  85. package/build/helpers/index.d.ts +16 -0
  86. package/build/helpers/index.d.ts.map +1 -1
  87. package/build/helpers/index.js +4 -0
  88. package/build/helpers/index.js.map +1 -1
  89. package/build/helpers/query/types.d.ts +23 -0
  90. package/build/helpers/query/types.d.ts.map +1 -0
  91. package/build/helpers/query/types.js +2 -0
  92. package/build/helpers/query/types.js.map +1 -0
  93. package/build/helpers/query.d.ts +25 -17
  94. package/build/helpers/query.d.ts.map +1 -1
  95. package/build/helpers/query.js +108 -280
  96. package/build/helpers/query.js.map +1 -1
  97. package/build/helpers/reply/consts.d.ts +2 -0
  98. package/build/helpers/reply/consts.d.ts.map +1 -0
  99. package/build/helpers/reply/consts.js +2 -0
  100. package/build/helpers/reply/consts.js.map +1 -0
  101. package/build/helpers/reply/types.d.ts +10 -0
  102. package/build/helpers/reply/types.d.ts.map +1 -0
  103. package/build/helpers/reply/types.js +2 -0
  104. package/build/helpers/reply/types.js.map +1 -0
  105. package/build/helpers/reply.d.ts +5 -0
  106. package/build/helpers/reply.d.ts.map +1 -0
  107. package/build/helpers/reply.js +29 -0
  108. package/build/helpers/reply.js.map +1 -0
  109. package/build/helpers/scoped/types.d.ts +73 -0
  110. package/build/helpers/scoped/types.d.ts.map +1 -0
  111. package/build/helpers/scoped/types.js +2 -0
  112. package/build/helpers/scoped/types.js.map +1 -0
  113. package/build/helpers/scoped.d.ts +25 -0
  114. package/build/helpers/scoped.d.ts.map +1 -0
  115. package/build/helpers/scoped.js +223 -0
  116. package/build/helpers/scoped.js.map +1 -0
  117. package/build/helpers/specification/types.d.ts +24 -0
  118. package/build/helpers/specification/types.d.ts.map +1 -0
  119. package/build/helpers/specification/types.js +2 -0
  120. package/build/helpers/specification/types.js.map +1 -0
  121. package/build/helpers/specification.d.ts +9 -13
  122. package/build/helpers/specification.d.ts.map +1 -1
  123. package/build/helpers/specification.js +47 -44
  124. package/build/helpers/specification.js.map +1 -1
  125. package/build/helpers/status/types.d.ts +48 -0
  126. package/build/helpers/status/types.d.ts.map +1 -0
  127. package/build/helpers/status/types.js +2 -0
  128. package/build/helpers/status/types.js.map +1 -0
  129. package/build/helpers/status.d.ts +16 -29
  130. package/build/helpers/status.d.ts.map +1 -1
  131. package/build/helpers/status.js +77 -73
  132. package/build/helpers/status.js.map +1 -1
  133. package/build/helpers/types.local.d.ts +17 -0
  134. package/build/helpers/types.local.d.ts.map +1 -0
  135. package/build/helpers/types.local.js +2 -0
  136. package/build/helpers/types.local.js.map +1 -0
  137. package/build/helpers/validate/types.d.ts +31 -0
  138. package/build/helpers/validate/types.d.ts.map +1 -0
  139. package/build/helpers/validate/types.js +2 -0
  140. package/build/helpers/validate/types.js.map +1 -0
  141. package/build/helpers/validate.d.ts +8 -19
  142. package/build/helpers/validate.d.ts.map +1 -1
  143. package/build/helpers/validate.js +79 -79
  144. package/build/helpers/validate.js.map +1 -1
  145. package/build/helpers/wire/types.d.ts +28 -0
  146. package/build/helpers/wire/types.d.ts.map +1 -0
  147. package/build/helpers/wire/types.js +2 -0
  148. package/build/helpers/wire/types.js.map +1 -0
  149. package/build/helpers/wire.d.ts +4 -0
  150. package/build/helpers/wire.d.ts.map +1 -0
  151. package/build/helpers/wire.js +216 -0
  152. package/build/helpers/wire.js.map +1 -0
  153. package/build/i18n/be.json +5 -0
  154. package/build/i18n/de.json +5 -0
  155. package/build/i18n/en.json +5 -0
  156. package/build/i18n/es.json +5 -0
  157. package/build/i18n/fr.json +5 -0
  158. package/build/i18n/pl.json +5 -0
  159. package/build/i18n/ru.json +5 -0
  160. package/build/i18n/uk.json +5 -0
  161. package/build/i18n.js +3 -3
  162. package/build/i18n.js.map +1 -1
  163. package/build/index.d.ts +7 -0
  164. package/build/index.d.ts.map +1 -1
  165. package/build/index.js +3 -0
  166. package/build/index.js.map +1 -1
  167. package/build/models/index.d.ts +2 -3
  168. package/build/models/index.d.ts.map +1 -1
  169. package/build/models/index.js +1 -15
  170. package/build/models/index.js.map +1 -1
  171. package/build/models/model.d.ts +5 -0
  172. package/build/models/model.d.ts.map +1 -0
  173. package/build/models/model.js +16 -0
  174. package/build/models/model.js.map +1 -0
  175. package/build/models/project.d.ts +2 -1
  176. package/build/models/project.d.ts.map +1 -1
  177. package/build/models/project.js.map +1 -1
  178. package/build/models/specification.d.ts +2 -1
  179. package/build/models/specification.d.ts.map +1 -1
  180. package/build/models/specification.js.map +1 -1
  181. package/build/models/types.d.ts +69 -0
  182. package/build/models/types.d.ts.map +1 -0
  183. package/build/models/types.js +2 -0
  184. package/build/models/types.js.map +1 -0
  185. package/build/models/workcard.d.ts +2 -1
  186. package/build/models/workcard.d.ts.map +1 -1
  187. package/build/models/workcard.js +12 -12
  188. package/build/models/workcard.js.map +1 -1
  189. package/build/registry.d.ts +3 -2
  190. package/build/registry.d.ts.map +1 -1
  191. package/build/registry.js +51 -3
  192. package/build/registry.js.map +1 -1
  193. package/build/resources/mentions.d.ts +4 -0
  194. package/build/resources/mentions.d.ts.map +1 -0
  195. package/build/resources/mentions.js +15 -0
  196. package/build/resources/mentions.js.map +1 -0
  197. package/build/resources/protocol/types.d.ts +30 -0
  198. package/build/resources/protocol/types.d.ts.map +1 -0
  199. package/build/resources/protocol/types.js +2 -0
  200. package/build/resources/protocol/types.js.map +1 -0
  201. package/build/resources/protocol.d.ts +6 -0
  202. package/build/resources/protocol.d.ts.map +1 -0
  203. package/build/resources/protocol.js +31 -0
  204. package/build/resources/protocol.js.map +1 -0
  205. package/build/resources/types.d.ts +146 -0
  206. package/build/resources/types.d.ts.map +1 -0
  207. package/build/resources/types.js +2 -0
  208. package/build/resources/types.js.map +1 -0
  209. package/build/resources/types.local.d.ts +6 -0
  210. package/build/resources/types.local.d.ts.map +1 -0
  211. package/build/resources/types.local.js +2 -0
  212. package/build/resources/types.local.js.map +1 -0
  213. package/build/schemas.d.ts +21 -2
  214. package/build/schemas.d.ts.map +1 -1
  215. package/build/schemas.js +164 -2
  216. package/build/schemas.js.map +1 -1
  217. package/build/types.d.ts +330 -151
  218. package/build/types.d.ts.map +1 -1
  219. package/build/utils.d.ts +6 -0
  220. package/build/utils.d.ts.map +1 -0
  221. package/build/utils.js +6 -0
  222. package/build/utils.js.map +1 -0
  223. package/package.json +13 -13
  224. package/src/aliases/types.ts +41 -0
  225. package/src/aliases.ts +34 -0
  226. package/src/consts.ts +50 -25
  227. package/src/entrypoints/types.ts +77 -0
  228. package/src/entrypoints.ts +53 -24
  229. package/src/errors.ts +71 -0
  230. package/src/helpers/app/consts.local.ts +5 -0
  231. package/src/helpers/app/types.ts +54 -0
  232. package/src/helpers/app.ts +158 -0
  233. package/src/helpers/apply/consts.local.ts +10 -0
  234. package/src/helpers/apply/types.ts +32 -0
  235. package/src/helpers/apply.ts +141 -153
  236. package/src/helpers/card/types.ts +20 -0
  237. package/src/helpers/card.ts +59 -33
  238. package/src/helpers/changes/consts.local.ts +17 -0
  239. package/src/helpers/changes/types.ts +66 -0
  240. package/src/helpers/changes.ts +270 -280
  241. package/src/helpers/code/types.ts +31 -0
  242. package/src/helpers/code.ts +52 -48
  243. package/src/helpers/index.ts +17 -0
  244. package/src/helpers/query/types.ts +26 -0
  245. package/src/helpers/query.ts +144 -314
  246. package/src/helpers/reply/consts.ts +1 -0
  247. package/src/helpers/reply/types.ts +13 -0
  248. package/src/helpers/reply.ts +27 -0
  249. package/src/helpers/scoped/types.ts +78 -0
  250. package/src/helpers/scoped.ts +281 -0
  251. package/src/helpers/specification/types.ts +26 -0
  252. package/src/helpers/specification.ts +69 -51
  253. package/src/helpers/status/types.ts +46 -0
  254. package/src/helpers/status.ts +117 -93
  255. package/src/helpers/types.local.ts +18 -0
  256. package/src/helpers/validate/types.ts +31 -0
  257. package/src/helpers/validate.ts +89 -77
  258. package/src/helpers/wire/types.ts +31 -0
  259. package/src/helpers/wire.ts +252 -0
  260. package/src/i18n/be.json +5 -0
  261. package/src/i18n/de.json +5 -0
  262. package/src/i18n/en.json +5 -0
  263. package/src/i18n/es.json +5 -0
  264. package/src/i18n/fr.json +5 -0
  265. package/src/i18n/pl.json +5 -0
  266. package/src/i18n/ru.json +5 -0
  267. package/src/i18n/uk.json +5 -0
  268. package/src/i18n.ts +4 -3
  269. package/src/index.ts +8 -0
  270. package/src/models/index.ts +2 -17
  271. package/src/models/model.ts +18 -0
  272. package/src/models/project.ts +2 -1
  273. package/src/models/specification.ts +2 -1
  274. package/src/models/types.ts +70 -0
  275. package/src/models/workcard.ts +14 -16
  276. package/src/registry.ts +55 -4
  277. package/src/resources/mentions.ts +11 -0
  278. package/src/resources/protocol/types.ts +21 -0
  279. package/src/resources/protocol.ts +36 -0
  280. package/src/resources/types.local.ts +5 -0
  281. package/src/resources/types.ts +148 -0
  282. package/src/schemas.ts +179 -4
  283. package/src/types.ts +334 -130
  284. package/src/utils.ts +9 -0
  285. package/tests/app.spec.ts +188 -0
  286. package/tests/apply.spec.ts +95 -31
  287. package/tests/code.spec.ts +9 -9
  288. package/tests/csp.spec.ts +122 -0
  289. package/tests/entrypoints.spec.ts +18 -2
  290. package/tests/error-status.spec.ts +6 -1
  291. package/tests/models.spec.ts +24 -16
  292. package/tests/query.spec.ts +13 -15
  293. package/tests/schemas.spec.ts +8 -8
  294. package/tests/scoped.spec.ts +161 -0
  295. package/tests/status.spec.ts +31 -22
package/README.md CHANGED
@@ -1,28 +1,31 @@
1
1
  # @owlmeans/planning
2
2
 
3
3
  Runtime-free contracts for project planning: workcards (cards, projects, specifications), typed
4
- relationships, shareable status flows over three intrinsic states, the transition event and its
5
- pure fold, the schema registry, the protocol tree and the models that behave identically on a
4
+ relationships, assignees, teams, comments and mention caches, shareable status flows over three
5
+ intrinsic states, the transition event and its pure fold, the schema registry, the protocol tree and the models that behave identically on a
6
6
  server and in a browser. An application depends on it from its shared contract package; it wires
7
7
  the executor with `@owlmeans/server-planning` and reads remotely with `@owlmeans/client-planning`.
8
8
 
9
9
  ## Installation
10
10
 
11
11
  ```sh
12
- bun add @owlmeans/planning@^0.1.18-rc.9 ajv ajv-formats
12
+ bun add @owlmeans/planning@^0.1.18 ajv ajv-formats
13
13
  ```
14
14
 
15
15
  ## Concepts
16
16
 
17
- - **Transition** — the only way a record changes: an append-only event; a card is the fold of its
18
- transitions in `seq` order (`applyTransition`).
17
+ - **Transition** — the only way a workcard changes: an append-only event; a card is the fold of its
18
+ transitions in `seq` order (`applyHelper.applyTransition`).
19
19
  - **Workcard** — base fields at the top level (`title`, `status`, `parent`, `parents`, `labels`,
20
20
  `order`); a type's own fields under `fields`, validated by the type's schema.
21
21
  - **Status flow** — shareable data declaring statuses (each mapped to `planned`, `in-progress` or
22
22
  `closed`) and named transitions; a type may run several flows.
23
23
  - **Specification** — a document workcard held in a slot the parent type declares; a revisioned
24
24
  slot revises one record in place.
25
- - **Wire query** — the scalar form a query travels in over HTTP (`encode*Query` / `decode*Query`).
25
+ - **Wire query** — the scalar form a query travels in over HTTP (`wireHelper.encode*Query` /
26
+ `wireHelper.decode*Query`).
27
+ - **Auxiliary resources** — assignees, teams, comments and mentions are separate organization
28
+ resources with `version` compare-and-set. They reuse the schema and relationship stores.
26
29
 
27
30
  ## Usage
28
31
 
@@ -63,19 +66,35 @@ import { makePlanningProtocols } from '@owlmeans/planning'
63
66
  export const planningProtocols = makePlanningProtocols({
64
67
  base: { alias: 'app:api:planning', path: '/planning' },
65
68
  guards: 'guard:default',
69
+ resources: true,
70
+ definitions: true,
66
71
  })
67
72
  ```
68
73
 
69
74
  Encode a query on the client, decode it in a handler:
70
75
 
71
76
  ```ts
72
- import { criteriaOf, decodeWorkcardQuery, encodeWorkcardQuery } from '@owlmeans/planning'
77
+ import { queryHelper, wireHelper } from '@owlmeans/planning'
73
78
 
74
- const query = encodeWorkcardQuery({ parent: projectId, status: ['todo', 'doing'], sort: ['order'] })
79
+ const query = wireHelper.encodeWorkcardQuery({ parent: projectId, status: ['todo', 'doing'], sort: ['order'] })
75
80
  const page = await context.entrypoint(planningProtocols.card.list).call({ query })
76
81
 
77
82
  // server side
78
- const where = criteriaOf(decodeWorkcardQuery(req.query), { entityId })
83
+ const where = queryHelper.criteriaOf(wireHelper.decodeWorkcardQuery(req.query), { entityId })
84
+ ```
85
+
86
+ Create a card and read it back through a facade — in process the one of `@owlmeans/server-planning`
87
+ (`ctx.service<PlanningHostService>(PLANNING_SERVICE).for({ entityId, profileId })`), remotely the one
88
+ of `@owlmeans/client-planning`:
89
+
90
+ ```ts
91
+ import { TransitionAction, WorkcardKind } from '@owlmeans/planning'
92
+
93
+ const drill = await planning.execute({
94
+ action: TransitionAction.Create,
95
+ card: { kind: WorkcardKind.Card, type: 'shed:tool', parent: shedId, title: 'Cordless drill' },
96
+ }, { wait: true }) // the options are the SECOND argument
97
+ const again = await planning.cards.get(drill.card!.id!)
79
98
  ```
80
99
 
81
100
  Work through a model — the same code on either side of the wire:
@@ -93,62 +112,136 @@ await task.update({ title: 'Renamed' }) // expectSeq defaults to the record's he
93
112
  Fold transitions yourself (a mirror, a test, a store):
94
113
 
95
114
  ```ts
96
- import { applyRelationship, applyTransition } from '@owlmeans/planning'
115
+ import { applyHelper } from '@owlmeans/planning'
97
116
 
98
- const card = transitions.reduce((current, transition) => applyTransition(current, transition), undefined)
99
- const links = transitions.reduce(applyRelationship, [])
117
+ const card = transitions.reduce((current, transition) => applyHelper.applyTransition(current, transition), undefined)
118
+ const links = transitions.reduce(applyHelper.applyRelationship, [])
100
119
  ```
101
120
 
121
+ ## Participants, comments and hierarchy
122
+
123
+ An assignee has a stable id, an organization-unique normalized nickname, `kind: 'human' |
124
+ 'non-human'`, a registered `type` and schema-validated `fields`. All links use the id.
125
+ `authentication: { provider, externalId }` may refer to any authentication system. Human types
126
+ require it by default; a type may explicitly declare `authentication: 'optional'`. Non-human
127
+ types default to optional authentication. Register `schemas.assigneeTypes` in a plugin, or use
128
+ `definitions.putAssigneeType` / `definitions.define({ assigneeTypes })` for organization-wide data
129
+ definitions. The optional `@owlmeans/planning-auth` adapter links verified identities and groups.
130
+
131
+ Cards have optional top-level single-choice `reporter` and `assignee` ids. Additional participant
132
+ fields use a type's `relationships` declaration with `field`, `toKind: PlanningResourceKind.Assignee`
133
+ and optional `to` type restrictions, `multiple` and `inverse`. The fields are authoritative;
134
+ planning maintains their derived relationship index. Assignee retirement preserves historical
135
+ attribution and prevents new assignments or memberships.
136
+
137
+ Use `facade.comments.create({ card, body })`; the host resolves the author from trusted
138
+ `PlanningScope.assigneeId`. `mentionHelper.encode(assigneeId, nickname)` embeds a stable mention
139
+ as `[@nickname](assignee:<encoded-id>)`. The separate `mentions` resource caches each mentioned
140
+ id and source comment revision. Comment updates maintain it; reads repair interrupted updates.
141
+
142
+ Teams exist independently of projects. `teams.addMember(teamId, assigneeId)` and
143
+ `teams.attach(teamId, projectId)` use canonical typed relationships. Multiple teams may attach to
144
+ one project, and a team may attach to multiple projects. `teams.assignees(projectId)` returns the
145
+ deduplicated union. An optional team `externalId` links an external permission group; access grants
146
+ and authentication membership remain the host's responsibility. Project `mode` is `opened` or
147
+ `closed`, defaults to `opened`, and is independent of flow status.
148
+
149
+ Hierarchy reuses `parent` and direct `parents`; `parentType` is derived from the primary parent.
150
+ Declare compatible `parents: { types?, required? }` and `children: { types }` on card schemas.
151
+ Planning rejects cycles, cross-organization parents, incompatible reparenting and ordinary-card
152
+ deletion with children. The nearest primary project selects schemas; project ancestry governs
153
+ access. Do not create another hierarchy or participant join store.
154
+
155
+ Enable `resources: true` to mount the assignee/team/comment/mention protocol branches and
156
+ `definitions: true` for writable schemas. Stock wire replies omit native organization `entityId`
157
+ metadata; the authenticated host derives scope from credentials and the organization `entitySlug`.
158
+ Custom fields and schema bodies remain opaque to wire projection.
159
+
102
160
  ## API
103
161
 
104
162
  - Records and declarations: `Workcard`, `Card`, `Project`, `Specification`, `Relationship`,
105
163
  `Transition`, `StatusFlowSchema`, `WorkcardTypeSchema`, `ProjectTypeSchema`, `SpecificationSlot`,
106
164
  `CodePolicy`, `RelationshipType`, `PlanningSchemaBundle`.
165
+ - Resources: `Assignee`, `AssigneeAuthentication`, `AssigneeTypeSchema`, `Team`, `Comment`,
166
+ `CommentMention`, `PlanningResourceFacade`, `PlanningRecordStore`, `PlanningWriteOptions`,
167
+ resource drafts and queries; `AssigneeKind`, `ProjectMode`, `PlanningResourceKind`,
168
+ `PLANNING_TEAM_MEMBER`, `PLANNING_PROJECT_TEAM`, `mentionHelper`, `planningReplyHelper`.
107
169
  - Write path and feed: `TransitionExecution`, `WorkcardDraft`, `ExecuteRequest`,
108
170
  `TransitionReceipt`, `TransitionReceiptView`, `CommitEvent`, `CommitStatus`, `CommitSource`.
109
171
  - Ports and seam: `TransitionStore`, `ProjectionStore`, `SpecificationStore`, `RelationshipStore`,
110
- `PlanningStore`, `PlanningPlugin`, `PlanningScope`, `PlanningFacade`, `PlanningService`.
172
+ `SchemaStore`, `PlanningStore`, `PlanningPlugin`, `PlanningScope`, `PlanningFacade`,
173
+ `PlanningService`, `PlanningDefinitions`.
174
+ - Data-defined types and flows: `ScopedSchemaRecord`, `ScopedSchemaWhere`, `ScopedSchemaBundle`,
175
+ `ScopedSchemaRegistry`, `SchemaDeclarations`, `SchemaWriteOptions`, `SchemaDefineRequest`,
176
+ `SchemaDefineReply`, and `scopedSchemaHelper` (`resolveScopedBundle`, `scopedRegistryOf`,
177
+ `assertTypeSchema`, `assertFlowSchema`, `assertOverridable`, `flowInUse`, `schemaRecordKey`,
178
+ `schemaKeyOf`).
111
179
  - Enums and constants: `WorkcardKind`, `IntrinsicStatus`, `IntrinsicPolicy`, `TransitionAction`,
112
- `CommitState`, `SpecificationFormat`, `CodeStyle`, `CodeScope`, `PLANNING_SERVICE`,
113
- `PLANNING_PATH`, `PLANNING_COMMIT_EVENT`, `planningAliases`, limits (`TITLE_MAX`, …).
114
- - Fold and changes: `applyTransition`, `applyRelationship`, `computeChanges`, `isEmptyChange`,
115
- `assertMutable`, `mergeFields`, `applyUnset`.
116
- - Status: `intrinsicOf`, `initialStatusOf`, `ruleOf`, `canTransit`, `transitionsFrom`,
117
- `initialFlowsOf`, `resolveIntrinsic`, `primaryFlowOf`, `isTerminal`.
118
- - Query: `criteriaOf`, `listOptionsOf`, `specCriteriaOf`, `linkWhereOf`, `transitionWhereOf`,
119
- `summaryOf`, `encode/decodeWorkcardQuery`, `encode/decodeSummaryQuery`,
120
- `encode/decodeTransitionQuery`, `encode/decodeSpecificationQuery`,
121
- `encode/decodeRelationshipQuery`.
122
- - Codes, specifications, validation: `mintCode`, `codeScopeOf`, `slotOf`, `currentSpecification`,
123
- `nextRevision`, `specificationTypeOf`, `makeAjv`, `validateFields`, `validateCard`,
124
- `validateSpecificationBody`.
180
+ `CommitState`, `SpecificationFormat`, `CodeStyle`, `CodeScope`, `PlanningSchemaKind`,
181
+ `SchemaOrigin`, `SchemaWriteMode`, `PLANNING_SERVICE`, `PLANNING_PATH`, `PLANNING_COMMIT_EVENT`,
182
+ limits (`TITLE_MAX`, …); `planningAliasHelper` (`planningAliases`, `planningDefinitionAliases`).
183
+ - Helpers — each a ready object (`xxxHelper`) built by its `createXxxHelper()`, its interface
184
+ exported beside it:
185
+ - `applyHelper` — the fold: `applyTransition`, `applyRelationship`.
186
+ - `changesHelper` — `computeChanges`, `isEmptyChange`, `assertMutable`, `mergeFields`,
187
+ `applyUnset`, `sameValue`.
188
+ - `cardHelper` — `isProject`, `isCard`, `isSpecification`, `normalizeParents`, `cardDefaults`,
189
+ `isPending`, `parentOf`, `projectOf`.
190
+ - `statusHelper` — `intrinsicOf`, `initialStatusOf`, `ruleOf`, `canTransit`, `transitionsFrom`,
191
+ `initialFlowsOf`, `resolveIntrinsic`, `primaryFlowOf`, `flowIdsOf`, `statusDefinitionOf`,
192
+ `isTerminal`.
193
+ - `queryHelper` — `criteriaOf`, `listOptionsOf`, `specCriteriaOf`, `linkWhereOf`,
194
+ `transitionWhereOf`, `summaryOf`.
195
+ - `wireHelper` — `encode/decodeWorkcardQuery`, `encode/decodeSummaryQuery`,
196
+ `encode/decodeTransitionQuery`, `encode/decodeSpecificationQuery`,
197
+ `encode/decodeRelationshipQuery`, `encode/decodeList`, `encode/decodeSort`.
198
+ - `codeHelper` — `mintCode`, `codeScopeOf`, `slugOf`.
199
+ - `specificationHelper` — `slotOf`, `currentSpecification`, `nextRevision`, `isRevisioned`,
200
+ `bodyCharsOf`, `specificationTypeOf`.
201
+ - `validateHelper` — `validateFields`, `validateCard`, `validateSpecificationBody`,
202
+ `invalidFieldKeys`, `ajvErrorText`; and `makeAjv`.
203
+ - The former plain functions (`applyTransition`, `criteriaOf`, `encodeWorkcardQuery`, …) remain as
204
+ deprecated delegates to these helpers.
125
205
  - Registry, protocols, models: `makeSchemaRegistry`, `makePlanningProtocols`, `makeWorkcardModel`,
126
206
  `makeProjectModel`, `makeSpecificationModel`, `modelOf`.
127
207
  - Errors: `PlanningError`, `WorkcardNotFound`, `UnknownWorkcardType`, `UnknownStatusFlow`,
128
208
  `ParentNotFound`, `CardTypeNotAllowed`, `PlanningRefused`, `IllegalTransition`, `FieldsInvalid`,
129
209
  `LabelNotAllowed`, `SpecificationSlotUnknown`, `SpecificationRevisionConflict`,
130
210
  `RelationshipRefused`, `CodeTaken`, `WorkcardConflict`, `CommitTimeout`, `CommitFailed`,
131
- `PlanningScopeMismatch`, `PlanningUnsupported`.
211
+ `PlanningScopeMismatch`, `SchemaConflict`, `SchemaInUse`, `SchemaSealed`, `SchemaInvalid`,
212
+ `PlanningForbidden`, `PlanningUnsupported`.
132
213
  - Schemas: `WorkcardSchema`, `SpecificationSchema`, `TransitionSchema`, `ExecuteRequestSchema`,
133
214
  `WorkcardQuerySchema`, … (every record, declaration, request and view).
134
215
 
135
216
  ## Common pitfalls
136
217
 
218
+ - A create's draft goes under `card` (never `draft`), and `{ wait, timeout }` is the second argument
219
+ of `execute` — inside the execution an in-process facade ignores it.
220
+ - A type or flow declaration has no `name` or `key`: the display name is `label`, the key is `type`
221
+ (a type) or `id` (a flow); a status has `key`, a transition rule `name`. The declaration schemas
222
+ are closed — `definitions.define` refuses an extra key with `SchemaInvalid`.
137
223
  - Pass a query through `encode*Query` before an HTTP call — arrays and objects do not survive a
138
224
  query string as they are.
139
225
  - `status`, `intrinsic` and `flows` move only through `transit`; an `update` naming them is refused.
226
+ - `createdBy` is written once, by a create's draft: `changes` or `unset` naming it is refused on
227
+ every action (`planning:immutable:createdBy`), so an ownership check can trust it.
140
228
  - `fields` and `flows` in `changes` merge; every other key replaces. Clear with `null` or `unset`.
141
229
  - A model's `expectSeq` is its record's head: a stale model refuses with `WorkcardConflict`.
142
230
  - `WorkcardNotFound` is also the answer for another entity's card — never read it as "deleted".
143
231
  - `CommitTimeout` leaves the transition pending; it will still commit.
144
232
  - Keep schemas `$jsonSchema`-safe: no `integer`, every optional property nullable.
233
+ - Card types, flows and assignee types are data-defined, and a code key needs `overridable: true` to be
234
+ overridden; a data-defined declaration's `version` is its compare-and-set token.
235
+ - Auxiliary updates/removals require the record's current `version`. Their `fields` replace the
236
+ previous fields object; card `changes.fields` merge.
145
237
 
146
238
  ## Related packages
147
239
 
148
240
  - `@owlmeans/server-planning` — executor, plugin registry, memory store, handlers
149
241
  - `@owlmeans/client-planning` — remote facade, state mirror, commit waiting
150
242
  - `@owlmeans/resource` — the criteria language
151
- - `@owlmeans/server-planning` — server execution and projection implementations
243
+ - `@owlmeans/planning-postgres` — the durable Postgres store
244
+ - `@owlmeans/planning-auth` — optional verified identity and group mapping
152
245
 
153
246
  <!-- owlmeans:agent-guidance:start -->
154
247
  ## Agent guidance
@@ -158,7 +251,7 @@ This package ships embedded agent skills under `agent-meta/`. After installing y
158
251
  your project's skill store (`.agents/skills/`):
159
252
 
160
253
  ```sh
161
- npx @owlmeans/agent-skills@^0.1.18-rc.38
254
+ npx @owlmeans/agent-skills@^0.1.18
162
255
  ```
163
256
 
164
257
  The embedded files are version-matched to this package release. Do not edit them
@@ -1,8 +1,8 @@
1
1
  {
2
- "schemaVersion": 2,
2
+ "schemaVersion": 3,
3
3
  "package": "@owlmeans/planning",
4
- "version": "0.1.18-rc.9",
5
- "generatedAt": "2026-09-23T19:57:40.684Z",
4
+ "version": "0.1.18",
5
+ "generatedAt": "2026-10-28T00:31:34.734Z",
6
6
  "canonicalRepo": "https://github.com/owlmeans/common",
7
7
  "entries": [
8
8
  {
@@ -10,7 +10,134 @@
10
10
  "name": "planning",
11
11
  "category": "package-specific",
12
12
  "file": "skills/planning/SKILL.md",
13
- "canonicalPath": ".agents/skills/planning/SKILL.md"
13
+ "canonicalPath": ".agents/skills/planning/SKILL.md",
14
+ "parts": [
15
+ {
16
+ "name": "collaboration",
17
+ "file": "skills/planning/parts/collaboration.md",
18
+ "description": "Assignees, comments with stable mentions, teams across projects, card hierarchy rules, the resources protocol branches, and PlanningReply's organization-free records.",
19
+ "purposes": [
20
+ "detail",
21
+ "view"
22
+ ],
23
+ "mentions": [
24
+ "Assignee",
25
+ "Team",
26
+ "Comment",
27
+ "CommentMention",
28
+ "mentionHelper",
29
+ "PlanningResourceKind",
30
+ "PLANNING_PROJECT_TEAM",
31
+ "planningResourceAliases",
32
+ "planningReplyHelper",
33
+ "PlanningReply",
34
+ "teams.addMember",
35
+ "reporter",
36
+ "assignee"
37
+ ]
38
+ },
39
+ {
40
+ "name": "errors",
41
+ "file": "skills/planning/parts/errors.md",
42
+ "description": "Every refusal class with its planning marker and HTTP status, the httpStatus rules for a new refusal, and the eight-language i18n the package registers.",
43
+ "purposes": [
44
+ "feedback"
45
+ ],
46
+ "mentions": [
47
+ "PlanningError",
48
+ "WorkcardNotFound",
49
+ "IllegalTransition",
50
+ "WorkcardConflict",
51
+ "PlanningRefused",
52
+ "FieldsInvalid",
53
+ "SchemaConflict",
54
+ "SchemaSealed",
55
+ "SchemaInvalid",
56
+ "PlanningForbidden",
57
+ "CommitTimeout",
58
+ "CommitFailed",
59
+ "lib:planning"
60
+ ]
61
+ },
62
+ {
63
+ "name": "fold",
64
+ "file": "skills/planning/parts/fold.md",
65
+ "description": "The pure fold (applyTransition, applyRelationship), what computeChanges records and assertMutable refuses, and the one query translation with its wire form.",
66
+ "purposes": [
67
+ "query",
68
+ "state"
69
+ ],
70
+ "mentions": [
71
+ "applyHelper",
72
+ "applyTransition",
73
+ "applyRelationship",
74
+ "changesHelper",
75
+ "computeChanges",
76
+ "assertMutable",
77
+ "isEmptyChange",
78
+ "queryHelper",
79
+ "criteriaOf",
80
+ "listOptionsOf",
81
+ "summaryOf",
82
+ "wireHelper",
83
+ "encodeWorkcardQuery",
84
+ "decodeWorkcardQuery",
85
+ "WorkcardQuery"
86
+ ]
87
+ },
88
+ {
89
+ "name": "mounting",
90
+ "file": "skills/planning/parts/mounting.md",
91
+ "description": "The protocol tree makePlanningProtocols declares (leaves, routes, aliases, guards, the commit socket) and how a generated target mounts it.",
92
+ "purposes": [
93
+ "server-api",
94
+ "config"
95
+ ],
96
+ "mentions": [
97
+ "makePlanningProtocols",
98
+ "planningAliasHelper",
99
+ "planningAliases",
100
+ "planningDefinitionAliases",
101
+ "PLANNING_PATH",
102
+ "socketBase",
103
+ "ExecuteRequest",
104
+ "CommitQuery",
105
+ "CommitFeedQuery",
106
+ "schema.define"
107
+ ]
108
+ },
109
+ {
110
+ "name": "types",
111
+ "file": "skills/planning/parts/types.md",
112
+ "description": "Declaring card, project and specification types and status flows as closed data, the application's own definition properties and base card fields (`app`), the data-defined layers (code, entity, project) and retirement, and the rules every record schema keeps.",
113
+ "purposes": [
114
+ "data"
115
+ ],
116
+ "mentions": [
117
+ "WorkcardTypeSchema",
118
+ "ProjectTypeSchema",
119
+ "StatusFlowSchema",
120
+ "SpecificationSlot",
121
+ "CodePolicy",
122
+ "makeSchemaRegistry",
123
+ "scopedSchemaHelper",
124
+ "resolveScopedBundle",
125
+ "ScopedSchemaRecord",
126
+ "ScopedSchemaBundle",
127
+ "SchemaStore",
128
+ "putType",
129
+ "putFlow",
130
+ "putAssigneeType",
131
+ "scopedCardTypes",
132
+ "overridable",
133
+ "appSchemaHelper",
134
+ "PlanningAppDeclarations",
135
+ "PlanningAppSchema",
136
+ "registerApp",
137
+ "fieldsSchema"
138
+ ]
139
+ }
140
+ ]
14
141
  }
15
142
  ]
16
143
  }