@x12i/memorix-docs 1.0.2 → 1.1.1

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 (236) hide show
  1. package/dist/generated/bundle.d.ts +4849 -3
  2. package/dist/generated/bundle.d.ts.map +1 -1
  3. package/dist/generated/bundle.js +7580 -45
  4. package/dist/generated/bundle.js.map +1 -1
  5. package/dist/index.d.ts +2 -2
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +6 -4
  8. package/dist/index.js.map +1 -1
  9. package/files/INDEX.md +84 -0
  10. package/files/SEARCH.json +3087 -0
  11. package/files/agent-manifest.json +1785 -0
  12. package/files/apis/memorix-records/overview.md +22 -0
  13. package/files/concepts/abstracts-bindings.md +27 -0
  14. package/files/concepts/agents-inheritance.md +28 -0
  15. package/files/concepts/analysis-objects.md +26 -0
  16. package/files/concepts/composition.md +27 -0
  17. package/files/concepts/decisions-content.md +27 -0
  18. package/files/concepts/effective-metadata.md +27 -0
  19. package/files/concepts/explicit-metadata-installation.md +26 -0
  20. package/files/concepts/intelligence-proposals.md +27 -0
  21. package/files/concepts/mappings-transforms.md +26 -0
  22. package/files/concepts/object-content-category.md +26 -0
  23. package/files/concepts/org-agent-scope.md +27 -0
  24. package/files/concepts/people-union.md +27 -0
  25. package/files/concepts/raw-records.md +26 -0
  26. package/files/concepts/record-revisions.md +26 -0
  27. package/files/concepts/relationship-definitions.md +26 -0
  28. package/files/concepts/relationship-references.md +27 -0
  29. package/files/concepts/resolved-unresolved.md +27 -0
  30. package/files/concepts/sources-and-memory.md +26 -0
  31. package/files/concepts/traversal.md +27 -0
  32. package/files/diagrams/agent-inheritance.md +34 -0
  33. package/files/diagrams/intelligence-journey.md +38 -0
  34. package/files/diagrams/memorix-central-journey.md +51 -0
  35. package/files/diagrams/metadata-lifecycle.md +40 -0
  36. package/files/diagrams/people-union-diagram.md +36 -0
  37. package/files/diagrams/record-content-model.md +43 -0
  38. package/files/diagrams/relationship-traversal.md +40 -0
  39. package/files/diagrams/revision-safe-write.md +39 -0
  40. package/files/examples/analysis-decision-records.md +11 -0
  41. package/files/examples/memorix-record-envelope.md +11 -0
  42. package/files/examples/metadata-pack-install.md +11 -0
  43. package/files/examples/people-abstract-query.md +11 -0
  44. package/files/examples/raw-vs-composed.md +11 -0
  45. package/files/examples/relationship-def-and-ref.md +11 -0
  46. package/files/examples/revision-conflict-response.md +11 -0
  47. package/files/examples/revision-safe-write.md +11 -0
  48. package/files/examples/traversal-resolved-unresolved.md +11 -0
  49. package/files/glossary/abstract.md +9 -0
  50. package/files/glossary/agent.md +9 -0
  51. package/files/glossary/analysis.md +9 -0
  52. package/files/glossary/binding.md +9 -0
  53. package/files/glossary/composition.md +9 -0
  54. package/files/glossary/content-type.md +9 -0
  55. package/files/glossary/data-category.md +9 -0
  56. package/files/glossary/decision.md +9 -0
  57. package/files/glossary/effective-metadata.md +9 -0
  58. package/files/glossary/intelligence-proposal.md +9 -0
  59. package/files/glossary/mapping.md +9 -0
  60. package/files/glossary/memory.md +9 -0
  61. package/files/glossary/object-type.md +9 -0
  62. package/files/glossary/relationship-definition.md +9 -0
  63. package/files/glossary/relationship-reference.md +9 -0
  64. package/files/glossary/revision.md +9 -0
  65. package/files/glossary/scope.md +9 -0
  66. package/files/glossary/source.md +9 -0
  67. package/files/glossary/traversal.md +9 -0
  68. package/files/guides/apply-scope.md +40 -0
  69. package/files/guides/choose-access-method.md +24 -0
  70. package/files/guides/compose-subject-ui.md +24 -0
  71. package/files/guides/define-traverse-relationship.md +26 -0
  72. package/files/guides/diagnose-unresolved.md +24 -0
  73. package/files/guides/evidence-to-decision.md +25 -0
  74. package/files/guides/first-revision-safe-write.md +30 -0
  75. package/files/guides/inspect-effective-metadata.md +30 -0
  76. package/files/guides/query-people-abstract.md +25 -0
  77. package/files/guides/reload-retry-conflict.md +32 -0
  78. package/files/guides/validate-install-pack.md +32 -0
  79. package/files/indexes/books.json +95 -0
  80. package/files/indexes/books.md +17 -0
  81. package/files/indexes/concepts.json +119 -0
  82. package/files/indexes/concepts.md +21 -0
  83. package/files/indexes/diagrams.json +53 -0
  84. package/files/indexes/diagrams.md +10 -0
  85. package/files/indexes/guides.json +71 -0
  86. package/files/indexes/guides.md +13 -0
  87. package/files/indexes/scenarios.json +41 -0
  88. package/files/indexes/scenarios.md +8 -0
  89. package/files/indexes/tutorials.json +47 -0
  90. package/files/indexes/tutorials.md +9 -0
  91. package/files/indexes/use-cases.json +239 -0
  92. package/files/indexes/use-cases.md +41 -0
  93. package/files/knowledge.json +2940 -0
  94. package/files/packs/concept/abstracts-bindings/PACK.md +11 -0
  95. package/files/packs/concept/abstracts-bindings/pack.json +13 -0
  96. package/files/packs/concept/agents-inheritance/PACK.md +11 -0
  97. package/files/packs/concept/agents-inheritance/pack.json +13 -0
  98. package/files/packs/concept/analysis-objects/PACK.md +11 -0
  99. package/files/packs/concept/analysis-objects/pack.json +14 -0
  100. package/files/packs/concept/composition/PACK.md +11 -0
  101. package/files/packs/concept/composition/pack.json +13 -0
  102. package/files/packs/concept/decisions-content/PACK.md +11 -0
  103. package/files/packs/concept/decisions-content/pack.json +13 -0
  104. package/files/packs/concept/effective-metadata/PACK.md +11 -0
  105. package/files/packs/concept/effective-metadata/pack.json +13 -0
  106. package/files/packs/concept/explicit-metadata-installation/PACK.md +11 -0
  107. package/files/packs/concept/explicit-metadata-installation/pack.json +14 -0
  108. package/files/packs/concept/intelligence-proposals/PACK.md +11 -0
  109. package/files/packs/concept/intelligence-proposals/pack.json +13 -0
  110. package/files/packs/concept/mappings-transforms/PACK.md +11 -0
  111. package/files/packs/concept/mappings-transforms/pack.json +13 -0
  112. package/files/packs/concept/object-content-category/PACK.md +11 -0
  113. package/files/packs/concept/object-content-category/pack.json +14 -0
  114. package/files/packs/concept/org-agent-scope/PACK.md +11 -0
  115. package/files/packs/concept/org-agent-scope/pack.json +14 -0
  116. package/files/packs/concept/people-union/PACK.md +11 -0
  117. package/files/packs/concept/people-union/pack.json +13 -0
  118. package/files/packs/concept/raw-records/PACK.md +11 -0
  119. package/files/packs/concept/raw-records/pack.json +14 -0
  120. package/files/packs/concept/record-revisions/PACK.md +11 -0
  121. package/files/packs/concept/record-revisions/pack.json +13 -0
  122. package/files/packs/concept/relationship-definitions/PACK.md +11 -0
  123. package/files/packs/concept/relationship-definitions/pack.json +14 -0
  124. package/files/packs/concept/relationship-references/PACK.md +11 -0
  125. package/files/packs/concept/relationship-references/pack.json +13 -0
  126. package/files/packs/concept/resolved-unresolved/PACK.md +11 -0
  127. package/files/packs/concept/resolved-unresolved/pack.json +13 -0
  128. package/files/packs/concept/sources-and-memory/PACK.md +11 -0
  129. package/files/packs/concept/sources-and-memory/pack.json +13 -0
  130. package/files/packs/concept/traversal/PACK.md +11 -0
  131. package/files/packs/concept/traversal/pack.json +13 -0
  132. package/files/packs/guide/apply-scope/PACK.md +11 -0
  133. package/files/packs/guide/apply-scope/pack.json +13 -0
  134. package/files/packs/guide/choose-access-method/PACK.md +11 -0
  135. package/files/packs/guide/choose-access-method/pack.json +15 -0
  136. package/files/packs/guide/compose-subject-ui/PACK.md +11 -0
  137. package/files/packs/guide/compose-subject-ui/pack.json +13 -0
  138. package/files/packs/guide/define-traverse-relationship/PACK.md +11 -0
  139. package/files/packs/guide/define-traverse-relationship/pack.json +14 -0
  140. package/files/packs/guide/diagnose-unresolved/PACK.md +11 -0
  141. package/files/packs/guide/diagnose-unresolved/pack.json +13 -0
  142. package/files/packs/guide/evidence-to-decision/PACK.md +11 -0
  143. package/files/packs/guide/evidence-to-decision/pack.json +14 -0
  144. package/files/packs/guide/first-revision-safe-write/PACK.md +11 -0
  145. package/files/packs/guide/first-revision-safe-write/pack.json +13 -0
  146. package/files/packs/guide/inspect-effective-metadata/PACK.md +11 -0
  147. package/files/packs/guide/inspect-effective-metadata/pack.json +13 -0
  148. package/files/packs/guide/query-people-abstract/PACK.md +11 -0
  149. package/files/packs/guide/query-people-abstract/pack.json +13 -0
  150. package/files/packs/guide/reload-retry-conflict/PACK.md +11 -0
  151. package/files/packs/guide/reload-retry-conflict/pack.json +13 -0
  152. package/files/packs/guide/validate-install-pack/PACK.md +11 -0
  153. package/files/packs/guide/validate-install-pack/pack.json +13 -0
  154. package/files/packs/scenario/choose-subject-view/PACK.md +11 -0
  155. package/files/packs/scenario/choose-subject-view/pack.json +11 -0
  156. package/files/packs/scenario/pack-valid-not-installed/PACK.md +11 -0
  157. package/files/packs/scenario/pack-valid-not-installed/pack.json +11 -0
  158. package/files/packs/scenario/scope-mismatch/PACK.md +11 -0
  159. package/files/packs/scenario/scope-mismatch/pack.json +11 -0
  160. package/files/packs/scenario/stale-revision-conflict/PACK.md +11 -0
  161. package/files/packs/scenario/stale-revision-conflict/pack.json +11 -0
  162. package/files/packs/scenario/traversal-direction/PACK.md +11 -0
  163. package/files/packs/scenario/traversal-direction/pack.json +11 -0
  164. package/files/packs/scenario/unresolved-relationship/PACK.md +11 -0
  165. package/files/packs/scenario/unresolved-relationship/pack.json +11 -0
  166. package/files/packs/tutorial/analysis-decision-lab/PACK.md +11 -0
  167. package/files/packs/tutorial/analysis-decision-lab/pack.json +14 -0
  168. package/files/packs/tutorial/compare-views/PACK.md +11 -0
  169. package/files/packs/tutorial/compare-views/pack.json +14 -0
  170. package/files/packs/tutorial/conflict-lab/PACK.md +11 -0
  171. package/files/packs/tutorial/conflict-lab/pack.json +13 -0
  172. package/files/packs/tutorial/first-revision-safe-record/PACK.md +11 -0
  173. package/files/packs/tutorial/first-revision-safe-record/pack.json +13 -0
  174. package/files/packs/tutorial/install-pack-lab/PACK.md +11 -0
  175. package/files/packs/tutorial/install-pack-lab/pack.json +13 -0
  176. package/files/packs/tutorial/relationships-lab/PACK.md +11 -0
  177. package/files/packs/tutorial/relationships-lab/pack.json +13 -0
  178. package/files/packs/tutorial/start-with-sample-data/PACK.md +11 -0
  179. package/files/packs/tutorial/start-with-sample-data/pack.json +13 -0
  180. package/files/sample-data/memorix-synthetic-basic.md +13 -0
  181. package/files/scenarios/choose-subject-view.md +36 -0
  182. package/files/scenarios/pack-valid-not-installed.md +33 -0
  183. package/files/scenarios/scope-mismatch.md +44 -0
  184. package/files/scenarios/stale-revision-conflict.md +38 -0
  185. package/files/scenarios/traversal-direction.md +30 -0
  186. package/files/scenarios/unresolved-relationship.md +31 -0
  187. package/files/tutorials/analysis-decision-lab.md +18 -0
  188. package/files/tutorials/compare-views.md +22 -0
  189. package/files/tutorials/conflict-lab.md +18 -0
  190. package/files/tutorials/first-revision-safe-record.md +18 -0
  191. package/files/tutorials/install-pack-lab.md +22 -0
  192. package/files/tutorials/relationships-lab.md +18 -0
  193. package/files/tutorials/start-with-sample-data.md +18 -0
  194. package/files/ui/clients/memorix-studio.md +9 -0
  195. package/files/use-cases/abstract-people-list.md +237 -0
  196. package/files/use-cases/ai-pipeline-fail-closed.md +117 -0
  197. package/files/use-cases/author-pipeline-e2e.md +339 -0
  198. package/files/use-cases/build-callable-service.md +347 -0
  199. package/files/use-cases/builder-acceptance-ops.md +112 -0
  200. package/files/use-cases/choose-access-method.md +111 -0
  201. package/files/use-cases/client-first-read-write.md +374 -0
  202. package/files/use-cases/compose-for-ui.md +97 -0
  203. package/files/use-cases/custom-kind-descriptors.md +137 -0
  204. package/files/use-cases/data-journey-evidence.md +115 -0
  205. package/files/use-cases/discriminated-content-writes.md +152 -0
  206. package/files/use-cases/embed-studio-host.md +165 -0
  207. package/files/use-cases/four-field-links.md +246 -0
  208. package/files/use-cases/http-process-compliance.md +225 -0
  209. package/files/use-cases/install-metadata-pack.md +180 -0
  210. package/files/use-cases/intelligence-propose-install.md +163 -0
  211. package/files/use-cases/knowx-claims-review.md +396 -0
  212. package/files/use-cases/learn-record-envelope.md +233 -0
  213. package/files/use-cases/lists-cursors-pagination.md +196 -0
  214. package/files/use-cases/local-acceptance-g12ops.md +160 -0
  215. package/files/use-cases/memory-hourly-ingest.md +276 -0
  216. package/files/use-cases/metadata-before-write.md +145 -0
  217. package/files/use-cases/migrate-associated-star.md +159 -0
  218. package/files/use-cases/openapi-typed-client.md +78 -0
  219. package/files/use-cases/ops-pack-fixtures.md +168 -0
  220. package/files/use-cases/orient-platform.md +172 -0
  221. package/files/use-cases/pipeline-retry-evidence.md +121 -0
  222. package/files/use-cases/relationship-rebuild-verify.md +128 -0
  223. package/files/use-cases/revision-stale-conflicts.md +194 -0
  224. package/files/use-cases/start-from-zero.md +171 -0
  225. package/files/use-cases/studio-design-types.md +122 -0
  226. package/files/use-cases/studio-explore-subject.md +89 -0
  227. package/files/use-cases/studio-operate-pipelines.md +100 -0
  228. package/files/use-cases/studio-review-intelligence.md +74 -0
  229. package/files/use-cases/studio-scope-isolation.md +67 -0
  230. package/files/use-cases/studio-stale-conflict-ui.md +54 -0
  231. package/files/use-cases/troubleshoot-http-matrix.md +164 -0
  232. package/files/use-cases/trusted-in-process-embed.md +94 -0
  233. package/files/use-cases/workflow-sibling-api.md +212 -0
  234. package/files/visuals/revision-conflict.md +19 -0
  235. package/files/visuals/scope-apply.md +19 -0
  236. package/package.json +4 -3
