@x12i/memorix-format 2.2.2 → 2.3.2
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 +30 -0
- package/README.md +36 -86
- package/dist/base-reexport.d.ts +8 -0
- package/dist/base-reexport.d.ts.map +1 -0
- package/dist/base-reexport.js +8 -0
- package/dist/base-reexport.js.map +1 -0
- package/dist/cli.js +179 -15
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/v2/index.d.ts +7 -0
- package/dist/v2/index.d.ts.map +1 -0
- package/dist/v2/index.js +6 -0
- package/dist/v2/index.js.map +1 -0
- package/dist/v2/migrate-present.d.ts +47 -0
- package/dist/v2/migrate-present.d.ts.map +1 -0
- package/dist/v2/migrate-present.js +225 -0
- package/dist/v2/migrate-present.js.map +1 -0
- package/dist/v2/profiles.d.ts +9 -0
- package/dist/v2/profiles.d.ts.map +1 -0
- package/dist/v2/profiles.js +63 -0
- package/dist/v2/profiles.js.map +1 -0
- package/dist/v2/revision.d.ts +24 -0
- package/dist/v2/revision.d.ts.map +1 -0
- package/dist/v2/revision.js +44 -0
- package/dist/v2/revision.js.map +1 -0
- package/dist/v2/types.d.ts +94 -0
- package/dist/v2/types.d.ts.map +1 -0
- package/dist/v2/types.js +3 -0
- package/dist/v2/types.js.map +1 -0
- package/dist/v2/validate.d.ts +8 -0
- package/dist/v2/validate.d.ts.map +1 -0
- package/dist/v2/validate.js +225 -0
- package/dist/v2/validate.js.map +1 -0
- package/docs/association-format.md +26 -445
- package/docs/memorix-format.md +24 -186
- package/docs/memorix-record-v2.md +101 -0
- package/docs/memorix-workflow-format.md +13 -1
- package/docs/migrate-present-to-v2.md +49 -0
- package/examples/v2/activity-events-snapshots.json +31 -0
- package/examples/v2/employees-discovery.json +26 -0
- package/examples/v2/employees-snapshots.json +27 -0
- package/examples/v2/procedures-knowledge.json +27 -0
- package/examples/v2/work-items-analysis.json +26 -0
- package/examples/v2/work-items-context.json +32 -0
- package/examples/v2/work-items-decisions.json +26 -0
- package/examples/v2/work-items-raw.json +37 -0
- package/examples/v2/work-items-relationships-candidate.json +38 -0
- package/examples/v2/work-items-snapshots-lifecycle.json +31 -0
- package/examples/v2/work-items-snapshots-lightweight-refs.json +34 -0
- package/examples/v2/work-items-snapshots.json +28 -0
- package/examples/v2/work-items-workflow.json +28 -0
- package/package.json +7 -2
- package/docs/memorix-format-additions.md +0 -956
- package/docs/memorix-format-for-dummies-association-corrections.md +0 -113
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
# Corrections To Association Guidance In Memorix Format For Dummies
|
|
2
|
-
|
|
3
|
-
This document records required fixes to association guidance in `ebooks/memorix-format-for-dummies.pdf`. The PDF's **Chapter 5** (vulnerability discovery/decisions case file) teaches a **direct content join** model that is incorrect.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Core correction
|
|
8
|
-
|
|
9
|
-
Association is always **snapshot-first**, then **content by matched snapshot `recordId`**:
|
|
10
|
-
|
|
11
|
-
```text
|
|
12
|
-
source snapshot (join value from data / identifier / identity)
|
|
13
|
-
→ match target *-snapshots collection
|
|
14
|
-
→ take matched snapshot recordId
|
|
15
|
-
→ fetch discovery / analysis / decisions by record-id link field
|
|
16
|
-
→ copy flat content.data into associated<ObjectType><ContentType>
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
**Never** join a source snapshot directly to a non-snapshot collection by business keys such as `data.sku`.
|
|
20
|
-
|
|
21
|
-
---
|
|
22
|
-
|
|
23
|
-
## Chapter-by-chapter fixes
|
|
24
|
-
|
|
25
|
-
### Cover / Chapter 0 — Vulnerability patch framing
|
|
26
|
-
|
|
27
|
-
**Incorrect:** The vulnerability patch wires `findings-snapshots` directly to `findings-discovery` / `findings-decisions` by `data.sku`.
|
|
28
|
-
|
|
29
|
-
**Correct:** The patch enriches `findings-snapshots` using snapshot-mediated resolution: match snapshots first (including same-object `findings-snapshots`), then fetch discovery/decisions content linked to the matched snapshot `recordId`.
|
|
30
|
-
|
|
31
|
-
### Chapter 4 — Core association rules
|
|
32
|
-
|
|
33
|
-
**Add before naming and payload rules:**
|
|
34
|
-
|
|
35
|
-
> Record-to-record association always resolves through snapshots. Non-snapshot collections (`discovery`, `analysis`, `decisions`, …) are fetched only after a snapshot match yields a target `recordId`. Associated content is never the source of truth for the link.
|
|
36
|
-
|
|
37
|
-
### Chapter 5 — Vulnerability discovery/decisions case file (full rewrite)
|
|
38
|
-
|
|
39
|
-
Replace the direct-join walkthrough with:
|
|
40
|
-
|
|
41
|
-
1. Read source `findings-snapshots.data.sku`.
|
|
42
|
-
2. Match target `findings-snapshots` by snapshot paths such as `data.sku`, `concept._extIdentifier`, or `identity`.
|
|
43
|
-
3. Take matched target snapshot `recordId`.
|
|
44
|
-
4. Fetch `findings-discovery` / `findings-decisions` by a record-id link field such as `data.sourceRecordId`, `concept._extIdentifier.recordId`, or root `recordId`.
|
|
45
|
-
5. Copy flat `content.data` into `associatedVulnerabilitiesDiscovery` / `associatedVulnerabilitiesDecisions`.
|
|
46
|
-
|
|
47
|
-
Payload rules for this pilot:
|
|
48
|
-
|
|
49
|
-
- Flat copied `data` only
|
|
50
|
-
- No nested `data` wrapper
|
|
51
|
-
- No inline `recordId` on items
|
|
52
|
-
- No `_system.association` metadata
|
|
53
|
-
|
|
54
|
-
### Chapter 9 — Checklist and glossary
|
|
55
|
-
|
|
56
|
-
**Checklist additions:**
|
|
57
|
-
|
|
58
|
-
- [ ] Snapshot match collection is `*-snapshots`
|
|
59
|
-
- [ ] Content fetch uses `recordId` link paths, not business-key joins on content
|
|
60
|
-
- [ ] `_system.association.toProperty` refers to the snapshot match path
|
|
61
|
-
|
|
62
|
-
**Glossary correction:**
|
|
63
|
-
|
|
64
|
-
| Term | Incorrect PDF usage | Correct definition |
|
|
65
|
-
|------|---------------------|-------------------|
|
|
66
|
-
| Association key | Business field on content collection | Join path on source snapshot used to match target snapshots |
|
|
67
|
-
| Linked collection | Content collection joined directly | Snapshot match collection + optional content collection fetched by `recordId` |
|
|
68
|
-
|
|
69
|
-
---
|
|
70
|
-
|
|
71
|
-
## Replacement example (vulnerability discovery/decisions)
|
|
72
|
-
|
|
73
|
-
```markdown
|
|
74
|
-
1. Read source `findings-snapshots.data.sku`.
|
|
75
|
-
2. Match target `findings-snapshots` by snapshot paths such as `data.sku`, `concept._extIdentifier`, or `identity`.
|
|
76
|
-
3. Take matched target snapshot `recordId`.
|
|
77
|
-
4. Fetch `findings-discovery` / `findings-decisions` by a record-id link field such as `data.sourceRecordId`, `concept._extIdentifier.recordId`, or root `recordId`.
|
|
78
|
-
5. Copy flat `content.data` into `associatedVulnerabilitiesDiscovery` / `associatedVulnerabilitiesDecisions`.
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
---
|
|
82
|
-
|
|
83
|
-
## Incorrect vs correct
|
|
84
|
-
|
|
85
|
-
| Aspect | Incorrect (PDF Chapter 5) | Correct |
|
|
86
|
-
|--------|---------------------------|---------|
|
|
87
|
-
| Join path | `findings-snapshots.data.sku` → `findings-discovery.data.sku` | `findings-snapshots.data.sku` → `findings-snapshots` (snapshot match) → `recordId` → `findings-discovery` (by `concept._extIdentifier.recordId`) |
|
|
88
|
-
| Phase count | One-phase direct content join | Two-phase: snapshot match, then content fetch |
|
|
89
|
-
| Same-object rule | Exception allowing direct snapshot→content | Same-object still matches snapshots first |
|
|
90
|
-
| Bridge pattern | Implicit direct join | Explicit `match` + `content` in associator rules |
|
|
91
|
-
|
|
92
|
-
---
|
|
93
|
-
|
|
94
|
-
## Associator rule shape (reference)
|
|
95
|
-
|
|
96
|
-
```json
|
|
97
|
-
{
|
|
98
|
-
"sourceJoinPaths": ["data.sku"],
|
|
99
|
-
"match": {
|
|
100
|
-
"collection": "findings-snapshots",
|
|
101
|
-
"joinPaths": ["data.sku", "concept._extIdentifier.sku", "identity", "recordId"]
|
|
102
|
-
},
|
|
103
|
-
"content": {
|
|
104
|
-
"collection": "findings-discovery",
|
|
105
|
-
"contentType": "discovery",
|
|
106
|
-
"linkPaths": ["concept._extIdentifier.recordId", "data.sourceRecordId", "recordId"]
|
|
107
|
-
},
|
|
108
|
-
"associatedProperty": "associatedVulnerabilitiesDiscovery",
|
|
109
|
-
"payload": { "format": "v2", "source": "target.data", "includeRecordId": false }
|
|
110
|
-
}
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
See also: [memorix-pipeline/docs/association-format.md](../memorix-pipeline/docs/association-format.md)
|