@unified-product-graph/core 0.12.6 → 0.12.8

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/dist/index.cjs CHANGED
@@ -38,7 +38,10 @@ __export(index_exports, {
38
38
  MARKET_COMPETITIVE_PLAYBOOK: () => MARKET_COMPETITIVE_PLAYBOOK,
39
39
  OPERATIONS_QUALITY_PLAYBOOK: () => OPERATIONS_QUALITY_PLAYBOOK,
40
40
  PRODUCT_DELIVERY_PLAYBOOK: () => PRODUCT_DELIVERY_PLAYBOOK,
41
+ PROPERTY_MODIFIERS: () => PROPERTY_MODIFIERS,
42
+ PROPERTY_MODIFIER_SEMANTICS: () => PROPERTY_MODIFIER_SEMANTICS,
41
43
  PROPERTY_SCALE_MAP: () => PROPERTY_SCALE_MAP,
44
+ RECORD_ENTITY_TYPES: () => RECORD_ENTITY_TYPES,
42
45
  REFLECT_MODES: () => REFLECT_MODES,
43
46
  REGISTRY_PRODUCT_ID: () => REGISTRY_PRODUCT_ID,
44
47
  STRATEGY_OUTCOMES_PLAYBOOK: () => STRATEGY_OUTCOMES_PLAYBOOK,
@@ -140,6 +143,7 @@ __export(index_exports, {
140
143
  getDomainIdForType: () => getDomainIdForType,
141
144
  getDomainsInRing: () => getDomainsInRing,
142
145
  getEdgePropertySchema: () => getEdgePropertySchema,
146
+ getEntityModifierSummary: () => getEntityModifierSummary,
143
147
  getEnumScale: () => getEnumScale,
144
148
  getEnumValueMeta: () => getEnumValueMeta,
145
149
  getGuideForDomain: () => getGuideForDomain,
@@ -155,6 +159,7 @@ __export(index_exports, {
155
159
  getPropertiesForScale: () => getPropertiesForScale,
156
160
  getPropertyDefaultScale: () => getPropertyDefaultScale,
157
161
  getPropertyMigrations: () => getPropertyMigrations,
162
+ getPropertyModifier: () => getPropertyModifier,
158
163
  getPropertySchema: () => getPropertySchema,
159
164
  getRegion: () => getRegion,
160
165
  getRegionForEntityType: () => getRegionForEntityType,
@@ -171,6 +176,7 @@ __export(index_exports, {
171
176
  getValidChildren: () => getValidChildren,
172
177
  getVisibleTypes: () => getVisibleTypes,
173
178
  hasStatusMigration: () => hasStatusMigration,
179
+ isAggregateShapedProperty: () => isAggregateShapedProperty,
174
180
  isCanonical: () => isCanonical,
175
181
  isCanonicalProductStage: () => isCanonicalProductStage,
176
182
  isContainmentFreeType: () => isContainmentFreeType,
@@ -183,9 +189,12 @@ __export(index_exports, {
183
189
  isLifecyclePlannedType: () => isLifecyclePlannedType,
184
190
  isPolymorphicEdge: () => isPolymorphicEdge,
185
191
  isPortfolio: () => isPortfolio,
192
+ isRecordEntity: () => isRecordEntity,
186
193
  isRegisteredPolymorphicEdge: () => isRegisteredPolymorphicEdge,
194
+ isRuntimeStateShapedProperty: () => isRuntimeStateShapedProperty,
187
195
  isSubSequenceStep: () => isSubSequenceStep,
188
196
  isUPGDocument: () => isUPGDocument,
197
+ listPropertiesByModifier: () => listPropertiesByModifier,
189
198
  listStatusMigrations: () => listStatusMigrations,
190
199
  listTreePatternSummaries: () => listTreePatternSummaries,
191
200
  migrateEdge: () => migrateEdge,
@@ -1659,6 +1668,11 @@ var UPG_EDGE_CATALOG = {
1659
1668
  design_system_defines_design_token: { forward_verb: "defines", reverse_verb: "defined_in", classification: "hierarchy", source_type: "design_system", target_type: "design_token" },
1660
1669
  design_system_codified_in_design_guideline: { forward_verb: "codified_in", reverse_verb: "codifies", classification: "hierarchy", source_type: "design_system", target_type: "design_guideline" },
1661
1670
  design_system_expresses_brand_identity: { forward_verb: "expresses", reverse_verb: "expressed_in", classification: "hierarchy", source_type: "design_system", target_type: "brand_identity" },
1671
+ // Product expresses the brand (0.12.7, UPG-698). A product references the shared
1672
+ // brand_identity. Dual-registered: also a cross-edge for the common case where the
1673
+ // brand is a registry singleton in another graph (the ratified pattern: brand is a
1674
+ // singleton expressed, not instance_of-d); this catalog entry is the within-graph case.
1675
+ product_expresses_brand_identity: { forward_verb: "expresses", reverse_verb: "expressed_by", classification: "semantic", source_type: "product", target_type: "brand_identity" },
1662
1676
  design_system_encompasses_user_journey: { forward_verb: "encompasses", reverse_verb: "encompassed_in", classification: "hierarchy", source_type: "design_system", target_type: "user_journey" },
1663
1677
  design_system_encompasses_user_flow: { forward_verb: "encompasses", reverse_verb: "encompassed_in", classification: "hierarchy", source_type: "design_system", target_type: "user_flow" },
1664
1678
  design_system_informed_by_insight: { forward_verb: "informed_by", reverse_verb: "informs", classification: "hierarchy", source_type: "design_system", target_type: "insight" },
@@ -1671,6 +1685,11 @@ var UPG_EDGE_CATALOG = {
1671
1685
  design_component_composes_design_component: { forward_verb: "composes", reverse_verb: "composed_in", classification: "hierarchy", source_type: "design_component", target_type: "design_component" },
1672
1686
  prototype_annotated_with_annotation: { forward_verb: "annotated_with", reverse_verb: "annotates", classification: "hierarchy", source_type: "prototype", target_type: "annotation" },
1673
1687
  screen_renders_design_component: { forward_verb: "renders", reverse_verb: "rendered_on", classification: "hierarchy", source_type: "screen", target_type: "design_component" },
1688
+ // Marketing surface to product (0.12.7, UPG-696/698). A marketing/landing screen
1689
+ // markets a product. Dual-registered: also a cross-edge (UPG_CROSS_EDGE_TYPES) for
1690
+ // the common case where the product lives in another graph; this catalog entry is
1691
+ // the within-graph degenerate case (a product's own landing page).
1692
+ screen_markets_product: { forward_verb: "markets", reverse_verb: "marketed_by", classification: "semantic", source_type: "screen", target_type: "product" },
1674
1693
  screen_navigates_to_screen: { forward_verb: "navigates_to", reverse_verb: "navigated_from", classification: "hierarchy", source_type: "screen", target_type: "screen" },
1675
1694
  screen_surfaces_feature: { forward_verb: "surfaces", reverse_verb: "surfaced_on", classification: "cross-domain", source_type: "screen", target_type: "feature" },
1676
1695
  screen_wireframed_as_wireframe: { forward_verb: "wireframed_as", reverse_verb: "wireframes", classification: "hierarchy", source_type: "screen", target_type: "wireframe" },
@@ -3348,7 +3367,9 @@ var UPG_CROSS_EDGE_TYPES = [
3348
3367
  "competitor_classified_as_classification_value",
3349
3368
  "node_classified_as_classification_value",
3350
3369
  "journey_phase_realises_operating_stage",
3351
- "screen_markets_product"
3370
+ "screen_markets_product",
3371
+ "screen_renders_design_component",
3372
+ "product_expresses_brand_identity"
3352
3373
  ];
3353
3374
  var REGISTRY_PRODUCT_ID = "registry";
3354
3375
 
@@ -19411,6 +19432,62 @@ function isUPGDocument(doc) {
19411
19432
  return validateUPGDocument(doc).valid;
19412
19433
  }
19413
19434
 
19435
+ // src/properties/property-modifiers.ts
19436
+ var PROPERTY_MODIFIERS = ["derived", "snapshot", "volatile"];
19437
+ var PROPERTY_MODIFIER_SEMANTICS = {
19438
+ derived: "Computed from edges/children at read-time; never hand-authored. A stored value that contradicts the graph is a smell.",
19439
+ snapshot: "A stale-stamped cache of a live reading; SHOULD pair with a `*_as_of` timestamp. Definition entities carry live state only as a snapshot.",
19440
+ volatile: "An environment-specific pointer (URL / path / id) that may rot or be stripped on export; not portable modeling knowledge."
19441
+ };
19442
+ function listPropertiesByModifier(modifier) {
19443
+ const out = [];
19444
+ for (const [type, props] of Object.entries(UPG_PROPERTY_SCHEMA)) {
19445
+ for (const [property, def] of Object.entries(props)) {
19446
+ const m = def?.modifier;
19447
+ if (!m) continue;
19448
+ if (modifier && m !== modifier) continue;
19449
+ out.push({ type, property, modifier: m });
19450
+ }
19451
+ }
19452
+ return out;
19453
+ }
19454
+ function getPropertyModifier(entityType, property) {
19455
+ return UPG_PROPERTY_SCHEMA[entityType]?.[property]?.modifier;
19456
+ }
19457
+ function getEntityModifierSummary(entityType) {
19458
+ const props = UPG_PROPERTY_SCHEMA[entityType];
19459
+ if (!props) return void 0;
19460
+ const summary = { derived: [], snapshot: [], volatile: [] };
19461
+ let any = false;
19462
+ for (const [property, def] of Object.entries(props)) {
19463
+ const m = def?.modifier;
19464
+ if (!m) continue;
19465
+ summary[m].push(property);
19466
+ any = true;
19467
+ }
19468
+ return any ? summary : void 0;
19469
+ }
19470
+ var RECORD_ENTITY_TYPES = /* @__PURE__ */ new Set([
19471
+ "ai_cost_tracker",
19472
+ "eval_run",
19473
+ "test_result",
19474
+ "agent_session",
19475
+ "cohort",
19476
+ "ai_trace",
19477
+ "workflow_run"
19478
+ ]);
19479
+ function isRecordEntity(entityType) {
19480
+ return RECORD_ENTITY_TYPES.has(entityType);
19481
+ }
19482
+ function isAggregateShapedProperty(name, def) {
19483
+ if (def?.type !== "number") return false;
19484
+ return name.endsWith("_count") || name === "headcount";
19485
+ }
19486
+ function isRuntimeStateShapedProperty(name, def) {
19487
+ if (def?.type !== "number") return false;
19488
+ return /_rate$/.test(name) || /_pct$/.test(name) || /^current_/.test(name) || /_remaining$/.test(name) || /_p\d+_/.test(name) || /^monthly_/.test(name) || /_per_/.test(name);
19489
+ }
19490
+
19414
19491
  // src/properties/edge-property-validation.ts
19415
19492
  function validateEdgeProperties(edgeType, properties) {
19416
19493
  const schema = getEdgePropertySchema(edgeType);
@@ -29453,7 +29530,7 @@ function isCanonical(text) {
29453
29530
  }
29454
29531
 
29455
29532
  // src/index.ts
29456
- var UPG_VERSION = "0.12.6";
29533
+ var UPG_VERSION = "0.12.8";
29457
29534
  var UPG_FORMAT_VERSION = "0.4.0";
29458
29535
  var MARKDOWN_FORMAT_VERSION = "0.1";
29459
29536
  var UPG_TYPES = getTypes();
@@ -29536,7 +29613,10 @@ var UPG_META_COUNT = UPG_ENTITY_META.length;
29536
29613
  MARKET_COMPETITIVE_PLAYBOOK,
29537
29614
  OPERATIONS_QUALITY_PLAYBOOK,
29538
29615
  PRODUCT_DELIVERY_PLAYBOOK,
29616
+ PROPERTY_MODIFIERS,
29617
+ PROPERTY_MODIFIER_SEMANTICS,
29539
29618
  PROPERTY_SCALE_MAP,
29619
+ RECORD_ENTITY_TYPES,
29540
29620
  REFLECT_MODES,
29541
29621
  REGISTRY_PRODUCT_ID,
29542
29622
  STRATEGY_OUTCOMES_PLAYBOOK,
@@ -29638,6 +29718,7 @@ var UPG_META_COUNT = UPG_ENTITY_META.length;
29638
29718
  getDomainIdForType,
29639
29719
  getDomainsInRing,
29640
29720
  getEdgePropertySchema,
29721
+ getEntityModifierSummary,
29641
29722
  getEnumScale,
29642
29723
  getEnumValueMeta,
29643
29724
  getGuideForDomain,
@@ -29653,6 +29734,7 @@ var UPG_META_COUNT = UPG_ENTITY_META.length;
29653
29734
  getPropertiesForScale,
29654
29735
  getPropertyDefaultScale,
29655
29736
  getPropertyMigrations,
29737
+ getPropertyModifier,
29656
29738
  getPropertySchema,
29657
29739
  getRegion,
29658
29740
  getRegionForEntityType,
@@ -29669,6 +29751,7 @@ var UPG_META_COUNT = UPG_ENTITY_META.length;
29669
29751
  getValidChildren,
29670
29752
  getVisibleTypes,
29671
29753
  hasStatusMigration,
29754
+ isAggregateShapedProperty,
29672
29755
  isCanonical,
29673
29756
  isCanonicalProductStage,
29674
29757
  isContainmentFreeType,
@@ -29681,9 +29764,12 @@ var UPG_META_COUNT = UPG_ENTITY_META.length;
29681
29764
  isLifecyclePlannedType,
29682
29765
  isPolymorphicEdge,
29683
29766
  isPortfolio,
29767
+ isRecordEntity,
29684
29768
  isRegisteredPolymorphicEdge,
29769
+ isRuntimeStateShapedProperty,
29685
29770
  isSubSequenceStep,
29686
29771
  isUPGDocument,
29772
+ listPropertiesByModifier,
29687
29773
  listStatusMigrations,
29688
29774
  listTreePatternSummaries,
29689
29775
  migrateEdge,