@x12i/memorix-base-format
v1.2.1
Published
Memorix base record format: fixed skeleton (recordId, concept with _extIdentifier, data, _*), open buckets, ContentTypeMeta, validator, CLI.
Maintainers
Readme
@x12i/memorix-base-format
Source of truth for the fixed Memorix record envelope (present tense).
Product open-bucket names (associated*, analytics, enrichment, insights, …), object-type recipes, and Catalox descriptors are not defined here. Those live in @x12i/memorix-format and entity descriptors.
Envelope meta: meta/envelope.json (loaded via loadBaseEnvelopeMeta). Present-tense only — legacy roots belong in compat / memorix-format migrate, not envelope law.
Normative requirements: docs/memorix-base-format-requirements.md.
What base owns
| Category | Keys |
|---|---|
| Identity | recordId, concept |
| Core | data |
| Underscore | any _… root (machine-only; e.g. _system.state) |
| Open | everything else (names not reserved) |
Identity vs content
recordId— join plumbing across content types for the same subject. Not human/LLM content.concept.title— human-readable display name.concept._extIdentifier— machine identity object:kind, same-named value, and deterministickey(kind+ kind-value + other scalar fields in sorted order,:-joined). Howkind/ title are chosen for an object type is defined on the entity descriptor, not in this package._system.state— when present:active|archived|superseded. Writers SHOULD setactiveon new records.
What base does not own
- Product / Catalox object type names (
items,groups, …) - Known open-bucket vocabularies (
analytics,associated*, …) - Key+title recipes per object type
Install
npm install @x12i/memorix-base-formatAbstract example
{
"recordId": "rec-item-1",
"concept": {
"_extIdentifier": {
"kind": "sku",
"sku": "SKU-100",
"key": "sku:SKU-100"
},
"title": "Blue widget"
},
"data": { "sku": "SKU-100", "color": "blue" },
"_system": { "state": "active" }
}SDK
import {
validateMemorixBaseRecord,
classifyRootKey,
parseContentTypeMeta,
} from "@x12i/memorix-base-format";
const result = validateMemorixBaseRecord(record);
classifyRootKey("analytics"); // "open" — no special case
const meta = parseContentTypeMeta({
objectType: "items",
contentType: "snapshots",
openBuckets: {
analytics: { kind: "rollup", shape: "object" },
},
});
validateMemorixBaseRecord(record, { meta: meta.meta });CLI
npx memorix-base-format validate ./record.json
npx memorix-base-format validate ./records/ --meta=./meta.json --json
npx memorix-base-format inspect ./record.json
npx memorix-base-format docs memorix-base-format-requirements.mdRelated
- Product layer + migrate:
@x12i/memorix-format - ContentTypeMeta: docs/content-type-meta.md
