@x12i/memorix-metadata 3.0.2 → 3.1.0

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 (72) hide show
  1. package/README.md +10 -6
  2. package/dist/abstracts.d.ts +9 -3
  3. package/dist/abstracts.d.ts.map +1 -1
  4. package/dist/abstracts.js +70 -66
  5. package/dist/abstracts.js.map +1 -1
  6. package/dist/fold-bindings.d.ts +19 -0
  7. package/dist/fold-bindings.d.ts.map +1 -0
  8. package/dist/fold-bindings.js +103 -0
  9. package/dist/fold-bindings.js.map +1 -0
  10. package/dist/index.d.ts +7 -3
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +7 -3
  13. package/dist/index.js.map +1 -1
  14. package/dist/kind-fields.d.ts.map +1 -1
  15. package/dist/kind-fields.js +0 -1
  16. package/dist/kind-fields.js.map +1 -1
  17. package/dist/kinds.d.ts +1 -1
  18. package/dist/kinds.d.ts.map +1 -1
  19. package/dist/kinds.js +6 -11
  20. package/dist/kinds.js.map +1 -1
  21. package/dist/multi-agent-rule.d.ts +3 -3
  22. package/dist/multi-agent-rule.d.ts.map +1 -1
  23. package/dist/multi-agent-rule.js +7 -7
  24. package/dist/multi-agent-rule.js.map +1 -1
  25. package/dist/normalize.d.ts +3 -2
  26. package/dist/normalize.d.ts.map +1 -1
  27. package/dist/normalize.js +18 -5
  28. package/dist/normalize.js.map +1 -1
  29. package/dist/resolve.d.ts +14 -2
  30. package/dist/resolve.d.ts.map +1 -1
  31. package/dist/resolve.js +229 -133
  32. package/dist/resolve.js.map +1 -1
  33. package/dist/streams.d.ts +17 -0
  34. package/dist/streams.d.ts.map +1 -0
  35. package/dist/streams.js +76 -0
  36. package/dist/streams.js.map +1 -0
  37. package/dist/topology.d.ts +52 -0
  38. package/dist/topology.d.ts.map +1 -0
  39. package/dist/topology.js +348 -0
  40. package/dist/topology.js.map +1 -0
  41. package/dist/types.d.ts +133 -17
  42. package/dist/types.d.ts.map +1 -1
  43. package/dist/types.js +22 -2
  44. package/dist/types.js.map +1 -1
  45. package/dist/validate.d.ts.map +1 -1
  46. package/dist/validate.js +188 -64
  47. package/dist/validate.js.map +1 -1
  48. package/examples/custom-kinds/acme-ui-tabs.pack.json +2 -2
  49. package/examples/invalid/agent-classification.json +69 -69
  50. package/examples/invalid/broken-binding.json +69 -69
  51. package/examples/invalid/completion-mapping-with-exec-policy.json +65 -65
  52. package/examples/invalid/missing-parent.json +69 -69
  53. package/examples/invalid/operational-kind-root.json +73 -73
  54. package/examples/invalid/pipeline-unknown-service.json +62 -62
  55. package/examples/invalid/relationship-missing-rules.json +65 -65
  56. package/examples/invalid/relationship-with-storage.json +65 -65
  57. package/examples/invalid/service-with-secrets.json +66 -66
  58. package/examples/knowx/normalized/pack.json +1538 -0
  59. package/examples/{ops → opx}/normalized/pack.json +340 -322
  60. package/examples/opx/raw/abstract-types.json +244 -0
  61. package/examples/{ops → opx}/raw/agents.json +8 -8
  62. package/examples/opx/raw/object-types.json +101 -0
  63. package/examples/{ops → opx}/raw/pipelines-and-sources.json +79 -31
  64. package/examples/{ops → opx}/raw/relationship-definitions.json +17 -47
  65. package/examples/{ops → opx}/raw/view-definitions.json +7 -21
  66. package/examples/opx/raw/write-and-source-mappings.json +223 -0
  67. package/examples/{project-ops → project-opx}/normalized/pack.json +391 -299
  68. package/package.json +1 -1
  69. package/examples/ops/raw/abstract-bindings.json +0 -38
  70. package/examples/ops/raw/abstract-types.json +0 -28
  71. package/examples/ops/raw/object-types.json +0 -170
  72. package/examples/ops/raw/write-and-source-mappings.json +0 -108
