@x12i/memorix-format 2.3.3 → 3.0.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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 3.0.1
2
+
3
+ - Patch release: README/port-map alignment, live-view wiring where applicable.
4
+
1
5
  # Changelog
2
6
 
3
7
  ## 2.3.3
package/README.md CHANGED
@@ -1,27 +1,28 @@
1
- # @x12i/memorix-format
1
+ # `@x12i/memorix-format`
2
2
 
3
- Memorix record format package.
3
+ Canonical **memorix-record/2** validation, migration, and CLI for Memorix.
4
4
 
5
- | Era | API | Status |
6
- |---|---|---|
7
- | **memorix-record/2** | `validateMemorixRecordV2`, `migratePresentToV2`, CLI `validate-v2` / `migrate-to-v2` | **Gate G2 SoT** for new platform work |
8
- | Present | `validateMemorixRecord`, CLI `validate` / `migrate` | Migration source; writer default until `MEMORIX_RECORD_FORMAT=v2` |
5
+ Object / content **types** belong in agent metadata — this package is the **envelope** SoT (shape of every stored subject content document), not product vocabulary.
9
6
 
10
- Present envelope helpers still come from [`@x12i/memorix-base-format`](https://www.npmjs.com/package/@x12i/memorix-base-format) (temporary; folding into this package per Phase 0 deletion ledger).
7
+ ## Install
11
8
 
12
- **Object types belong in agent metadata / Catalox, not here.**
9
+ ```bash
10
+ npm install @x12i/memorix-format@3.0.0
11
+ ```
13
12
 
14
- Docs:
13
+ | Audience | Use this package? |
14
+ |----------|-------------------|
15
+ | Remote app | Optional — validate offline / in CI |
16
+ | Platform / writers / pipelines | **Yes** |
15
17
 
16
- - [docs/memorix-record-v2.md](./docs/memorix-record-v2.md) — V2 contract
17
- - [docs/memorix-format.md](./docs/memorix-format.md) — present + pointers
18
- - Golden V2 examples: [examples/v2/](./examples/v2/)
18
+ ## API status
19
19
 
20
- ## Install
20
+ | API | Status |
21
+ |-----|--------|
22
+ | `validateMemorixRecordV2`, CLI `validate-v2` / `migrate-to-v2` | **Current** SoT for platform work |
23
+ | Present-envelope helpers | Migration / compat only |
21
24
 
22
- ```bash
23
- npm install @x12i/memorix-format
24
- ```
25
+ **Exports:** `.` · `./validate` · `./profiles` · `./types` · `./v2`
25
26
 
26
27
  ## Quick V2 example
27
28
 
@@ -54,12 +55,24 @@ npx memorix-format migrate-to-v2 ./present.json \
54
55
  --object-type=work-items --content-type=snapshots --data-category=entity
55
56
  ```
56
57
 
57
- ## Present envelope (migration)
58
+ ```ts
59
+ import { validateMemorixRecordV2 } from "@x12i/memorix-format/v2";
60
+
61
+ const result = validateMemorixRecordV2(doc);
62
+ if (!result.ok) throw new Error(result.errors.join("; "));
63
+ ```
64
+
65
+ ## Hard rules (format)
66
+
67
+ - V2 rejects **copied** related-record payloads in the document.
68
+ - Authoritative navigation between subjects is **four-field relationship links** (`@x12i/memorix-relationships`), not embedded `associated*`.
58
69
 
59
- Still documented for existing data. Open buckets: `analytics`, `enrichment`, `insights`, `associated*` (copied payloads — **rejected on V2**).
70
+ ## Docs
60
71
 
61
- ## Writer flag
72
+ - [`docs/memorix-record-v2.md`](./docs/memorix-record-v2.md) · [`meta/`](./meta/)
73
+ - Ebook: [Format for Dummies](../new-ebooks/01-format-for-dummies/)
74
+ - Hub: [https://ebooks.memorix.x12i.com](https://ebooks.memorix.x12i.com)
62
75
 
63
76
  ```bash
64
- MEMORIX_RECORD_FORMAT=v2
77
+ npm test
65
78
  ```
@@ -39,7 +39,7 @@ Object-type segments come from Catalox descriptors — not from this format pack
39
39
 
40
40
  - Associated properties are **arrays of plain objects** (linked payloads), never full envelopes.
41
41
  - On **memorix-record/2**, root `associated*` may hold **lightweight refs only** (Option A — format-valid): `relationshipDefinitionId` + `recordId`, optional `relationshipId`. Copied related business payload is rejected.
42
- - **Authoritative relationship storage (Gate G4)** is centralized per-category collections (Candidate C), not Option A roots or sibling `relationships` content. See `docs/re-factoring-and-ops-agent/RELATIONSHIP-STORAGE-DECISION.md`.
42
+ - **Authoritative relationship storage (Gate G4)** is centralized per-category collections (Candidate C), not Option A roots or sibling `relationships` content. See `@x12i/memorix-relationship-store` (archived decision: `.tmp/housekeeping-2026-07-23/docs/re-factoring-and-ops-agent/RELATIONSHIP-STORAGE-DECISION.md`).
43
43
 
44
44
  - **Omit** the property when empty — never write `[]`.
45
45
  - Prefer traceability in optional item-level `_system.association` (v2) rather than wrapping envelopes.
@@ -56,7 +56,7 @@ Every piece of business data lives in **exactly one** of these buckets (plus the
56
56
  | **`insights`** | AI / judgment outputs |
57
57
  | **`associated*`** | Copied related payloads (present only; removed in V2) |
58
58
 
59
- On **memorix-record/2**, snapshot buckets are optional and **omitted when empty**. Root `associated*` may hold **lightweight refs** only (Option A — still format-valid). **Authoritative relationship storage (Gate G4)** is centralized per-category collections (Candidate C); see `docs/re-factoring-and-ops-agent/RELATIONSHIP-STORAGE-DECISION.md`.
59
+ On **memorix-record/2**, snapshot buckets are optional and **omitted when empty**. Root `associated*` may hold **lightweight refs** only (Option A — still format-valid). **Authoritative relationship storage (Gate G4)** is centralized per-category collections (Candidate C); see `@x12i/memorix-relationship-store` (archived: `.tmp/housekeeping-2026-07-23/docs/re-factoring-and-ops-agent/RELATIONSHIP-STORAGE-DECISION.md`).
60
60
 
61
61
  ---
62
62
 
@@ -52,7 +52,7 @@ type MemorixRecordV2 = {
52
52
  3. **Composition** = same `recordId` across content types; not a relationship.
53
53
  4. **`_graphRuns` / `_jobTypeRuns` stay off the subject** — operational run ledger owns run history.
54
54
  5. **V2 rejects copied related-record payloads.** Root `associated*` may hold **lightweight relationship refs** only: required `relationshipDefinitionId` + `recordId`; optional `relationshipId` (derivable). Without `relationshipDefinitionId` the item is not a relationship. **Option A** (direct-record lightweight `associated*` roots) remains **format-valid** for validation and migration compatibility.
55
- 6. **Authoritative physical relationship storage is Gate G4 Candidate C** — org-prefixed per-category `relationships` collections (`entity` / `event` / `knowledge`). Option A lightweight roots and sibling `relationships` content are **not** the selected authoritative storage model; see `docs/re-factoring-and-ops-agent/RELATIONSHIP-STORAGE-DECISION.md`.
55
+ 6. **Authoritative physical relationship storage is Gate G4 Candidate C** — org-prefixed per-category `relationships` collections (`entity` / `event` / `knowledge`). Option A lightweight roots and sibling `relationships` content are **not** the selected authoritative storage model; see `@x12i/memorix-relationship-store` / `@x12i/memorix-relationships` (decision note archived under `.tmp/housekeeping-2026-07-23/docs/re-factoring-and-ops-agent/RELATIONSHIP-STORAGE-DECISION.md`).
56
56
  7. **Present format remains the writer/pipeline default** until cutover (`MEMORIX_RECORD_FORMAT=v2`). All **new** refactor packages and the `ops` harness use V2 exclusively. The env switch is transitional (`DEL-FORMAT-PRESENT-SOT`).
57
57
 
58
58
  ## Revision vs lifecycle
@@ -44,6 +44,6 @@ Optional `associatedPropertyMap: { associatedPeople: "people-assigned-to-work-it
44
44
 
45
45
  ## Gate G4 boundary
46
46
 
47
- **Authoritative physical relationship storage (Gate G4):** centralized org-prefixed per-category `relationships` collections (Candidate C). See `docs/re-factoring-and-ops-agent/RELATIONSHIP-STORAGE-DECISION.md`.
47
+ **Authoritative physical relationship storage (Gate G4):** centralized org-prefixed per-category `relationships` collections (Candidate C). See `@x12i/memorix-relationship-store` (archived decision: `.tmp/housekeeping-2026-07-23/docs/re-factoring-and-ops-agent/RELATIONSHIP-STORAGE-DECISION.md`).
48
48
 
49
49
  `migratePresentToV2` still extracts relationship candidates **out-of-band** and does not persist them onto the V2 record. Option A root `associated*` lightweight refs remain **format-valid** but are **not** the selected authoritative storage model.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@x12i/memorix-format",
3
- "version": "2.3.3",
3
+ "version": "3.0.1",
4
4
  "description": "Memorix format: present envelope + memorix-record/2 (Gate G2 SoT), validators, migrate CLIs.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",