@x12i/memorix-docs 1.0.1 → 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 +7582 -47
  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 +5 -4
@@ -0,0 +1,38 @@
1
+ ---
2
+ id: "stale-revision-conflict"
3
+ type: "scenario"
4
+ title: "A write returns a stale-revision conflict"
5
+ summary: "PATCH/PUT rejected because expected revision was stale."
6
+ audiences: ["developers"]
7
+ invariants: ["Conflict means the prior write did not apply"]
8
+ ---
9
+ # A write returns a stale-revision conflict
10
+
11
+ ## Situation
12
+
13
+ API returned a revision conflict; record unchanged.
14
+
15
+ ## Decision
16
+
17
+ Reapply from current revision or escalate?
18
+
19
+ ## Signals
20
+
21
+ - 409/conflict
22
+ - expectedRevision mismatch
23
+
24
+ ## Paths
25
+
26
+ ### Reload and retry
27
+
28
+ **When:** Intended change still valid against current meaning
29
+
30
+ Safe recovery path.
31
+
32
+ Guides: `reload-retry-conflict`
33
+
34
+ ### Escalate
35
+
36
+ **When:** Current meaning changed in a conflicting way
37
+
38
+ Guides: _none_
@@ -0,0 +1,30 @@
1
+ ---
2
+ id: "traversal-direction"
3
+ type: "scenario"
4
+ title: "Relationship traversal direction and expansion"
5
+ summary: "Choose forward/inverse and expanded/unexpanded handling."
6
+ audiences: ["developers"]
7
+ ---
8
+ # Relationship traversal direction and expansion
9
+
10
+ ## Situation
11
+
12
+ Caller must traverse a relationship and pick direction/expansion.
13
+
14
+ ## Decision
15
+
16
+ Which direction and expansion?
17
+
18
+ ## Paths
19
+
20
+ ### Forward
21
+
22
+ **When:** Following the definition's forward semantics
23
+
24
+ Guides: `define-traverse-relationship`
25
+
26
+ ### Inverse
27
+
28
+ **When:** Need inbound links
29
+
30
+ Guides: `define-traverse-relationship`
@@ -0,0 +1,31 @@
1
+ ---
2
+ id: "unresolved-relationship"
3
+ type: "scenario"
4
+ title: "A relationship target is unresolved"
5
+ summary: "Traversal returns an unresolved target marker."
6
+ audiences: ["developers", "builders"]
7
+ invariants: ["Do not hide unresolved targets"]
8
+ ---
9
+ # A relationship target is unresolved
10
+
11
+ ## Situation
12
+
13
+ Related record cannot be resolved under the active definition.
14
+
15
+ ## Decision
16
+
17
+ Repair, wait, or preserve/escalate?
18
+
19
+ ## Paths
20
+
21
+ ### Repair target
22
+
23
+ **When:** Target should exist and can be created/linked
24
+
25
+ Guides: `diagnose-unresolved`, `define-traverse-relationship`
26
+
27
+ ### Preserve unresolved
28
+
29
+ **When:** Unresolved is intentional
30
+
31
+ Guides: `diagnose-unresolved`
@@ -0,0 +1,18 @@
1
+ ---
2
+ id: "analysis-decision-lab"
3
+ type: "tutorial"
4
+ title: "Move from records to analysis and a decision"
5
+ summary: "Create analysis then a distinct decision on sample evidence."
6
+ audiences: ["developers", "builders"]
7
+ ---
8
+ # Move from records to analysis and a decision
9
+
10
+ Create analysis then a distinct decision on sample evidence.
11
+
12
+ ## 1. Write analysis
13
+
14
+
15
+
16
+ ## 2. Write decision
17
+
18
+
@@ -0,0 +1,22 @@
1
+ ---
2
+ id: "compare-views"
3
+ type: "tutorial"
4
+ title: "Compare raw, composed, and abstract views"
5
+ summary: "See fidelity differences on the same subjects."
6
+ audiences: ["developers", "builders"]
7
+ ---
8
+ # Compare raw, composed, and abstract views
9
+
10
+ See fidelity differences on the same subjects.
11
+
12
+ ## 1. Open raw
13
+
14
+
15
+
16
+ ## 2. Open composition
17
+
18
+
19
+
20
+ ## 3. Open People
21
+
22
+
@@ -0,0 +1,18 @@
1
+ ---
2
+ id: "conflict-lab"
3
+ type: "tutorial"
4
+ title: "Recover from a stale revision conflict"
5
+ summary: "Trigger and recover from a conflict using sample data."
6
+ audiences: ["developers"]
7
+ ---
8
+ # Recover from a stale revision conflict
9
+
10
+ Trigger and recover from a conflict using sample data.
11
+
12
+ ## 1. Submit stale revision
13
+
14
+
15
+
16
+ ## 2. Reload and retry
17
+
18
+
@@ -0,0 +1,18 @@
1
+ ---
2
+ id: "first-revision-safe-record"
3
+ type: "tutorial"
4
+ title: "Read and write the first revision-safe record"
5
+ summary: "Practice expected-revision writes on sample data."
6
+ audiences: ["developers"]
7
+ ---
8
+ # Read and write the first revision-safe record
9
+
10
+ Practice expected-revision writes on sample data.
11
+
12
+ ## 1. Read record
13
+
14
+
15
+
16
+ ## 2. Write with expected revision
17
+
18
+
@@ -0,0 +1,22 @@
1
+ ---
2
+ id: "install-pack-lab"
3
+ type: "tutorial"
4
+ title: "Validate and explicitly install a metadata pack"
5
+ summary: "Practice validation versus confirmation."
6
+ audiences: ["builders"]
7
+ ---
8
+ # Validate and explicitly install a metadata pack
9
+
10
+ Practice validation versus confirmation.
11
+
12
+ ## 1. Validate
13
+
14
+
15
+
16
+ ## 2. Cancel once
17
+
18
+
19
+
20
+ ## 3. Confirm install
21
+
22
+
@@ -0,0 +1,18 @@
1
+ ---
2
+ id: "relationships-lab"
3
+ type: "tutorial"
4
+ title: "Define, store, and traverse relationships"
5
+ summary: "Hands-on relationship definition and traversal."
6
+ audiences: ["developers"]
7
+ ---
8
+ # Define, store, and traverse relationships
9
+
10
+ Hands-on relationship definition and traversal.
11
+
12
+ ## 1. Review definition
13
+
14
+ Use sample relationship definition.
15
+
16
+ ## 2. Traverse forward and inverse
17
+
18
+
@@ -0,0 +1,18 @@
1
+ ---
2
+ id: "start-with-sample-data"
3
+ type: "tutorial"
4
+ title: "Start Memorix with the sample dataset"
5
+ summary: "Load the synthetic dataset and confirm scope."
6
+ audiences: ["developers", "builders"]
7
+ ---
8
+ # Start Memorix with the sample dataset
9
+
10
+ Load the synthetic dataset and confirm scope.
11
+
12
+ ## 1. Apply demo scope
13
+
14
+
15
+
16
+ ## 2. List sample subjects
17
+
18
+
@@ -0,0 +1,9 @@
1
+ ---
2
+ id: "memorix-studio"
3
+ type: "ui-client"
4
+ title: "Memorix Studio"
5
+ summary: "Service-oriented UI for designing, operating, and exploring Memorix."
6
+ ---
7
+ # Memorix Studio
8
+
9
+ Service-oriented UI for designing, operating, and exploring Memorix.
@@ -0,0 +1,237 @@
1
+ # Multi-type abstract list (People)
2
+
3
+ > **Use case id:** `abstract-people-list`
4
+ > **Goal:** List across concrete types via abstracts and reverse-map writes.
5
+ > **Audiences:** developers
6
+ > **Tags:** abstracts, metadata, http
7
+
8
+ ## Reading path
9
+
10
+ 1. **Metadata, Agents, Abstracts & Mappings** (developers) → chapters: `5-abstracts-virtual-unions-only`, `7-views-writes-and-the-client-effective-metadata-pattern`
11
+ 1. **Runtime Data Client** (developers) → chapters: `7-abstract-reads`, `12-abstract-writes`
12
+
13
+ ## From: Metadata, Agents, Abstracts & Mappings — 5. Abstracts — virtual unions only
14
+
15
+ Hard rule **#4:** abstracts are virtual projections — **no** abstract collections, **no** abstract `recordId`.
16
+
17
+ ![Abstracts & bindings](../screenshots/05-abstracts-bindings.png)
18
+
19
+ ### Why abstracts exist
20
+
21
+ Callers often want “all people” without knowing whether a subject is an `employees` or `contractors` record. An abstract type (`People`) is a **union projection** over concrete bindings.
22
+
23
+ ```text
24
+ People (abstract, virtual)
25
+ ├─ employees (concrete) — snapshots via mapping
26
+ └─ contractors (concrete) — snapshots via mapping
27
+ ```
28
+
29
+ There is no `people` Mongo collection and no `recordId` namespace owned by the abstract.
30
+
31
+ ### Abstract type (ops)
32
+
33
+ ```json
34
+ {
35
+ "id": "People",
36
+ "name": "People",
37
+ "meaning": "Employees and contractors who perform operational work",
38
+ "category": "entity",
39
+ "properties": [
40
+ { "id": "title", "valueType": "string", "required": true },
41
+ { "id": "role", "valueType": "string", "required": true },
42
+ { "id": "lens", "valueType": "string", "required": false }
43
+ ]
44
+ }
45
+ ```
46
+
47
+ ### Binding (union)
48
+
49
+ ```json
50
+ {
51
+ "id": "people-employees-contractors",
52
+ "abstractType": "People",
53
+ "concreteObjectTypes": ["employees", "contractors"],
54
+ "union": true,
55
+ "notes": "People = Employees ∪ Contractors. No abstract records exist.",
56
+ "members": [
57
+ {
58
+ "objectType": "employees",
59
+ "contentType": "snapshots",
60
+ "properties": [
61
+ {
62
+ "abstractProperty": "title",
63
+ "contentType": "snapshots",
64
+ "mappingId": "ops-people-abstract-employees"
65
+ }
66
+ ]
67
+ },
68
+ {
69
+ "objectType": "contractors",
70
+ "contentType": "snapshots",
71
+ "properties": [
72
+ {
73
+ "abstractProperty": "title",
74
+ "contentType": "snapshots",
75
+ "mappingId": "ops-people-abstract-contractors"
76
+ }
77
+ ]
78
+ }
79
+ ]
80
+ }
81
+ ```
82
+
83
+ Studio Explore can list the union:
84
+
85
+ ![People union](../screenshots/11-people-union.png)
86
+
87
+ ### Reads vs writes
88
+
89
+ | Operation | API idea | Where it lands |
90
+ |---|---|---|
91
+ | List / get abstract | `listAbstract` / `getAbstract` (data plane) | Virtual projection over concrete stores |
92
+ | Patch abstract | `patchAbstract` | Reverse mapping → **one** concrete writer patch |
93
+ | Write concrete | ordinary data write | Concrete `objectType` + `contentType` |
94
+
95
+ ```mermaid
96
+ flowchart LR
97
+ Abs[Abstract People] --> Emp[employees]
98
+ Abs --> Con[contractors]
99
+ Patch[patchAbstract] --> Map[reverse mapping]
100
+ Map --> Writer[concrete patch via memorix-data]
101
+ ```
102
+
103
+ See also [diagrams/abstract-reverse-write.md](../diagrams/abstract-reverse-write.md).
104
+
105
+ ### Reverse patch rules
106
+
107
+ 1. The caller patches **abstract properties** (for example `title`).
108
+ 2. Metadata bindings + mappings choose **which concrete object type** and **which content paths** receive the write.
109
+ 3. Exactly **one** concrete writer target is selected for a given patch context (union members are not written in parallel as “abstract records”).
110
+ 4. The data plane still enforces ordinary revision / concurrency rules on the concrete content.
111
+ 5. If reverse mapping cannot resolve a unique writer, the patch fails — do not invent an abstract identity.
112
+
113
+ ### What abstracts are not
114
+
115
+ - Not a second database
116
+ - Not a place to store relationship payloads
117
+ - Not a substitute for four-field relationship links
118
+ - Not auto-created when you invent a nice name in a host app — they must be declared and installed
119
+
120
+ ---
121
+
122
+ ## From: Metadata, Agents, Abstracts & Mappings — 7. Views, writes, and the client effective-metadata pattern
123
+
124
+ Integrators should not invent list columns or write forms in the host. Load effective metadata, then drive UI from descriptors.
125
+
126
+ ### Pattern
127
+
128
+ ```text
129
+ 1. Resolve effective metadata for (orgId, agentIds[])
130
+ 2. Read views / writes / objectTypes / abstracts / custom kinds
131
+ 3. Render UI columns and forms from those descriptors
132
+ 4. Address data only with concrete types (or abstract reverse-write)
133
+ 5. Never bypass the service with direct Mongo domain writes
134
+ ```
135
+
136
+ Example client sketch:
137
+
138
+ ```ts
139
+ const effective = await fetch("/api/metadata/effective", {
140
+ headers: {
141
+ "x-memorix-org-id": orgId, // g12ops…
142
+ "x-memorix-agent-ids": "ops",
143
+ },
144
+ }).then((r) => r.json());
145
+
146
+ const employeeSnapshotWrite = effective.writes.find(
147
+ (w) => w.id === "ops-employees-snapshots",
148
+ );
149
+
150
+ // Drive form identity / required fields from employeeSnapshotWrite
151
+ // Then POST/PATCH via /api/data against objectType: "employees", contentType: "snapshots"
152
+ ```
153
+
154
+ ### Built-in views / writes vs custom kinds
155
+
156
+ Prefer built-in `views` and `writes` when the need is first-class Memorix shape or Studio-compatible UI composition. Use **custom kinds** (next chapter) when another client owns a descriptor vocabulary the platform should only store and resolve.
157
+
158
+ ---
159
+
160
+ ## From: Runtime Data Client — 7. Abstract reads
161
+
162
+ Abstracts are **virtual projections** over concrete records. There is no `People` collection and no abstract `recordId`.
163
+
164
+ ### Operations
165
+
166
+ - **Get** one abstract projection by concrete identity under an abstract type.
167
+ - **List** an abstract union (e.g. People = employees ∪ contractors).
168
+ - Each hit retains concrete `recordId` + `objectType`.
169
+ - Direct **pushdown** filters run when the service can map them; unsupported non-pushdown queries fail clearly.
170
+ - Cross-collection pagination is deterministic when exposed — trust the cursor, do not reimplement merges.
171
+ - Abstract binding/provenance appears where the API exposes it.
172
+
173
+ ### Ops example — list People
174
+
175
+ ```bash
176
+ curl -sS \
177
+ -H "x-memorix-org-id: $ORG" \
178
+ -H "x-memorix-agent-ids: $AGENTS" \
179
+ "$BASE/api/data/abstract?abstractType=People&limit=50"
180
+ ```
181
+
182
+ Alex may appear as `objectType: "employees"`. A contractor peer appears as `objectType: "contractors"`. Both are People in the UI; neither is stored under a People collection.
183
+
184
+ ### May / must-not
185
+
186
+ - **You may** bind UI forms to abstract property names when bindings exist.
187
+ - **You must not** construct abstract storage paths or invent abstract record ids.
188
+ - **You must not** write “into People” except via supported abstract reverse-write (`patchAbstract`) that targets one concrete member.
189
+
190
+ ---
191
+
192
+ ## From: Runtime Data Client — 12. Abstract writes
193
+
194
+ Supported flow: **`patchAbstract`** (name per OpenAPI / data plane).
195
+
196
+ 1. Abstract type (e.g. `People`)
197
+ 2. Concrete `recordId` (Alex)
198
+ 3. Expected **concrete** revision
199
+ 4. Abstract-shaped changes
200
+ 5. Binding resolution → generated concrete update plan
201
+ 6. **One** concrete mutation
202
+
203
+ ### Failures (fail closed)
204
+
205
+ | Failure | Meaning |
206
+ |---|---|
207
+ | Concrete record not a union member | Alex’s type not in People |
208
+ | Unknown abstract property | No binding |
209
+ | Non-reversible binding | Cannot map write safely |
210
+ | Multi-target binding | Would touch more than one concrete path |
211
+ | Conflicting reverse paths | Ambiguous plan |
212
+ | Stale concrete revision | Refetch and retry |
213
+ | Invalid generated path | Plan rejected |
214
+
215
+ Abstract writes **never** create abstract records. They only reverse-map onto concrete content.
216
+
217
+ ### Ops example — patch People.title
218
+
219
+ ```ts
220
+ await patchAbstract({
221
+ abstractType: "People",
222
+ recordId: "employee-10", // Alex
223
+ expectedRevision: 4,
224
+ changes: [{ op: "set", path: "title", value: "Operations lead" }],
225
+ });
226
+ // → one concrete employees snapshot patch
227
+ ```
228
+
229
+ ---
230
+
231
+ ## Also see
232
+
233
+ - **Data Access Patterns** (`04-data-access-patterns`) — Decision matrix — best / acceptable / forbidden access methods for real client tasks.
234
+
235
+ ---
236
+
237
+ _Generated use-case pack for agents and humans. See `agent-manifest.json` for discovery._
@@ -0,0 +1,117 @@
1
+ # AI pipeline steps fail closed
2
+
3
+ > **Use case id:** `ai-pipeline-fail-closed`
4
+ > **Goal:** Add AI steps without silent invention; keep validation and retries honest.
5
+ > **Audiences:** developers
6
+ > **Tags:** pipelines, ai
7
+
8
+ ## Reading path
9
+
10
+ 1. **Building Pipelines** (developers) → chapters: `8-ai-pipelines`, `11-errors-catalog`
11
+ 1. **Building Services** (developers) → chapters: `9-secrets-validation-reliability`
12
+
13
+ ## From: Building Pipelines — 8. AI pipelines
14
+
15
+ AI is **optional service execution**, not core pipeline intelligence.
16
+
17
+ 1. Capture exact record revisions, composition, relationship-expanded context, prompt/template fingerprint, model/service binding evidence.
18
+ 2. Invoke AI service step.
19
+ 3. Store raw response artifact/hash.
20
+ 4. Parse and validate structured output.
21
+ 5. Persist only through canonical ports.
22
+ 6. Several model attempts may differ; **one** accepted mutation applies.
23
+ 7. Recorded-response testing for acceptance; air-gapped execution supported.
24
+ 8. Failure/skip/fallback is explicit policy — never silent fake success.
25
+ 9. Metadata proposal pipelines never install metadata directly.
26
+
27
+ Deterministic fixtures only for platform acceptance — **no live AI required**.
28
+
29
+ ---
30
+
31
+ ## From: Building Pipelines — 11. Errors (catalog)
32
+
33
+ | Code class | Layer | Retryable? | Safe action |
34
+ |---|---|---|---|
35
+ | Invalid definition / unknown step / cycle | Validate | No | Fix pack |
36
+ | Missing dependency / invalid reference | Validate | No | Fix graph |
37
+ | Missing service / port | Startup/run | No | Bind registry / ports |
38
+ | Missing prod ledger/artifact store | Startup | No | Configure durable stores |
39
+ | Invalid scope / input | Run | No | Fix caller |
40
+ | Mapping / validation failure | Step | No | Fix mapping/data |
41
+ | Identity conflict | Step | No | Resolve identity |
42
+ | Stale revision | Write | No auto | Re-read; new revision |
43
+ | Relationship discover/write failure | Step | Often partial | Retry relationship portion |
44
+ | Memory / cursor failure | Step | Often yes | Fix source; resume cursor |
45
+ | Artifact missing / wrong org | DataRef | No | Restore / fix scope |
46
+ | Timeout / cancelled | Attempt | Policy | Retry or accept cancel |
47
+ | Retry exhausted | Step | No | Manual intervene |
48
+ | Partial batch | Run | Mixed | Retry failed items |
49
+ | Invalid AI output | Step | Policy | Repair or fail |
50
+ | External action uncertain/failed | Step | Keyed only | Inspect receipt |
51
+ | Unsupported atomicity | Validate | No | Disable atomicBatch |
52
+ | Schedule error | Scheduler | No | Fix cron/config |
53
+
54
+ Sanitize all evidence — no secrets, no unrestricted payloads.
55
+
56
+ ---
57
+
58
+ ## From: Building Services — 9. Secrets, validation, reliability
59
+
60
+ ### Credential references
61
+
62
+ Service metadata and Memory configs carry `credentialRef` only. Runtime resolves credentials outside Catalox and never places them in metadata, records, run evidence, artifacts, errors, logs, or client responses.
63
+
64
+ ```http
65
+ POST /api/memory/pull
66
+ x-memorix-org-id: g12ops7a3c
67
+ x-memorix-agent-ids: ops
68
+ Content-Type: application/json
69
+
70
+ {
71
+ "sourceId": "ops-source",
72
+ "credentialRef": "secret://ops-source"
73
+ }
74
+ ```
75
+
76
+ ### Validation
77
+
78
+ Schema validation, maximum sizes, path safety, content types, artifact type/hash, scope validation, unknown fields, structured error codes.
79
+
80
+ ### Timeouts and cancellation
81
+
82
+ Deadline propagation, cancellation signal, cleanup, remote cancellation limits, cancelled attempt status, and honest uncertainty when an external side effect may already have occurred.
83
+
84
+ ### Idempotency declaration
85
+
86
+ For every service declare: supported?, key shape, duplicate behavior, result reuse, side-effect receipt handling.
87
+
88
+ Recommended key material: `(orgId, pipelineId, stepId, subjectRecordId, inputRevision)` or an explicit business key for external actions.
89
+
90
+ ### Error catalog (codes to handle)
91
+
92
+ | Code class | Retryable? | Operator action |
93
+ |---|---|---|
94
+ | Configuration / missing binding | No | Fix pack / registry; redeploy |
95
+ | Invalid input / validation | No | Fix caller or mapping |
96
+ | Dependency unavailable | Yes | Wait / retry; check health |
97
+ | Timeout | Often yes | Inspect attempt; raise timeout or fix hang |
98
+ | Retryable external failure | Yes | Automatic / manual retry |
99
+ | Terminal external failure | No | Fix external system or disable step |
100
+ | Partial batch | Mixed | Retry failed items only |
101
+ | Invalid output | No | Fix service contract / parser |
102
+ | Artifact error | Depends | Restore artifact store / wrong-org check |
103
+ | Stale write after service | No auto | Re-read; new revision; retry write |
104
+ | Ambiguous identity / insufficient evidence | No | Human resolution / richer input |
105
+ | AI parse / validation failure | Policy | Repair policy or fail terminal |
106
+
107
+ Sanitize all errors — no secrets, no unrestricted payloads.
108
+
109
+ ---
110
+
111
+ ## Also see
112
+
113
+ - **Structural Intelligence** (`10-intelligence`) — Profile data, proposals with evidence, human install boundary.
114
+
115
+ ---
116
+
117
+ _Generated use-case pack for agents and humans. See `agent-manifest.json` for discovery._