@@ -0,0 +1,194 @@
1
+ # Handle revision / stale conflicts
2
+
3
+ > **Use case id:** `revision-stale-conflicts`
4
+ > **Goal:** Patch with revision preconditions and recover when another writer won.
5
+ > **Audiences:** developers
6
+ > **Tags:** revisions, conflicts, http
7
+
8
+ ## Reading path
9
+
10
+ 1. **Runtime Data Client** (developers) → chapters: `10-patch-language`, `18-error-catalog-client-facing`
11
+ 1. **Migration & Troubleshooting** (developers) → chapters: `4-failure-matrix-runtime-http`
12
+
13
+ ## From: Runtime Data Client — 10. Patch language
14
+
15
+ Patches are structured operations with path rules — not free-form JSON Merge Patch against the whole envelope unless the contract says so.
16
+
17
+ ### Typical operations
18
+
19
+ | Op | Use |
20
+ |---|---|
21
+ | `set` | Set a value at an allowed path |
22
+ | `unset` / remove | Clear an allowed path where supported |
23
+
24
+ ### Path rules (client view)
25
+
26
+ - Prefer paths under `data`, and allowed `concept` / `_system` subsets per contract.
27
+ - Envelope fields (`format`, `recordId`, `objectType`, `contentType`, …) are immutable via patch.
28
+ - Discriminator values are immutable via patch/replace.
29
+ - Lifecycle modifications follow metadata rules — illegal transitions fail.
30
+ - Concept / data / system ownership is contract-defined; do not invent cross-bucket ownership.
31
+ - Conflicting ops in one request fail validation.
32
+ - Invalid or unsafe paths fail before mutation.
33
+ - Validation runs **after** patch application against V2 + profiles.
34
+
35
+ ### Valid vs invalid (illustrative)
36
+
37
+ **Valid**
38
+
39
+ - Set `data.priority` on WI-100 snapshot.
40
+ - Unset an optional `data` field allowed by schema.
41
+ - Set `concept.title` when the profile allows title edits.
42
+
43
+ **Invalid**
44
+
45
+ - Set `revision` or `format`.
46
+ - Set discriminator in place.
47
+ - Set root `associatedEmployees` or any `associated*`.
48
+ - Patch Mongo `_id`.
49
+ - Invent `/../../` or injection-shaped paths.
50
+ - Conflicting `set` + `unset` on the same path in one request.
51
+
52
+ ### After patch
53
+
54
+ Re-read if your client needs the server-normalized record (defaults, timestamps, omitted empty buckets). Do not assume the patch document equals the stored document byte-for-byte.
55
+
56
+ ---
57
+
58
+ ## From: Runtime Data Client — 18. Error catalog (client-facing)
59
+
60
+ For each error, clients should know: code, HTTP status, whether retryable, whether to refetch, whether the same body may be repeated.
61
+
62
+ | Situation | Typical status / code class | Client action |
63
+ |---|---|---|
64
+ | Invalid scope / singular `agentId` | `400` | Fix headers; do not retry unchanged |
65
+ | Unknown object/content type | `400` / validation | Rediscover metadata |
66
+ | Missing content | `404` / `READ_NOT_FOUND` | Create with `absent` or show empty UI |
67
+ | Directory identity conflict | conflict / validation | Stop — `recordId` already bound differently |
68
+ | Missing discriminator | validation | Supply required discriminator |
69
+ | Immutable discriminator | validation | Remove then add; do not patch |
70
+ | Duplicate add | conflict | Read existing content |
71
+ | Stale revision | `409` | Refetch, reconcile, retry with new revision |
72
+ | Absent-precondition conflict | conflict | Content already exists — switch to revision write |
73
+ | Immutable envelope | validation | Remove illegal paths from patch |
74
+ | Invalid lifecycle | validation | Follow allowed transitions |
75
+ | Validation failure | `400` | Fix body against schema/profile |
76
+ | Unsafe query / injection-shaped filter | `400` | Rewrite with allowlisted grammar |
77
+ | Cursor mismatch | `400` | Restart list from page 1 |
78
+ | Unsupported abstract pushdown | `400` | Narrow query or query concrete types |
79
+ | Abstract non-reversible / non-member | `400` | Fix abstract write inputs |
80
+ | Relationship query unbounded | `400` | Add bounds / change traversal |
81
+ | Unresolved target | readable state | Show gap; optional later retry |
82
+ | Missing canonical runtime port | platform | Misconfig — not a client retry loop |
83
+ | Artifact not found / wrong org | `404` | Fix org or artifact id |
84
+ | Pipeline partial failure | run status | Retry failed step/run op |
85
+ | Malformed Memory item | quarantine | Inspect quarantine; fix source mapping |
86
+ | Durable route `503` in `dev` without Mongo | `503` | Use `prod` + `MONGO_URI` or accept in-memory limits |
87
+
88
+ Studio and HTTP both surface these classes; decode the structured error body when present.
89
+
90
+ ### Example — stale write
91
+
92
+ ```text
93
+ PATCH wi-100 snapshots expectedRevision=3
94
+ → 409 WRITE_STALE_REVISION (current is 4)
95
+ → GET again → merge → PATCH expectedRevision=4
96
+ ```
97
+
98
+ ---
99
+
100
+ ## From: Migration & Troubleshooting — 4. Failure matrix (runtime HTTP)
101
+
102
+ Use this as the first lookup when demos break.
103
+
104
+ ### 409 — stale revision / conflict
105
+
106
+ | Likely cause | Fix |
107
+ |---|---|
108
+ | Concurrent edit; wrong `expectedRevision` | Re-GET content; merge; retry with current revision |
109
+ | Workflow PUT with stale revision | Same — Studio shows stale conflict UI |
110
+
111
+ ```bash
112
+ # pattern
113
+ curl -s "${H[@]}" "$SERVICE/api/data/content?objectType=work-items&contentType=workflow&id=wi-100"
114
+ # note revision → PUT /api/workflow with expectedRevision
115
+ ```
116
+
117
+ ### 405 — relationship link mutation
118
+
119
+ | Likely cause | Fix |
120
+ |---|---|
121
+ | Ad-hoc PUT/DELETE on links | Use `/api/relationships` verify / rebuild / discover |
122
+ | Host treating links like ordinary documents | Relationship engine only |
123
+
124
+ ### 503 — durable routes unavailable
125
+
126
+ | Likely cause | Fix |
127
+ |---|---|
128
+ | Prod/durable mode without Mongo | Set `MEMORIX_SERVICE_MODE=prod` + `MONGO_URI` |
129
+ | Service down | Check `/health`; restart `dev-stack` |
130
+ | Port already in use / AirPlay conflict | Avoid **5000/7000**; stay in zone **5100–5119**; see `@x12i/ports-manager` `port-map.json` avoid list (`npx x12i-ports avoid`) |
131
+
132
+ ### Unresolved relationships
133
+
134
+ | Likely cause | Fix |
135
+ |---|---|
136
+ | Target subject/content missing | Write targets first; or rebuild definition after targets exist |
137
+ | Wrong definition / candidate set | Discover/rebuild for the definition id |
138
+ | Expansion shows `targetStatus: "unresolved"` | **Expected** calculated signal — do not invent fake targets |
139
+
140
+ ### Abstract write error
141
+
142
+ | Likely cause | Fix |
143
+ |---|---|
144
+ | Treating abstract type as a write collection | Write concrete object types |
145
+ | Non-reversible abstract property | Adjust bindings / use concrete path |
146
+ | Multi-target ambiguity | Disambiguate concrete type / id |
147
+
148
+ ### Intelligence “did nothing”
149
+
150
+ | Likely cause | Fix |
151
+ |---|---|
152
+ | Expecting auto-install | Explicit `/api/metadata/install` or Studio install |
153
+ | Insufficient evidence | Gather fixtures; do not force install |
154
+ | Wrong org/agent | Fresh `g12ops*` + `ops` |
155
+
156
+ ### Discriminator failures
157
+
158
+ | Likely cause | Fix |
159
+ |---|---|
160
+ | Missing `data.analysisType` (etc.) when required | Supply value or profile default |
161
+ | Changing immutable discriminator in place | remove old instance + add new |
162
+
163
+ ### Scope / headers
164
+
165
+ | Symptom | Fix |
166
+ |---|---|
167
+ | 400 on `agentId` | Use plural `x-memorix-agent-ids` |
168
+ | Empty / wrong types | Install pack; fix agent set |
169
+ | Wrong tenant data | Fix `x-memorix-org-id` |
170
+
171
+ ### Memory / pipelines
172
+
173
+ | Symptom | Fix |
174
+ |---|---|
175
+ | Secret rejected | Pass `credentialRef` only |
176
+ | Raw present, no snapshots | Check pipeline runs & artifacts |
177
+ | Quarantine growing | Inspect mapping / provider shape |
178
+
179
+ ### Stack / networking
180
+
181
+ | Symptom | Fix |
182
+ |---|---|
183
+ | Studio loads, API fails | Service `:5100/health`; proxy target |
184
+ | Port in use | Change `MEMORIX_*_PORT` (even=API, odd=UI) |
185
+
186
+ ---
187
+
188
+ ## Also see
189
+
190
+ - **Format for Dummies** (`01-format-for-dummies`) — Mental model of the record envelope — OT/CT, composition, discriminators, and what is not stored on the record.
191
+
192
+ ---
193
+
194
+ _Generated use-case pack for agents and humans. See `agent-manifest.json` for discovery._
@@ -0,0 +1,171 @@
1
+ # Start Memorix from zero
2
+
3
+ > **Use case id:** `start-from-zero`
4
+ > **Goal:** Install docs for your agents, set scope, run the stack, and walk the tutorials to the core loop.
5
+ > **Audiences:** developers, builders
6
+ > **Tags:** getting-started, tutorials, start-here
7
+
8
+ ## Reading path
9
+
10
+ 1. **Getting Started & Tutorials** (developers) → chapters: `1-installation-for-agents`, `2-getting-started`, `4-tutorial-run-the-local-stack`, `5-tutorial-first-read-and-write`
11
+ 1. **Getting Started & Tutorials** (builders) → chapters: `2-getting-started`, `4-tutorial-run-the-local-stack`, `7-tutorial-memory-to-pipeline`
12
+
13
+ ## From: Getting Started & Tutorials — 1. Installation for agents
14
+
15
+ Give your AI tooling the Memorix docs as a package before anything else:
16
+
17
+ ```bash
18
+ npm i -D @x12i/memorix-docs
19
+ ```
20
+
21
+ ### Why install it
22
+
23
+ - **Versioned product truth for agents.** Cursor / Codex / CI agents get a pinned, upgradable knowledge surface — no stale prompts, no scraped HTML.
24
+ - **Structured Markdown.** Per-book MD, chapter indexes, use-case packs, and `agent-manifest.json` ship inside the package.
25
+ - **Typed discovery.** `listUseCases`, `getBookMarkdown`, `getUseCaseMarkdown` answer “which book / chapter?” without hallucinated paths.
26
+ - **Knowledge out of prompts.** Product rules (four-field relationships, explicit installs, V2 envelope) live in a dependency you update deliberately.
27
+
28
+ ### The devDependency rule
29
+
30
+ `@x12i/memorix-docs` documents the product for tools. It is **never** a production runtime dependency:
31
+
32
+ - Do: `devDependencies`, pin or caret the version, point agent rules/skills at the package.
33
+ - Do not: add to `dependencies`, import from shipped product code, or fork the content.
34
+
35
+ Humans do not need the package — this website is the human surface.
36
+
37
+ ---
38
+
39
+ ## From: Getting Started & Tutorials — 2. Getting started
40
+
41
+ Scope first, always:
42
+
43
+ ```http
44
+ x-memorix-org-id: g12ops<suffix>
45
+ x-memorix-agent-ids: ops
46
+ ```
47
+
48
+ Fresh `g12ops*` orgs only — never live customer orgs. Singular `agentId` headers are rejected.
49
+
50
+ The working loop:
51
+
52
+ 1. **Run the local stack** (chapter 4) — ops-source + memorix-service + Studio.
53
+ 2. **Install ops metadata** into your fresh org — `@x12i/memorix-ops-pack` provides agent `ops`, object types, abstracts, relationships, mappings, pipelines, sources, and services in one explicit install.
54
+ 3. **Read and write** through `/api/data` only (chapter 5) — no direct Mongo, ever.
55
+ 4. **Promote raw via pipelines** (chapter 7) and **materialize links** (chapter 8).
56
+
57
+ Subjects you will meet everywhere: employee **Alex**, work item **WI-100**, procedure **PROC-2**.
58
+
59
+ ---
60
+
61
+ ## From: Getting Started & Tutorials — 4. Tutorial — run the local stack
62
+
63
+ Goal: ops-source + memorix-service + Studio on default ports.
64
+
65
+ ```bash
66
+ # from monorepo root
67
+ node scripts/dev-stack.mjs
68
+ ```
69
+
70
+ Open:
71
+
72
+ - Studio: `http://127.0.0.1:5101/`
73
+ - Stack status: `http://127.0.0.1:5103/`
74
+ - OpenAPI: `http://127.0.0.1:5100/api/openapi.json`
75
+ - Health: `http://127.0.0.1:5100/health` · `http://127.0.0.1:5102/health`
76
+
77
+ Variants: `--list` prints URLs without starting; `--dev` runs the service in dev mode. Prod mode needs `MONGO_URI`. Ctrl+C stops the stack.
78
+
79
+ Check:
80
+
81
+ ```bash
82
+ curl -sS http://127.0.0.1:5100/health
83
+ curl -sS http://127.0.0.1:5102/health
84
+ curl -sS http://127.0.0.1:5103/api/status
85
+ ```
86
+
87
+ ---
88
+
89
+ ## From: Getting Started & Tutorials — 5. Tutorial — first read and write
90
+
91
+ Goal: call `/api/data` with correct scope; understand revision preconditions.
92
+
93
+ Prerequisite: stack running, ops metadata installed for your `g12ops*` org.
94
+
95
+ Scope every call:
96
+
97
+ ```bash
98
+ ORG=g12ops<suffix>
99
+ AGENTS=ops
100
+
101
+ curl -sS \
102
+ -H "x-memorix-org-id: $ORG" \
103
+ -H "x-memorix-agent-ids: $AGENTS" \
104
+ http://127.0.0.1:5100/api/openapi.json | head
105
+ ```
106
+
107
+ Read metadata first — resolve effective object/content types and views so you know legal addresses (paths under `/api/metadata`, see OpenAPI).
108
+
109
+ Write then read:
110
+
111
+ 1. Create with revision precondition `absent`; update with the exact `revision`.
112
+ 2. Get / list / compose the same `recordId`.
113
+ 3. On a stale conflict: re-read, re-apply intent, retry.
114
+
115
+ Do not: omit scope headers, write with the Mongo driver, or invent list columns in your host — drive UI from metadata views.
116
+
117
+ ---
118
+
119
+ ## From: Getting Started & Tutorials — 2. Getting started
120
+
121
+ Scope bar first, always:
122
+
123
+ 1. Choose a **fresh** `g12ops*` organization — never a live customer org.
124
+ 2. Set agent to **`ops`**.
125
+ 3. Confirm Design / Operate / Explore show that same scope.
126
+
127
+ Then the working loop:
128
+
129
+ 1. **Run the local stack** (chapter 4) — or ask engineering for a running Studio.
130
+ 2. **Design** — confirm ops metadata is installed (explicit install; nothing auto-installs).
131
+ 3. **Operate** — Memory pull, then the promotion pipeline.
132
+ 4. **Explore** — confirm composition and links for **WI-100**, **Alex**, **PROC-2**.
133
+
134
+ If screens look empty or show wrong types: fix scope and metadata install before filing a bug.
135
+
136
+ ---
137
+
138
+ ## From: Getting Started & Tutorials — 4. Tutorial — run the local stack
139
+
140
+ Goal: a running Studio against the local ops fixture stack.
141
+
142
+ 1. From the monorepo root: `node scripts/dev-stack.mjs` (or ask engineering).
143
+ 2. Open Studio at `http://127.0.0.1:5101/`.
144
+ 3. Check stack status at `http://127.0.0.1:5103/` — all services healthy.
145
+ 4. Set the scope bar: fresh `g12ops*` + agent `ops`.
146
+
147
+ Ctrl+C stops the stack. Never point drills at live customer orgs.
148
+
149
+ ---
150
+
151
+ ## From: Getting Started & Tutorials — 7. Tutorial — memory to pipeline
152
+
153
+ Goal: land exact source material, then promote it — the acceptance path.
154
+
155
+ 1. **Operate → Memory** — pull from ops-source; confirm **PROC-2** raw landed (`credentialRef` only).
156
+ 2. **Operate → Runs** — start the promotion pipeline; watch runs / attempts.
157
+ 3. If a step fails: open the **artifact**, fix metadata/mapping/service, retry from Operate — once, intentionally.
158
+ 4. **Explore** — open **WI-100**; confirm snapshot / workflow siblings appeared as designed.
159
+
160
+ Raw sitting in Memory is not a bug — promotion is always an explicit pipeline path.
161
+
162
+ ---
163
+
164
+ ## Also see
165
+
166
+ - **Platform Overview** (`00-platform-overview`) — Surfaces, packages, hard rules, and where to start — developers and builders twins.
167
+ - **Agent Packs & Ops** (`11-agent-packs-and-ops`) — Pack layout, harness, g12ops* acceptance, custom kinds, golden V2 validation.
168
+
169
+ ---
170
+
171
+ _Generated use-case pack for agents and humans. See `agent-manifest.json` for discovery._
@@ -0,0 +1,122 @@
1
+ # Design object and content types in Studio
2
+
3
+ > **Use case id:** `studio-design-types`
4
+ > **Goal:** Change product shape in Design without shipping engine code.
5
+ > **Audiences:** builders
6
+ > **Tags:** studio, design, metadata
7
+
8
+ ## Reading path
9
+
10
+ 1. **Workflow & Studio** (builders) → chapters: `1-scope-bar-first-always`, `2-design`
11
+ 1. **Metadata, Agents, Abstracts & Mappings** (builders) → chapters: `2-design-screens-you-will-use`, `3-builder-workflow-ops`
12
+
13
+ ## From: Workflow & Studio — 1. Scope bar first (always)
14
+
15
+ ![Isolated workspace scope](../screenshots/01-isolated-workspace-scope.png)
16
+
17
+ Before any meaningful work:
18
+
19
+ 1. Choose a **fresh** `g12ops*` organization (never a live customer org).
20
+ 2. Set agent to **`ops`** (or the agent set your pack documents).
21
+ 3. Confirm Design / Operate / Explore reflect that scope.
22
+ 4. If screens look empty or “wrong types,” fix scope and metadata install before filing a bug.
23
+
24
+ Forbidden for acceptance drills: legacy/live customer org names. Always `g12ops*` + `ops`.
25
+
26
+ ---
27
+
28
+ ## From: Workflow & Studio — 2. Design
29
+
30
+ Author and govern what the platform *can* run:
31
+
32
+ | Screen family | You do this |
33
+ |---|---|
34
+ | Agents | Inheritance and which vocabulary is in scope |
35
+ | Sources | Where Memory pulls from (e.g. ops-source) |
36
+ | Object / content types | What subjects exist and what content they may wear |
37
+ | Abstracts | Virtual unions (e.g. People) — not separate databases |
38
+ | Relationships | Definitions for navigation links |
39
+ | Mappings / views | Deterministic transforms and list shapes |
40
+ | Services / pipelines / schedules | Capabilities and ordered runs |
41
+ | Intelligence proposals | Review suggested metadata — **never** auto-live |
42
+ | Install / publish | Explicitly make a pack version effective |
43
+
44
+ Operator rule: proposals are suggestions. You **install** deliberately (see Intelligence builders book).
45
+
46
+ ---
47
+
48
+ ## From: Metadata, Agents, Abstracts & Mappings — 2. Design screens you will use
49
+
50
+ ### Agents and inheritance
51
+
52
+ ![Agents inheritance](../screenshots/02-agents-inheritance.png)
53
+
54
+ Agents are named vocabularies, not chatbots. Child agents inherit from parents and can override. What your scope actually uses is the **effective** set after inheritance — not a single file you edit blindly.
55
+
56
+ For acceptance drills, stay on parent **`ops`**.
57
+
58
+ ### Object and content types
59
+
60
+ ![Object & content types](../screenshots/04-object-content-types.png)
61
+
62
+ Object types are concrete subjects (`employees`, `work-items`, `procedures`, …). Content types are kinds of information about them (`raw`, `snapshots`, `workflow`, …).
63
+
64
+ Same subject keeps the same id. Different content kinds become siblings (composition). You do not flatten everything into one blob.
65
+
66
+ ### Abstracts and bindings
67
+
68
+ ![Abstracts & bindings](../screenshots/05-abstracts-bindings.png)
69
+
70
+ An abstract such as **People** is a virtual union of employees and contractors. There is no separate “people database” and no abstract subject id you can invent.
71
+
72
+ Bindings say which concrete types participate and how abstract fields map onto concrete snapshot fields.
73
+
74
+ ### People union in Explore
75
+
76
+ ![People union](../screenshots/11-people-union.png)
77
+
78
+ After metadata is installed and subject content exists, Explore can list **People** as one unified view. Writers still always target a concrete type (or an abstract patch that reverse-maps to one concrete writer).
79
+
80
+ ### Explicit install
81
+
82
+ ![Explicit metadata installation](../screenshots/19-explicit-metadata-installation.png)
83
+
84
+ Intelligence may **propose** metadata. Proposals are not live until you **install / publish** deliberately. Never expect auto-install.
85
+
86
+ ---
87
+
88
+ ## From: Metadata, Agents, Abstracts & Mappings — 3. Builder workflow (ops)
89
+
90
+ Use this sequence every time you change vocabulary:
91
+
92
+ 1. **Choose agent scope** — `ops` on a fresh `g12ops*` org.
93
+ 2. **Define or confirm object/content types** — employees, contractors, work-items, procedures, activity-events.
94
+ 3. **Bind abstracts** — People = employees ∪ contractors; remember: virtual only.
95
+ 4. **Author mappings** where transforms are deterministic (source fields → raw/snapshot paths, abstract property maps).
96
+ 5. **Validate**, then **install / publish** deliberately.
97
+ 6. **Prove in Explore** — People list, Alex, WI-100 composition — before you run Memory or pipelines for real work.
98
+
99
+ ```text
100
+ Design vocabulary
101
+ → validate
102
+ → explicit install
103
+ → Explore proves types/abstracts
104
+ → Operate runs Memory / pipelines / relationships
105
+ ```
106
+
107
+ ### Tips while authoring
108
+
109
+ - Prefer clear titles and identifiers over clever nested payloads.
110
+ - Keep cyber/vendor vocabulary out of the permanent ops narrative.
111
+ - If a proposal looks wrong, **reject it** — do not install “to see what happens” on a shared org.
112
+ - Treat abstract names as views, not storage.
113
+
114
+ ---
115
+
116
+ ## Also see
117
+
118
+ - **Format for Dummies** (`01-format-for-dummies`) — Mental model of the record envelope — OT/CT, composition, discriminators, and what is not stored on the record.
119
+
120
+ ---
121
+
122
+ _Generated use-case pack for agents and humans. See `agent-manifest.json` for discovery._
@@ -0,0 +1,89 @@
1
+ # Explore a composed subject in Studio
2
+
3
+ > **Use case id:** `studio-explore-subject`
4
+ > **Goal:** Read composition vs relationships visually in Explore.
5
+ > **Audiences:** builders
6
+ > **Tags:** studio, explore
7
+
8
+ ## Reading path
9
+
10
+ 1. **Workflow & Studio** (builders) → chapters: `4-explore`
11
+ 1. **Format for Dummies** (builders) → chapters: `1-what-you-see-in-explore`, `2-composition-vs-relationship`
12
+
13
+ ## From: Workflow & Studio — 4. Explore
14
+
15
+ ![Composed subject](../screenshots/10-composed-subject.png)
16
+
17
+ Explore is where you inspect **truth about subjects**:
18
+
19
+ - Concrete records (employees, work-items, procedures, …)
20
+ - Abstract unions (People, …)
21
+ - **Composition** — siblings on the same id (snapshot + workflow + analysis, …)
22
+ - **Relationships** — four-field links between different ids (expansion shows current targets)
23
+ - Workflow / analysis / decisions editors
24
+
25
+ ![Workflow edit](../screenshots/16-workflow-edit.png)
26
+
27
+ ### Composition vs relationship (builder wording)
28
+
29
+ ```text
30
+ Same subject id → composition (siblings on one page)
31
+ Different subject ids → relationship (link + expansion)
32
+ ```
33
+
34
+ You should never see a pasted “associated employee payload” block inside a work-item snapshot. If you do, that content is wrong — escalate with a screenshot.
35
+
36
+ ---
37
+
38
+ ## From: Format for Dummies — 1. What you see in Explore
39
+
40
+ ### A single content document
41
+
42
+ ![Raw record](../screenshots/09-raw-record.png)
43
+
44
+ One content document about one subject — for example a work-item snapshot. You can open technical details for JSON, but ordinary review should stay on forms and status.
45
+
46
+ ### Composition (siblings)
47
+
48
+ ![Composed subject](../screenshots/10-composed-subject.png)
49
+
50
+ Ask Explore for “everything about WI-100” and Studio shows **siblings** — snapshot, workflow, analyses — without flattening them into one blob. Same subject id; different content types.
51
+
52
+ ### Discriminators (many instances)
53
+
54
+ ![Discriminators](../screenshots/12-analysis-decision-discriminators.png)
55
+
56
+ Some content types allow **many instances** on the same subject (for example several analyses or decisions). A **discriminator** labels which instance you are looking at so saves do not overwrite the wrong sibling.
57
+
58
+ | Idea | Builder meaning |
59
+ |---|---|
60
+ | One snapshot | Usually one current business picture |
61
+ | Many analyses | Each needs a clear label (discriminator) |
62
+ | Workflow | Process / assignment state — ordinary sibling, not a separate product |
63
+
64
+ ---
65
+
66
+ ## From: Format for Dummies — 2. Composition vs relationship
67
+
68
+ ```text
69
+ Same recordId → composition (siblings on one Explore page)
70
+ Different recordIds → relationship (link + expansion)
71
+ ```
72
+
73
+ | Composition | Relationship |
74
+ |---|---|
75
+ | Snapshot + workflow on WI-100 | Alex **assigned to** WI-100 |
76
+ | Same subject id | Two subject ids |
77
+ | Siblings listed together | Four-field link; expansion shows current targets |
78
+
79
+ Relationships remember *who links to whom* and *why*. They do **not** paste the other record’s fields into this one. If you see a nested “associated employee payload” inside a work-item snapshot, that content is wrong — screenshot and escalate.
80
+
81
+ ---
82
+
83
+ ## Also see
84
+
85
+ - **Relationships & Memory** (`06-relationships-and-memory`) — Exact Memory ingest and relationship engine links — never associated* payloads on records.
86
+
87
+ ---
88
+
89
+ _Generated use-case pack for agents and humans. See `agent-manifest.json` for discovery._
@@ -0,0 +1,100 @@
1
+ # Operate pipelines in Studio
2
+
3
+ > **Use case id:** `studio-operate-pipelines`
4
+ > **Goal:** Run, retry, and inspect pipeline health from Operate.
5
+ > **Audiences:** builders
6
+ > **Tags:** studio, pipelines, operate
7
+
8
+ ## Reading path
9
+
10
+ 1. **Workflow & Studio** (builders) → chapters: `3-operate`
11
+ 1. **Building Pipelines** (builders) → chapters: `4-runs-attempts-and-artifacts`, `6-retry-etiquette`, `9-operate-checklist`
12
+
13
+ ## From: Workflow & Studio — 3. Operate
14
+
15
+ Watch and recover work in flight:
16
+
17
+ | Need | Go to |
18
+ |---|---|
19
+ | Pipeline / schedule activity | Runs / Attempts / Schedules |
20
+ | Why something failed | Failures + Artifacts |
21
+ | Source landing | Memory |
22
+ | Link health | Relationship verify / rebuild |
23
+ | Intelligence profiling runs | Intelligence runs (still does **not** install) |
24
+
25
+ Operate is where you prove the path:
26
+
27
+ ```text
28
+ ops-source → Memory (exact raw) → Pipeline → subjects + links → Explore
29
+ ```
30
+
31
+ Do not “fix” a failed step by hand-editing storage. Fix metadata/mapping/service, then retry from Operate.
32
+
33
+ ---
34
+
35
+ ## From: Building Pipelines — 4. Runs, attempts, and artifacts
36
+
37
+ | Word | Meaning |
38
+ |---|---|
39
+ | **Run** | One execution of a pipeline |
40
+ | **Step** | One box in the design |
41
+ | **Attempt** | One try of a step (retries add attempts) |
42
+ | **Artifact** | Stored proof of large input/output or captured context |
43
+
44
+ Operate shows status: pending, running, succeeded, failed, partial, cancelled.
45
+
46
+ **Partial** means some items or branches succeeded — retry only what failed. Do not assume the whole world rolled back.
47
+
48
+ **Captured context** freezes the exact revisions a step saw. If someone edits WI-100 in Explore later, a retry still uses the captured artifact unless you intentionally start a new run.
49
+
50
+ ---
51
+
52
+ ## From: Building Pipelines — 6. Retry etiquette
53
+
54
+ 1. Read the failure code and artifact context in Operate.
55
+ 2. Fix metadata, mapping, service binding, or source issue.
56
+ 3. Retry from Operate (failed step or failed batch items).
57
+ 4. Confirm input revisions in artifacts after success.
58
+ 5. Open Explore — **WI-100**, **Alex**, **PROC-2** — and confirm composition + links.
59
+
60
+ If the runtime restarted mid-run, resume should **not** redo completed steps. If it does, escalate — that is a platform defect, not something to “fix” by re-scheduling.
61
+
62
+ ### Partial success in plain words
63
+
64
+ Example: snapshot write for WI-100 succeeded, relationship write failed. Retry the relationship step only. Do not re-pull the whole world unless Memory itself failed.
65
+
66
+ ---
67
+
68
+ ## From: Building Pipelines — 9. Operate checklist
69
+
70
+ - [ ] Scope: fresh `g12ops*` + `ops`
71
+ - [ ] Pipeline definition valid in Design
72
+ - [ ] Services/mappings referenced by steps exist for this agent
73
+ - [ ] Schedule enabled only when intended; overlapping runs understood
74
+ - [ ] Failures show attempts + artifacts
75
+ - [ ] Retries intentional
76
+ - [ ] Explore confirms subjects and links after success
77
+ - [ ] No secrets visible in artifacts or records
78
+ - [ ] Intelligence proposals reviewed — never assumed installed
79
+
80
+ ### Quick diagnose
81
+
82
+ | Symptom | Likely cause |
83
+ |---|---|
84
+ | Fails before any step | Invalid definition, missing binding, or missing durable store in prod |
85
+ | Map step fails | Mapping/schema mismatch on raw |
86
+ | Write fails “stale” | Subject edited since capture — re-read or new run |
87
+ | Green run, empty Explore | Missing write step or wrong object/content type |
88
+ | Links missing | Discover without write, or verify/rebuild not run |
89
+ | AI step flaky | Expect recorded adapter for acceptance; check validation artifacts |
90
+ | Duplicate external ticket | Action step missing/broken idempotency — escalate |
91
+
92
+ ---
93
+
94
+ ## Also see
95
+
96
+ - **Building Services** (`07-services`) — When to build a service, handlers, pipeline invoke, and core-service / ports-manager / api-live-view.
97
+
98
+ ---
99
+
100
+ _Generated use-case pack for agents and humans. See `agent-manifest.json` for discovery._