{
  "step": "compose",
  "tool": "design_compose",
  "input": {
    "object": "Warehouse",
    "context": "detail",
    "preferences": {
      "brand": "Harbor",
      "theme": "light"
    }
  },
  "isError": false,
  "error": null,
  "output": {
    "status": "ok",
    "layout": "detail",
    "schema": {
      "version": "2026.02",
      "theme": "light",
      "screens": [
        {
          "id": "screen-detail-13",
          "component": "Stack",
          "layout": {
            "type": "stack",
            "gapToken": "cluster-default"
          },
          "children": [
            {
              "id": "detail-header-1",
              "component": "Stack",
              "layout": {
                "type": "stack",
                "align": "space-between",
                "gapToken": "stack-default"
              },
              "children": [
                {
                  "id": "detail-header-1-record-title",
                  "component": "DetailHeader",
                  "props": {
                    "titleField": "name",
                    "headingLevel": 1
                  }
                },
                {
                  "id": "screen-detail-13-record-summary",
                  "component": "Stack",
                  "layout": {
                    "type": "inline",
                    "gapToken": "cluster-tight"
                  },
                  "meta": {
                    "intent": "record-summary"
                  },
                  "children": [
                    {
                      "id": "screen-detail-13-record-summary-1",
                      "component": "StatusBadge",
                      "props": {
                        "tone": "lifecycle",
                        "statusField": "status",
                        "domain": "lifecycle"
                      }
                    }
                  ]
                },
                {
                  "id": "slot-header-2",
                  "component": "StatusTimeline",
                  "meta": {
                    "intent": "slot:header",
                    "label": "header"
                  },
                  "props": {
                    "field": "status",
                    "historyField": "state_history",
                    "statesParameter": "states",
                    "showActorId": true,
                    "showReason": true
                  }
                }
              ]
            },
            {
              "id": "detail-body-10",
              "component": "Card",
              "layout": {
                "type": "stack",
                "gapToken": "cluster-default"
              },
              "children": [
                {
                  "id": "detail-tabs-9",
                  "component": "Tabs",
                  "children": [
                    {
                      "id": "detail-tab-panel-3",
                      "component": "Stack",
                      "layout": {
                        "type": "stack",
                        "gapToken": "cluster-default"
                      },
                      "props": {
                        "label": "Details"
                      },
                      "children": [
                        {
                          "id": "detail-tabs-9-code-read-field",
                          "component": "Stack",
                          "children": [
                            {
                              "id": "detail-tabs-9-code-label",
                              "component": "Text",
                              "props": {
                                "as": "strong",
                                "content": "Code"
                              }
                            },
                            {
                              "id": "detail-tabs-9-code-value",
                              "meta": {
                                "intent": "read-only-field"
                              },
                              "component": "Text",
                              "props": {
                                "field": "code"
                              }
                            }
                          ]
                        },
                        {
                          "id": "slot-tab-4-17-read-field",
                          "component": "Stack",
                          "children": [
                            {
                              "id": "slot-tab-4-17-label",
                              "component": "Text",
                              "props": {
                                "as": "strong",
                                "content": "City"
                              }
                            },
                            {
                              "id": "slot-tab-4-17-value",
                              "meta": {
                                "intent": "read-only-field"
                              },
                              "component": "Text",
                              "props": {
                                "field": "city"
                              }
                            }
                          ]
                        },
                        {
                          "id": "detail-tabs-9-manager_email-read-field",
                          "component": "Stack",
                          "children": [
                            {
                              "id": "detail-tabs-9-manager_email-label",
                              "component": "Text",
                              "props": {
                                "as": "strong",
                                "content": "Manager email"
                              }
                            },
                            {
                              "id": "detail-tabs-9-manager_email-value",
                              "meta": {
                                "intent": "read-only-field"
                              },
                              "component": "Text",
                              "props": {
                                "field": "manager_email"
                              }
                            }
                          ]
                        },
                        {
                          "id": "detail-tabs-9-monthly_rent-read-field",
                          "component": "Stack",
                          "children": [
                            {
                              "id": "detail-tabs-9-monthly_rent-label",
                              "component": "Text",
                              "props": {
                                "as": "strong",
                                "content": "Monthly rent"
                              }
                            },
                            {
                              "id": "detail-tabs-9-monthly_rent-value",
                              "meta": {
                                "intent": "read-only-field"
                              },
                              "component": "PriceBadge",
                              "props": {
                                "amountField": "monthly_rent",
                                "currencyField": "currency"
                              }
                            }
                          ]
                        },
                        {
                          "id": "detail-tabs-9-currency-read-field",
                          "component": "Stack",
                          "children": [
                            {
                              "id": "detail-tabs-9-currency-label",
                              "component": "Text",
                              "props": {
                                "as": "strong",
                                "content": "Currency"
                              }
                            },
                            {
                              "id": "detail-tabs-9-currency-value",
                              "meta": {
                                "intent": "read-only-field"
                              },
                              "component": "Text",
                              "props": {
                                "field": "currency"
                              }
                            }
                          ]
                        },
                        {
                          "id": "detail-tabs-9-organization_id-read-field",
                          "component": "Stack",
                          "children": [
                            {
                              "id": "detail-tabs-9-organization_id-label",
                              "component": "Text",
                              "props": {
                                "as": "strong",
                                "content": "Organization"
                              }
                            },
                            {
                              "id": "detail-tabs-9-organization_id-value",
                              "meta": {
                                "intent": "read-only-field"
                              },
                              "component": "Text",
                              "props": {
                                "field": "organization_id"
                              }
                            }
                          ]
                        },
                        {
                          "id": "pg-status-timeline-kept-24-read-field",
                          "component": "Stack",
                          "children": [
                            {
                              "id": "pg-status-timeline-kept-24-label",
                              "component": "Text",
                              "props": {
                                "as": "strong",
                                "content": "Stock level"
                              }
                            },
                            {
                              "id": "pg-status-timeline-kept-24",
                              "component": "StatusBadge",
                              "props": {
                                "statusField": "stock_level",
                                "emphasis": "subtle",
                                "showIcon": false,
                                "domain": "lifecycle"
                              },
                              "meta": {
                                "intent": "read-only-field"
                              }
                            }
                          ]
                        },
                        {
                          "id": "slot-tab-1-6-read-field",
                          "component": "Stack",
                          "children": [
                            {
                              "id": "slot-tab-1-6-label",
                              "component": "Text",
                              "props": {
                                "as": "strong",
                                "content": "Units on hand"
                              }
                            },
                            {
                              "id": "slot-tab-1-6-value",
                              "meta": {
                                "intent": "read-only-field"
                              },
                              "component": "Text",
                              "props": {
                                "field": "units_on_hand"
                              }
                            }
                          ]
                        },
                        {
                          "id": "slot-tab-2-8-read-field",
                          "component": "Stack",
                          "children": [
                            {
                              "id": "slot-tab-2-8-label",
                              "component": "Text",
                              "props": {
                                "as": "strong",
                                "content": "Capacity units"
                              }
                            },
                            {
                              "id": "slot-tab-2-8-value",
                              "meta": {
                                "intent": "read-only-field"
                              },
                              "component": "Text",
                              "props": {
                                "field": "capacity_units"
                              }
                            }
                          ]
                        },
                        {
                          "id": "detail-tabs-9-created_at-read-field",
                          "component": "Stack",
                          "children": [
                            {
                              "id": "detail-tabs-9-created_at-label",
                              "component": "Text",
                              "props": {
                                "as": "strong",
                                "content": "Created at"
                              }
                            },
                            {
                              "id": "detail-tabs-9-created_at-value",
                              "meta": {
                                "intent": "read-only-field"
                              },
                              "component": "Text",
                              "props": {
                                "field": "created_at"
                              }
                            }
                          ]
                        },
                        {
                          "id": "pg-status-timeline-23-read-field",
                          "component": "Stack",
                          "children": [
                            {
                              "id": "pg-status-timeline-23-label",
                              "component": "Text",
                              "props": {
                                "as": "strong",
                                "content": "Updated at"
                              }
                            },
                            {
                              "id": "pg-status-timeline-23-value",
                              "meta": {
                                "intent": "read-only-field"
                              },
                              "component": "Text",
                              "props": {
                                "field": "updated_at"
                              }
                            }
                          ]
                        },
                        {
                          "id": "detail-tabs-9-last_event-read-field",
                          "component": "Stack",
                          "children": [
                            {
                              "id": "detail-tabs-9-last_event-label",
                              "component": "Text",
                              "props": {
                                "as": "strong",
                                "content": "Last event"
                              }
                            },
                            {
                              "id": "detail-tabs-9-last_event-value",
                              "meta": {
                                "intent": "read-only-field"
                              },
                              "component": "Text",
                              "props": {
                                "field": "last_event"
                              }
                            }
                          ]
                        },
                        {
                          "id": "detail-tabs-9-last_event_at-read-field",
                          "component": "Stack",
                          "children": [
                            {
                              "id": "detail-tabs-9-last_event_at-label",
                              "component": "Text",
                              "props": {
                                "as": "strong",
                                "content": "Last event at"
                              }
                            },
                            {
                              "id": "detail-tabs-9-last_event_at-value",
                              "meta": {
                                "intent": "read-only-field"
                              },
                              "component": "Text",
                              "props": {
                                "field": "last_event_at"
                              }
                            }
                          ]
                        }
                      ]
                    }
                  ],
                  "props": {
                    "ariaLabel": "Record details"
                  }
                }
              ]
            }
          ],
          "bindings": {
            "onEdit": "handleEdit",
            "onDelete": "handleDelete",
            "onViewTimeline": "handleViewTimeline"
          },
          "meta": {
            "label": "Warehouse"
          }
        }
      ],
      "objectSchema": {
        "status": {
          "type": "string",
          "required": true,
          "default": "planned",
          "examples": [
            "active"
          ],
          "description": "Current operating state of the warehouse.",
          "enum": [
            "planned",
            "active",
            "closed"
          ],
          "semanticType": "status.state"
        },
        "state_history": {
          "type": "StateTransition[]",
          "required": false,
          "examples": [
            [
              {
                "title": "Opened",
                "from": "planned",
                "to": "active",
                "at": "2026-03-02T08:00:00Z",
                "reason": "Site opened for orders"
              }
            ]
          ],
          "description": "The site's operating-state changes, oldest first.",
          "semanticType": "timeline.state_transition"
        },
        "allowed_transitions": {
          "type": "string[]",
          "required": false,
          "default": [],
          "description": "Materialized list of valid next states from the current status, computed from the\ntransitionRules parameter. When transitionRules is null (open model), this contains\nall states except the current one. Used by StatusSelector to disable invalid options\nand by StatusBadge to indicate available paths.\n",
          "semanticType": "status.navigation"
        },
        "created_at": {
          "type": "datetime",
          "required": true,
          "examples": [
            "2026-01-12T09:00:00Z"
          ],
          "description": "When the site was registered.",
          "semanticType": "audit.created_at"
        },
        "updated_at": {
          "type": "datetime",
          "required": false,
          "examples": [
            "2026-09-15T12:00:00Z"
          ],
          "description": "When the site's record last changed.",
          "semanticType": "audit.updated_at"
        },
        "last_event": {
          "type": "string",
          "required": false,
          "examples": [
            "restocked"
          ],
          "description": "Most recent recorded warehouse event.",
          "enum": [
            "opened",
            "restocked",
            "closed"
          ],
          "semanticType": "audit.event.type"
        },
        "last_event_at": {
          "type": "datetime",
          "required": false,
          "examples": [
            "2026-09-15T12:00:00Z"
          ],
          "description": "When the sample warehouse was last restocked.",
          "semanticType": "audit.event.timestamp"
        },
        "stock_level": {
          "type": "string",
          "required": true,
          "description": "Whether the location has room, is nearly full, or is full.",
          "enum": [
            "room_available",
            "nearly_full",
            "full"
          ],
          "semanticType": "inventory.stock.level"
        },
        "capacity_units": {
          "type": "integer",
          "required": true,
          "examples": [
            1200,
            800,
            2400
          ],
          "description": "How many units the location holds when it is full."
        },
        "units_on_hand": {
          "type": "integer",
          "required": true,
          "examples": [
            640,
            760,
            2400
          ],
          "description": "How many units are stored there now."
        },
        "warehouse_id": {
          "type": "uuid",
          "required": true,
          "description": "Unique identifier for the warehouse."
        },
        "name": {
          "type": "string",
          "required": true,
          "examples": [
            "Lakeside Distribution",
            "North Yard",
            "Harbor Cold Store",
            "Prairie Crossdock",
            "Riverbend Fulfillment",
            "Summit Parts Depot",
            "Bayview Returns Center",
            "Canal Street Annex",
            "Maple Grove Storage",
            "Eastgate Freight Hub"
          ],
          "description": "The warehouse's name.",
          "semanticType": "logistics.warehouse.name"
        },
        "code": {
          "type": "string",
          "required": true,
          "examples": [
            "MKE-01",
            "CHI-02",
            "DET-03",
            "DSM-04",
            "STL-05",
            "DEN-06",
            "OAK-07",
            "IND-08",
            "MSP-09",
            "CLE-10"
          ],
          "description": "Short site code printed on shipping labels."
        },
        "city": {
          "type": "string",
          "required": true,
          "examples": [
            "Milwaukee",
            "Chicago",
            "Detroit",
            "Des Moines",
            "St. Louis",
            "Denver",
            "Oakland",
            "Indianapolis",
            "Minneapolis",
            "Cleveland"
          ],
          "description": "City the warehouse is in."
        },
        "manager_email": {
          "type": "email",
          "required": false,
          "examples": [
            "mke-01.manager@harbor.example",
            "chi-02.manager@harbor.example",
            "det-03.manager@harbor.example",
            "dsm-04.manager@harbor.example",
            "stl-05.manager@harbor.example",
            "den-06.manager@harbor.example",
            "oak-07.manager@harbor.example",
            "ind-08.manager@harbor.example",
            "msp-09.manager@harbor.example",
            "cle-10.manager@harbor.example"
          ],
          "description": "Who runs the site day to day."
        },
        "monthly_rent": {
          "type": "number",
          "required": true,
          "examples": [
            12500.5,
            9800,
            15250.75,
            7400,
            11850.25,
            21000,
            18990.99,
            6250,
            9975.5,
            14300
          ],
          "description": "What the site costs each month, in major units of its currency.",
          "semanticType": "logistics.warehouse.rent",
          "money": {
            "currencyField": "currency"
          }
        },
        "currency": {
          "type": "string",
          "required": true,
          "description": "Currency the rent is paid in.",
          "enum": [
            "USD",
            "EUR",
            "GBP"
          ],
          "semanticType": "logistics.warehouse.currency"
        },
        "organization_id": {
          "type": "uuid",
          "required": false,
          "examples": [
            "5d0c6a2e-8f41-4b7a-9c3e-2a6f1b8d4e90"
          ],
          "description": "The organization operating this warehouse.",
          "semanticType": "logistics.warehouse.operator",
          "displayLabelField": "organization_name"
        },
        "organization_name": {
          "type": "string",
          "required": false,
          "examples": [
            "Harbor Logistics"
          ],
          "description": "The operating organization's name, shown in place of its id."
        }
      }
    },
    "schemaRef": "compose-d6072861",
    "schemaRefCreatedAt": "2026-10-08T15:03:14.084Z",
    "schemaRefExpiresAt": "2026-10-08T15:33:14.084Z",
    "compositionId": "cmp-c013f1ee92f9",
    "version": 1,
    "parentVersion": null,
    "operation": "compose",
    "head": "af36064f0f930eec023a3e02e0f1280cf8dbe8f7",
    "selections": [
      {
        "slotName": "header",
        "intent": "page-header",
        "selectedComponent": "DetailHeader",
        "explanation": "DetailHeader leads slot \"header\" because record title placed by the layout from the object's label field. The slot also renders StatusTimeline after it, in that order.",
        "candidates": [
          {
            "name": "DetailHeader",
            "reason": "record title placed by the layout from the object's label field"
          },
          {
            "name": "StatusTimeline",
            "reason": "view_extension placement"
          }
        ],
        "placedComponents": [
          "DetailHeader",
          "StatusTimeline"
        ]
      }
    ],
    "validation": {
      "status": "ok",
      "errors": [],
      "warnings": []
    },
    "warnings": [
      {
        "code": "OODS-V121",
        "message": "Object 'Warehouse' has maturity 'beta' — composed output may change.",
        "hint": "Consider using stable objects for production compositions."
      },
      {
        "code": "OODS-V117",
        "message": "Warehouse refines 6 fields its traits define, and its own definitions are used: lifecycle/Stateful (status, state_history); lifecycle/Timestampable (last_event, last_event_at, created_at, updated_at)."
      }
    ],
    "objectUsed": {
      "name": "Warehouse",
      "version": "1.0.0",
      "traits": [
        "lifecycle/Stateful",
        "lifecycle/Timestampable",
        "Stockable"
      ],
      "fieldsComposed": 19,
      "viewExtensionsApplied": {
        "list": 3,
        "detail": 5,
        "form": 1,
        "card": 2
      }
    },
    "meta": {
      "intentParsed": "Warehouse detail view",
      "layoutDetected": "context-inferred: detail (from context=\"detail\")",
      "slotCount": 1,
      "nodeCount": 48,
      "intentSynthetic": true,
      "warnings": [
        "Object 'Warehouse' has maturity 'beta' — composed output may change.",
        "Warehouse refines 6 fields its traits define, and its own definitions are used: lifecycle/Stateful (status, state_history); lifecycle/Timestampable (last_event, last_event_at, created_at, updated_at)."
      ],
      "intelligence": {
        "fieldsExpanded": true,
        "slotsExpanded": 2,
        "expansionReason": "Expanded from 3 to 5 tabs for 19 fields",
        "patternsApplied": 1,
        "patternGroups": [
          {
            "slotName": "tab-0",
            "patternId": "status-timeline",
            "compositeComponent": "StatusTimeline",
            "matchedFields": [
              "status",
              "updated_at"
            ],
            "confidence": 1
          }
        ],
        "fieldAffinityUsed": true
      }
    }
  }
}