@@ -0,0 +1,244 @@
1
+ {
2
+ "abstractTypes": [
3
+ {
4
+ "id": "People",
5
+ "name": "People",
6
+ "meaning": "People who perform operational work \u2014 inside the org (employeeId) or outside (externalPersonId), distinguished by identity kind",
7
+ "category": "entity",
8
+ "properties": [
9
+ {
10
+ "id": "title",
11
+ "valueType": "string",
12
+ "required": true
13
+ },
14
+ {
15
+ "id": "role",
16
+ "valueType": "string",
17
+ "required": true
18
+ },
19
+ {
20
+ "id": "lens",
21
+ "valueType": "string",
22
+ "required": false
23
+ },
24
+ {
25
+ "id": "email",
26
+ "valueType": "string",
27
+ "required": false
28
+ },
29
+ {
30
+ "id": "organization",
31
+ "valueType": "string",
32
+ "required": false
33
+ }
34
+ ],
35
+ "members": [
36
+ {
37
+ "objectType": "people",
38
+ "contentType": "snapshots",
39
+ "properties": [
40
+ {
41
+ "abstractProperty": "title",
42
+ "contentType": "snapshots",
43
+ "mappingId": "opx-people-abstract"
44
+ },
45
+ {
46
+ "abstractProperty": "role",
47
+ "contentType": "snapshots",
48
+ "mappingId": "opx-people-abstract"
49
+ },
50
+ {
51
+ "abstractProperty": "lens",
52
+ "contentType": "snapshots",
53
+ "mappingId": "opx-people-abstract"
54
+ },
55
+ {
56
+ "abstractProperty": "email",
57
+ "contentType": "snapshots",
58
+ "mappingId": "opx-people-abstract"
59
+ },
60
+ {
61
+ "abstractProperty": "organization",
62
+ "contentType": "snapshots",
63
+ "mappingId": "opx-people-abstract"
64
+ }
65
+ ]
66
+ }
67
+ ],
68
+ "union": false,
69
+ "notes": "People abstract \u2194 people OT 1:1. Inside/outside org is concept.identifiers.primary.kind (employeeId | externalPersonId), not a second OT."
70
+ },
71
+ {
72
+ "id": "WorkItems",
73
+ "name": "Work Items",
74
+ "meaning": "Units of operational work",
75
+ "category": "entity",
76
+ "properties": [
77
+ {
78
+ "id": "title",
79
+ "valueType": "string",
80
+ "required": true
81
+ },
82
+ {
83
+ "id": "status",
84
+ "valueType": "string",
85
+ "required": true
86
+ },
87
+ {
88
+ "id": "priority",
89
+ "valueType": "string",
90
+ "required": false
91
+ }
92
+ ],
93
+ "members": [
94
+ {
95
+ "objectType": "work-items",
96
+ "contentType": "snapshots",
97
+ "properties": [
98
+ {
99
+ "abstractProperty": "title",
100
+ "contentType": "snapshots",
101
+ "propertyPath": "data.title",
102
+ "concreteValueType": "string"
103
+ },
104
+ {
105
+ "abstractProperty": "status",
106
+ "contentType": "snapshots",
107
+ "propertyPath": "data.status",
108
+ "concreteValueType": "string"
109
+ },
110
+ {
111
+ "abstractProperty": "priority",
112
+ "contentType": "snapshots",
113
+ "propertyPath": "data.priority",
114
+ "concreteValueType": "string"
115
+ }
116
+ ]
117
+ }
118
+ ],
119
+ "union": false
120
+ },
121
+ {
122
+ "id": "Playbooks",
123
+ "name": "Playbooks",
124
+ "meaning": "Reusable operational knowledge / playbooks",
125
+ "category": "knowledge",
126
+ "properties": [
127
+ {
128
+ "id": "title",
129
+ "valueType": "string",
130
+ "required": true
131
+ },
132
+ {
133
+ "id": "body",
134
+ "valueType": "string",
135
+ "required": true
136
+ },
137
+ {
138
+ "id": "contentHash",
139
+ "valueType": "string",
140
+ "required": false
141
+ }
142
+ ],
143
+ "members": [
144
+ {
145
+ "objectType": "playbooks",
146
+ "contentType": "snapshots",
147
+ "properties": [
148
+ {
149
+ "abstractProperty": "title",
150
+ "contentType": "snapshots",
151
+ "propertyPath": "data.name",
152
+ "concreteValueType": "string"
153
+ },
154
+ {
155
+ "abstractProperty": "body",
156
+ "contentType": "snapshots",
157
+ "propertyPath": "data.body",
158
+ "concreteValueType": "string"
159
+ },
160
+ {
161
+ "abstractProperty": "contentHash",
162
+ "contentType": "snapshots",
163
+ "propertyPath": "data.contentHash",
164
+ "concreteValueType": "string"
165
+ }
166
+ ]
167
+ }
168
+ ],
169
+ "union": false
170
+ },
171
+ {
172
+ "id": "ActivityEvents",
173
+ "name": "Activity Events",
174
+ "meaning": "Progress and activity reports about work items",
175
+ "category": "event",
176
+ "properties": [
177
+ {
178
+ "id": "type",
179
+ "valueType": "string",
180
+ "required": true
181
+ },
182
+ {
183
+ "id": "message",
184
+ "valueType": "string",
185
+ "required": true
186
+ },
187
+ {
188
+ "id": "workItemId",
189
+ "valueType": "recordId",
190
+ "required": true
191
+ },
192
+ {
193
+ "id": "actorId",
194
+ "valueType": "recordId",
195
+ "required": false
196
+ },
197
+ {
198
+ "id": "occurredAt",
199
+ "valueType": "datetime",
200
+ "required": false
201
+ }
202
+ ],
203
+ "members": [
204
+ {
205
+ "objectType": "activity-events",
206
+ "contentType": "snapshots",
207
+ "properties": [
208
+ {
209
+ "abstractProperty": "type",
210
+ "contentType": "snapshots",
211
+ "propertyPath": "data.type",
212
+ "concreteValueType": "string"
213
+ },
214
+ {
215
+ "abstractProperty": "message",
216
+ "contentType": "snapshots",
217
+ "propertyPath": "data.message",
218
+ "concreteValueType": "string"
219
+ },
220
+ {
221
+ "abstractProperty": "workItemId",
222
+ "contentType": "snapshots",
223
+ "propertyPath": "data.workItemId",
224
+ "concreteValueType": "recordId"
225
+ },
226
+ {
227
+ "abstractProperty": "actorId",
228
+ "contentType": "snapshots",
229
+ "propertyPath": "data.actorId",
230
+ "concreteValueType": "recordId"
231
+ },
232
+ {
233
+ "abstractProperty": "occurredAt",
234
+ "contentType": "snapshots",
235
+ "propertyPath": "data.occurredAt",
236
+ "concreteValueType": "datetime"
237
+ }
238
+ ]
239
+ }
240
+ ],
241
+ "union": false
242
+ }
243
+ ]
244
+ }
@@ -1,30 +1,30 @@
1
1
  {
2
2
  "agents": [
3
3
  {
4
- "id": "ops",
4
+ "id": "opx",
5
5
  "name": "Operations (generic parent)",
6
6
  "description": "Complete generic parent agent for ordinary operational work. Permanent Memorix acceptance pack.",
7
7
  "parentAgentId": null,
8
8
  "orgScopeExample": {
9
9
  "orgId": "fieldstone",
10
10
  "agentIds": [
11
- "ops"
11
+ "opx"
12
12
  ]
13
13
  }
14
14
  },
15
15
  {
16
- "id": "project-ops",
17
- "name": "Project Operations (child of ops)",
18
- "description": "Inheritance smoke agent. Extends ops without replacing core definitions.",
19
- "parentAgentId": "ops",
16
+ "id": "project-opx",
17
+ "name": "Project Operations (child of opx)",
18
+ "description": "Inheritance smoke agent. Extends opx without replacing core definitions.",
19
+ "parentAgentId": "opx",
20
20
  "overrides": {
21
21
  "viewDefinitions": [
22
22
  {
23
- "id": "project-ops-work-items-list",
23
+ "id": "project-opx-work-items-list",
24
24
  "kind": "list",
25
25
  "objectType": "work-items",
26
26
  "title": "Project work items",
27
- "extends": "ops-work-items-list"
27
+ "extends": "opx-work-items-list"
28
28
  }
29
29
  ]
30
30
  }
@@ -0,0 +1,101 @@
1
+ {
2
+ "objectTypes": [
3
+ {
4
+ "id": "people",
5
+ "name": "People",
6
+ "dataCategory": "entity",
7
+ "abstractTypes": ["People"],
8
+ "notes": "Single people OT. Inside vs outside org is identity kind (concept.identifiers.primary.kind): employeeId | externalPersonId — not separate object types.",
9
+ "contentTypes": [
10
+ {
11
+ "id": "raw",
12
+ "required": true,
13
+ "requiredReason": "Landed provider-native payload; identity and lineage depend on it."
14
+ },
15
+ {
16
+ "id": "snapshots",
17
+ "required": true,
18
+ "requiredReason": "Canonical composed person view used by queries and abstracts."
19
+ },
20
+ {
21
+ "id": "discovery",
22
+ "discriminator": {
23
+ "path": "data.discoveryType",
24
+ "required": false,
25
+ "defaultValue": "default"
26
+ }
27
+ },
28
+ {
29
+ "id": "analysis",
30
+ "discriminator": {
31
+ "path": "data.analysisType",
32
+ "required": false,
33
+ "defaultValue": "default"
34
+ }
35
+ },
36
+ { "id": "relationships", "notes": "Candidate store shape until Gate G4" }
37
+ ]
38
+ },
39
+ {
40
+ "id": "work-items",
41
+ "name": "Work Items",
42
+ "dataCategory": "entity",
43
+ "abstractTypes": ["WorkItems"],
44
+ "contentTypes": [
45
+ { "id": "raw" },
46
+ { "id": "snapshots" },
47
+ {
48
+ "id": "discovery",
49
+ "discriminator": { "path": "data.discoveryType", "required": false }
50
+ },
51
+ {
52
+ "id": "analysis",
53
+ "discriminator": {
54
+ "path": "data.analysisType",
55
+ "required": false,
56
+ "defaultValue": "delivery-risk"
57
+ }
58
+ },
59
+ {
60
+ "id": "decisions",
61
+ "discriminator": {
62
+ "path": "data.decisionType",
63
+ "required": false,
64
+ "defaultValue": "priority"
65
+ }
66
+ },
67
+ { "id": "workflow" },
68
+ { "id": "context", "retention": "work-scoped-ttl" },
69
+ { "id": "relationships" }
70
+ ],
71
+ "snapshotBuckets": {
72
+ "analytics": "optional",
73
+ "enrichment": "optional",
74
+ "insights": "optional"
75
+ }
76
+ },
77
+ {
78
+ "id": "playbooks",
79
+ "name": "Playbooks",
80
+ "dataCategory": "knowledge",
81
+ "abstractTypes": ["Playbooks"],
82
+ "contentTypes": [
83
+ { "id": "raw" },
84
+ { "id": "snapshots", "notes": "Persistent knowledge content" },
85
+ { "id": "relationships" }
86
+ ],
87
+ "retention": "persistent-knowledge"
88
+ },
89
+ {
90
+ "id": "activity-events",
91
+ "name": "Activity Events",
92
+ "dataCategory": "event",
93
+ "abstractTypes": ["ActivityEvents"],
94
+ "contentTypes": [
95
+ { "id": "raw" },
96
+ { "id": "snapshots", "notes": "Normalized event content" },
97
+ { "id": "relationships" }
98
+ ]
99
+ }
100
+ ]
101
+ }
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "pipelineDefinitions": [
3
3
  {
4
- "id": "ops-knowledge-pull",
5
- "name": "Scheduled knowledge pull from ops-source",
4
+ "id": "opx-knowledge-pull",
5
+ "name": "Scheduled knowledge pull from opx-source",
6
6
  "trigger": "scheduled",
7
7
  "mode": "knowledge",
8
8
  "steps": [
9
9
  {
10
10
  "id": "pull",
11
11
  "kind": "memory-pull",
12
- "sourceId": "ops-source"
12
+ "sourceId": "opx-source"
13
13
  },
14
14
  {
15
15
  "id": "land-raw",
@@ -26,7 +26,7 @@
26
26
  ]
27
27
  },
28
28
  {
29
- "id": "ops-context-pull",
29
+ "id": "opx-context-pull",
30
30
  "name": "On-demand work-item context pull",
31
31
  "trigger": "on-demand",
32
32
  "mode": "context",
@@ -34,7 +34,7 @@
34
34
  {
35
35
  "id": "pull",
36
36
  "kind": "memory-pull",
37
- "sourceId": "ops-source"
37
+ "sourceId": "opx-source"
38
38
  },
39
39
  {
40
40
  "id": "land-raw",
@@ -51,7 +51,7 @@
51
51
  ]
52
52
  },
53
53
  {
54
- "id": "ops-relationship-build",
54
+ "id": "opx-relationship-build",
55
55
  "name": "Discover and write lightweight relationships",
56
56
  "trigger": "explicit",
57
57
  "steps": [
@@ -70,7 +70,7 @@
70
70
  ]
71
71
  },
72
72
  {
73
- "id": "ops-analysis",
73
+ "id": "opx-analysis",
74
74
  "name": "Work-item analysis sibling",
75
75
  "trigger": "explicit",
76
76
  "steps": [
@@ -86,7 +86,7 @@
86
86
  ]
87
87
  },
88
88
  {
89
- "id": "ops-workflow",
89
+ "id": "opx-workflow",
90
90
  "name": "Work-item workflow sibling",
91
91
  "trigger": "explicit",
92
92
  "steps": [
@@ -100,23 +100,41 @@
100
100
  "contentType": "workflow"
101
101
  }
102
102
  ]
103
+ },
104
+ {
105
+ "id": "opx-enrich-priority",
106
+ "name": "Enrich WI priority (draft then write)",
107
+ "trigger": "explicit",
108
+ "description": "Capture snapshot → enrich service (opx-enrich-priority) → write-record. Runtime v2 uses stepKind enrich + serviceId.",
109
+ "steps": [
110
+ {
111
+ "id": "enrich",
112
+ "kind": "enrich",
113
+ "serviceId": "opx-enrich-priority"
114
+ },
115
+ {
116
+ "id": "write",
117
+ "kind": "write-record",
118
+ "contentType": "snapshots"
119
+ }
120
+ ]
103
121
  }
104
122
  ],
105
123
  "sources": [
106
124
  {
107
- "id": "ops-source",
108
- "name": "Fieldstone ops fixture source",
109
- "kind": "rest-fixture",
110
- "baseUrlEnv": "OPS_SOURCE_URL",
111
- "defaultBaseUrl": "http://127.0.0.1:7099",
112
- "credentialRef": "ops-source-local",
113
- "connectorRef": "ops-fixture",
125
+ "id": "opx-source",
126
+ "name": "Opx-service",
127
+ "kind": "rest",
128
+ "baseUrlEnv": "OPX_SOURCE_URL",
129
+ "defaultBaseUrl": "http://127.0.0.1:5102",
130
+ "credentialRef": "opx-source-local",
131
+ "connectorRef": "opx-rest",
114
132
  "endpoints": [
115
133
  "/employees",
116
- "/contractors",
134
+ "/external-people",
117
135
  "/work-items",
118
136
  "/activity-events",
119
- "/procedures",
137
+ "/playbooks",
120
138
  "/work-items/:id/context"
121
139
  ],
122
140
  "pagination": {
@@ -131,13 +149,18 @@
131
149
  },
132
150
  "routes": [
133
151
  {
134
- "endpoint": "/procedures",
135
- "objectType": "procedures",
152
+ "endpoint": "/playbooks",
153
+ "objectType": "playbooks",
136
154
  "dataCategory": "knowledge",
137
155
  "identityPath": "id",
138
- "primaryKind": "procedureId",
139
- "modes": ["knowledge"],
140
- "pageSize": 2
156
+ "primaryKind": "playbookId",
157
+ "modes": [
158
+ "knowledge"
159
+ ],
160
+ "pageSize": 2,
161
+ "checkpoint": {
162
+ "method": "cursor"
163
+ }
141
164
  },
142
165
  {
143
166
  "endpoint": "/work-items/:id/context",
@@ -145,7 +168,12 @@
145
168
  "dataCategory": "entity",
146
169
  "identityPath": "workItemId",
147
170
  "primaryKind": "workItemId",
148
- "modes": ["context"]
171
+ "modes": [
172
+ "context"
173
+ ],
174
+ "checkpoint": {
175
+ "method": "cursor"
176
+ }
149
177
  },
150
178
  {
151
179
  "endpoint": "/work-items",
@@ -153,23 +181,38 @@
153
181
  "dataCategory": "entity",
154
182
  "identityPath": "id",
155
183
  "primaryKind": "workItemId",
156
- "modes": ["knowledge"]
184
+ "modes": [
185
+ "knowledge"
186
+ ],
187
+ "checkpoint": {
188
+ "method": "cursor"
189
+ }
157
190
  },
158
191
  {
159
192
  "endpoint": "/employees",
160
- "objectType": "employees",
193
+ "objectType": "people",
161
194
  "dataCategory": "entity",
162
195
  "identityPath": "id",
163
196
  "primaryKind": "employeeId",
164
- "modes": ["knowledge"]
197
+ "modes": [
198
+ "knowledge"
199
+ ],
200
+ "checkpoint": {
201
+ "method": "cursor"
202
+ }
165
203
  },
166
204
  {
167
- "endpoint": "/contractors",
168
- "objectType": "contractors",
205
+ "endpoint": "/external-people",
206
+ "objectType": "people",
169
207
  "dataCategory": "entity",
170
208
  "identityPath": "id",
171
- "primaryKind": "contractorId",
172
- "modes": ["knowledge"]
209
+ "primaryKind": "externalPersonId",
210
+ "modes": [
211
+ "knowledge"
212
+ ],
213
+ "checkpoint": {
214
+ "method": "cursor"
215
+ }
173
216
  },
174
217
  {
175
218
  "endpoint": "/activity-events",
@@ -177,7 +220,12 @@
177
220
  "dataCategory": "event",
178
221
  "identityPath": "id",
179
222
  "primaryKind": "activityEventId",
180
- "modes": ["knowledge"]
223
+ "modes": [
224
+ "knowledge"
225
+ ],
226
+ "checkpoint": {
227
+ "method": "cursor"
228
+ }
181
229
  }
182
230
  ]
183
231
  }