@unified-product-graph/core 0.11.6 → 0.12.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/dist/index.cjs CHANGED
@@ -90,6 +90,7 @@ __export(index_exports, {
90
90
  UPG_REGION_COUNT: () => UPG_REGION_COUNT,
91
91
  UPG_REGION_MAP: () => UPG_REGION_MAP,
92
92
  UPG_RELATIONSHIP_BENCHMARKS: () => UPG_RELATIONSHIP_BENCHMARKS,
93
+ UPG_SCALAR_TO_EDGE_MIGRATIONS: () => UPG_SCALAR_TO_EDGE_MIGRATIONS,
93
94
  UPG_SCALES: () => UPG_SCALES,
94
95
  UPG_SPLIT_MIGRATIONS: () => UPG_SPLIT_MIGRATIONS,
95
96
  UPG_STATUS_MIGRATIONS: () => UPG_STATUS_MIGRATIONS,
@@ -158,6 +159,7 @@ __export(index_exports, {
158
159
  getRegionForEntityType: () => getRegionForEntityType,
159
160
  getReplacementType: () => getReplacementType,
160
161
  getRingForDomain: () => getRingForDomain,
162
+ getScalarToEdgeMigrations: () => getScalarToEdgeMigrations,
161
163
  getScale: () => getScale,
162
164
  getSplitMigrations: () => getSplitMigrations,
163
165
  getTreePattern: () => getTreePattern,
@@ -2396,6 +2398,32 @@ var UPG_EDGE_CATALOG = {
2396
2398
  // owned by feature_area / theme / product. Relationship is semantic.
2397
2399
  changelog_includes_feature: { forward_verb: "includes", reverse_verb: "included_in", classification: "semantic", source_type: "changelog", target_type: "feature" },
2398
2400
  ai_trace_spawns_ai_trace: { forward_verb: "spawns", reverse_verb: "spawned_by", classification: "hierarchy", source_type: "ai_trace", target_type: "ai_trace" },
2401
+ // ── P14 conformance edges (0.12.0) — promote orphan entity-reference scalars ──
2402
+ // Each replaces a string property that named a first-class entity. The matching
2403
+ // `UPGScalarToEdgeMigration['0.12.0']` rule losslessly mints/links + drops the
2404
+ // scalar. See the P14 string-reference sweep.
2405
+ business_model_guided_by_metric: { forward_verb: "guided_by", reverse_verb: "guides", classification: "cross-domain", source_type: "business_model", target_type: "metric" },
2406
+ vision_anchored_by_metric: { forward_verb: "anchored_by", reverse_verb: "anchors", classification: "cross-domain", source_type: "vision", target_type: "metric" },
2407
+ metric_fed_by_data_source: { forward_verb: "fed_by", reverse_verb: "feeds", classification: "cross-domain", source_type: "metric", target_type: "data_source" },
2408
+ hallucination_report_has_root_cause: { forward_verb: "has_root_cause", reverse_verb: "root_cause_of", classification: "causal", source_type: "hallucination_report", target_type: "root_cause" },
2409
+ model_comparison_compares_ai_model: { forward_verb: "compares", reverse_verb: "compared_in", classification: "semantic", source_type: "model_comparison", target_type: "ai_model" },
2410
+ launch_measured_by_metric: { forward_verb: "measured_by", reverse_verb: "measures", classification: "cross-domain", source_type: "launch", target_type: "metric" },
2411
+ wireframe_depicts_screen: { forward_verb: "depicts", reverse_verb: "depicted_by", classification: "semantic", source_type: "wireframe", target_type: "screen" },
2412
+ service_level_indicator_measures_metric: { forward_verb: "measures", reverse_verb: "measured_by", classification: "cross-domain", source_type: "service_level_indicator", target_type: "metric" },
2413
+ agent_definition_uses_ai_model: { forward_verb: "uses", reverse_verb: "used_by", classification: "semantic", source_type: "agent_definition", target_type: "ai_model" },
2414
+ privacy_policy_governs_compliance_requirement: { forward_verb: "governs", reverse_verb: "governed_by", classification: "semantic", source_type: "privacy_policy", target_type: "compliance_requirement" },
2415
+ a11y_annotation_targets_design_component: { forward_verb: "targets", reverse_verb: "targeted_by", classification: "cross-domain", source_type: "a11y_annotation", target_type: "design_component" },
2416
+ metric_quality_assessment_considers_proxy_metric: { forward_verb: "considers_proxy", reverse_verb: "proxy_for", classification: "semantic", source_type: "metric_quality_assessment", target_type: "metric" },
2417
+ ai_experiment_based_on_ai_model: { forward_verb: "based_on", reverse_verb: "basis_for", classification: "semantic", source_type: "ai_experiment", target_type: "ai_model" },
2418
+ rebuttal_supported_by_evidence: { forward_verb: "supported_by", reverse_verb: "supports", classification: "cross-domain", source_type: "rebuttal", target_type: "evidence" },
2419
+ bug_observed_in_release: { forward_verb: "observed_in", reverse_verb: "exhibits", classification: "semantic", source_type: "bug", target_type: "release" },
2420
+ vulnerability_affects_library_dependency: { forward_verb: "affects", reverse_verb: "affected_by", classification: "cross-domain", source_type: "vulnerability", target_type: "library_dependency" },
2421
+ a11y_issue_found_in_screen: { forward_verb: "found_in", reverse_verb: "site_of", classification: "cross-domain", source_type: "a11y_issue", target_type: "screen" },
2422
+ team_okr_cascades_from_team_okr: { forward_verb: "cascades_from", reverse_verb: "cascades_to", classification: "semantic", source_type: "team_okr", target_type: "team_okr" },
2423
+ agent_session_invoked_agent_skill: { forward_verb: "invoked", reverse_verb: "invoked_by", classification: "semantic", source_type: "agent_session", target_type: "agent_skill" },
2424
+ agent_task_uses_agent_skill: { forward_verb: "uses", reverse_verb: "used_by", classification: "semantic", source_type: "agent_task", target_type: "agent_skill" },
2425
+ participant_belongs_to_behavioral_segment: { forward_verb: "belongs_to", reverse_verb: "includes", classification: "cross-domain", source_type: "participant", target_type: "behavioral_segment" },
2426
+ classification_axis_owned_by_product: { forward_verb: "owned_by", reverse_verb: "owns", classification: "cross-domain", source_type: "classification_axis", target_type: "product" },
2399
2427
  // ── Part 9: Cross-Layer Influence Edges ────────────────────────────────────
2400
2428
  product_expressed_as_design_component: { forward_verb: "expressed_as", reverse_verb: "expresses", classification: "cross-domain", source_type: "product", target_type: "design_component" },
2401
2429
  product_manifests_in_design_component: { forward_verb: "manifests_in", reverse_verb: "manifested_by", classification: "cross-domain", source_type: "product", target_type: "design_component" },
@@ -3215,6 +3243,9 @@ var UPG_EDGE_CATALOG = {
3215
3243
  specification_competes_with_specification: { forward_verb: "competes_with", reverse_verb: "competes_with", classification: "semantic", source_type: "specification", target_type: "specification" },
3216
3244
  primitive_defined_by_specification: { forward_verb: "defined_by", reverse_verb: "defines", classification: "semantic", source_type: "primitive", target_type: "specification" },
3217
3245
  primitive_composes_primitive: { forward_verb: "composes", reverse_verb: "composed_by", classification: "hierarchy", source_type: "primitive", target_type: "primitive" },
3246
+ // A canonical specification defines the operating lifecycle (mirrors primitive_defined_by_specification),
3247
+ // so the lifecycle is governed rather than a standalone root (0.12.1 refinement).
3248
+ operating_lifecycle_defined_by_specification: { forward_verb: "defined_by", reverse_verb: "defines", classification: "semantic", source_type: "operating_lifecycle", target_type: "specification" },
3218
3249
  operating_lifecycle_contains_operating_stage: { forward_verb: "contains", reverse_verb: "belongs_to", classification: "hierarchy", source_type: "operating_lifecycle", target_type: "operating_stage" },
3219
3250
  // Stewardship: a registry specification is governed by a (registry-hostable) organization (0.9.13).
3220
3251
  specification_governed_by_organization: { forward_verb: "governed_by", reverse_verb: "governs", classification: "semantic", source_type: "specification", target_type: "organization" },
@@ -3306,7 +3337,8 @@ var UPG_CROSS_EDGE_TYPES = [
3306
3337
  "competitor_signal_maps_to_feature",
3307
3338
  "competitor_signal_surfaces_opportunity",
3308
3339
  "competitor_classified_as_classification_value",
3309
- "node_classified_as_classification_value"
3340
+ "node_classified_as_classification_value",
3341
+ "journey_phase_realises_operating_stage"
3310
3342
  ];
3311
3343
  var REGISTRY_PRODUCT_ID = "registry";
3312
3344
 
@@ -7534,6 +7566,25 @@ function getDeprecatedTypes() {
7534
7566
  return deprecated;
7535
7567
  }
7536
7568
  var UPG_PROPERTY_MIGRATIONS = {
7569
+ // ── v0.12.0: P14 Bucket C — drop the one non-derived denormalized aggregate ──
7570
+ //
7571
+ // The count caches (feature_count, evidence_count, workflow step_count /
7572
+ // agent_count) are KEPT — 0.11.6 marked them `modifier:'derived'` (the
7573
+ // sanctioned "derived cache" reframe), so tooling knows to recompute rather
7574
+ // than removing them. `business_model.monetisation_basis` is NOT a count: it's
7575
+ // a categorical rollup of the model's revenue_stream.billing_model children, so
7576
+ // it drops here. `pattern` stays (a chosen archetype, not a rollup).
7577
+ // (customer_health_score.metrics — a metric→value map — is deferred: dropping
7578
+ // it is lossy until the per-metric values move onto the composed_of_metric
7579
+ // edges; tracked as a follow-up.)
7580
+ "0.12.0": [
7581
+ {
7582
+ kind: "drop_props",
7583
+ type: "business_model",
7584
+ drop_props: ["monetisation_basis"],
7585
+ reason: "P14 Bucket C: monetisation_basis is a categorical rollup of the model\u2019s revenue_stream.billing_model children, not a first-class attribute. Drop it; KEEP `pattern` (a chosen archetype)."
7586
+ }
7587
+ ],
7537
7588
  // ── v0.10.2: market_intelligence number -> assessment reshape ──────────────
7538
7589
  //
7539
7590
  // The v0.10.0 property-registry generator fix (#43) corrected several property
@@ -8363,6 +8414,245 @@ function getSplitMigrations(fromVersion, toVersion) {
8363
8414
  }
8364
8415
  return result;
8365
8416
  }
8417
+ var UPG_SCALAR_TO_EDGE_MIGRATIONS = {
8418
+ "0.12.0": [
8419
+ // ── Bucket A1 — orphan scalars (no edge existed): add edge + migrate + drop ──
8420
+ {
8421
+ from_type: "business_model",
8422
+ scalar_property: "north_star_metric",
8423
+ target_type: "metric",
8424
+ edge_type: "business_model_guided_by_metric",
8425
+ target_match: "title",
8426
+ target_defaults: { designation: "north_star" },
8427
+ drop_scalar: true,
8428
+ reason: 'P14: the optimised metric is a first-class entity you query across business models ("which models optimise for this metric"), not a label. Mint metric{designation:north_star} + link via business_model_guided_by_metric; drop the orphan string.'
8429
+ },
8430
+ // NOTE: revenue_stream.forecast is NOT promoted — its JSDoc ("Free-text
8431
+ // forecast or projection") is narrative prose, not a ref to a forecast
8432
+ // entity. The additive revenue_stream_projected_by_forecast edge exists for
8433
+ // an explicit stream→forecast link; the free-text field stays.
8434
+ {
8435
+ from_type: "metric",
8436
+ scalar_property: "data_source",
8437
+ target_type: "data_source",
8438
+ edge_type: "metric_fed_by_data_source",
8439
+ drop_scalar: true,
8440
+ reason: 'P14: the data source feeding a metric is queryable across metrics ("everything fed by this source"); promote the string to a metric_fed_by_data_source edge.'
8441
+ },
8442
+ {
8443
+ from_type: "hallucination_report",
8444
+ scalar_property: "root_cause",
8445
+ target_type: "root_cause",
8446
+ edge_type: "hallucination_report_has_root_cause",
8447
+ drop_scalar: true,
8448
+ reason: "P14: a root_cause is a first-class entity reused across reports; link it rather than restating the cause as a string."
8449
+ },
8450
+ // NOTE: prompt_version.template is NOT promoted — its JSDoc ("Template body
8451
+ // with variable placeholders") is the prompt CONTENT, not a ref to a
8452
+ // prompt_template entity. The additive prompt_version_child_of_prompt_template
8453
+ // edge exists for an explicit version→template link; the content field stays.
8454
+ {
8455
+ from_type: "model_comparison",
8456
+ scalar_property: "model_ids",
8457
+ target_type: "ai_model",
8458
+ edge_type: "model_comparison_compares_ai_model",
8459
+ multi: true,
8460
+ drop_scalar: true,
8461
+ reason: "P14: the models being compared are first-class ai_model entities; one compares edge per model replaces the id-string list."
8462
+ },
8463
+ {
8464
+ from_type: "launch",
8465
+ scalar_property: "success_metrics",
8466
+ target_type: "metric",
8467
+ edge_type: "launch_measured_by_metric",
8468
+ multi: true,
8469
+ drop_scalar: true,
8470
+ reason: "P14: success metrics are first-class metric entities measured across launches; one measured_by edge per metric replaces the string list."
8471
+ },
8472
+ // NOTE: user_story.as_a is NOT promoted — it is a load-bearing field of the
8473
+ // user_story → story_statement split (the "As a <persona>" templated promise),
8474
+ // and the value is often a role descriptor, not a persona node. Left in place.
8475
+ {
8476
+ from_type: "wireframe",
8477
+ scalar_property: "screen_name",
8478
+ target_type: "screen",
8479
+ edge_type: "wireframe_depicts_screen",
8480
+ drop_scalar: true,
8481
+ reason: "P14: the depicted screen is a first-class entity; link it via wireframe_depicts_screen rather than naming it in a string."
8482
+ },
8483
+ {
8484
+ from_type: "service_level_indicator",
8485
+ scalar_property: "metric_name",
8486
+ target_type: "metric",
8487
+ edge_type: "service_level_indicator_measures_metric",
8488
+ drop_scalar: true,
8489
+ reason: "P14: the SLI\u2019s metric is a first-class entity; link it via service_level_indicator_measures_metric rather than naming it in a string."
8490
+ },
8491
+ {
8492
+ from_type: "agent_definition",
8493
+ scalar_property: "model_ref",
8494
+ target_type: "ai_model",
8495
+ edge_type: "agent_definition_uses_ai_model",
8496
+ drop_scalar: true,
8497
+ reason: 'P14: the model an agent uses is a first-class ai_model entity ("every agent on this model"); promote the ref string to a uses edge.'
8498
+ },
8499
+ {
8500
+ from_type: "privacy_policy",
8501
+ scalar_property: "regulations",
8502
+ target_type: "compliance_requirement",
8503
+ edge_type: "privacy_policy_governs_compliance_requirement",
8504
+ multi: true,
8505
+ drop_scalar: true,
8506
+ reason: "P14: each regulation is a first-class compliance_requirement entity tracked across policies; one governs edge per requirement replaces the string list."
8507
+ },
8508
+ {
8509
+ from_type: "a11y_annotation",
8510
+ scalar_property: "target_component",
8511
+ target_type: "design_component",
8512
+ edge_type: "a11y_annotation_targets_design_component",
8513
+ drop_scalar: true,
8514
+ reason: "P14: the annotated component is a real design_component entity; link it so accessibility coverage rolls up by component."
8515
+ },
8516
+ {
8517
+ from_type: "metric_quality_assessment",
8518
+ scalar_property: "proxy_alternatives",
8519
+ target_type: "metric",
8520
+ edge_type: "metric_quality_assessment_considers_proxy_metric",
8521
+ multi: true,
8522
+ drop_scalar: true,
8523
+ reason: "P14: proxy alternatives are first-class metric entities; one considers_proxy edge per metric replaces the name list."
8524
+ },
8525
+ {
8526
+ from_type: "ai_experiment",
8527
+ scalar_property: "foundation_model",
8528
+ target_type: "ai_model",
8529
+ edge_type: "ai_experiment_based_on_ai_model",
8530
+ drop_scalar: true,
8531
+ reason: "P14: the foundation model is a first-class ai_model entity reused across experiments; promote the string to a based_on edge."
8532
+ },
8533
+ {
8534
+ from_type: "rebuttal",
8535
+ scalar_property: "evidence_refs",
8536
+ target_type: "evidence",
8537
+ edge_type: "rebuttal_supported_by_evidence",
8538
+ multi: true,
8539
+ drop_scalar: true,
8540
+ reason: "P14: each evidence ref is a first-class evidence entity; one supported_by edge per item replaces the ref-string list."
8541
+ },
8542
+ {
8543
+ from_type: "bug",
8544
+ scalar_property: "affected_version",
8545
+ target_type: "release",
8546
+ edge_type: "bug_observed_in_release",
8547
+ drop_scalar: true,
8548
+ reason: 'P14: the affected version is a first-class release entity ("every bug in this release"); promote the version string to an observed_in edge.'
8549
+ },
8550
+ {
8551
+ from_type: "vulnerability",
8552
+ scalar_property: "affected_package",
8553
+ target_type: "library_dependency",
8554
+ edge_type: "vulnerability_affects_library_dependency",
8555
+ drop_scalar: true,
8556
+ reason: "P14: the affected package is a first-class library_dependency entity; link it so vulnerabilities roll up by dependency."
8557
+ },
8558
+ {
8559
+ from_type: "a11y_issue",
8560
+ scalar_property: "discovered_in",
8561
+ target_type: "screen",
8562
+ edge_type: "a11y_issue_found_in_screen",
8563
+ drop_scalar: true,
8564
+ reason: "P14: the screen an issue was found in is a real screen entity; link it so issues roll up by screen rather than naming it in a string."
8565
+ },
8566
+ {
8567
+ from_type: "team_okr",
8568
+ scalar_property: "cascade_from",
8569
+ target_type: "team_okr",
8570
+ edge_type: "team_okr_cascades_from_team_okr",
8571
+ drop_scalar: true,
8572
+ reason: "P14: a cascaded OKR points at its parent OKR (a real entity); the cascade is a self-referential edge, not a name string."
8573
+ },
8574
+ {
8575
+ from_type: "agent_session",
8576
+ scalar_property: "tools_invoked",
8577
+ target_type: "agent_skill",
8578
+ edge_type: "agent_session_invoked_agent_skill",
8579
+ multi: true,
8580
+ drop_scalar: true,
8581
+ reason: "P14: invoked tools are first-class agent_skill entities tracked across sessions; one invoked edge per skill replaces the string list."
8582
+ },
8583
+ {
8584
+ from_type: "agent_task",
8585
+ scalar_property: "tools",
8586
+ target_type: "agent_skill",
8587
+ edge_type: "agent_task_uses_agent_skill",
8588
+ multi: true,
8589
+ drop_scalar: true,
8590
+ reason: "P14: the tools a task uses are first-class agent_skill entities; one uses edge per skill replaces the string list."
8591
+ },
8592
+ {
8593
+ from_type: "participant",
8594
+ scalar_property: "segment",
8595
+ target_type: "behavioral_segment",
8596
+ edge_type: "participant_belongs_to_behavioral_segment",
8597
+ drop_scalar: true,
8598
+ reason: "P14: a participant\u2019s segment is a first-class behavioral_segment entity queried across studies; promote the string to a belongs_to edge."
8599
+ },
8600
+ {
8601
+ from_type: "classification_axis",
8602
+ scalar_property: "owner_product",
8603
+ target_type: "product",
8604
+ edge_type: "classification_axis_owned_by_product",
8605
+ target_match: "id",
8606
+ drop_scalar: true,
8607
+ reason: "P14: the product that owns an axis is a first-class entity; link it via classification_axis_owned_by_product. The scalar holds a product id, so match by id (no mint)."
8608
+ },
8609
+ // ── Bucket A2 — shadow scalars (the canonical edge ALREADY exists): backfill + drop ──
8610
+ {
8611
+ from_type: "growth_campaign",
8612
+ scalar_property: "channels_targeted",
8613
+ target_type: "acquisition_channel",
8614
+ edge_type: "acquisition_channel_runs_growth_campaign",
8615
+ reverse: true,
8616
+ multi: true,
8617
+ drop_scalar: true,
8618
+ reason: "P14 shadow: the acquisition_channel_runs_growth_campaign edge already exists (channel\u2192campaign). Backfill any string-only channels as edges, then drop the drift-prone list."
8619
+ },
8620
+ {
8621
+ from_type: "journey_step",
8622
+ scalar_property: "touchpoint",
8623
+ target_type: "touchpoint",
8624
+ edge_type: "touchpoint_occurs_in_journey_step",
8625
+ reverse: true,
8626
+ drop_scalar: true,
8627
+ reason: "P14 shadow: the touchpoint_occurs_in_journey_step edge already exists (touchpoint\u2192journey_step) and the field was @deprecated 0.9.9. Backfill + finish the drop."
8628
+ },
8629
+ {
8630
+ from_type: "decision",
8631
+ scalar_property: "superseded_by",
8632
+ target_type: "decision",
8633
+ edge_type: "decision_superseded_by_decision",
8634
+ drop_scalar: true,
8635
+ reason: "P14 shadow: the decision_superseded_by_decision edge already exists. Backfill the superseding decision as an edge, then drop the reference string."
8636
+ },
8637
+ {
8638
+ from_type: "subscription",
8639
+ scalar_property: "plan_name",
8640
+ target_type: "pricing_tier",
8641
+ edge_type: "subscription_subscribes_to_pricing_tier",
8642
+ drop_scalar: true,
8643
+ reason: "P14 shadow: the subscription_subscribes_to_pricing_tier edge already exists. Backfill the plan as a pricing_tier edge, then drop the name string."
8644
+ }
8645
+ ]
8646
+ };
8647
+ function getScalarToEdgeMigrations(fromVersion, toVersion) {
8648
+ const result = [];
8649
+ for (const [version, migrations] of Object.entries(UPG_SCALAR_TO_EDGE_MIGRATIONS)) {
8650
+ if (versionInRange(version, fromVersion, toVersion)) {
8651
+ result.push(...migrations);
8652
+ }
8653
+ }
8654
+ return result;
8655
+ }
8366
8656
  var UPG_EDGE_MIGRATIONS = {
8367
8657
  "0.9.9": [
8368
8658
  // (since v0.9.9, UPG-664/UPG-678) Validation experiment-model + test_plan
@@ -9351,7 +9641,6 @@ var UPG_PROPERTY_SCHEMA = {
9351
9641
  // A11yAnnotationProperties: Accessibility annotation.
9352
9642
  a11y_annotation: {
9353
9643
  category: { type: "string", enum: ["focus_order", "alt_text", "heading_level", "aria_label", "colour_contrast", "keyboard_nav", "screen_reader", "motion_preference", "other"], description: "Category of accessibility annotation. Expanded from the original 5-value enum to cover the full range of a11y annotation types." },
9354
- target_component: { type: "string", description: "Component or element this annotation applies to" },
9355
9644
  requirement: { type: "string", description: "Specific accessibility requirement described" },
9356
9645
  wcag_criterion: { type: "string", description: "WCAG success criterion this annotation relates to" },
9357
9646
  annotation_priority: { type: "string", enum: ["urgent", "high", "medium", "low", "none"], description: "Priority for implementing this annotation" },
@@ -9400,8 +9689,7 @@ var UPG_PROPERTY_SCHEMA = {
9400
9689
  html_snippet: { type: "string", description: "HTML snippet containing the violation" },
9401
9690
  tags: { type: "string[]", description: 'Tags from the audit tool (e.g. "wcag2aa", "cat.color")' },
9402
9691
  remediation: { type: "string", description: "Recommended fix for the issue" },
9403
- impact_description: { type: "string", description: "Description of the user impact" },
9404
- discovered_in: { type: "string", description: "Page or component where the issue was found" }
9692
+ impact_description: { type: "string", description: "Description of the user impact" }
9405
9693
  },
9406
9694
  // A11yStandardProperties: Accessibility standard.
9407
9695
  a11y_standard: {
@@ -9467,7 +9755,6 @@ var UPG_PROPERTY_SCHEMA = {
9467
9755
  agent_scope: { type: "string", description: "Boundaries of what this agent can act on" },
9468
9756
  goal: { type: "string", description: "Primary objective the agent is trying to achieve" },
9469
9757
  backstory: { type: "string", description: "Context or persona narrative for the agent" },
9470
- model_ref: { type: "string", description: "Reference to the AI model powering this agent" },
9471
9758
  allow_delegation: { type: "boolean", description: "Whether the agent can delegate tasks to other agents" },
9472
9759
  memory_enabled: { type: "boolean", description: "Whether the agent retains memory across sessions" },
9473
9760
  max_iterations: { type: "number", description: "Maximum number of reasoning iterations allowed" },
@@ -9491,7 +9778,6 @@ var UPG_PROPERTY_SCHEMA = {
9491
9778
  turns: { type: "number", description: "Number of conversational turns in the session" },
9492
9779
  tokens_used: { type: "number", description: "Total tokens consumed during the session" },
9493
9780
  cost: { type: "number", description: "Total monetary cost of the session" },
9494
- tools_invoked: { type: "string[]", description: "List of tools invoked during the session" },
9495
9781
  error_count: { type: "number", description: "Number of errors encountered during the session" },
9496
9782
  session_status: { type: "string", enum: ["active", "completed", "errored", "timed_out"], description: "Current status of the session" },
9497
9783
  output_summary: { type: "string", description: "Brief summary of the session's output" }
@@ -9507,7 +9793,6 @@ var UPG_PROPERTY_SCHEMA = {
9507
9793
  description: { type: "string", description: "What the agent should accomplish" },
9508
9794
  expected_output: { type: "string", description: "Description of the expected output format or content" },
9509
9795
  context: { type: "string", description: "Additional context provided to the agent for this task" },
9510
- tools: { type: "string[]", description: "Tools the agent may use for this task" },
9511
9796
  output_file: { type: "string", description: "File path where the agent should write output" },
9512
9797
  blocking: { type: "boolean", description: "Whether this task blocks downstream tasks" },
9513
9798
  priority: { type: "string", enum: ["urgent", "high", "medium", "low", "none"], description: "Relative priority of this task" }
@@ -9549,7 +9834,6 @@ var UPG_PROPERTY_SCHEMA = {
9549
9834
  summary_metrics: { type: "string", description: "Key-metric summary" },
9550
9835
  started_at: { type: "string", description: "ISO timestamp started" },
9551
9836
  completed_at: { type: "string", description: "ISO timestamp completed" },
9552
- foundation_model: { type: "string", description: "Foundation starting model" },
9553
9837
  training_steps: { type: "number", description: "Training steps or epochs completed" },
9554
9838
  artifact_uri: { type: "string", description: "Produced artifact URI" },
9555
9839
  notes: { type: "string", description: "Free-text notes" },
@@ -9780,7 +10064,6 @@ var UPG_PROPERTY_SCHEMA = {
9780
10064
  environment: { type: "string", description: 'Observed environment (e.g. "prod", "staging", "iOS 17.4")' },
9781
10065
  priority: { type: "string", enum: ["urgent", "high", "medium", "low", "none"], description: "Urgency relative to other work. Independent of `bug_severity` (a critical bug can have low priority if rare)." },
9782
10066
  assignee: { type: "string", description: "Assigned person" },
9783
- affected_version: { type: "string", description: "Product version where first observed. Helps triage regressions." },
9784
10067
  due_date: { type: "string", description: "ISO date due. Often tied to a release gate or SLA." },
9785
10068
  labels: { type: "string[]", description: "Free-form classification tags. Applied uniformly across work item types." }
9786
10069
  },
@@ -9796,9 +10079,9 @@ var UPG_PROPERTY_SCHEMA = {
9796
10079
  business_model: {
9797
10080
  framework_id: { type: "string", description: "Framework ID (references `UPGFramework.id`)" },
9798
10081
  stage: { type: "string", enum: ["draft", "validated", "active"], description: "Maturity" },
9799
- pattern: { type: "string", enum: ["freemium", "marketplace", "saas", "subscription", "transactional", "advertising", "licensing", "hybrid"], description: "Canonical pattern. Useful for benchmarking against peer businesses with the same shape." },
9800
- monetisation_basis: { type: "string", enum: ["usage", "seat", "outcome", "transaction", "flat"], description: "Primary monetisation unit" },
9801
- north_star_metric: { type: "string", description: "The single metric the business optimises for" }
10082
+ pattern: { type: "string", enum: ["freemium", "marketplace", "saas", "subscription", "transactional", "advertising", "licensing", "hybrid"], description: "Canonical pattern. Useful for benchmarking against peer businesses with the same shape." }
10083
+ // monetisation_basis removed in 0.12.0 (P14 Bucket C) — categorical rollup of revenue_stream.billing_model.
10084
+ // north_star_metric removed in 0.12.0 (P14) → `business_model_guided_by_metric` edge.
9802
10085
  },
9803
10086
  // CapabilityProperties: Capability entity.
9804
10087
  capability: {
@@ -9866,8 +10149,7 @@ var UPG_PROPERTY_SCHEMA = {
9866
10149
  // ClassificationAxisProperties: ClassificationAxis: a dimension along which subjects are classified.
9867
10150
  classification_axis: {
9868
10151
  axis_kind: { type: "string", enum: ["categorical", "ordinal", "continuous"], description: "Structural kind of values on this axis. `categorical` = discrete, unordered (most common; CMS architectures). `ordinal` = discrete, ordered (maturity tiers, T-shirt sizes). `continuous` = numeric range (latency budget, price points)." },
9869
- cardinality: { type: "string", enum: ["single", "multi"], description: 'How many values a subject may hold on this axis at once (UPG 0.11.3). `single` (default) = a subject sits at exactly one value; a re-classification to a new value SUPERSEDES the prior one (the classify writer retires the old same-axis edge and records the move in the reclassification history). `multi` = a subject may legitimately hold several values at once (e.g. an axis like "supported frameworks"); re-classifying ADDS a value and does not supersede. A separate axis from `axis_kind`: an axis can be `categorical` (unordered) yet `single`-select, or `categorical` yet `multi`-select.' },
9870
- owner_product: { type: "string", description: "Product id when product-specific. Axes are usually product-agnostic; leave empty for shared taxonomies." }
10152
+ cardinality: { type: "string", enum: ["single", "multi"], description: 'How many values a subject may hold on this axis at once (UPG 0.11.3). `single` (default) = a subject sits at exactly one value; a re-classification to a new value SUPERSEDES the prior one (the classify writer retires the old same-axis edge and records the move in the reclassification history). `multi` = a subject may legitimately hold several values at once (e.g. an axis like "supported frameworks"); re-classifying ADDS a value and does not supersede. A separate axis from `axis_kind`: an axis can be `categorical` (unordered) yet `single`-select, or `categorical` yet `multi`-select.' }
9871
10153
  },
9872
10154
  // ClassificationValueProperties: ClassificationValue: a value on a classification axis.
9873
10155
  classification_value: {
@@ -10236,8 +10518,7 @@ var UPG_PROPERTY_SCHEMA = {
10236
10518
  decision_outcome: { type: "string", description: "Outcome text. What was decided. Separate from `rationale` (which explains why)." },
10237
10519
  consequences: { type: "string", description: `Known positive and negative consequences. Mirrors MADR's "Consequences" section.` },
10238
10520
  decision_makers: { type: "string[]", description: `People who made the decision. Mirrors MADR's "Deciders" field.` },
10239
- decision_drivers: { type: "string[]", description: `Forces, constraints, and goals that shaped the decision. Mirrors MADR's "Decision Drivers" section. @example ["must work offline", "team has no Go expertise", "cost < $500/mo"]` },
10240
- superseded_by: { type: "string", description: "Reference to the superseding decision, if any." }
10521
+ decision_drivers: { type: "string[]", description: `Forces, constraints, and goals that shaped the decision. Mirrors MADR's "Decision Drivers" section. @example ["must work offline", "team has no Go expertise", "cost < $500/mo"]` }
10241
10522
  },
10242
10523
  // DeliverableProperties: Deliverable.
10243
10524
  deliverable: {
@@ -10771,7 +11052,6 @@ var UPG_PROPERTY_SCHEMA = {
10771
11052
  end_date: { type: "string", description: "ISO end date" },
10772
11053
  budget_amount: { type: "number", description: "Total allocated budget. Use with `budget_currency`." },
10773
11054
  budget_currency: { type: "string", description: 'ISO 4217 currency code (e.g. "USD", "EUR", "GBP")' },
10774
- channels_targeted: { type: "string[]", description: 'Channels the campaign runs across. Free-form so partner channels and ad networks both fit (e.g. "google_ads", "linkedin", "podcast_sponsorship").' },
10775
11055
  primary_kpi: { type: "string", description: 'Primary KPI optimised for (e.g. "qualified_signups", "MQL_volume", "activated_teams")' },
10776
11056
  kpi_target: { type: "number", description: "Numeric target for `primary_kpi` over the campaign window" },
10777
11057
  utm_parameters: { type: "string", description: "UTM tracking parameters for this campaign" },
@@ -10805,7 +11085,6 @@ var UPG_PROPERTY_SCHEMA = {
10805
11085
  required: ["value", "label"]
10806
11086
  },
10807
11087
  user_facing: { type: "boolean", description: "Visible to end users" },
10808
- root_cause: { type: "string", description: "Identified cause" },
10809
11088
  remediation: { type: "string", description: "Remediation steps" }
10810
11089
  },
10811
11090
  // HelpVideoProperties: Help video.
@@ -11059,7 +11338,6 @@ var UPG_PROPERTY_SCHEMA = {
11059
11338
  // JourneyStepProperties: Single step within a user journey. A user-moment on the journey's single
11060
11339
  journey_step: {
11061
11340
  step_order: { type: "number", description: "Display order within the journey's step timeline (0-indexed). The scalar ordering convention shared with `journey_phase.phase_order` and `journey_action.action_order` (UPG-663). For branching journeys, the explicit `journey_step_precedes_journey_step` edge captures the chain." },
11062
- touchpoint: { type: "string", description: "@deprecated since v0.9.9 (UPG-675). Touchpoints are modelled in two places, neither of which is this string: the `touchpoint` *entity* is the cross-channel customer-success layer (`touchpoint_occurs_in_journey_step`), and `journey_action` is the in-product blueprint layer (the finest band of a `journey_step`). Use one of those rather than a free-text string here. Removed in a future major." },
11063
11341
  channel: { type: "string", description: 'Channel (e.g. "web", "email", "in-store")' },
11064
11342
  emotion_score: {
11065
11343
  type: "assessment",
@@ -11132,8 +11410,7 @@ var UPG_PROPERTY_SCHEMA = {
11132
11410
  // LaunchProperties: Launch entity.
11133
11411
  launch: {
11134
11412
  launch_type: { type: "string", enum: ["soft", "beta", "public", "feature"], description: "Scale and audience of the launch" },
11135
- target_date: { type: "string", description: "Planned launch date (ISO format)" },
11136
- success_metrics: { type: "string[]", description: "Metrics that define launch success" }
11413
+ target_date: { type: "string", description: "Planned launch date (ISO format)" }
11137
11414
  },
11138
11415
  // LeadProperties: Lead.
11139
11416
  lead: {
@@ -11293,7 +11570,6 @@ var UPG_PROPERTY_SCHEMA = {
11293
11570
  range_min: { type: "number", description: "Minimum expected or baseline value" },
11294
11571
  range_max: { type: "number", description: "Maximum expected or ceiling value" },
11295
11572
  cadence: { type: "string", enum: ["continuous", "hourly", "daily", "weekly", "monthly", "quarterly", "yearly", "on_demand", "other"], description: "Measurement cadence. Canonical `Cadence` since v0.4.0. `'realtime'` migrates to `'continuous'`; all other values 1:1." },
11296
- data_source: { type: "string", description: 'Data source or tool that feeds this metric (e.g. "PostHog", "Stripe")' },
11297
11573
  owner: { type: "string", description: "Person or team responsible for tracking this metric" },
11298
11574
  metric_health: { type: "string", enum: ["healthy", "at_risk", "unhealthy", "unknown"], description: "Universal health rollup. Orthogonal to lifecycle and `guardrail_status`. Applies to every metric regardless of `designation`. `healthy` = trending well against target / inside safe range. `at_risk` = drifting, approaching breach or target shortfall. `unhealthy` = missed target or breached; action needed. `unknown` = no current reading or not yet measured. For guardrails specifically, `guardrail_status` remains the breach-specific signal (`safe`/`warning`/`breached`)." },
11299
11575
  guardrail_threshold_min: { type: "number", description: "Lower bound for guardrail safety (below this = breach)" },
@@ -11311,8 +11587,7 @@ var UPG_PROPERTY_SCHEMA = {
11311
11587
  quality_related: { type: "boolean", description: "Quality signal: metric relates to other key metrics in the system" },
11312
11588
  quality_score: { type: "number", description: "Computed quality score across all quality signals (0\u20135)" },
11313
11589
  proxy_reason: { type: "string", enum: ["qualitative", "no_direct_measure", "not_yet_instrumented", "too_expensive"], description: "Why this metric is used as a proxy instead of measuring directly" },
11314
- proxy_confidence: { type: "string", enum: ["strong", "moderate", "weak"], description: "How strongly this metric predicts the direct measure" },
11315
- proxy_alternatives: { type: "string[]", description: "Other metrics considered as proxy candidates" }
11590
+ proxy_confidence: { type: "string", enum: ["strong", "moderate", "weak"], description: "How strongly this metric predicts the direct measure" }
11316
11591
  },
11317
11592
  // MilestoneProperties: Milestone.
11318
11593
  milestone: {
@@ -11328,7 +11603,6 @@ var UPG_PROPERTY_SCHEMA = {
11328
11603
  },
11329
11604
  // ModelComparisonProperties: Model comparison.
11330
11605
  model_comparison: {
11331
- model_ids: { type: "string[]", description: "Compared model identifiers" },
11332
11606
  comparison_criteria: { type: "string[]", description: 'Comparison dimensions (e.g. "accuracy", "cost", "latency")' },
11333
11607
  comparison_date: { type: "string", description: "ISO conduct date" }
11334
11608
  },
@@ -11505,7 +11779,6 @@ var UPG_PROPERTY_SCHEMA = {
11505
11779
  // ParticipantProperties: Research participant.
11506
11780
  participant: {
11507
11781
  alias: { type: "string", description: 'Anonymous alias for privacy (e.g. "P01")' },
11508
- segment: { type: "string", description: "User segment this participant belongs to" },
11509
11782
  recruit_source: { type: "string", description: "How the participant was recruited" },
11510
11783
  consent_status: { type: "string", enum: ["pending", "given", "withdrawn"], description: "Current consent status for data usage" }
11511
11784
  },
@@ -11643,26 +11916,21 @@ var UPG_PROPERTY_SCHEMA = {
11643
11916
  },
11644
11917
  // OperatingLifecycleProperties: a canonical ordered (often cyclic) operating process products' journey phases map onto.
11645
11918
  operating_lifecycle: {
11646
- label: { type: "string", description: "Human-readable name of the operating process." },
11647
- cyclic: { type: "boolean", description: "True if the process loops (e.g. Analyze \u2192 Extend \u2192 Plan). Rendered linearly by stage_order with the wrap on the final stage." },
11648
- source: { type: "string", description: 'Origin of the canonical model (e.g. "Sanity official content-ops lifecycle").' }
11919
+ cyclic: { type: "boolean", description: "True if the process loops (e.g. Analyze \u2192 Extend \u2192 Plan). The sequence is expressed by the stages' stage_order; cyclic adds the wrap from last stage back to first." },
11920
+ source: { type: "string", description: 'Origin of the canonical model (e.g. "Sanity official content-ops lifecycle"). Optional provenance; promote to an edge if it names a real specification/document.' }
11649
11921
  },
11650
11922
  // OperatingStageProperties: one ordered stage of an operating_lifecycle.
11651
11923
  operating_stage: {
11652
- stage_order: { type: "number", description: "Ordered position within the lifecycle, 0-indexed." },
11653
- label: { type: "string", description: "Human-readable stage name." },
11924
+ stage_order: { type: "number", description: "Ordered position within the lifecycle, 0-indexed. Source of truth for sequence." },
11654
11925
  goal: { type: "string", description: "What this stage accomplishes." },
11655
- owner_role: { type: "string", description: "Role that owns the stage (free-text role label)." },
11656
- os_analogy: { type: "string", description: 'The Content-OS analogy from the source volume (e.g. "Drivers + daemons / cron").' },
11657
- next_stage: { type: "string", description: "Label of the next stage; on the final stage of a cyclic lifecycle this carries the wrap." }
11926
+ owner_role: { type: "string", description: "Role that owns the stage (free-text role label). Optional; promote to a node_owned_by_role edge if ownership must be queryable." }
11658
11927
  },
11659
11928
  // PrivacyPolicyProperties: Privacy policy.
11660
11929
  privacy_policy: {
11661
11930
  version: { type: "string", description: "Version identifier of the policy" },
11662
11931
  last_updated: { type: "string", description: "Date the policy was last updated (ISO format)" },
11663
11932
  effective_date: { type: "string", description: "Date the policy takes effect (ISO format)" },
11664
- url: { type: "string", description: "URL where the policy is published" },
11665
- regulations: { type: "string[]", description: 'Regulations this policy addresses (e.g. "GDPR", "CCPA")' }
11933
+ url: { type: "string", description: "URL where the policy is published" }
11666
11934
  },
11667
11935
  // ProductProperties: The product being created. Root of the graph.
11668
11936
  product: {
@@ -12054,7 +12322,6 @@ var UPG_PROPERTY_SCHEMA = {
12054
12322
  },
12055
12323
  // ServiceLevelIndicatorProperties: Service Level Indicator.
12056
12324
  service_level_indicator: {
12057
- metric_name: { type: "string", description: 'Indicator metric name. @example "Request latency p99", "Error rate", "Availability"' },
12058
12325
  threshold: { type: "number", description: 'Threshold that defines a "good" event. @example 200 (ms latency), 0.01 (1% error rate), 99.9 (% availability)' },
12059
12326
  current_value: { type: "number", description: "Current observed value. Compared against `threshold` for SLO compliance. @example 150 (ms), 0.003 (0.3% error rate)", modifier: "snapshot" },
12060
12327
  unit: { type: "string", description: 'Unit of measurement. Required to interpret `threshold` and `current_value`. @example "ms", "%", "req/s", "errors/min"' },
@@ -12212,7 +12479,6 @@ var UPG_PROPERTY_SCHEMA = {
12212
12479
  },
12213
12480
  // SubscriptionProperties: Subscription.
12214
12481
  subscription: {
12215
- plan_name: { type: "string", description: "Name of the subscribed plan" },
12216
12482
  monthly_recurring_revenue: { type: "number", description: "Monthly recurring revenue from this subscription" },
12217
12483
  start_date: { type: "string", description: "Subscription start date (ISO format)" },
12218
12484
  renewal_date: { type: "string", description: "Next renewal date (ISO format)" },
@@ -12305,8 +12571,7 @@ var UPG_PROPERTY_SCHEMA = {
12305
12571
  team_okr: {
12306
12572
  period: { type: "string", description: 'Time period for the OKR (e.g. "Q2 2026")' },
12307
12573
  progress: { type: "number", description: "Overall progress toward the objective (0-100%)" },
12308
- objective_statement: { type: "string", description: "The team-level objective statement (key results live in child entities)" },
12309
- cascade_from: { type: "string", description: "Higher-level objective this OKR cascades from (company or department OKR)" }
12574
+ objective_statement: { type: "string", description: "The team-level objective statement (key results live in child entities)" }
12310
12575
  },
12311
12576
  // TechnicalDebtItemProperties: Technical debt item.
12312
12577
  technical_debt_item: {
@@ -12559,7 +12824,6 @@ var UPG_PROPERTY_SCHEMA = {
12559
12824
  },
12560
12825
  cvss_version: { type: "string", enum: ["v3.1", "v4.0"], description: 'CVSS scoring version. v3.1 and v4.0 differ significantly for the same vulnerability. @example "v4.0" for vulnerabilities scored after the v4.0 release in 2023' },
12561
12826
  affected_component: { type: "string", description: 'Affected component, library, or system. @example "lodash", "openssl", "login service"' },
12562
- affected_package: { type: "string", description: 'Affected package with version. More precise than `affected_component`. @example "lodash@4.17.20", "openssl@1.1.1q"' },
12563
12827
  exploit_maturity: { type: "string", enum: ["no_known_exploit", "proof_of_concept", "functional_exploit", "active_exploitation"], description: 'Exploit maturity. Primary prioritisation factor after severity. `no_known_exploit` = theoretical. `proof_of_concept` = exploit code exists, not weaponised. `functional_exploit` = working exploit available. `active_exploitation` = active in the wild. @example "active_exploitation" demands immediate response regardless of severity score' },
12564
12828
  fix_available: { type: "boolean", description: "Patch availability. Common triage question after severity. @example false for a zero-day with no available patch" },
12565
12829
  disclosed_at: { type: "string", description: 'ISO date publicly disclosed. Time since disclosure matters for SLA. @example "2024-03-15"' },
@@ -12584,7 +12848,6 @@ var UPG_PROPERTY_SCHEMA = {
12584
12848
  // WireframeProperties: Wireframe.
12585
12849
  wireframe: {
12586
12850
  fidelity: { type: "string", enum: ["low", "medium", "high"], description: "Detail level" },
12587
- screen_name: { type: "string", description: "Represented screen name" },
12588
12851
  version: { type: "string", description: 'Version or iteration (e.g. "v2", "2026-04-B")' },
12589
12852
  tool: { type: "string", description: 'Authoring tool. @example "Figma", "Balsamiq", "pen and paper"' },
12590
12853
  review_status: { type: "string", enum: ["draft", "in_review", "approved", "rejected"], description: "Review gate status" },
@@ -28332,6 +28595,7 @@ var UPG_REGIONS = [
28332
28595
  "specification_competes_with_specification",
28333
28596
  "primitive_defined_by_specification",
28334
28597
  "primitive_composes_primitive",
28598
+ "operating_lifecycle_defined_by_specification",
28335
28599
  "operating_lifecycle_contains_operating_stage"
28336
28600
  ],
28337
28601
  boundary_edges: [
@@ -28871,7 +29135,7 @@ function isCanonical(text) {
28871
29135
  }
28872
29136
 
28873
29137
  // src/index.ts
28874
- var UPG_VERSION = "0.11.6";
29138
+ var UPG_VERSION = "0.12.1";
28875
29139
  var UPG_FORMAT_VERSION = "0.4.0";
28876
29140
  var MARKDOWN_FORMAT_VERSION = "0.1";
28877
29141
  var UPG_TYPES = getTypes();
@@ -29006,6 +29270,7 @@ var UPG_META_COUNT = UPG_ENTITY_META.length;
29006
29270
  UPG_REGION_COUNT,
29007
29271
  UPG_REGION_MAP,
29008
29272
  UPG_RELATIONSHIP_BENCHMARKS,
29273
+ UPG_SCALAR_TO_EDGE_MIGRATIONS,
29009
29274
  UPG_SCALES,
29010
29275
  UPG_SPLIT_MIGRATIONS,
29011
29276
  UPG_STATUS_MIGRATIONS,
@@ -29074,6 +29339,7 @@ var UPG_META_COUNT = UPG_ENTITY_META.length;
29074
29339
  getRegionForEntityType,
29075
29340
  getReplacementType,
29076
29341
  getRingForDomain,
29342
+ getScalarToEdgeMigrations,
29077
29343
  getScale,
29078
29344
  getSplitMigrations,
29079
29345
  getTreePattern,