@x12i/memorix-format 2.0.0 → 2.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.1.0
4
+
5
+ - Meta-metadata lives in packaged JSON under `meta/` (`open-buckets.json`, `content-types.json`, `associated-conventions.json`, `content-type-profiles.json`).
6
+ - Inventory of managed Catalox descriptors: `meta/inventory/managed-descriptors.json` (not format law).
7
+ - Profiles / known buckets / SCOPE buckets load from those JSON files instead of hardcoded lists.
8
+ - Requires `@x12i/memorix-base-format@^1.1.0` (base envelope meta JSON).
9
+
3
10
  ## 2.0.0
4
11
 
5
12
  Breaking relative to 1.0.0:
package/README.md CHANGED
@@ -8,6 +8,8 @@ Memorix **product** record format — profiles and conventions on top of
8
8
  | `@x12i/memorix-base-format` | Fixed skeleton: `recordId`, `concept`, `data`, `_…`; unnamed open buckets; ContentTypeMeta |
9
9
  | `@x12i/memorix-format` | Memorix open-bucket meanings, `associated*` rules, snapshot SCOPE, built-in profiles |
10
10
 
11
+ Product meta-metadata is packaged under [`meta/`](./meta/) (open buckets, content types, association conventions, profiles). Managed-descriptor inventory lives in `meta/inventory/` and is not format law.
12
+
11
13
  ## Install
12
14
 
