@x12i/memorix-docs 1.0.2 → 1.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 (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,74 @@
1
+ # Review intelligence proposals in Studio
2
+
3
+ > **Use case id:** `studio-review-intelligence`
4
+ > **Goal:** Accept evidence, reject bad proposals, install only deliberately.
5
+ > **Audiences:** builders
6
+ > **Tags:** studio, intelligence
7
+
8
+ ## Reading path
9
+
10
+ 1. **Structural Intelligence** (builders) → chapters: `1-where-in-studio`, `2-what-good-evidence-looks-like`, `3-review-reject-install-checklist`
11
+
12
+ ## From: Structural Intelligence — 1. Where in Studio
13
+
14
+ | Need | Go to |
15
+ |---|---|
16
+ | Run / inspect profiling | Operate → intelligence runs (and related artifacts) |
17
+ | Read a proposal | Design → intelligence proposals |
18
+ | Install after approval | Design → metadata install / publish |
19
+ | Confirm it took effect | Design → effective types / agents · Explore lists |
20
+
21
+ Scope bar first: fresh `g12ops*` + agent `ops`. Never rehearse installs on live customer orgs.
22
+
23
+ ---
24
+
25
+ ## From: Structural Intelligence — 2. What “good evidence” looks like
26
+
27
+ Ask before installing:
28
+
29
+ 1. Were samples **deterministic** (ops fixtures) or a one-off scrape?
30
+ 2. Does the proposal explain **paths / types / cardinality**, or only vague labels?
31
+ 3. Is anything marked **insufficient evidence** or **rejected by validation**?
32
+ 4. Does compare-against-ops show a **small, understandable** diff?
33
+ 5. Will this change writers/readers for Alex / WI-100 in ways you can explain?
34
+
35
+ If you cannot answer those, **reject** (or request more fixtures). Rejection is a successful outcome.
36
+
37
+ ---
38
+
39
+ ## From: Structural Intelligence — 3. Review → reject → install checklist
40
+
41
+ ### Review
42
+
43
+ - [ ] Scope is `g12ops*` + `ops`
44
+ - [ ] Proposal id / timestamp recorded
45
+ - [ ] Evidence section opened (not only summary chips)
46
+ - [ ] Compare against approved `ops` (when available)
47
+ - [ ] AI-only suggestions flagged as untrusted extras
48
+
49
+ ### Reject when
50
+
51
+ - Evidence is thin or contradictory
52
+ - Diff invents cyber/vendor vocabulary into the permanent ops narrative
53
+ - Validation already rejected the draft
54
+ - You are on the wrong org / agent set
55
+ - Someone asks you to “just apply” without reading
56
+
57
+ ### Install only when
58
+
59
+ - [ ] Human review completed
60
+ - [ ] Explicit install/publish confirmation clicked
61
+ - [ ] Effective metadata refreshed afterward
62
+ - [ ] Explore still shows expected subjects (smoke check WI-100 / Alex)
63
+
64
+ Install is a **different** action from “generate proposal.” If Studio ever conflates them, treat that as a defect.
65
+
66
+ ---
67
+
68
+ ## Also see
69
+
70
+ - **Metadata, Agents, Abstracts & Mappings** (`05-metadata-agents-abstracts`) — Agents, OT/CT, virtual abstracts, mappings, install/publish — never auto-install from intelligence.
71
+
72
+ ---
73
+
74
+ _Generated use-case pack for agents and humans. See `agent-manifest.json` for discovery._
@@ -0,0 +1,67 @@
1
+ # Keep workspaces isolated via the scope bar
2
+
3
+ > **Use case id:** `studio-scope-isolation`
4
+ > **Goal:** Never mix orgs/workspaces; treat scope as the product boundary.
5
+ > **Audiences:** builders
6
+ > **Tags:** studio, scope, isolation
7
+
8
+ ## Reading path
9
+
10
+ 1. **Workflow & Studio** (builders) → chapters: `1-scope-bar-first-always`, `6-operator-ux-rules`
11
+ 1. **Platform Overview** (builders) → chapters: `6-rules-builders-enforce`, `9-acceptance-workspace`
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 — 6. Operator UX rules
29
+
30
+ | Do | Don’t |
31
+ |---|---|
32
+ | Prefer tables, forms, status, confirmations | Make raw JSON the primary review surface |
33
+ | Open technical JSON only when needed | Ask engineers to “just patch Mongo” |
34
+ | Keep Design / Operate / Explore jobs separate | Mix install, run, and subject edit without labels |
35
+ | Use fresh `g12ops*` for drills | Practice on live customer orgs |
36
+ | Explicit metadata install | Expect intelligence to “just apply” |
37
+ | Capture org, agents, subject, revision, run id on failure | Escalate with only “it broke” |
38
+
39
+ Studio talks **only** to Memorix Service. If someone claims Studio “writes Mongo,” they are wrong about the architecture.
40
+
41
+ ---
42
+
43
+ ## From: Platform Overview — 6. Rules builders enforce
44
+
45
+ - Fresh `g12ops*` + agent `ops` for acceptance and drills.
46
+ - No live customer orgs as playgrounds.
47
+ - Relationships never copy the other record’s payload into this one.
48
+ - Abstracts are views — you always write to a **concrete** type.
49
+ - Intelligence proposes; humans install.
50
+ - Deterministic fixtures for acceptance — do not require live AI to prove the platform.
51
+ - When something fails, capture: org, agents, subject id, content type, revision, run/attempt id — then escalate with that packet.
52
+
53
+ Hard rules (full): [HARD-RULES.md](../../HARD-RULES.md).
54
+
55
+ ---
56
+
57
+ ## From: Platform Overview — 9. Acceptance workspace
58
+
59
+ Always use a fresh `g12ops*` organization with agent `ops`. Never use live customer orgs for drills. See [_shared/ops-scenario.md](../../_shared/ops-scenario.md).
60
+
61
+ ## Also see
62
+
63
+ - **Agent Packs & Ops** (`11-agent-packs-and-ops`) — Pack layout, harness, g12ops* acceptance, custom kinds, golden V2 validation.
64
+
65
+ ---
66
+
67
+ _Generated use-case pack for agents and humans. See `agent-manifest.json` for discovery._
@@ -0,0 +1,54 @@
1
+ # Resolve stale conflicts from the UI
2
+
3
+ > **Use case id:** `studio-stale-conflict-ui`
4
+ > **Goal:** Recognize revision conflicts and recover without losing the other writer’s work blindly.
5
+ > **Audiences:** builders
6
+ > **Tags:** studio, conflicts
7
+
8
+ ## Reading path
9
+
10
+ 1. **Migration & Troubleshooting** (builders) → chapters: `2-stale-conflicts-what-you-should-do`, `4-symptom-where-to-click`
11
+ 1. **Format for Dummies** (builders) → chapters: `4-revision-why-saves-sometimes-conflict`
12
+
13
+ ## From: Migration & Troubleshooting — 2. Stale conflicts (what you should do)
14
+
15
+ When Explore/Workflow save fails because someone else (or you in another tab) saved first:
16
+
17
+ 1. Read the conflict message — do not force-overwrite.
18
+ 2. Refresh the subject.
19
+ 3. Re-apply **your** intent on the latest revision.
20
+ 4. Save again.
21
+
22
+ This is normal optimistic concurrency — not a broken database.
23
+
24
+ ---
25
+
26
+ ## From: Migration & Troubleshooting — 4. Symptom → where to click
27
+
28
+ | Symptom | Studio area | Likely next step |
29
+ |---|---|---|
30
+ | Empty types / agents | Design | Explicit metadata install |
31
+ | Proposal didn’t change anything | Design | Review → **install** or reject (by design) |
32
+ | Pull failed / quarantine | Operate → Memory | Fix source/credentialRef; re-pull |
33
+ | Step failed | Operate → Failures / Artifacts | Read artifact; fix mapping/service; retry |
34
+ | Save conflict | Explore | Refresh + retry |
35
+ | Link missing | Operate → Relationships | Verify/rebuild definition |
36
+ | Wrong tenant’s subjects | Scope bar | Fix org / agents |
37
+
38
+ ---
39
+
40
+ ## From: Format for Dummies — 4. Revision (why saves sometimes conflict)
41
+
42
+ Every content instance has a **revision**. When you save, Studio sends the revision it believes is current. If someone else saved first, you get a **stale conflict** — refresh, re-apply your intent, save again.
43
+
44
+ That is protection, not a bug. Do not ask for a Mongo force-write.
45
+
46
+ ---
47
+
48
+ ## Also see
49
+
50
+ - **Workflow & Studio** (`09-workflow-and-studio`) — Design · Operate · Explore — scope bar ≡ headers, workflow siblings, embedding guidance. Builders primary.
51
+
52
+ ---
53
+
54
+ _Generated use-case pack for agents and humans. See `agent-manifest.json` for discovery._
@@ -0,0 +1,164 @@
1
+ # Troubleshoot runtime HTTP failures
2
+
3
+ > **Use case id:** `troubleshoot-http-matrix`
4
+ > **Goal:** Use the failure matrix and escalate packet when stuck.
5
+ > **Audiences:** developers
6
+ > **Tags:** troubleshooting, http
7
+
8
+ ## Reading path
9
+
10
+ 1. **Migration & Troubleshooting** (developers) → chapters: `4-failure-matrix-runtime-http`, `11-escalate-packet-for-humans-builders`, `13-end-to-end-repair-playbooks`
11
+
12
+ ## From: Migration & Troubleshooting — 4. Failure matrix (runtime HTTP)
13
+
14
+ Use this as the first lookup when demos break.
15
+
16
+ ### 409 — stale revision / conflict
17
+
18
+ | Likely cause | Fix |
19
+ |---|---|
20
+ | Concurrent edit; wrong `expectedRevision` | Re-GET content; merge; retry with current revision |
21
+ | Workflow PUT with stale revision | Same — Studio shows stale conflict UI |
22
+
23
+ ```bash
24
+ # pattern
25
+ curl -s "${H[@]}" "$SERVICE/api/data/content?objectType=work-items&contentType=workflow&id=wi-100"
26
+ # note revision → PUT /api/workflow with expectedRevision
27
+ ```
28
+
29
+ ### 405 — relationship link mutation
30
+
31
+ | Likely cause | Fix |
32
+ |---|---|
33
+ | Ad-hoc PUT/DELETE on links | Use `/api/relationships` verify / rebuild / discover |
34
+ | Host treating links like ordinary documents | Relationship engine only |
35
+
36
+ ### 503 — durable routes unavailable
37
+
38
+ | Likely cause | Fix |
39
+ |---|---|
40
+ | Prod/durable mode without Mongo | Set `MEMORIX_SERVICE_MODE=prod` + `MONGO_URI` |
41
+ | Service down | Check `/health`; restart `dev-stack` |
42
+ | 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`) |
43
+
44
+ ### Unresolved relationships
45
+
46
+ | Likely cause | Fix |
47
+ |---|---|
48
+ | Target subject/content missing | Write targets first; or rebuild definition after targets exist |
49
+ | Wrong definition / candidate set | Discover/rebuild for the definition id |
50
+ | Expansion shows `targetStatus: "unresolved"` | **Expected** calculated signal — do not invent fake targets |
51
+
52
+ ### Abstract write error
53
+
54
+ | Likely cause | Fix |
55
+ |---|---|
56
+ | Treating abstract type as a write collection | Write concrete object types |
57
+ | Non-reversible abstract property | Adjust bindings / use concrete path |
58
+ | Multi-target ambiguity | Disambiguate concrete type / id |
59
+
60
+ ### Intelligence “did nothing”
61
+
62
+ | Likely cause | Fix |
63
+ |---|---|
64
+ | Expecting auto-install | Explicit `/api/metadata/install` or Studio install |
65
+ | Insufficient evidence | Gather fixtures; do not force install |
66
+ | Wrong org/agent | Fresh `g12ops*` + `ops` |
67
+
68
+ ### Discriminator failures
69
+
70
+ | Likely cause | Fix |
71
+ |---|---|
72
+ | Missing `data.analysisType` (etc.) when required | Supply value or profile default |
73
+ | Changing immutable discriminator in place | remove old instance + add new |
74
+
75
+ ### Scope / headers
76
+
77
+ | Symptom | Fix |
78
+ |---|---|
79
+ | 400 on `agentId` | Use plural `x-memorix-agent-ids` |
80
+ | Empty / wrong types | Install pack; fix agent set |
81
+ | Wrong tenant data | Fix `x-memorix-org-id` |
82
+
83
+ ### Memory / pipelines
84
+
85
+ | Symptom | Fix |
86
+ |---|---|
87
+ | Secret rejected | Pass `credentialRef` only |
88
+ | Raw present, no snapshots | Check pipeline runs & artifacts |
89
+ | Quarantine growing | Inspect mapping / provider shape |
90
+
91
+ ### Stack / networking
92
+
93
+ | Symptom | Fix |
94
+ |---|---|
95
+ | Studio loads, API fails | Service `:5100/health`; proxy target |
96
+ | Port in use | Change `MEMORIX_*_PORT` (even=API, odd=UI) |
97
+
98
+ ---
99
+
100
+ ## From: Migration & Troubleshooting — 11. Escalate packet (for humans / builders)
101
+
102
+ When filing or receiving a failure, require:
103
+
104
+ | Field | Example |
105
+ |---|---|
106
+ | Org id | `g12opsab12cd` |
107
+ | Agent ids | `["ops"]` |
108
+ | Subject / content | `wi-100` / `workflow` |
109
+ | Revision observed | `3` |
110
+ | Route + status | `PUT /api/workflow` → `409` |
111
+ | Run / attempt id | pipeline attempt uuid |
112
+ | Artifact ref | failure artifact id |
113
+ | Fixture mode | deterministic ops-source: yes/no |
114
+ | Screenshot | scope bar + error |
115
+
116
+ Builders twin turns this into a Studio quick-check list.
117
+
118
+ ---
119
+
120
+ ## From: Migration & Troubleshooting — 13. End-to-end repair playbooks
121
+
122
+ ### Playbook A — Stale workflow edit (409)
123
+
124
+ 1. `GET /api/workflow?id=wi-100` (or data content read).
125
+ 2. Diff operator intent against `record.data`.
126
+ 3. `PUT /api/workflow` with `expectedRevision` = current.
127
+ 4. If 409 again, another writer won — loop once; then escalate with both revisions.
128
+
129
+ ### Playbook B — Missing links after migrate
130
+
131
+ 1. Confirm V2 subjects for endpoints exist (`employee-10`, `wi-100`).
132
+ 2. Map extracted candidates → `relationshipDefinitionId` values installed in ops metadata.
133
+ 3. `POST /api/relationships/discover` (bounded) and/or pipeline `relationship-write`.
134
+ 4. `POST /api/relationships/verify` for the definition.
135
+ 5. Expand in compose/query — unresolved targets stay visible if still missing.
136
+
137
+ ### Playbook C — Abstract write confusion
138
+
139
+ 1. Confirm the abstract type is virtual (People).
140
+ 2. Choose concrete `objectType` (`employees` / `contractors`) or use documented reverse-map patch APIs.
141
+ 3. Never create an abstract collection or abstract `recordId`.
142
+
143
+ ### Playbook D — Intelligence silence
144
+
145
+ 1. Confirm proposal artifact exists (Design / `/api/intelligence/proposals`).
146
+ 2. Confirm effective metadata hash unchanged after propose (expected).
147
+ 3. Explicit install with confirm — or reject.
148
+ 4. Re-check `/api/metadata/effective`.
149
+
150
+ ### Playbook E — 503 on durable routes
151
+
152
+ 1. `GET /health`.
153
+ 2. Check `MEMORIX_SERVICE_MODE` and `MONGO_URI` for durable/prod.
154
+ 3. Restart `dev-stack` / service; re-try the same scoped call.
155
+
156
+ ---
157
+
158
+ ## Also see
159
+
160
+ - **Runtime Data Client** (`02-runtime-data-client`) — Connection, scope, exact reads, writes, compose, abstracts, and client anti-patterns through Memorix Service / OpenAPI.
161
+
162
+ ---
163
+
164
+ _Generated use-case pack for agents and humans. See `agent-manifest.json` for discovery._
@@ -0,0 +1,94 @@
1
+ # Embed Memorix engines in a trusted host
2
+
3
+ > **Use case id:** `trusted-in-process-embed`
4
+ > **Goal:** Know when in-process packages are allowed vs remote HTTP-only clients.
5
+ > **Audiences:** developers
6
+ > **Tags:** embedding, packages
7
+
8
+ ## Reading path
9
+
10
+ 1. **Platform Overview** (developers) → chapters: `5-sixteen-packages-when-to-use-what`, `8-hard-product-rules-integrator-checklist`
11
+ 1. **Structural Intelligence** (developers) → chapters: `12-in-process-vs-http`
12
+
13
+ ## From: Platform Overview — 5. Sixteen packages (when to use what)
14
+
15
+ All of the packages below publish as **`@x12i/memorix-*@3.0.2+`**. HTTP compliance kits (`ports-manager`, `api-live-view`, `core-service`) are separate `@x12i/*` packages.
16
+
17
+ | Package | Integrator use |
18
+ |---|---|
19
+ | `memorix-format` | Validate / migrate `memorix-record/2` offline |
20
+ | `memorix-metadata` | Declarative contracts + abstract unions |
21
+ | `memorix-metadata-runtime` | Install / effective metadata client (trusted boundary) |
22
+ | `memorix-mapping` | Deterministic mapping AST execution |
23
+ | `memorix-data` | Read/write/compose/abstract (preferred library behind service) |
24
+ | `memorix-relationship-store` | Link storage contract (engine-internal; not for ad-hoc writes) |
25
+ | `memorix-relationships` | Trusted relationship engine |
26
+ | `memorix-memory` | Source pull → `*-raw` landing |
27
+ | `memorix-pipeline` | Pipeline definitions and execution |
28
+ | `memorix-pipeline-runtime` | Run/attempt/artifact ledgers |
29
+ | `memorix-intelligence` | Structural profiling + proposals |
30
+ | `memorix-service` | HTTP composition root |
31
+ | `memorix-studio` | Product UI |
32
+ | `memorix-ops-pack` | Ops metadata + fixtures pattern |
33
+ | `memorix-db-router` | Org/agent DB naming |
34
+ | `memorix-mongo` | Mongo helpers used by data plane |
35
+
36
+ ### Decision tree — HTTP vs package
37
+
38
+ ```text
39
+ Remote host / another product?
40
+ └─ Yes → call memorix-service HTTP (optional: memorix-format for offline validate)
41
+ Same trusted process as the platform?
42
+ └─ Yes → may use memorix-data / metadata-runtime / engines in-process
43
+ Need to mutate domain content?
44
+ └─ Always through data plane (service or memorix-data) — never raw Mongo
45
+ Need to mutate relationship links?
46
+ └─ Only via relationship engine APIs (verify/rebuild/materialize) — never ad-hoc PUT/DELETE
47
+ ```
48
+
49
+ ---
50
+
51
+ ## From: Platform Overview — 8. Hard product rules (integrator checklist)
52
+
53
+ These invariants apply to every integration, acceptance example, and ebook:
54
+
55
+ 1. Acceptance orgs are fresh `g12ops*` with `agentIds: ["ops"]`.
56
+ 2. Permanent narrative is non-cyber **ops** (employees, work-items, procedures).
57
+ 3. Relationships are four-field links only — no root `associated*` storage, no copied payloads.
58
+ 4. Abstracts are virtual projections — no abstract collections / abstract `recordId`.
59
+ 5. KnowX is one content type + `data.kind` (`NODE` | `EDGE`) + one abstract `KnowXEntity`.
60
+ 6. Provenance (`docHash` + `SourceSpan`) is mandatory for KnowX; `epistemic.state` ≠ extraction confidence.
61
+ 7. Deterministic fixtures only for acceptance — no live AI required.
62
+ 8. Mutations go through the data plane (`memorix-service` / `@x12i/memorix-data`), never direct Mongo domain writes.
63
+
64
+ Full text: [HARD-RULES.md](../../HARD-RULES.md).
65
+
66
+ ---
67
+
68
+ ## From: Structural Intelligence — 12. In-process vs HTTP
69
+
70
+ | Mode | Use when | Caution |
71
+ |---|---|---|
72
+ | HTTP `/api/intelligence/*` | Remote hosts, Studio, demos | Prefer for product boundaries |
73
+ | In-process `@x12i/memorix-intelligence` | Trusted platform workers | Still must not call install implicitly |
74
+
75
+ Even in-process, keep proposal creation and metadata install in **separate functions / jobs**. A single “profileAndApply” helper is an anti-pattern.
76
+
77
+ ```ts
78
+ // Good: explicit stages
79
+ const profile = profileRecords(samples, opts);
80
+ const proposal = createProposal(profile, opts);
81
+ // ... persist proposal artifact, notify reviewers ...
82
+ // later, after approval:
83
+ await metadataRuntime.install({ pack: approvedPack, confirm: true, scope });
84
+ ```
85
+
86
+ ---
87
+
88
+ ## Also see
89
+
90
+ - **Building Services** (`07-services`) — When to build a service, handlers, pipeline invoke, and core-service / ports-manager / api-live-view.
91
+
92
+ ---
93
+
94
+ _Generated use-case pack for agents and humans. See `agent-manifest.json` for discovery._
@@ -0,0 +1,212 @@
1
+ # Work with workflow sibling content via API
2
+
3
+ > **Use case id:** `workflow-sibling-api`
4
+ > **Goal:** Treat workflow as sibling content under /api/workflow, not a separate product.
5
+ > **Audiences:** developers
6
+ > **Tags:** workflow, http
7
+
8
+ ## Reading path
9
+
10
+ 1. **Workflow & Studio** (developers) → chapters: `4-workflow-is-sibling-content`, `5-workflow-http-api-workflow`
11
+ 1. **Runtime Data Client** (developers) → chapters: `16-workflow-clients`
12
+
13
+ ## From: Workflow & Studio — 4. Workflow is sibling content
14
+
15
+ Workflow is **not** a separate product database and not a Mongo collection you invent. It is ordinary `memorix-record/2` content:
16
+
17
+ ```json
18
+ {
19
+ "format": "memorix-record/2",
20
+ "recordId": "wi-100",
21
+ "revision": 2,
22
+ "objectType": "work-items",
23
+ "contentType": "workflow",
24
+ "dataCategory": "entity",
25
+ "concept": {
26
+ "title": "Workflow for WI-100",
27
+ "identifiers": {
28
+ "primary": {
29
+ "kind": "workItemId",
30
+ "value": "WI-100",
31
+ "issuer": "ops-source"
32
+ }
33
+ }
34
+ },
35
+ "data": {
36
+ "state": "in-progress",
37
+ "assignedTo": ["ops-reviewers"],
38
+ "steps": [
39
+ { "id": "triage", "status": "done" },
40
+ { "id": "ops-review", "status": "open" }
41
+ ]
42
+ },
43
+ "_system": {
44
+ "state": "active",
45
+ "createdAt": "2026-07-22T09:00:00.000Z",
46
+ "modifiedAt": "2026-07-22T11:00:00.000Z"
47
+ }
48
+ }
49
+ ```
50
+
51
+ Composition with the same `recordId` yields siblings — for example `work-items-snapshots` + `work-items-workflow` — without flattening.
52
+
53
+ KnowX review pattern (book `12`): assertions often carry:
54
+
55
+ - `contentType: "knowx"` — the claim
56
+ - `contentType: "workflow"` — assignment / pending-review
57
+ - `contentType: "confirmations"` — accept/reject decision
58
+
59
+ Do **not** stuff review UI state into provenance. Use workflow / confirmations siblings.
60
+
61
+ ---
62
+
63
+ ## From: Workflow & Studio — 5. Workflow HTTP (`/api/workflow`)
64
+
65
+ OpenAPI family: **Workflow**. Two operations mirror Studio Explore workflow edit.
66
+
67
+ ### 5.1 Read — `GET /api/workflow`
68
+
69
+ ```http
70
+ GET /api/workflow?id=wi-100
71
+ x-memorix-org-id: g12ops…
72
+ x-memorix-agent-ids: ops
73
+ ```
74
+
75
+ Response shape (conceptual):
76
+
77
+ ```ts
78
+ {
79
+ scope: MemorixScope;
80
+ id: string | null;
81
+ contentType: "workflow";
82
+ record: MemorixRecordV2 | null;
83
+ currentRevision: number | null;
84
+ note?: string;
85
+ }
86
+ ```
87
+
88
+ Notes:
89
+
90
+ - `contentType` is fixed to `"workflow"`.
91
+ - Missing workflow returns a null `record` (and null revision) rather than inventing empty steps.
92
+ - You can also read via the data plane (`/api/data/content?objectType=…&contentType=workflow&id=…`). The workflow family exists so operator clients have a stable, narrow contract.
93
+
94
+ ### 5.2 Write — `PUT /api/workflow`
95
+
96
+ Exact-revision edit (optimistic concurrency):
97
+
98
+ ```http
99
+ PUT /api/workflow
100
+ x-memorix-org-id: g12ops…
101
+ x-memorix-agent-ids: ops
102
+ content-type: application/json
103
+ ```
104
+
105
+ ```json
106
+ {
107
+ "id": "wi-100",
108
+ "expectedRevision": "2",
109
+ "record": {
110
+ "format": "memorix-record/2",
111
+ "recordId": "wi-100",
112
+ "revision": 2,
113
+ "objectType": "work-items",
114
+ "contentType": "workflow",
115
+ "dataCategory": "entity",
116
+ "concept": {
117
+ "title": "Workflow for WI-100",
118
+ "identifiers": {
119
+ "primary": {
120
+ "kind": "workItemId",
121
+ "value": "WI-100",
122
+ "issuer": "ops-source"
123
+ }
124
+ }
125
+ },
126
+ "data": {
127
+ "state": "pending-review",
128
+ "assignedTo": ["ops-reviewers"]
129
+ },
130
+ "_system": {
131
+ "state": "active",
132
+ "createdAt": "2026-07-22T09:00:00.000Z",
133
+ "modifiedAt": "2026-07-22T11:00:00.000Z"
134
+ }
135
+ }
136
+ }
137
+ ```
138
+
139
+ | Field | Role |
140
+ |---|---|
141
+ | `id` | Subject `recordId` |
142
+ | `record` | Full V2 workflow envelope (`contentType` must be `workflow`) |
143
+ | `expectedRevision` | Exact revision the client believes is current |
144
+ | `currentRevision` (optional) | When set and mismatched, service returns **409** |
145
+
146
+ Success response (conceptual): `scope`, `id`, `expectedRevision`, `currentRevision`, `status`, `conflict: false`.
147
+
148
+ Conflict: **409** — re-GET, merge operator intent, retry with the new revision. Studio shows this as a stale-edit conflict (see migration book screenshot `17-stale-conflict`).
149
+
150
+ ### 5.3 Error matrix (workflow-focused)
151
+
152
+ | Status | Likely meaning | Fix |
153
+ |---|---|---|
154
+ | 400 | Bad body / validation / singular agent header | Fix envelope + plural `agent-ids` |
155
+ | 403 | Forbidden for this scope | Check org / agents / auth |
156
+ | 409 | Stale revision / conflict | Re-read; retry exact revision |
157
+ | 503 | Service unavailable (often durable mode without Mongo) | Set prod mode + `MONGO_URI`, or use documented dev mode |
158
+
159
+ Always validate locally when iterating:
160
+
161
+ ```bash
162
+ npx memorix-format validate-v2 ./work-items-workflow.json
163
+ ```
164
+
165
+ ---
166
+
167
+ ## From: Runtime Data Client — 16. Workflow clients
168
+
169
+ Workflow is **ordinary sibling content** on the subject.
170
+
171
+ - Read/write through the data API (and `/api/workflow` as a specialized view of the same rules).
172
+ - Exact revision required for updates.
173
+ - Explicit composition when the UI also needs snapshot/analysis.
174
+ - No separate “workflow database” semantics.
175
+ - Studio workflow surfaces are views over canonical content operations.
176
+
177
+ ### Ops example — edit WI-100 workflow
178
+
179
+ 1. GET workflow sibling for `wi-100` → note `revision`.
180
+ 2. PATCH assignee / step with that revision.
181
+ 3. On conflict, re-read, merge, retry.
182
+ 4. Compose with snapshot when the page shows both status and assignment.
183
+
184
+ ```ts
185
+ async function editWorkflow(recordId: string, nextAssignee: string) {
186
+ const current = await getContent({
187
+ objectType: "work-items",
188
+ contentType: "workflow",
189
+ recordId,
190
+ });
191
+ await writeContent({
192
+ op: "patch",
193
+ objectType: "work-items",
194
+ contentType: "workflow",
195
+ recordId,
196
+ precondition: { kind: "revision", revision: current.revision },
197
+ patch: [{ op: "set", path: "data.assignee", value: nextAssignee }],
198
+ });
199
+ }
200
+ ```
201
+
202
+ See also [Workflow & Studio](../../09-workflow-and-studio/developers/BOOK.md).
203
+
204
+ ---
205
+
206
+ ## Also see
207
+
208
+ - **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.
209
+
210
+ ---
211
+
212
+ _Generated use-case pack for agents and humans. See `agent-manifest.json` for discovery._
@@ -0,0 +1,19 @@
1
+ ---
2
+ id: "revision-conflict"
3
+ type: "visual"
4
+ title: "Stale writers are rejected; the record stays at the newer revision."
5
+ summary: "Revision preconditions preserve newer data."
6
+ ---
7
+ # Stale writers are rejected; the record stays at the newer revision.
8
+
9
+ Alt: Conflict dialog showing stale expected revision while record remains unchanged
10
+
11
+ ## What to notice
12
+
13
+ - Expected revision is shown
14
+ - Record was not mutated
15
+ - Recovery is reload and retry
16
+
17
+ ## Why it matters
18
+
19
+ Revision preconditions preserve newer data.