13
15
  ```bash
@@ -1,23 +1,10 @@
1
1
  /**
2
- * Memorix product open-bucket helpers.
3
- * Base envelope rules live in @x12i/memorix-base-format — do not reimplement them here.
2
+ * Memorix product open-bucket helpers — conventions from meta/*.json.
3
+ * Base envelope rules live in @x12i/memorix-base-format.
4
4
  */
5
5
  export declare const LEGACY_ASSOCIATED_NAMES: Set<string>;
6
- export declare const KNOWN_OPEN_BUCKETS: {
7
- analytics: {
8
- kind: "rollup";
9
- shape: "object";
10
- };
11
- enrichment: {
12
- kind: "sourced";
13
- shape: "object";
14
- };
15
- insights: {
16
- kind: "interpretive";
17
- shape: "object";
18
- };
19
- };
20
- export declare const DEFAULT_TOP_ASSOCIATED_ITEMS = 5;
6
+ export declare const KNOWN_OPEN_BUCKETS: Record<string, import("@x12i/memorix-base-format").OpenBucketDecl>;
7
+ export declare const DEFAULT_TOP_ASSOCIATED_ITEMS: number;
21
8
  export declare function isAssociatedPropertyName(name: string): boolean;
22
9
  export declare function isLegacyAssociatedPropertyName(name: string): boolean;
23
10
  export declare function isEnrichmentAssociatedPropertyName(name: string): boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"associated.d.ts","sourceRoot":"","sources":["../src/associated.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,MAAM,uBAAuB,aAQlC,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;CAI9B,CAAC;AAEF,eAAO,MAAM,4BAA4B,IAAI,CAAC;AAE9C,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE9D;AAED,wBAAgB,8BAA8B,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEpE;AAED,wBAAgB,kCAAkC,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAExE;AAED,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEjE;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAM1D;AAED,MAAM,MAAM,2BAA2B,GACnC;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,OAAO,CAAA;CAAE,GAC3E;IAAE,IAAI,EAAE,uBAAuB,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,OAAO,CAAA;CAAE,GAC1F;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,OAAO,CAAA;CA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E,GAC1F;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,OAAO,CAAA;CAAE,GACzD;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,OAAO,CAAA;CAAE,GACvD;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAE7D,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,2BAA2B,GAAG,MAAM,CAmBtF;AAED,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,EAAE,CAElF"}
@@ -1,24 +1,14 @@
1
1
  /**
2
- * Memorix product open-bucket helpers.
3
- * Base envelope rules live in @x12i/memorix-base-format — do not reimplement them here.
2
+ * Memorix product open-bucket helpers — conventions from meta/*.json.
3
+ * Base envelope rules live in @x12i/memorix-base-format.
4
4
  */
5
- export const LEGACY_ASSOCIATED_NAMES = new Set([
6
- "associatedData",
7
- "associatedDiscovery",
8
- "associatedAnalysis",
9
- "associatedSiblings",
10
- "associatedChildren",
11
- "associatedAssets",
12
- "associatedSubnets",
13
- ]);
14
- export const KNOWN_OPEN_BUCKETS = {
15
- analytics: { kind: "rollup", shape: "object" },
16
- enrichment: { kind: "sourced", shape: "object" },
17
- insights: { kind: "interpretive", shape: "object" },
18
- };
19
- export const DEFAULT_TOP_ASSOCIATED_ITEMS = 5;
5
+ import { loadAssociatedConventionsMeta, knownOpenBucketsFromMeta, } from "./load-meta.js";
6
+ const associatedMeta = loadAssociatedConventionsMeta();
7
+ export const LEGACY_ASSOCIATED_NAMES = new Set(associatedMeta.legacyNames);
8
+ export const KNOWN_OPEN_BUCKETS = knownOpenBucketsFromMeta();
9
+ export const DEFAULT_TOP_ASSOCIATED_ITEMS = associatedMeta.defaultTopMaxItems;
20
10
  export function isAssociatedPropertyName(name) {
21
- return name.startsWith("associated");
11
+ return name.startsWith(associatedMeta.prefix);
22
12
  }
23
13
  export function isLegacyAssociatedPropertyName(name) {
24
14
  return LEGACY_ASSOCIATED_NAMES.has(name);
@@ -1 +1 @@
1
- {"version":3,"file":"associated.js","sourceRoot":"","sources":["../src/associated.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,GAAG,CAAC;IAC7C,gBAAgB;IAChB,qBAAqB;IACrB,oBAAoB;IACpB,oBAAoB;IACpB,oBAAoB;IACpB,kBAAkB;IAClB,mBAAmB;CACpB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,SAAS,EAAE,EAAE,IAAI,EAAE,QAAiB,EAAE,KAAK,EAAE,QAAiB,EAAE;IAChE,UAAU,EAAE,EAAE,IAAI,EAAE,SAAkB,EAAE,KAAK,EAAE,QAAiB,EAAE;IAClE,QAAQ,EAAE,EAAE,IAAI,EAAE,cAAuB,EAAE,KAAK,EAAE,QAAiB,EAAE;CACtE,CAAC;AAEF,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC;AAE9C,MAAM,UAAU,wBAAwB,CAAC,IAAY;IACnD,OAAO,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;AACvC,CAAC;AAED,MAAM,UAAU,8BAA8B,CAAC,IAAY;IACzD,OAAO,uBAAuB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAC3C,CAAC;AAED,MAAM,UAAU,kCAAkC,CAAC,IAAY;IAC7D,OAAO,iDAAiD,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACtE,CAAC;AAED,MAAM,UAAU,2BAA2B,CAAC,IAAY;IACtD,OAAO,IAAI,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC;AAC1C,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,KAAa;IA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BAA2B,CAAC,KAAkC;IAC5E,MAAM,aAAa,GAAG,oBAAoB,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IAC7D,MAAM,SAAS,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;IACzC,QAAQ,KAAK,CAAC,IAAI,EAAE,CAAC;QACnB,KAAK,SAAS;YACZ,OAAO,aAAa,SAAS,GAAG,aAAa,GAAG,oBAAoB,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE,CAAC;QAC5F,KAAK,uBAAuB;YAC1B,OAAO,aAAa,SAAS,GAAG,aAAa,YAAY,oBAAoB,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE,CAAC;QACtG,KAAK,YAAY;YACf,OAAO,aAAa,SAAS,GAAG,aAAa,YAAY,CAAC;QAC5D,KAAK,UAAU;YACb,OAAO,aAAa,SAAS,GAAG,aAAa,UAAU,CAAC;QAC1D,KAAK,WAAW;YACd,OAAO,aAAa,SAAS,GAAG,aAAa,WAAW,CAAC;QAC3D,OAAO,CAAC,CAAC,CAAC;YACR,MAAM,EAAE,GAAU,KAAK,CAAC;YACxB,MAAM,IAAI,KAAK,CAAC,sBAAsB,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;QAC9D,CAAC;IACH,CAAC;AACH,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,MAA+B;IACtE,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,wBAAwB,CAAC,CAAC,IAAI,EAAE,CAAC;AACrE,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,7 +1,8 @@
1
1
  export type { ContentTypeMeta, JsonObject, MemorixBaseRecord, MemorixConcept, MemorixConceptIdentifier, MemorixLifecycleEvent, MemorixRecord, MemorixSystemBlock, OpenBucketDecl, OpenBucketKind, RecordInspection, RootCategory, ValidateBaseOptions, ValidateBaseResult, ValidateMemorixOptions, ValidationIssue, ValidationSeverity, MemorixProfileName, AssociatedPropertyNameInput, } from "./types.js";
2
- export { classifyRootKey, isOpenBucketKey, isSystemRootKey, validateMemorixBaseRecord, validateMemorixBaseRecords, parseContentTypeMeta, parseRecordsJson, inspectMemorixBaseRecord, buildConceptIdentifier, buildIdentityString, readConceptIdentifier, readConceptTitle, readRecordId, isPlainObject, stringifyId, RECORD_ID_FIELD, CONCEPT_FIELD, DATA_FIELD, SYSTEM_FIELD, IDENTITY_ROOT_KEYS, CORE_ROOT_KEYS, LEGACY_ROOT_KEYS, OPEN_BUCKET_KINDS, } from "@x12i/memorix-base-format";
2
+ export { classifyRootKey, isOpenBucketKey, isSystemRootKey, validateMemorixBaseRecord, validateMemorixBaseRecords, parseContentTypeMeta, parseRecordsJson, inspectMemorixBaseRecord, buildConceptIdentifier, buildIdentityString, readConceptIdentifier, readConceptTitle, readRecordId, isPlainObject, stringifyId, loadBaseEnvelopeMeta, clearBaseEnvelopeMetaCache, RECORD_ID_FIELD, CONCEPT_FIELD, DATA_FIELD, SYSTEM_FIELD, IDENTITY_ROOT_KEYS, CORE_ROOT_KEYS, LEGACY_ROOT_KEYS, OPEN_BUCKET_KINDS, BASE_ENVELOPE_META_VERSION, } from "@x12i/memorix-base-format";
3
3
  export { inspectMemorixBaseRecord as inspectMemorixRecord } from "@x12i/memorix-base-format";
4
4
  export { buildAssociatedPropertyName, isAssociatedPropertyName, isEnrichmentAssociatedPropertyName, isLegacyAssociatedPropertyName, isTopAssociatedPropertyName, listAssociatedProperties, DEFAULT_TOP_ASSOCIATED_ITEMS, KNOWN_OPEN_BUCKETS, LEGACY_ASSOCIATED_NAMES, pascalCaseObjectType, } from "./associated.js";
5
5
  export { BUILTIN_PROFILES, minimalContentTypeMeta, resolveMemorixProfile, snapshotsContentTypeMeta, } from "./profiles.js";
6
+ export { loadAssociatedConventionsMeta, loadContentTypeProfilesMeta, loadContentTypesMeta, loadManagedInventoryMeta, loadOpenBucketsMeta, clearMemorixFormatMetaCache, knownOpenBucketsFromMeta, } from "./load-meta.js";
6
7
  export { validateMemorixRecord, validateMemorixRecords } from "./validate.js";
7
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,eAAe,EACf,UAAU,EACV,iBAAiB,EACjB,cAAc,EACd,wBAAwB,EACxB,qBAAqB,EACrB,aAAa,EACb,kBAAkB,EAClB,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,YAAY,EACZ,mBAAmB,EACnB,kBAAkB,EAClB,sBAAsB,EACtB,eAAe,EACf,kBAAkB,EAClB,kBAAkB,EAClB,2BAA2B,GAC5B,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,eAAe,EACf,eAAe,EACf,eAAe,EACf,yBAAyB,EACzB,0BAA0B,EAC1B,oBAAoB,EACpB,gBAAgB,EAChB,wBAAwB,EACxB,sBAAsB,EACtB,mBAAmB,EACnB,qBAAqB,EACrB,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACb,WAAW,EACX,eAAe,EACf,aAAa,EACb,UAAU,EACV,YAAY,EACZ,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,wBAAwB,IAAI,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAE7F,OAAO,EACL,2BAA2B,EAC3B,wBAAwB,EACxB,kCAAkC,EAClC,8BAA8B,EAC9B,2BAA2B,EAC3B,wBAAwB,EACxB,4BAA4B,EAC5B,kBAAkB,EAClB,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACtB,qBAAqB,EACrB,wBAAwB,GACzB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,eAAe,EACf,UAAU,EACV,iBAAiB,EACjB,cAAc,EACd,wBAAwB,EACxB,qBAAqB,EACrB,aAAa,EACb,kBAAkB,EAClB,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,YAAY,EACZ,mBAAmB,EACnB,kBAAkB,EAClB,sBAAsB,EACtB,eAAe,EACf,kBAAkB,EAClB,kBAAkB,EAClB,2BAA2B,GAC5B,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,eAAe,EACf,eAAe,EACf,eAAe,EACf,yBAAyB,EACzB,0BAA0B,EAC1B,oBAAoB,EACpB,gBAAgB,EAChB,wBAAwB,EACxB,sBAAsB,EACtB,mBAAmB,EACnB,qBAAqB,EACrB,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACb,WAAW,EACX,oBAAoB,EACpB,0BAA0B,EAC1B,eAAe,EACf,aAAa,EACb,UAAU,EACV,YAAY,EACZ,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,0BAA0B,GAC3B,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,wBAAwB,IAAI,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAE7F,OAAO,EACL,2BAA2B,EAC3B,wBAAwB,EACxB,kCAAkC,EAClC,8BAA8B,EAC9B,2BAA2B,EAC3B,wBAAwB,EACxB,4BAA4B,EAC5B,kBAAkB,EAClB,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACtB,qBAAqB,EACrB,wBAAwB,GACzB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,6BAA6B,EAC7B,2BAA2B,EAC3B,oBAAoB,EACpB,wBAAwB,EACxB,mBAAmB,EACnB,2BAA2B,EAC3B,wBAAwB,GACzB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC"}
package/dist/index.js CHANGED
@@ -1,7 +1,8 @@
1
1
  // Base envelope (re-exported — source of truth is @x12i/memorix-base-format)
2
- export { classifyRootKey, isOpenBucketKey, isSystemRootKey, validateMemorixBaseRecord, validateMemorixBaseRecords, parseContentTypeMeta, parseRecordsJson, inspectMemorixBaseRecord, buildConceptIdentifier, buildIdentityString, readConceptIdentifier, readConceptTitle, readRecordId, isPlainObject, stringifyId, RECORD_ID_FIELD, CONCEPT_FIELD, DATA_FIELD, SYSTEM_FIELD, IDENTITY_ROOT_KEYS, CORE_ROOT_KEYS, LEGACY_ROOT_KEYS, OPEN_BUCKET_KINDS, } from "@x12i/memorix-base-format";
2
+ export { classifyRootKey, isOpenBucketKey, isSystemRootKey, validateMemorixBaseRecord, validateMemorixBaseRecords, parseContentTypeMeta, parseRecordsJson, inspectMemorixBaseRecord, buildConceptIdentifier, buildIdentityString, readConceptIdentifier, readConceptTitle, readRecordId, isPlainObject, stringifyId, loadBaseEnvelopeMeta, clearBaseEnvelopeMetaCache, RECORD_ID_FIELD, CONCEPT_FIELD, DATA_FIELD, SYSTEM_FIELD, IDENTITY_ROOT_KEYS, CORE_ROOT_KEYS, LEGACY_ROOT_KEYS, OPEN_BUCKET_KINDS, BASE_ENVELOPE_META_VERSION, } from "@x12i/memorix-base-format";
3
3
  export { inspectMemorixBaseRecord as inspectMemorixRecord } from "@x12i/memorix-base-format";
4
4
  export { buildAssociatedPropertyName, isAssociatedPropertyName, isEnrichmentAssociatedPropertyName, isLegacyAssociatedPropertyName, isTopAssociatedPropertyName, listAssociatedProperties, DEFAULT_TOP_ASSOCIATED_ITEMS, KNOWN_OPEN_BUCKETS, LEGACY_ASSOCIATED_NAMES, pascalCaseObjectType, } from "./associated.js";
5
5
  export { BUILTIN_PROFILES, minimalContentTypeMeta, resolveMemorixProfile, snapshotsContentTypeMeta, } from "./profiles.js";
6
+ export { loadAssociatedConventionsMeta, loadContentTypeProfilesMeta, loadContentTypesMeta, loadManagedInventoryMeta, loadOpenBucketsMeta, clearMemorixFormatMetaCache, knownOpenBucketsFromMeta, } from "./load-meta.js";
6
7
  export { validateMemorixRecord, validateMemorixRecords } from "./validate.js";
7
8
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAsBA,6EAA6E;AAC7E,OAAO,EACL,eAAe,EACf,eAAe,EACf,eAAe,EACf,yBAAyB,EACzB,0BAA0B,EAC1B,oBAAoB,EACpB,gBAAgB,EAChB,wBAAwB,EACxB,sBAAsB,EACtB,mBAAmB,EACnB,qBAAqB,EACrB,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACb,WAAW,EACX,eAAe,EACf,aAAa,EACb,UAAU,EACV,YAAY,EACZ,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,wBAAwB,IAAI,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAE7F,OAAO,EACL,2BAA2B,EAC3B,wBAAwB,EACxB,kCAAkC,EAClC,8BAA8B,EAC9B,2BAA2B,EAC3B,wBAAwB,EACxB,4BAA4B,EAC5B,kBAAkB,EAClB,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACtB,qBAAqB,EACrB,wBAAwB,GACzB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAsBA,6EAA6E;AAC7E,OAAO,EACL,eAAe,EACf,eAAe,EACf,eAAe,EACf,yBAAyB,EACzB,0BAA0B,EAC1B,oBAAoB,EACpB,gBAAgB,EAChB,wBAAwB,EACxB,sBAAsB,EACtB,mBAAmB,EACnB,qBAAqB,EACrB,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACb,WAAW,EACX,oBAAoB,EACpB,0BAA0B,EAC1B,eAAe,EACf,aAAa,EACb,UAAU,EACV,YAAY,EACZ,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,0BAA0B,GAC3B,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,wBAAwB,IAAI,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAE7F,OAAO,EACL,2BAA2B,EAC3B,wBAAwB,EACxB,kCAAkC,EAClC,8BAA8B,EAC9B,2BAA2B,EAC3B,wBAAwB,EACxB,4BAA4B,EAC5B,kBAAkB,EAClB,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACtB,qBAAqB,EACrB,wBAAwB,GACzB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,6BAA6B,EAC7B,2BAA2B,EAC3B,oBAAoB,EACpB,wBAAwB,EACxB,mBAAmB,EACnB,2BAA2B,EAC3B,wBAAwB,GACzB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC"}
@@ -0,0 +1,56 @@
1
+ import type { ContentTypeMeta, OpenBucketDecl } from "@x12i/memorix-base-format";
2
+ export type OpenBucketsMeta = {
3
+ version: string;
4
+ openBuckets: Record<string, OpenBucketDecl & {
5
+ title?: string;
6
+ description?: string;
7
+ }>;
8
+ };
9
+ export type AssociatedConventionsMeta = {
10
+ version: string;
11
+ prefix: string;
12
+ defaultTopMaxItems: number;
13
+ legacyNames: string[];
14
+ namingForms: Array<{
15
+ form: string;
16
+ pattern: string;
17
+ }>;
18
+ };
19
+ export type ContentTypesMeta = {
20
+ version: string;
21
+ canonicalContentType: string;
22
+ contentTypes: Record<string, {
23
+ profile: string;
24
+ description?: string;
25
+ }>;
26
+ };
27
+ export type ContentTypeProfilesMeta = {
28
+ version: string;
29
+ profiles: Record<string, {
30
+ contentType?: string;
31
+ collectionPostfix?: string;
32
+ openBucketsRef?: string;
33
+ policy?: ContentTypeMeta["policy"];
34
+ read?: ContentTypeMeta["read"];
35
+ }>;
36
+ };
37
+ export type ManagedInventoryMeta = {
38
+ version: string;
39
+ managedObjectTypes: string[];
40
+ contentTypesObserved: string[];
41
+ associatedPropertiesObserved: string[];
42
+ customRootPropertiesObserved: Array<{
43
+ name: string;
44
+ kind: string;
45
+ shape: string;
46
+ }>;
47
+ };
48
+ export declare function loadOpenBucketsMeta(): OpenBucketsMeta;
49
+ export declare function loadAssociatedConventionsMeta(): AssociatedConventionsMeta;
50
+ export declare function loadContentTypesMeta(): ContentTypesMeta;
51
+ export declare function loadContentTypeProfilesMeta(): ContentTypeProfilesMeta;
52
+ export declare function loadManagedInventoryMeta(): ManagedInventoryMeta;
53
+ export declare function clearMemorixFormatMetaCache(): void;
54
+ /** Known product open buckets from meta/open-buckets.json. */
55
+ export declare function knownOpenBucketsFromMeta(): Record<string, OpenBucketDecl>;
56
+ //# sourceMappingURL=load-meta.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"load-meta.d.ts","sourceRoot":"","sources":["../src/load-meta.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AA8BjF,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,GAAG;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACxF,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,kBAAkB,EAAE,M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BAA2B,IAAI,uBAAuB,CAKrE;AAED,wBAAgB,wBAAwB,IAAI,oBAAoB,CAK/D;AAED,wBAAgB,2BAA2B,IAAI,IAAI,CAMlD;AAED,8DAA8D;AAC9D,wBAAgB,wBAAwB,IAAI,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAazE"}
@@ -0,0 +1,94 @@
1
+ import { readFileSync } from "node:fs";
2
+ import { dirname, join } from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+ import { createRequire } from "node:module";
5
+ const __dirname = dirname(fileURLToPath(import.meta.url));
6
+ const require = createRequire(import.meta.url);
7
+ function metaDir() {
8
+ const candidates = [
9
+ join(__dirname, "..", "meta"),
10
+ join(__dirname, "meta"),
11
+ ];
12
+ for (const dir of candidates) {
13
+ try {
14
+ readFileSync(join(dir, "open-buckets.json"));
15
+ return dir;
16
+ }
17
+ catch {
18
+ /* next */
19
+ }
20
+ }
21
+ try {
22
+ const pkg = require.resolve("@x12i/memorix-format/package.json");
23
+ return join(dirname(pkg), "meta");
24
+ }
25
+ catch {
26
+ return candidates[0];
27
+ }
28
+ }
29
+ function readJson(name) {
30
+ return JSON.parse(readFileSync(join(metaDir(), name), "utf8"));
31
+ }
32
+ let openBucketsCache;
33
+ let associatedCache;
34
+ let contentTypesCache;
35
+ let profilesCache;
36
+ let inventoryCache;
37
+ export function loadOpenBucketsMeta() {
38
+ if (openBucketsCache)
39
+ return openBucketsCache;
40
+ const loaded = readJson("open-buckets.json");
41
+ openBucketsCache = loaded;
42
+ return loaded;
43
+ }
44
+ export function loadAssociatedConventionsMeta() {
45
+ if (associatedCache)
46
+ return associatedCache;
47
+ const loaded = readJson("associated-conventions.json");
48
+ associatedCache = loaded;
49
+ return loaded;
50
+ }
51
+ export function loadContentTypesMeta() {
52
+ if (contentTypesCache)
53
+ return contentTypesCache;
54
+ const loaded = readJson("content-types.json");
55
+ contentTypesCache = loaded;
56
+ return loaded;
57
+ }
58
+ export function loadContentTypeProfilesMeta() {
59
+ if (profilesCache)
60
+ return profilesCache;
61
+ const loaded = readJson("content-type-profiles.json");
62
+ profilesCache = loaded;
63
+ return loaded;
64
+ }
65
+ export function loadManagedInventoryMeta() {
66
+ if (inventoryCache)
67
+ return inventoryCache;
68
+ const loaded = readJson(join("inventory", "managed-descriptors.json"));
69
+ inventoryCache = loaded;
70
+ return loaded;
71
+ }
72
+ export function clearMemorixFormatMetaCache() {
73
+ openBucketsCache = undefined;
74
+ associatedCache = undefined;
75
+ contentTypesCache = undefined;
76
+ profilesCache = undefined;
77
+ inventoryCache = undefined;
78
+ }
79
+ /** Known product open buckets from meta/open-buckets.json. */
80
+ export function knownOpenBucketsFromMeta() {
81
+ const meta = loadOpenBucketsMeta();
82
+ const out = {};
83
+ for (const [name, decl] of Object.entries(meta.openBuckets)) {
84
+ out[name] = {
85
+ kind: decl.kind,
86
+ shape: decl.shape,
87
+ required: decl.required,
88
+ title: decl.title,
89
+ description: decl.description,
90
+ };
91
+ }
92
+ return out;
93
+ }
94
+ //# sourceMappingURL=load-meta.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"load-meta.js","sourceRoot":"","sources":["../src/load-meta.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAG5C,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAC1D,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAE/C,SAAS,OAAO;IACd,MAAM,UAAU,GAAG;QACjB,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,MAAM,CAAC;QAC7B,IAAI,CAAC,SAAS,E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AAW;SAC9B,CAAC;IACJ,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -1,12 +1,15 @@
1
1
  import type { ContentTypeMeta } from "@x12i/memorix-base-format";
2
- /** Minimal content type — identity + data only (no declared open buckets). */
3
- export declare function minimalContentTypeMeta(objectType: string, contentType: string): ContentTypeMeta;
2
+ export type MemorixProfileName = "snapshots" | "minimal";
4
3
  /**
5
- * Snapshot-style Memorix profile: known open buckets + allow extra association keys.
6
- * Association property names are still open buckets to base; profile validates shapes in validate.ts.
4
+ * Snapshot content-type conventions from meta/content-type-profiles.json + open-buckets.json.
5
+ * `objectType` is supplied by the caller (descriptor / catalog / write context).
7
6
  */
8
7
  export declare function snapshotsContentTypeMeta(objectType: string): ContentTypeMeta;
9
- export type MemorixProfileName = "snapshots" | "minimal";
10
- export declare function resolveMemorixProfile(name: MemorixProfileName, objectType?: string): ContentTypeMeta;
8
+ /** Minimal content type — identity + data only. */
9
+ export declare function minimalContentTypeMeta(objectType: string, contentType: string): ContentTypeMeta;
10
+ /**
11
+ * Resolve profile by name, or by content-type vocabulary (meta/content-types.json).
12
+ */
13
+ export declare function resolveMemorixProfile(name: MemorixProfileName | string, objectType?: string): ContentTypeMeta;
11
14
  export declare const BUILTIN_PROFILES: MemorixProfileName[];
12
15
  //# sourceMappingURL=profiles.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"profiles.d.ts","sourceRoot":"","sources":["../src/profiles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAGjE,8EAA8E;AAC9E,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,GAClB,eAAe,CAQjB;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,UAAU,EAAE,MAAM,GAAG,eAAe,CA6B5E;AAED,MAAM,MAAM,kBAAkB,GAAG,WAAW,GAAG,SAAS,CAAC;AAEzD,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,kBAAkB,EACxB,UAAU,SAAY,GACrB,eAAe,CAGjB;AAED,eAAO,MAAM,gBAAgB,EAAE,kBAAkB,EAA6B,CAAC"}
1
+ {"version":3,"file":"profiles.d.ts","sourceRoot":"","sources":["../src/profiles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAOjE,MAAM,MAAM,kBAAkB,GAAG,WAAW,GAAG,SAAS,CAAC;AAEzD;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,UAAU,EAAE,MAAM,GAAG,eAAe,CAW5E;AAED,mDAAmD;AACnD,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,GAClB,eAAe,CASjB;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,kBAAkB,GAAG,MAAM,EACjC,UAAU,SAAY,GACrB,eAAe,CAWjB;AAED,eAAO,MAAM,gBAAgB,EAAE,kBAAkB,EAA6B,CAAC"}
package/dist/profiles.js CHANGED
@@ -1,52 +1,47 @@
1
- import { KNOWN_OPEN_BUCKETS } from "./associated.js";
2
- /** Minimal content type — identity + data only (no declared open buckets). */
1
+ import { knownOpenBucketsFromMeta, loadContentTypeProfilesMeta, loadContentTypesMeta, } from "./load-meta.js";
2
+ /**
3
+ * Snapshot content-type conventions from meta/content-type-profiles.json + open-buckets.json.
4
+ * `objectType` is supplied by the caller (descriptor / catalog / write context).
5
+ */
6
+ export function snapshotsContentTypeMeta(objectType) {
7
+ const profiles = loadContentTypeProfilesMeta().profiles.snapshots;
8
+ const openBuckets = knownOpenBucketsFromMeta();
9
+ return {
10
+ objectType,
11
+ contentType: profiles?.contentType ?? "snapshots",
12
+ collectionPostfix: profiles?.collectionPostfix ?? "snapshots",
13
+ openBuckets,
14
+ policy: profiles?.policy ?? { unknownOpenBuckets: "allow", emptyBuckets: "reject" },
15
+ read: profiles?.read ?? { missingOptionalIsNa: true },
16
+ };
17
+ }
18
+ /** Minimal content type — identity + data only. */
3
19
  export function minimalContentTypeMeta(objectType, contentType) {
20
+ const profiles = loadContentTypeProfilesMeta().profiles.minimal;
4
21
  return {
5
22
  objectType,
6
23
  contentType,
7
24
  collectionPostfix: contentType,
8
- policy: { unknownOpenBuckets: "warn", emptyBuckets: "reject" },
9
- read: { missingOptionalIsNa: true },
25
+ policy: profiles?.policy ?? { unknownOpenBuckets: "warn", emptyBuckets: "reject" },
26
+ read: profiles?.read ?? { missingOptionalIsNa: true },
10
27
  };
11
28
  }
12
29
  /**
13
- * Snapshot-style Memorix profile: known open buckets + allow extra association keys.
14
- * Association property names are still open buckets to base; profile validates shapes in validate.ts.
30
+ * Resolve profile by name, or by content-type vocabulary (meta/content-types.json).
15
31
  */
16
- export function snapshotsContentTypeMeta(objectType) {
17
- return {
18
- objectType,
19
- contentType: "snapshots",
20
- collectionPostfix: "snapshots",
21
- openBuckets: {
22
- analytics: {
23
- ...KNOWN_OPEN_BUCKETS.analytics,
24
- title: "Analytics",
25
- description: "Numeric rollups about linked lists",
26
- },
27
- enrichment: {
28
- ...KNOWN_OPEN_BUCKETS.enrichment,
29
- title: "Enrichment",
30
- description: "External / prior-system sourced values",
31
- },
32
- insights: {
33
- ...KNOWN_OPEN_BUCKETS.insights,
34
- title: "Insights",
35
- description: "Interpreted judgments and recommendations",
36
- },
37
- },
38
- policy: {
39
- // Allow associated* and other custom open buckets without listing every name
40
- unknownOpenBuckets: "allow",
41
- emptyBuckets: "reject",
42
- },
43
- read: { missingOptionalIsNa: true },
44
- };
45
- }
46
32
  export function resolveMemorixProfile(name, objectType = "generic") {
47
33
  if (name === "snapshots")
48
34
  return snapshotsContentTypeMeta(objectType);
49
- return minimalContentTypeMeta(objectType, name === "minimal" ? "events" : name);
35
+ if (name === "minimal")
36
+ return minimalContentTypeMeta(objectType, "events");
37
+ const ctMeta = loadContentTypesMeta().contentTypes[name];
38
+ if (ctMeta?.profile === "snapshots")
39
+ return snapshotsContentTypeMeta(objectType);
40
+ if (ctMeta?.profile === "workflow") {
41
+ // Workflow uses a separate document format; treat as minimal for envelope checks.
42
+ return minimalContentTypeMeta(objectType, "workflow");
43
+ }
44
+ return minimalContentTypeMeta(objectType, name);
50
45
  }
51
46
  export const BUILTIN_PROFILES = ["snapshots", "minimal"];
52
47
  //# sourceMappingURL=profiles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"profiles.js","sourceRoot":"","sources":["../src/profiles.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAErD,8EAA8E;AAC9E,MAAM,UAAU,sBAAsB,CACpC,UAAkB,EAClB,WAAmB;IAEnB,OAAO;QACL,UAAU;QACV,WAAW;QACX,iBAAiB,EAAE,WAAW;QAC9B,MAAM,EAAE,EAAE,kBAAkB,EAAE,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE;QAC9D,IAAI,EAAE,EAAE,mBAAmB,EAAE,IAAI,EAAE;KACpC,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,wBAAwB,CAAC,UAAkB;IACzD,OAAO;QACL,UAAU;QACV,WAAW,EAAE,WAAW;QACxB,iBAAiB,EAAE,WAAW;QAC9B,WAAW,EAAE;YACX,SAAS,EAAE;gBACT,GAAG,kBAAkB,CAAC,SAAS;gBAC/B,KAAK,EAAE,WAAW;gBAClB,WAAW,EAAE,oCAAoC;aAClD;YACD,UAAU,EAAE;gBACV,GAAG,kBAAkB,CAAC,UAAU;gBAChC,KAAK,EAAE,YAAY;gBACnB,WAAW,EAAE,wCAAwC;aACtD;YACD,QAAQ,EAAE;gBACR,GAAG,kBAAkB,CAAC,QAAQ;gBAC9B,KAAK,EAAE,UAAU;gBACjB,WAAW,EAAE,2CAA2C;aACzD;SACF;QACD,MAAM,EAAE;YACN,6EAA6E;YAC7E,kBAAkB,EAAE,OAAO;YAC3B,YAAY,EAAE,QAAQ;SACvB;QACD,IAAI,EAAE,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B,0DAA0D;IAC1D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAeF;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,OAAO,EACd,OAAO,GAAE,sBAA2B,GACnC,kBAAkB,CA0EpB;AAED,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,OAAO,EAAE,EAClB,OAAO,GAAE,sBAA2B,GACnC;IAAE,EAAE,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,kBAAkB,EAAE,CAAA;CAAE,CAGhD"}
1
+ {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../src/validate.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EAExB,MAAM,2BAA2B,CAAC;AAMnC,OAAO,EAAyB,KAAK,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAE/E,MAAM,MAAM,sBAAsB,GAAG,mBAAmB,GAAG;IACzD,gDAAgD;IAChD,OAAO,CAAC,EAAE,kBAAkB,CAAC;IAC7B,0DAA0D;IAC1D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAeF;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,OAAO,EACd,OAAO,GAAE,sBAA2B,GACnC,kBAAkB,CA0EpB;AAED,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,OAAO,EAAE,EAClB,OAAO,GAAE,sBAA2B,GACnC;IAAE,EAAE,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,kBAAkB,EAAE,CAAA;CAAE,CAGhD"}
package/dist/validate.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { validateMemorixBaseRecord, } from "@x12i/memorix-base-format";
2
- import { isAssociatedPropertyName, isLegacyAssociatedPropertyName, } from "./associated.js";
2
+ import { isAssociatedPropertyName, isLegacyAssociatedPropertyName, KNOWN_OPEN_BUCKETS, } from "./associated.js";
3
3
  import { resolveMemorixProfile } from "./profiles.js";
4
4
  function issue(path, code, message, severity = "error") {
5
5
  return { path, code, message, severity };
@@ -52,7 +52,7 @@ export function validateMemorixRecord(input, options = {}) {
52
52
  }
53
53
  }
54
54
  if (!isSnapshot) {
55
- for (const bucket of ["analytics", "enrichment", "insights"]) {
55
+ for (const bucket of Object.keys(KNOWN_OPEN_BUCKETS)) {
56
56
  if (input[bucket] !== undefined) {
57
57
  issues.push(issue(bucket, "SCOPE-2", `${bucket} SHOULD be omitted on non-snapshot content types unless opted in`));
58
58
  }
@@ -1 +1 @@
1
- {"version":3,"file":"validate.js","sourceRoot":"","sources":["../src/validate.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,GAI1B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,wBAAwB,EACxB,8BAA8B,GAC/B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,qBAAqB,EAA2B,MAAM,eAAe,CAAC;AAc/E,SAAS,KAAK,CACZ,IAAY,EACZ,IAAY,EACZ,OAAe,EACf,WAAwC,OAAO;IAE/C,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;AAC3C,CAAC;AAED,SAAS,aAAa,CAAC,CAAU;IAC/B,OAAO,CAAC,KAAK,IAAI,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AAClE,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,qBAAqB,CACnC,KAAc,EACd,UAAkC,EAAE;IAEpC,MAAM,IAAI,GACR,OAAO,CAAC,IAAI;QACZ,CAAC,OAAO,CAAC,OAAO;YACd,CAAC,CAAC,qBAAqB,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,UAAU,IAAI,SAAS,CAAC;YACzE,CAAC,CAAC,SAAS,CA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AQ,EAAE,CAAC;AACjD,CAAC;AAED,MAAM,UAAU,sBAAsB,CACpC,OAAkB,EAClB,UAAkC,EAAE;IAEpC,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,qBAAqB,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;IACtE,OAAO,EAAE,EAAE,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC;AACrD,CAAC"}
@@ -0,0 +1,59 @@
1
+ {
2
+ "$schemaNote": "Associated* naming conventions + legacy short names. No objectType bindings.",
3
+ "version": "2.1.0",
4
+ "prefix": "associated",
5
+ "defaultTopMaxItems": 5,
6
+ "legacyNames": [
7
+ "associatedData",
8
+ "associatedDiscovery",
9
+ "associatedAnalysis",
10
+ "associatedSiblings",
11
+ "associatedChildren",
12
+ "associatedAssets",
13
+ "associatedSubnets"
14
+ ],
15
+ "namingForms": [
16
+ {
17
+ "form": "content",
18
+ "pattern": "associated[Top?]<ObjectType><ContentType>",
19
+ "kind": "linked-payloads",
20
+ "shape": "array-of-objects"
21
+ },
22
+ {
23
+ "form": "enrichment",
24
+ "pattern": "associated[Top?]<ObjectType>Enrichment",
25
+ "kind": "linked-payloads",
26
+ "shape": "array-of-objects"
27
+ },
28
+ {
29
+ "form": "snapshotsRootProperty",
30
+ "pattern": "associated[Top?]<ObjectType>Snapshots<RootProperty>",
31
+ "kind": "linked-payloads",
32
+ "shape": "array-of-objects"
33
+ },
34
+ {
35
+ "form": "concepts",
36
+ "pattern": "associated[Top?]<ObjectType>Concepts",
37
+ "kind": "linked-payloads",
38
+ "shape": "array-of-objects"
39
+ },
40
+ {
41
+ "form": "recordIds",
42
+ "pattern": "associated[Top?]<ObjectType>RecordIds",
43
+ "kind": "linked-payloads",
44
+ "shape": "array-of-objects"
45
+ },
46
+ {
47
+ "form": "customDomain",
48
+ "pattern": "associated<CustomName>",
49
+ "kind": "linked-payloads",
50
+ "shape": "array-of-objects",
51
+ "examples": ["associatedTopology", "associatedCompliance"]
52
+ }
53
+ ],
54
+ "rules": {
55
+ "ASSOC-2": "when present MUST be an array",
56
+ "ASSOC-3": "MUST be omitted when empty — never []",
57
+ "ASSOC-6": "resolution MUST be snapshot-first (match *-snapshots, then content by recordId)"
58
+ }
59
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ "$schemaNote": "Content-type profiles (policies). objectType is filled by the caller — never hardcoded here.",
3
+ "version": "2.1.0",
4
+ "profiles": {
5
+ "snapshots": {
6
+ "contentType": "snapshots",
7
+ "collectionPostfix": "snapshots",
8
+ "openBucketsRef": "open-buckets.json",
9
+ "policy": {
10
+ "unknownOpenBuckets": "allow",
11
+ "emptyBuckets": "reject"
12
+ },
13
+ "read": {
14
+ "missingOptionalIsNa": true
15
+ }
16
+ },
17
+ "minimal": {
18
+ "policy": {
19
+ "unknownOpenBuckets": "warn",
20
+ "emptyBuckets": "reject"
21
+ },
22
+ "read": {
23
+ "missingOptionalIsNa": true
24
+ }
25
+ }
26
+ }
27
+ }
@@ -0,0 +1,68 @@
1
+ {
2
+ "$schemaNote": "Content-type vocabulary used by Memorix. Not object types. Aligned with managed Catalox entity descriptors + product vocabulary.",
3
+ "version": "2.1.0",
4
+ "canonicalContentType": "snapshots",
5
+ "contentTypes": {
6
+ "snapshots": {
7
+ "profile": "snapshots",
8
+ "description": "Full readable object view — may carry known open buckets and associated*"
9
+ },
10
+ "discovery": {
11
+ "profile": "minimal",
12
+ "description": "Discovery / Q&A style content"
13
+ },
14
+ "analysis": {
15
+ "profile": "minimal",
16
+ "description": "Analysis content"
17
+ },
18
+ "decisions": {
19
+ "profile": "minimal",
20
+ "description": "Decision content",
21
+ "collectionPostfixVariants": ["decision", "decisions"]
22
+ },
23
+ "scoped": {
24
+ "profile": "minimal",
25
+ "description": "Scoped slice"
26
+ },
27
+ "legacy": {
28
+ "profile": "minimal",
29
+ "description": "Quarantined / legacy slice"
30
+ },
31
+ "narratives": {
32
+ "profile": "minimal",
33
+ "description": "Narrative records"
34
+ },
35
+ "narrative-steps": {
36
+ "profile": "minimal",
37
+ "description": "Narrative step records"
38
+ },
39
+ "workflow": {
40
+ "profile": "workflow",
41
+ "description": "Product workflow overlay (memorix-workflow/1) — not the snapshot envelope"
42
+ },
43
+ "extrated": {
44
+ "profile": "minimal",
45
+ "description": "Extracted document content (managed key spelling as in Catalox descriptors)"
46
+ },
47
+ "chunks": {
48
+ "profile": "minimal",
49
+ "description": "Document chunks"
50
+ },
51
+ "ai-processing": {
52
+ "profile": "minimal",
53
+ "description": "Product vocabulary — optional CT"
54
+ },
55
+ "context": {
56
+ "profile": "minimal",
57
+ "description": "Product vocabulary — optional CT"
58
+ },
59
+ "suggested-plans": {
60
+ "profile": "minimal",
61
+ "description": "Product vocabulary — optional CT"
62
+ },
63
+ "suggested-actions": {
64
+ "profile": "minimal",
65
+ "description": "Product vocabulary — optional CT"
66
+ }
67
+ }
68
+ }
@@ -0,0 +1,77 @@
1
+ {
2
+ "$schemaNote": "INVENTORY ONLY — derived from managed Catalox entity descriptors (memorix-retrieval/catalox-seeds). Not format law. Not agent packs. Used to keep format meta aligned with live managed objects. Regenerate when descriptors change.",
3
+ "version": "2.1.0",
4
+ "source": "memorix-retrieval/catalox-seeds/inputs/entity-descriptors/*.json",
5
+ "scannedAt": "2026-07-21",
6
+ "alsoScanned": [
7
+ {
8
+ "source": "ebooks/memorix-seed/entity-descriptors/*.json",
9
+ "note": "Demo domain — same CT/open-bucket conventions; no new format vocabulary"
10
+ }
11
+ ],
12
+ "managedObjectTypes": [
13
+ "assets",
14
+ "content-documents",
15
+ "knowledge-playbooks",
16
+ "subnets",
17
+ "topology-zones",
18
+ "vulnerabilities",
19
+ "vulnerabilities-groups"
20
+ ],
21
+ "contentTypesObserved": [
22
+ "analysis",
23
+ "chunks",
24
+ "decisions",
25
+ "discovery",
26
+ "extrated",
27
+ "legacy",
28
+ "narrative-steps",
29
+ "narratives",
30
+ "scoped",
31
+ "snapshots",
32
+ "workflow"
33
+ ],
34
+ "contentTypeNotes": [
35
+ {
36
+ "contentType": "decisions",
37
+ "note": "Some descriptors use collection postfix 'decision' (singular) while the contentTypes key is 'decisions'"
38
+ },
39
+ {
40
+ "contentType": "extrated",
41
+ "note": "Spelling as managed in content-documents descriptor (key/postfix/collection)"
42
+ }
43
+ ],
44
+ "associatedPropertiesObserved": [
45
+ "associatedAssetsSnapshots",
46
+ "associatedSubnetsAnalysis",
47
+ "associatedSubnetsDiscovery",
48
+ "associatedSubnetsSnapshots",
49
+ "associatedTopVulnerabilitiesAnalysis",
50
+ "associatedTopology",
51
+ "associatedTopologyZonesAnalysis",
52
+ "associatedTopologyZonesSnapshots",
53
+ "associatedVulnerabilitiesAnalysis",
54
+ "associatedVulnerabilitiesDecisions",
55
+ "associatedVulnerabilitiesDiscovery",
56
+ "associatedVulnerabilitiesGroupsAnalysis",
57
+ "associatedVulnerabilitiesGroupsDiscovery",
58
+ "associatedVulnerabilitiesGroupsEnrichment",
59
+ "associatedVulnerabilitiesGroupsSnapshots"
60
+ ],
61
+ "customRootPropertiesObserved": [
62
+ {
63
+ "name": "possiblePaths",
64
+ "kind": "custom",
65
+ "shape": "object",
66
+ "objectTypes": ["subnets"],
67
+ "note": "Declared on subnets descriptors as managed rootProperty — open bucket, not base-reserved and not a product-known open bucket"
68
+ }
69
+ ],
70
+ "platformOpenBucketsObservedInProductDocs": ["analytics", "enrichment", "insights"],
71
+ "alignmentChecks": {
72
+ "allContentTypesCoveredInContentTypesJson": true,
73
+ "platformOpenBucketsPresentInOpenBucketsJson": ["analytics", "enrichment", "insights"],
74
+ "associatedNamesFollowPrefixConvention": true,
75
+ "noObjectTypesInFormatLawJson": true
76
+ }
77
+ }
@@ -0,0 +1,24 @@
1
+ {
2
+ "$schemaNote": "Memorix product open buckets — content-type level, no objectType. Kind meanings for snapshots.",
3
+ "version": "2.1.0",
4
+ "openBuckets": {
5
+ "analytics": {
6
+ "kind": "rollup",
7
+ "shape": "object",
8
+ "title": "Analytics",
9
+ "description": "Numeric rollups about linked lists"
10
+ },
11
+ "enrichment": {
12
+ "kind": "sourced",
13
+ "shape": "object",
14
+ "title": "Enrichment",
15
+ "description": "External / prior-system sourced values as received"
16
+ },
17
+ "insights": {
18
+ "kind": "interpretive",
19
+ "shape": "object",
20
+ "title": "Insights",
21
+ "description": "Interpreted judgments, scores, recommendations"
22
+ }
23
+ }
24
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@x12i/memorix-format",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "description": "Memorix product format profiles on @x12i/memorix-base-format: known open buckets, association conventions, validator, CLI.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -30,7 +30,7 @@
30
30
  "dist",
31
31
  "docs",
32
32
  "examples",
33
- "profiles",
33
+ "meta",
34
34
  "README.md",
35
35
  "CHANGELOG.md"
36
36
  ],
@@ -48,7 +48,7 @@
48
48
  "node": ">=18.0.0"
49
49
  },
50
50
  "dependencies": {
51
- "@x12i/memorix-base-format": "^1.0.0"
51
+ "@x12i/memorix-base-format": "^1.1.0"
52
52
  },
53
53
  "devDependencies": {
54
54
  "@types/node": "^20.14.0",
@@ -1,27 +0,0 @@
1
- {
2
- "objectType": "vulnerabilities",
3
- "contentType": "snapshots",
4
- "collectionPostfix": "snapshots",
5
- "openBuckets": {
6
- "analytics": {
7
- "kind": "rollup",
8
- "shape": "object",
9
- "title": "Analytics"
10
- },
11
- "enrichment": {
12
- "kind": "sourced",
13
- "shape": "object",
14
- "title": "Enrichment"
15
- },
16
- "insights": {
17
- "kind": "interpretive",
18
- "shape": "object",
19
- "title": "Insights"
20
- }
21
- },
22
- "policy": {
23
- "unknownOpenBuckets": "allow",
24
- "emptyBuckets": "reject"
25
- },
26
- "read": { "missingOptionalIsNa": true }
27
- }